From nobody Mon Jul 29 06:20:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXSrm11ryz5RKFx; Mon, 29 Jul 2024 06:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXSrm0ZgKz40Mf; Mon, 29 Jul 2024 06:20:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722234008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J8q+f6Z9zWMy8GqKQCBi7PxHX/XRhBF9K80gHjXDZL0=; b=M7aMw/EsZVru1iMyrrjTMB8QQJlaDNqv/Ng/kFjBXTxUvpyTrLypwRP9uPmoUL5Sn+/acD EluNEXJRWLK/vANaB0mc32qSL0IV99XdSx2/Hxqze3KwR7105j0sV5XNq42OOV9ZGRojTB zl4ubCOahtpWmA3yIsxdWZGHQ0N/s4oAtxtWmiCdtToqw3b5S7dwpj1eaT2BFWNMsEu+Db j9RjlslPt+LVX0hEcpm34ZrzdzbB7fwSuHwq2xGGafY+gmASHA0hIwEiyrnAr3PSew1TOn 97S0uhQjK11nAuJa9suM0lZeB0o83GJnBrIA08JhU/UV8hx8pmrMabgxKlK8Qw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722234008; a=rsa-sha256; cv=none; b=RIbGbJVde189Ghwv7CX35Eh4OzfkbwWFKndnoSLgP3tsTDnHbAxttrJ7Rw1zqBcGu6YQJ1 YMa47lSRK86uijjdCnwic2JvhN/pAdMTMfi5W//SxaI7Ae9CWXCkQQQSvcAvZ9wgUbAZFh 1NVCWwT4GdQi4Z81f7OzJEGuIe9B8196jVbOCmt80nyvdNK3cQD4rW+dtRvHxqB7mo1lYi Rb32jz4O9cs7GNHQUI0JQ+P2++Zv34lCkgN+xG9GhvMmqsB8Pj/oFtRA7ii65PXYzfHNNj Q0MCqYcdR+QySc39X/u0NklTR3wAmaBNONCZVI5nPd3zSYwN5khpnMlFCvHCfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722234008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J8q+f6Z9zWMy8GqKQCBi7PxHX/XRhBF9K80gHjXDZL0=; b=fX7Ph7f0g3Ntf38ArLqFVBHABvoojpxKFo0lboCzfQ+vhQxb5s48r2olwy0Yb4mc0jDpii AvJfWRjjvrLeODzM+TxUGcCY6FaoKHklAhSlVIu39zZaEW87m4FCQCiIQAxIwxxa82JqLO LKmNfMJJ7Vo1OcJAKdhNbqhSwonel7o64/kRdV8TiSgHdVDruMFwyaQWVVuOOk1uBhzFxW p8E/XjQy+G2BqjJkWLt32/uOqHerMJabncCS1mONw8L126JXQUG8Q9lYtSPaQdJrq+XAkB wgaJ7rA8b55CPBpmRpSUvm4kOdGjPD1y1nI3fUEJ1yd1nN5zgM/AQWE9cLeoaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXSrm09lQzN0l; Mon, 29 Jul 2024 06:20: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 46T6K7hr053676; Mon, 29 Jul 2024 06:20:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46T6K7Fn053671; Mon, 29 Jul 2024 06:20:07 GMT (envelope-from git) Date: Mon, 29 Jul 2024 06:20:07 GMT Message-Id: <202407290620.46T6K7Fn053671@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: 954692a14402 - stable/14 - dhclient: Ignore SIP servers DHCP option defined in RFC 3361 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 954692a144026860579cc525b5aa824b75719d6a Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=954692a144026860579cc525b5aa824b75719d6a commit 954692a144026860579cc525b5aa824b75719d6a Author: Yuichiro NAITO AuthorDate: 2024-07-04 07:57:02 +0000 Commit: Michael Osipov CommitDate: 2024-07-29 06:19:41 +0000 dhclient: Ignore SIP servers DHCP option defined in RFC 3361 Ignore SIP servers dhcp option to shut up the warning message. This option is defined in the RFC 3361 and sent from NSD-G1000T router. PR: 280119 Reviewed by: jrm (mentor), brooks MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45873 (cherry picked from commit ac6dc5cde729a602252a0b80f82424861d2eb7b5) --- sbin/dhclient/dhclient.c | 1 + sbin/dhclient/dhcp.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 8179a5c34209..62e55eb4d01f 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2618,6 +2618,7 @@ check_option(struct client_lease *l, int option) case DHO_BOOTFILE_NAME: case DHO_DHCP_USER_CLASS_ID: case DHO_URL: + case DHO_SIP_SERVERS: case DHO_END: return (1); case DHO_CLASSLESS_ROUTES: diff --git a/sbin/dhclient/dhcp.h b/sbin/dhclient/dhcp.h index 300deb464238..99b69613934f 100644 --- a/sbin/dhclient/dhcp.h +++ b/sbin/dhclient/dhcp.h @@ -172,6 +172,7 @@ struct dhcp_packet { #define DHO_DHCP_USER_CLASS_ID 77 #define DHO_URL 114 #define DHO_DOMAIN_SEARCH 119 +#define DHO_SIP_SERVERS 120 #define DHO_CLASSLESS_ROUTES 121 #define DHO_END 255 From nobody Mon Jul 29 06:21:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXStt3v69z5RKCt; Mon, 29 Jul 2024 06:21:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXStt31mcz40X4; Mon, 29 Jul 2024 06:21:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722234118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUyTpmU3XyGgw3lOxAaR3ezrxnuLf14WgbE+IVom5ss=; b=BZy0a34ncqjQapzum4483lff2HFXjg+vz4JReGvTRx83CA5+ocQ5RNaPpdUgiLOqpaPUqC 6UGX9ADAPlp+ZLf0I+hNhlKB4SjHja+PDH23VYXN15ISAwGVN3uxpuwgINQ7VJ8QypxV98 /M6ustTFkft84Z3OUI3Aa9ErEBgYmktzSmqJMblvw6X+OURjHmJb4JGq7ff7DPqUpn8a7R v+eLgXBVBOagwMfBSL09iCV9W6yUlMU6P+Rpmg9Qck3Yk7ezh7deZiY8puId885G8k0Cbv 0c0KRpFTyX19Shk10QhNzXA8fjdiuRJPQyY1nrL8c0iYtbKzR665SuYqx0YJ/A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722234118; a=rsa-sha256; cv=none; b=Jxmgpk5bnFXNCzesVGX6ezTgH3PcqskQwz0RF0D3ix+tJEBAkzrTcOrgg6pZKWoMgF7V16 VySAbDVhzOKLhW9hMLy/Z+FTcOrOZuva3tsBEtBH2tZekHkTQFgKKEcElRcFn0zX4tFHOw bjKkmlQQxXAPu9ZW9+9899jH1X6Q+m4sktdljWEIWB5ah2olaCuajQdMXSef1WpQog3qd5 HIVRGrWaIFx2l47JriiamIEmJmMuYaY7TkncppRXHelo8pIAYRYILxDaaZt7AIpxyxqDEw n7jZC1ar6tOciS54Dxh0RF8d7t0bA+a1pXwZgvU/LHp7y+LUIh2bVniho5BM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722234118; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mUyTpmU3XyGgw3lOxAaR3ezrxnuLf14WgbE+IVom5ss=; b=DWelx8409A5ldQQGYgfDzh9rMJo8GyPfeIoE5DQAB8vB0CNhxSvVjAt41ubxQIjFGLVZ3+ HAAWqSY3X3Hyyl+SbvfZ4b7J/beaRyThrRhCrdks49sXy0j9rw7zhkOdEwUNlkGBie81cC gD8Heobx0/SmtpfcYrf5LIwPxls7IOOXSu9mkTyv5ynmhi7Hlpg9S2K1Q0Gcz3yF78IeeS y/H/J7Kez/0MCkb94QN8MB7loVdsl6kmqSlNPFA8Muc1CUClT2VQWuXHeWmRV+Q4mvEk9T ImIExkXCxHGayHHN8VDnNcN90AInNYrgMDMhaNnxAH4UMrwkb6XUe1d8yXrmZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXStt2dL0zNhf; Mon, 29 Jul 2024 06:21: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 46T6LwWI065751; Mon, 29 Jul 2024 06:21:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46T6Lw7M065748; Mon, 29 Jul 2024 06:21:58 GMT (envelope-from git) Date: Mon, 29 Jul 2024 06:21:58 GMT Message-Id: <202407290621.46T6Lw7M065748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov Subject: git: e5236f640510 - stable/13 - dhclient: Ignore SIP servers DHCP option defined in RFC 3361 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5236f64051056eb933c6a53f6f6c2bab62f308a Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=e5236f64051056eb933c6a53f6f6c2bab62f308a commit e5236f64051056eb933c6a53f6f6c2bab62f308a Author: Yuichiro NAITO AuthorDate: 2024-07-04 07:57:02 +0000 Commit: Michael Osipov CommitDate: 2024-07-29 06:21:34 +0000 dhclient: Ignore SIP servers DHCP option defined in RFC 3361 Ignore SIP servers dhcp option to shut up the warning message. This option is defined in the RFC 3361 and sent from NSD-G1000T router. PR: 280119 Reviewed by: jrm (mentor), brooks MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45873 (cherry picked from commit ac6dc5cde729a602252a0b80f82424861d2eb7b5) --- sbin/dhclient/dhclient.c | 1 + sbin/dhclient/dhcp.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index e7557c4b0bf7..1bdd0eb68f8f 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2609,6 +2609,7 @@ check_option(struct client_lease *l, int option) case DHO_BOOTFILE_NAME: case DHO_DHCP_USER_CLASS_ID: case DHO_URL: + case DHO_SIP_SERVERS: case DHO_END: return (1); case DHO_CLASSLESS_ROUTES: diff --git a/sbin/dhclient/dhcp.h b/sbin/dhclient/dhcp.h index 300deb464238..99b69613934f 100644 --- a/sbin/dhclient/dhcp.h +++ b/sbin/dhclient/dhcp.h @@ -172,6 +172,7 @@ struct dhcp_packet { #define DHO_DHCP_USER_CLASS_ID 77 #define DHO_URL 114 #define DHO_DOMAIN_SEARCH 119 +#define DHO_SIP_SERVERS 120 #define DHO_CLASSLESS_ROUTES 121 #define DHO_END 255 From nobody Mon Jul 29 15:35:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9D0Q2Wz5RSgP; Mon, 29 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9C71RVz41q0; Mon, 29 Jul 2024 15: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=1722267312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiuSmhtM32+5ximDjCoK9x3CKoUHPbpM+tzfedIMNgg=; b=BV4SaV1J57Xlz9k48H60Kn6/6/S+nRq3vb2+U5gKkcySupRt6sx5aSt4yRo3MD3sZ/9c3n PCl0n2QDed0Ia4vyZVTakvxepwdS9QGixBbcln74+dX6QBqSHb5wrsxYm8IftPQDmfCH/G bfjnnMEJH9u80ELrk2x0eclvrOpXAUDOeL6qsDY+O/+extYZJeRH53IGLzenUV3OhoLBFn vwGpnnOehXmYfDUD5C5S6b6V+XhEHM+AI5+cmEulMSrfGc1X2xEfB3KAHiNPr/bdyQeVX1 kMSm2mzJArrZkEnws0egHoPFAfTaY6QB8R6x2sf0nMJ6NLinFdIRBLSUegpJAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267312; a=rsa-sha256; cv=none; b=xwH99zB38sEFP5f0J6dmMwx7WpOn9PPNjF+NLZhUn2GTj2ULrEcg4v8ON4OfxioST/rZ3O zUe/Q1ExZrVT33ibdk28hnm9Dq7GjHj3wzj9oycJ3iKcc6h4IO93yXKaAjP8NAbW7YBDsa qWh7qYH/+ubbtBryJpxmf6kabGgrm/N6i/cD/qt1FsRXnwdlo/DU5AMGmfvbj2rRVc041O 7Xj3PACjRXEs5R++9qZjUBIWQ2GsqCSAKXYXNTtPcEc41SK/IqgQGBvXEsbaftff32vTfb wV3sBh1DqmtnrHLn3NUNowq6urnnEASTrXtweOJy+SR72Pdr4R70vClaUMNmpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NiuSmhtM32+5ximDjCoK9x3CKoUHPbpM+tzfedIMNgg=; b=H7sEUw7s0JqIQkCsJIadCN1MdBDz6TptbsNGMS86VmTYecEPZNDkVPXJv7XQU4yoP1c/F1 a30P51PbCBjSfeaEhOAX79xqQgnI0ax7EDXiRoFKE5Njoug2ckTTtIBhMwCN3cnNie4Wbl 8YN4Fup+ic1nprrCbxFlBTt6A/Z3SPyhn9QY6Ud5KaG145yvMGoDNmfESnh/RZJpHMAsGk 8iLSpK4d01ptx3k61M6ix/WqqH8IJcWfYl6pZB5DBB9RqDM0g1+GjKE+kBy+44XO1IGRrC FtJqlLIfW20QJ19N4aDw6DmmIk1yC59HWaNEDjYiIFbFY+7aG5bwchXIvm3fLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9C6cmTzgSt; Mon, 29 Jul 2024 15: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 46TFZBR2002051; Mon, 29 Jul 2024 15: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 46TFZBVC002048; Mon, 29 Jul 2024 15:35:11 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:11 GMT Message-Id: <202407291535.46TFZBVC002048@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: 894edb7cb133 - stable/14 - sound: Add device status string to sndstat nvlist List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 894edb7cb133e07c45639b5d478a7d4803748385 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=894edb7cb133e07c45639b5d478a7d4803748385 commit 894edb7cb133e07c45639b5d478a7d4803748385 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:14 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:53 +0000 sound: Add device status string to sndstat nvlist Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46163 (cherry picked from commit 810530aa2648812860e84d951d9cf96dfd24e595) --- share/man/man4/sndstat.4 | 6 +++++- sys/dev/sound/pcm/sndstat.c | 1 + sys/sys/sndstat.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index f638fc6834fe..66c1b6e8402d 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -29,7 +29,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd June 5, 2024 +.Dd July 26, 2024 .Dt SNDSTAT 4 .Os .Sh NAME @@ -74,6 +74,7 @@ dsps (NVLIST ARRAY): 1 max_chn (NUMBER): 2 provider_info (NVLIST): unit (NUMBER): 0 + status (STRING): on hdaa0 bitperfect (BOOL): FALSE pvchan (NUMBER): 1 rvchan (NUMBER): 0 @@ -169,6 +170,9 @@ provider, there are a number of name/value pairs inside this field: .Bl -tag -width ".Dv channel_info" .It Dv unit Sound card unit. +.It Dv status +Status string. +Usually reports the driver the device is attached on. .It Dv bitperfect Whether the sound card has bit-perfect mode enabled. .It Dv pvchan diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 753531f3694e..fda7a2ad6d48 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -440,6 +440,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_UNIT, device_get_unit(d->dev)); // XXX: I want signed integer here + nvlist_add_string(sound4di, SNDST_DSPS_SOUND4_STATUS, d->status); nvlist_add_bool( sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount); diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 6fef6502ec89..2f2965bb3d05 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -70,6 +70,7 @@ struct sndstioc_nv_arg { */ #define SNDST_DSPS_SOUND4_PROVIDER "sound(4)" #define SNDST_DSPS_SOUND4_UNIT "unit" +#define SNDST_DSPS_SOUND4_STATUS "status" #define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" From nobody Mon Jul 29 15:35:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9F1YWQz5RScn; Mon, 29 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9F0wBtz41q1; Mon, 29 Jul 2024 15: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=1722267313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff+NYUF3s2YZEzK5hpluM70ntq/WxTAJuftthxmkAR0=; b=luGl9WtVYGUwGEvTU2QbGsQaLvsN5Sp9Gx6wOnA+Hij2ldCITvfF1Rq7t4y1gF3MjyVPo7 TWbbcOBAHuHWXUWix1M45hM8fiRj6vQfmuxdvJyBXyI65xal7Hcar68xvhydVh3xXZI5Pw pwHs4etHqcEXtWkABV1INK0tbX8O5KFpuvZacmGBhJ+JB57A0S/v8JT56iNbfosc8EvWuk b+lFty4+6uOvhhZZ7mcQs6US2mEx0wzVnz/stEMjtx+ylPdFLqXZ84u4cHGBzePsTG4WCj FlR8E1528mcfL8P8FnC3BfrNr/CPU7yIcRcB+eAXOaqxz2LyJ8YfvC0NQi++Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267313; a=rsa-sha256; cv=none; b=jjbmSYG8k1P3BhvHnfAdawB7FnrMrfs8EmY8LhCr1UcAIZ96NilWxuflfYzhOTky/sm6vz HAhYasGHKnqH76fSec/cJ2MKuumSL2+DJPhwyXU6urKvVsDyi3PlL8ly+uKJhNIOroyr4Q n1HNf/jroE6uQX7AXraz1xol9erQyc47mxc07Djl6yO/FxdQuQYHOHtjFEm4eMQkvPdZDy UOsbT/qHdKe1aTi97tN+6ZcMUayArJ7j8o2rj3lROwA5k+0kf9pq/a1AcvKu1PRI23E/7/ IdEDs54RsXTABcvsUOtDGu9QS/mhLlYBDuEmgpclAT55gwAGIA2955hI40kpqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ff+NYUF3s2YZEzK5hpluM70ntq/WxTAJuftthxmkAR0=; b=V4AUckIzRd47qRs94nW1oBqTgzLulCWzDD6A9ZxHPWWieL2FoKLjpKEe2roG1bYXPv7WQc YVOZTV2sbxy1Y7ImAZw1G+OqcBEKKpvPNS4Iej+9xAc9HMJoz8hW/8RQy0LscHJNo5E9Q6 EhOZ7lN98CtfqtgL5CD1sN1QVZYQ3PJaCNDDZzc96FiAkaVbpRwMgLOQw6Qi8huii8Rjjh 9I9is7qCzbAktXgSeuNj6h1Yhpunwb58vlVJwQMuCHPnobqhqNcsAh2iMLsupweV1pYd3h dOmqwNFU/cpRAgHh9aa6LzlBWmkm5l96zvTfmISAr9cEfDv4VGUoTDfaW2hQiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9F0WXnzgDF; Mon, 29 Jul 2024 15: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 46TFZCWN002108; Mon, 29 Jul 2024 15: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 46TFZCip002105; Mon, 29 Jul 2024 15:35:12 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:12 GMT Message-Id: <202407291535.46TFZCip002105@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: 08c1cf0b5221 - stable/14 - sound: Add *vchanrate and *vchanformat to sndstat nvlist List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 08c1cf0b5221a4d7581f7c3e0319c5e36300b49b Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=08c1cf0b5221a4d7581f7c3e0319c5e36300b49b commit 08c1cf0b5221a4d7581f7c3e0319c5e36300b49b Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:21 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound: Add *vchanrate and *vchanformat to sndstat nvlist Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46164 (cherry picked from commit a6283717577066b0ff6c62053145470ff4134051) --- share/man/man4/sndstat.4 | 12 ++++++++++++ sys/dev/sound/pcm/sndstat.c | 8 ++++++++ sys/sys/sndstat.h | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 66c1b6e8402d..7c2813356dae 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -77,7 +77,11 @@ dsps (NVLIST ARRAY): 1 status (STRING): on hdaa0 bitperfect (BOOL): FALSE pvchan (NUMBER): 1 + pvchanrate (NUMBER): 48000 + pvchanformat (NUMBER): 0x00000010 rvchan (NUMBER): 0 + rvchanrate (NUMBER): 48000 + rvchanformat (NUMBER): 0x00000010 channel_info (NVLIST_ARRAY): 1 name (STRING): pcm0:virtual_play:dsp0.vp0 parentchan (STRING): pcm0:play:dsp0.p0 @@ -177,8 +181,16 @@ Usually reports the driver the device is attached on. Whether the sound card has bit-perfect mode enabled. .It Dv pvchan Number of playback virtual channels. +.It Dv pvchanrate +Playback virtual channel sample rate. +.It Dv pvchanformat +Playback virtual channel format. .It Dv rvchan Number of recording virtual channels. +.It Dv rvchanrate +Recording virtual channel sample rate. +.It Dv rvchanformat +Recording virtual channel format. .It Dv channel_info Channel information. There are a number of name/value pairs inside this field: diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index fda7a2ad6d48..b0d2c5b6ca21 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -444,7 +444,15 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_bool( sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANRATE, + d->pvchanrate); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANFORMAT, + d->pvchanformat); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHAN, d->rvchancount); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANRATE, + d->rvchanrate); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANFORMAT, + d->rvchanformat); nchan = 0; CHN_FOREACH(c, d, channels.pcm) { diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 2f2965bb3d05..f7d0b2f29bd5 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -73,7 +73,11 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_STATUS "status" #define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" +#define SNDST_DSPS_SOUND4_PVCHANRATE "pvchanrate" +#define SNDST_DSPS_SOUND4_PVCHANFORMAT "pvchanformat" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" +#define SNDST_DSPS_SOUND4_RVCHANRATE "rvchanrate" +#define SNDST_DSPS_SOUND4_RVCHANFORMAT "rvchanformat" #define SNDST_DSPS_SOUND4_CHAN_INFO "channel_info" #define SNDST_DSPS_SOUND4_CHAN_NAME "name" #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" From nobody Mon Jul 29 15:35:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9G3LNGz5RSV0; Mon, 29 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9G1j5lz41qC; Mon, 29 Jul 2024 15: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=1722267314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=53Eim3fp0j37lM/GVAndkJIB7nPfoXFApCpq+XjSd6g=; b=QQ4NmqcEI5uAZ0UE5LVgkoPInEPDcs+aOjP/y1JzdNCkgJPkUk+oGnPoOOLFIpYaOfS0Rv IOZSjYkw/rdWcKhT0g72pb09SUfMcpkjXMKVHo32WQSnctoyuxcbGL+D3XoiT9uss1sV7y +2cTD21pZdOfm3NsaSSp8eTQcudzAqgFon9Fn2Clwp2XQgwmmrdFLVVnx7WAGI1gJlrWOD KbJzuifvYTIsTm2/oJrghf2WfJLJxhI8vAw2hypj/h4wXguhiLduoM+J3y0pO0Ayp+8YIK +ZGB5mGDe7ek9ZSf9+rdhXIcj6zYETjTqz6rhRhIddrc8jbJor1Zh+/BAFRr1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267314; a=rsa-sha256; cv=none; b=skHeqfF1I/uRGnQjwgmn53X/54bkIWRbil/I+SXW49AV7P1ZoSJZs8HQSX59zvhGgm5Z47 voN2QNmS0uJ0TXBl4m5asWMlC9fuW1WsFnNI/ykWJjkehVuO1tVJCaJghGDDx1OH9OJKxw LrRIpQtxKT3e+Qv1jkeFqrSCYM5KCYDU1R9uAHMfrFXzNSq5ESVbKvUqUGoIpiPlcAZmay znLezuOzxoPzYWgDT1vYm4+VW5NGO9LveHdBTnF85gx8cEPO1alTEY5P3WEh3m5KkTOFR/ htTwhwfDeEpmk2mRYVqtR7lQIMarQUt62OIuk0xg59FoJX0mQxflVnaFtQJAow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=53Eim3fp0j37lM/GVAndkJIB7nPfoXFApCpq+XjSd6g=; b=HXKGuiAo0rilkQqcfhvJZOsi/SO5VqaIZ7fHQS8T3mkzxeGWD7BcxhytmaudE9VfZFjllK XUxGQr6B+p7l8hCP4BtYyuGiMob14Rn9+fS00T23MqJBWwiB1HLTkIVupRI6Dq4pD5Sm/A TqdHFA3qN9drHw7EyC0O4iY3T8bDESkurPIEm9PDu72p02nR7QV0n4KpF7JI+oo+sMC4RZ kh91/sBOMuVWIRzkJ3aXxzoDb4BhJ0niaR3VXAkM90ZEUlth3EaMRolwZNzFang5avWH/j Cu1ecjqPJClXVEoqRV8elynBStZOjm754JSlzE3hNd6hO5kXOSP+Q2y223iccQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9G1GnhzgQN; Mon, 29 Jul 2024 15: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 46TFZEhg002159; Mon, 29 Jul 2024 15: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 46TFZEKt002156; Mon, 29 Jul 2024 15:35:14 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:14 GMT Message-Id: <202407291535.46TFZEKt002156@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: 188d619e4569 - stable/14 - sound: Add OSS channel capabilities to sndstat nvlist List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 188d619e45692c491158c63cdb468a8ad6912224 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=188d619e45692c491158c63cdb468a8ad6912224 commit 188d619e45692c491158c63cdb468a8ad6912224 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:27 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound: Add OSS channel capabilities to sndstat nvlist Assignment taken from dsp_oss_engineinfo(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46166 (cherry picked from commit bd5bcc848c5764229926ad27a4bd77af4f87d189) --- share/man/man4/sndstat.4 | 3 +++ sys/dev/sound/pcm/sndstat.c | 7 ++++++- sys/sys/sndstat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 7c2813356dae..bef444529e5f 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -86,6 +86,7 @@ dsps (NVLIST ARRAY): 1 name (STRING): pcm0:virtual_play:dsp0.vp0 parentchan (STRING): pcm0:play:dsp0.p0 unit (NUMBER): 1 + caps (NUMBER): 0x073200 latency (NUMBER): 2 rate (NUMBER): 48000 format (NUMBER): 0x201000 @@ -201,6 +202,8 @@ Channel name. Parent channel name (e.g., in the case of virtual channels). .It Dv unit Channel unit. +.It Dv caps +OSS capabilities. .It Dv latency Latency. .It Dv rate diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index b0d2c5b6ca21..f09fa7139884 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -385,7 +385,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) struct pcm_channel *c; struct pcm_feeder *f; struct sbuf sb; - uint32_t maxrate, minrate, fmts, minchn, maxchn; + uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; @@ -467,10 +467,15 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) CHN_LOCK(c); + caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((c->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | + ((c->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); + nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_NAME, c->name); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_PARENTCHAN, c->parentchannel != NULL ? c->parentchannel->name : ""); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_UNIT, nchan++); + nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_CAPS, caps); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_LATENCY, c->latency); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_RATE, c->speed); diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index f7d0b2f29bd5..6fd2e06ac483 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -82,6 +82,7 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_CHAN_NAME "name" #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" #define SNDST_DSPS_SOUND4_CHAN_UNIT "unit" +#define SNDST_DSPS_SOUND4_CHAN_CAPS "caps" #define SNDST_DSPS_SOUND4_CHAN_LATENCY "latency" #define SNDST_DSPS_SOUND4_CHAN_RATE "rate" #define SNDST_DSPS_SOUND4_CHAN_FORMAT "format" From nobody Mon Jul 29 15:35:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9H5tYSz5RSZV; Mon, 29 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9H2gYTz428F; Mon, 29 Jul 2024 15: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=1722267315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYqiLDzuMPr+MLddVb1WTD7nWY3yUPp8eTtIWP069es=; b=bhg22PMcG1c4JK2RHSe9qanLG/WyB4vHrnknGLEai8PyQECzhtvV6n9ZKUzqdPv+69J5Ba /a3rYc2+Jzn75fBTtj3wIsZroBgepHV7juEHlt0NtBu/+RreY2tl/Xpmnyug2x2U0nIrEt tOwoT38XO1Wc5ItMaIfGLNnoO60DEi6bh1gwFwehc4fp9fASE5Kp4tBL2O1ynhzAr1m3ns gyVakgD2ZT/3357YY8LsiJrzyYl1PrzCfNUz+KK5wGIwzW1roOlZwcPcT5+Cbla1vgwd1I F4gzI9YMZDwhiGhhP7HE7s+k9v5sl78f4LETJ7BMvpoWoAufBDm26C2nMY+1uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267315; a=rsa-sha256; cv=none; b=E6f4jYmHw5F8kRF8MY7hEsfN2h9YtV8vold8VFzvcp1jDrkrwgG6jDUWI/2u290/wzYSjO EZ9V+5+IN5qMhGEsXznwbIvYd38ZuOtj7HJQQI9DaL07vLsX4xvJw2F0mNGufQVKUKQedA f/MNo6tfZxlS8MfpmlfxRfpp+HHHYndDmEEu1i967n5nNVgeE1Vr+gTbKrWox0h5Wj0bmd IoaLSzxHuLFg/E71pUurKzYqVsafAT40vernafberup8Fi+XzM3VSMMnum10OtWMVJS5eM 7SsGhRKKzc90H/UngX6Jm86aNKLuL45SCqhYucNy/fwtVyUrBATE/OTmWffa8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KYqiLDzuMPr+MLddVb1WTD7nWY3yUPp8eTtIWP069es=; b=TVObrC2Rd47LdWJLewXdIoCPBRy/zQs0u1KKYzohwzIDKevWgcU6m24ItmSrT1N3me4CGO h5VOEAhD3ccbCNp0BcVXi0Q8+b/37MP1sI9kqcm7NHlrnkE92DpuPkminxxbtxMnADn/zr wyztfofd9/DGn5gpNKZeBxKzWqgq2UU35/EPuSaX9BbCejuSQLluXLtFYktw7XcduCQN6v UGB3Oqfl0ey5B4apm2CArDhOUZj4T+JQf5d2EE3h2Leo6uXiiEK8Upw0y2rG9Y1H4Ym0de duMUj4alqkcWttIev1bLOTnxxcA5hb3vy3w5H+W1KROEpCdBo5/JChcucGW24g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9H29GzzgSv; Mon, 29 Jul 2024 15: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 46TFZFn2002206; Mon, 29 Jul 2024 15: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 46TFZFeA002203; Mon, 29 Jul 2024 15:35:15 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:15 GMT Message-Id: <202407291535.46TFZFeA002203@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: d8c42c34176a - stable/14 - sound examples: Organize files in directories List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: d8c42c34176ad9a34ffc343acaa093bbd840e523 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d8c42c34176ad9a34ffc343acaa093bbd840e523 commit d8c42c34176ad9a34ffc343acaa093bbd840e523 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:35 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound examples: Organize files in directories More examples will be added, so it's better to be organized. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45968 (cherry picked from commit cb00491fbc51751fe166056cc69e23beeb26fee4) --- share/examples/Makefile | 11 +++++++---- share/examples/sound/{ => oss}/README | 0 share/examples/sound/{ => oss}/basic.c | 0 share/examples/sound/{ => oss}/midi.c | 0 share/examples/sound/{ => oss}/ossinit.h | 0 share/examples/sound/{ => oss}/ossmidi.h | 0 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 06d10a0bc149..9cd64cc2a3bd 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -310,12 +310,15 @@ SE_SCSI_TARGET= \ scsi_cmds.c SE_DIRS+= sound -SE_SOUND= \ +SE_SOUND= + +SE_DIRS+= sound/oss +SE_SOUND_OSS= \ + README \ basic.c \ - ossinit.h \ - ossmidi.h \ midi.c \ - README + ossinit.h \ + ossmidi.h SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/README b/share/examples/sound/oss/README similarity index 100% rename from share/examples/sound/README rename to share/examples/sound/oss/README diff --git a/share/examples/sound/basic.c b/share/examples/sound/oss/basic.c similarity index 100% rename from share/examples/sound/basic.c rename to share/examples/sound/oss/basic.c diff --git a/share/examples/sound/midi.c b/share/examples/sound/oss/midi.c similarity index 100% rename from share/examples/sound/midi.c rename to share/examples/sound/oss/midi.c diff --git a/share/examples/sound/ossinit.h b/share/examples/sound/oss/ossinit.h similarity index 100% rename from share/examples/sound/ossinit.h rename to share/examples/sound/oss/ossinit.h diff --git a/share/examples/sound/ossmidi.h b/share/examples/sound/oss/ossmidi.h similarity index 100% rename from share/examples/sound/ossmidi.h rename to share/examples/sound/oss/ossmidi.h From nobody Mon Jul 29 15:35:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9J5Q9Nz5RSgV; Mon, 29 Jul 2024 15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9J3dzHz424Z; Mon, 29 Jul 2024 15: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=1722267316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YckXuzm0og7mekEoNJvDEGUCYj5XSKrcwhyYmkYVlJg=; b=NmdV8t74yM48kX42tsLUIRYBHmAnSEY7GgNQajAnOosskeoJ2eVS2VVeTuFyXrhoFTCxXR mFvh30Fa0hTUqTZVB+P30ku0klwvQ78VTBM9fBohbFGK3f3Z7iHz0kTn3RW450rTN9OTM0 6hzu+/ABoxNpI7Pdjn+gGjRve9+UBgp4rFvGiUAalEk6BpzcK6ErOSPIftCehvcjsLIqvF /QGkX8Yv7mplSU/joR25GHh4L3bWrlk4pDF3vrqJ2cAF6+2YvZ470032OodQ3sUPQZD9zr bKW/EQiNSvmRiEyq+ySjG/qyaxQVIxRhnDMK1YEQ25nYeohSPgtfCqnAY9J8kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267316; a=rsa-sha256; cv=none; b=ieMVcibZAmkpIkrq5EeKuPLmgpgO9wSqZpXnwZzg5GtV6xz0GZDRt/bL+QwCrfIOFUHLpX LqzFPnBc0NIWYl/nPTn0ygyw/2RUtqUFOSwrVs2xSyXcytxmvp3Nt5kjp1zII+mW0HhF7H ooniQ9cudxubu0LcrprDt28nUp8R0IkZ8xQxBA8FvnwkeuEqYtgEiVA/JlKcQbvhYYH5aT 2hkyZZynopnmqBqWNHnXgP0mmj1Y0efxKrscOjShFP8MB/3vHeGPZmPxJ4JnGvu/6Q/LIx E+ZL7rF5rdbfVEf+AjCEOKO0mhwvxKmrGVEgGVXxfEpnCkS687OVUAMxgYtpEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YckXuzm0og7mekEoNJvDEGUCYj5XSKrcwhyYmkYVlJg=; b=HTbQtr9Nnl+iFU7aBlxcXBz1hGrvCJ7vF2YKYIX2gnKvp8G18S9Y6PwTc58ktQX+0R2Y2u wlgfwGa/rCfozelDX0HU1FC+mxRAeGvqyk69TMnuP6sZ68HflU7Yq8jjLSm0sLHJpT3XkR IW9/n0I4akmT6bvLsiHMBMX6Q2/UTKIH97LODnjadApQ1wQiDjGKxJu/IdF7d+7/Q81uYr a0uRVs1LgWQzpYGiTjcniyofMrlyxWocKosNjtAgzG8v79IAJJDUcDdzdF1+RWBMgrnzkX D2FmkVEUj6AyqOBma5s8QCH3PSQmsDeXqe7rE2CuLAybrbvx4Vgbn6DWUYmr2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9J3CqXzg0w; Mon, 29 Jul 2024 15: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 46TFZGeo002254; Mon, 29 Jul 2024 15: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 46TFZG7o002251; Mon, 29 Jul 2024 15:35:16 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:16 GMT Message-Id: <202407291535.46TFZG7o002251@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: b4a9d6c8faf5 - stable/14 - sound examples: Add sndstat nvlist example List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: b4a9d6c8faf5eb5c769476f06c05134a9d3eff89 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a9d6c8faf5eb5c769476f06c05134a9d3eff89 commit b4a9d6c8faf5eb5c769476f06c05134a9d3eff89 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:40 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound examples: Add sndstat nvlist example Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45969 (cherry picked from commit f08ecd24a19ba772701fc35caaad92b9fe91fa9c) --- share/examples/Makefile | 3 +- share/examples/sound/sndstat_nv.c | 206 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 9cd64cc2a3bd..1fbc74f51083 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -310,7 +310,8 @@ SE_SCSI_TARGET= \ scsi_cmds.c SE_DIRS+= sound -SE_SOUND= +SE_SOUND= \ + sndstat_nv.c SE_DIRS+= sound/oss SE_SOUND_OSS= \ diff --git a/share/examples/sound/sndstat_nv.c b/share/examples/sound/sndstat_nv.c new file mode 100644 index 000000000000..1056c1f4a08f --- /dev/null +++ b/share/examples/sound/sndstat_nv.c @@ -0,0 +1,206 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 +#include + +/* + * Example program showcasing how to use sndstat(4)'s nvlist interface, and how + * to fetch all currently supported fields, with the appropriate error checks. + * + * For more detailed information on what each nvlist field represents, please + * read sndstat(4)'s man page. + */ + +int +main(int argc, char *argv[]) +{ + nvlist_t *nvl; + const nvlist_t * const *di; + const nvlist_t * const *cdi; + struct sndstioc_nv_arg arg; + size_t nitems, nchans, i, j; + int fd, pchan, rchan; + + if ((fd = open("/dev/sndstat", O_RDONLY)) < 0) + err(1, "open(/dev/sndstat)"); + + if (ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL) < 0) + err(1, "ioctl(SNDSTIOC_REFRESH_DEVS)"); + + arg.nbytes = 0; + arg.buf = NULL; + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0) + err(1, "ioctl(SNDSTIOC_GET_DEVS#1)"); + + if ((arg.buf = malloc(arg.nbytes)) == NULL) + err(1, "malloc"); + + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0) + err(1, "ioctl(SNDSTIOC_GET_DEVS#2)"); + + if ((nvl = nvlist_unpack(arg.buf, arg.nbytes, 0)) == NULL) + err(1, "nvlist_unpack"); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + errx(1, "no soundcards attached"); + + di = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item) \ + nvlist_get_ ## type (di[i], SNDST_DSPS_ ## item) + printf("nameunit=%s\n", NV(string, NAMEUNIT)); + printf("\tfrom_user=%d\n", NV(bool, FROM_USER)); + printf("\tdevnode=%s\n", NV(string, DEVNODE)); + printf("\tdesc=%s\n", NV(string, DESC)); + printf("\tprovider=%s\n", NV(string, PROVIDER)); + printf("\tpchan=%d\n", (int)NV(number, PCHAN)); + printf("\trchan=%d\n", (int)NV(number, RCHAN)); + pchan = NV(number, PCHAN); + rchan = NV(number, RCHAN); +#undef NV + + if (pchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_PLAY)) + errx(1, "playback channel list empty"); + if (rchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_REC)) + errx(1, "recording channel list empty"); + +#define NV(type, mode, item) \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item) + if (pchan) { + printf("\tplay_min_rate=%d\n", + (int)NV(number, PLAY, MIN_RATE)); + printf("\tplay_max_rate=%d\n", + (int)NV(number, PLAY, MAX_RATE)); + printf("\tplay_formats=%#08x\n", + (int)NV(number, PLAY, FORMATS)); + printf("\tplay_min_chn=%d\n", + (int)NV(number, PLAY, MIN_CHN)); + printf("\tplay_max_chn=%d\n", + (int)NV(number, PLAY, MAX_CHN)); + } + if (rchan) { + printf("\trec_min_rate=%d\n", + (int)NV(number, REC, MIN_RATE)); + printf("\trec_max_rate=%d\n", + (int)NV(number, REC, MAX_RATE)); + printf("\trec_formats=%#08x\n", + (int)NV(number, REC, FORMATS)); + printf("\trec_min_chn=%d\n", + (int)NV(number, REC, MIN_CHN)); + printf("\trec_max_chn=%d\n", + (int)NV(number, REC, MAX_CHN)); + } +#undef NV + + if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) + continue; + +#define NV(type, item) \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item) + printf("\tunit=%d\n", (int)NV(number, UNIT)); + printf("\tstatus=%s\n", NV(string, STATUS)); + printf("\tbitperfect=%d\n", NV(bool, BITPERFECT)); + printf("\tpvchan=%d\n", (int)NV(number, PVCHAN)); + printf("\tpvchanrate=%d\n", (int)NV(number, PVCHANRATE)); + printf("\tpvchanformat=%#08x\n", (int)NV(number, PVCHANFORMAT)); + printf("\trvchan=%d\n", (int)NV(number, RVCHAN)); + printf("\trvchanrate=%d\n", (int)NV(number, RVCHANRATE)); + printf("\trvchanformat=%#08x\n", (int)NV(number, RVCHANFORMAT)); +#undef NV + + if (!nvlist_exists(nvlist_get_nvlist(di[i], + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_CHAN_INFO)) + errx(1, "channel info list empty"); + + cdi = nvlist_get_nvlist_array( + nvlist_get_nvlist(di[i], SNDST_DSPS_PROVIDER_INFO), + SNDST_DSPS_SOUND4_CHAN_INFO, &nchans); + for (j = 0; j < nchans; j++) { +#define NV(type, item) \ + nvlist_get_ ## type (cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item) + printf("\tchan=%s\n", NV(string, NAME)); + printf("\t\tparentchan=%s\n", NV(string, PARENTCHAN)); + printf("\t\tunit=%d\n", (int)NV(number, UNIT)); + printf("\t\tcaps=%#08x\n", (int)NV(number, CAPS)); + printf("\t\tlatency=%d\n", (int)NV(number, LATENCY)); + printf("\t\trate=%d\n", (int)NV(number, RATE)); + printf("\t\tformat=%#08x\n", (int)NV(number, FORMAT)); + printf("\t\tpid=%d\n", (int)NV(number, PID)); + printf("\t\tcomm=%s\n", NV(string, COMM)); + printf("\t\tintr=%d\n", (int)NV(number, INTR)); + printf("\t\txruns=%d\n", (int)NV(number, XRUNS)); + printf("\t\tfeedcnt=%d\n", (int)NV(number, FEEDCNT)); + printf("\t\tleftvol=%d\n", (int)NV(number, LEFTVOL)); + printf("\t\trightvol=%d\n", (int)NV(number, RIGHTVOL)); + printf("\t\thwbuf_format=%#08x\n", + (int)NV(number, HWBUF_FORMAT)); + printf("\t\thwbuf_size=%d\n", + (int)NV(number, HWBUF_SIZE)); + printf("\t\thwbuf_blksz=%d\n", + (int)NV(number, HWBUF_BLKSZ)); + printf("\t\thwbuf_blkcnt=%d\n", + (int)NV(number, HWBUF_BLKCNT)); + printf("\t\thwbuf_free=%d\n", + (int)NV(number, HWBUF_FREE)); + printf("\t\thwbuf_ready=%d\n", + (int)NV(number, HWBUF_READY)); + printf("\t\tswbuf_format=%#08x\n", + (int)NV(number, SWBUF_FORMAT)); + printf("\t\tswbuf_size=%d\n", + (int)NV(number, SWBUF_SIZE)); + printf("\t\tswbuf_blksz=%d\n", + (int)NV(number, SWBUF_BLKSZ)); + printf("\t\tswbuf_blkcnt=%d\n", + (int)NV(number, SWBUF_BLKCNT)); + printf("\t\tswbuf_free=%d\n", + (int)NV(number, SWBUF_FREE)); + printf("\t\tswbuf_ready=%d\n", + (int)NV(number, SWBUF_READY)); + printf("\t\tswbuf_feederchain=%s\n", + NV(string, FEEDERCHAIN)); +#undef NV + } + } + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); + + return (0); +} From nobody Mon Jul 29 15:35:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9L75CRz5RSQB; Mon, 29 Jul 2024 15:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9L5KzXz42L8; Mon, 29 Jul 2024 15:35:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B/YYd+DGWi4UShlF4K0Tntd9PZgqEFcKVBXsHV6HgLQ=; b=VB+KPlKltW0wcWnxhApSGdKFrV2S7aallZVuoR6pN5Qnp3m8xUF/aPxcAXGp+o3ycfx5uK bNl2dJATLDQeWJHt1CV++j00lfljq3dyeRVk3CzUSOA0+n2lbZ6+9yZWDoUZLjSzbiiyWL DykGZY11B52sw/goqEmIkcIVc/JahhwygwVSi9NHUy5wPEj6nn0l7IdOemv0bgO4gfok9r mJqF5FEtoawNG7Tjsw2vAn1witVgA5Z2ynZnKqo6J9dP/coEpraNiOopSSXScyCrVCjeY3 aLeoJrdWcUMsOtVnvqcFJVDGhlg5o2hf3QNsChyz/ZKeySsOHPvfVyThKuaUxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267318; a=rsa-sha256; cv=none; b=ZL07Pv2JoP+HijaI/Y8PxeT6bfmil7r5m39mJHrLYygmPX6Ad5tDavpdJSV/6mH5H/8NUw MpeGLx6v0qIk7qnySEAwucTU1/JLzKNNMzkh9/uCk7EZQtTJ8I/bWv9u++5FV0xRCc3F2U IHeX1SBYPo4tnY0IlFDrV5aucqvCA1fDZf2I2WIPJzhjKDQqjJY9+JBhCGLymPBTURfCTk LjOvI49dgso4r2PMVbUUg0xVwmyOp2rgbSMMnjf2rDmYJvmHLXJZiae/FWhOwaGXQkwxOt MKNDtzBjPOjYTssyT0cNXwgUo0xVGK5feNdh5DHyb0uCW5xeWElMjQDn0i9yKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B/YYd+DGWi4UShlF4K0Tntd9PZgqEFcKVBXsHV6HgLQ=; b=eE9YnEfx7IwqY4gmCU728LVxD8ugamoa8Ki0ploNkFD/theKkMSLCCe8Sa+GQtyoYAS+UE WnEQk/3kMDfbYrJ8N/5LPE6P+nQ4cEVEfXZVyB2OqVIoWcoaqAEdtABGfyPBqj7Tym4ViI HPg9YJa7BTRtsUF9FXO8Ku4ydsdkl/vAtEYCvs3T5XpGn3aOvAkQcgTd6sF2TDhpr0B5Je YCLu3q66uaUzjNgkIlZXB0BSYxcSqUJvxi6bPqRATYX9jyO1dZ8pcJw9DKkAj2d6wRPbQ3 EoKwDe4t2FiIfCvY+yWd0UuOIAtvkKzsCk/8M0DXIJIIj4n4aBK5OsSfIbtAPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9L4xc6zfsQ; Mon, 29 Jul 2024 15:35: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 46TFZI09002350; Mon, 29 Jul 2024 15:35:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZIKX002347; Mon, 29 Jul 2024 15:35:18 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:18 GMT Message-Id: <202407291535.46TFZIKX002347@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: 22be802cf84b - stable/14 - sound tests: Add sndstat nvlist ATF test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 22be802cf84bb9b623ab62e347bf8fc3110916fc Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=22be802cf84bb9b623ab62e347bf8fc3110916fc commit 22be802cf84bb9b623ab62e347bf8fc3110916fc Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:03 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound tests: Add sndstat nvlist ATF test Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45901 (cherry picked from commit 95eb4b873b6a8b527c5bd78d7191975dfca38998) --- tests/sys/Makefile | 1 + tests/sys/sound/Makefile | 9 ++ tests/sys/sound/sndstat.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 20ea4f181c7c..a2a133e19803 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -31,6 +31,7 @@ TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= ses +TESTS_SUBDIRS+= sound TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm diff --git a/tests/sys/sound/Makefile b/tests/sys/sound/Makefile new file mode 100644 index 000000000000..fb731fb8ab61 --- /dev/null +++ b/tests/sys/sound/Makefile @@ -0,0 +1,9 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/sound + +ATF_TESTS_C+= sndstat + +LDFLAGS+= -lnv + +.include diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c new file mode 100644 index 000000000000..7c030dfa8b58 --- /dev/null +++ b/tests/sys/sound/sndstat.c @@ -0,0 +1,214 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 +#include +#include +#include + +static void +load_dummy(void) +{ + if (kldload("snd_dummy.ko") < 0 && errno != EEXIST) + atf_tc_skip("snd_dummy.ko not found"); +} + +ATF_TC(sndstat_nv); +ATF_TC_HEAD(sndstat_nv, tc) +{ + atf_tc_set_md_var(tc, "descr", "/dev/sndstat nvlist test"); +} + +ATF_TC_BODY(sndstat_nv, tc) +{ + nvlist_t *nvl; + const nvlist_t * const *di; + const nvlist_t * const *cdi; + struct sndstioc_nv_arg arg; + size_t nitems, nchans, i, j; + int fd, rc; + int pchan, rchan; + + load_dummy(); + + if ((fd = open("/dev/sndstat", O_RDONLY)) < 0) + atf_tc_skip("/dev/sndstat not found, load sound(4)"); + + rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL); + ATF_REQUIRE_EQ(rc, 0); + + arg.nbytes = 0; + arg.buf = NULL; + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#1) failed"); + + arg.buf = malloc(arg.nbytes); + ATF_REQUIRE(arg.buf != NULL); + + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#2) failed"); + + nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); + ATF_REQUIRE(nvl != NULL); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + atf_tc_skip("no soundcards attached"); + + di = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(di[i], SNDST_DSPS_ ## item), \ + "SNDST_DSPS_" #item " does not exist"); \ + nvlist_get_ ## type (di[i], SNDST_DSPS_ ## item); \ +} while (0) + NV(string, NAMEUNIT); + NV(bool, FROM_USER); + NV(string, DEVNODE); + NV(string, DESC); + NV(string, PROVIDER); + NV(number, PCHAN); + NV(number, RCHAN); +#undef NV + + /* Cannot asign using the macro. */ + pchan = nvlist_get_number(di[i], SNDST_DSPS_PCHAN); + rchan = nvlist_get_number(di[i], SNDST_DSPS_RCHAN); + + if (pchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_PLAY)) + atf_tc_fail("playback channel list empty"); + if (rchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_REC)) + atf_tc_fail("recording channel list empty"); + +#define NV(type, mode, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item), \ + "SNDST_DSPS_INFO_" #item " does not exist"); \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item); \ +} while (0) + if (pchan) { + NV(number, PLAY, MIN_RATE); + NV(number, PLAY, MAX_RATE); + NV(number, PLAY, FORMATS); + NV(number, PLAY, MIN_CHN); + NV(number, PLAY, MAX_CHN); + } + if (rchan) { + NV(number, REC, MIN_RATE); + NV(number, REC, MAX_RATE); + NV(number, REC, FORMATS); + NV(number, REC, MIN_CHN); + NV(number, REC, MAX_CHN); + } +#undef NV + + /* XXX Do we need to skip the TC? userdevs won't have this list */ + if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) + continue; + +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item), \ + "SNDST_DSPS_SOUND4_" #item " does not exist"); \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item); \ +} while (0) + NV(number, UNIT); + NV(string, STATUS); + NV(bool, BITPERFECT); + NV(number, PVCHAN); + NV(number, PVCHANRATE); + NV(number, PVCHANFORMAT); + NV(number, RVCHAN); + NV(number, PVCHANRATE); + NV(number, PVCHANFORMAT); +#undef NV + + if (!nvlist_exists(nvlist_get_nvlist(di[i], + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_CHAN_INFO)) + atf_tc_fail("channel info list empty"); + + cdi = nvlist_get_nvlist_array( + nvlist_get_nvlist(di[i], SNDST_DSPS_PROVIDER_INFO), + SNDST_DSPS_SOUND4_CHAN_INFO, &nchans); + for (j = 0; j < nchans; j++) { +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item), \ + "SNDST_DSPS_SOUND4_CHAN_" #item " does not exist"); \ + nvlist_get_ ## type (cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item); \ +} while (0) + NV(string, NAME); + NV(string, PARENTCHAN); + NV(number, UNIT); + NV(number, CAPS); + NV(number, LATENCY); + NV(number, RATE); + NV(number, FORMAT); + NV(number, PID); + NV(string, COMM); + NV(number, INTR); + NV(number, XRUNS); + NV(number, FEEDCNT); + NV(number, LEFTVOL); + NV(number, RIGHTVOL); + NV(number, HWBUF_FORMAT); + NV(number, HWBUF_SIZE); + NV(number, HWBUF_BLKSZ); + NV(number, HWBUF_BLKCNT); + NV(number, HWBUF_FREE); + NV(number, HWBUF_READY); + NV(number, SWBUF_FORMAT); + NV(number, SWBUF_SIZE); + NV(number, SWBUF_BLKSZ); + NV(number, SWBUF_BLKCNT); + NV(number, SWBUF_FREE); + NV(number, SWBUF_READY); + NV(string, FEEDERCHAIN); +#undef NV + } + } + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, sndstat_nv); + + return (atf_no_error()); +} From nobody Mon Jul 29 15:35:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9K5yl4z5RS74; Mon, 29 Jul 2024 15:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9K4wfLz42Hm; Mon, 29 Jul 2024 15:35:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHkNReff61lVAy+RLX8BcVdyjFEnQGkgV3tO/0vgD3w=; b=u5VJz/m/UvMdR8pzlPjooOdXK92qt+12Txpg9SIdUHTYdCSVOo8ZJF/+el+j1d1uM5/Mmj XAQjN45QtT6M9RzB2or+G9u3dsdmY0XKiklMyMBFzBRvFklzQ6neLv/mnLtWK1aLW13aiP qFBzaMu/bBBVqn6TMHHVuA01fvvqdx4mbTNeu48kE/l5Occg4wXVDiENuU5kukyoZuXdgn 7tfBgT65g2SU6wb4IHssSFCj37zBi7MHiSg7ClcThCAco6wDKsPQsl2sk+b8M8SnFUkdD2 ziaWXzv2v+Y/eGtEBSHNWQaxarXYBfXXBWIClF7f0Hz318fOqkDp6omL80tHWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267317; a=rsa-sha256; cv=none; b=PhT5uipLG4G4xcwwLYYDKn4j3FO2EZQcIskNF+BXKWkZ2bZx5j3Ag50kTx3JvIQsSIEBIe unkPvJ4pUJhPOlCaViy0X5i1KHLq9G1O5/8iTABZk4BC2gBMzJw2s+f9IxyZFIKJWaA1t2 B6BjiWGzpKOx4m0tN8rghNLNoyNlDyDGBxGqTymY3iOjDvkkV40k+FcNQYZUPqxkrx7qcl Am5Z5pRWvOL88gBRVDu4KFbWSnhceug/rYLB5N4iwOotnGESzPAVV+Qi6B5eq2TNZ1IQJ/ 8SWPApG9Q+tS7nRhi6e0egOTKKnILH8UUnUc5tInCItiFbW4+67CJYM9Bb0kbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHkNReff61lVAy+RLX8BcVdyjFEnQGkgV3tO/0vgD3w=; b=DFibYkGfMGZo3evVkeMU9L+mcksdPRogGcIUFKMBExxCRLSDDahnYfVdP54ZOLzD+nT9QE cxq9b3WYsOgNJf8InYH3vTqYj57VJM502hA8s0JAU5IbNFFxrFW/jZOztq8W6QVNtthrhE JjbI6ilsMvz6fpRVOhCdzBa/S8G6UAAnp/ZqncuTDqkX2hd6OXjv2wSEjZcQYP1ejyqDCZ CesWuOr5udlw211t/eYE/rF0m7GC415Mt89f978XZRG/0mEPbhVVYiY9bGgW1DARz6tQaS 4aA1Zt0HFdkposncYGkOE5b4/rtP3T74+esWbjJF0olzg+GblM5Zdx7PANLOQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9K4Cl9zgW7; Mon, 29 Jul 2024 15:35: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 46TFZHgM002295; Mon, 29 Jul 2024 15:35:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZH2k002292; Mon, 29 Jul 2024 15:35:17 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:17 GMT Message-Id: <202407291535.46TFZH2k002292@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: 1ff260a6e166 - stable/14 - sound: Implement dummy 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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1ff260a6e1663a7f3468313d0b6d8d54b07af4c0 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=1ff260a6e1663a7f3468313d0b6d8d54b07af4c0 commit 1ff260a6e1663a7f3468313d0b6d8d54b07af4c0 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:45 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound: Implement dummy driver Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45967 (cherry picked from commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861) --- share/man/man4/Makefile | 1 + share/man/man4/snd_dummy.4 | 69 +++++++ sys/dev/sound/dummy.c | 353 ++++++++++++++++++++++++++++++++ sys/modules/sound/driver/Makefile | 1 + sys/modules/sound/driver/dummy/Makefile | 7 + 5 files changed, 431 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 612b063de3de..efe0625cc620 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -513,6 +513,7 @@ MAN= aac.4 \ snd_cmi.4 \ snd_cs4281.4 \ snd_csa.4 \ + snd_dummy.4 \ snd_emu10k1.4 \ snd_emu10kx.4 \ snd_envy24.4 \ diff --git a/share/man/man4/snd_dummy.4 b/share/man/man4/snd_dummy.4 new file mode 100644 index 000000000000..2b9d26d318ef --- /dev/null +++ b/share/man/man4/snd_dummy.4 @@ -0,0 +1,69 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 The FreeBSD Foundation +.\" +.\" Portions of this software were developed by Christos Margiolis +.\" 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. +.\" +.Dd July 15, 2024 +.Dt SND_DUMMY 4 +.Os +.Sh NAME +.Nm snd_dummy +.Nd Dummy audio driver +.Sh SYNOPSIS +To load the driver at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +snd_dummy_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements a virtual testing device, meaning it does not correspond to a +physical sound card. +It is intended for testing, so that test programs do not need to rely on +hardware being present in the machine in order to run. +.Pp +The driver attaches as a regular PCM device, with two channels (one playback +and one recording), as well as a mixer. +.Pp +Playback works by discarding all input, and recording by returning silence +(zeros). +.Sh SEE ALSO +.Xr sound 4 , +.Xr loader.conf 5 , +.Xr loader 8 +.Sh AUTHORS +The +.Nm +driver was implemented by +.An Christos Margiolis Aq Mt christos@FreeBSD.org +under sponsorship from the +.Fx +Foundation. +.Sh CAVEATS +Because the driver automatically attaches once the module is loaded, it can +only be attached once. diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c new file mode 100644 index 000000000000..f8193a73fcc8 --- /dev/null +++ b/sys/dev/sound/dummy.c @@ -0,0 +1,353 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include +#include + +#define DUMMY_NPCHAN 1 +#define DUMMY_NRCHAN 1 +#define DUMMY_NCHAN (DUMMY_NPCHAN + DUMMY_NRCHAN) + +struct dummy_chan { + struct dummy_softc *sc; + struct pcm_channel *chan; + struct snd_dbuf *buf; + struct pcmchan_caps *caps; + uint32_t ptr; + int dir; + int run; +}; + +struct dummy_softc { + struct snddev_info info; + device_t dev; + uint32_t cap_fmts[4]; + struct pcmchan_caps caps; + int chnum; + struct dummy_chan chans[DUMMY_NCHAN]; + struct callout callout; + struct mtx *lock; +}; + +static void +dummy_chan_io(void *arg) +{ + struct dummy_softc *sc = arg; + struct dummy_chan *ch; + int i = 0; + + snd_mtxlock(sc->lock); + + for (i = 0; i < sc->chnum; i++) { + ch = &sc->chans[i]; + if (!ch->run) + continue; + if (ch->dir == PCMDIR_PLAY) + ch->ptr += sndbuf_getblksz(ch->buf); + else + sndbuf_fillsilence(ch->buf); + snd_mtxunlock(sc->lock); + chn_intr(ch->chan); + snd_mtxlock(sc->lock); + } + callout_schedule(&sc->callout, 1); + + snd_mtxunlock(sc->lock); +} + +static int +dummy_chan_free(kobj_t obj, void *data) +{ + struct dummy_chan *ch =data; + uint8_t *buf; + + buf = sndbuf_getbuf(ch->buf); + if (buf != NULL) + free(buf, M_DEVBUF); + + return (0); +} + +static void * +dummy_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct dummy_softc *sc; + struct dummy_chan *ch; + uint8_t *buf; + size_t bufsz; + + sc = devinfo; + + snd_mtxlock(sc->lock); + + ch = &sc->chans[sc->chnum++]; + ch->sc = sc; + ch->dir = dir; + ch->chan = c; + ch->buf = b; + ch->caps = &sc->caps; + + snd_mtxunlock(sc->lock); + + bufsz = pcm_getbuffersize(sc->dev, 2048, 2048, 65536); + buf = malloc(bufsz, M_DEVBUF, M_WAITOK | M_ZERO); + if (sndbuf_setup(ch->buf, buf, bufsz) != 0) { + dummy_chan_free(obj, ch); + return (NULL); + } + + return (ch); +} + +static int +dummy_chan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct dummy_chan *ch = data; + int i; + + for (i = 0; ch->caps->fmtlist[i]; i++) + if (format == ch->caps->fmtlist[i]) + return (0); + + return (EINVAL); +} + +static uint32_t +dummy_chan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct dummy_chan *ch = data; + + RANGE(speed, ch->caps->minspeed, ch->caps->maxspeed); + + return (speed); +} + +static uint32_t +dummy_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct dummy_chan *ch = data; + + return (sndbuf_getblksz(ch->buf)); +} + +static int +dummy_chan_trigger(kobj_t obj, void *data, int go) +{ + struct dummy_chan *ch = data; + struct dummy_softc *sc = ch->sc; + + snd_mtxlock(sc->lock); + + switch (go) { + case PCMTRIG_START: + if (!callout_active(&sc->callout)) + callout_reset(&sc->callout, 1, dummy_chan_io, sc); + ch->ptr = 0; + ch->run = 1; + break; + case PCMTRIG_STOP: + case PCMTRIG_ABORT: + ch->run = 0; + if (callout_active(&sc->callout)) + callout_stop(&sc->callout); + default: + break; + } + + snd_mtxunlock(sc->lock); + + return (0); +} + +static uint32_t +dummy_chan_getptr(kobj_t obj, void *data) +{ + struct dummy_chan *ch = data; + + return (ch->run ? ch->ptr : 0); +} + +static struct pcmchan_caps * +dummy_chan_getcaps(kobj_t obj, void *data) +{ + struct dummy_chan *ch = data; + + return (ch->caps); +} + +static kobj_method_t dummy_chan_methods[] = { + KOBJMETHOD(channel_init, dummy_chan_init), + KOBJMETHOD(channel_free, dummy_chan_free), + KOBJMETHOD(channel_setformat, dummy_chan_setformat), + KOBJMETHOD(channel_setspeed, dummy_chan_setspeed), + KOBJMETHOD(channel_setblocksize,dummy_chan_setblocksize), + KOBJMETHOD(channel_trigger, dummy_chan_trigger), + KOBJMETHOD(channel_getptr, dummy_chan_getptr), + KOBJMETHOD(channel_getcaps, dummy_chan_getcaps), + KOBJMETHOD_END +}; + +CHANNEL_DECLARE(dummy_chan); + +static int +dummy_mixer_init(struct snd_mixer *m) +{ + struct dummy_softc *sc; + + sc = mix_getdevinfo(m); + if (sc == NULL) + return (-1); + + pcm_setflags(sc->dev, pcm_getflags(sc->dev) | SD_F_SOFTPCMVOL); + mix_setdevs(m, SOUND_MASK_PCM | SOUND_MASK_VOLUME | SOUND_MASK_RECLEV); + mix_setrecdevs(m, SOUND_MASK_RECLEV); + + return (0); +} + +static int +dummy_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + return (0); +} + +static uint32_t +dummy_mixer_setrecsrc(struct snd_mixer *m, uint32_t src) +{ + return (src == SOUND_MASK_RECLEV ? src : 0); +} + +static kobj_method_t dummy_mixer_methods[] = { + KOBJMETHOD(mixer_init, dummy_mixer_init), + KOBJMETHOD(mixer_set, dummy_mixer_set), + KOBJMETHOD(mixer_setrecsrc, dummy_mixer_setrecsrc), + KOBJMETHOD_END +}; + +MIXER_DECLARE(dummy_mixer); + +static void +dummy_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, driver->name, -1) != NULL) + return; + if (BUS_ADD_CHILD(parent, 0, driver->name, -1) == NULL) + device_printf(parent, "add child failed\n"); +} + +static int +dummy_probe(device_t dev) +{ + device_set_desc(dev, "Dummy Audio Device"); + + return (0); +} + +static int +dummy_attach(device_t dev) +{ + struct dummy_softc *sc; + char status[SND_STATUSLEN]; + int i = 0; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_dummy softc"); + + sc->cap_fmts[0] = SND_FORMAT(AFMT_S32_LE, 2, 0); + sc->cap_fmts[1] = SND_FORMAT(AFMT_S24_LE, 2, 0); + sc->cap_fmts[2] = SND_FORMAT(AFMT_S16_LE, 2, 0); + sc->cap_fmts[3] = 0; + sc->caps = (struct pcmchan_caps){ + 8000, /* minspeed */ + 96000, /* maxspeed */ + sc->cap_fmts, /* fmtlist */ + 0, /* caps */ + }; + + pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); + if (pcm_register(dev, sc, DUMMY_NPCHAN, DUMMY_NRCHAN)) + return (ENXIO); + for (i = 0; i < DUMMY_NPCHAN; i++) + pcm_addchan(dev, PCMDIR_PLAY, &dummy_chan_class, sc); + for (i = 0; i < DUMMY_NRCHAN; i++) + pcm_addchan(dev, PCMDIR_REC, &dummy_chan_class, sc); + + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); + pcm_setstatus(dev, status); + mixer_init(dev, &dummy_mixer_class, sc); + callout_init(&sc->callout, 1); + + return (0); +} + +static int +dummy_detach(device_t dev) +{ + struct dummy_softc *sc = device_get_softc(dev); + int err; + + err = pcm_unregister(dev); + snd_mtxfree(sc->lock); + + return (err); +} + +static device_method_t dummy_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, dummy_identify), + DEVMETHOD(device_probe, dummy_probe), + DEVMETHOD(device_attach, dummy_attach), + DEVMETHOD(device_detach, dummy_detach), + DEVMETHOD_END +}; + +static driver_t dummy_driver = { + "pcm", + dummy_methods, + sizeof(struct dummy_softc), +}; + +DRIVER_MODULE(snd_dummy, nexus, dummy_driver, 0, 0); +MODULE_DEPEND(snd_dummy, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(snd_dummy, 1); diff --git a/sys/modules/sound/driver/Makefile b/sys/modules/sound/driver/Makefile index af5e3259aa00..7d5dd3587ce9 100644 --- a/sys/modules/sound/driver/Makefile +++ b/sys/modules/sound/driver/Makefile @@ -9,6 +9,7 @@ SUBDIR= als4000 atiixp cs4281 ${_csa} emu10k1 emu10kx SUBDIR+= envy24 envy24ht es137x fm801 hda hdspe ich SUBDIR+= ${_maestro3} neomagic solo spicds t4dwave via8233 SUBDIR+= via82c686 vibes driver uaudio +SUBDIR+= dummy .if ${MK_SOURCELESS_UCODE} != "no" _csa= csa diff --git a/sys/modules/sound/driver/dummy/Makefile b/sys/modules/sound/driver/dummy/Makefile new file mode 100644 index 000000000000..fb4127d35073 --- /dev/null +++ b/sys/modules/sound/driver/dummy/Makefile @@ -0,0 +1,7 @@ +.PATH: ${SRCTOP}/sys/dev/sound + +KMOD= snd_dummy +SRCS= bus_if.h device_if.h +SRCS+= dummy.c + +.include From nobody Mon Jul 29 15:35:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9N2Xf0z5RSgj; Mon, 29 Jul 2024 15:35:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9M6lYyz42Nk; Mon, 29 Jul 2024 15:35:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nimJA6y82932+3GupznmYEOEpb5cVGWCxvMV0s0wkyc=; b=TTRURGTdSAkOo+trJuImaaPN58IJF9n9FDUvJp4hNW/1/d09aaA8uIWI0Nz+AGji+U/HhQ SYWlQJtOEHb2c8W2Oooe9pUbNYu3bz5VIlQyokykkpc9sUIA8LoyLiPntx/ZEeszaNPIID +2vfl9/iRwZD653GhTx0fzZelBhHYs/izzUVRFJvjKgpgznnoT77aKnavH6pNs6slwCSag MF6ySMfuafq1egixHbHoN4gEp5OG3DLiLuDCwG2hMGEd8Ut7VVe2YiDqULBiTpK8hgCWAM f6bIFYg4ATV59zbJOgnqjOFTxmTu2JkEnbLWP30Ci+swhJRanFkbz5k516feUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267320; a=rsa-sha256; cv=none; b=c3nNfRPzGsumDAhEBLruaAoA6vLIwbzSGgI8hW745WM+rw3QND7JF9c/zYT+3zyOSksLs9 TpSVJeAMIGbByeROhzv3ZxM4yQGUbsmw5ByjcPh/Rhxd1NKeO7sFBCwJ7BbaKhPWDZuve+ UpL8zwPcyJYJ/4FsQnA62xVHW/+IfA/vLqVj0smSwpcOV+YxsE8laokbEpTKM+Thp3m4II yNIVXvoyUEnlYuGn+4hKpghhXVFXGy7gDZxoeFwvPG1J3dU5kP5nqyjlZ9Lv23KbfT/maM toTOtPBAvksmNoKJTD3YjUiwwWDQ79cRLJlTzxw+AgcBzepFFLib0JS13v6jUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nimJA6y82932+3GupznmYEOEpb5cVGWCxvMV0s0wkyc=; b=ro1favtHmc66ElcwdddHLZI5lj3rzrgBEmbrBOJjy0P0hq2gyBCnEpLIjhCV4dfwXOrup+ vcNUugwzlUmFFepQ81E7vNG8G0Y7M6bQz27pF1vRTLNOLDbI/ooIdG9EAjRBazPq4hE6qb a4XhqcVHjyoY5G3zaSoE+BJtWnUs3Ze4M9CFm8xDCIB3imsWsxm1eKtG/rsNj/MSF0DkQ2 2vrJOVSIPjc2S+iBGT2FsmICc3E+6MCl3U8TvZrm/RQePvh7qJzak7bc1crnpZ9GwgZPfh mhspuDMvbRveG9+bXGOqgqTexY3/k8vMgQb5zn4PLhpmQZSgXy2QgStT9k1KXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9M624JzgDG; Mon, 29 Jul 2024 15:35: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 46TFZJ6x002406; Mon, 29 Jul 2024 15:35:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZJUY002402; Mon, 29 Jul 2024 15:35:19 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:19 GMT Message-Id: <202407291535.46TFZJUY002402@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: bf3d523408d4 - stable/14 - mixer(8): Make mute and recsrc argument parsing more robust List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: bf3d523408d48126e83a097978e2db469954d238 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bf3d523408d48126e83a097978e2db469954d238 commit bf3d523408d48126e83a097978e2db469954d238 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:09 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 mixer(8): Make mute and recsrc argument parsing more robust For the deprecated argument interfaces of the mute (1, 0, ^) and recsrc (+, -, =, ^) controls, we only check the first character of the argument, which means that an argument such as "vol.mute=10" would be valid. Fix this by checking the whole argument string. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45973 (cherry picked from commit 8ca73331ef810cd0e0b9e3c37cddc1d89fbe8c6b) --- usr.sbin/mixer/mixer.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 07dd16536495..109d3ad09bc5 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -426,11 +426,14 @@ mod_mute(struct mix_dev *d, void *p) m = d->parent_mixer; cp = mixer_get_ctl(m->dev, C_MUT); val = p; - if (strncmp(val, "off", strlen(val)) == 0 || *val == '0') + if (strncmp(val, "off", strlen(val)) == 0 || + strncmp(val, "0", strlen(val)) == 0) opt = MIX_UNMUTE; - else if (strncmp(val, "on", strlen(val)) == 0 || *val == '1') + else if (strncmp(val, "on", strlen(val)) == 0 || + strncmp(val, "1", strlen(val)) == 0) opt = MIX_MUTE; - else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^') + else if (strncmp(val, "toggle", strlen(val)) == 0 || + strncmp(val, "^", strlen(val)) == 0) opt = MIX_TOGGLEMUTE; else { warnx("%s: no such modifier", val); @@ -459,13 +462,17 @@ mod_recsrc(struct mix_dev *d, void *p) m = d->parent_mixer; cp = mixer_get_ctl(m->dev, C_SRC); val = p; - if (strncmp(val, "add", strlen(val)) == 0 || *val == '+') + if (strncmp(val, "add", strlen(val)) == 0 || + strncmp(val, "+", strlen(val)) == 0) opt = MIX_ADDRECSRC; - else if (strncmp(val, "remove", strlen(val)) == 0 || *val == '-') + else if (strncmp(val, "remove", strlen(val)) == 0 || + strncmp(val, "-", strlen(val)) == 0) opt = MIX_REMOVERECSRC; - else if (strncmp(val, "set", strlen(val)) == 0 || *val == '=') + else if (strncmp(val, "set", strlen(val)) == 0 || + strncmp(val, "=", strlen(val)) == 0) opt = MIX_SETRECSRC; - else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^') + else if (strncmp(val, "toggle", strlen(val)) == 0 || + strncmp(val, "^", strlen(val)) == 0) opt = MIX_TOGGLERECSRC; else { warnx("%s: no such modifier", val); From nobody Mon Jul 29 15:35:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9P2gxGz5RSQH; Mon, 29 Jul 2024 15:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9P03dBz42R0; Mon, 29 Jul 2024 15:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5XW2Q72Ikmuov4B82jKyIycD/bXeCTLS6mwVNfCXss=; b=FKo6TcF1hAgUy9ze56/kEe3jet1iI2EAZx3b5+/P+1oZ7awiieRYtQ8aM6/UC9wHzKYjW/ iZn3TK1kzCFvznMXNQqYr+SovbmdjmrjXYbCP12pT/UgXn0qYi6huYXAEFUf9bEkmt1eCk bLh+q/OOi2/1QDpiv62cUcIr+hzRHwGgeWcyXlvZFfD8ozjGvzzUpbqNyX9HfreNbzuwrO +VhuVqYuy9QpJP+1w+IDyNNsaBfmW2bPxnwom5L9hSDuuIi1JgyQIP/r+ASKoYeazr+Sf6 2H1SpphdjDSjAj5BERiPm6kD6qcsaaN5YmvPgfPwssRGTRNDbvV69iiBJ0P9aA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267321; a=rsa-sha256; cv=none; b=jSJd5OUoeWMo+KzD5mBsCLtKQnA3kV6PZ0VJM1NpZ6IA/0PeHaIU3RtkTFzRn9H5owSmZb RinJmYjz0pfDroEsZgnHqNAEs1CU813LEfJCgRyLF/UVNHRuqrg1ngwn2C6iPX5IgIX7Jl 6sOoz0KgMRpXL+5IRxR8JC3BpqiO8mlbkxojTnxFW7UO7SB9fmte+EzWzOz8R0BvUI3988 ro+3b+RP1Tvm+aOANgUcJcMTuuYNymGkEta3OjdW24VWXozOhr+I1uSFFQDuUh25RdcOGA dk7my/8nj/0P/LZM7Dte8J80XkBdcs+Wz6kHo7D7AjIzruoJObCi43vsRhbG/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5XW2Q72Ikmuov4B82jKyIycD/bXeCTLS6mwVNfCXss=; b=kk7BmSORm6oQu1rH3qlWpRRE0UsIb7AHmH8hNnUONntTDDaGWUQUE6r0vnnJXylE3s89FM UbOCxMvV/mkL65r/j9IliN3jT/QJMzLUQTZHAlpQTbFHKPVrXsW+gyT1y3XG9yKPi3Eest VuMwplNQNvbPEBskFG89hqC1uOYUaz42BX+U+PWIpzCMZ6gsNTQDjiMUtJ+nZxVfA8hoj3 ZavFV7dBVumFa8EPbeYUG1sksKM23OwWMbPxK87fWZM3ey1jUAfIVke7T126iHRP6KEsK4 koJyWsHgw3mcx8+PdrPAk5eizzfoiQ5xlljsoiiWleupCy/DTSmg0FAlRzHftQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9N6mKSzgDH; Mon, 29 Jul 2024 15:35: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 46TFZKWV002449; Mon, 29 Jul 2024 15:35:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZKrB002445; Mon, 29 Jul 2024 15:35:20 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:20 GMT Message-Id: <202407291535.46TFZKrB002445@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: f55b8bba6092 - stable/14 - mixer(8): Add tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f55b8bba60922af0381894fdfc801bb0b04dc5c4 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f55b8bba60922af0381894fdfc801bb0b04dc5c4 commit f55b8bba60922af0381894fdfc801bb0b04dc5c4 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:14 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 mixer(8): Add tests Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45974 (cherry picked from commit 94a86f3f69205a6de3c07ae60daf4f5f920e9b82) --- usr.sbin/mixer/Makefile | 3 + usr.sbin/mixer/tests/Makefile | 3 + usr.sbin/mixer/tests/mixer_test.sh | 285 +++++++++++++++++++++++++++++++++++++ 3 files changed, 291 insertions(+) diff --git a/usr.sbin/mixer/Makefile b/usr.sbin/mixer/Makefile index 0dab386e0873..213166e952dc 100644 --- a/usr.sbin/mixer/Makefile +++ b/usr.sbin/mixer/Makefile @@ -6,4 +6,7 @@ SRCS= ${PROG}.c MAN= ${PROG}.8 LDFLAGS+= -lmixer +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.sbin/mixer/tests/Makefile b/usr.sbin/mixer/tests/Makefile new file mode 100644 index 000000000000..9a5bb3a183ab --- /dev/null +++ b/usr.sbin/mixer/tests/Makefile @@ -0,0 +1,3 @@ +ATF_TESTS_SH+= mixer_test + +.include diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh new file mode 100755 index 000000000000..e1321ad9ee13 --- /dev/null +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -0,0 +1,285 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Christos Margiolis +# 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. + +mixer_exists() +{ + if ! mixer >/dev/null 2>&1; then + atf_skip "no mixer available" + fi +} + +save_conf() +{ + atf_check -o save:test_mixer_conf mixer -o +} + +restore_conf() +{ + mixer_exists + test -r "test_mixer_conf" && mixer $(cat test_mixer_conf) +} + +load_dummy() +{ + if ! kldload -n snd_dummy; then + atf_skip "cannot load snd_dummy.ko" + fi +} + +set_default() +{ + deflt_unit="$(mixer | grep ^pcm | cut -f1 -d:)" + dummy_unit="$(mixer -a | grep "Dummy Audio Device" | cut -f1 -d:)" + + atf_check -o save:test_mixer_deflt_unit echo ${deflt_unit} + atf_check -o save:test_mixer_dummy_unit echo ${dummy_unit} + + # Set the dummy as the default + mixer -d ${dummy_unit} +} + +restore_default() +{ + test -r "test_mixer_deflt_unit" && mixer -d $(cat test_mixer_deflt_unit) +} + +atf_test_case o_flag cleanup +o_flag_head() +{ + atf_set "descr" "Verify that the output of the -o flag can be used " \ + "as valid input" +} +o_flag_body() +{ + load_dummy + mixer_exists + set_default + + atf_check -o ignore -e empty mixer $(mixer -o) +} +o_flag_cleanup() +{ + restore_default +} + +atf_test_case d_flag cleanup +d_flag_head() +{ + atf_set "descr" "Test default unit setting" +} +d_flag_body() +{ + load_dummy + mixer_exists + set_default + + dev="${dummy_unit}" + unit=$(echo ${dev} | sed 's/pcm//') + + atf_check -o ignore -e empty mixer -d ${dev} + atf_check -o ignore -e empty mixer -d ${unit} +} +d_flag_cleanup() +{ + restore_default +} + +atf_test_case volume cleanup +volume_head() +{ + atf_set "descr" "Test volume setting" +} +volume_body() +{ + load_dummy + mixer_exists + set_default + save_conf + + # Test lower bound + mixer vol.volume=0 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-2 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-1:-2 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-110% + atf_check -o match:"0.00:0.00" mixer vol.volume + + # Test higher bound + mixer vol.volume=1 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+1.01 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=2 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+1:+1 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=2:2 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=100% + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=110% + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+110% + atf_check -o match:"1.00:1.00" mixer vol.volume + + # Test percentages + mixer vol.volume=1 + + mixer vol.volume=-10% + atf_check -o match:"0.90:0.90" mixer vol.volume + + mixer vol.volume=+5% + atf_check -o match:"0.95:0.95" mixer vol.volume + + mixer vol.volume=80% + atf_check -o match:"0.80:0.80" mixer vol.volume + + # Test left:right assignment + mixer vol.volume=0.80:0.70 + atf_check -o match:"0.80:0.70" mixer vol.volume + + mixer vol.volume=+5%:+10% + atf_check -o match:"0.85:0.80" mixer vol.volume + + mixer vol.volume=-5%:-10% + atf_check -o match:"0.80:0.70" mixer vol.volume + + mixer vol.volume=+10%:-15% + atf_check -o match:"0.90:0.55" mixer vol.volume + + # Test wrong values + atf_check -o ignore -e not-empty mixer vol.volume=foobar + atf_check -o ignore -e not-empty mixer vol.volume=2oo:b4r + atf_check -o ignore -e not-empty mixer vol.volume=+f0o:1 +} +volume_cleanup() +{ + restore_conf + restore_default +} + +atf_test_case mute cleanup +mute_head() +{ + atf_set "descr" "Test muting" +} +mute_body() +{ + load_dummy + mixer_exists + set_default + save_conf + + # Check that the mute control exists + atf_check -o not-empty mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=off + atf_check -o match:"=off" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=on + atf_check -o match:"=on" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=toggle + atf_check -o match:"=off" mixer vol.mute + + # Test deprecated interface + atf_check -o ignore -e empty mixer vol.mute=0 + atf_check -o match:"=off" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=1 + atf_check -o match:"=on" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=^ + atf_check -o match:"=off" mixer vol.mute + + # Test wrong values + atf_check -o ignore -e not-empty mixer vol.mute=foobar + atf_check -o ignore -e not-empty mixer vol.mute=10 +} +mute_cleanup() +{ + restore_conf + restore_default +} + +atf_test_case recsrc cleanup +recsrc_head() +{ + atf_set "descr" "Test recording source handling" +} +recsrc_body() +{ + load_dummy + mixer_exists + set_default + save_conf + test -n "$(mixer -s)" || atf_skip "no recording source found" + + recsrc=$(mixer -s | awk '{print $2}') + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=add + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=remove + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=set + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=toggle + + # Test deprecated interface + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=+ + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=- + atf_check -o ignore -e empty mixer ${recsrc}.recsrc== + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=^ + + # Test wrong values + atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=foobar + atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=10 +} +recsrc_cleanup() +{ + restore_conf + restore_default +} + +atf_init_test_cases() +{ + atf_add_test_case o_flag + atf_add_test_case d_flag + atf_add_test_case volume + atf_add_test_case mute + atf_add_test_case recsrc +} From nobody Mon Jul 29 15:35:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9Q30VNz5RSZk; Mon, 29 Jul 2024 15:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9Q19xbz42RH; Mon, 29 Jul 2024 15:35:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61pkL3vGSqVcsJ7bwTTrOazXQxrM2GPKZwTCPORcknk=; b=oCPnIKAESRT0Io9Qu6IY+Z5tTegRzxBYDGDbIntCPV3+zgrawAci/ujTzRTFGncg9/vjCE 6U7Za7mJ2cvGzrUo5lvSq7q2wwVwuBnq38QMuDMuEVcUngpiKpwMaVeLJX3kYUmntxAI3Y WhnbS+2Rod3+L9h1mcYwEJryyjMA6c2yrjR6fGaetcHY6nty6p8olh2qKBk+ydfqcLl6di psX2rJrdSxG6sPwlQ0DM+fjNc87s+bw/SyDaEV8whue9wKd1fj917n341lyZg4lmYzzNz8 8xYO7uowPcQZ0I+/Uq8pPwGQ117t99OLMTSUQBsKeYYSkOM6uUz+leoz+DVCiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267322; a=rsa-sha256; cv=none; b=dOqMmxFkMslPLznxmSfKr9peUcpnESnTLKmSHAbvVnnI7LT3VgLWi0lt5JfbVQFgTpF4v6 Ap6sJGdnjD3YexIXS6G4DM/Hiiq5yYAnARvyyzqbYx0HjW4MfXqg0RfFFVvHvpbMpH3ajn uDHJoWiaYAglsGwvIsSRYM5c4M6/Jl5bBzvq2ymlfDm6ppt+vq7odSx9h/NstyMzbIwkGR oFdWIYzNt2uuI61SR2MqwKQ2tbK3MYBHJUW4QiPnmFaDphymaRK5hcXnFahvCF+Icf4BVa 6eubd76FWiEvoST7igPAaLglSkhmOleDN95ofXwDBCeY3Jt2D3UGYeHMsvdH4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=61pkL3vGSqVcsJ7bwTTrOazXQxrM2GPKZwTCPORcknk=; b=gchmrfQWrVQNfDOyGKHwEOZuNtrMEuV09uFeqGQ7Z4Nbn8asOgM8ZcO85ewJYmAlb66NHn zC3nRmpE5RddvYq60O+V0WSwibPPP79+nmUT+/MuZ8HYOYZvFlCmxdtHX1RlPQxk8R8DqV AyWM5n0HMwYpK9pdULuEgvZWced1dYKmqBemaTE+mS7gxHJj8AZMoqrU8VgUusrZw6RKRq FpFJvNfqCelmXIAKtYVReUt9JRfI2vjFbXLvfPHjLSL46HXEzqe4CEMoI6iHRrC81LjToY WX30IPqYDBDRU9slQZlCTqsZ3gAofOs95coazevtQg/hDvYQJIEi3epv+6GnEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9Q0n0tzgDJ; Mon, 29 Jul 2024 15:35: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 46TFZMNB002494; Mon, 29 Jul 2024 15:35:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZM42002491; Mon, 29 Jul 2024 15:35:22 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:22 GMT Message-Id: <202407291535.46TFZM42002491@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: 6716cc7e2768 - stable/14 - sound: Fix memory leak in chn_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 6716cc7e276816c693647dbfa643fcd110a42f81 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6716cc7e276816c693647dbfa643fcd110a42f81 commit 6716cc7e276816c693647dbfa643fcd110a42f81 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:19 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:54 +0000 sound: Fix memory leak in chn_init() In case chn_init() fails, we are leaking memory by not freeing the feeder. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45979 (cherry picked from commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0) --- sys/dev/sound/pcm/channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index a18ef1cf4234..19808a43631a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1365,6 +1365,8 @@ out2: if (CHN_LOCKOWNED(c)) CHN_UNLOCK(c); if (ret) { + while (chn_removefeeder(c) == 0) + ; if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); From nobody Mon Jul 29 15:35:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9S5ztYz5RSjT; Mon, 29 Jul 2024 15:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9S3w4vz42MZ; Mon, 29 Jul 2024 15:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rExbApDwTxGSHi3bBOxGjKx9yuATdykss7BNvfiMzLk=; b=teikf3NFxxk7BY91uamGimZEUgyokOl6nvxIfHIvRnH33PKMhnXw/Ui8s2chirl5rhIvB8 WCfDBC7KDI36BeiSWK69bq7yGzh3O0OkSJ0ahqVeAZII4g89CZYtbmJUUCE2V8vQYBFvjV 3OSSEqXDORlj/q6MzxoRMVC/hvRZhd2NsL2szUfWRPHRjYKeImwSw+r2FyH7kBlWeCiF5i Ni7TEF5ltBrLpyPbAIJzfuLYGIlHp3TtS+UuNE46zISmMjbFm2gUQSmV2fqe5OnR6hrqPu avT/uGBPzny6OwjkF4vulaM/7GV3sWg/FDhYtuzqmjbuAqLxY+B7ckWJtNts/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267324; a=rsa-sha256; cv=none; b=U6jxCsPERzgh05SkYY7l5/bs2nQuQGTdq26HMBlAEa++rgjV5fDb8Hi4JRMupUKiy2YOfa Bsq7eTTaXqD/hir/owPEXAV36m1D2AkGmbS80Gz9g/187BbkyWEAyNIGmbIc3PpLB7tC2S TMhzYpY6SlFiqVh6brXQQ9GT5cZhiCxGRtPfSIGC7rMP4wl+faMWaW14Taq3gVe3tD8aqS IXFSUANefzrnJHHy7fWuuDX2HsbzEu3az/gjSn/lFewldhAA7u5LsACWK5RAqhzLOK63kT i5zWSNNnPj25A7xrO/Yrt5seeIUmzKKfR93xcL0O/3nHJqV7dLi7Y4YMJpdB2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rExbApDwTxGSHi3bBOxGjKx9yuATdykss7BNvfiMzLk=; b=VURI43PT292mujS9BxhnvN71xWQQGqqFzYDo/LAkQGawTR05lEj30WjTDEx83CLpsQXztr hwi41aUBZ0BW3QXf/aoKadAuy49++rPzdWQUbAc/tQm9IO5E+SUhAZ1ZQtIhgg/0B8RXk5 P3FDiMpOCA5cdcQFePXoLi6Twk8NuvI+9PYAGVQk/GFt8vEWnWDRAv4a2LW72D7Yz698zc g2nl1NRL/A1XtSZ/MEkxOBmVJBBXb9Uh9jhTg6p5xRjwH8bOY7VpV3oc7Zg8ZMcFHidq7z pQSreoS6YYXW8HaXsYnzToFUwi/aUxB/0R22ExsyglAfNOFOdPJS1PwnvXtlnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9S3Wtvzg3g; Mon, 29 Jul 2024 15:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46TFZOpG002587; Mon, 29 Jul 2024 15:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZOIj002584; Mon, 29 Jul 2024 15:35:24 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:24 GMT Message-Id: <202407291535.46TFZOIj002584@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: cbbc1f5db1d9 - stable/14 - sound: Remove unused FEEDER_DEBUG List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: cbbc1f5db1d9628ab6586a5072effb33629ee279 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cbbc1f5db1d9628ab6586a5072effb33629ee279 commit cbbc1f5db1d9628ab6586a5072effb33629ee279 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:42 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sound: Remove unused FEEDER_DEBUG No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45984 (cherry picked from commit c55f995502cbaa2d38b7a7003bc27805b28a6a29) --- sys/dev/sound/pcm/feeder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index fdbf2a8353e0..ad6966331f02 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -39,7 +39,6 @@ static MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); #define MAXFEEDERS 256 -#undef FEEDER_DEBUG struct feedertab_entry { SLIST_ENTRY(feedertab_entry) link; From nobody Mon Jul 29 15:35:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9R562sz5RSXJ; Mon, 29 Jul 2024 15:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9R2ql2z42KD; Mon, 29 Jul 2024 15:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUMDPUAapBHFhZur8K7neZpi8cq588Js633vZ3VdcJA=; b=awcfDckpjJr1/oupCR1cqxd0wxjYhbXp9SFBWaoeNsoGPZMAd0lrDETXXoYbW0M5mauwOB HvK0ksRZg20ctHQ2m2yoqIdy6GVlVTTYZLLk+BZFWS2pprgxAM3VXwdA3f0hVP3YYhKEWc bf5PQ+4+BiKD82IgXkwTXTtA90IUBH1al42Ba4LXgGwoiSlxTsK3b71llZ3ZaRCT1wwdks pzULS/GiGcynCz2DNKjkLQ8LftuIPRTjhCuiLlviXSdcWKwOvazHqOLlH4+Y7jicy1Y+QA EAGI9VAlCDMsjIXoIzip+aHB7BSfaIbKacGaXBmxCFC23fxLFasCwO4qze3GiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267323; a=rsa-sha256; cv=none; b=wv2gl/qRbqlia/PEMDNI2546sMeJDYYKxHU+Qyr8C+0dzvVAfjlgwichDxL8O9VeGLpssT bLqh/ucMPczGrWnf+anw3W05Ifj5zstcbpu6YlJ3xASupW3lDyQxSFYR6VpeOmYfVa6oLt LOWHfaD/uVF98Pp2oVrj0VYzIO6v3TvfK6KbZtgStZ5KzdiK4G3xpW8Q+k7eozXq0en0vD nxzKV/nO6CYmk6ycqxkO1fAzdBGAxYX48uwE0npxDoXirp7sAcsJmQaCha9EthEygPZ5Hi diCFqUOpYKcz6jrJsBuS/JvYhCLAXStyzyiiHv3dFgoqM1Bcp8io0Kr0FQ3vVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LUMDPUAapBHFhZur8K7neZpi8cq588Js633vZ3VdcJA=; b=a664HZjH/HWTA4/TMFp/TfTjODQsGBTb/W4pzGg0grpSBYTnJMWSU8cvN8t4LeAGfdm6GD V1xd64usmfvKpDjhtBiWySuSRIwFY6MAxu3OU0/Myn9tLT19itBWVozPiE5DgLGd7sW77J Xmg/x9178BNzlt9PURa0Cv9TYhgICQp/IvKWePoBOGqr5eSAf1YRT1X22nmLxVZmEMyS+w zXyNAD5nkglNJdzv1zr3xBEm3rIxbcicwps25XBxcPli59YIsCV0O1HnopfyJ/oIUdMhTj CW5a+5jLja64NDXlOk1edXxa8MNuiW7YawzK5zVumqJmaX+oiuZIAYzLBLpRhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9R2N6czgSw; Mon, 29 Jul 2024 15:35:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46TFZN4R002544; Mon, 29 Jul 2024 15:35:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZNPk002541; Mon, 29 Jul 2024 15:35:23 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:23 GMT Message-Id: <202407291535.46TFZNPk002541@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: 8f685b1f1ffa - stable/14 - sound: Rename chn_* feeder functions to feeder_* List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 8f685b1f1ffa91f5eb024b2b2fc88a0f56fec2d7 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8f685b1f1ffa91f5eb024b2b2fc88a0f56fec2d7 commit 8f685b1f1ffa91f5eb024b2b2fc88a0f56fec2d7 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:37 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sound: Rename chn_* feeder functions to feeder_* Avoid layering violation. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45983 (cherry picked from commit 29ff7b08be363f0d4345794bb951d5c0c8406a0a) --- sys/dev/sound/pcm/channel.c | 8 ++++---- sys/dev/sound/pcm/feeder.c | 6 +++--- sys/dev/sound/pcm/feeder.h | 6 +++--- sys/dev/sound/pcm/feeder_chain.c | 16 ++++++++-------- sys/dev/sound/pcm/feeder_eq.c | 4 ++-- sys/dev/sound/pcm/feeder_rate.c | 2 +- sys/dev/sound/pcm/mixer.c | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 19808a43631a..511d5256c06b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1287,7 +1287,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, __func__); goto out2; } - if (chn_addfeeder(c, fc, NULL)) { + if (feeder_add(c, fc, NULL)) { device_printf(d->dev, "%s(): failed to add feeder\n", __func__); goto out2; } @@ -1365,7 +1365,7 @@ out2: if (CHN_LOCKOWNED(c)) CHN_UNLOCK(c); if (ret) { - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) @@ -1407,7 +1407,7 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); @@ -2300,7 +2300,7 @@ chn_syncstate(struct pcm_channel *c) else bass = ((bass & 0x7f) + ((bass >> 8) & 0x7f)) >> 1; - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) { if (FEEDER_SET(f, FEEDEQ_TREBLE, treble) != 0) device_printf(c->dev, diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 0113299bd0d4..fdbf2a8353e0 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -232,7 +232,7 @@ feeder_getclass(struct pcm_feederdesc *desc) } int -chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc) +feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc) { struct pcm_feeder *nf; @@ -250,7 +250,7 @@ chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederd } int -chn_removefeeder(struct pcm_channel *c) +feeder_remove(struct pcm_channel *c) { struct pcm_feeder *f; @@ -264,7 +264,7 @@ chn_removefeeder(struct pcm_channel *c) } struct pcm_feeder * -chn_findfeeder(struct pcm_channel *c, u_int32_t type) +feeder_find(struct pcm_channel *c, u_int32_t type) { struct pcm_feeder *f; diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h index c3d6f89d102e..f2a865d3d2f9 100644 --- a/sys/dev/sound/pcm/feeder.h +++ b/sys/dev/sound/pcm/feeder.h @@ -58,10 +58,10 @@ u_int32_t snd_fmtbestbit(u_int32_t fmt, u_int32_t *fmts); u_int32_t snd_fmtbestchannel(u_int32_t fmt, u_int32_t *fmts); u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts); -int chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, +int feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc); -int chn_removefeeder(struct pcm_channel *c); -struct pcm_feeder *chn_findfeeder(struct pcm_channel *c, u_int32_t type); +int feeder_remove(struct pcm_channel *c); +struct pcm_feeder *feeder_find(struct pcm_channel *c, u_int32_t type); void feeder_printchain(struct pcm_feeder *head); int feeder_chain(struct pcm_channel *); diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 52351ef58510..555cd86d60e5 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -157,7 +157,7 @@ feeder_build_format(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = cdesc->target.afmt; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_format\n", __func__); @@ -230,7 +230,7 @@ feeder_build_rate(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_rate\n", __func__); @@ -309,7 +309,7 @@ feeder_build_matrix(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->out = SND_FORMAT(cdesc->current.afmt, cdesc->target.matrix->channels, cdesc->target.matrix->ext); - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_matrix\n", __func__); @@ -365,7 +365,7 @@ feeder_build_volume(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_volume\n", __func__); @@ -433,7 +433,7 @@ feeder_build_eq(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_eq\n", __func__); @@ -472,7 +472,7 @@ feeder_build_root(struct pcm_channel *c, struct feeder_chain_desc *cdesc) return (ENOTSUP); } - ret = chn_addfeeder(c, fc, NULL); + ret = feeder_add(c, fc, NULL); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_root\n", __func__); @@ -513,7 +513,7 @@ feeder_build_mixer(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_mixer\n", __func__); @@ -588,7 +588,7 @@ feeder_chain(struct pcm_channel *c) CHN_LOCKASSERT(c); /* Remove everything first. */ - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; KASSERT(c->feeder == NULL, ("feeder chain not empty")); diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index a097b13cd986..3c9d9cda9d62 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -584,7 +584,7 @@ sysctl_dev_pcm_eq(SYSCTL_HANDLER_ARGS) CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, FEEDEQ_STATE, val); CHN_UNLOCK(c); @@ -643,7 +643,7 @@ sysctl_dev_pcm_eq_preamp(SYSCTL_HANDLER_ARGS) CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, FEEDEQ_PREAMP, val); CHN_UNLOCK(c); diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index c8cc67e8fa80..77de21e7a31a 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -268,7 +268,7 @@ sysctl_hw_snd_feeder_rate_quality(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); CHN_FOREACH(c, d, channels.pcm) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_RATE); + f = feeder_find(c, FEEDER_RATE); if (f == NULL || f->data == NULL || CHN_STARTED(c)) { CHN_UNLOCK(c); continue; diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 0cf6a9f42f8f..6d74fa975f03 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -224,7 +224,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d, CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, tone, level); CHN_UNLOCK(c); From nobody Mon Jul 29 15:35:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9V05Jkz5RSSR; Mon, 29 Jul 2024 15:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9T4skDz42Mt; Mon, 29 Jul 2024 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXda1LX+za3VjJV0uupNlZHSOEGUUimoOb8SgQ0yCU=; b=a3PCELQwUXEAc376/5fsdU18qVTXOxU41wezXvTAmhZTpIwDy9f55BaBQKF3Wytrq7L90K ZXelcHHlxLJlTWP9azkIOEOP3aI/W7vpx1O9Vz7YDqAYCVoue7bJwAuta5T60voyvP5yFL sA1TUvjC/G318dgfmAGFkhee+8RBavMNNVxwP/6Cwb3Wrd2+A1BY/2MbKtLmdIXfHPXps1 wXPKQziVK4LCfFufx20CpEdSPMb7YBzcyusAxHUUUMCu6H/SMZPxT00iT+Vyv0Tdwn7QV+ Y/2AwNoMlfxD5GhzDXKze2ZmvyWnJi/khtRZnajMDnLCYgl8bN4YTEd4kFMi+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267325; a=rsa-sha256; cv=none; b=vrO+HYMY6zz0HQsl11+9Z4/3ICT30R2SfNjTJGtF7oeaOHLFZLVnIWbLRsy6U5Wh+Hy6N1 JKqGVCyxyb2ypI436qK/xnRjNG8S8M3G+vRVkZ2OMS63DNZImJ++45FJl/+Uo3WeWAKVNQ HyOVOPzsxuZHG1a7exrSy90zmtuQ/DfCSlP7i0JzUvI57Z0Lgly8EaxKCX5sFLfV1ixglT NyYg6xpECHajY96jI8VJiX0awRnktuK1SBkK9ec/lpITQeeyIa62XDzZRHdqVI8xRnR7T9 nzgI6ou2+snqscKOZHpJplG9Et3w7xGJgVQkmJalIEvWL0fo7DorSfJFKyRf4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JbXda1LX+za3VjJV0uupNlZHSOEGUUimoOb8SgQ0yCU=; b=QszogF7V9qGRn4XsRJKqS7ow7ml58xoqTnMZyOJ2Y87EEpNjSBzW3MNrMRl92MMQJ4KHQT 93VYXfs2cYNleOKOStqrS7dpyDbHxXpoXgGS/6Rd9lm7xqHbNIuuyoPTr84GaUBl6MGI71 OYYLZzsxg+cqYCcpj7XC4BszmI3VpHqBRaq3Lsnka/5hsCoDXkR1X5XNVqvDbVftXIivnI D+kj5UWB/Oj1OAMyY5znIa+SbWEIEepd4vGxyWwK4VbKsBKAQOjHpv03VpxQkeU70exaZn kPtbRlAosWGWH/IbB9FdyfVfWmYDqJlXhAABFp2ZW66uMS/pN29u+TO9SsplEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9T4V9YzgDK; Mon, 29 Jul 2024 15:35:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46TFZPxW002627; Mon, 29 Jul 2024 15:35:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZPTT002624; Mon, 29 Jul 2024 15:35:25 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:25 GMT Message-Id: <202407291535.46TFZPTT002624@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: a619d8c76c63 - stable/14 - sound: Simplify chn_init() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: a619d8c76c635ab7b3d851b2630700ab46b534db Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a619d8c76c635ab7b3d851b2630700ab46b534db commit a619d8c76c635ab7b3d851b2630700ab46b534db Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:47 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sound: Simplify chn_init() - Remove unnecessary CHN_[UN]LOCKs. - Improve device_printf() messages. - Remove redundant checks. - Remove 0 assignments, since the channel is allocated with M_ZERO. - Re-organize sections in a more coherent way. - Remove "out1" label, just return NULL directly. - Rename "out2" to "fail" and simplify logic. - Do not check the return value of dsp_unit2name(), as it is guaranteed not to fail (we pass a valid channel type). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45985 (cherry picked from commit 5b209e153b58515c0315f5902e18ecd7d75ecd2a) --- sys/dev/sound/pcm/channel.c | 177 ++++++++++++++++---------------------------- 1 file changed, 63 insertions(+), 114 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 511d5256c06b..ce4fb7222ddb 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1164,8 +1164,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct pcm_channel *c; struct feeder_class *fc; struct snd_dbuf *b, *bs; - char *dirs, *devname, buf[CHN_NAMELEN]; - int i, ret, direction, rpnum, *pnum, max, type, unit; + char *dirs, buf[CHN_NAMELEN]; + int i, direction, *pnum, max, type, unit; PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); @@ -1203,148 +1203,106 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, device_printf(d->dev, "%s(): invalid channel direction: %d\n", __func__, dir); - goto out1; + return (NULL); } - unit = 0; - - if (*pnum >= max || unit >= max) { - device_printf(d->dev, "%s(): unit=%d or pnum=%d >= than " - "max=%d\n", __func__, unit, *pnum, max); - goto out1; + if (*pnum >= max) { + device_printf(d->dev, "%s(): cannot allocate more channels " + "(max=%d)\n", __func__, max); + return (NULL); } - rpnum = 0; - + unit = 0; CHN_FOREACH(c, d, channels.pcm) { if (c->type != type) continue; unit++; if (unit >= max) { - device_printf(d->dev, - "%s(): chan=%d >= max=%d\n", __func__, unit, max); - goto out1; + device_printf(d->dev, "%s(): cannot allocate more " + "channels for type=%d (max=%d)\n", + __func__, type, max); + return (NULL); } - rpnum++; - } - - if (*pnum != rpnum) { - device_printf(d->dev, - "%s(): pnum screwed: dirs=%s pnum=%d rpnum=%d\n", - __func__, dirs, *pnum, rpnum); - goto out1; } PCM_UNLOCK(d); b = NULL; bs = NULL; + c = malloc(sizeof(*c), M_DEVBUF, M_WAITOK | M_ZERO); c->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); + chn_lockinit(c, dir); + CHN_INIT(c, children); + CHN_INIT(c, children.busy); + c->direction = direction; c->type = type; c->unit = unit; + c->format = SND_FORMAT(AFMT_U8, 1, 0); + c->speed = DSP_DEFAULT_SPEED; c->pid = -1; + c->latency = -1; + c->timeout = 1; strlcpy(c->comm, CHN_COMM_UNUSED, sizeof(c->comm)); c->parentsnddev = d; c->parentchannel = parent; c->dev = d->dev; c->trigger = PCMTRIG_STOP; - chn_lockinit(c, dir); - devname = dsp_unit2name(buf, sizeof(buf), c); - if (devname == NULL) { - ret = EINVAL; - device_printf(d->dev, "%s(): failed to create channel name", - __func__); - goto out2; - } + snprintf(c->name, sizeof(c->name), "%s:%s:%s", - device_get_nameunit(c->dev), dirs, devname); + device_get_nameunit(c->dev), dirs, + dsp_unit2name(buf, sizeof(buf), c)); - CHN_INIT(c, children); - CHN_INIT(c, children.busy); - c->latency = -1; - c->timeout = 1; + c->matrix = *feeder_matrix_id_map(SND_CHN_MATRIX_1_0); + c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; - ret = ENOMEM; - b = sndbuf_create(c->dev, c->name, "primary", c); - if (b == NULL) { - device_printf(d->dev, "%s(): failed to create hardware buffer\n", - __func__); - goto out2; - } - bs = sndbuf_create(c->dev, c->name, "secondary", c); - if (bs == NULL) { - device_printf(d->dev, "%s(): failed to create software buffer\n", - __func__); - goto out2; - } + for (i = 0; i < SND_CHN_T_MAX; i++) + c->volume[SND_VOL_C_MASTER][i] = SND_VOL_0DB_MASTER; + + c->volume[SND_VOL_C_MASTER][SND_CHN_T_VOL_0DB] = SND_VOL_0DB_MASTER; + c->volume[SND_VOL_C_PCM][SND_CHN_T_VOL_0DB] = chn_vol_0db_pcm; CHN_LOCK(c); + chn_vpc_reset(c, SND_VOL_C_PCM, 1); + CHN_UNLOCK(c); - ret = EINVAL; fc = feeder_getclass(NULL); if (fc == NULL) { device_printf(d->dev, "%s(): failed to get feeder class\n", __func__); - goto out2; + goto fail; } if (feeder_add(c, fc, NULL)) { device_printf(d->dev, "%s(): failed to add feeder\n", __func__); - goto out2; + goto fail; } - /* - * XXX - sndbuf_setup() & sndbuf_resize() expect to be called - * with the channel unlocked because they are also called - * from driver methods that don't know about locking - */ - CHN_UNLOCK(c); - sndbuf_setup(bs, NULL, 0); - CHN_LOCK(c); + b = sndbuf_create(c->dev, c->name, "primary", c); + bs = sndbuf_create(c->dev, c->name, "secondary", c); + if (b == NULL || bs == NULL) { + device_printf(d->dev, "%s(): failed to create %s buffer\n", + __func__, b == NULL ? "hardware" : "software"); + goto fail; + } c->bufhard = b; c->bufsoft = bs; - c->flags = 0; - c->feederflags = 0; - c->sm = NULL; - c->format = SND_FORMAT(AFMT_U8, 1, 0); - c->speed = DSP_DEFAULT_SPEED; - c->matrix = *feeder_matrix_id_map(SND_CHN_MATRIX_1_0); - c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; - - for (i = 0; i < SND_CHN_T_MAX; i++) { - c->volume[SND_VOL_C_MASTER][i] = SND_VOL_0DB_MASTER; - } - - c->volume[SND_VOL_C_MASTER][SND_CHN_T_VOL_0DB] = SND_VOL_0DB_MASTER; - c->volume[SND_VOL_C_PCM][SND_CHN_T_VOL_0DB] = chn_vol_0db_pcm; - - memset(c->muted, 0, sizeof(c->muted)); - - chn_vpc_reset(c, SND_VOL_C_PCM, 1); - - ret = ENODEV; - CHN_UNLOCK(c); /* XXX - Unlock for CHANNEL_INIT() malloc() call */ c->devinfo = CHANNEL_INIT(c->methods, devinfo, b, c, direction); - CHN_LOCK(c); if (c->devinfo == NULL) { - device_printf(d->dev, "%s(): NULL devinfo\n", __func__); - goto out2; + device_printf(d->dev, "%s(): CHANNEL_INIT() failed\n", __func__); + goto fail; } - ret = ENOMEM; if ((sndbuf_getsize(b) == 0) && ((c->flags & CHN_F_VIRTUAL) == 0)) { device_printf(d->dev, "%s(): hardware buffer's size is 0\n", __func__); - goto out2; + goto fail; } - ret = 0; - c->direction = direction; - sndbuf_setfmt(b, c->format); sndbuf_setspd(b, c->speed); sndbuf_setfmt(bs, c->format); sndbuf_setspd(bs, c->speed); + sndbuf_setup(bs, NULL, 0); /** * @todo Should this be moved somewhere else? The primary buffer @@ -1355,42 +1313,33 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, bs->sl = sndbuf_getmaxsize(bs); bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_NOWAIT); if (bs->shadbuf == NULL) { - ret = ENOMEM; device_printf(d->dev, "%s(): failed to create shadow " "buffer\n", __func__); - goto out2; + goto fail; } } -out2: - if (CHN_LOCKOWNED(c)) - CHN_UNLOCK(c); - if (ret) { - while (feeder_remove(c) == 0) - ; - if (c->devinfo) { - if (CHANNEL_FREE(c->methods, c->devinfo)) - sndbuf_free(b); - } - if (bs) - sndbuf_destroy(bs); - if (b) - sndbuf_destroy(b); - CHN_LOCK(c); - c->flags |= CHN_F_DEAD; - chn_lockdestroy(c); - PCM_LOCK(d); + PCM_LOCK(d); - kobj_delete(c->methods, M_DEVBUF); - free(c, M_DEVBUF); + return (c); - return (NULL); - } +fail: + while (feeder_remove(c) == 0) + ; + if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) + sndbuf_free(b); + if (bs) + sndbuf_destroy(bs); + if (b) + sndbuf_destroy(b); + CHN_LOCK(c); + chn_lockdestroy(c); + + kobj_delete(c->methods, M_DEVBUF); + free(c, M_DEVBUF); PCM_LOCK(d); - return (c); -out1: return (NULL); } From nobody Mon Jul 29 15:35:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9W23kkz5RSh6; Mon, 29 Jul 2024 15:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9V6Fh1z42QF; Mon, 29 Jul 2024 15:35:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TZzfdBzzRhTiB9Q6jPiD/d9LxfB56TrUlyLvH8+ngUE=; b=FybOTikz3SsLOYG8SdzWSJe3qxHD3CfqlWIdCq+IDPAXpyH5f6a6yO/Op9pf8xWcb1aJ36 U/9V2rYJMX57njaZVAjljWEVvr6rIdqsN9g6i7i0YhYMVvwbC5v537bDZv+8BB7vE4KKNp tjkadPgCOPzWNHn+7dNHbkFKMFBDrUMNkrvUAeCFHqOkDlodo22wVBDH+HtJWa397TRlxy 8vjF7pYIC9NgahmqFdw7tgGXw9h5wGCKgNMZwzFxfJS/Sk9YgXA6nRVrhn+qaS+OhnZFpn K3n3+nkv3YGAT2+Bk8nfrzICLPzov9AVglFPJ9cr3McvWQ3E9VfCYkB7jjC+vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267326; a=rsa-sha256; cv=none; b=e1FfVF7KnNKHbPQXr6MLWl/7dg6fxNIaaynuOkTPXANLWZrMC8Zk0XkIKtRPjyuTT9TvBl pfxM/ySzqUgvzqlJDPHKDPFqJ+GWJd2GnD5eUDvs1x+ecIYM3DJx2ada2EMbbuVoX2HxiH 9dai2RzK+CQLLv+F6+v0TQXO8onHwK6hDOIxfVx19cgo3He71yaYG9Jo0iEL2kEcj8VdvB FrMLSJVzJxo+fg3IC94UrLz8BYhxQFBvje8EgoA1PHnQqMJh4RfE6aK2v9AQWOcnvYi88h zT5AOvcTHNlzR62yiaZcHr4Et90Mmru9pOskgKxSeUkdbpaVqSXJ1EvLSABVrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TZzfdBzzRhTiB9Q6jPiD/d9LxfB56TrUlyLvH8+ngUE=; b=t1dia+BvDcpjBzyo9yH9gNudu7Jdxa4qn811bT9aaFXKP/QLdrFhgP2DSONeEFcAde5uyH MKB0fuKIWmWh/yGbJ8RJqhCcTT4oIEDUR/sYkM4O4ojJZtPuzLj2wJEGQ01VNnWtRUPHaJ v7Cy927HfzJbpkgNNZKqByBsQd3VYB2uHxHVL35okR7xuNx2BE/0eHd4mITUXC9Mmmsw4o BSuAsQY24uiF0bEuDKYhCOEwW4jJjZnDr+nLOhUqLFFRZaK2HFnlK5IWDueeMfvq61iloL byAO4YqCa0Y8EuiG7uSgpO61uVzL8nPUK2ao4mMjyBkjSzBECyx/2BQ3UtZqRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9V5h79zgDL; Mon, 29 Jul 2024 15:35: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 46TFZQNa002674; Mon, 29 Jul 2024 15:35:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZQHr002671; Mon, 29 Jul 2024 15:35:26 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:26 GMT Message-Id: <202407291535.46TFZQHr002671@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: 9b5e6dfe18a2 - stable/14 - sound: Remove unused defines from pcm/sound.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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9b5e6dfe18a2f39761f16abc7a08c2c88a753c34 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9b5e6dfe18a2f39761f16abc7a08c2c88a753c34 commit 9b5e6dfe18a2f39761f16abc7a08c2c88a753c34 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:52 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sound: Remove unused defines from pcm/sound.h Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45986 (cherry picked from commit f477d412530a8cb9d8e058d00189ce127584f6f6) --- sys/dev/sound/pcm/sound.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index e4a3ba41ee7f..5f32dd767fe8 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -126,9 +126,6 @@ struct snd_mixer; #define SD_F_PRIO_RD 0x10000000 #define SD_F_PRIO_WR 0x20000000 -#define SD_F_PRIO_SET (SD_F_PRIO_RD | SD_F_PRIO_WR) -#define SD_F_DIR_SET 0x40000000 -#define SD_F_TRANSIENT 0xf0000000 #define SD_F_BITS "\020" \ "\001SIMPLEX" \ @@ -146,8 +143,7 @@ struct snd_mixer; "\015EQ_BYPASSED" \ "\016EQ_PC" \ "\035PRIO_RD" \ - "\036PRIO_WR" \ - "\037DIR_SET" + "\036PRIO_WR" #define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL && \ !((x)->flags & SD_F_DYING)) @@ -162,7 +158,6 @@ struct snd_mixer; /* many variables should be reduced to a range. Here define a macro */ #define RANGE(var, low, high) (var) = \ (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) -#define DSP_BUFFSIZE (8192) /* make figuring out what a format is easier. got AFMT_STEREO already */ #define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) @@ -242,22 +237,12 @@ enum { #define DSP_DEFAULT_SPEED 8000 -#define ON 1 -#define OFF 0 - extern int pcm_veto_load; extern int snd_unit; extern int snd_verbose; extern devclass_t pcm_devclass; extern struct unrhdr *pcmsg_unrhdr; -/* - * some macros for debugging purposes - * DDB/DEB to enable/disable debugging stuff - * BVDDB to enable debugging when bootverbose - */ -#define BVDDB(x) if (bootverbose) x - #ifndef DEB #define DEB(x) #endif From nobody Mon Jul 29 15:35:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9Y2j76z5RSSZ; Mon, 29 Jul 2024 15:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9Y0y8Dz42gj; Mon, 29 Jul 2024 15:35:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fb81eUkoaZmdnBWxexy8S+FmYC6zJwtDCMQWDSv+fP4=; b=wVEqM/wnzc8+YBD6HKONmy6xWEJogJ+CH6sj43dpp4pqI/lW/pTKrnJHNfc9lRTY7fHgoB cJpFF5vrdgaRu55lkOrtO4zcOzi017LTJ0dTVQV4mCTod5p/tpoKlYIMPxUHLvxI5iJ6Hd gTTwkoCsdMEyKRjAwQE7QAsurorXUdkVBiMPE1AFpok3XPFSi+IdUNga+1AozhlPzQ3Ci2 /l5uxC8lGZ4SCEqjUAuYtDOXw9zqZkKOEAxBicOcMo1Vo9ES1vlaRCOAxP4jRubQqhR678 3Hr6XZi6r2ld9U8JpUhLcj8TFgGFKJ+865u5YAiXem/u5Iieo/s7cy4l1W9LAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267329; a=rsa-sha256; cv=none; b=at8vVtANrO9feqHHov2y2tyllq17ntKU9b/RVeC+F3JRirNQrUSBsg5zFLR7rE2usNU5s+ OWZe/vRELCx+EQfOuSjJopQ6k7SqVHbmfaJXUkKt6jKq1MdeWcA8/51ezkPyAPLWYcc2+j XVyZACqYfiWCJci5H0S4FIvmcqCezJtIgom2MFBQX+LHFHBvNAhb3ne8onROYtszbmHg8I Ucux7GlzF2OUP24+kAXeoBs1sXdyy83QQwbg0qR4HVBaLxkRoT8cB35dsCrywI/gZ4PdPa zHMAbNcViRDbdHHgY07vejvQbMSglleoMZDacbYinhNIkxcfybLk4RUZ2UOAog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fb81eUkoaZmdnBWxexy8S+FmYC6zJwtDCMQWDSv+fP4=; b=HZo1U/r474MaQt/vO2OxCKs1rDB9T6rqDHYCZkLoZE8C+R+I8cH1M4sx4IBmZKLKhSEl4I FBIjN3yXImoh6G2BDSuOPuoHFCmukmQJrUubpvuLe7yi5I4HHK4ojAdlvSJ4V6novolEYw ex9FiMDHwCiJGaja7LXP75VZwp8PpByP3EYz1O76Dwvtbr60CMnHgmnR5h5nwsedtihUsh IZElgzlPpoH+MAfN2WOYYrItGkFzg1+0mi8kAqP4yc9xmR7A1dYVf026v0EmX0LZ2NtjOI N+v+50BUVs12Tihevs5wEMHzM46uLqEp9hI6U2MV9d7iHIfvEoa4fQDWy4zYOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9Y0TBGzg3j; Mon, 29 Jul 2024 15:35: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 46TFZSFG002752; Mon, 29 Jul 2024 15:35:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZSAo002748; Mon, 29 Jul 2024 15:35:28 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:28 GMT Message-Id: <202407291535.46TFZSAo002748@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: 695313daa341 - stable/14 - sndstat.4: Fix typo List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 695313daa341ddc8a5bd5cde041532f9bd944928 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=695313daa341ddc8a5bd5cde041532f9bd944928 commit 695313daa341ddc8a5bd5cde041532f9bd944928 Author: Christos Margiolis AuthorDate: 2024-07-27 11:56:02 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sndstat.4: Fix typo Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46165 (cherry picked from commit f0eceecf5ab51a68d713f9a5a7f360964d0a49ce) --- share/man/man4/sndstat.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index bef444529e5f..266bfcf304fe 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -198,7 +198,7 @@ There are a number of name/value pairs inside this field: .Bl -tag -width ".Dv hwbuf_blkcnt" .It Dv name Channel name. -.It Dv parenchan +.It Dv parentchan Parent channel name (e.g., in the case of virtual channels). .It Dv unit Channel unit. From nobody Mon Jul 29 15:35:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9X1dZMz5RSVJ; Mon, 29 Jul 2024 15:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9W6qYmz42SV; Mon, 29 Jul 2024 15:35:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sGRJ6aRTsSjZ6KLwdM9LUlWj1kYGnzebEAjrwirOqk4=; b=sInxLJzd3i0w49mxp5JbRE9psBjh9t9UQpZrP8+/HvMUA3zdSJjuiuoodFLzF0JHW1UyNk BO3mKxXIZmTNu23XRLBD1lhs4eTmPcVXPUwsNyIoLt5lNWjVmPMBCLJy5HRVRbp+nrfFoO HmoLnYSlHNPQfRsT3mX9M4mAoDckoWVN60WCmk2k8oxKR0/cU2+K9o9zUJdkizwqD19HV5 T57/xP8xFfuxtSeUDjXpGjBH5ruE0vhyxpckk72w3mb+/PiUOGmjAovXyf+hehXoOETy5i 2thoWjyYutADzS4NJhB4vIc49qjmdbVQYDBvrCOItC0dbaSw2A2H0iYfapSeyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267328; a=rsa-sha256; cv=none; b=mKCxAtdaY8MtwNIAdAaoBK5sy2dXYk5Ze/E4M1dAXNk9e22CZkQrf3Fb4GoLN0jx7S5XSn j/MZaDrblKi7IMUJWjgJMR1TDPx+D5ZqxKpNXZ5oPsZlUGoULqMTmU0duxrlGGoIFolXJZ OTgDpBUdl8CecAWf3bgBl2YpMq+BXxUKgBwi6Ga71N5GdANh4ud9ET1fXTMRALC/5C9pNe +l6OIbrVdGKpmM4pPlAI5SKmndpIk6mtDLK9ikEWl0Nu+EzOUBllLIjuVH0es3VOHAuYfy 4zdzACXEYkmhd9jBbmSxurlgS4ZTJFH1cjoNna1gZhb29XObQSEIrbQiJ4TLHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sGRJ6aRTsSjZ6KLwdM9LUlWj1kYGnzebEAjrwirOqk4=; b=crVnKsGLWDgLcSpNsw/amM0pwINr6RAh4wYsLFPS8JgtOaqBOxwktrNrhHbHsCNGmmG0/e OJcnwHSafnS4NMkT9Ww4Ye3EGBl8FVkSEVzGyNgUKT3a2oGIPo3RP1jCv7rlLEgKHyz5iA MMU0JJnXxZofwpjG8NbLLvdbHAwzFEQ16Nj3O+DOdMcTSm99dSvMX/zR0rw7WMMgLvz3zz 240sfVVe5QvX1NOHmQfEQPfI85peBRuRZGjjDZ1WN4scyVDGpEh+YmQRE9wOSeuHRWykTW hl0CFidb8inuwV5GQWBbjqBmDhPgIqYyRsuxg+ymacWD5HNjzHFMrXz5xycBow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9W6Rqpzg3h; Mon, 29 Jul 2024 15:35: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 46TFZRWg002713; Mon, 29 Jul 2024 15:35:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZRNK002710; Mon, 29 Jul 2024 15:35:27 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:27 GMT Message-Id: <202407291535.46TFZRNK002710@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: a9e27006db60 - stable/14 - sound: Simplify feeder_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: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a9e27006db60edc60ffbe650b077abf64a42c025 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a9e27006db60edc60ffbe650b077abf64a42c025 commit a9e27006db60edc60ffbe650b077abf64a42c025 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:57 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 sound: Simplify feeder_remove() Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D46100 (cherry picked from commit 00172d20070a544e0514cce9f94475c5525fd15e) --- sys/dev/sound/pcm/channel.c | 6 ++---- sys/dev/sound/pcm/feeder.c | 14 ++++++-------- sys/dev/sound/pcm/feeder.h | 2 +- sys/dev/sound/pcm/feeder_chain.c | 3 +-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index ce4fb7222ddb..e0fd24805a21 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1324,8 +1324,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, return (c); fail: - while (feeder_remove(c) == 0) - ; + feeder_remove(c); if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); if (bs) @@ -1356,8 +1355,7 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - while (feeder_remove(c) == 0) - ; + feeder_remove(c); if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); sndbuf_destroy(bs); diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index ad6966331f02..716eb07feaae 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -248,18 +248,16 @@ feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc return 0; } -int +void feeder_remove(struct pcm_channel *c) { struct pcm_feeder *f; - if (c->feeder == NULL) - return -1; - f = c->feeder; - c->feeder = c->feeder->source; - feeder_destroy(f); - - return 0; + while (c->feeder != NULL) { + f = c->feeder; + c->feeder = c->feeder->source; + feeder_destroy(f); + } } struct pcm_feeder * diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h index f2a865d3d2f9..1e240d934e94 100644 --- a/sys/dev/sound/pcm/feeder.h +++ b/sys/dev/sound/pcm/feeder.h @@ -60,7 +60,7 @@ u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts); int feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc); -int feeder_remove(struct pcm_channel *c); +void feeder_remove(struct pcm_channel *c); struct pcm_feeder *feeder_find(struct pcm_channel *c, u_int32_t type); void feeder_printchain(struct pcm_feeder *head); int feeder_chain(struct pcm_channel *); diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 555cd86d60e5..588bae2ff281 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -588,8 +588,7 @@ feeder_chain(struct pcm_channel *c) CHN_LOCKASSERT(c); /* Remove everything first. */ - while (feeder_remove(c) == 0) - ; + feeder_remove(c); KASSERT(c->feeder == NULL, ("feeder chain not empty")); From nobody Mon Jul 29 15:35:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXj9Z4HzPz5RSm2; Mon, 29 Jul 2024 15:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXj9Z1fYTz42WK; Mon, 29 Jul 2024 15:35:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16XC50NovwxkglACj+xZwVhfgR1dRTEKGk2Wrd817hw=; b=yxOSXtl8dOxPU3zFJ9GmK9fDse1vQZA/lQaqy2CxgZwLAB/GdXyPbExrOdCUkKN1lp3/sV k2caUChGTZHY5Ncj0kGrFL2ayWW6THKpdr3i/45lJuGW4su1lc0TYupja/RlS78cE96P8K lnkGLiLsvDQIqdkSECixG/KQF68Yx6hAp1Yc2hFEdRvmWJ6c5apG6Tg+px/bwIsmY1ldFn crbFWAE0GXFcX/+2aIP+sMsiYjGqDdTmT3xMlemmCQMwFSaNA53YzfQVzB9+5ASIPgJ4GE UeLLrd3ShoaMglpY1wqmWgVfh+bC9nsUrJlC+/pmH+l9TfARGBW04pRTbi8OGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722267330; a=rsa-sha256; cv=none; b=RCxk8YmSYTokb/ScfzgsfIEGLbZzOqqXGtIjJRsGalE4y2FFIOTi4uINlkCSL3VjHC/4NY cZorpRLaaspcb2lyHJ2MjENK6TjuSGE0SeZmUls0mzSNFqce4fKdL09tPCRvdooDO/0ZBw 6WhHF9MjTWSGR0iH5xTQrinMK2FMcoWhIWBuT3D7ejvXtWb8Cax2gVRomAdWAyK0JkPkbw W7qa0OwXgpjjNgl6tWWz937nhPafEx+mAQkX39cH6hSl/vKkuRDhbvgwfDIzAzBn5+yI7d DsSfLQjrUXRaulfPhdTAPrm7az81cYJYY/umnWZhusRCtqVzdECPmm/hWLHnMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722267330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=16XC50NovwxkglACj+xZwVhfgR1dRTEKGk2Wrd817hw=; b=DvD2XpeXEuAVKCTN/vGu1rAvtF9wkE8f3W23iyVnes0yj/As84Trk6UNmK9v08Dqz+NSt7 JCEZIhH1IcIGI84caHWJ8QxbS35lf1TRTNhRDmGV+84lCWNyJMZ7WRubUP5WLM/6sxKpiP 7EBYXavrcae4SnsfRbW/rIg6NjH+6zQtnnjWfVgIMisLGz9P2Gj+BhsjsWMi5RjLC39VFE yRzn3HEp+Ut6JF35kX245dgLwLfXvNQxiP7Xa1lyMex8hVr4BK/cqw3dSU6KRbDma5R8E3 J7ppR+e05inY7qF70MB2hPaVihUaYVRbOI9VR3gw6LUGVwRMk655MJencqfXdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXj9Z1HKHzgYd; Mon, 29 Jul 2024 15:35: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 46TFZUAH002800; Mon, 29 Jul 2024 15:35:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TFZUtd002797; Mon, 29 Jul 2024 15:35:30 GMT (envelope-from git) Date: Mon, 29 Jul 2024 15:35:30 GMT Message-Id: <202407291535.46TFZUtd002797@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: 2684490714ac - stable/14 - BSD.tests.dist: Add entry for mixer tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 2684490714aceb29f59201910f515eabf6b6b37e Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2684490714aceb29f59201910f515eabf6b6b37e commit 2684490714aceb29f59201910f515eabf6b6b37e Author: Li-Wen Hsu AuthorDate: 2024-07-27 18:44:28 +0000 Commit: Christos Margiolis CommitDate: 2024-07-29 15:34:55 +0000 BSD.tests.dist: Add entry for mixer tests Fixes: 94a86f3f6920 mixer(8): Add tests Sponsored by: The FreeBSD Foundation (cherry picked from commit 21e98f6d195a5db63b17025f339684048834e1aa) --- etc/mtree/BSD.tests.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 1b37720363f1..c75e2eabab69 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1183,6 +1183,8 @@ .. makefs .. + mixer + .. newsyslog .. nmtree From nobody Mon Jul 29 16:12:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXk0p3mp5z5RWZq; Mon, 29 Jul 2024 16:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXk0p35JBz49S1; Mon, 29 Jul 2024 16:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722269578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1JfKO5Y6XiX6Ks5cLc0QsBO2LDLcZCgdgJfVnvQ1U84=; b=W60wlHnpP1c8EvWSUJOkgW7ORW0iqXjQyUgBwOvK51W/Xfl98OAh7NjmRsaL3WiX/rg7AM 3F7jgVNelC6MPLWoNe57cEEHZNCJ5M5Xk7peS+5sSPEpFw/D8a9ujoE5A3ae2C/wBppajY UDVfCVOYMbEsv1QTqtwxzKUFBfn10ARdzG6lwsAsYtqe3EidN4if2JFJSpDc2NI88vLip4 y2sSX+QyJzUgWxauGz7ODgUr26sPAfZCQP10mqZu7h5Gkh/6+2A4BwpsqChJomHov9g/aM ny//Hq2nSt9iz8TNAfSvKF+uXIx/RcQTHxaZKETPkFlcIkyqM4upF0qoKTYmZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722269578; a=rsa-sha256; cv=none; b=AOK6RrMYdE1ARyfCgThLQBj3VG3uVso1xtJc0wWfcxQttdA3otw+aH1olbpN0jMJiDjvrt +T2POW3/zFsJBis7HhEOpX9Px9zlK0gl19aJhuu0LAvfPOfX2BwuGmbU+4MsMfWK9J+hN5 6mHr5Re4+xk//Ei9Xg3Chh1eQzZWpy0SnryYOoeVeJOlCLgqCHGCCAXS7yU+DbvY4Dvdyw yITp9eIkZdM/Fmts6f8o1FkKjoocxGnl0xl5FYXclRkx8KiLDS89DgyRQjWSs4xbMMp0fc t2G+YQmqWPl+DVR6DII0W+M6DAgvjtwsUJvv1YwBjGGIcTR3fYsMVT+p9aKvUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722269578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1JfKO5Y6XiX6Ks5cLc0QsBO2LDLcZCgdgJfVnvQ1U84=; b=sgc6esPNIJtLsXV8A6ohYW4FL26BqD747ATRw5to4gE9nh4dmcddTCOkUC3GINVuIFgqPi bkE2Ly/C0QbWPzRXe433Qfw05DFYdbrZoHF5vDQImoYfFK7ZW09aEUpmDwBnaOx+XXaKcz GlG6vcrDeifLnVn5VTdA7Vh16DkDT1dFhzzi+XQefsKF5CgeapVDZ7msDD9ybeZx2Na85p 8bji0LwSB3CTvqCsJd8NP9OxvTyYd0uDiUxLOIoxOnq1+EBaFiWDTBFLWsRn735uwU2qUB XcuOz5FKcZVIg5jfWPfQgewSHQ55oMS7x84hdtgJllrfeagg8KbI3EEDNPmnHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXk0p2hqmzhQn; Mon, 29 Jul 2024 16:12: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 46TGCwxD070157; Mon, 29 Jul 2024 16:12:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGCwnR070154; Mon, 29 Jul 2024 16:12:58 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:12:58 GMT Message-Id: <202407291612.46TGCwnR070154@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: c8701777c0e8 - stable/13 - Fix the KCSAN_ENABLED check when building 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8701777c0e8654f060e46b067dd86452f48c364 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c8701777c0e8654f060e46b067dd86452f48c364 commit c8701777c0e8654f060e46b067dd86452f48c364 Author: Andrew Turner AuthorDate: 2021-06-02 10:07:55 +0000 Commit: Mark Johnston CommitDate: 2024-07-29 16:10:50 +0000 Fix the KCSAN_ENABLED check when building modules The KCSAN_ENABLED variable is non-empty when the kernel is being built with KCSAN. This allows us to disable modules that are known to be broken. There was a bug where we would check if it was defined. As this is always the case the KCSAN_ENABLED variable would be set when building modules so we would never build such a module. Fix this by checking if the value is empty before passing it on to the module stage. This doesn't affect how modules are built as the CFLAGS passed to modules has the correct check. PR: 280212 Reported by: rstone Sponsored by: Innovate UK (cherry picked from commit 2422138952d86dd8b02ff33c55f747ca8e381afe) --- sys/conf/kern.post.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index 4e22c07ef8d8..6664afc2bf16 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -37,7 +37,7 @@ MKMODULESENV+= WITH_CTF="${WITH_CTF}" MKMODULESENV+= WITH_EXTRA_TCP_STACKS="${WITH_EXTRA_TCP_STACKS}" .endif -.if defined(KCSAN_ENABLED) +.if !empty(KCSAN_ENABLED) MKMODULESENV+= KCSAN_ENABLED="yes" .endif From nobody Mon Jul 29 16:37:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkYF5hRdz5RYjx; Mon, 29 Jul 2024 16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkYF20b0z4FGD; Mon, 29 Jul 2024 16: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=1722271057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FrfqxmZIelys3x9/1ZgwWbkHl4SYDKjH5DJVKpSXCA=; b=oIVvtKJkHcQSs8D4dnTmIe4ryAJq+Xmk6rj/uowSbdrxhTNSV9C1Iz55ktQmtnpRTG5428 6GhMhIzSOPzPwt1Iy2ew2jU6fklni7oiW2HKLnuM7D086XMKG9VoUtkVRBs+MoCAInwvtS vbqa228/kKvCuXvzlnYcnRBGPOnYtU3/wjpBJZbWdsjsIiXaSPlhoXLCHgggz8k/uPAlxp ToJ5tD8KbVLcftyt0/i1E+R0OGcToiQjSYC7E8rTcPxLmivvkUycygF7oQGW4zArnmIZVI Q/aYMk/pfVO4Dg0fblTdl/PCEbqL7d5yi9Njg2nAjPsYFiDlyDlx3MwMzsqABw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271057; a=rsa-sha256; cv=none; b=uiTYCn9guufWfk+b4DNwb2HB3kAeKuAOwiw9GulQZowwQBbNklxvn4e7bBxOAfJbbuwL9H i8xz2mq7oKed5kGBHJTeK2NoZlASHk0X+BRTh1fdE9wSXgKyul1ydYfRwvCV26mPx8MKdR CaeYsnlD6qVM7Vy5K8UPjzbJca5KPxqx83MZrURdyxzETlEfOAxk3SYm/DbUDDPr5MUaa4 pUI4e30lRQ55Fh9ipvkHPfpdkIolQuxG4T6QLH95QYfnRExHh2bVlkdCzk8qef94qiBloN VDAhD6COAelyjextCoN1HbgvfjFTyqgi5/pU3w8oS4lD8Uw08FxYphA1yII3jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271057; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FrfqxmZIelys3x9/1ZgwWbkHl4SYDKjH5DJVKpSXCA=; b=hJR/z21xpV7Iz64y5fGY6l9zTaXCGvHmtWq26YwuN8mLH6rFuKUyC1E21AVGDUcjegeR/g O4sIJskZeDwaSuJNnnboUDERQAe8JiADCgpwM2BUHXSLGOFJdMarZLiO6gSk6sol1f+TSx Jidbpztp9S3/0NyM7X5+YtysvL9xzdcY5H1w9Y4PokAcKrd+kcK2DY3bvZWHA0ac/ZeVnA dWAlYcmpXZUAjBJ1XjWkXuDzqwZsoE6GSrmrcoSFCErUOsIkrQ/Sr+VKQJ1C2UpuMHe9dj pBBrrczterLgc0Ri+nzhJX1Wz0bGDLvbnecIBxyGDKl0IzzU6kyW9CONJAYoPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkYF1byrzh8f; Mon, 29 Jul 2024 16:37: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 46TGbbVr004670; Mon, 29 Jul 2024 16:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGbblZ004667; Mon, 29 Jul 2024 16:37:37 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:37:37 GMT Message-Id: <202407291637.46TGbblZ004667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 8e908fab6c5b - stable/14 - conf: Add usbhid and hidbus to GENERIC* kernel configs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8e908fab6c5ba76bfe9bc26be00051cc733fc82e Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=8e908fab6c5ba76bfe9bc26be00051cc733fc82e commit 8e908fab6c5ba76bfe9bc26be00051cc733fc82e Author: Emmanuel Vadot AuthorDate: 2024-06-20 07:30:07 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:36:42 +0000 conf: Add usbhid and hidbus to GENERIC* kernel configs Include the new unified HID stack by default in generic. This will allow us to migrate to the multi-stack hkbd and hms instead of relying on the older ukbd and ums which only work with USB. To test those drivers just add hw.usb.usbhid.enable=1 in loader.conf Differential Revision: https://reviews.freebsd.org/D45658 Reviewed by: emaste, imp, wulf (all older version) Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 13d00a43cba4c35fcc9e0ab567baf530126a6348) conf: hidmap is always needed for hms So bring it in when hms is in the kernel config Fixes: 13d00a43cba4 ("conf: Add usbhid and hidbus to GENERIC* kernel configs") Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 5ed91e788f0b97c9e6c544671ffef71fad7cad27) conf: powerpc: Add evdev to some kernel configs Fixes: 13d00a43cba4 ("conf: Add usbhid and hidbus to GENERIC* kernel configs") Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 43a62df0b464e60895084c7f9d9eddf70906fda3) --- sys/amd64/conf/GENERIC | 5 ++++- sys/arm/conf/GENERIC | 4 ++++ sys/arm/conf/RPI-B | 1 + sys/arm/conf/TEGRA124 | 4 ++++ sys/arm64/conf/std.dev | 5 ++++- sys/conf/files | 2 +- sys/i386/conf/GENERIC | 5 ++++- sys/powerpc/conf/GENERIC | 8 ++++++-- sys/powerpc/conf/GENERIC64 | 8 ++++++-- sys/powerpc/conf/GENERIC64LE | 8 ++++++-- sys/powerpc/conf/MPC85XX | 9 +++++++++ sys/powerpc/conf/MPC85XXSPE | 9 +++++++++ sys/powerpc/conf/QORIQ64 | 9 +++++++++ sys/riscv/conf/GENERIC | 3 +++ 14 files changed, 70 insertions(+), 10 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index ab1c3856051b..8ad3a3ccd425 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -328,7 +328,9 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) -device ukbd # Keyboard +device usbhid # USB HID Transport +device hkbd # HID Keyboard +device ukbd # USB Keyboard device umass # Disks/Mass storage - Requires scbus and da # Sound support @@ -379,4 +381,5 @@ device uinput # install /dev/uinput cdev # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus options IICHID_SAMPLING # Workaround missing GPIO INTR support diff --git a/sys/arm/conf/GENERIC b/sys/arm/conf/GENERIC index f8a39cb370d5..05bbf6526b34 100644 --- a/sys/arm/conf/GENERIC +++ b/sys/arm/conf/GENERIC @@ -192,7 +192,9 @@ device musb device axe # USB-Ethernet device umass # Disks/Mass storage - Requires scbus and da +device usbhid # USB HID Transport device uhid # "Human Interface Devices" +device hkbd # Allow keyboard like HIDs to control console device ukbd # Allow keyboard like HIDs to control console # Device mode support @@ -226,6 +228,7 @@ device sound # Framebuffer support device vt device kbdmux +device hms device ums device videomode device vchiq @@ -263,6 +266,7 @@ device aw_thermal # Allwinner Thermal Sensor Controller # HID support device hid # Generic HID support +device hidbus # Generic HID Bus # Flattened Device Tree options FDT # Configure using FDT/DTB data diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index 844b31686d5a..d0a3ee13c367 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -57,6 +57,7 @@ device usb_template # Control of the gadget # Comment following lines for boot console on serial port device vt device kbdmux +device hkbd device ukbd device sdhci diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index 9b75bf2e94f8..16cb5f95d26f 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -85,6 +85,7 @@ device ehci # EHCI USB interface device xhci # XHCI USB interface device tegra124_xusb_fw # Tegra XUSB firmware device usb # USB Bus (required) +device usbhid # USB HID Transport device umass # Disks/Mass storage - Requires scbus and da device uhid # "Human Interface Devices" #device u3g # USB modems @@ -130,6 +131,9 @@ device drm2 # HID support device hid # Generic HID support +device hidbus # Generic HID Bus +device hkbd # Allow keyboard like HIDs to control console +device hms # HID mouse # Flattened Device Tree options FDT # Configure using FDT/DTB data diff --git a/sys/arm64/conf/std.dev b/sys/arm64/conf/std.dev index 0c0ede38ed2b..d07ab6c22b7b 100644 --- a/sys/arm64/conf/std.dev +++ b/sys/arm64/conf/std.dev @@ -98,7 +98,9 @@ device uhci # UHCI USB interface device ehci # EHCI USB interface (USB 2.0) device xhci # XHCI USB interface (USB 3.0) device usb # USB Bus (required) -device ukbd # Keyboard +device usbhid # USB HID Transport +device hkbd # HID Keyboard +device ukbd # USB Keyboard device umass # Disks/Mass storage - Requires scbus and da # Sound support @@ -111,6 +113,7 @@ device mmcsd # mmc/sd flash cards # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus # Firmware device mmio_sram # Generic on-chip SRAM diff --git a/sys/conf/files b/sys/conf/files index 47601d3c7cff..5325e010d970 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1770,7 +1770,7 @@ dev/hid/hgame.c optional hgame dev/hid/hid.c optional hid dev/hid/hid_if.m optional hid dev/hid/hidbus.c optional hidbus -dev/hid/hidmap.c optional hidmap +dev/hid/hidmap.c optional hidmap | hms dev/hid/hidquirk.c optional hid dev/hid/hidraw.c optional hidraw dev/hid/hkbd.c optional hkbd diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index c5ad0a613eaa..79a26583b1b1 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -286,7 +286,9 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) device xhci # XHCI PCI->USB interface (USB 3.0) device usb # USB Bus (required) -device ukbd # Keyboard +device usbhid # USB HID Transport +device hkbd # HID Keyboard +device ukbd # USB Keyboard device umass # Disks/Mass storage - Requires scbus and da # Sound support @@ -333,4 +335,5 @@ device uinput # install /dev/uinput cdev # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus options IICHID_SAMPLING # Workaround missing GPIO INTR support diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index c839e2d63b9e..c2a68dba326a 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -172,12 +172,15 @@ device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface device usb # USB Bus (required) +device usbhid # USB HID Transport device uhid # "Human Interface Devices" -device ukbd # Keyboard +device hkbd # HID Keyboard +device ukbd # USB Keyboard options KBD_INSTALL_CDEV # install a CDEV entry in /dev device ulpt # Printer device umass # Disks/Mass storage - Requires scbus and da0 -device ums # Mouse +device hms # HID Mouse +device ums # USB Mouse device atp # Apple USB touchpad device urio # Diamond Rio 500 MP3 player # USB Ethernet @@ -233,3 +236,4 @@ device virtio_balloon # VirtIO Memory Balloon device # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 1e91a4cc9455..34e6d1bcf027 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -211,11 +211,14 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface device xhci # XHCI PCI->USB interface device usb # USB Bus (required) +device usbhid # USB HID Transport device uhid # "Human Interface Devices" -device ukbd # Keyboard +device hkbd # HID Keyboard +device ukbd # USB Keyboard options KBD_INSTALL_CDEV # install a CDEV entry in /dev device umass # Disks/Mass storage - Requires scbus and da0 -device ums # Mouse +device hms # HID Mouse +device ums # USB Mouse # USB Ethernet device aue # ADMtek USB Ethernet device axe # ASIX Electronics USB Ethernet @@ -285,3 +288,4 @@ device virtio_balloon # VirtIO Memory Balloon device # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index d05308b9f0b9..1d4ac62abd81 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -207,11 +207,14 @@ device ohci # OHCI PCI->USB interface device ehci # EHCI PCI->USB interface device xhci # XHCI PCI->USB interface device usb # USB Bus (required) +device usbhid # USB HID Transport device uhid # "Human Interface Devices" -device ukbd # Keyboard +device hkbd # HID Keyboard +device ukbd # USB Keyboard options KBD_INSTALL_CDEV # install a CDEV entry in /dev device umass # Disks/Mass storage - Requires scbus and da0 -device ums # Mouse +device hms # HID Mouse +device ums # USB Mouse # USB Ethernet device aue # ADMtek USB Ethernet device axe # ASIX Electronics USB Ethernet @@ -266,3 +269,4 @@ device virtio_balloon # VirtIO Memory Balloon device # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus diff --git a/sys/powerpc/conf/MPC85XX b/sys/powerpc/conf/MPC85XX index e44a35377355..e13fc75089f4 100644 --- a/sys/powerpc/conf/MPC85XX +++ b/sys/powerpc/conf/MPC85XX @@ -108,10 +108,13 @@ device uart options USB_DEBUG # enable debug msgs #device uhci device ehci +device hkbd device ukbd +device hms device ums device umass device usb +device usbhid device vlan # P1022 DIU @@ -120,6 +123,12 @@ device videomode device vt device fbd +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev + # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID bus diff --git a/sys/powerpc/conf/MPC85XXSPE b/sys/powerpc/conf/MPC85XXSPE index 3665da656ed1..2410170f9672 100644 --- a/sys/powerpc/conf/MPC85XXSPE +++ b/sys/powerpc/conf/MPC85XXSPE @@ -115,10 +115,13 @@ device uart options USB_DEBUG # enable debug msgs #device uhci device ehci +device hkbd device ukbd +device hms device ums device umass device usb +device usbhid device vlan # VirtIO support @@ -135,6 +138,12 @@ device videomode device vt device fbd +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev + # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID bus diff --git a/sys/powerpc/conf/QORIQ64 b/sys/powerpc/conf/QORIQ64 index 369e83179c59..e72d967dd895 100644 --- a/sys/powerpc/conf/QORIQ64 +++ b/sys/powerpc/conf/QORIQ64 @@ -112,15 +112,24 @@ options USB_DEBUG # enable debug msgs device ehci device umass device usb +device usbhid device vlan # Desktop related device vt device fbd options KBD_INSTALL_CDEV +device hkbd device ukbd +device hms device ums +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev + # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID bus diff --git a/sys/riscv/conf/GENERIC b/sys/riscv/conf/GENERIC index 5b02f1694fa3..7ecd496d6aab 100644 --- a/sys/riscv/conf/GENERIC +++ b/sys/riscv/conf/GENERIC @@ -115,12 +115,15 @@ device uhci # UHCI USB interface device ehci # EHCI USB interface (USB 2.0) device xhci # XHCI USB interface (USB 3.0) device usb # USB Bus (required) +device usbhid # USB HID Transport +device hkbd # Keyboard device ukbd # Keyboard device umass # Disks/Mass storage - Requires scbus and da # HID support options HID_DEBUG # enable debug msgs device hid # Generic HID support +device hidbus # Generic HID Bus # DTrace support # device dtrace From nobody Mon Jul 29 16:38:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZJ0z78z5RYnq; Mon, 29 Jul 2024 16:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZJ0MMZz4FSx; Mon, 29 Jul 2024 16:38:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWooaqmKD/UFEuc2C8IJkdDxdhXlNCfAGN/6Cvgx88Q=; b=dHgw/8REYUvWpBZyTHdsgab4kIuEhl0chGF+tTPNNQuEposlOX5rbylwUGOvaR0y+g68H6 xSvraZCSTyG36u4vQXUTd+Wc5KdY0eZioa8pup5KzFu6jNMVvv7oIEQT/wTKv/LokKwXQ8 yIHwNLr87qusm/lOA5hkilF0PRdgmfldA87oYx7lePb8q+kESHaXsSNv3TpIKy7xPIphdg kXGL7/USdCjQ+3RUKa8HTY42ncwXrfdh/VMyDLsjIzfI0nrbW52QftcvGnUaWInAjuBP/U W+VnmZ2gjSNq9Mspzi635wfT0mag8KsxEmTxcGjfepCXbBtoaw2XTxATa3wIGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271112; a=rsa-sha256; cv=none; b=etltlct4zeTcIyctT1UdP6SnIcaAtCFR7GJu+aUVop7Qn2xA/Wjs2ddpg7d81MImDG/poH Yd2jFXrQt1xN0Td1B6Wf5pZbQpkvf9PVvbDd4YkgiivLVJdTlvve+WO41ysucC5jxZjT8O XmpvwsEEoPmxrQe4m6Hh/Q+yR+S//4JeN3RRLq3ZQZuyadcooWTjI4S8dy00gERqqB6sBn w2lSUK1xOHj2kdw1iqrtfund8/uPh0XCmUy/VVzHbLeU8ka52YuTiAtuMGvWB2iSvXlhuv DRJ02L7NpCgsPTCo3MVorJdDO6rOLo7W80+ntPAtOfz4QmNBcv1eVIc/mbjYuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWooaqmKD/UFEuc2C8IJkdDxdhXlNCfAGN/6Cvgx88Q=; b=YChMael7P61wga2+1KO1LUPUAFZ8xI0bPnyDWeKWlnUBQWT+b3OeyItVrjJoBbzpDaKnxU JFOKxjREEOcN0jwim9DMnukZWz64y6EBiHxHHovqprPFnQEm7B9SSv4omYk9LJxehljkgd z44CaL0EkhQwCUq7Q4TtMyUMwxj/cSKEM1Px/mA4vl2/M6In465xXhIjuvMiaZ2Kg/Jolk 4p7pMj40C/RX6Bvzh3jCxJ3YHcZa9g5j8DQyBFzeE3/d8UxlUdtDlRSYt6WDx4iUPEVxHs KKZ6kASzI+PaQoFZQlWnFe/deVmAZ2nCjQ2rSxCB60CsuC55HHNBMzyl8hJ88g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZH73sDzhSM; Mon, 29 Jul 2024 16:38: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 46TGcVt0004948; Mon, 29 Jul 2024 16:38:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcVJR004945; Mon, 29 Jul 2024 16:38:31 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:31 GMT Message-Id: <202407291638.46TGcVJR004945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: ed956d5fcb26 - stable/14 - stand: Fix logo alpha List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ed956d5fcb26c614ede8be229dd1f659f6481907 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=ed956d5fcb26c614ede8be229dd1f659f6481907 commit ed956d5fcb26c614ede8be229dd1f659f6481907 Author: Emmanuel Vadot AuthorDate: 2024-07-09 12:53:08 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:09 +0000 stand: Fix logo alpha The alpha wasn't done properly and some white stripes could be seen. Differential Revision: https://reviews.freebsd.org/D45933 Reviewed by: imp. tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 887062c1da4a4c04a2b3987ec9a4e2a5902122d5) --- stand/images/freebsd-logo-rev.png | Bin 43898 -> 39052 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/stand/images/freebsd-logo-rev.png b/stand/images/freebsd-logo-rev.png index 5279b718218c..6e2088df4654 100644 Binary files a/stand/images/freebsd-logo-rev.png and b/stand/images/freebsd-logo-rev.png differ From nobody Mon Jul 29 16:38:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZK2nXDz5RYmR; Mon, 29 Jul 2024 16:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZK0xznz4FNG; Mon, 29 Jul 2024 16:38:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z9urPkRT4DNPUdxMZNV9Ur6LsLKdWeqv0qXzRPZArf0=; b=hfLpqr14+kvgi9VGtiOj8FsH7O9e436vism1YKauJxRUF/LX/3sukSVvlAPYlOiZLEKuQJ M1tfPIe28nI6ksNxkJ/4HZb6ApngZahcIrpPZkLXcoCFv8Y7/cY3ezMOTQw8tvmxSudaRS t+ui9s88Z+B4EQYnJ8th0UhLWTb4h8mTqi34vNft1rh4nacrU5T53MUijMUKlJ+lZK2gzg lc8EagCN2ashQteg221H834Q08IoZOddDpWxpDpbKMW4IkpzTw2cS/LieyPvkzvdKQNDBe L65+3IreUFpIDCdJVwDOsvKqfvAmFik7HqMMNmCtboCy6G7fryuyJv5gfH1j9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271113; a=rsa-sha256; cv=none; b=hpq/2desadHgkEyKvjKFlBVCwHQ7HZW0SijoD5AIMVPMhvOIueHiILbh+A2u2Z5Ss55gmI R5Gz1o4uQ+UnpyYkInw+UYlA/bgkeWYaR7AQukPtmOnBwgzADmZW1OBtUl5vsBiDsfCEA4 T8VOjnQOjQlWPQB+WC4MoL0Y/wwUA3KIgRqCoaze9ZeQbgpI8eZZmF+SCnLK1NiNdohNaM 56lla2/ROhwDvSrKZYBSVsnN/QMQBCSBR59kJNK5NKrc0n05IbtWQqUdGSmayBXL/EuRsR hq5oZg0AYJiFb1/8uRLdZqRq8y8zhHMoBSV10trqtArlaxwtusHlV7dfjjignQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z9urPkRT4DNPUdxMZNV9Ur6LsLKdWeqv0qXzRPZArf0=; b=WLXeE/QAe9XopVvEA3g8iYQcfcsHS8XArX2Sf96RSWFoijs+zjauEHG3j4V3PebDWRWoX1 mheYwTmvCobKog0Gb89flpTQAeRltZ2PKjH/FjXY/2cKOSvzV6GrizBO6+o1QC2CDXCilv 7VaxhwwGsJf4TIikfjtZFwYer5USIcy0MPM51sTlu7X4Qp5DTxynMJVltDKd7X1gkrj5K/ OGliI9fXD5fSuMcCa938NFu6EQ091Ns9We86yGtbY4+rKmnGCDpTaOl5hiIXOsutxGf0JK PmcQpR20sgzRpXDG4k0LwzunFydujriAEAJ18ZIuZCZs1DGawQF8OVdjVjwJow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZK0Yyvzhlr; Mon, 29 Jul 2024 16:38: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 46TGcWnd004984; Mon, 29 Jul 2024 16:38:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcWAb004981; Mon, 29 Jul 2024 16:38:32 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:32 GMT Message-Id: <202407291638.46TGcWAb004981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 01215ffec65a - stable/14 - vt: Add vd_bitblt_argb List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 01215ffec65ae607a0583c564158097b5d56e531 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=01215ffec65ae607a0583c564158097b5d56e531 commit 01215ffec65ae607a0583c564158097b5d56e531 Author: Emmanuel Vadot AuthorDate: 2024-07-09 12:35:12 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:12 +0000 vt: Add vd_bitblt_argb This blit an ARGB image on the dedicated vd. This also adds vt_fb_bitblt_argb which will works for most of the vt backends Differential Revision: https://reviews.freebsd.org/D45929 Reviewed by: tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit b93028d8cd3aafc883b5f0ecec65a8a2a30af7f3) --- sys/dev/virtio/gpu/virtio_gpu.c | 12 ++++++++++ sys/dev/vt/hw/efifb/efifb.c | 1 + sys/dev/vt/hw/fb/vt_early_fb.c | 1 + sys/dev/vt/hw/fb/vt_fb.c | 47 +++++++++++++++++++++++++++++++++++++++ sys/dev/vt/hw/fb/vt_fb.h | 1 + sys/dev/vt/hw/ofwfb/ofwfb.c | 12 ++++++++++ sys/dev/vt/hw/simplefb/simplefb.c | 12 ++++++++++ sys/dev/vt/hw/vbefb/vbefb.c | 1 + sys/dev/vt/hw/vga/vt_vga.c | 12 ++++++++++ sys/dev/vt/vt.h | 5 +++++ 10 files changed, 104 insertions(+) diff --git a/sys/dev/virtio/gpu/virtio_gpu.c b/sys/dev/virtio/gpu/virtio_gpu.c index 6209fe4beae1..ccb49a6b7695 100644 --- a/sys/dev/virtio/gpu/virtio_gpu.c +++ b/sys/dev/virtio/gpu/virtio_gpu.c @@ -102,6 +102,7 @@ static vd_bitblt_text_t vtgpu_fb_bitblt_text; static vd_bitblt_bmp_t vtgpu_fb_bitblt_bitmap; static vd_drawrect_t vtgpu_fb_drawrect; static vd_setpixel_t vtgpu_fb_setpixel; +static vd_bitblt_argb_t vtgpu_fb_bitblt_argb; static struct vt_driver vtgpu_fb_driver = { .vd_name = "virtio_gpu", @@ -111,6 +112,7 @@ static struct vt_driver vtgpu_fb_driver = { .vd_bitblt_text = vtgpu_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vtgpu_fb_bitblt_bitmap, + .vd_bitblt_argb = vtgpu_fb_bitblt_argb, .vd_drawrect = vtgpu_fb_drawrect, .vd_setpixel = vtgpu_fb_setpixel, .vd_postswitch = vt_fb_postswitch, @@ -180,6 +182,16 @@ vtgpu_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, vtgpu_resource_flush(sc, x, y, width, height); } +static int +vtgpu_fb_bitblt_argb(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y) +{ + + return (EOPNOTSUPP); +} + static void vtgpu_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, int fill, term_color_t color) diff --git a/sys/dev/vt/hw/efifb/efifb.c b/sys/dev/vt/hw/efifb/efifb.c index 12909d836a24..3ba501c000cb 100644 --- a/sys/dev/vt/hw/efifb/efifb.c +++ b/sys/dev/vt/hw/efifb/efifb.c @@ -59,6 +59,7 @@ static struct vt_driver vt_efifb_driver = { .vd_bitblt_text = vt_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_bitblt_argb = vt_fb_bitblt_argb, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, diff --git a/sys/dev/vt/hw/fb/vt_early_fb.c b/sys/dev/vt/hw/fb/vt_early_fb.c index 265a148ae556..920bfa05fd63 100644 --- a/sys/dev/vt/hw/fb/vt_early_fb.c +++ b/sys/dev/vt/hw/fb/vt_early_fb.c @@ -59,6 +59,7 @@ static struct vt_driver vt_fb_early_driver = { .vd_bitblt_text = vt_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_bitblt_argb = vt_fb_bitblt_argb, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_priority = VD_PRIORITY_GENERIC, diff --git a/sys/dev/vt/hw/fb/vt_fb.c b/sys/dev/vt/hw/fb/vt_fb.c index 5f4173ab144f..87d0595a66f1 100644 --- a/sys/dev/vt/hw/fb/vt_fb.c +++ b/sys/dev/vt/hw/fb/vt_fb.c @@ -50,6 +50,7 @@ static struct vt_driver vt_fb_driver = { .vd_bitblt_text = vt_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_bitblt_argb = vt_fb_bitblt_argb, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_postswitch = vt_fb_postswitch, @@ -333,6 +334,52 @@ vt_fb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, } } +int +vt_fb_bitblt_argb(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y) +{ + struct fb_info *info; + uint32_t o, cc; + int bpp, xi, yi; + + info = vd->vd_softc; + bpp = FBTYPE_GET_BYTESPP(info); + if (bpp != 4) + return (EOPNOTSUPP); + + if (info->fb_flags & FB_FLAG_NOWRITE) + return (0); + + KASSERT((info->fb_vbase != 0), ("Unmapped framebuffer")); + + /* Bound by right and bottom edges. */ + if (y + height > vw->vw_draw_area.tr_end.tp_row) { + if (y >= vw->vw_draw_area.tr_end.tp_row) + return (EINVAL); + height = vw->vw_draw_area.tr_end.tp_row - y; + } + if (x + width > vw->vw_draw_area.tr_end.tp_col) { + if (x >= vw->vw_draw_area.tr_end.tp_col) + return (EINVAL); + width = vw->vw_draw_area.tr_end.tp_col - x; + } + for (yi = 0; yi < height; yi++) { + for (xi = 0; xi < (width * 4); xi += 4) { + o = (y + yi) * info->fb_stride + (x + (xi / 4)) * bpp; + o += vd->vd_transpose; + cc = (argb[yi * width * 4 + xi] << 16) | + (argb[yi * width * 4 + xi + 1] << 8) | + (argb[yi * width * 4 + xi + 2]) | + (argb[yi * width * 4 + xi + 3] << 24); + vt_fb_mem_wr4(info, o, cc); + } + } + + return (0); +} + void vt_fb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, const term_rect_t *area) diff --git a/sys/dev/vt/hw/fb/vt_fb.h b/sys/dev/vt/hw/fb/vt_fb.h index 54f7ba667eb1..fc3db42b2a15 100644 --- a/sys/dev/vt/hw/fb/vt_fb.h +++ b/sys/dev/vt/hw/fb/vt_fb.h @@ -42,6 +42,7 @@ vd_blank_t vt_fb_blank; vd_bitblt_text_t vt_fb_bitblt_text; vd_invalidate_text_t vt_fb_invalidate_text; vd_bitblt_bmp_t vt_fb_bitblt_bitmap; +vd_bitblt_argb_t vt_fb_bitblt_argb; vd_drawrect_t vt_fb_drawrect; vd_setpixel_t vt_fb_setpixel; vd_postswitch_t vt_fb_postswitch; diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c index 0dc0c39f92cb..aca6b6faeae1 100644 --- a/sys/dev/vt/hw/ofwfb/ofwfb.c +++ b/sys/dev/vt/hw/ofwfb/ofwfb.c @@ -67,6 +67,7 @@ static vd_probe_t ofwfb_probe; static vd_init_t ofwfb_init; static vd_bitblt_text_t ofwfb_bitblt_text; static vd_bitblt_bmp_t ofwfb_bitblt_bitmap; +static vd_bitblt_argb_t ofwfb_bitblt_argb; static const struct vt_driver vt_ofwfb_driver = { .vd_name = "ofwfb", @@ -75,6 +76,7 @@ static const struct vt_driver vt_ofwfb_driver = { .vd_blank = vt_fb_blank, .vd_bitblt_text = ofwfb_bitblt_text, .vd_bitblt_bmp = ofwfb_bitblt_bitmap, + .vd_bitblt_argb = ofwfb_bitblt_argb, .vd_fb_ioctl = vt_fb_ioctl, .vd_fb_mmap = vt_fb_mmap, .vd_priority = VD_PRIORITY_GENERIC+1, @@ -243,6 +245,16 @@ ofwfb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, } } +static int +ofwfb_bitblt_argb(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y) +{ + + return (EOPNOTSUPP); +} + void ofwfb_bitblt_text(struct vt_device *vd, const struct vt_window *vw, const term_rect_t *area) diff --git a/sys/dev/vt/hw/simplefb/simplefb.c b/sys/dev/vt/hw/simplefb/simplefb.c index c5f17e1b3d16..2f8fd6036ae3 100644 --- a/sys/dev/vt/hw/simplefb/simplefb.c +++ b/sys/dev/vt/hw/simplefb/simplefb.c @@ -50,6 +50,7 @@ static vd_init_t vt_simplefb_init; static vd_fini_t vt_simplefb_fini; static vd_probe_t vt_simplefb_probe; +static vd_bitblt_argb_t vt_simplefb_bitblt_argb; static struct vt_driver vt_simplefb_driver = { .vd_name = "simplefb", @@ -60,6 +61,7 @@ static struct vt_driver vt_simplefb_driver = { .vd_bitblt_text = vt_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_bitblt_argb = vt_simplefb_bitblt_argb, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, @@ -222,3 +224,13 @@ vt_simplefb_fini(struct vt_device *vd, void *softc) vt_fb_fini(vd, softc); pmap_unmapdev((void *)sc->fb_vbase, sc->fb_size); } + +static int +vt_simplefb_bitblt_argb(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y) +{ + + return (EOPNOTSUPP); +} diff --git a/sys/dev/vt/hw/vbefb/vbefb.c b/sys/dev/vt/hw/vbefb/vbefb.c index f7dce1be0832..4e65657639b4 100644 --- a/sys/dev/vt/hw/vbefb/vbefb.c +++ b/sys/dev/vt/hw/vbefb/vbefb.c @@ -59,6 +59,7 @@ static struct vt_driver vt_vbefb_driver = { .vd_bitblt_text = vt_fb_bitblt_text, .vd_invalidate_text = vt_fb_invalidate_text, .vd_bitblt_bmp = vt_fb_bitblt_bitmap, + .vd_bitblt_argb = vt_fb_bitblt_argb, .vd_drawrect = vt_fb_drawrect, .vd_setpixel = vt_fb_setpixel, .vd_fb_ioctl = vt_fb_ioctl, diff --git a/sys/dev/vt/hw/vga/vt_vga.c b/sys/dev/vt/hw/vga/vt_vga.c index fdfbaebc0e79..51880ebb62e2 100644 --- a/sys/dev/vt/hw/vga/vt_vga.c +++ b/sys/dev/vt/hw/vga/vt_vga.c @@ -97,6 +97,7 @@ static vd_blank_t vga_blank; static vd_bitblt_text_t vga_bitblt_text; static vd_invalidate_text_t vga_invalidate_text; static vd_bitblt_bmp_t vga_bitblt_bitmap; +static vd_bitblt_argb_t vga_bitblt_argb; static vd_drawrect_t vga_drawrect; static vd_setpixel_t vga_setpixel; static vd_postswitch_t vga_postswitch; @@ -109,6 +110,7 @@ static const struct vt_driver vt_vga_driver = { .vd_bitblt_text = vga_bitblt_text, .vd_invalidate_text = vga_invalidate_text, .vd_bitblt_bmp = vga_bitblt_bitmap, + .vd_bitblt_argb = vga_bitblt_argb, .vd_drawrect = vga_drawrect, .vd_setpixel = vga_setpixel, .vd_postswitch = vga_postswitch, @@ -999,6 +1001,16 @@ vga_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw, } } +static int +vga_bitblt_argb(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y) +{ + + return (EOPNOTSUPP); +} + static void vga_initialize_graphics(struct vt_device *vd) { diff --git a/sys/dev/vt/vt.h b/sys/dev/vt/vt.h index 56a28c0420c7..8e35a81bc101 100644 --- a/sys/dev/vt/vt.h +++ b/sys/dev/vt/vt.h @@ -345,6 +345,10 @@ typedef void vd_bitblt_bmp_t(struct vt_device *vd, const struct vt_window *vw, const uint8_t *pattern, const uint8_t *mask, unsigned int width, unsigned int height, unsigned int x, unsigned int y, term_color_t fg, term_color_t bg); +typedef int vd_bitblt_argb_t(struct vt_device *vd, const struct vt_window *vw, + const uint8_t *argb, + unsigned int width, unsigned int height, + unsigned int x, unsigned int y); typedef int vd_fb_ioctl_t(struct vt_device *, u_long, caddr_t, struct thread *); typedef int vd_fb_mmap_t(struct vt_device *, vm_ooffset_t, vm_paddr_t *, int, vm_memattr_t *); @@ -368,6 +372,7 @@ struct vt_driver { vd_bitblt_text_t *vd_bitblt_text; vd_invalidate_text_t *vd_invalidate_text; vd_bitblt_bmp_t *vd_bitblt_bmp; + vd_bitblt_argb_t *vd_bitblt_argb; /* Framebuffer ioctls, if present. */ vd_fb_ioctl_t *vd_fb_ioctl; From nobody Mon Jul 29 16:38:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZM4M2Zz5RYv7; Mon, 29 Jul 2024 16:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZM2czmz4FLN; Mon, 29 Jul 2024 16:38:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=224s56vQiJu0JlOQ8amzkK8d76s+6TXlm9ZdoYRHCk0=; b=H6rekOrpafAFLF2yFQ7k6SVhO+Ap5OqbqlRxQsbtuhy/9CZ4oHpTUJ/XE/zlpQ5Wdk0NrF yI2s1NIXx7tf+zH8pVeHSwJuz3uAwPLmyGKN2GOUuhDQcdycDI6aVtOzZwBaUMzN1vBkUT Nl2kdHNBTB6J//ptVU3JAibGczo/uKImKRGgNPzgl1zFzoQCTYD0n+6QokUBi4WMDHasU2 OHh36tKrJgsW9HTBDoLy+vjgcun2EO7xihCyUArRMEV8zJzXuIh6MrLHsydHVWLzOhhh3X zWUKPZicu3aSU2z405LWDVwv7On1fzJXG64WIrOT0sL/swqeVNsZtGLilbDPUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271115; a=rsa-sha256; cv=none; b=MI2xAdtsDVMK+FKQgpKkiZeFksrBQsMK4iqYdlnt86Bt7SC2E0IC3JcBskLFlhMuJ+LkKy R/7uBCSOcbpt2iMefXEfQPrNtzlV7R7HgHaZibrrBHST0GxocwKe1cwVXAJsBb/BVXLNgl 8i7LgmbJ3Nbsob6cZP2TuDPPmsyuk3s0zc0hrXFIGFzUJdipssSBM+/STMUc1R/JEvJEvg aeZWeYMZS52x5DySL5Vl7OfhUN8k06Uz5VkagZd/YQy1BRLLjQ77791z9hEVxCpBk5fDpi JUg8WNWZ6hzYEmOAVnpaoucKdqnq5t9JH/UorC52D67DGL4G0Z52OsVWGpjPTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=224s56vQiJu0JlOQ8amzkK8d76s+6TXlm9ZdoYRHCk0=; b=ZZSa37Ny+yPW1/gCleZy9kE7u7ta9ZnmtlLf528OmYFiRY6d7M2RTnm7gmO+Heeul1knGA VyWcFuk0Zp5XcR15ZFfE734EeC8fIpicS4tQjv9qu26lsBuvHqPswhxp5h5V97tWTJ0chc xskBP98KcEKH1t7YsUc6flSzkY2fsZAcYphoG0qWhDRtZu9utYH8Opit/uZruyVXIjtgrw v/cmkpQb+SaF1AAdItyE1sqXkv0O60kEcB5lD2c7fCEDM/vkln7bYBvQ+dvKz7jqGSPxqx llDHugdlccFrSKj8AZeO3YWtcOQ22U8wAKxTGHqJi56oozSz9X48wqYaGAk8SQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZM21zWzhjG; Mon, 29 Jul 2024 16:38: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 46TGcZDF005074; Mon, 29 Jul 2024 16:38:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcZjn005071; Mon, 29 Jul 2024 16:38:35 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:35 GMT Message-Id: <202407291638.46TGcZjn005071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 82829e49e627 - stable/14 - vt: splash: Use splash screen passed from loader List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 82829e49e627c17041c7c0dddde58f1f3481e982 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=82829e49e627c17041c7c0dddde58f1f3481e982 commit 82829e49e627c17041c7c0dddde58f1f3481e982 Author: Emmanuel Vadot AuthorDate: 2024-07-09 12:38:41 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:44 +0000 vt: splash: Use splash screen passed from loader If loader(8) gives use a splash screen to use using the MODINFOMD_SPLASH type, use it if RB_MUTE is set to "YES". By design only argb data will be displayed. Differential Revision: https://reviews.freebsd.org/D45931 Reviewed by: imp, tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit f6e8b0e85081681100bf9cd74423be02233204bc) --- sys/dev/vt/vt_core.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 797af56e5e1d..e27f74b03a0f 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -1658,18 +1659,33 @@ vtterm_done(struct terminal *tm) static void vtterm_splash(struct vt_device *vd) { + caddr_t kmdp; + struct splash_info *si; + uintptr_t image; vt_axis_t top, left; - /* Display a nice boot splash. */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + si = MD_FETCH(kmdp, MODINFOMD_SPLASH, struct splash_info *); if (!(vd->vd_flags & VDF_TEXTMODE) && (boothowto & RB_MUTE)) { - top = (vd->vd_height - vt_logo_height) / 2; - left = (vd->vd_width - vt_logo_width) / 2; - switch (vt_logo_depth) { - case 1: - /* XXX: Unhardcode colors! */ + if (si == NULL) { + top = (vd->vd_height - vt_logo_height) / 2; + left = (vd->vd_width - vt_logo_width) / 2; vd->vd_driver->vd_bitblt_bmp(vd, vd->vd_curwindow, vt_logo_image, NULL, vt_logo_width, vt_logo_height, left, top, TC_WHITE, TC_BLACK); + } else { + if (si->si_depth != 4) + return; + printf("SPLASH: width: %d height: %d depth: %d\n", si->si_width, si->si_height, si->si_depth); + image = (uintptr_t)si + sizeof(struct splash_info); + image = roundup2(image, 8); + top = (vd->vd_height - si->si_height) / 2; + left = (vd->vd_width - si->si_width) / 2; + vd->vd_driver->vd_bitblt_argb(vd, vd->vd_curwindow, + (unsigned char *)image, si->si_width, si->si_height, + left, top); } vd->vd_flags |= VDF_SPLASH; } From nobody Mon Jul 29 16:38:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZL5bZvz5RYXD; Mon, 29 Jul 2024 16:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZL1yl1z4FbM; Mon, 29 Jul 2024 16:38:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j14PA3h1WO3jpmyD8QcVi00XocECzyFaoT5hBKRJUeE=; b=uOZ2Ub8sTsXFAEMuhl1n2S/Ry6QkuALLurH0PEJ1u2jTnMIAsNSTCkrUt10p+TS12HCXal WkrJHkhfRTCZTq87BaMl5sn7cYtFDs4s4pmGqDM5JeIFE9aIH4TBrdcXLgZqT3mxgJonZV eS5zCG6D2Bvkl6pDECflFv1cJwhl58gXNTYPircrV5ylT4aVZb+HhwADJzMGKX+M1aOcuY BJkxKYvO/YKfHRBI0TbWpjsYoHesdMGXO1eFX/9lR3m/knvIKxuC43KVPbtFMcbAAg4ddy Hc7Ba4qbXLgznulqRsRdu81SLdRFp+Wna+Awke0ZWtz7QIgOsu9UY9ZGB8eQ9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271114; a=rsa-sha256; cv=none; b=Wm8rBOY0UJ4ZaOlcLj5SwvqIfmTxWb8wFiIo+KB4YY/ny0QSiq72e171PFB12xMX73uqwT wtSQDxvpASy5rRgav1cVyVEFGqZqf2KB42GNrSTl7LxBDXR39sKQtuFVDshR3C/zuKpFpC T9IB3JbY3nrzxzptl3aCvckST0rKADL3faBe6RKvL0Tg3GK52olTD1FC8Co1XO+Qv2fZQw BOVcHQh17pe+rZllMfvYE/W00dcz6GiUnbWpYpk7ti7LScy8PpPpbOHH5ganSfyIDcIp/6 fCOoBUHvbSMBEDiAXsPipYqv74dstEAmGyjThNVvVb+6SXzTYuCG9jss6ci4Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j14PA3h1WO3jpmyD8QcVi00XocECzyFaoT5hBKRJUeE=; b=jPkfYaF3EVphV9Z3F7IwTQDrzB1bcQ1pLSSYFbx6rrVU12wVXXOBq7rAf85lW+nydzUDzM ydZbhHjZeiD9l57Q0kfeXcrMuucRBApicBcx5LfqyPXpVyZkAsn4/tp8x1GFubkt6AKAd9 YReuSdPyfvnOXUFG1IccVgvksPlj+qyt1/u6mHDILuTFCE27Kv7GlGyGlKB/JARxbYG9Pq IWDxlovGTAyvdBsrzkq0uboFm61YEppYk1EEhcc3WcmScIN4EtAzMdttIT/ufFM2taUJIM pMI2391eJzV0cUNLUOoGxEhd7Ez31+XQwrjv3SYyfN6lXYn9YyY7oC764cGtTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZL1JfKzj2w; Mon, 29 Jul 2024 16:38: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 46TGcYwu005023; Mon, 29 Jul 2024 16:38:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcYDU005020; Mon, 29 Jul 2024 16:38:34 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:34 GMT Message-Id: <202407291638.46TGcYDU005020@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 014edaa360ce - stable/14 - linker: Add MODINFOMD_SPLASH type List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 014edaa360ce7c4f28371e167b2ec33a9f2773b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=014edaa360ce7c4f28371e167b2ec33a9f2773b2 commit 014edaa360ce7c4f28371e167b2ec33a9f2773b2 Author: Emmanuel Vadot AuthorDate: 2024-07-09 12:37:08 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:42 +0000 linker: Add MODINFOMD_SPLASH type This mod type and structure holds the splash screen data and metadata. Differential Revision: https://reviews.freebsd.org/D45930 Reviewed by: tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 966e53a4e563da36d62edf57c2b0007921fec8dd) splash: Add sys/types.h To fix make test-includes Fixes: 966e53a4e563 ("linker: Add MODINFOMD_SPLASH type") Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit e4fc2fd62a5e4afebfc466868eb3b17f9ba0ad57) --- sys/kern/subr_module.c | 9 +++++++++ sys/sys/linker.h | 1 + sys/sys/splash.h | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/sys/kern/subr_module.c b/sys/kern/subr_module.c index 5ab41809aa89..66bf3334b771 100644 --- a/sys/kern/subr_module.c +++ b/sys/kern/subr_module.c @@ -294,6 +294,7 @@ preload_bootstrap_relocate(vm_offset_t offset) switch (hdr[0]) { case MODINFO_ADDR: case MODINFO_METADATA|MODINFOMD_FONT: + case MODINFO_METADATA|MODINFOMD_SPLASH: case MODINFO_METADATA|MODINFOMD_SSYM: case MODINFO_METADATA|MODINFOMD_ESYM: ptr = (vm_offset_t *)(curp + (sizeof(uint32_t) * 2)); @@ -424,6 +425,11 @@ preload_modinfo_type(struct sbuf *sbp, int type) case MODINFOMD_FONT: sbuf_cat(sbp, "MODINFOMD_FONT"); break; +#endif +#ifdef MODINFOMD_SPLASH + case MODINFOMD_SPLASH: + sbuf_cat(sbp, "MODINFOMD_SPLASH"); + break; #endif default: sbuf_cat(sbp, "unrecognized metadata type"); @@ -476,6 +482,9 @@ preload_modinfo_value(struct sbuf *sbp, uint32_t *bptr, int type, int len) #endif #ifdef MODINFOMD_FONT case MODINFO_METADATA | MODINFOMD_FONT: +#endif +#ifdef MODINFOMD_SPLASH + case MODINFO_METADATA | MODINFOMD_SPLASH: #endif sbuf_print_vmoffset(sbp, *(vm_offset_t *)bptr); break; diff --git a/sys/sys/linker.h b/sys/sys/linker.h index 461a32d5529b..be127e6ded48 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -242,6 +242,7 @@ void linker_kldload_unbusy(int flags); #define MODINFOMD_FW_HANDLE 0x000c /* Firmware dependent handle */ #define MODINFOMD_KEYBUF 0x000d /* Crypto key intake buffer */ #define MODINFOMD_FONT 0x000e /* Console font */ +#define MODINFOMD_SPLASH 0x000f /* Console splash screen */ #define MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */ #define MODINFOMD_DEPLIST (0x4001 | MODINFOMD_NOCOPY) /* depends on */ diff --git a/sys/sys/splash.h b/sys/sys/splash.h new file mode 100644 index 000000000000..0bbc5a2bd574 --- /dev/null +++ b/sys/sys/splash.h @@ -0,0 +1,19 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Beckhoff Automation GmbH & Co. KG + * + */ + +#ifndef _SYS_SPLASH_H_ +#define _SYS_SPLASH_H_ + +#include + +struct splash_info { + uint32_t si_width; + uint32_t si_height; + uint32_t si_depth; +}; + +#endif /* _SYS_SPLASH_H_ */ From nobody Mon Jul 29 16:38:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZN52KBz5RYmY; Mon, 29 Jul 2024 16:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZN3FJhz4FRD; Mon, 29 Jul 2024 16:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLDatU2oljNUWkm4/Ob4upCQXG3jF05NqE4HtJ/1i9g=; b=GQEi1iPb11TeZU02U/130MAPzd41g/32/TCdvbv2aBgWO/JQyEh5aVGkx7BUHuQNy47tLH Bg63RU4IBdkWbAUEb48FeBSkMad4jZmqIG/PDwYRlDoDXKEsWYEI0XZrcYg8PbbSlecTk/ 1/RQ1/Sy+X67ULzEdUqNxuqeelrCW37+1Df2TeAarYN84hWFEgNx6HSrb6i5x41GcpKMq9 GjsZbTwyae/vU1VtavBJPOt73guzJY9QHdsA9VXPDaK8+kRTSZB2FA01qKu3OvF2AJfqq8 xT09v9ZdMTPMI/mMiTqOgVLHNvrtv1giMz3R3u71EQpV8Om7+YfAblDF3/mA2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271116; a=rsa-sha256; cv=none; b=mKl4S+G+pZ5+W1nThKB+2A6V4zwdMUy00c9XWyllxT3QKScM5aSjxTV2eUzpagSme6ksDw iXmq73CUZGcNWFzRnqtDL8BemSqybxQeAWZhsM6QzcF1Z4BR+KpX53+s3GzRD/tbAo0b5s jipVqghJ1T5B5Zlw30ry8hIXl/CnH6EY+Ox4coSJ/JDnmxwRyhEyUseHIyEaNCrJPuO4Zu PPuuF+7b3sphHVnfsb2QAffl1+JJWXFnsrIvWui2g2HqbBc69faWPUQ2ZmoeD/68DydFMg gzvEnodwSzJLusr6ZxweIcnKFWkHKGRkFMf3DWMXX22XLIf9IBK7IwBQo6KiWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QLDatU2oljNUWkm4/Ob4upCQXG3jF05NqE4HtJ/1i9g=; b=gR5yXQ18jlj69Ux17XSIsm6mhUDP6rb/b1CXre9PRuytGfkgZ/SBCH+D2xPOaeVEQ6p/Rv WruJivQhcUc/SjIFikVIZAeA0mGnvq9zzF9pYcGymDXJeYLyQFfqe4Bk3SRYKmtToV0RpH q3L+/6f8w/jw4+KxFKRXJm4Mk/tPAdl+r34gvia+4LNZzQqDTrlt32vgAPw0C2tuk8OY8q F/ZXTD82Qegr6aoB+ICKsiFnStTYt3MnfLeIWrB8A50w9Ci0ER7XFCH0UY68J+pQjXGVrq JHw5JPPxNdo0KtwN2OblzTL4D6T/lk34sFoLWcQ8OsLKiPEyBL5zcm1RxKZUnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZN2sj3zj2x; Mon, 29 Jul 2024 16:38: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 46TGcaXL005141; Mon, 29 Jul 2024 16:38:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcaMM005138; Mon, 29 Jul 2024 16:38:36 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:36 GMT Message-Id: <202407291638.46TGcaMM005138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 619caaa1b552 - stable/14 - loader: Load a splash screen if "splash" variable is defined List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 619caaa1b5524772ea5e93dec0f558a243503acc Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=619caaa1b5524772ea5e93dec0f558a243503acc commit 619caaa1b5524772ea5e93dec0f558a243503acc Author: Emmanuel Vadot AuthorDate: 2024-07-09 12:41:11 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:44 +0000 loader: Load a splash screen if "splash" variable is defined Load a splash screen that vt(4) can use if the "splash" env variable is defined. For now only png is supported and decoding is done in loader and not in kernel compared to splash screen support in sc(4). For using this add: boot_mute="YES" splash="/boot/images/freebsd-logo-rev.png" in loader.conf Differential Revision: https://reviews.freebsd.org/D45932 Reviewed by: imp, tsoome Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 00460cc8c5ad02b628e81eec9e493a1df8393d36) --- stand/common/bootstrap.h | 1 + stand/common/gfx_fb.c | 48 +++++++++++++++++++++++++++++++++++++++++++++ stand/efi/loader/bootinfo.c | 5 +++++ 3 files changed, 54 insertions(+) diff --git a/stand/common/bootstrap.h b/stand/common/bootstrap.h index b7d6e538f9be..2dcc6eda47ba 100644 --- a/stand/common/bootstrap.h +++ b/stand/common/bootstrap.h @@ -281,6 +281,7 @@ int tslog_init(void); int tslog_publish(void); vm_offset_t build_font_module(vm_offset_t); +vm_offset_t build_splash_module(vm_offset_t); /* MI module loaders */ #ifdef __elfN diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 0a88a166089b..9942c629d124 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -87,6 +87,7 @@ #include #include #include +#include #include #include #include @@ -3007,3 +3008,50 @@ build_font_module(vm_offset_t addr) file_addmetadata(fp, MODINFOMD_FONT, sizeof(fontp), &fontp); return (addr); } + +vm_offset_t +build_splash_module(vm_offset_t addr) +{ + struct preloaded_file *fp; + struct splash_info si; + const char *splash; + png_t png; + uint64_t splashp; + int error; + + /* We can't load first */ + if ((file_findfile(NULL, NULL)) == NULL) { + printf("Can not load splash module: %s\n", + "the kernel is not loaded"); + return (addr); + } + + fp = file_findfile(NULL, "elf kernel"); + if (fp == NULL) + fp = file_findfile(NULL, "elf64 kernel"); + if (fp == NULL) + panic("can't find kernel file"); + + splash = getenv("splash"); + if (splash == NULL) + return (addr); + + /* Parse png */ + if ((error = png_open(&png, splash)) != PNG_NO_ERROR) { + return (addr); + } + + si.si_width = png.width; + si.si_height = png.height; + si.si_depth = png.bpp; + splashp = addr; + addr += archsw.arch_copyin(&si, addr, sizeof (struct splash_info)); + addr = roundup2(addr, 8); + + /* Copy the bitmap. */ + addr += archsw.arch_copyin(png.image, addr, png.png_datalen); + + printf("Loading splash ok\n"); + file_addmetadata(fp, MODINFOMD_SPLASH, sizeof(splashp), &splashp); + return (addr); +} diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c index b55c2184d9fe..0a53422142e2 100644 --- a/stand/efi/loader/bootinfo.c +++ b/stand/efi/loader/bootinfo.c @@ -390,6 +390,11 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs) /* Pad to a page boundary. */ addr = roundup(addr, PAGE_SIZE); + + addr = build_splash_module(addr); + + /* Pad to a page boundary. */ + addr = roundup(addr, PAGE_SIZE); #endif /* Copy our environment. */ From nobody Mon Jul 29 16:38:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXkZQ25J4z5RYmb; Mon, 29 Jul 2024 16:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXkZP4mQwz4FPC; Mon, 29 Jul 2024 16:38:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VOta1yX7aTxiuk65UqlgokYneCHe9KQvIfOdxcoAD0=; b=Pa1IX+sQrCCnsgcQHkuVpY1XBNpc7JqeUqM+2RJV2rULf1vWbOPa2zzMc2JwLs56c4HGwD tl60YnzIcztJrC/xD1qFDpHU//vzi96b8JXmT3ZBQmWB1QG+fiingbTFD4WtMBUpwyMEWX HKCKBgB/iAhSEQEXq61Vl3Dh3y/VOcg+yhUptw4S605RCz544TLtVbXhXSRNm2kJkggoit fQ3E2Euyow3p7QlIbKRYXFhTJb2V0RrSGM+R1yQ+MLp5UqYoDmcvVEZVTfDpJ2lg+dvipQ hBjgqYw5iJVOQV9scicfi7sbQ8VHBOKOVe9fNH9qplv40WRvYlr1OV1jOUUqzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722271117; a=rsa-sha256; cv=none; b=m6LamoKV8KMOjFAX8U7swECFV3TzZ1Prn9GKzg4ZoLYIl/AYg+cSTZVB61zeTpze8YjFsE hZMHTPfMj4vu41bpB1/qkuUS27HJF+iIGD6ZiaokRsCE1tMMfSzvGrJVHtCsOTIOZuUW6y RpvDHEmVfB6KdwcFBlYpg8M/o9jvAiPS5KPSx4bR52Lc4UkYxo4fKU3hWf0En89oMcBrHW pzoQWInVE/KtXdr8Jb9xxlWZPVfbSf3jPozSjpsKUf7fWlf3zMiEL3dq/Zv9OYVaXO0rdE uFJGR5oRWMknUzB1rXH/sMAxz9DYkSjGShTiK8tY4VDxSqwQ5YfVsF52DJL/vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722271117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VOta1yX7aTxiuk65UqlgokYneCHe9KQvIfOdxcoAD0=; b=xYIDsSSTSVecKQXdkLHsT+lDux+D3S2tKtL5+s4bTKxYsnQrx1dBEXUuL7fojxMzpQIZbv ibJ/LJ/1qstuYnJ0NRargN0i5vdOht4e2gZcPQchfl384I22kOK9Ets1S59LouQTTyiDMw 7mbeeXESaXND/rQvQqvXkOx0pC2v+CvNRqtN3fP3A5SRLyy6ljgjJk1IxOdsxRqZ6O1QaQ zVIFNWj8y2DTMdp6TCA9/GsnagG+V8j0JmNudf4O2qxbwVKzwM1pqZokcPUL4NfuprlISE DLK3f1LZUrxCSsb0A756FqTZ4G4cykYQVxkeweNYOtYGr4QuoD+fF5ma++H0Ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXkZP4BsRzj2y; Mon, 29 Jul 2024 16:38: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 46TGcbXo005196; Mon, 29 Jul 2024 16:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46TGcb4c005193; Mon, 29 Jul 2024 16:38:37 GMT (envelope-from git) Date: Mon, 29 Jul 2024 16:38:37 GMT Message-Id: <202407291638.46TGcb4c005193@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: b0d27132b2dc - stable/14 - splash(4): Document how to use splash screen with vt(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: manu X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b0d27132b2dcdff4695303e0a534af8a7ed9f265 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=b0d27132b2dcdff4695303e0a534af8a7ed9f265 commit b0d27132b2dcdff4695303e0a534af8a7ed9f265 Author: Emmanuel Vadot AuthorDate: 2024-07-09 14:43:36 +0000 Commit: Emmanuel Vadot CommitDate: 2024-07-29 16:37:44 +0000 splash(4): Document how to use splash screen with vt(4) Differential Revision: https://reviews.freebsd.org/D45935 Sponsored by: Beckhoff Automation GmbH & Co. KG (cherry picked from commit 7504e0e3e517fe9f0c775b802f0eb30481b4c01d) --- share/man/man4/splash.4 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/share/man/man4/splash.4 b/share/man/man4/splash.4 index b6d93287286c..736703317a7f 100644 --- a/share/man/man4/splash.4 +++ b/share/man/man4/splash.4 @@ -24,7 +24,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 December 31, 2015 +.Dd July 09, 2024 .Dt SPLASH 4 .Os .Sh NAME @@ -203,7 +203,9 @@ have the following line in the kernel configuration file. .Pp .Dl device splash .Pp -Next, edit +Next for +.Xr syscons 4 +, edit .Pa /boot/loader.conf (see .Xr loader.conf 5 ) @@ -240,6 +242,17 @@ splash_txt_load="YES" bitmap_load="YES" bitmap_name="/boot/splash.bin" .Ed +.Pp +For +.Xr vt 4 +, edit +.Pa /boot/loader.conf +(see +.Xr loader.conf 5 ) +and include the following lines: +.Bd -literal -offset indent +splash="/boot/images/freebsd-logo-rev.png" +boot_mute="YES" .\".Sh DIAGNOSTICS .Sh SEE ALSO .Xr vidcontrol 1 , @@ -291,7 +304,7 @@ and modules were written by .An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . .Sh CAVEATS -Both the splash screen and the screen saver work with +The screen saver work with .Xr syscons 4 only. .Sh BUGS From nobody Tue Jul 30 15:55:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYKZk150dz5RSQr; Tue, 30 Jul 2024 15:55:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYKZk0ddxz45HS; Tue, 30 Jul 2024 15:55:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4bA05huwTWy/u6lkTZvDNrZ/XEeZLwYrHZCDoWzAaY=; b=V7A5BZOe6f3GZpLKw+BxLRderl/p/og4sm3T+DNQw+4rXDuXT749ed6h0WdjyJOdWp/sPf Su9M7UuYOEFHIGIaSPy5Qx68OYsyiTe010hmaMjbKzoZmzmW/7NkYyrnTqy/ws09j3bzsw qR6M+tDwKiVv4t0iHY75/MTUKEylj5zx3mfamc7YINkdiTW18VVMX19Gb+2koDoYyS8Nc8 vqIzIoq47B6cQsINCTfxqgiE6XE6WC9abd0hh+Knwif8uAYqazB2gNYdUA/QtGXVvxs2++ 2S8Nrx+t7NoPyeXvj75Hc+NzOz0KxxPvVUDLKzE+r/bEmh7rhQfFySB/eOdfhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722354958; a=rsa-sha256; cv=none; b=lr4FZ8o9/K498CBH/uQYp9itYybH3KctltiDuUcC2sK/MkSGEY9T/fyU9j0EIwWGW0oZw1 h2AGydJAfaSSSxzphoioD8S0OBgh3Fqoa9bSGkrc9W+zalkeCySvcvNLhot9I162D7qQIO Ai8cp0E5zu+OwUWlYqWZ7IrCsp+fUSl9ikyjeRddhv1WARV+nDSayhIjI0wwwO5yNIxuB4 myMfCUL/Cox/tHspnjVNCoGP+XShTt6APUVKmMsKzdajhv1iZLn6OZadLSxhgPrUDCBP1V BTi/JzsEK+0R0GqNjZq1XZh+ezWU5s6ShwWVZ47Q1QSQLlvleMF/FqCH+mz5fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=p4bA05huwTWy/u6lkTZvDNrZ/XEeZLwYrHZCDoWzAaY=; b=T+giCWyzzU8RBgy3DOx1fOcmUIg2qaLbUJsjaEmjR2whz6lRBmVVU9tQauyaSYcETzcPs6 hLQVQzEBbL6DOrsI8JC5+6hotRB1WD+4TzMXYo3zOLt2UurrrRL2bE5ysMQL2L69qOt1L2 61NRXEDiFP48bcgoHc5F1wefky5T1PmYbIjXLCLq8XhLAcJqzKraio509xUfl5jTsR+myp +DghzuITwf2i/Fps0a8krBZl/PfFfWPi4nvZGzQfFEPJFaX3soScczEkP6BRU2s7LZ6Wn3 +2Z27e94ljLmXYcX8YWtmd2yZj4HquvXv0PFelRK2kVUfH8tEYmdZAhKK0wj+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYKZk0F3QzPHl; Tue, 30 Jul 2024 15:55: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 46UFtvjG082637; Tue, 30 Jul 2024 15:55:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46UFtvdL082634; Tue, 30 Jul 2024 15:55:57 GMT (envelope-from git) Date: Tue, 30 Jul 2024 15:55:57 GMT Message-Id: <202407301555.46UFtvdL082634@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: 5437ef1dc12d - stable/14 - libdtrace: Compute the relocation offset for all non-ET_REL objects List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 5437ef1dc12db8e34ecaf82b45be6255230ed5ba Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5437ef1dc12db8e34ecaf82b45be6255230ed5ba commit 5437ef1dc12db8e34ecaf82b45be6255230ed5ba Author: Mark Johnston AuthorDate: 2024-07-10 21:21:54 +0000 Commit: Mark Johnston CommitDate: 2024-07-30 15:55:32 +0000 libdtrace: Compute the relocation offset for all non-ET_REL objects The use of an ifdef here most likely carries over from when the dtrace port only worked on x86 platforms. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 7bbcbd43c53b49360969ca82b152fd6d971e9055) --- .../opensolaris/lib/libdtrace/common/dt_module.c | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 6fb9b0f84769..2a0386c33124 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -1251,19 +1251,21 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) * [Text][R/O data][R/W data][Dynamic][BSS][Non loadable] */ dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va; -#if defined(__i386__) - /* - * Find the first load section and figure out the relocation - * offset for the symbols. The kernel module will not need - * relocation, but the kernel linker modules will. - */ - for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) { - if (ph.p_type == PT_LOAD) { - dmp->dm_reloc_offset = k_stat->address - ph.p_vaddr; - break; + + if (!is_elf_obj) { + /* + * Find the first load section and figure out the relocation + * offset for the symbols. The kernel module will not need + * relocation, but the kernel linker modules will. + */ + for (i = 0; gelf_getphdr(dmp->dm_elf, i, &ph) != NULL; i++) { + if (ph.p_type == PT_LOAD) { + dmp->dm_reloc_offset = + k_stat->address - ph.p_vaddr; + break; + } } } -#endif if (dmp->dm_info.objfs_info_primary) dmp->dm_flags |= DT_DM_PRIMARY; From nobody Tue Jul 30 15:55:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYKZl1qCmz5RSrc; Tue, 30 Jul 2024 15:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYKZl1GtGz459X; Tue, 30 Jul 2024 15:55:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2LxAjjxBcGBlUC3FIFMtanyqhNfWrEfyWg8kAeY44Js=; b=BxGFWt4rZL5M3irUA+ot9DhiOi5Bw5/2GOBKaIalwS3CVVH3+BAbH23nZLJ45PGtP+2BeC vYChIYNS+ycpnrZEY7s4oenfvVqRn2KR2+h9CfGuJt5oHWU9o28s1LBjpTachh3M5WVlal 9YnGPomIYJpHetsSroTTgDyZ4vxHU/9JR/VridVs90OBBoOC+nLGqCr7/TANzx1yOeuCSa QEnjhuiVhHxgS94xva9s9KB3sMRtrWGLqufjAjtUrVxgRJ+i2SIMWq23HiY/h8bxifqDrc 0/NGe6Nn70pNhCpBF+W74XUULppj77Lk9JarmSXNgUp5AzeIQ+YlWLS1jPqgjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722354959; a=rsa-sha256; cv=none; b=hObBY1lkAi7uZ+zXF9mAC5rsF0jndHXrtD8dt8Sd1kukUFJB1e8e4lR7Wt/eEmf3V5x3p9 SGRx3Ghw5RGo42GuH+6dyA7h01iXaC9E/jCETOq1AKTuOFK+Fj3/W7g3bSGWur74yuL02H 9oSjFKuMU1tUfqoKe6s7JzQl8PKIu+wHsBcM0IZqaIuMI/gL7C695MCumk53Si+riUvL8Z /l/q1m8nuf85pumT3nxsggmsZ1ms+F4t3RRiJsNSOXccwW+yc/DVLcZ8IpL8RmjX0r3usD 4fnf/0TTAJLksN/m+KPFFtNSN4/Lt6dvdpVSKQCk1N/J/zVCy6jj5NtXR/CHLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2LxAjjxBcGBlUC3FIFMtanyqhNfWrEfyWg8kAeY44Js=; b=ROta6zTAWKt12zpsvLCyfMO2Uq0/vob+tA11hrXTGHJ4CxAe3R0Vi8aWOMo4V19t2Sv2zs 5YyEQ+E2AYCUPwtdouZMcADRt+tmEWAi22tcP+TKK4w4WUVRwbfHGc/H6ka+uCKrJACY7D 8WL96SvEQoEE28+ppnLP7adnQj91g7hYNIlHY99qc5iCq/6A9cvPSZ1hSNSV86JRvXjOE7 jL+lT4+8qFqraNg1i1Lqs1LpGxC/ENZQP1hi2NFlz9K0wanlJzY9M7YLXs7ZnHjmWq2KXq KEUezTKINDX957xSWXdxdgsZ+NzpeyIPpbgsfq8wS61IBbPMHb7lIp94IU12uA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYKZl0tPRzNJB; Tue, 30 Jul 2024 15:55: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 46UFtxxZ082676; Tue, 30 Jul 2024 15:55:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46UFtxbV082673; Tue, 30 Jul 2024 15:55:59 GMT (envelope-from git) Date: Tue, 30 Jul 2024 15:55:59 GMT Message-Id: <202407301555.46UFtxbV082673@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: fb8670d3f876 - stable/14 - gnop tests: Serialize List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: fb8670d3f876309981f8d22aa0a7d8ecf16d78b3 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fb8670d3f876309981f8d22aa0a7d8ecf16d78b3 commit fb8670d3f876309981f8d22aa0a7d8ecf16d78b3 Author: Mark Johnston AuthorDate: 2024-07-14 16:14:50 +0000 Commit: Mark Johnston CommitDate: 2024-07-30 15:55:32 +0000 gnop tests: Serialize Some of these tests make use of test disk devices, but then they can't run in parallel. MFC after: 2 weeks (cherry picked from commit dc8357de606aa65fc1c35a43d4a5f1d706164ddb) --- tests/sys/geom/class/nop/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/sys/geom/class/nop/Makefile b/tests/sys/geom/class/nop/Makefile index 54b41584d441..a3347e0cdb65 100644 --- a/tests/sys/geom/class/nop/Makefile +++ b/tests/sys/geom/class/nop/Makefile @@ -5,4 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/geom/class/${.CURDIR:T} ATF_TESTS_SH+= nop_test +# Some tests make use of the "disks" property and kyua may schedule +# them to run at the time time, which the tests do not expect. +TEST_METADATA.nop_test+= is_exclusive="true" + .include From nobody Tue Jul 30 15:56:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYKZm5tFLz5RSyN; Tue, 30 Jul 2024 15:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYKZm2bt0z45NS; Tue, 30 Jul 2024 15:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFm1gckm5LejHQhn24WI/dMw7ENIfvWzqdcPleVlVj4=; b=P+T33MJRDSXgHmkrPogRyutZEls2NVoGrqtETQJSaJWwhINs3zIsGQo8yNyNIZUcpWKfD/ hk5v/L7FI6AfOYWDjapwigDGeGLe7MppWoxegTm1lgurZ5qVdtkqnT1uE5bC5xlR8KcXR4 Tagb3HWLN0P44XbSc4yYTVTZSXJHnZp7iKk8fJRUIvMjHJx2dZVI6RtqGWdGIZiQR1+gVD nUoBZBMoXWIwHLforcAunY3AnVIKOFH0VQmAv7svGq4Ts9guZj8ajzWfqk5svu/fnn5CWA wdhwF0plkWzLqS1mIIO2hxURCci/GjyyZ+mA56cCmhri0gR+K2ZL7XXk1ZW27A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722354960; a=rsa-sha256; cv=none; b=t/+0a6bFuKYZP1XWgikazoKor0bdbni15mxvqIXVasAmiXpGP7gQtK+9LBjnNaH4gLIHl/ nN4iA6geEYWIFClq4FAPIDy1A9kf8gGycN/u/DGb62QfGgt34xm98+YwPWsmSY5pYuN2Xt 1R30Va0+8AxwryZKzmP76Z5R//3zDyEOiOOaKexnoClYLWN54WKfrKNq7xXMScNcsBVrfK KCQWgoVbfdCeQt3Wc3F0LOMQhq5ryRATHEpDIuawBWGffOna7OlnuZz0PhZogVsVJ86yHk lrlQV7UJMTroRVQqzV1U6nLZufgw9mHu0n7tb+zBAnmV9jwh7TIpEol1t8FkZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722354960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hFm1gckm5LejHQhn24WI/dMw7ENIfvWzqdcPleVlVj4=; b=p/9h1tmVWUTcH1XqHFlryYFJN9MLA8dXRleXwIwMYXjmkP5X7ZC/605oEnfCHuKFOZQ3WB sW78Bw8Pbq6P89Fx1IOF9Dbx33M/7RRdjt2BJRLCxTQq5KBOgAUwO52uTw14+6c+oj5wn0 1zxPE87Ghu1hIC0lazauChs4ode989vE8cWanW8lxMdFveu+MHmCPl6BdfVVt4pmg0RGmb TcuTrYWlFO/NwjsW1sdpRMvwmWE4KWOm0HJN1uIrILR7YZRWzsxxYXbx5TfGha+/8g5VG7 mElkERrDbuNtd+nzCJUJ9DmgvxRoD8c6xk70utXC51uJgEsjgX13Z6danUQlDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYKZm2BHszNdZ; Tue, 30 Jul 2024 15:56: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 46UFu0JK082722; Tue, 30 Jul 2024 15:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46UFu09l082719; Tue, 30 Jul 2024 15:56:00 GMT (envelope-from git) Date: Tue, 30 Jul 2024 15:56:00 GMT Message-Id: <202407301556.46UFu09l082719@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: bed96ef09d2f - stable/14 - socket tests: Serialize sonewconn_overflow List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: bed96ef09d2f37abe4e88efe7e5feec83eb9f3c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bed96ef09d2f37abe4e88efe7e5feec83eb9f3c7 commit bed96ef09d2f37abe4e88efe7e5feec83eb9f3c7 Author: Mark Johnston AuthorDate: 2024-07-14 16:12:50 +0000 Commit: Mark Johnston CommitDate: 2024-07-30 15:55:32 +0000 socket tests: Serialize sonewconn_overflow It relies on being able inspect the dmesg buffer to see whether the kernel logged certain messages. If it's interleaved with tests that generate large amounts of console output (e.g., GELI tests), then it can fail spuriously. MFC after: 2 weeks (cherry picked from commit ab27e232b14c07317642a2e4c546c9b71bd9c00b) --- tests/sys/kern/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/sys/kern/Makefile b/tests/sys/kern/Makefile index d78c761feaac..29d33f4c617c 100644 --- a/tests/sys/kern/Makefile +++ b/tests/sys/kern/Makefile @@ -57,6 +57,7 @@ ATF_TESTS_SH+= coredump_phnum_test ATF_TESTS_SH+= sonewconn_overflow TEST_METADATA.sonewconn_overflow+= required_programs="python" TEST_METADATA.sonewconn_overflow+= required_user="root" +TEST_METADATA.sonewconn_overflow+= is_exclusive="true" ATF_TESTS_SH+= sendfile_test ${PACKAGE}FILES+= sonewconn_overflow.py From nobody Wed Jul 31 04:38:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVG2Bk0z5Sbgh; Wed, 31 Jul 2024 04:38:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVG1cg9z4X13; Wed, 31 Jul 2024 04:38:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yzwccHQNMzIR+yaRbPvLtBIfrIqwHGoL+Kqk5ss0D38=; b=WULACX07SyLujP6oChTKSOVSFRemXJ1jYRdqG+X2//KC7V+0FkcNI3X8yidpNQyAXkH9Qo CYPjoDcYgF6Jk0irjZkSj94FameaSXP5vlcptIDUCrkXlN1slwDp4u7nrmdNhO520idZui 3QXBKP+DzYFMMV7rCIi6aLTQ//duzhzsONco95RQnaGGtpECgzq9le49dhQTC46MlvIaKz TmITLcNo5dEBf6xtflxRrXId2A+inWVQg8xLgvw1jErW4QBC9Kgq/0wKUGyxTCLaZp/R4P EIegUaaPKQKzabKTNJdfYs7nA7CcUXI4bwCnaqg9Vhir3Yt1pyXDUAZwKSUuQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400694; a=rsa-sha256; cv=none; b=u23JRL3QTjkJHel2ICvjkIX0NQ+aPETrwr0MFuGPkUpBnAPZyPpF0oe1x0tdGRk71MIvrR P/H85/aq5yK/RPWos3ukSjZoHZLaB2uyZsKHsOIQwPaMTizfMpH74d9JvtazTCrUgJ52zj HODsn0sbzA899xNRnSZbRlNZZ9S9RkcqITP3VPCATqC7hDGpRysBbpmvajM48jG5a5ZVO+ C811JoWZO+a1yy+TB8ethx1JGb3c5FKDLt6JpFgWk21xkSWfIiuOXd+P69WAzGI7Cu61Dv EURmNMNkyPGvwp5bvwWYLcN0sQzdZEwpv8hkT8TwNPkUFK/yR/SViKrxIuf0qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yzwccHQNMzIR+yaRbPvLtBIfrIqwHGoL+Kqk5ss0D38=; b=NWkglfZfyD2gqOcHnO3q4zXvm8+EcrFIHx9au2Pg0txUjFS/rsrl28mwR08Ue40q3dH0IY 56D4YZs1OsjjN6+RovR8Fp9JQPcDiMrSZpp0lR419M9H0pZxj2znLWRtECHi6Oc/bWOETi Q+v8XwYNqcnJBgcWE6UlLfE9doJw2vWQOXsAQF/gIVYuy/E02NuU4W7MpxNElFiY4kdiw6 Rii3r/0GdR0t04ngSyB5mKtsw8+MzBGw+SpWiA01rPKO6CYXSQ+QkzdYSU206QOxJK8osN tbxBBYGOM0LoQMEWO1M39qeK4VdCkVj/sXFVMZ/s1MLqVMfALms2IxxDWQ6oRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVG15YSzmfs; Wed, 31 Jul 2024 04:38: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 46V4cEkh068341; Wed, 31 Jul 2024 04:38:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cE56068338; Wed, 31 Jul 2024 04:38:14 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:14 GMT Message-Id: <202407310438.46V4cE56068338@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 9c1fafce1ed3 - stable/13 - ice_ddp: Update to 1.3.35.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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9c1fafce1ed3f005763862852e03762bcf9b9785 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=9c1fafce1ed3f005763862852e03762bcf9b9785 commit 9c1fafce1ed3f005763862852e03762bcf9b9785 Author: Eric Joyner AuthorDate: 2023-08-22 04:55:34 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 03:48:56 +0000 ice_ddp: Update to 1.3.35.0 This is intended to be used with the upcoming updated ice(4) version 1.38.16-k. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation (cherry picked from commit e04c4b4a369df3f1dcbebbdf726193f02af60801) --- sys/conf/files.amd64 | 6 +++--- sys/conf/files.arm64 | 6 +++--- sys/conf/files.powerpc | 6 +++--- sys/contrib/dev/ice/LICENSE | 2 +- .../dev/ice/{ice-1.3.30.0.pkg => ice-1.3.35.0.pkg} | Bin 692660 -> 692776 bytes sys/modules/ice_ddp/Makefile | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 245b6a29b585..7180f4e0e83d 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -207,7 +207,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -216,8 +216,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index bb593a8f9a01..286cbc0ae566 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -238,7 +238,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -247,8 +247,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 2db6e15b70f5..3bb98c15d15c 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -82,7 +82,7 @@ dev/ice/irdma_di_if.m optional ice pci powerpc64 | ice pci powerpc64le \ dev/ice/ice_ddp_common.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp powerpc64 | ice pci powerpc64le \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01031e00 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ @@ -91,8 +91,8 @@ ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp powerpc64 | ice pci powerpc64le \ - dependency "$S/contrib/dev/ice/ice-1.3.30.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.30.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ixl/if_ixl.c optional ixl pci powerpc64 \ diff --git a/sys/contrib/dev/ice/LICENSE b/sys/contrib/dev/ice/LICENSE index 7faadfc55aac..97fe53c2d998 100644 --- a/sys/contrib/dev/ice/LICENSE +++ b/sys/contrib/dev/ice/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2006-2021, Intel Corporation. +Copyright (c) 2006-2023, Intel Corporation. All rights reserved. Redistribution. Redistribution and use in binary form, without diff --git a/sys/contrib/dev/ice/ice-1.3.30.0.pkg b/sys/contrib/dev/ice/ice-1.3.35.0.pkg similarity index 88% rename from sys/contrib/dev/ice/ice-1.3.30.0.pkg rename to sys/contrib/dev/ice/ice-1.3.35.0.pkg index 454a2a6ea193..fc3e8ebc640f 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.30.0.pkg and b/sys/contrib/dev/ice/ice-1.3.35.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index 41ed4ac92888..ad85bc2a9935 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,5 +1,5 @@ KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.30.0.pkg:ice_ddp:0x01031e00 +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.35.0.pkg:ice_ddp:0x01032300 .include From nobody Wed Jul 31 04:38:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVH3dLkz5Sbtd; Wed, 31 Jul 2024 04:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVH24Tjz4XMr; Wed, 31 Jul 2024 04:38:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8W71mtOEdwLCA01YBeSNrNZ9O7KGPRBh8JpRcpHC164=; b=tluxuLDh7XhQVfPGgEaYwGJTPWmUI4rMf2TwRkhH2FQYU5X6gM3501oLVyTdH0J1nwqzJZ GvZRovcgGJqMLZk7hoWR6Z78VmcKvZhbR0PVHnuxDo2oRvFHS67VT+avXrdnqSS2naLE6Z 789Qag37QiUpY37wMD1NQLDflUXGm/0NfdqZvW10VSI9FjW7GQrtf6xpt5+6lEXaz0Mpgf rfJS1gSrqjlU8dacZvR7Sc+mmq2KdmSX/KWypn8XfiWtBbozE2EU8cy+hyf5Z2gUCFuxcy 0DIuAkqK6ua45tJJY7A1/2KDUhWPDtCxQJlPZ646zvfiH0/vG9c3/NaGcesn2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400695; a=rsa-sha256; cv=none; b=Jw3KeMVzi1FxkTVjE9soaA/v9FXRwz6IbkA61w8fFe2jVxKtY8fFNg0999TCM8Vu9KcrMl QcNPkZO58R4KtuaRdbPXExsc4p2+bQaM1lLor4Mxm9oXWRIXdKdopIOlvKjqRdmmpRumKi jonc4lfzuVHDkqU35wUXyK6CekH6oUnGv7qFaW4Pj8B2703m8jshgWvXmQ9jB6MGMxji5e uSi5sYDPar1h1l8pKqFxDCmDJ0Kw5aSF8a6jfBucEEpAVHN87jRaqxsm+Qeo8qFQJPgOXF 18dPXjOj24ciBkna0dfV0WRFYvL79X1vo5u45knApSKn8jLPNDiZnLHitm2JEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8W71mtOEdwLCA01YBeSNrNZ9O7KGPRBh8JpRcpHC164=; b=dC/cWdynjE06Q2fIR58txlFDEQRl+3I04VKUyLsmt1hGNL70VneAxvXMHy1R0b0j9mtBHL wC7VmyS3pYxEbqkOZO0auV9bfJVqrzWJMZZhFDNwoifjXqZ8QfyR2vnxkcP+nH5j4x6JSN 9TxQww+Dv+4ComqT/hmZeOE5FdGomiuSHCt9YSV+y8kTaXAGSIdfpVppgdtpupozhod4AR kEgV927kRZfUawrdiMVoVzYxQWBQzH+62eyK//RVm/PMa48Jxzm7WG4eoHyUWJ34CmZ9ME 8CkR1ka0HaDUsxbz59CrfwVyIn81HBvN3feaEi+pypzJ+3iQmLJipYIwaBIlew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVH1g3Xzn3V; Wed, 31 Jul 2024 04:38: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 46V4cFnk068380; Wed, 31 Jul 2024 04:38:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cFaT068377; Wed, 31 Jul 2024 04:38:15 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:15 GMT Message-Id: <202407310438.46V4cFaT068377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: f36e1b88dbea - stable/13 - ice(4): Update to 1.38.16-k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f36e1b88dbeadbd17b2d38e7172e8cad81198a53 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=f36e1b88dbeadbd17b2d38e7172e8cad81198a53 commit f36e1b88dbeadbd17b2d38e7172e8cad81198a53 Author: Eric Joyner AuthorDate: 2023-08-24 23:26:13 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:07 +0000 ice(4): Update to 1.38.16-k New features - Add sysctl "link_active_on_if_down" (defaults to 1 to match previous behavior): set this to 0 to have the driver bring the physical link down when the interface is brought administratively down - Add sysctl "temp" to read chip temperature on E810 devices; this requires a 4.30 or newer NVM (see package sysutils/intel-nvmupdate-100g) Bug fixes and general changes - (linked to irdma) properly propagate PF reset request from irdma driver - (linked to irdma) properly notify irdma of an impending PF reset - (linked to irdma) move Protocol Engine error handling to irdma - Print log message when using a DDP that doesn't support the "TX balancing" mode - Block LLDP agent configuration when DSCP QoS mode is enabled - Fix kernel panic when updating NVM when adapter is in the "TX balancing" mode - Remove ice_sbq_cmd.h since it's unused - Fix LLDP RX filter to still allow LLDP frames to be received by SW after a PF reset in SW LLDP mode - Add ice_if_needs_restart handler in order to fix a bad VLAN and link down interaction - Issue PF reset during unload - nvmupdate process fixes - Use pci_msix_table_bar() to get MSI-X bar index at runtime instead of hardcoding it Signed-off-by: Eric Joyner Reviewed by: anzhu@netapp.com Sponsored by: Intel Corporation, NetApp Differential Revision: https://reviews.freebsd.org/D41655 (cherry picked from commit 9c30461dd25bac49045acbeac10e00b6cc13d2bc) --- sys/dev/ice/ice_adminq_cmd.h | 123 ++++++---- sys/dev/ice/ice_common.c | 490 +++++++++++++++++++++------------------- sys/dev/ice/ice_common.h | 6 +- sys/dev/ice/ice_controlq.c | 110 ++++----- sys/dev/ice/ice_controlq.h | 3 - sys/dev/ice/ice_dcb.c | 2 +- sys/dev/ice/ice_ddp_common.c | 4 + sys/dev/ice/ice_ddp_common.h | 1 + sys/dev/ice/ice_defs.h | 4 +- sys/dev/ice/ice_features.h | 2 + sys/dev/ice/ice_flow.c | 41 +++- sys/dev/ice/ice_flow.h | 6 +- sys/dev/ice/ice_fw_logging.c | 4 +- sys/dev/ice/ice_fwlog.c | 1 + sys/dev/ice/ice_lan_tx_rx.h | 1 - sys/dev/ice/ice_lib.c | 239 ++++++++++++++++++-- sys/dev/ice/ice_lib.h | 16 +- sys/dev/ice/ice_rdma.c | 16 ++ sys/dev/ice/ice_rdma.h | 80 ++++++- sys/dev/ice/ice_rdma_internal.h | 17 ++ sys/dev/ice/ice_sbq_cmd.h | 120 ---------- sys/dev/ice/ice_sched.c | 104 +++++++-- sys/dev/ice/ice_sched.h | 42 +++- sys/dev/ice/ice_strings.c | 4 + sys/dev/ice/ice_switch.c | 334 +++++++++++++++------------ sys/dev/ice/ice_switch.h | 86 ++++--- sys/dev/ice/ice_type.h | 112 ++++++++- sys/dev/ice/if_ice_iflib.c | 130 +++++++++-- sys/dev/ice/irdma_di_if.m | 5 + sys/dev/ice/irdma_if.m | 4 + sys/dev/ice/virtchnl.h | 2 +- 31 files changed, 1360 insertions(+), 749 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 710830e95a16..e4dc14b0162c 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -168,6 +168,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_LED 0x0061 #define ICE_AQC_CAPS_SDP 0x0062 #define ICE_AQC_CAPS_WR_CSR_PROT 0x0064 +#define ICE_AQC_CAPS_SENSOR_READING 0x0067 #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 @@ -180,7 +181,8 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_EXT_TOPO_DEV_IMG3 0x0084 #define ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE 0x0085 #define ICE_AQC_CAPS_NAC_TOPOLOGY 0x0087 -#define ICE_AQC_CAPS_DYN_FLATTENING 0x0090 +#define ICE_AQC_CAPS_DYN_FLATTENING 0x008A +#define ICE_AQC_CAPS_OROM_RECOVERY_UPDATE 0x0090 #define ICE_AQC_CAPS_ROCEV2_LAG 0x0092 u8 major_ver; @@ -793,12 +795,30 @@ struct ice_aqc_sw_rules { __le32 addr_low; }; +/* Add switch rule response: + * Content of return buffer is same as the input buffer. The status field and + * LUT index are updated as part of the response + */ +struct ice_aqc_sw_rules_elem_hdr { + __le16 type; /* Switch rule type, one of T_... */ +#define ICE_AQC_SW_RULES_T_LKUP_RX 0x0 +#define ICE_AQC_SW_RULES_T_LKUP_TX 0x1 +#define ICE_AQC_SW_RULES_T_LG_ACT 0x2 +#define ICE_AQC_SW_RULES_T_VSI_LIST_SET 0x3 +#define ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR 0x4 +#define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5 +#define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6 + __le16 status; +}; + /* Add/Update/Get/Remove lookup Rx/Tx command/response entry * This structures describes the lookup rules and associated actions. "index" * is returned as part of a response to a successful Add command, and can be * used to identify the rule for Update/Get/Remove commands. */ struct ice_sw_rule_lkup_rx_tx { + struct ice_aqc_sw_rules_elem_hdr hdr; + __le16 recipe_id; #define ICE_SW_RECIPE_LOGICAL_PORT_FWD 10 /* Source port for LOOKUP_RX and source VSI in case of LOOKUP_TX */ @@ -877,14 +897,17 @@ struct ice_sw_rule_lkup_rx_tx { * lookup-type */ __le16 hdr_len; - u8 hdr[STRUCT_HACK_VAR_LEN]; + u8 hdr_data[STRUCT_HACK_VAR_LEN]; }; +#pragma pack(1) /* Add/Update/Remove large action command/response entry * "index" is returned as part of a response to a successful Add command, and * can be used to identify the action for Update/Get/Remove commands. */ struct ice_sw_rule_lg_act { + struct ice_aqc_sw_rules_elem_hdr hdr; + __le16 index; /* Index in large action table */ __le16 size; /* Max number of large actions */ @@ -939,50 +962,30 @@ struct ice_sw_rule_lg_act { #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S) __le32 act[STRUCT_HACK_VAR_LEN]; /* array of size for actions */ }; +#pragma pack() +#pragma pack(1) /* Add/Update/Remove VSI list command/response entry * "index" is returned as part of a response to a successful Add command, and * can be used to identify the VSI list for Update/Get/Remove commands. */ struct ice_sw_rule_vsi_list { + struct ice_aqc_sw_rules_elem_hdr hdr; + __le16 index; /* Index of VSI/Prune list */ __le16 number_vsi; __le16 vsi[STRUCT_HACK_VAR_LEN]; /* Array of number_vsi VSI numbers */ }; +#pragma pack() #pragma pack(1) /* Query VSI list command/response entry */ struct ice_sw_rule_vsi_list_query { __le16 index; - ice_declare_bitmap(vsi_list, ICE_MAX_VSI); + u8 vsi_list[DIVIDE_AND_ROUND_UP(ICE_MAX_VSI, BITS_PER_BYTE)]; }; #pragma pack() -#pragma pack(1) -/* Add switch rule response: - * Content of return buffer is same as the input buffer. The status field and - * LUT index are updated as part of the response - */ -struct ice_aqc_sw_rules_elem { - __le16 type; /* Switch rule type, one of T_... */ -#define ICE_AQC_SW_RULES_T_LKUP_RX 0x0 -#define ICE_AQC_SW_RULES_T_LKUP_TX 0x1 -#define ICE_AQC_SW_RULES_T_LG_ACT 0x2 -#define ICE_AQC_SW_RULES_T_VSI_LIST_SET 0x3 -#define ICE_AQC_SW_RULES_T_VSI_LIST_CLEAR 0x4 -#define ICE_AQC_SW_RULES_T_PRUNE_LIST_SET 0x5 -#define ICE_AQC_SW_RULES_T_PRUNE_LIST_CLEAR 0x6 - __le16 status; - union { - struct ice_sw_rule_lkup_rx_tx lkup_tx_rx; - struct ice_sw_rule_lg_act lg_act; - struct ice_sw_rule_vsi_list vsi_list; - struct ice_sw_rule_vsi_list_query vsi_list_query; - } pdata; -}; - -#pragma pack() - /* PFC Ignore (direct 0x0301) * The command and response use the same descriptor structure */ @@ -994,8 +997,8 @@ struct ice_aqc_pfc_ignore { u8 reserved[14]; }; -/* Set PFC Mode (direct 0x0303) - * Query PFC Mode (direct 0x0302) +/* Query PFC Mode (direct 0x0302) + * Set PFC Mode (direct 0x0303) */ struct ice_aqc_set_query_pfc_mode { u8 pfc_mode; @@ -1098,9 +1101,9 @@ struct ice_aqc_txsched_elem { u8 generic; #define ICE_AQC_ELEM_GENERIC_MODE_M 0x1 #define ICE_AQC_ELEM_GENERIC_PRIO_S 0x1 -#define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S) +#define ICE_AQC_ELEM_GENERIC_PRIO_M (0x7 << ICE_AQC_ELEM_GENERIC_PRIO_S) #define ICE_AQC_ELEM_GENERIC_SP_S 0x4 -#define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S) +#define ICE_AQC_ELEM_GENERIC_SP_M (0x1 << ICE_AQC_ELEM_GENERIC_SP_S) #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S 0x5 #define ICE_AQC_ELEM_GENERIC_ADJUST_VAL_M \ (0x3 << ICE_AQC_ELEM_GENERIC_ADJUST_VAL_S) @@ -1673,6 +1676,32 @@ struct ice_aqc_set_mac_lb { u8 reserved[15]; }; +/* Get sensor reading (direct 0x0632) */ +struct ice_aqc_get_sensor_reading { + u8 sensor; +#define ICE_AQC_INT_TEMP_SENSOR 0x0 + u8 format; +#define ICE_AQC_INT_TEMP_FORMAT 0x0 + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get sensor reading response (direct 0x0632) */ +struct ice_aqc_get_sensor_reading_resp { + union { + u8 raw[8]; + /* Output data for sensor 0x00, format 0x00 */ + struct { + s8 temp; + u8 temp_warning_threshold; + u8 temp_critical_threshold; + u8 temp_fatal_threshold; + u8 reserved[4]; + } s0f0; + } data; +}; + /* DNL Get Status command (indirect 0x0680) * Structure used for the response, the command uses the generic * ice_aqc_generic struct to pass a buffer address to the FW. @@ -2476,6 +2505,19 @@ struct ice_aqc_get_set_rss_keys { u8 extended_hash_key[ICE_AQC_GET_SET_RSS_KEY_DATA_HASH_KEY_SIZE]; }; +enum ice_lut_type { + ICE_LUT_VSI = 0, + ICE_LUT_PF = 1, + ICE_LUT_GLOBAL = 2, + ICE_LUT_TYPE_MASK = 3 +}; + +enum ice_lut_size { + ICE_LUT_VSI_SIZE = 64, + ICE_LUT_GLOBAL_SIZE = 512, + ICE_LUT_PF_SIZE = 2048, +}; + /* Get/Set RSS LUT (indirect 0x0B05/0x0B03) */ struct ice_aqc_get_set_rss_lut { #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15) @@ -2484,21 +2526,13 @@ struct ice_aqc_get_set_rss_lut { __le16 vsi_id; #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ - (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) - -#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI 0 -#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF 1 -#define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL 2 + (ICE_LUT_TYPE_MASK << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S 2 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M \ - (0x3 << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) + (ICE_LUT_TYPE_MASK << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128 128 -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG 0 -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512 512 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG 1 -#define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K 2048 #define ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG 2 #define ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S 4 @@ -2686,7 +2720,7 @@ struct ice_aqc_move_rdma_qset_buffer { }; /* Download Package (indirect 0x0C40) */ -/* Also used for Update Package (indirect 0x0C42 and 0x0C41) */ +/* Also used for Update Package (indirect 0x0C41 and 0x0C42) */ struct ice_aqc_download_pkg { u8 flags; #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01 @@ -2989,6 +3023,8 @@ struct ice_aq_desc { struct ice_aqc_get_phy_caps get_phy; struct ice_aqc_set_phy_cfg set_phy; struct ice_aqc_restart_an restart_an; + struct ice_aqc_get_sensor_reading get_sensor_reading; + struct ice_aqc_get_sensor_reading_resp get_sensor_reading_resp; struct ice_aqc_dnl_get_status get_status; struct ice_aqc_dnl_run_command dnl_run; struct ice_aqc_dnl_call_command dnl_call; @@ -3239,6 +3275,7 @@ enum ice_adminq_opc { ice_aqc_opc_get_link_status = 0x0607, ice_aqc_opc_set_event_mask = 0x0613, ice_aqc_opc_set_mac_lb = 0x0620, + ice_aqc_opc_get_sensor_reading = 0x0632, ice_aqc_opc_dnl_get_status = 0x0680, ice_aqc_opc_dnl_run = 0x0681, ice_aqc_opc_dnl_call = 0x0682, diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index a3f50f251533..0df73583e137 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -343,6 +343,88 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, return ICE_SUCCESS; } +/** + * ice_phy_maps_to_media + * @phy_type_low: PHY type low bits + * @phy_type_high: PHY type high bits + * @media_mask_low: media type PHY type low bitmask + * @media_mask_high: media type PHY type high bitmask + * + * Return true if PHY type [low|high] bits are only of media type PHY types + * [low|high] bitmask. + */ +static bool +ice_phy_maps_to_media(u64 phy_type_low, u64 phy_type_high, + u64 media_mask_low, u64 media_mask_high) +{ + /* check if a PHY type exist for media type */ + if (!(phy_type_low & media_mask_low || + phy_type_high & media_mask_high)) + return false; + + /* check that PHY types are only of media type */ + if (!(phy_type_low & ~media_mask_low) && + !(phy_type_high & ~media_mask_high)) + return true; + + return false; +} + +/** + * ice_set_media_type - Sets media type + * @pi: port information structure + * + * Set ice_port_info PHY media type based on PHY type. This should be called + * from Get PHY caps with media. + */ +static void ice_set_media_type(struct ice_port_info *pi) +{ + enum ice_media_type *media_type; + u64 phy_type_high, phy_type_low; + + phy_type_high = pi->phy.phy_type_high; + phy_type_low = pi->phy.phy_type_low; + media_type = &pi->phy.media_type; + + /* if no media, then media type is NONE */ + if (!(pi->phy.link_info.link_info & ICE_AQ_MEDIA_AVAILABLE)) + *media_type = ICE_MEDIA_NONE; + /* else if PHY types are only BASE-T, then media type is BASET */ + else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, + ICE_MEDIA_BASET_PHY_TYPE_LOW_M, 0)) + *media_type = ICE_MEDIA_BASET; + /* else if any PHY type is BACKPLANE, then media type is BACKPLANE */ + else if (phy_type_low & ICE_MEDIA_BP_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_BP_PHY_TYPE_HIGH_M) + *media_type = ICE_MEDIA_BACKPLANE; + /* else if PHY types are only optical, or optical and C2M, then media + * type is FIBER + */ + else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, + ICE_MEDIA_OPT_PHY_TYPE_LOW_M, 0) || + (phy_type_low & ICE_MEDIA_OPT_PHY_TYPE_LOW_M && + phy_type_low & ICE_MEDIA_C2M_PHY_TYPE_LOW_M)) + *media_type = ICE_MEDIA_FIBER; + /* else if PHY types are only DA, or DA and C2C, then media type DA */ + else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, + ICE_MEDIA_DAC_PHY_TYPE_LOW_M, 0) || + (phy_type_low & ICE_MEDIA_DAC_PHY_TYPE_LOW_M && + (phy_type_low & ICE_MEDIA_C2C_PHY_TYPE_LOW_M || + phy_type_high & ICE_MEDIA_C2C_PHY_TYPE_HIGH_M))) + *media_type = ICE_MEDIA_DA; + /* else if PHY types are only C2M or only C2C, then media is AUI */ + else if (ice_phy_maps_to_media(phy_type_low, phy_type_high, + ICE_MEDIA_C2M_PHY_TYPE_LOW_M, + ICE_MEDIA_C2M_PHY_TYPE_HIGH_M) || + ice_phy_maps_to_media(phy_type_low, phy_type_high, + ICE_MEDIA_C2C_PHY_TYPE_LOW_M, + ICE_MEDIA_C2C_PHY_TYPE_HIGH_M)) + *media_type = ICE_MEDIA_AUI; + + else + *media_type = ICE_MEDIA_UNKNOWN; +} + /** * ice_aq_get_phy_caps - returns PHY capabilities * @pi: port information structure @@ -434,6 +516,9 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode, ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, sizeof(pi->phy.link_info.module_type), ICE_NONDMA_TO_NONDMA); + ice_set_media_type(pi); + ice_debug(hw, ICE_DBG_LINK, "%s: media_type = 0x%x\n", prefix, + pi->phy.media_type); } return status; @@ -513,156 +598,6 @@ ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number, return ICE_ERR_DOES_NOT_EXIST; } -/** - * ice_is_media_cage_present - * @pi: port information structure - * - * Returns true if media cage is present, else false. If no cage, then - * media type is backplane or BASE-T. - */ -static bool ice_is_media_cage_present(struct ice_port_info *pi) -{ - struct ice_aqc_get_link_topo *cmd; - struct ice_aq_desc desc; - - cmd = &desc.params.get_link_topo; - - ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo); - - cmd->addr.topo_params.node_type_ctx = - (ICE_AQC_LINK_TOPO_NODE_CTX_PORT << - ICE_AQC_LINK_TOPO_NODE_CTX_S); - - /* set node type */ - cmd->addr.topo_params.node_type_ctx |= - (ICE_AQC_LINK_TOPO_NODE_TYPE_M & - ICE_AQC_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 ice_aq_get_netlist_node(pi->hw, cmd, NULL, NULL); -} - -/** - * ice_get_media_type - Gets media type - * @pi: port information structure - */ -static enum ice_media_type ice_get_media_type(struct ice_port_info *pi) -{ - struct ice_link_status *hw_link_info; - - if (!pi) - return ICE_MEDIA_UNKNOWN; - - hw_link_info = &pi->phy.link_info; - if (hw_link_info->phy_type_low && hw_link_info->phy_type_high) - /* If more than one media type is selected, report unknown */ - return ICE_MEDIA_UNKNOWN; - - if (hw_link_info->phy_type_low) { - /* 1G SGMII is a special case where some DA cable PHYs - * may show this as an option when it really shouldn't - * be since SGMII is meant to be between a MAC and a PHY - * in a backplane. Try to detect this case and handle it - */ - if (hw_link_info->phy_type_low == ICE_PHY_TYPE_LOW_1G_SGMII && - (hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == - ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE || - hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == - ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE)) - return ICE_MEDIA_DA; - - switch (hw_link_info->phy_type_low) { - case ICE_PHY_TYPE_LOW_1000BASE_SX: - case ICE_PHY_TYPE_LOW_1000BASE_LX: - case ICE_PHY_TYPE_LOW_10GBASE_SR: - case ICE_PHY_TYPE_LOW_10GBASE_LR: - case ICE_PHY_TYPE_LOW_25GBASE_SR: - case ICE_PHY_TYPE_LOW_25GBASE_LR: - case ICE_PHY_TYPE_LOW_40GBASE_SR4: - case ICE_PHY_TYPE_LOW_40GBASE_LR4: - case ICE_PHY_TYPE_LOW_50GBASE_SR2: - case ICE_PHY_TYPE_LOW_50GBASE_LR2: - case ICE_PHY_TYPE_LOW_50GBASE_SR: - case ICE_PHY_TYPE_LOW_50GBASE_FR: - case ICE_PHY_TYPE_LOW_50GBASE_LR: - case ICE_PHY_TYPE_LOW_100GBASE_SR4: - case ICE_PHY_TYPE_LOW_100GBASE_LR4: - case ICE_PHY_TYPE_LOW_100GBASE_SR2: - case ICE_PHY_TYPE_LOW_100GBASE_DR: - return ICE_MEDIA_FIBER; - case ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC: - case ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC: - case ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC: - case ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC: - case ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC: - case ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC: - case ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC: - case ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC: - return ICE_MEDIA_FIBER; - case ICE_PHY_TYPE_LOW_100BASE_TX: - case ICE_PHY_TYPE_LOW_1000BASE_T: - case ICE_PHY_TYPE_LOW_2500BASE_T: - case ICE_PHY_TYPE_LOW_5GBASE_T: - case ICE_PHY_TYPE_LOW_10GBASE_T: - case ICE_PHY_TYPE_LOW_25GBASE_T: - return ICE_MEDIA_BASET; - case ICE_PHY_TYPE_LOW_10G_SFI_DA: - case ICE_PHY_TYPE_LOW_25GBASE_CR: - case ICE_PHY_TYPE_LOW_25GBASE_CR_S: - case ICE_PHY_TYPE_LOW_25GBASE_CR1: - case ICE_PHY_TYPE_LOW_40GBASE_CR4: - case ICE_PHY_TYPE_LOW_50GBASE_CR2: - case ICE_PHY_TYPE_LOW_50GBASE_CP: - case ICE_PHY_TYPE_LOW_100GBASE_CR4: - case ICE_PHY_TYPE_LOW_100GBASE_CR_PAM4: - case ICE_PHY_TYPE_LOW_100GBASE_CP2: - return ICE_MEDIA_DA; - case ICE_PHY_TYPE_LOW_25G_AUI_C2C: - case ICE_PHY_TYPE_LOW_40G_XLAUI: - case ICE_PHY_TYPE_LOW_50G_LAUI2: - case ICE_PHY_TYPE_LOW_50G_AUI2: - case ICE_PHY_TYPE_LOW_50G_AUI1: - case ICE_PHY_TYPE_LOW_100G_AUI4: - case ICE_PHY_TYPE_LOW_100G_CAUI4: - if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_AUI; - /* fall-through */ - case ICE_PHY_TYPE_LOW_1000BASE_KX: - case ICE_PHY_TYPE_LOW_2500BASE_KX: - case ICE_PHY_TYPE_LOW_2500BASE_X: - case ICE_PHY_TYPE_LOW_5GBASE_KR: - case ICE_PHY_TYPE_LOW_10GBASE_KR_CR1: - case ICE_PHY_TYPE_LOW_10G_SFI_C2C: - case ICE_PHY_TYPE_LOW_25GBASE_KR: - case ICE_PHY_TYPE_LOW_25GBASE_KR1: - case ICE_PHY_TYPE_LOW_25GBASE_KR_S: - case ICE_PHY_TYPE_LOW_40GBASE_KR4: - case ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4: - case ICE_PHY_TYPE_LOW_50GBASE_KR2: - case ICE_PHY_TYPE_LOW_100GBASE_KR4: - case ICE_PHY_TYPE_LOW_100GBASE_KR_PAM4: - return ICE_MEDIA_BACKPLANE; - } - } else { - switch (hw_link_info->phy_type_high) { - case ICE_PHY_TYPE_HIGH_100G_AUI2: - case ICE_PHY_TYPE_HIGH_100G_CAUI2: - if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_AUI; - /* fall-through */ - case ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4: - return ICE_MEDIA_BACKPLANE; - case ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC: - case ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC: - return ICE_MEDIA_FIBER; - } - } - return ICE_MEDIA_UNKNOWN; -} - #define ice_get_link_status_datalen(hw) ICE_GET_LINK_STATUS_DATALEN_V1 /** @@ -681,7 +616,6 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, struct ice_aqc_get_link_status_data link_data = { 0 }; struct ice_aqc_get_link_status *resp; struct ice_link_status *li_old, *li; - enum ice_media_type *hw_media_type; struct ice_fc_info *hw_fc_info; bool tx_pause, rx_pause; struct ice_aq_desc desc; @@ -694,7 +628,6 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, hw = pi->hw; li_old = &pi->phy.link_info_old; - hw_media_type = &pi->phy.media_type; li = &pi->phy.link_info; hw_fc_info = &pi->fc; @@ -716,7 +649,6 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, li->link_speed = LE16_TO_CPU(link_data.link_speed); li->phy_type_low = LE64_TO_CPU(link_data.phy_type_low); li->phy_type_high = LE64_TO_CPU(link_data.phy_type_high); - *hw_media_type = ice_get_media_type(pi); li->link_info = link_data.link_info; li->link_cfg_err = link_data.link_cfg_err; li->an_info = link_data.an_info; @@ -747,7 +679,6 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool ena_lse, (unsigned long long)li->phy_type_low); ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", (unsigned long long)li->phy_type_high); - ice_debug(hw, ICE_DBG_LINK, " media_type = 0x%x\n", *hw_media_type); ice_debug(hw, ICE_DBG_LINK, " link_info = 0x%x\n", li->link_info); ice_debug(hw, ICE_DBG_LINK, " link_cfg_err = 0x%x\n", li->link_cfg_err); ice_debug(hw, ICE_DBG_LINK, " an_info = 0x%x\n", li->an_info); @@ -1066,7 +997,8 @@ enum ice_status ice_init_hw(struct ice_hw *hw) if (status) goto err_unroll_cqinit; - hw->port_info = (struct ice_port_info *) + if (!hw->port_info) + hw->port_info = (struct ice_port_info *) ice_malloc(hw, sizeof(*hw->port_info)); if (!hw->port_info) { status = ICE_ERR_NO_MEMORY; @@ -1205,7 +1137,7 @@ void ice_deinit_hw(struct ice_hw *hw) */ enum ice_status ice_check_reset(struct ice_hw *hw) { - u32 cnt, reg = 0, grst_timeout, uld_mask; + u32 cnt, reg = 0, grst_timeout, uld_mask, reset_wait_cnt; /* Poll for Device Active state in case a recent CORER, GLOBR, * or EMPR has occurred. The grst delay value is in 100ms units. @@ -1237,8 +1169,10 @@ enum ice_status ice_check_reset(struct ice_hw *hw) uld_mask = ICE_RESET_DONE_MASK | (hw->func_caps.common_cap.iwarp ? GLNVM_ULD_PE_DONE_M : 0); + reset_wait_cnt = ICE_PF_RESET_WAIT_COUNT; + /* Device is Active; check Global Reset processes are done */ - for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) { + for (cnt = 0; cnt < reset_wait_cnt; cnt++) { reg = rd32(hw, GLNVM_ULD) & uld_mask; if (reg == uld_mask) { ice_debug(hw, ICE_DBG_INIT, "Global reset processes done. %d\n", cnt); @@ -1247,7 +1181,7 @@ enum ice_status ice_check_reset(struct ice_hw *hw) ice_msec_delay(10, true); } - if (cnt == ICE_PF_RESET_WAIT_COUNT) { + if (cnt == reset_wait_cnt) { ice_debug(hw, ICE_DBG_INIT, "Wait for Reset Done timed out. GLNVM_ULD = 0x%x\n", reg); return ICE_ERR_RESET_FAILED; @@ -1265,7 +1199,7 @@ enum ice_status ice_check_reset(struct ice_hw *hw) */ static enum ice_status ice_pf_reset(struct ice_hw *hw) { - u32 cnt, reg; + u32 cnt, reg, reset_wait_cnt, cfg_lock_timeout; /* If at function entry a global reset was already in progress, i.e. * state is not 'device active' or any of the reset done bits are not @@ -1290,8 +1224,10 @@ static enum ice_status ice_pf_reset(struct ice_hw *hw) * timeout plus the PFR timeout which will account for a possible reset * that is occurring during a download package operation. */ - for (cnt = 0; cnt < ICE_GLOBAL_CFG_LOCK_TIMEOUT + - ICE_PF_RESET_WAIT_COUNT; cnt++) { + reset_wait_cnt = ICE_PF_RESET_WAIT_COUNT; + cfg_lock_timeout = ICE_GLOBAL_CFG_LOCK_TIMEOUT; + + for (cnt = 0; cnt < cfg_lock_timeout + reset_wait_cnt; cnt++) { reg = rd32(hw, PFGEN_CTRL); if (!(reg & PFGEN_CTRL_PFSWR_M)) break; @@ -1299,7 +1235,7 @@ static enum ice_status ice_pf_reset(struct ice_hw *hw) ice_msec_delay(1, true); } - if (cnt == ICE_PF_RESET_WAIT_COUNT) { + if (cnt == cfg_lock_timeout + reset_wait_cnt) { ice_debug(hw, ICE_DBG_INIT, "PF reset polling failed to complete.\n"); return ICE_ERR_RESET_FAILED; } @@ -2452,6 +2388,11 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, true : false; ice_debug(hw, ICE_DBG_INIT, "%s: nvm_unified_update = %d\n", prefix, caps->nvm_unified_update); + caps->netlist_auth = + (number & ICE_NVM_MGMT_NETLIST_AUTH_SUPPORT) ? + true : false; + ice_debug(hw, ICE_DBG_INIT, "%s: netlist_auth = %d\n", prefix, + caps->netlist_auth); break; case ICE_AQC_CAPS_CEM: caps->mgmt_cem = (number == 1); @@ -2534,6 +2475,8 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, (phys_id & ICE_EXT_TOPO_DEV_IMG_LOAD_EN) != 0; caps->ext_topo_dev_img_prog_en[index] = (phys_id & ICE_EXT_TOPO_DEV_IMG_PROG_EN) != 0; + caps->ext_topo_dev_img_ver_schema[index] = + (phys_id & ICE_EXT_TOPO_DEV_IMG_VER_SCHEMA) != 0; ice_debug(hw, ICE_DBG_INIT, "%s: ext_topo_dev_img_ver_high[%d] = %d\n", prefix, index, @@ -2554,6 +2497,10 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, "%s: ext_topo_dev_img_prog_en[%d] = %d\n", prefix, index, caps->ext_topo_dev_img_prog_en[index]); + ice_debug(hw, ICE_DBG_INIT, + "%s: ext_topo_dev_img_ver_schema[%d] = %d\n", + prefix, index, + caps->ext_topo_dev_img_ver_schema[index]); break; } case ICE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE: @@ -2564,6 +2511,11 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, ice_debug(hw, ICE_DBG_INIT, "%s: dyn_flattening_en = %d\n", prefix, caps->dyn_flattening_en); break; + case ICE_AQC_CAPS_OROM_RECOVERY_UPDATE: + caps->orom_recovery_update = (number == 1); + ice_debug(hw, ICE_DBG_INIT, "%s: orom_recovery_update = %d\n", + prefix, caps->orom_recovery_update); + break; default: /* Not one of the recognized common capabilities */ found = false; @@ -2782,6 +2734,26 @@ ice_parse_nac_topo_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, dev_p->nac_topo.id); } +/** + * ice_parse_sensor_reading_cap - Parse ICE_AQC_CAPS_SENSOR_READING cap + * @hw: pointer to the HW struct + * @dev_p: pointer to device capabilities structure + * @cap: capability element to parse + * + * Parse ICE_AQC_CAPS_SENSOR_READING for device capability for reading + * enabled sensors. + */ +static void +ice_parse_sensor_reading_cap(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, + struct ice_aqc_list_caps_elem *cap) +{ + dev_p->supported_sensors = LE32_TO_CPU(cap->number); + + ice_debug(hw, ICE_DBG_INIT, + "dev caps: supported sensors (bitmap) = 0x%x\n", + dev_p->supported_sensors); +} + /** * ice_parse_dev_caps - Parse device capabilities * @hw: pointer to the HW struct @@ -2827,6 +2799,9 @@ ice_parse_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, case ICE_AQC_CAPS_NAC_TOPOLOGY: ice_parse_nac_topo_dev_caps(hw, dev_p, &cap_resp[i]); break; + case ICE_AQC_CAPS_SENSOR_READING: + ice_parse_sensor_reading_cap(hw, dev_p, &cap_resp[i]); + break; default: /* Don't list common capabilities as unknown */ if (!found) @@ -3776,8 +3751,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg, break; case ICE_FEC_DIS_AUTO: /* Set No FEC and auto FEC */ - if (!ice_fw_supports_fec_dis_auto(hw)) - return ICE_ERR_NOT_SUPPORTED; + if (!ice_fw_supports_fec_dis_auto(hw)) { + status = ICE_ERR_NOT_SUPPORTED; + goto out; + } cfg->link_fec_opt |= ICE_AQC_PHY_FEC_DIS; /* fall-through */ case ICE_FEC_AUTO: @@ -3852,6 +3829,7 @@ enum ice_status ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, struct ice_sq_cd *cd) { + enum ice_status status = ICE_ERR_AQ_ERROR; struct ice_aqc_restart_an *cmd; struct ice_aq_desc desc; @@ -3866,7 +3844,16 @@ ice_aq_set_link_restart_an(struct ice_port_info *pi, bool ena_link, else cmd->cmd_flags &= ~ICE_AQC_RESTART_AN_LINK_ENABLE; - return ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); + status = ice_aq_send_cmd(pi->hw, &desc, NULL, 0, cd); + if (status) + return status; + + if (ena_link) + pi->phy.curr_user_phy_cfg.caps |= ICE_AQC_PHY_EN_LINK; + else + pi->phy.curr_user_phy_cfg.caps &= ~ICE_AQC_PHY_EN_LINK; + + return ICE_SUCCESS; } /** @@ -4062,6 +4049,51 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, return ICE_SUCCESS; } +static u16 ice_lut_type_to_size(u16 lut_type) +{ + switch (lut_type) { + case ICE_LUT_VSI: + return ICE_LUT_VSI_SIZE; + case ICE_LUT_GLOBAL: + return ICE_LUT_GLOBAL_SIZE; + case ICE_LUT_PF: + return ICE_LUT_PF_SIZE; + default: + return 0; + } +} + +static u16 ice_lut_size_to_flag(u16 lut_size) +{ + u16 f = 0; + + switch (lut_size) { + case ICE_LUT_GLOBAL_SIZE: + f = ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG; + break; + case ICE_LUT_PF_SIZE: + f = ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG; + break; + default: + break; + } + return f << ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S; +} + +int ice_lut_size_to_type(int lut_size) +{ + switch (lut_size) { + case ICE_LUT_VSI_SIZE: + return ICE_LUT_VSI; + case ICE_LUT_GLOBAL_SIZE: + return ICE_LUT_GLOBAL; + case ICE_LUT_PF_SIZE: + return ICE_LUT_PF; + default: + return -1; + } +} + /** * __ice_aq_get_set_rss_lut * @hw: pointer to the hardware structure @@ -4073,7 +4105,7 @@ ice_aq_read_topo_dev_nvm(struct ice_hw *hw, static enum ice_status __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *params, bool set) { - u16 flags = 0, vsi_id, lut_type, lut_size, glob_lut_idx, vsi_handle; + u16 flags, vsi_id, lut_type, lut_size, glob_lut_idx = 0, vsi_handle; struct ice_aqc_get_set_rss_lut *cmd_resp; struct ice_aq_desc desc; enum ice_status status; @@ -4084,16 +4116,22 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params vsi_handle = params->vsi_handle; lut = params->lut; + lut_type = params->lut_type; + lut_size = ice_lut_type_to_size(lut_type); + cmd_resp = &desc.params.get_set_rss_lut; + if (lut_type == ICE_LUT_GLOBAL) + glob_lut_idx = params->global_lut_id; - if (!ice_is_vsi_valid(hw, vsi_handle) || !lut) + if (!lut || !lut_size || !ice_is_vsi_valid(hw, vsi_handle)) return ICE_ERR_PARAM; - lut_size = params->lut_size; - lut_type = params->lut_type; - glob_lut_idx = params->global_lut_id; - vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); + if (lut_size > params->lut_size) + return ICE_ERR_INVAL_SIZE; - cmd_resp = &desc.params.get_set_rss_lut; + if (set && lut_size != params->lut_size) + return ICE_ERR_PARAM; + + vsi_id = ice_get_hw_vsi_num(hw, vsi_handle); if (set) { ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_rss_lut); @@ -4107,61 +4145,15 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params ICE_AQC_GSET_RSS_LUT_VSI_ID_M) | ICE_AQC_GSET_RSS_LUT_VSI_VALID); - switch (lut_type) { - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_VSI: - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF: - case ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL: - flags |= ((lut_type << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) & - ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M); - break; - default: - status = ICE_ERR_PARAM; - goto ice_aq_get_set_rss_lut_exit; - } - - if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_GLOBAL) { - flags |= ((glob_lut_idx << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S) & - ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M); + flags = ice_lut_size_to_flag(lut_size) | + ((lut_type << ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S) & + ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M) | + ((glob_lut_idx << ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_S) & + ICE_AQC_GSET_RSS_LUT_GLOBAL_IDX_M); - if (!set) - goto ice_aq_get_set_rss_lut_send; - } else if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF) { - if (!set) - goto ice_aq_get_set_rss_lut_send; - } else { - goto ice_aq_get_set_rss_lut_send; - } - - /* LUT size is only valid for Global and PF table types */ - switch (lut_size) { - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128: - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_128_FLAG << - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; - break; - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512: - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_512_FLAG << - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; - break; - case ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K: - if (lut_type == ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF) { - flags |= (ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_2K_FLAG << - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_S) & - ICE_AQC_GSET_RSS_LUT_TABLE_SIZE_M; - break; - } - /* fall-through */ - default: - status = ICE_ERR_PARAM; - goto ice_aq_get_set_rss_lut_exit; - } - -ice_aq_get_set_rss_lut_send: cmd_resp->flags = CPU_TO_LE16(flags); status = ice_aq_send_cmd(hw, &desc, lut, lut_size, NULL); - -ice_aq_get_set_rss_lut_exit: + params->lut_size = LE16_TO_CPU(desc.datalen); return status; } @@ -5155,7 +5147,7 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle, q_ctx->q_teid = LE32_TO_CPU(node.node_teid); /* add a leaf node into scheduler tree queue layer */ - status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node); + status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node, NULL); if (!status) status = ice_sched_replay_q_bw(pi, q_ctx); @@ -5390,7 +5382,7 @@ ice_ena_vsi_rdma_qset(struct ice_port_info *pi, u16 vsi_handle, u8 tc, for (i = 0; i < num_qsets; i++) { node.node_teid = buf->rdma_qsets[i].qset_teid; status = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, - &node); *** 3425 LINES SKIPPED *** From nobody Wed Jul 31 04:38:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVJ5t1Xz5Sbny; Wed, 31 Jul 2024 04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVJ2y5kz4X5r; Wed, 31 Jul 2024 04: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=1722400696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L0xwpdJ33VncAK9KAldTt/oOo1D7W0eSvsOJ/fPnQC0=; b=MspP3E2PCnnXKXD94UfeXjWJU7L0ZjfcxO0QXVJnyV96G09j2VgEEjIzXvTfNokcUFVzkc aU6DFeavVkiPWoZHyhev0OQi7OUoUd9KGrn+9WC3MabJVl7p/1eGeEkxMK7v9v34IQGvX/ 1qxX/Lw0dL/wF2wP2J4JZoW9bCRvy7+G76uG3aKpHUtbHRNdaavpEv297zGB8VQbrwDyWm GdxUNrg1sXlTc2SolqCN+sRLWbUYeAVJ0RoS3C7GOpHFeN10Mu1jWY1CQhSgscMD2j+L43 5jKj4kyRQaOHcdEeVi92kMFR2Wawq9a/VagfcbbuRXa087OIk4p3TKkgGPOn+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400696; a=rsa-sha256; cv=none; b=cE0yblCbc72hu7o0pAIFiq6AHcSFNYOB8LhGf/kso9tEy3nz2AhTqqOc1D3y0yFNT/IC5p w9dLOlTH6R9OpuX4R1aKU2cGaoNKq9gRzsCsMpPJ7yQJFJWQ0dduHtmuCEWnXj4ukzOyvi rVe2md1vqy9k7qZ6YreQOHdy5dMvvmEhq+m2QJwil4sOl07TbDEyxc80KvBS4zyNxnvuOt tB0LRrLrUtSiuem0/VzrkveGh1NDM8yaowUN65DWbhz9B6r/sk1dalaJQMjdFTzSG2u3mF 439hkgc490A4O7OJbVkZoGXDijcTHUXeFSojtNLYpDTBntgAWyfjv9TYWCj9aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L0xwpdJ33VncAK9KAldTt/oOo1D7W0eSvsOJ/fPnQC0=; b=Vr2RWL3AsbQBmANkixQnnlVPzuLZJDDhVV+4Eh1yPvrYxZzm4grniP8U3lz9zbKIBIyhk9 IYjjY7AqdzwPwE/ahoSFM4SzpoD1XiaMy273F7U4qBaMjhp9Jheu8i+N0CjECY7xJ3kWqz 9/5W0SgEiQ53KyttJNvaHE9GR+dTG3aulYnYCv6F4xtmuPSFtrUpPpC8cUGH4wBt3ZDp/4 ik7eS2zwU60DtQrkadRmyRaSCsSEQaIQU0Yk5ZjrW9DSGoZmDGjS1i3fJswLTYwBZvQ0Xd lVIp9uAK2SrtWfkBTG/qJsMQlVOdLCaXEjMF1bWmaX5TeTWWWx22fntSTMiphA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVJ2YQHzmMn; Wed, 31 Jul 2024 04: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 46V4cGwt068422; Wed, 31 Jul 2024 04: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 46V4cGxL068419; Wed, 31 Jul 2024 04:38:16 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:16 GMT Message-Id: <202407310438.46V4cGxL068419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 3795e83c28e8 - stable/13 - ice_ddp: Update package to 1.3.36.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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3795e83c28e89c4cc2d1485c1f9b72458195b5ed Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=3795e83c28e89c4cc2d1485c1f9b72458195b5ed commit 3795e83c28e89c4cc2d1485c1f9b72458195b5ed Author: Eric Joyner AuthorDate: 2024-02-13 06:39:21 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:15 +0000 ice_ddp: Update package to 1.3.36.0 This is intended to be used with the upcoming ice 1.39.13-k driver update, but is still backwards compatible with previous versions of the driver. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation (cherry picked from commit 768329961dc0c041f7647f1c4549944a2ca168aa) --- sys/conf/files.amd64 | 6 +++--- sys/conf/files.arm64 | 6 +++--- sys/conf/files.powerpc | 6 +++--- .../dev/ice/{ice-1.3.35.0.pkg => ice-1.3.36.0.pkg} | Bin 692776 -> 692776 bytes sys/modules/ice_ddp/Makefile | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 7180f4e0e83d..48f2d8408007 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -207,7 +207,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -216,8 +216,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index 286cbc0ae566..2aaa19a8c7b7 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -238,7 +238,7 @@ dev/ice/irdma_di_if.m optional ice pci \ dev/ice/ice_ddp_common.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp \ @@ -247,8 +247,8 @@ ice_ddp.fwo optional ice_ddp \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp \ - dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc index 3bb98c15d15c..22016c77e049 100644 --- a/sys/conf/files.powerpc +++ b/sys/conf/files.powerpc @@ -82,7 +82,7 @@ dev/ice/irdma_di_if.m optional ice pci powerpc64 | ice pci powerpc64le \ dev/ice/ice_ddp_common.c optional ice pci powerpc64 | ice pci powerpc64le \ compile-with "${NORMAL_C} -I$S/dev/ice" ice_ddp.c optional ice_ddp powerpc64 | ice pci powerpc64le \ - compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032300 -mice_ddp -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01032400 -mice_ddp -c${.TARGET}" \ no-ctfconvert no-implicit-rule before-depend local \ clean "ice_ddp.c" ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ @@ -91,8 +91,8 @@ ice_ddp.fwo optional ice_ddp powerpc64 | ice pci powerpc64le \ no-implicit-rule \ clean "ice_ddp.fwo" ice_ddp.fw optional ice_ddp powerpc64 | ice pci powerpc64le \ - dependency "$S/contrib/dev/ice/ice-1.3.35.0.pkg" \ - compile-with "${CP} $S/contrib/dev/ice/ice-1.3.35.0.pkg ice_ddp.fw" \ + dependency "$S/contrib/dev/ice/ice-1.3.36.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.36.0.pkg ice_ddp.fw" \ no-obj no-implicit-rule \ clean "ice_ddp.fw" dev/ixl/if_ixl.c optional ixl pci powerpc64 \ diff --git a/sys/contrib/dev/ice/ice-1.3.35.0.pkg b/sys/contrib/dev/ice/ice-1.3.36.0.pkg similarity index 98% rename from sys/contrib/dev/ice/ice-1.3.35.0.pkg rename to sys/contrib/dev/ice/ice-1.3.36.0.pkg index fc3e8ebc640f..ce5dbf41f557 100644 Binary files a/sys/contrib/dev/ice/ice-1.3.35.0.pkg and b/sys/contrib/dev/ice/ice-1.3.36.0.pkg differ diff --git a/sys/modules/ice_ddp/Makefile b/sys/modules/ice_ddp/Makefile index ad85bc2a9935..7329f0897325 100644 --- a/sys/modules/ice_ddp/Makefile +++ b/sys/modules/ice_ddp/Makefile @@ -1,5 +1,5 @@ KMOD= ice_ddp -FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.35.0.pkg:ice_ddp:0x01032300 +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.36.0.pkg:ice_ddp:0x01032400 .include From nobody Wed Jul 31 04:38:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVK5SLqz5SbXD; Wed, 31 Jul 2024 04:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVK3gqzz4X3S; Wed, 31 Jul 2024 04:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dtETTZ/GzDuFTfiE5MTdyQ7+03/5gLuM2Um6SRiR4dE=; b=AxnISpFpOV27aWw1ZngZCHKQVTBgOaMR3oV/4WngzW5rlEtPQ5ozbOyRgAThtKdszhx89R Lz+jkCkC4bOx8ftz84U0Qjl+cShuhlv7xFkZ+2aLHOS7wntn8NWORzZ/iJh7h0Wy2MHjfm YR29a/5CNT2zPHyCjCwGfqLNbIbIty3gkUhteFr6Nvs02cI++ur8E+8fgYFgesdSZD2Voz GBIgbNaAjJ/Dx9vpTcvI2vJUY8C9tCkVAqwOyz/m09VaLw84BuFACUY5p+8H62K4TVdHKi Weyemn95dGOYkc/a+6DFLBMGH4LVXldbfgVP6SwohrQ3IYvlLtxOTu0CNyJ8bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400697; a=rsa-sha256; cv=none; b=mJvynBmsslCnarEEEsJZ+WuUl51aR+oY3UBmKmeJmt+1QRBwjMjbTTgSTvYpSaighw1GYs yBpOzMj5hcO9gelvoXjm61+KyumSWKCqtsIzBG4Zzofi1zewwLnuRTJsZsIn4BOKszAF1H 8mR4tqFOaor+eiohXUanSHgcWKmfaCRlnPFPyykuMhqPxsjUUH13FOWI3Lluw9u0YFriLn WiWq12UT9RSf1zmr9A1/7E8dg3WkNND9ell/+KO4fg8ZByzGgZEhUCvnPZrB/fxwPk6aZW IOkNSi7rI85kCiClPfNyyB9D0ogYsLAUDKr2EJXgACRUP7gUJuH7+dl3E/zchQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dtETTZ/GzDuFTfiE5MTdyQ7+03/5gLuM2Um6SRiR4dE=; b=QJOO0i7Ybtq45WT3fEV8P4dnBmATnJWfnF8UkR3QmpnsI43vO/Yq3smTaVNOSxHl0si2Nh PrM/NYrmhhdekiauOCxXi0wF1iB+1j2kEDcjUxKeD54g1usEUm1eq6A/aI2ya1l5b9kiRv 9QlQ8Jgnvst+4z3V7plrIP1zZJQKPp5bs1OIae3VG1vFK7Fk6hmtFWVslpjTnlWnSzKjh7 PSVteB44I4BQVLASr7JbmKfre7rQVQvkJ0OklheMA4TPmBIf2n96pfT+bY8wY1nlnnTdso jMZcQO466pHVmSOjoVt+/Py1RneWquK2fpQ61MZ1qsTGxm0Tb+PNlpDHZh3dOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVK3FVZzm9p; Wed, 31 Jul 2024 04:38: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 46V4cH3g068461; Wed, 31 Jul 2024 04:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cHTb068458; Wed, 31 Jul 2024 04:38:17 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:17 GMT Message-Id: <202407310438.46V4cHTb068458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 0bf3573a5406 - stable/13 - iflib: Fix compiler warnings List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0bf3573a5406029070ce2d24ab0da24d71a209a9 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=0bf3573a5406029070ce2d24ab0da24d71a209a9 commit 0bf3573a5406029070ce2d24ab0da24d71a209a9 Author: Stephen J. Kiernan AuthorDate: 2024-04-03 20:21:55 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:17 +0000 iflib: Fix compiler warnings Some of the QUAD sysctls are actually for unsigned quad values. Switch to using UQUAD instead, as that is meant for unsigned. Reviewed by: erj, jhb Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D44620 (cherry picked from commit 303dea74c2cb3a41fba455fce8577993e637c3da) --- sys/net/iflib.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d6dcb09312db..cdf9d4889565 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -7074,32 +7074,32 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD, &txq->ift_task.gt_cpu, 0, "cpu this queue is bound to"); #if MEMORY_LOGGING - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_dequeued", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_dequeued", CTLFLAG_RD, &txq->ift_dequeued, "total mbufs freed"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_enqueued", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_enqueued", CTLFLAG_RD, &txq->ift_enqueued, "total mbufs enqueued"); #endif - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag", CTLFLAG_RD, &txq->ift_mbuf_defrag, "# of times m_defrag was called"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "m_pullups", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "m_pullups", CTLFLAG_RD, &txq->ift_pullups, "# of times m_pullup was called"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag_failed", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &txq->ift_mbuf_defrag_failed, "# of times m_defrag failed"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "no_desc_avail", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "no_desc_avail", CTLFLAG_RD, &txq->ift_no_desc_avail, "# of times no descriptors were available"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "tx_map_failed", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "tx_map_failed", CTLFLAG_RD, &txq->ift_map_failed, "# of times DMA map failed"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txd_encap_efbig", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txd_encap_efbig", CTLFLAG_RD, &txq->ift_txd_encap_efbig, "# of times txd_encap returned EFBIG"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "no_tx_dma_setup", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "no_tx_dma_setup", CTLFLAG_RD, &txq->ift_no_tx_dma_setup, "# of times map failed for other than EFBIG"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_pidx", @@ -7114,10 +7114,10 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_in_use", CTLFLAG_RD, &txq->ift_in_use, 1, "descriptors in use"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_processed", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_processed", CTLFLAG_RD, &txq->ift_processed, "descriptors procesed for clean"); - SYSCTL_ADD_QUAD(ctx_list, queue_list, OID_AUTO, "txq_cleaned", + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_cleaned", CTLFLAG_RD, &txq->ift_cleaned, "total cleaned"); SYSCTL_ADD_PROC(ctx_list, queue_list, OID_AUTO, "ring_state", @@ -7182,16 +7182,16 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD, &fl->ifl_buf_size, 1, "buffer size"); #if MEMORY_LOGGING - SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, "fl_m_enqueued", + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_m_enqueued", CTLFLAG_RD, &fl->ifl_m_enqueued, "mbufs allocated"); - SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, "fl_m_dequeued", + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_m_dequeued", CTLFLAG_RD, &fl->ifl_m_dequeued, "mbufs freed"); - SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_enqueued", + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_enqueued", CTLFLAG_RD, &fl->ifl_cl_enqueued, "clusters allocated"); - SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_dequeued", + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_dequeued", CTLFLAG_RD, &fl->ifl_cl_dequeued, "clusters freed"); #endif From nobody Wed Jul 31 04:38:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVL6JFQz5Sbp2; Wed, 31 Jul 2024 04:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVL3wBwz4X1b; Wed, 31 Jul 2024 04:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOLZp+uvrIj37q7w2AsMON2Fc8/QjPy9xwMQ6NtTpmg=; b=Os5hLbVDhlVKquAz9ipVT9qxWakVfAzvcnkfo/uR7O4YfJ4VTF2otgLU/UiEnBhzWOxGYQ es7Dao4ctzalm6ZUCARBAb4QSXebEl23Wy0C4KLvJs0CTYaqonwFxgUZRMKzK/aXzNaQKi d0cuPb/kiEGuLU09Wf1kdW3gMsWq5DqhJGtm+nZ0o45uzKe4tg905GRHG4hv1yBJiCDDZK CWxSn7OHEClDiqP3YENJOoFrZsZwMwhlQ0Am+XI9auuxZe1rzI3xA98kD6u/dnlXCAsC4U /tx38EOGWLVqMpaVd9w0PWhILRFLonSKSvrsyU8kmq1nU8hDkRt14WRiXsCWSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400698; a=rsa-sha256; cv=none; b=kcnmFrYL14XepXKQ/XwvLQDQ/yRdgh4VIUxUZQii04IcJ/T+teRmARSd+ZL+kafIdBGfNE A/kB/dwYM8ycLq9SD6rWp8wekjEbeTu8S7hAMtcNUaw9Rkm+hebP8EbCBqFKLhv1AtBgb/ hHAwS5gDmzon/PFXrxtw5r/15jiXLWkiLJ/JTpusBvqYpXo+Ubx93k0LiBQsj33YYV/fwO VfJ5QktQJoXTdbCk5QFOQzWgbPhy8eZzZh9/ks14MdkhQpMDGae/+LR0VM3nkj4Uj5/h1m Ot9X42KxA/BboLasSK36huDkZjX9WVK7SixzqlJZtGT7MRCjp9CSntWfsqHWUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JOLZp+uvrIj37q7w2AsMON2Fc8/QjPy9xwMQ6NtTpmg=; b=EoBVMLZeXGx/W5PBdqvJVNeC77Ezx7cTkVDtvv4gdBhNxS/wlkHgzinr+oxRFOA6vDzgwQ faHAHVwluUr5i+vElqVaqy7VL+Ns2Zvc31WPUn0T/R4SMF+eC6PxULijfsBBLyk/YF5P+P eLiXyO+iUHA/qB42oZZ386Kd+uYyUp4Taesb0ESoIiAYPkktC5EBZhGQ5F6q8B8Z7jtmhc mPWGNhUKQh3pICLJkv4YSqb4bcKnV4ay2EYHlH9Io627Zz+bARHsi+DIgXre5xGn1NmkME RUAO7GO4mSYHG5Uc9opL1xfbmWwNukHAZJr3++3lF6CvpUZ20Lp4En2bkQF8vA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVL3XS7zm9q; Wed, 31 Jul 2024 04:38: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 46V4cISq068513; Wed, 31 Jul 2024 04:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cIxi068510; Wed, 31 Jul 2024 04:38:18 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:18 GMT Message-Id: <202407310438.46V4cIxi068510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: d381220e4ee1 - stable/13 - iflib: Correct indentation according to style(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: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d381220e4ee157801a79f9dd0eeecc8974e31632 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=d381220e4ee157801a79f9dd0eeecc8974e31632 commit d381220e4ee157801a79f9dd0eeecc8974e31632 Author: Stephen J. Kiernan AuthorDate: 2024-04-16 18:35:57 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:19 +0000 iflib: Correct indentation according to style(9) The indentation style for the SYSCTL_* macros used was not matching KNF. Reported by: jhb Differential Revision: https://reviews.freebsd.org/D44811 (cherry picked from commit e4a0c92e7aea50654290e3082668932cea16b64f) --- sys/net/iflib.c | 277 +++++++++++++++++++++++++++----------------------------- 1 file changed, 135 insertions(+), 142 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index cdf9d4889565..fec432a0cb65 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -584,13 +584,15 @@ static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, */ static int iflib_min_tx_latency = 0; SYSCTL_INT(_net_iflib, OID_AUTO, min_tx_latency, CTLFLAG_RW, - &iflib_min_tx_latency, 0, "minimize transmit latency at the possible expense of throughput"); + &iflib_min_tx_latency, 0, + "minimize transmit latency at the possible expense of throughput"); static int iflib_no_tx_batch = 0; SYSCTL_INT(_net_iflib, OID_AUTO, no_tx_batch, CTLFLAG_RW, - &iflib_no_tx_batch, 0, "minimize transmit latency at the possible expense of throughput"); + &iflib_no_tx_batch, 0, + "minimize transmit latency at the possible expense of throughput"); static int iflib_timer_default = 1000; SYSCTL_INT(_net_iflib, OID_AUTO, timer_default, CTLFLAG_RW, - &iflib_timer_default, 0, "number of ticks between iflib_timer calls"); + &iflib_timer_default, 0, "number of ticks between iflib_timer calls"); #if IFLIB_DEBUG_COUNTERS @@ -603,31 +605,31 @@ static int iflib_fl_refills; static int iflib_fl_refills_large; static int iflib_tx_frees; -SYSCTL_INT(_net_iflib, OID_AUTO, tx_seen, CTLFLAG_RD, - &iflib_tx_seen, 0, "# TX mbufs seen"); -SYSCTL_INT(_net_iflib, OID_AUTO, tx_sent, CTLFLAG_RD, - &iflib_tx_sent, 0, "# TX mbufs sent"); -SYSCTL_INT(_net_iflib, OID_AUTO, tx_encap, CTLFLAG_RD, - &iflib_tx_encap, 0, "# TX mbufs encapped"); -SYSCTL_INT(_net_iflib, OID_AUTO, tx_frees, CTLFLAG_RD, - &iflib_tx_frees, 0, "# TX frees"); -SYSCTL_INT(_net_iflib, OID_AUTO, rx_allocs, CTLFLAG_RD, - &iflib_rx_allocs, 0, "# RX allocations"); -SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills, CTLFLAG_RD, - &iflib_fl_refills, 0, "# refills"); +SYSCTL_INT(_net_iflib, OID_AUTO, tx_seen, CTLFLAG_RD, &iflib_tx_seen, 0, + "# TX mbufs seen"); +SYSCTL_INT(_net_iflib, OID_AUTO, tx_sent, CTLFLAG_RD, &iflib_tx_sent, 0, + "# TX mbufs sent"); +SYSCTL_INT(_net_iflib, OID_AUTO, tx_encap, CTLFLAG_RD, &iflib_tx_encap, 0, + "# TX mbufs encapped"); +SYSCTL_INT(_net_iflib, OID_AUTO, tx_frees, CTLFLAG_RD, &iflib_tx_frees, 0, + "# TX frees"); +SYSCTL_INT(_net_iflib, OID_AUTO, rx_allocs, CTLFLAG_RD, &iflib_rx_allocs, 0, + "# RX allocations"); +SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills, CTLFLAG_RD, &iflib_fl_refills, 0, + "# refills"); SYSCTL_INT(_net_iflib, OID_AUTO, fl_refills_large, CTLFLAG_RD, - &iflib_fl_refills_large, 0, "# large refills"); + &iflib_fl_refills_large, 0, "# large refills"); static int iflib_txq_drain_flushing; static int iflib_txq_drain_oactive; static int iflib_txq_drain_notready; SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_flushing, CTLFLAG_RD, - &iflib_txq_drain_flushing, 0, "# drain flushes"); + &iflib_txq_drain_flushing, 0, "# drain flushes"); SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_oactive, CTLFLAG_RD, - &iflib_txq_drain_oactive, 0, "# drain oactives"); + &iflib_txq_drain_oactive, 0, "# drain oactives"); SYSCTL_INT(_net_iflib, OID_AUTO, txq_drain_notready, CTLFLAG_RD, - &iflib_txq_drain_notready, 0, "# drain notready"); + &iflib_txq_drain_notready, 0, "# drain notready"); static int iflib_encap_load_mbuf_fail; static int iflib_encap_pad_mbuf_fail; @@ -635,13 +637,13 @@ static int iflib_encap_txq_avail_fail; static int iflib_encap_txd_encap_fail; SYSCTL_INT(_net_iflib, OID_AUTO, encap_load_mbuf_fail, CTLFLAG_RD, - &iflib_encap_load_mbuf_fail, 0, "# busdma load failures"); + &iflib_encap_load_mbuf_fail, 0, "# busdma load failures"); SYSCTL_INT(_net_iflib, OID_AUTO, encap_pad_mbuf_fail, CTLFLAG_RD, - &iflib_encap_pad_mbuf_fail, 0, "# runt frame pad failures"); + &iflib_encap_pad_mbuf_fail, 0, "# runt frame pad failures"); SYSCTL_INT(_net_iflib, OID_AUTO, encap_txq_avail_fail, CTLFLAG_RD, - &iflib_encap_txq_avail_fail, 0, "# txq avail failures"); + &iflib_encap_txq_avail_fail, 0, "# txq avail failures"); SYSCTL_INT(_net_iflib, OID_AUTO, encap_txd_encap_fail, CTLFLAG_RD, - &iflib_encap_txd_encap_fail, 0, "# driver encap failures"); + &iflib_encap_txd_encap_fail, 0, "# driver encap failures"); static int iflib_task_fn_rxs; static int iflib_rx_intr_enables; @@ -653,22 +655,22 @@ static int iflib_rxd_flush; static int iflib_verbose_debug; -SYSCTL_INT(_net_iflib, OID_AUTO, task_fn_rx, CTLFLAG_RD, - &iflib_task_fn_rxs, 0, "# task_fn_rx calls"); +SYSCTL_INT(_net_iflib, OID_AUTO, task_fn_rx, CTLFLAG_RD, &iflib_task_fn_rxs, 0, + "# task_fn_rx calls"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_intr_enables, CTLFLAG_RD, - &iflib_rx_intr_enables, 0, "# RX intr enables"); -SYSCTL_INT(_net_iflib, OID_AUTO, fast_intrs, CTLFLAG_RD, - &iflib_fast_intrs, 0, "# fast_intr calls"); -SYSCTL_INT(_net_iflib, OID_AUTO, rx_unavail, CTLFLAG_RD, - &iflib_rx_unavail, 0, "# times rxeof called with no available data"); + &iflib_rx_intr_enables, 0, "# RX intr enables"); +SYSCTL_INT(_net_iflib, OID_AUTO, fast_intrs, CTLFLAG_RD, &iflib_fast_intrs, 0, + "# fast_intr calls"); +SYSCTL_INT(_net_iflib, OID_AUTO, rx_unavail, CTLFLAG_RD, &iflib_rx_unavail, 0, + "# times rxeof called with no available data"); SYSCTL_INT(_net_iflib, OID_AUTO, rx_ctx_inactive, CTLFLAG_RD, - &iflib_rx_ctx_inactive, 0, "# times rxeof called with inactive context"); -SYSCTL_INT(_net_iflib, OID_AUTO, rx_if_input, CTLFLAG_RD, - &iflib_rx_if_input, 0, "# times rxeof called if_input"); -SYSCTL_INT(_net_iflib, OID_AUTO, rxd_flush, CTLFLAG_RD, - &iflib_rxd_flush, 0, "# times rxd_flush called"); + &iflib_rx_ctx_inactive, 0, "# times rxeof called with inactive context"); +SYSCTL_INT(_net_iflib, OID_AUTO, rx_if_input, CTLFLAG_RD, &iflib_rx_if_input, + 0, "# times rxeof called if_input"); +SYSCTL_INT(_net_iflib, OID_AUTO, rxd_flush, CTLFLAG_RD, &iflib_rxd_flush, 0, + "# times rxd_flush called"); SYSCTL_INT(_net_iflib, OID_AUTO, verbose_debug, CTLFLAG_RW, - &iflib_verbose_debug, 0, "enable verbose debugging"); + &iflib_verbose_debug, 0, "enable verbose debugging"); #define DBG_COUNTER_INC(name) atomic_add_int(&(iflib_ ## name), 1) static void @@ -6990,42 +6992,41 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) ctx_list = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - ctx->ifc_sysctl_node = node = SYSCTL_ADD_NODE(ctx_list, child, OID_AUTO, "iflib", - CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IFLIB fields"); + ctx->ifc_sysctl_node = node = SYSCTL_ADD_NODE(ctx_list, child, + OID_AUTO, "iflib", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "IFLIB fields"); oid_list = SYSCTL_CHILDREN(node); SYSCTL_ADD_CONST_STRING(ctx_list, oid_list, OID_AUTO, "driver_version", - CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, - "driver version"); + CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, "driver version"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_ntxqs", - CTLFLAG_RWTUN, &ctx->ifc_sysctl_ntxqs, 0, - "# of txqs to use, 0 => use default #"); + CTLFLAG_RWTUN, &ctx->ifc_sysctl_ntxqs, 0, + "# of txqs to use, 0 => use default #"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_nrxqs", - CTLFLAG_RWTUN, &ctx->ifc_sysctl_nrxqs, 0, - "# of rxqs to use, 0 => use default #"); + CTLFLAG_RWTUN, &ctx->ifc_sysctl_nrxqs, 0, + "# of rxqs to use, 0 => use default #"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_qs_enable", - CTLFLAG_RWTUN, &ctx->ifc_sysctl_qs_eq_override, 0, - "permit #txq != #rxq"); + CTLFLAG_RWTUN, &ctx->ifc_sysctl_qs_eq_override, 0, + "permit #txq != #rxq"); SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix", - CTLFLAG_RWTUN, &ctx->ifc_softc_ctx.isc_disable_msix, 0, - "disable MSI-X (default 0)"); + CTLFLAG_RWTUN, &ctx->ifc_softc_ctx.isc_disable_msix, 0, + "disable MSI-X (default 0)"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", - CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, - "set the RX budget"); + CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, "set the RX budget"); SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "tx_abdicate", - CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, - "cause TX to abdicate instead of running to completion"); + CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, + "cause TX to abdicate instead of running to completion"); ctx->ifc_sysctl_core_offset = CORE_OFFSET_UNSPECIFIED; SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "core_offset", - CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, - "offset to start using cores at"); + CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, + "offset to start using cores at"); SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "separate_txrx", - CTLFLAG_RDTUN, &ctx->ifc_sysctl_separate_txrx, 0, - "use separate cores for TX and RX"); + CTLFLAG_RDTUN, &ctx->ifc_sysctl_separate_txrx, 0, + "use separate cores for TX and RX"); SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "use_logical_cores", - CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, - "try to make use of logical cores for TX and RX"); + CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, + "try to make use of logical cores for TX and RX"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", @@ -7071,77 +7072,71 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_INT(ctx_list, queue_list, OID_AUTO, "cpu", - CTLFLAG_RD, - &txq->ift_task.gt_cpu, 0, "cpu this queue is bound to"); + CTLFLAG_RD, &txq->ift_task.gt_cpu, 0, + "cpu this queue is bound to"); #if MEMORY_LOGGING SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_dequeued", - CTLFLAG_RD, - &txq->ift_dequeued, "total mbufs freed"); + CTLFLAG_RD, &txq->ift_dequeued, "total mbufs freed"); SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_enqueued", - CTLFLAG_RD, - &txq->ift_enqueued, "total mbufs enqueued"); + CTLFLAG_RD, &txq->ift_enqueued, "total mbufs enqueued"); #endif SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag", - CTLFLAG_RD, - &txq->ift_mbuf_defrag, "# of times m_defrag was called"); + CTLFLAG_RD, &txq->ift_mbuf_defrag, + "# of times m_defrag was called"); SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "m_pullups", - CTLFLAG_RD, - &txq->ift_pullups, "# of times m_pullup was called"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "mbuf_defrag_failed", - CTLFLAG_RD, - &txq->ift_mbuf_defrag_failed, "# of times m_defrag failed"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "no_desc_avail", - CTLFLAG_RD, - &txq->ift_no_desc_avail, "# of times no descriptors were available"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "tx_map_failed", - CTLFLAG_RD, - &txq->ift_map_failed, "# of times DMA map failed"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txd_encap_efbig", - CTLFLAG_RD, - &txq->ift_txd_encap_efbig, "# of times txd_encap returned EFBIG"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "no_tx_dma_setup", - CTLFLAG_RD, - &txq->ift_no_tx_dma_setup, "# of times map failed for other than EFBIG"); + CTLFLAG_RD, &txq->ift_pullups, + "# of times m_pullup was called"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "mbuf_defrag_failed", CTLFLAG_RD, + &txq->ift_mbuf_defrag_failed, "# of times m_defrag failed"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "no_desc_avail", CTLFLAG_RD, &txq->ift_no_desc_avail, + "# of times no descriptors were available"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "tx_map_failed", CTLFLAG_RD, &txq->ift_map_failed, + "# of times DMA map failed"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "txd_encap_efbig", CTLFLAG_RD, &txq->ift_txd_encap_efbig, + "# of times txd_encap returned EFBIG"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "no_tx_dma_setup", CTLFLAG_RD, &txq->ift_no_tx_dma_setup, + "# of times map failed for other than EFBIG"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_pidx", - CTLFLAG_RD, - &txq->ift_pidx, 1, "Producer Index"); + CTLFLAG_RD, &txq->ift_pidx, 1, "Producer Index"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_cidx", - CTLFLAG_RD, - &txq->ift_cidx, 1, "Consumer Index"); - SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_cidx_processed", - CTLFLAG_RD, - &txq->ift_cidx_processed, 1, "Consumer Index seen by credit update"); + CTLFLAG_RD, &txq->ift_cidx, 1, "Consumer Index"); + SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, + "txq_cidx_processed", CTLFLAG_RD, &txq->ift_cidx_processed, + 1, "Consumer Index seen by credit update"); SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "txq_in_use", - CTLFLAG_RD, - &txq->ift_in_use, 1, "descriptors in use"); - SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_processed", - CTLFLAG_RD, - &txq->ift_processed, "descriptors procesed for clean"); + CTLFLAG_RD, &txq->ift_in_use, 1, "descriptors in use"); + SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, + "txq_processed", CTLFLAG_RD, &txq->ift_processed, + "descriptors procesed for clean"); SYSCTL_ADD_UQUAD(ctx_list, queue_list, OID_AUTO, "txq_cleaned", - CTLFLAG_RD, - &txq->ift_cleaned, "total cleaned"); + CTLFLAG_RD, &txq->ift_cleaned, "total cleaned"); SYSCTL_ADD_PROC(ctx_list, queue_list, OID_AUTO, "ring_state", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, __DEVOLATILE(uint64_t *, &txq->ift_br->state), 0, mp_ring_state_handler, "A", "soft ring state"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_enqueues", - CTLFLAG_RD, &txq->ift_br->enqueues, - "# of enqueues to the mp_ring for this queue"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_drops", - CTLFLAG_RD, &txq->ift_br->drops, - "# of drops in the mp_ring for this queue"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_starts", - CTLFLAG_RD, &txq->ift_br->starts, - "# of normal consumer starts in the mp_ring for this queue"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_stalls", - CTLFLAG_RD, &txq->ift_br->stalls, - "# of consumer stalls in the mp_ring for this queue"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_restarts", - CTLFLAG_RD, &txq->ift_br->restarts, - "# of consumer restarts in the mp_ring for this queue"); - SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, "r_abdications", - CTLFLAG_RD, &txq->ift_br->abdications, - "# of consumer abdications in the mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_enqueues", CTLFLAG_RD, &txq->ift_br->enqueues, + "# of enqueues to the mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_drops", CTLFLAG_RD, &txq->ift_br->drops, + "# of drops in the mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_starts", CTLFLAG_RD, &txq->ift_br->starts, + "# of normal consumer starts in mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_stalls", CTLFLAG_RD, &txq->ift_br->stalls, + "# of consumer stalls in the mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_restarts", CTLFLAG_RD, &txq->ift_br->restarts, + "# of consumer restarts in the mp_ring for this queue"); + SYSCTL_ADD_COUNTER_U64(ctx_list, queue_list, OID_AUTO, + "r_abdications", CTLFLAG_RD, &txq->ift_br->abdications, + "# of consumer abdications in the mp_ring for this queue"); } if (scctx->isc_nrxqsets > 100) @@ -7156,44 +7151,42 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_INT(ctx_list, queue_list, OID_AUTO, "cpu", - CTLFLAG_RD, - &rxq->ifr_task.gt_cpu, 0, "cpu this queue is bound to"); + CTLFLAG_RD, &rxq->ifr_task.gt_cpu, 0, + "cpu this queue is bound to"); if (sctx->isc_flags & IFLIB_HAS_RXCQ) { - SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, "rxq_cq_cidx", - CTLFLAG_RD, - &rxq->ifr_cq_cidx, 1, "Consumer Index"); + SYSCTL_ADD_U16(ctx_list, queue_list, OID_AUTO, + "rxq_cq_cidx", CTLFLAG_RD, &rxq->ifr_cq_cidx, 1, + "Consumer Index"); } for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) { snprintf(namebuf, NAME_BUFLEN, "rxq_fl%d", j); - fl_node = SYSCTL_ADD_NODE(ctx_list, queue_list, OID_AUTO, namebuf, - CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "freelist Name"); + fl_node = SYSCTL_ADD_NODE(ctx_list, queue_list, + OID_AUTO, namebuf, CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, "freelist Name"); fl_list = SYSCTL_CHILDREN(fl_node); SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "pidx", - CTLFLAG_RD, - &fl->ifl_pidx, 1, "Producer Index"); + CTLFLAG_RD, &fl->ifl_pidx, 1, "Producer Index"); SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "cidx", - CTLFLAG_RD, - &fl->ifl_cidx, 1, "Consumer Index"); + CTLFLAG_RD, &fl->ifl_cidx, 1, "Consumer Index"); SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "credits", - CTLFLAG_RD, - &fl->ifl_credits, 1, "credits available"); + CTLFLAG_RD, &fl->ifl_credits, 1, + "credits available"); SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "buf_size", - CTLFLAG_RD, - &fl->ifl_buf_size, 1, "buffer size"); + CTLFLAG_RD, &fl->ifl_buf_size, 1, "buffer size"); #if MEMORY_LOGGING - SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_m_enqueued", - CTLFLAG_RD, - &fl->ifl_m_enqueued, "mbufs allocated"); - SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_m_dequeued", - CTLFLAG_RD, - &fl->ifl_m_dequeued, "mbufs freed"); - SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_enqueued", - CTLFLAG_RD, - &fl->ifl_cl_enqueued, "clusters allocated"); - SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, "fl_cl_dequeued", - CTLFLAG_RD, - &fl->ifl_cl_dequeued, "clusters freed"); + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, + "fl_m_enqueued", CTLFLAG_RD, &fl->ifl_m_enqueued, + "mbufs allocated"); + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, + "fl_m_dequeued", CTLFLAG_RD, &fl->ifl_m_dequeued, + "mbufs freed"); + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, + "fl_cl_enqueued", CTLFLAG_RD, &fl->ifl_cl_enqueued, + "clusters allocated"); + SYSCTL_ADD_UQUAD(ctx_list, fl_list, OID_AUTO, + "fl_cl_dequeued", CTLFLAG_RD, &fl->ifl_cl_dequeued, + "clusters freed"); #endif } } From nobody Wed Jul 31 04:38:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVN0F18z5Sc09; Wed, 31 Jul 2024 04:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVM5Pqcz4XNd; Wed, 31 Jul 2024 04:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j7WiNdffnALDKOY38WH7PAo1MLCEIQMuXy/msQ++RLY=; b=Hl+iRFNIxp8fLAcMcSUWpwT0LgvbSJCHFrno6A495lTDbs3VRMr8VCngw+CZn2cIcpPAQ5 Dm/URfnOt5OzKPHjDgfa11QTBcHEjeebRxP07dm21E0meOiqaBn0PKjStw4YVxiYUz/WMZ keJwIkDlYyeRa9pDBpAggx2yDMHoBYoVLy+g2gU2wvTNSd+n/jOXVWS19364qAJuiuK188 WCWBk7yks8wNffhmBHK++FZGzPXuH4sKaSoPSAoQYuugHSfa2KyyVlNwfURajfCuSxPjHh 2Fuhw7ELRHlV16wuMhFmfsYoYMkEZ1Bgeg03h1YQLbwv4gyaCulg7AZP+07l2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400699; a=rsa-sha256; cv=none; b=ufeaHxkBKR+YwlVMLMYhh3OfKvfBoe6TYzrq7HiiMONDa2hYr9G5iVfHdd4JHmu+KIhCTg uL+0qa97doOKy5ulYKJO1z6CS9Y/ecbGiiaAQhD9pBCnhWqw0TbcCRoccsU1ru8nUwQzn9 veN6VQYv8FUH2PTmgoI4KfkdZOaeEz2JfxqUVvQFT85HHKbEqUfQcYvvMqXI2+GjZ2j5vx /P6crbYsQbS+OQ8p+/rasu7URWB4CKBPn+D6tK5Wn/oGbkPilbdOQ0uqQ4MZ4+iNw5ZKhT qIwO9wSX5NkOh4nNtRupVDovaZTg4EWxDKsVsAIaGRTkvLTYpye1NiZdMhqlSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j7WiNdffnALDKOY38WH7PAo1MLCEIQMuXy/msQ++RLY=; b=K68MKiofld9EXkEUGaIYpy+cgglLXF1f4PXFEfXAjy7niWfBMzVSXrHkUQAyF2OsSju1yP YVKIpFAI43rws+Nqtc9gpHSTxSQ4xyuQ7mMWNZ5XCrpFuLfZR1c8mTuyayVmLiOcWY0fa0 p8DG09jDt7/OnjA+rn75GOi/D/5cbhrEmZ67nPFb8Niz5npkLSD8vG9aT29MsnD+dKFHgz KoA90Evk9AL0xdjvDE50PWh/jUXHLF0DrMJ46qqqsemDgquvdcwo3BVVZT2n2DqcigdxSe 1Gh/x47LPrNiYgrsyqP6RsWZbMTLMyeEM0ivNcZEYbLaunG02+LpTxLskEu2vQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVM4dngzm9r; Wed, 31 Jul 2024 04:38: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 46V4cJLn068574; Wed, 31 Jul 2024 04:38:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cJJl068571; Wed, 31 Jul 2024 04:38:19 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:19 GMT Message-Id: <202407310438.46V4cJJl068571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 1eb348e090fd - stable/13 - iflib: Add sysctl to request extra MSIX vectors on driver load List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1eb348e090fd3bda6c0f799fc4a22568f579f576 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=1eb348e090fd3bda6c0f799fc4a22568f579f576 commit 1eb348e090fd3bda6c0f799fc4a22568f579f576 Author: Eric Joyner AuthorDate: 2023-03-22 19:18:44 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:21 +0000 iflib: Add sysctl to request extra MSIX vectors on driver load Intended to be used with upcoming feature to add sub-interfaces, since those new interfaces will be dynamically created and will need to have spare MSI-X interrupts already allocated for them on driver load. This sysctl is marked as a tunable since it will need to be set before the driver is loaded since MSI-X interrupt allocation and setup is done during the attach process. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D41326 (cherry picked from commit 3c7da27a473e339392121404e06c506df040c16f) --- sys/net/iflib.c | 14 ++++++++++++++ sys/net/iflib.h | 1 + 2 files changed, 15 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index fec432a0cb65..ed82ff9a3d09 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -194,6 +194,7 @@ struct iflib_ctx { #define CORE_OFFSET_UNSPECIFIED 0xffff uint8_t ifc_sysctl_separate_txrx; uint8_t ifc_sysctl_use_logical_cores; + uint16_t ifc_sysctl_extra_msix_vectors; bool ifc_cpus_are_physical_cores; qidx_t ifc_sysctl_ntxds[8]; @@ -270,6 +271,13 @@ iflib_get_sctx(if_ctx_t ctx) return (ctx->ifc_sctx); } +uint16_t +iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx) +{ + + return (ctx->ifc_sysctl_extra_msix_vectors); +} + #define IP_ALIGNED(m) ((((uintptr_t)(m)->m_data) & 0x3) == 0x2) #define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE/sizeof(void*)) #define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr)+CACHE_LINE_SIZE-1) & (CACHE_LINE_SIZE-1))) @@ -7027,6 +7035,12 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "use_logical_cores", CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, "try to make use of logical cores for TX and RX"); + SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "use_extra_msix_vectors", + CTLFLAG_RDTUN, &ctx->ifc_sysctl_extra_msix_vectors, 0, + "attempt to reserve the given number of extra MSI-X vectors during driver load for the creation of additional interfaces later"); + SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "allocated_msix_vectors", + CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, + "total # of MSI-X vectors allocated by driver"); /* XXX change for per-queue sizes */ SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", diff --git a/sys/net/iflib.h b/sys/net/iflib.h index a444a4937a3c..f9b1045266c4 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -498,6 +498,7 @@ void iflib_led_create(if_ctx_t ctx); void iflib_add_int_delay_sysctl(if_ctx_t, const char *, const char *, if_int_delay_info_t, int, int); +uint16_t iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx); /* * Pseudo device support From nobody Wed Jul 31 04:38:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVQ1yk4z5Sbgy; Wed, 31 Jul 2024 04:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVQ02wlz4XWP; Wed, 31 Jul 2024 04:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TctUe8eL0hFcFVBr/UXW/j+4ybCdONHHowfZQAXFS6I=; b=xwVLOXpG83ve4R9logruSXHe7wMXbLxaVKu/+/n8MY/ySxqT9fc52Y1CQo6vVE2QUeOh3b LHwYh8J5tp7TE9Tl8LXeynMgiUHMQfp2IfHebHRK3IqKmSpig6C438PBws7KFXWdwLGjy3 /heReGBQrFZrbomA7RXGzF45F2bE/NApIoeBzO7ghNnGAl4UtwFpGeyONRgzBq+i24R/Iu Lz5PF3r/qqXOqXt4WPsjquE3TrDvE3/RX1zibzJZ1xQ86cX56I0Q19W28Dt8JKwlReeLXA sXMNuwNZlqwQtw44Y120QVvlc6Qe2l5jkDwYzaIZTZ2bovmcuofFN1kGiJzbtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400702; a=rsa-sha256; cv=none; b=m/FrBdJ2XbX6nk+jB6+WpYFJgZqEKOjbJeQf4Byt093ZPv1kTEZzxL6pZC8n3S2q8hIrDe STVgFloTz+BcAzfbYBP32gPEt1vQZcTM/msqxjvpSnvrB4GzC+/C9ZgOmnd9RQU08iYR0U actB7Vz1fMQkGa06x0aGXcWZTfJZHfHH5RKqb39fXz644s6lAqdLaa0GVf0jDABX856cOU 5Y1lGFnYVdyX8pUCQV8DzRRJiIv4r2f6E8iLrLAc4unfrgVnlT/ntzy3XjUOCQkIHaVOej oKGnz4wDOjB+TdY78Cc4sPN9VHIrJYGRbxuU3dtr+aoaeT3waJtctTLA0yGJoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TctUe8eL0hFcFVBr/UXW/j+4ybCdONHHowfZQAXFS6I=; b=WdBq6o5TdsgTkdtpV5OdBqnsacrvOspUpwR2HXaq4dye49bej3T6ahETqhAZ7mdT4Vl/+X fGI8hy/CSMkDcrZoEHTO8lmm4wJPpXzlJrd5wK9WYPI270INmRHmBg5p9MzdIaR5cXh2jG /b5z8d2MULO1lyWnQM5QCIvWx6bBzy+XKiDBSjNaLt9vkTTrQ8vLihaW7V+8zb4Ti/O4Pt 9L8uSwQ7gkgJ5EJsgHKJAvoJNjhzd/sZgBR8Jqw7BdihkxgXDxVSgWK704ej/Po/JWB+6W oM5dBArf7bxarLyXWgu8A1cXlpjBuc6ORZbD1IwmLKkARYhlHUGTN9YXgbzcaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVP6mcSzn3W; Wed, 31 Jul 2024 04:38: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 46V4cLPh068671; Wed, 31 Jul 2024 04:38:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cLUJ068668; Wed, 31 Jul 2024 04:38:21 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:21 GMT Message-Id: <202407310438.46V4cLUJ068668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: df718474022b - stable/13 - ice(4): Update copyright year to 2024 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df718474022b4acb7bebd2f073ba26c50964e305 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=df718474022b4acb7bebd2f073ba26c50964e305 commit df718474022b4acb7bebd2f073ba26c50964e305 Author: Eric Joyner AuthorDate: 2024-02-13 06:25:47 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:25 +0000 ice(4): Update copyright year to 2024 Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D44003 (cherry picked from commit 015f8cc5b0c10336a048f37a7071ea03516de242) --- sys/dev/ice/ice_adminq_cmd.h | 2 +- sys/dev/ice/ice_alloc.h | 2 +- sys/dev/ice/ice_bitops.h | 2 +- sys/dev/ice/ice_common.c | 2 +- sys/dev/ice/ice_common.h | 2 +- sys/dev/ice/ice_common_sysctls.h | 2 +- sys/dev/ice/ice_common_txrx.h | 2 +- sys/dev/ice/ice_controlq.c | 2 +- sys/dev/ice/ice_controlq.h | 2 +- sys/dev/ice/ice_dcb.c | 2 +- sys/dev/ice/ice_dcb.h | 2 +- sys/dev/ice/ice_ddp_common.c | 2 +- sys/dev/ice/ice_ddp_common.h | 2 +- sys/dev/ice/ice_defs.h | 2 +- sys/dev/ice/ice_drv_info.h | 2 +- sys/dev/ice/ice_features.h | 2 +- sys/dev/ice/ice_flex_pipe.c | 2 +- sys/dev/ice/ice_flex_pipe.h | 2 +- sys/dev/ice/ice_flex_type.h | 2 +- sys/dev/ice/ice_flow.c | 2 +- sys/dev/ice/ice_flow.h | 2 +- sys/dev/ice/ice_fw_logging.c | 2 +- sys/dev/ice/ice_fwlog.c | 2 +- sys/dev/ice/ice_fwlog.h | 2 +- sys/dev/ice/ice_hw_autogen.h | 2 +- sys/dev/ice/ice_iflib.h | 2 +- sys/dev/ice/ice_iflib_recovery_txrx.c | 2 +- sys/dev/ice/ice_iflib_sysctls.h | 2 +- sys/dev/ice/ice_iflib_txrx.c | 2 +- sys/dev/ice/ice_lan_tx_rx.h | 2 +- sys/dev/ice/ice_lib.c | 2 +- sys/dev/ice/ice_lib.h | 2 +- sys/dev/ice/ice_nvm.c | 2 +- sys/dev/ice/ice_nvm.h | 2 +- sys/dev/ice/ice_opts.h | 2 +- sys/dev/ice/ice_osdep.c | 2 +- sys/dev/ice/ice_osdep.h | 2 +- sys/dev/ice/ice_protocol_type.h | 2 +- sys/dev/ice/ice_rdma.c | 2 +- sys/dev/ice/ice_rdma.h | 2 +- sys/dev/ice/ice_rdma_internal.h | 2 +- sys/dev/ice/ice_resmgr.c | 2 +- sys/dev/ice/ice_resmgr.h | 2 +- sys/dev/ice/ice_rss.h | 2 +- sys/dev/ice/ice_sched.c | 2 +- sys/dev/ice/ice_sched.h | 2 +- sys/dev/ice/ice_status.h | 2 +- sys/dev/ice/ice_strings.c | 2 +- sys/dev/ice/ice_switch.c | 2 +- sys/dev/ice/ice_switch.h | 2 +- sys/dev/ice/ice_type.h | 2 +- sys/dev/ice/ice_vlan_mode.c | 2 +- sys/dev/ice/ice_vlan_mode.h | 2 +- sys/dev/ice/if_ice_iflib.c | 2 +- sys/dev/ice/irdma_di_if.m | 2 +- sys/dev/ice/irdma_if.m | 2 +- sys/dev/ice/virtchnl.h | 2 +- sys/dev/ice/virtchnl_inline_ipsec.h | 2 +- 58 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index e4dc14b0162c..31e9583494fc 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_alloc.h b/sys/dev/ice/ice_alloc.h index 4970fae3bcf7..90946143091a 100644 --- a/sys/dev/ice/ice_alloc.h +++ b/sys/dev/ice/ice_alloc.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index 9c20106b994a..c7bf3384675e 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index 0df73583e137..73249cb7add4 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common.h b/sys/dev/ice/ice_common.h index 3d96792cf56f..024f6f4cdb01 100644 --- a/sys/dev/ice/ice_common.h +++ b/sys/dev/ice/ice_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common_sysctls.h b/sys/dev/ice/ice_common_sysctls.h index 3ff004152784..37a50296ea81 100644 --- a/sys/dev/ice/ice_common_sysctls.h +++ b/sys/dev/ice/ice_common_sysctls.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_common_txrx.h b/sys/dev/ice/ice_common_txrx.h index 4a4d2fc948ed..865c1d27da44 100644 --- a/sys/dev/ice/ice_common_txrx.h +++ b/sys/dev/ice/ice_common_txrx.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index 6568be2d9748..09816d4a812a 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_controlq.h b/sys/dev/ice/ice_controlq.h index b32c753d14c5..047dd1beaf60 100644 --- a/sys/dev/ice/ice_controlq.h +++ b/sys/dev/ice/ice_controlq.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_dcb.c b/sys/dev/ice/ice_dcb.c index deb1505fa01c..a06117f90aad 100644 --- a/sys/dev/ice/ice_dcb.c +++ b/sys/dev/ice/ice_dcb.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_dcb.h b/sys/dev/ice/ice_dcb.h index 10c8c3cda9e9..ec2200afe200 100644 --- a/sys/dev/ice/ice_dcb.h +++ b/sys/dev/ice/ice_dcb.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_ddp_common.c b/sys/dev/ice/ice_ddp_common.c index 95e65317a4f2..a1573f5ea998 100644 --- a/sys/dev/ice/ice_ddp_common.c +++ b/sys/dev/ice/ice_ddp_common.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_ddp_common.h b/sys/dev/ice/ice_ddp_common.h index 10f6665d2b12..9305dc83520d 100644 --- a/sys/dev/ice/ice_ddp_common.h +++ b/sys/dev/ice/ice_ddp_common.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_defs.h b/sys/dev/ice/ice_defs.h index 3b96f9e0bf7c..e9f5192bed9f 100644 --- a/sys/dev/ice/ice_defs.h +++ b/sys/dev/ice/ice_defs.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index 41598923dc94..ff13fe99ee27 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index c259684df4fc..b58af574976d 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.c b/sys/dev/ice/ice_flex_pipe.c index fc31afab9e79..943b37746f9d 100644 --- a/sys/dev/ice/ice_flex_pipe.c +++ b/sys/dev/ice/ice_flex_pipe.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_pipe.h b/sys/dev/ice/ice_flex_pipe.h index 16f9334daa83..559905e7fb59 100644 --- a/sys/dev/ice/ice_flex_pipe.h +++ b/sys/dev/ice/ice_flex_pipe.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flex_type.h b/sys/dev/ice/ice_flex_type.h index 5baa694ebda7..9c8f7b462677 100644 --- a/sys/dev/ice/ice_flex_type.h +++ b/sys/dev/ice/ice_flex_type.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flow.c b/sys/dev/ice/ice_flow.c index a45bb0408b9d..0cf37159b251 100644 --- a/sys/dev/ice/ice_flow.c +++ b/sys/dev/ice/ice_flow.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_flow.h b/sys/dev/ice/ice_flow.h index c6e272b4dd6b..0857b325ca7c 100644 --- a/sys/dev/ice/ice_flow.h +++ b/sys/dev/ice/ice_flow.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_fw_logging.c b/sys/dev/ice/ice_fw_logging.c index 57445cc89056..a8caf65aca6d 100644 --- a/sys/dev/ice/ice_fw_logging.c +++ b/sys/dev/ice/ice_fw_logging.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_fwlog.c b/sys/dev/ice/ice_fwlog.c index b66860f67cf5..c3c6d9101627 100644 --- a/sys/dev/ice/ice_fwlog.c +++ b/sys/dev/ice/ice_fwlog.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_fwlog.h b/sys/dev/ice/ice_fwlog.h index 0aa7db9a8339..41e41de1e670 100644 --- a/sys/dev/ice/ice_fwlog.h +++ b/sys/dev/ice/ice_fwlog.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_hw_autogen.h b/sys/dev/ice/ice_hw_autogen.h index 36d13eb22f52..6b04bff4b722 100644 --- a/sys/dev/ice/ice_hw_autogen.h +++ b/sys/dev/ice/ice_hw_autogen.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_iflib.h b/sys/dev/ice/ice_iflib.h index d89d04985429..e9e09851b82c 100644 --- a/sys/dev/ice/ice_iflib.h +++ b/sys/dev/ice/ice_iflib.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_iflib_recovery_txrx.c b/sys/dev/ice/ice_iflib_recovery_txrx.c index 69ee98b46d35..dd90ffb8f21a 100644 --- a/sys/dev/ice/ice_iflib_recovery_txrx.c +++ b/sys/dev/ice/ice_iflib_recovery_txrx.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_iflib_sysctls.h b/sys/dev/ice/ice_iflib_sysctls.h index 1eac7249447e..a718f5d12943 100644 --- a/sys/dev/ice/ice_iflib_sysctls.h +++ b/sys/dev/ice/ice_iflib_sysctls.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_iflib_txrx.c b/sys/dev/ice/ice_iflib_txrx.c index 8afca4832d8f..59332e8509f9 100644 --- a/sys/dev/ice/ice_iflib_txrx.c +++ b/sys/dev/ice/ice_iflib_txrx.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_lan_tx_rx.h b/sys/dev/ice/ice_lan_tx_rx.h index 415565b4e99d..860958bffbaf 100644 --- a/sys/dev/ice/ice_lan_tx_rx.h +++ b/sys/dev/ice/ice_lan_tx_rx.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 9ba38f8582a8..a92658ba9f38 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index c07b9458db1f..fd8c8881cdbd 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_nvm.c b/sys/dev/ice/ice_nvm.c index 42a60e0df1c8..91393c1fc8b3 100644 --- a/sys/dev/ice/ice_nvm.c +++ b/sys/dev/ice/ice_nvm.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_nvm.h b/sys/dev/ice/ice_nvm.h index d359a9ea4e4e..32f791f63102 100644 --- a/sys/dev/ice/ice_nvm.h +++ b/sys/dev/ice/ice_nvm.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_opts.h b/sys/dev/ice/ice_opts.h index 4b11f277debe..479ead0dc41e 100644 --- a/sys/dev/ice/ice_opts.h +++ b/sys/dev/ice/ice_opts.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_osdep.c b/sys/dev/ice/ice_osdep.c index c9ac8e9f97c9..88b4984c290f 100644 --- a/sys/dev/ice/ice_osdep.c +++ b/sys/dev/ice/ice_osdep.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_osdep.h b/sys/dev/ice/ice_osdep.h index c6774588bdaa..ea355ddb31f4 100644 --- a/sys/dev/ice/ice_osdep.h +++ b/sys/dev/ice/ice_osdep.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_protocol_type.h b/sys/dev/ice/ice_protocol_type.h index 0793eb005eca..ced1bc5037dd 100644 --- a/sys/dev/ice/ice_protocol_type.h +++ b/sys/dev/ice/ice_protocol_type.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_rdma.c b/sys/dev/ice/ice_rdma.c index 12d100584b7b..327d1ceeb5c6 100644 --- a/sys/dev/ice/ice_rdma.c +++ b/sys/dev/ice/ice_rdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_rdma.h b/sys/dev/ice/ice_rdma.h index 6d818f84b6cf..68aa2f2099e7 100644 --- a/sys/dev/ice/ice_rdma.h +++ b/sys/dev/ice/ice_rdma.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_rdma_internal.h b/sys/dev/ice/ice_rdma_internal.h index 20718973af5d..c2ff8757c8c2 100644 --- a/sys/dev/ice/ice_rdma_internal.h +++ b/sys/dev/ice/ice_rdma_internal.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_resmgr.c b/sys/dev/ice/ice_resmgr.c index 547d6035e2bb..824b986fff57 100644 --- a/sys/dev/ice/ice_resmgr.c +++ b/sys/dev/ice/ice_resmgr.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_resmgr.h b/sys/dev/ice/ice_resmgr.h index eef028df4700..0869f5c5654c 100644 --- a/sys/dev/ice/ice_resmgr.h +++ b/sys/dev/ice/ice_resmgr.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_rss.h b/sys/dev/ice/ice_rss.h index 0b79bea6f30b..ede1fad5abe7 100644 --- a/sys/dev/ice/ice_rss.h +++ b/sys/dev/ice/ice_rss.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_sched.c b/sys/dev/ice/ice_sched.c index 49a8415132cb..ed9432292c0c 100644 --- a/sys/dev/ice/ice_sched.c +++ b/sys/dev/ice/ice_sched.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_sched.h b/sys/dev/ice/ice_sched.h index 4d9a4480fe58..490a7719a960 100644 --- a/sys/dev/ice/ice_sched.h +++ b/sys/dev/ice/ice_sched.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_status.h b/sys/dev/ice/ice_status.h index 48c8264c4bc5..016d987bac36 100644 --- a/sys/dev/ice/ice_status.h +++ b/sys/dev/ice/ice_status.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_strings.c b/sys/dev/ice/ice_strings.c index 16a1f9a34d56..7feaef163ef6 100644 --- a/sys/dev/ice/ice_strings.c +++ b/sys/dev/ice/ice_strings.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_switch.c b/sys/dev/ice/ice_switch.c index dfa2368e2bee..44be3999d3de 100644 --- a/sys/dev/ice/ice_switch.c +++ b/sys/dev/ice/ice_switch.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_switch.h b/sys/dev/ice/ice_switch.h index e5b0239d491b..70b5df769175 100644 --- a/sys/dev/ice/ice_switch.h +++ b/sys/dev/ice/ice_switch.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_type.h b/sys/dev/ice/ice_type.h index b7bab6a21a20..e153a772f746 100644 --- a/sys/dev/ice/ice_type.h +++ b/sys/dev/ice/ice_type.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_vlan_mode.c b/sys/dev/ice/ice_vlan_mode.c index 9b298a6ad71a..e0c6d7897607 100644 --- a/sys/dev/ice/ice_vlan_mode.c +++ b/sys/dev/ice/ice_vlan_mode.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/ice_vlan_mode.h b/sys/dev/ice/ice_vlan_mode.h index 1cf4ebb68798..8b1a56c98a3d 100644 --- a/sys/dev/ice/ice_vlan_mode.h +++ b/sys/dev/ice/ice_vlan_mode.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 24a964cdcf0a..ce2ea7c857f3 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/irdma_di_if.m b/sys/dev/ice/irdma_di_if.m index 55564d554c12..61a1817925a2 100644 --- a/sys/dev/ice/irdma_di_if.m +++ b/sys/dev/ice/irdma_di_if.m @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright (c) 2023, Intel Corporation +# Copyright (c) 2024, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/irdma_if.m b/sys/dev/ice/irdma_if.m index a78a4b05f7d2..d3aa68bcdf46 100644 --- a/sys/dev/ice/irdma_if.m +++ b/sys/dev/ice/irdma_if.m @@ -1,5 +1,5 @@ # SPDX-License-Identifier: BSD-3-Clause -# Copyright (c) 2023, Intel Corporation +# Copyright (c) 2024, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/virtchnl.h b/sys/dev/ice/virtchnl.h index da281bfa366b..d7a1d3f254bf 100644 --- a/sys/dev/ice/virtchnl.h +++ b/sys/dev/ice/virtchnl.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ice/virtchnl_inline_ipsec.h b/sys/dev/ice/virtchnl_inline_ipsec.h index ad8cfc1dcebb..adcd9f34c00f 100644 --- a/sys/dev/ice/virtchnl_inline_ipsec.h +++ b/sys/dev/ice/virtchnl_inline_ipsec.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause */ -/* Copyright (c) 2023, Intel Corporation +/* Copyright (c) 2024, Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without From nobody Wed Jul 31 04:38:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVP0rCVz5SbrV; Wed, 31 Jul 2024 04:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVN63Rsz4X3v; Wed, 31 Jul 2024 04:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+V+tzJ/XrxyD4k+ZLhcE9A8GpFd0c5iEQYWdiLtgnBs=; b=EEFTlfEdGScQFwOES78VzuC+bgmpjIoIYgo5KFQFN3jwgAS4S3EDZiAgayf28OSLT+4Z+A 9gbWbNjvQSO8WNRR4RR5Q5vTh1o8ToyJjfPjQlBP2+K6xbXLNg9jrXGm5lm5CIahR/U3x/ nfMe98nJbhCZF1mtx3xRNtW4cHBddSYdpVl6c4bwOfl4udk7G9epekIqSVIBpNdDt8Cxgq J4sxE1vP0s1nYNug0I03/AifpKrlkPgj8jnuCtKCGp7h2ZZdXBYubOMTGWct0wndKYt5P7 dWGVLeSaiZ2UN14mKEXn+7wDSzbgr5zn6hO4meYT5UKuemClGrd6J72Yy1CHBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400700; a=rsa-sha256; cv=none; b=Iqytpp1i/L9VSs+TUHKX6qv1LxRaoezuyU42PZDBEWNaHr4UyWTuT7WknKSk83o+8iK0M5 gGVLwLrJRJ/KC18CVtMJfgnHu3rNuGAl78eRuYLludawX5G0tsZg3lG0BaIq6RScBeuy3k umeWbrUXjw4ECMMVctpiS3xgFS+a9PRMU7DIfn5OzZ5Frnxt6w4Gn7YCB5q2sJKVNQ17iE /HlCBr4rPJlYqoUl+wRf70ILHnw0aXgw9asAxYhwg05lSdIiFK+rF6JLMYvAKHOu7YaNes /7bvmPflOx71GtfU03s1SlOR/XfxspQV+QD3xl62DsphGSlp2GyH9KfM1li03Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+V+tzJ/XrxyD4k+ZLhcE9A8GpFd0c5iEQYWdiLtgnBs=; b=u/5eSO/lddviRGIqWqCoK4URyw/z4+EA4OIqG7GHAHZNNK8E8ZwB6Pxpa+RviOESBGM6t/ UGNZVGNsSs3jHlTNYQHXP+Na3Pg2AVoxn++c49J8Hw+PGlgDplVHw5gRWwwl1LQGGVP29A 70Mv+t+TarkGGBNxGeDtB5GqzzOEpX5ghpWOSL+zOuq80ceB7zsXrTrxyhH13PnF61YlzR e+ZvM692Jf5U1CRxqyb1Qi1YLOKcocIMO4BbKS/6nG7aOkIeN3q4E8d0lhnlbqLoCDb0qL nNFgV39WqITtTLCUpwjAD1V616JviSdmZ0e5ckaiNecjXcDqXMSJURgO9vbovA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVN5dLCzn50; Wed, 31 Jul 2024 04:38: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 46V4cKv4068626; Wed, 31 Jul 2024 04:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cKOB068623; Wed, 31 Jul 2024 04:38:20 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:20 GMT Message-Id: <202407310438.46V4cKOB068623@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 67c30c246d16 - stable/13 - iflib: Add subinterface interrupt allocation function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 67c30c246d16414016f96fc87dd73413de25610d Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=67c30c246d16414016f96fc87dd73413de25610d commit 67c30c246d16414016f96fc87dd73413de25610d Author: Eric Joyner AuthorDate: 2023-01-18 00:46:39 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:23 +0000 iflib: Add subinterface interrupt allocation function The ice(4) driver will add the ability to create extra interfaces that hang off of the base interface; to do that the driver requires a method for the subinterface to request hardware interrupt resources from the base interface. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D39930 (cherry picked from commit ed34a6b6eab9ea39759ccd3f12876a815d271929) --- sys/net/iflib.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-- sys/net/iflib.h | 12 +++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index ed82ff9a3d09..38e7f57823d1 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1458,8 +1458,8 @@ iflib_dma_alloc_align(if_ctx_t ctx, int size, int align, iflib_dma_info_t dma, i &dma->idi_tag); if (err) { device_printf(dev, - "%s: bus_dma_tag_create failed: %d\n", - __func__, err); + "%s: bus_dma_tag_create failed: %d (size=%d, align=%d)\n", + __func__, err, size, align); goto fail_0; } @@ -6423,6 +6423,81 @@ iflib_irq_set_affinity(if_ctx_t ctx, if_irq_t irq, iflib_intr_type_t type, return (0); } +/* + * Allocate a hardware interrupt for subctx using the parent (ctx)'s hardware + * resources. + * + * Similar to iflib_irq_alloc_generic(), but for interrupt type IFLIB_INTR_RXTX + * only. + * + * XXX: Could be removed if subctx's dev has its intr resource allocation + * methods replaced with custom ones? + */ +int +iflib_irq_alloc_generic_subctx(if_ctx_t ctx, if_ctx_t subctx, if_irq_t irq, + int rid, iflib_intr_type_t type, + driver_filter_t *filter, void *filter_arg, + int qid, const char *name) +{ + device_t dev, subdev; + struct grouptask *gtask; + struct taskqgroup *tqg; + iflib_filter_info_t info; + gtask_fn_t *fn; + int tqrid, err; + driver_filter_t *intr_fast; + void *q; + + MPASS(ctx != NULL); + MPASS(subctx != NULL); + + tqrid = rid; + dev = ctx->ifc_dev; + subdev = subctx->ifc_dev; + + switch (type) { + case IFLIB_INTR_RXTX: + q = &subctx->ifc_rxqs[qid]; + info = &subctx->ifc_rxqs[qid].ifr_filter_info; + gtask = &subctx->ifc_rxqs[qid].ifr_task; + tqg = qgroup_if_io_tqg; + fn = _task_fn_rx; + intr_fast = iflib_fast_intr_rxtx; + NET_GROUPTASK_INIT(gtask, 0, fn, q); + break; + default: + device_printf(dev, "%s: unknown net intr type for subctx %s (%d)\n", + __func__, device_get_nameunit(subdev), type); + return (EINVAL); + } + + info->ifi_filter = filter; + info->ifi_filter_arg = filter_arg; + info->ifi_task = gtask; + info->ifi_ctx = q; + + NET_GROUPTASK_INIT(gtask, 0, fn, q); + + /* Allocate interrupts from hardware using parent context */ + err = _iflib_irq_alloc(ctx, irq, rid, intr_fast, NULL, info, name); + if (err != 0) { + device_printf(dev, "_iflib_irq_alloc failed for subctx %s: %d\n", + device_get_nameunit(subdev), err); + return (err); + } + + if (tqrid != -1) { + err = iflib_irq_set_affinity(ctx, irq, type, qid, gtask, tqg, q, + name); + if (err) + return (err); + } else { + taskqgroup_attach(tqg, gtask, q, dev, irq->ii_res, name); + } + + return (0); +} + int iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, iflib_intr_type_t type, driver_filter_t *filter, diff --git a/sys/net/iflib.h b/sys/net/iflib.h index f9b1045266c4..f23b8138435c 100644 --- a/sys/net/iflib.h +++ b/sys/net/iflib.h @@ -402,6 +402,11 @@ typedef enum { * function. */ #define IFLIB_FEATURE_QUEUE_SELECT_V2 1301509 +/* + * Driver can create subinterfaces with their own Tx/Rx queues + * that all share a single device (or commonly, port) + */ +#define IFLIB_FEATURE_SUB_INTERFACES 1303503 /* * These enum values are used in iflib_needs_restart to indicate to iflib @@ -506,4 +511,11 @@ uint16_t iflib_get_extra_msix_vectors_sysctl(if_ctx_t ctx); if_pseudo_t iflib_clone_register(if_shared_ctx_t); void iflib_clone_deregister(if_pseudo_t); +/* + * Sub-interface support + */ +int iflib_irq_alloc_generic_subctx(if_ctx_t ctx, if_ctx_t subctx, if_irq_t irq, + int rid, iflib_intr_type_t type, + driver_filter_t *filter, void *filter_arg, + int qid, const char *name); #endif /* __IFLIB_H_ */ From nobody Wed Jul 31 04:38:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYfVR3cBjz5Sc2Z; Wed, 31 Jul 2024 04:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYfVR17qYz4Xc0; Wed, 31 Jul 2024 04:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oAC3XHfoa5puLeNp+VDe622OTM4YTnl4CYggo9bsKfI=; b=J0s7FNikbXoL/WmQIgsW9BMyizw4Luh1m35Ksl6qfu8cvV9FyDGID9elB+u4G3vsC1OV/1 EspqUCMsUMQkWlZ0uNyMlNcAtHdPCJM2Ut3WEIYoHFa/y7z3SOywZ2S/ZuRtG9R3PKMGDx ZRU6Z2UTtn0qJ9CYIJI+uDcLkBMaQPMAw+U+OWVarj5S/eC5Xgin2nla4xZOLGUvRLV+BH fHnZNDg/X2/2Ds25dC+91PLqHknGe8KEY1BSLEApFx6w+qEh/MfbgzLCuON/L8eoLH2UB7 Z2fm/N3SmJ+raAMgXX2QBHZGSHnIYfpZQWmgjhPDJfY0DzMzXcQc5TJwBt657w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722400703; a=rsa-sha256; cv=none; b=oNOhW1PVZuHuHg9szEz9qGjm2ZfbV0vd48gq69qiSynb4C4Tt7EpCjN54kukxgrBcPtzmP Hc09HBFElvyVfizTM+KxzcMZnbyQCvRdB8m0tkBtaYFuPiEXv3wrcC7EulxGjIITy55Za1 LaXtnrt7GE61tY7WVkNl0WBDEizaWqTt2CnZtHRI9zddA1aPgI2SbguNlSiznP5suJ5IE8 j3Ew3NCaIeOnpDyz84kP5SaditXGCZEBfVP4QR3YY0uFh30M6eP2Bwvgiug3Jwtp3I2uYG rYXCBmpboPm4ghc74E6s92clqb2GvueGhlvF49MzNeoSsFvjW+Grh/6g4atqhw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722400703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oAC3XHfoa5puLeNp+VDe622OTM4YTnl4CYggo9bsKfI=; b=aJ4yBwf8XGmytNUyR33imnCjuyWblaIDjmzJaWtLdQC3DQTi1kxkyTMyY1sUG03wWLFY/z mr8/sI2nSeLs4QLqezoYlZDXz95vj5763yo1lOmKA8p2KOdQIibUeiL0JI5uGv3H/LS2rH KuYYL356UqzJQ3W2r3KGUfnj+/s/V2qffHbqWX9ISgftMoR8+dt2DrLPH8SEL9v9hNGzHh x4mxKRe4IH42VS1L8ucNSeYUgi6ik73gd6/zyFo4p4Zio/V6pWb9jRrj62P206gpTViaUA PgtIstwJBNGHg/vyAPreihQlqYtX+7sUwoAIBSROCfzXHMDe3VrUJPtjwDRauQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYfVR0lxzzmtH; Wed, 31 Jul 2024 04:38: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 46V4cN7m068711; Wed, 31 Jul 2024 04:38:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V4cMMq068708; Wed, 31 Jul 2024 04:38:22 GMT (envelope-from git) Date: Wed, 31 Jul 2024 04:38:22 GMT Message-Id: <202407310438.46V4cMMq068708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: dbda7355908f - stable/13 - ice(4): Update to 1.39.13-k List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dbda7355908fc536e2b1fc6cd5b39c285fd88cc9 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=dbda7355908fc536e2b1fc6cd5b39c285fd88cc9 commit dbda7355908fc536e2b1fc6cd5b39c285fd88cc9 Author: Eric Joyner AuthorDate: 2024-02-13 06:26:26 +0000 Commit: Eric Joyner CommitDate: 2024-07-31 04:29:27 +0000 ice(4): Update to 1.39.13-k - Adds mirror interface functionality - Remove unused virtchnl headers Signed-off-by: Eric Joyner MFC-with: 768329961dc0c041f7647f1c4549944a2ca168aa Sponsored by: Intel Corporation Tested by: jeffrey.e.pieper@intel.com Differential Revision: https://reviews.freebsd.org/D44004 (cherry picked from commit 9e54973fc33aa44b77d1c851cb36fcd82dc44cda) --- sys/dev/ice/ice_adminq_cmd.h | 21 +- sys/dev/ice/ice_bitops.h | 4 +- sys/dev/ice/ice_common.c | 43 +- sys/dev/ice/ice_common.h | 8 +- sys/dev/ice/ice_controlq.c | 10 +- sys/dev/ice/ice_controlq.h | 3 +- sys/dev/ice/ice_drv_info.h | 10 +- sys/dev/ice/ice_features.h | 1 - sys/dev/ice/ice_flex_pipe.c | 1 + sys/dev/ice/ice_flow.c | 71 +- sys/dev/ice/ice_flow.h | 8 +- sys/dev/ice/ice_hw_autogen.h | 1 + sys/dev/ice/ice_iflib.h | 32 +- sys/dev/ice/ice_iflib_txrx.c | 351 +++++++++- sys/dev/ice/ice_lib.c | 360 ++++++++-- sys/dev/ice/ice_lib.h | 30 +- sys/dev/ice/ice_nvm.c | 33 +- sys/dev/ice/ice_nvm.h | 1 + sys/dev/ice/ice_protocol_type.h | 1 + sys/dev/ice/ice_sched.c | 7 +- sys/dev/ice/ice_strings.c | 6 + sys/dev/ice/ice_switch.c | 31 +- sys/dev/ice/ice_switch.h | 9 +- sys/dev/ice/ice_type.h | 15 +- sys/dev/ice/if_ice_iflib.c | 1264 ++++++++++++++++++++++++++++++++++- sys/dev/ice/virtchnl_inline_ipsec.h | 594 ---------------- sys/dev/ice/virtchnl_lan_desc.h | 0 27 files changed, 2133 insertions(+), 782 deletions(-) diff --git a/sys/dev/ice/ice_adminq_cmd.h b/sys/dev/ice/ice_adminq_cmd.h index 31e9583494fc..70b56144faf2 100644 --- a/sys/dev/ice/ice_adminq_cmd.h +++ b/sys/dev/ice/ice_adminq_cmd.h @@ -152,6 +152,7 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_WOL_PROXY 0x0008 #define ICE_AQC_CAPS_SRIOV 0x0012 #define ICE_AQC_CAPS_VF 0x0013 +#define ICE_AQC_CAPS_VMDQ 0x0014 #define ICE_AQC_CAPS_802_1QBG 0x0015 #define ICE_AQC_CAPS_802_1BR 0x0016 #define ICE_AQC_CAPS_VSI 0x0017 @@ -184,6 +185,8 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_DYN_FLATTENING 0x008A #define ICE_AQC_CAPS_OROM_RECOVERY_UPDATE 0x0090 #define ICE_AQC_CAPS_ROCEV2_LAG 0x0092 +#define ICE_AQC_BIT_ROCEV2_LAG 0x01 +#define ICE_AQC_BIT_SRIOV_LAG 0x02 u8 major_ver; u8 minor_ver; @@ -358,6 +361,8 @@ struct ice_aqc_set_port_params { #define ICE_AQC_RES_TYPE_FLAG_SHARED BIT(7) #define ICE_AQC_RES_TYPE_FLAG_SCAN_BOTTOM BIT(12) #define ICE_AQC_RES_TYPE_FLAG_IGNORE_INDEX BIT(13) +#define ICE_AQC_RES_TYPE_FLAG_SUBSCRIBE_SHARED BIT(14) +#define ICE_AQC_RES_TYPE_FLAG_SUBSCRIBE_CTL BIT(15) #define ICE_AQC_RES_TYPE_FLAG_DEDICATED 0x00 @@ -2198,6 +2203,14 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_MINSREV_MOD_ID 0x130 #define ICE_AQC_NVM_TX_TOPO_MOD_ID 0x14B +#define ICE_AQC_NVM_CMPO_MOD_ID 0x153 + +/* Cage Max Power override NVM module */ +struct ice_aqc_nvm_cmpo { + __le16 length; +#define ICE_AQC_NVM_CMPO_ENABLE BIT(8) + __le16 cages_cfg[8]; +}; /* Used for reading and writing MinSRev using 0x0701 and 0x0703. Note that the * type field is excluded from the section when reading and writing from @@ -2509,11 +2522,13 @@ enum ice_lut_type { ICE_LUT_VSI = 0, ICE_LUT_PF = 1, ICE_LUT_GLOBAL = 2, - ICE_LUT_TYPE_MASK = 3 + ICE_LUT_TYPE_MASK = 3, + ICE_LUT_PF_SMALL = 5, /* yields ICE_LUT_PF when &= ICE_LUT_TYPE_MASK */ }; enum ice_lut_size { ICE_LUT_VSI_SIZE = 64, + ICE_LUT_PF_SMALL_SIZE = 128, ICE_LUT_GLOBAL_SIZE = 512, ICE_LUT_PF_SIZE = 2048, }; @@ -2796,7 +2811,7 @@ struct ice_aqc_event_lan_overflow { /* Debug Dump Internal Data (indirect 0xFF08) */ struct ice_aqc_debug_dump_internals { - u8 cluster_id; + __le16 cluster_id; /* Expresses next cluster ID in response */ #define ICE_AQC_DBG_DUMP_CLUSTER_ID_SW 0 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_TXSCHED 2 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_PROFILES 3 @@ -2809,7 +2824,7 @@ struct ice_aqc_debug_dump_internals { #define ICE_AQC_DBG_DUMP_CLUSTER_ID_L2P 8 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_QUEUE_MNG 9 #define ICE_AQC_DBG_DUMP_CLUSTER_ID_FULL_CSR_SPACE 21 - u8 reserved; +#define ICE_AQC_DBG_DUMP_CLUSTER_ID_MNG_TRANSACTIONS 22 __le16 table_id; /* Used only for non-memory clusters */ __le32 idx; /* In table entries for tables, in bytes for memory */ __le32 addr_high; diff --git a/sys/dev/ice/ice_bitops.h b/sys/dev/ice/ice_bitops.h index c7bf3384675e..499ee41228c3 100644 --- a/sys/dev/ice/ice_bitops.h +++ b/sys/dev/ice/ice_bitops.h @@ -402,7 +402,7 @@ static inline bool ice_is_any_bit_set(ice_bitmap_t *bitmap, u16 size) } /** - * ice_cp_bitmap - copy bitmaps. + * ice_cp_bitmap - copy bitmaps * @dst: bitmap destination * @src: bitmap to copy from * @size: Size of the bitmaps in bits @@ -460,7 +460,7 @@ ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) } /** - * ice_cmp_bitmap - compares two bitmaps. + * ice_cmp_bitmap - compares two bitmaps * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 * @size: Size of the bitmaps in bits diff --git a/sys/dev/ice/ice_common.c b/sys/dev/ice/ice_common.c index 73249cb7add4..ef487bcfd0f4 100644 --- a/sys/dev/ice/ice_common.c +++ b/sys/dev/ice/ice_common.c @@ -2319,6 +2319,10 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, ice_debug(hw, ICE_DBG_INIT, "%s: sr_iov_1_1 = %d\n", prefix, caps->sr_iov_1_1); break; + case ICE_AQC_CAPS_VMDQ: + caps->vmdq = (number == 1); + ice_debug(hw, ICE_DBG_INIT, "%s: vmdq = %d\n", prefix, caps->vmdq); + break; case ICE_AQC_CAPS_802_1QBG: caps->evb_802_1_qbg = (number == 1); ice_debug(hw, ICE_DBG_INIT, "%s: evb_802_1_qbg = %d\n", prefix, number); @@ -2404,7 +2408,7 @@ ice_parse_common_caps(struct ice_hw *hw, struct ice_hw_common_caps *caps, ice_debug(hw, ICE_DBG_INIT, "%s: iwarp = %d\n", prefix, caps->iwarp); break; case ICE_AQC_CAPS_ROCEV2_LAG: - caps->roce_lag = (number == 1); + caps->roce_lag = !!(number & ICE_AQC_BIT_ROCEV2_LAG); ice_debug(hw, ICE_DBG_INIT, "%s: roce_lag = %d\n", prefix, caps->roce_lag); break; @@ -2726,6 +2730,10 @@ ice_parse_nac_topo_dev_caps(struct ice_hw *hw, struct ice_hw_dev_caps *dev_p, dev_p->nac_topo.mode = LE32_TO_CPU(cap->number); dev_p->nac_topo.id = LE32_TO_CPU(cap->phys_id) & ICE_NAC_TOPO_ID_M; + ice_info(hw, "PF is configured in %s mode with IP instance ID %d\n", + (dev_p->nac_topo.mode == 0) ? "primary" : "secondary", + dev_p->nac_topo.id); + ice_debug(hw, ICE_DBG_INIT, "dev caps: nac topology is_primary = %d\n", !!(dev_p->nac_topo.mode & ICE_NAC_TOPO_PRIMARY_M)); ice_debug(hw, ICE_DBG_INIT, "dev caps: nac topology is_dual = %d\n", @@ -3060,7 +3068,7 @@ void ice_clear_pxe_mode(struct ice_hw *hw) } /** - * ice_aq_set_port_params - set physical port parameters. + * ice_aq_set_port_params - set physical port parameters * @pi: pointer to the port info struct * @bad_frame_vsi: defines the VSI to which bad frames are forwarded * @save_bad_pac: if set packets with errors are forwarded to the bad frames VSI @@ -4058,6 +4066,8 @@ static u16 ice_lut_type_to_size(u16 lut_type) return ICE_LUT_GLOBAL_SIZE; case ICE_LUT_PF: return ICE_LUT_PF_SIZE; + case ICE_LUT_PF_SMALL: + return ICE_LUT_PF_SMALL_SIZE; default: return 0; } @@ -4089,6 +4099,8 @@ int ice_lut_size_to_type(int lut_size) return ICE_LUT_GLOBAL; case ICE_LUT_PF_SIZE: return ICE_LUT_PF; + case ICE_LUT_PF_SMALL_SIZE: + return ICE_LUT_PF_SMALL; default: return -1; } @@ -4116,8 +4128,8 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params vsi_handle = params->vsi_handle; lut = params->lut; - lut_type = params->lut_type; - lut_size = ice_lut_type_to_size(lut_type); + lut_size = ice_lut_type_to_size(params->lut_type); + lut_type = params->lut_type & ICE_LUT_TYPE_MASK; cmd_resp = &desc.params.get_set_rss_lut; if (lut_type == ICE_LUT_GLOBAL) glob_lut_idx = params->global_lut_id; @@ -4773,6 +4785,7 @@ ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, * @buf: dump buffer * @buf_size: dump buffer size * @ret_buf_size: return buffer size (returned by FW) + * @ret_next_cluster: next cluster to read (returned by FW) * @ret_next_table: next block to read (returned by FW) * @ret_next_index: next index to read (returned by FW) * @cd: pointer to command details structure @@ -4780,10 +4793,10 @@ ice_set_ctx(struct ice_hw *hw, u8 *src_ctx, u8 *dest_ctx, * Get internal FW/HW data (0xFF08) for debug purposes. */ enum ice_status -ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, +ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id, u32 start, void *buf, u16 buf_size, u16 *ret_buf_size, - u16 *ret_next_table, u32 *ret_next_index, - struct ice_sq_cd *cd) + u16 *ret_next_cluster, u16 *ret_next_table, + u32 *ret_next_index, struct ice_sq_cd *cd) { struct ice_aqc_debug_dump_internals *cmd; struct ice_aq_desc desc; @@ -4796,7 +4809,7 @@ ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_debug_dump_internals); - cmd->cluster_id = cluster_id; + cmd->cluster_id = CPU_TO_LE16(cluster_id); cmd->table_id = CPU_TO_LE16(table_id); cmd->idx = CPU_TO_LE32(start); @@ -4805,6 +4818,8 @@ ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, if (!status) { if (ret_buf_size) *ret_buf_size = LE16_TO_CPU(desc.datalen); + if (ret_next_cluster) + *ret_next_cluster = LE16_TO_CPU(cmd->cluster_id); if (ret_next_table) *ret_next_table = LE16_TO_CPU(cmd->table_id); if (ret_next_index) @@ -6051,7 +6066,7 @@ ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, */ enum ice_status ice_aq_write_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, - u16 bus_addr, __le16 addr, u8 params, u8 *data, + u16 bus_addr, __le16 addr, u8 params, const u8 *data, struct ice_sq_cd *cd) { struct ice_aq_desc desc = { 0 }; @@ -6183,8 +6198,6 @@ static bool ice_is_fw_min_ver(struct ice_hw *hw, u8 branch, u8 maj, u8 min, if (hw->fw_min_ver == min && hw->fw_patch >= patch) return true; } - } else if (hw->fw_branch > branch) { - return true; } return false; @@ -6591,10 +6604,14 @@ u32 ice_get_link_speed(u16 index) */ bool ice_fw_supports_fec_dis_auto(struct ice_hw *hw) { - return ice_is_fw_min_ver(hw, ICE_FW_FEC_DIS_AUTO_BRANCH, + return ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E810, ICE_FW_FEC_DIS_AUTO_MAJ, ICE_FW_FEC_DIS_AUTO_MIN, - ICE_FW_FEC_DIS_AUTO_PATCH); + ICE_FW_FEC_DIS_AUTO_PATCH) || + ice_is_fw_min_ver(hw, ICE_FW_VER_BRANCH_E82X, + ICE_FW_FEC_DIS_AUTO_MAJ_E82X, + ICE_FW_FEC_DIS_AUTO_MIN_E82X, + ICE_FW_FEC_DIS_AUTO_PATCH_E82X); } /** diff --git a/sys/dev/ice/ice_common.h b/sys/dev/ice/ice_common.h index 024f6f4cdb01..3abfba874b9c 100644 --- a/sys/dev/ice/ice_common.h +++ b/sys/dev/ice/ice_common.h @@ -88,10 +88,10 @@ enum ice_status ice_get_caps(struct ice_hw *hw); void ice_set_safe_mode_caps(struct ice_hw *hw); enum ice_status -ice_aq_get_internal_data(struct ice_hw *hw, u8 cluster_id, u16 table_id, +ice_aq_get_internal_data(struct ice_hw *hw, u16 cluster_id, u16 table_id, u32 start, void *buf, u16 buf_size, u16 *ret_buf_size, - u16 *ret_next_table, u32 *ret_next_index, - struct ice_sq_cd *cd); + u16 *ret_next_cluster, u16 *ret_next_table, + u32 *ret_next_index, struct ice_sq_cd *cd); enum ice_status ice_set_mac_type(struct ice_hw *hw); @@ -352,7 +352,7 @@ ice_aq_read_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, struct ice_sq_cd *cd); enum ice_status ice_aq_write_i2c(struct ice_hw *hw, struct ice_aqc_link_topo_addr topo_addr, - u16 bus_addr, __le16 addr, u8 params, u8 *data, + u16 bus_addr, __le16 addr, u8 params, const u8 *data, struct ice_sq_cd *cd); enum ice_status ice_aq_set_health_status_config(struct ice_hw *hw, u8 event_source, diff --git a/sys/dev/ice/ice_controlq.c b/sys/dev/ice/ice_controlq.c index 09816d4a812a..8aa2a7f765a2 100644 --- a/sys/dev/ice/ice_controlq.c +++ b/sys/dev/ice/ice_controlq.c @@ -482,7 +482,7 @@ shutdown_sq_out: } /** - * ice_aq_ver_check - Check the reported AQ API version. + * ice_aq_ver_check - Check the reported AQ API version * @hw: pointer to the hardware structure * * Checks if the driver should load on a given AQ API version. @@ -1037,12 +1037,18 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, if (cq->sq.next_to_use == cq->sq.count) cq->sq.next_to_use = 0; wr32(hw, cq->sq.tail, cq->sq.next_to_use); + ice_flush(hw); + + /* Wait a short time before initial ice_sq_done() check, to allow + * hardware time for completion. + */ + ice_usec_delay(5, false); do { if (ice_sq_done(hw, cq)) break; - ice_usec_delay(ICE_CTL_Q_SQ_CMD_USEC, false); + ice_usec_delay(10, false); total_delay++; } while (total_delay < cq->sq_cmd_timeout); diff --git a/sys/dev/ice/ice_controlq.h b/sys/dev/ice/ice_controlq.h index 047dd1beaf60..d48d53a37161 100644 --- a/sys/dev/ice/ice_controlq.h +++ b/sys/dev/ice/ice_controlq.h @@ -60,8 +60,7 @@ enum ice_ctl_q { }; /* Control Queue timeout settings - max delay 1s */ -#define ICE_CTL_Q_SQ_CMD_TIMEOUT 10000 /* Count 10000 times */ -#define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */ +#define ICE_CTL_Q_SQ_CMD_TIMEOUT 100000 /* Count 100000 times */ #define ICE_CTL_Q_ADMIN_INIT_TIMEOUT 10 /* Count 10 times */ #define ICE_CTL_Q_ADMIN_INIT_MSEC 100 /* Check every 100msec */ diff --git a/sys/dev/ice/ice_drv_info.h b/sys/dev/ice/ice_drv_info.h index ff13fe99ee27..8e1200e08a64 100644 --- a/sys/dev/ice/ice_drv_info.h +++ b/sys/dev/ice/ice_drv_info.h @@ -62,16 +62,16 @@ * @var ice_rc_version * @brief driver release candidate version number */ -const char ice_driver_version[] = "1.37.11-k"; +const char ice_driver_version[] = "1.39.13-k"; const uint8_t ice_major_version = 1; -const uint8_t ice_minor_version = 37; -const uint8_t ice_patch_version = 11; +const uint8_t ice_minor_version = 39; +const uint8_t ice_patch_version = 13; const uint8_t ice_rc_version = 0; #define PVIDV(vendor, devid, name) \ - PVID(vendor, devid, name " - 1.37.11-k") + PVID(vendor, devid, name " - 1.39.13-k") #define PVIDV_OEM(vendor, devid, svid, sdevid, revid, name) \ - PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.37.11-k") + PVID_OEM(vendor, devid, svid, sdevid, revid, name " - 1.39.13-k") /** * @var ice_vendor_info_array diff --git a/sys/dev/ice/ice_features.h b/sys/dev/ice/ice_features.h index b58af574976d..03b8c63af291 100644 --- a/sys/dev/ice/ice_features.h +++ b/sys/dev/ice/ice_features.h @@ -89,7 +89,6 @@ enum feat_list { static inline void ice_disable_unsupported_features(ice_bitmap_t __unused *bitmap) { - ice_clear_bit(ICE_FEATURE_SRIOV, bitmap); #ifndef DEV_NETMAP ice_clear_bit(ICE_FEATURE_NETMAP, bitmap); #endif diff --git a/sys/dev/ice/ice_flex_pipe.c b/sys/dev/ice/ice_flex_pipe.c index 943b37746f9d..f103e2aa6e71 100644 --- a/sys/dev/ice/ice_flex_pipe.c +++ b/sys/dev/ice/ice_flex_pipe.c @@ -672,6 +672,7 @@ enum ice_status ice_replay_tunnels(struct ice_hw *hw) if (status) { ice_debug(hw, ICE_DBG_PKG, "ERR: 0x%x - destroy tunnel port 0x%x\n", status, port); + hw->tnl.tbl[i].ref = refs; break; } diff --git a/sys/dev/ice/ice_flow.c b/sys/dev/ice/ice_flow.c index 0cf37159b251..c04f86445767 100644 --- a/sys/dev/ice/ice_flow.c +++ b/sys/dev/ice/ice_flow.c @@ -404,12 +404,11 @@ struct ice_flow_prof_params { }; #define ICE_FLOW_SEG_HDRS_L3_MASK \ - (ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6 | \ - ICE_FLOW_SEG_HDR_ARP) + (ICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV6 | ICE_FLOW_SEG_HDR_ARP) #define ICE_FLOW_SEG_HDRS_L4_MASK \ (ICE_FLOW_SEG_HDR_ICMP | ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | \ ICE_FLOW_SEG_HDR_SCTP) -/* mask for L4 protocols that are NOT part of IPV4/6 OTHER PTYPE groups */ +/* mask for L4 protocols that are NOT part of IPv4/6 OTHER PTYPE groups */ #define ICE_FLOW_SEG_HDRS_L4_MASK_NO_OTHER \ (ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | ICE_FLOW_SEG_HDR_SCTP) @@ -483,15 +482,13 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) if ((hdrs & ICE_FLOW_SEG_HDR_IPV4) && (hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER)) { - src = i ? - (const ice_bitmap_t *)ice_ptypes_ipv4_il : + src = i ? (const ice_bitmap_t *)ice_ptypes_ipv4_il : (const ice_bitmap_t *)ice_ptypes_ipv4_ofos_all; ice_and_bitmap(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); } else if ((hdrs & ICE_FLOW_SEG_HDR_IPV6) && (hdrs & ICE_FLOW_SEG_HDR_IPV_OTHER)) { - src = i ? - (const ice_bitmap_t *)ice_ptypes_ipv6_il : + src = i ? (const ice_bitmap_t *)ice_ptypes_ipv6_il : (const ice_bitmap_t *)ice_ptypes_ipv6_ofos_all; ice_and_bitmap(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); @@ -645,8 +642,7 @@ ice_flow_xtract_fld(struct ice_hw *hw, struct ice_flow_prof_params *params, case ICE_FLOW_FIELD_IDX_ICMP_TYPE: case ICE_FLOW_FIELD_IDX_ICMP_CODE: /* ICMP type and code share the same extraction seq. entry */ - prot_id = (params->prof->segs[seg].hdrs & - ICE_FLOW_SEG_HDR_IPV4) ? + prot_id = (params->prof->segs[seg].hdrs & ICE_FLOW_SEG_HDR_IPV4) ? ICE_PROT_ICMP_IL : ICE_PROT_ICMPV6_IL; sib = fld == ICE_FLOW_FIELD_IDX_ICMP_TYPE ? ICE_FLOW_FIELD_IDX_ICMP_CODE : @@ -1301,20 +1297,20 @@ ice_flow_set_rss_seg_info(struct ice_flow_seg_info *segs, u8 seg_cnt, /* set outer most header */ if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV4) segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_IPV_FRAG | - ICE_FLOW_SEG_HDR_IPV_OTHER; + ICE_FLOW_SEG_HDR_IPV_FRAG | + ICE_FLOW_SEG_HDR_IPV_OTHER; else if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV6) segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV6 | - ICE_FLOW_SEG_HDR_IPV_FRAG | - ICE_FLOW_SEG_HDR_IPV_OTHER; + ICE_FLOW_SEG_HDR_IPV_FRAG | + ICE_FLOW_SEG_HDR_IPV_OTHER; else if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE) segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV4 | - ICE_FLOW_SEG_HDR_GRE | - ICE_FLOW_SEG_HDR_IPV_OTHER; + ICE_FLOW_SEG_HDR_GRE | + ICE_FLOW_SEG_HDR_IPV_OTHER; else if (cfg->hdr_type == ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE) segs[ICE_RSS_OUTER_HEADERS].hdrs |= ICE_FLOW_SEG_HDR_IPV6 | - ICE_FLOW_SEG_HDR_GRE | - ICE_FLOW_SEG_HDR_IPV_OTHER; + ICE_FLOW_SEG_HDR_GRE | + ICE_FLOW_SEG_HDR_IPV_OTHER; if (seg->hdrs & ~ICE_FLOW_RSS_SEG_HDR_VAL_MASKS) return ICE_ERR_PARAM; @@ -1418,11 +1414,14 @@ ice_get_rss_hdr_type(struct ice_flow_prof *prof) if (prof->segs_cnt == ICE_FLOW_SEG_SINGLE) { hdr_type = ICE_RSS_OUTER_HEADERS; } else if (prof->segs_cnt == ICE_FLOW_SEG_MAX) { - if (prof->segs[ICE_RSS_OUTER_HEADERS].hdrs == ICE_FLOW_SEG_HDR_NONE) + const struct ice_flow_seg_info *s; + + s = &prof->segs[ICE_RSS_OUTER_HEADERS]; + if (s->hdrs == ICE_FLOW_SEG_HDR_NONE) hdr_type = ICE_RSS_INNER_HEADERS; - if (prof->segs[ICE_RSS_OUTER_HEADERS].hdrs & ICE_FLOW_SEG_HDR_IPV4) + if (s->hdrs & ICE_FLOW_SEG_HDR_IPV4) hdr_type = ICE_RSS_INNER_HEADERS_W_OUTER_IPV4; - if (prof->segs[ICE_RSS_OUTER_HEADERS].hdrs & ICE_FLOW_SEG_HDR_IPV6) + if (s->hdrs & ICE_FLOW_SEG_HDR_IPV6) hdr_type = ICE_RSS_INNER_HEADERS_W_OUTER_IPV6; } @@ -1529,13 +1528,14 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof) * [62:63] - Encapsulation flag: * 0 if non-tunneled * 1 if tunneled - * 2 for tunneled with outer ipv4 - * 3 for tunneled with outer ipv6 + * 2 for tunneled with outer IPv4 + * 3 for tunneled with outer IPv6 */ -#define ICE_FLOW_GEN_PROFID(hash, hdr, encap) \ - ((u64)(((u64)(hash) & ICE_FLOW_PROF_HASH_M) | \ +#define ICE_FLOW_GEN_PROFID(hash, hdr, encap) \ + ((u64)(((u64)(hash) & ICE_FLOW_PROF_HASH_M) | \ (((u64)(hdr) << ICE_FLOW_PROF_HDR_S) & ICE_FLOW_PROF_HDR_M) | \ - (((u64)(encap) << ICE_FLOW_PROF_ENCAP_S) & ICE_FLOW_PROF_ENCAP_M))) + (((u64)(encap) << ICE_FLOW_PROF_ENCAP_S) & \ + ICE_FLOW_PROF_ENCAP_M))) /** * ice_add_rss_cfg_sync - add an RSS configuration @@ -1559,7 +1559,8 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, return ICE_ERR_PARAM; segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? - ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; + ICE_FLOW_SEG_SINGLE : + ICE_FLOW_SEG_MAX; segs = (struct ice_flow_seg_info *)ice_calloc(hw, segs_cnt, sizeof(*segs)); @@ -1663,18 +1664,16 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, struct ice_rss_hash_cfg local_cfg; enum ice_status status; - if (!ice_is_vsi_valid(hw, vsi_handle) || - !cfg || cfg->hdr_type > ICE_RSS_ANY_HEADERS || + if (!ice_is_vsi_valid(hw, vsi_handle) || !cfg || + cfg->hdr_type > ICE_RSS_ANY_HEADERS || cfg->hash_flds == ICE_HASH_INVALID) return ICE_ERR_PARAM; + ice_acquire_lock(&hw->rss_locks); local_cfg = *cfg; if (cfg->hdr_type < ICE_RSS_ANY_HEADERS) { - ice_acquire_lock(&hw->rss_locks); status = ice_add_rss_cfg_sync(hw, vsi_handle, &local_cfg); - ice_release_lock(&hw->rss_locks); } else { - ice_acquire_lock(&hw->rss_locks); local_cfg.hdr_type = ICE_RSS_OUTER_HEADERS; status = ice_add_rss_cfg_sync(hw, vsi_handle, &local_cfg); if (!status) { @@ -1682,8 +1681,8 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, status = ice_add_rss_cfg_sync(hw, vsi_handle, &local_cfg); } - ice_release_lock(&hw->rss_locks); } + ice_release_lock(&hw->rss_locks); return status; } @@ -1707,7 +1706,8 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u8 segs_cnt; segs_cnt = (cfg->hdr_type == ICE_RSS_OUTER_HEADERS) ? - ICE_FLOW_SEG_SINGLE : ICE_FLOW_SEG_MAX; + ICE_FLOW_SEG_SINGLE : + ICE_FLOW_SEG_MAX; segs = (struct ice_flow_seg_info *)ice_calloc(hw, segs_cnt, sizeof(*segs)); if (!segs) @@ -1762,8 +1762,8 @@ ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, struct ice_rss_hash_cfg local_cfg; enum ice_status status; - if (!ice_is_vsi_valid(hw, vsi_handle) || - !cfg || cfg->hdr_type > ICE_RSS_ANY_HEADERS || + if (!ice_is_vsi_valid(hw, vsi_handle) || !cfg || + cfg->hdr_type > ICE_RSS_ANY_HEADERS || cfg->hash_flds == ICE_HASH_INVALID) return ICE_ERR_PARAM; @@ -1774,7 +1774,6 @@ ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, } else { local_cfg.hdr_type = ICE_RSS_OUTER_HEADERS; status = ice_rem_rss_cfg_sync(hw, vsi_handle, &local_cfg); - if (!status) { local_cfg.hdr_type = ICE_RSS_INNER_HEADERS; status = ice_rem_rss_cfg_sync(hw, vsi_handle, diff --git a/sys/dev/ice/ice_flow.h b/sys/dev/ice/ice_flow.h index 0857b325ca7c..31c369c144e0 100644 --- a/sys/dev/ice/ice_flow.h +++ b/sys/dev/ice/ice_flow.h @@ -188,14 +188,14 @@ enum ice_flow_avf_hdr_field { enum ice_rss_cfg_hdr_type { ICE_RSS_OUTER_HEADERS, /* take outer headers as inputset. */ ICE_RSS_INNER_HEADERS, /* take inner headers as inputset. */ - /* take inner headers as inputset for packet with outer ipv4. */ + /* take inner headers as inputset for packet with outer IPv4. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV4, - /* take inner headers as inputset for packet with outer ipv6. */ + /* take inner headers as inputset for packet with outer IPv6. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV6, /* take outer headers first then inner headers as inputset */ - /* take inner as inputset for GTPoGRE with outer ipv4 + gre. */ + /* take inner as inputset for GTPoGRE with outer IPv4 + GRE. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV4_GRE, - /* take inner as inputset for GTPoGRE with outer ipv6 + gre. */ + /* take inner as inputset for GTPoGRE with outer IPv6 + GRE. */ ICE_RSS_INNER_HEADERS_W_OUTER_IPV6_GRE, ICE_RSS_ANY_HEADERS }; diff --git a/sys/dev/ice/ice_hw_autogen.h b/sys/dev/ice/ice_hw_autogen.h index 6b04bff4b722..8e59ebc76835 100644 --- a/sys/dev/ice/ice_hw_autogen.h +++ b/sys/dev/ice/ice_hw_autogen.h @@ -5476,6 +5476,7 @@ #define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_S 1 #define GL_MNG_FW_RAM_STAT_MNG_MEM_ECC_ERR_M BIT(1) #define GL_MNG_FWSM 0x000B6134 /* Reset Source: POR */ +#define GL_MNG_FWSM_FW_LOADING_M BIT(30) #define GL_MNG_FWSM_FW_MODES_S 0 #define GL_MNG_FWSM_FW_MODES_M MAKEMASK(0x7, 0) #define GL_MNG_FWSM_RSV0_S 3 diff --git a/sys/dev/ice/ice_iflib.h b/sys/dev/ice/ice_iflib.h index e9e09851b82c..4ac5fffe5b7e 100644 --- a/sys/dev/ice/ice_iflib.h +++ b/sys/dev/ice/ice_iflib.h @@ -192,6 +192,29 @@ struct ice_rx_queue { struct if_irq que_irq; }; +/** + * @struct ice_mirr_if + * @brief structure representing a mirroring interface + */ +struct ice_mirr_if { + struct ice_softc *back; + struct ifnet *ifp; + struct ice_vsi *vsi; + + device_t subdev; + if_ctx_t subctx; + if_softc_ctx_t subscctx; + + u16 num_irq_vectors; + u16 *if_imap; + u16 *os_imap; + struct ice_irq_vector *rx_irqvs; + + u32 state; + + bool if_attached; +}; + /** * @struct ice_softc * @brief main structure representing one device @@ -262,7 +285,7 @@ struct ice_softc { struct ice_resmgr rx_qmgr; /* Interrupt allocation manager */ - struct ice_resmgr imgr; + struct ice_resmgr dev_imgr; u16 *pf_imap; int lan_vectors; @@ -302,7 +325,7 @@ struct ice_softc { /* NVM link override settings */ struct ice_link_default_override_tlv ldo_tlv; - u16 fw_debug_dump_cluster_mask; + u32 fw_debug_dump_cluster_mask; struct sx *iflib_ctx_lock; @@ -310,6 +333,11 @@ struct ice_softc { ice_declare_bitmap(feat_cap, ICE_FEATURE_COUNT); ice_declare_bitmap(feat_en, ICE_FEATURE_COUNT); + struct ice_resmgr os_imgr; + /* For mirror interface */ + struct ice_mirr_if *mirr_if; + int extra_vectors; + int last_rid; }; #endif /* _ICE_IFLIB_H_ */ diff --git a/sys/dev/ice/ice_iflib_txrx.c b/sys/dev/ice/ice_iflib_txrx.c index 59332e8509f9..d9e8a77173c1 100644 --- a/sys/dev/ice/ice_iflib_txrx.c +++ b/sys/dev/ice/ice_iflib_txrx.c @@ -44,6 +44,18 @@ /* Tx/Rx hotpath utility functions */ #include "ice_common_txrx.h" +/* + * Driver private implementations + */ +static int _ice_ift_txd_encap(struct ice_tx_queue *txq, if_pkt_info_t pi); +static int _ice_ift_txd_credits_update(struct ice_softc *sc, struct ice_tx_queue *txq, bool clear); +static int _ice_ift_rxd_available(struct ice_rx_queue *rxq, qidx_t pidx, qidx_t budget); +static int _ice_ift_rxd_pkt_get(struct ice_rx_queue *rxq, if_rxd_info_t ri); +static void _ice_ift_rxd_refill(struct ice_rx_queue *rxq, uint32_t pidx, + uint64_t *paddrs, uint16_t count); +static void _ice_ift_rxd_flush(struct ice_softc *sc, struct ice_rx_queue *rxq, + uint32_t pidx); + /* * iflib txrx method declarations */ @@ -55,6 +67,13 @@ static int ice_ift_rxd_available(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t static void ice_ift_rxd_flush(void *arg, uint16_t rxqid, uint8_t flidx, qidx_t pidx); static void ice_ift_rxd_refill(void *arg, if_rxd_update_t iru); static qidx_t ice_ift_queue_select(void *arg, struct mbuf *m, if_pkt_info_t pi); +static int ice_ift_txd_credits_update_subif(void *arg, uint16_t txqid, bool clear); +static int ice_ift_txd_encap_subif(void *arg, if_pkt_info_t pi); +static void ice_ift_txd_flush_subif(void *arg, uint16_t txqid, qidx_t pidx); +static int ice_ift_rxd_available_subif(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t budget); +static int ice_ift_rxd_pkt_get_subif(void *arg, if_rxd_info_t ri); +static void ice_ift_rxd_refill_subif(void *arg, if_rxd_update_t iru); +static void ice_ift_rxd_flush_subif(void *arg, uint16_t rxqid, uint8_t flidx, qidx_t pidx); /* Macro to help extract the NIC mode flexible Rx descriptor fields from the * advanced 32byte Rx descriptors. @@ -82,8 +101,27 @@ struct if_txrx ice_txrx = { }; /** - * ice_ift_txd_encap - prepare Tx descriptors for a packet - * @arg: the iflib softc structure pointer + * @var ice_subif_txrx + * @brief Tx/Rx operations for the iflib stack, for subinterfaces + * + * Structure defining the Tx and Rx related operations that iflib can request + * the subinterface driver to perform. These are the main entry points for the + * hot path of the transmit and receive paths in the iflib driver. + */ +struct if_txrx ice_subif_txrx = { + .ift_txd_credits_update = ice_ift_txd_credits_update_subif, + .ift_txd_encap = ice_ift_txd_encap_subif, + .ift_txd_flush = ice_ift_txd_flush_subif, + .ift_rxd_available = ice_ift_rxd_available_subif, + .ift_rxd_pkt_get = ice_ift_rxd_pkt_get_subif, + .ift_rxd_refill = ice_ift_rxd_refill_subif, + .ift_rxd_flush = ice_ift_rxd_flush_subif, + .ift_txq_select_v2 = NULL, +}; + +/** + * _ice_ift_txd_encap - prepare Tx descriptors for a packet + * @txq: driver's TX queue context * @pi: packet info * * Prepares and encapsulates the given packet into into Tx descriptors, in @@ -94,10 +132,8 @@ struct if_txrx ice_txrx = { * Return 0 on success, non-zero error code on failure. */ static int -ice_ift_txd_encap(void *arg, if_pkt_info_t pi) +_ice_ift_txd_encap(struct ice_tx_queue *txq, if_pkt_info_t pi) { - struct ice_softc *sc = (struct ice_softc *)arg; - struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[pi->ipi_qsidx]; int nsegs = pi->ipi_nsegs; bus_dma_segment_t *segs = pi->ipi_segs; struct ice_tx_desc *txd = NULL; @@ -156,6 +192,27 @@ ice_ift_txd_encap(void *arg, if_pkt_info_t pi) return (0); } +/** + * ice_ift_txd_encap - prepare Tx descriptors for a packet + * @arg: the iflib softc structure pointer + * @pi: packet info + * + * Prepares and encapsulates the given packet into Tx descriptors, in + * preparation for sending to the transmit engine. Sets the necessary context + * descriptors for TSO and other offloads, and prepares the last descriptor + * for the writeback status. + * + * Return 0 on success, non-zero error code on failure. + */ +static int +ice_ift_txd_encap(void *arg, if_pkt_info_t pi) +{ + struct ice_softc *sc = (struct ice_softc *)arg; + struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[pi->ipi_qsidx]; + + return _ice_ift_txd_encap(txq, pi); +} + /** * ice_ift_txd_flush - Flush Tx descriptors to hardware * @arg: device specific softc pointer @@ -176,9 +233,9 @@ ice_ift_txd_flush(void *arg, uint16_t txqid, qidx_t pidx) } /** - * ice_ift_txd_credits_update - cleanup Tx descriptors - * @arg: device private softc - * @txqid: the Tx queue to update + * _ice_ift_txd_credits_update - cleanup Tx descriptors + * @sc: device private softc + * @txq: the Tx queue to update * @clear: if false, only report, do not actually clean * * If clear is false, iflib is asking if we *could* clean up any Tx @@ -186,13 +243,12 @@ ice_ift_txd_flush(void *arg, uint16_t txqid, qidx_t pidx) * * If clear is true, iflib is requesting to cleanup and reclaim used Tx * descriptors. + * + * Called by other txd_credits_update functions passed to iflib. */ static int -ice_ift_txd_credits_update(void *arg, uint16_t txqid, bool clear) +_ice_ift_txd_credits_update(struct ice_softc *sc __unused, struct ice_tx_queue *txq, bool clear) { - struct ice_softc *sc = (struct ice_softc *)arg; - struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[txqid]; - qidx_t processed = 0; qidx_t cur, prev, ntxd, rs_cidx; int32_t delta; @@ -235,9 +291,28 @@ ice_ift_txd_credits_update(void *arg, uint16_t txqid, bool clear) } /** - * ice_ift_rxd_available - Return number of available Rx packets + * ice_ift_txd_credits_update - cleanup PF VSI Tx descriptors * @arg: device private softc - * @rxqid: the Rx queue id + * @txqid: the Tx queue to update + * @clear: if false, only report, do not actually clean + * + * Wrapper for _ice_ift_txd_credits_update() meant for TX queues that + * belong to the PF VSI. + * + * @see _ice_ift_txd_credits_update() + */ +static int +ice_ift_txd_credits_update(void *arg, uint16_t txqid, bool clear) +{ + struct ice_softc *sc = (struct ice_softc *)arg; + struct ice_tx_queue *txq = &sc->pf_vsi.tx_queues[txqid]; + + return _ice_ift_txd_credits_update(sc, txq, clear); +} + +/** + * _ice_ift_rxd_available - Return number of available Rx packets + * @rxq: RX queue driver structure * @pidx: descriptor start point * @budget: maximum Rx budget * @@ -245,10 +320,8 @@ ice_ift_txd_credits_update(void *arg, uint16_t txqid, bool clear) * of the given budget. */ static int -ice_ift_rxd_available(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t budget) +_ice_ift_rxd_available(struct ice_rx_queue *rxq, qidx_t pidx, qidx_t budget) { - struct ice_softc *sc = (struct ice_softc *)arg; - struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[rxqid]; union ice_32b_rx_flex_desc *rxd; uint16_t status0; int cnt, i, nrxd; @@ -270,20 +343,54 @@ ice_ift_rxd_available(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t budget) return (cnt); } +/** + * ice_ift_rxd_available - Return number of available Rx packets + * @arg: device private softc + * @rxqid: the Rx queue id + * @pidx: descriptor start point + * @budget: maximum Rx budget + * + * Wrapper for _ice_ift_rxd_available() that provides a function pointer + * that iflib requires for RX processing. + */ +static int +ice_ift_rxd_available(void *arg, uint16_t rxqid, qidx_t pidx, qidx_t budget) +{ + struct ice_softc *sc = (struct ice_softc *)arg; + struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[rxqid]; + + return _ice_ift_rxd_available(rxq, pidx, budget); +} + /** * ice_ift_rxd_pkt_get - Called by iflib to send data to upper layer * @arg: device specific softc * @ri: receive packet info * - * This function is called by iflib, and executes in ithread context. It is - * called by iflib to obtain data which has been DMA'ed into host memory. - * Returns zero on success, and EBADMSG on failure. + * Wrapper function for _ice_ift_rxd_pkt_get() that provides a function pointer + * used by iflib for RX packet processing. */ static int ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri) { struct ice_softc *sc = (struct ice_softc *)arg; struct ice_rx_queue *rxq = &sc->pf_vsi.rx_queues[ri->iri_qsidx]; + + return _ice_ift_rxd_pkt_get(rxq, ri); +} + +/** + * _ice_ift_rxd_pkt_get - Called by iflib to send data to upper layer + * @rxq: RX queue driver structure + * @ri: receive packet info + * + * This function is called by iflib, and executes in ithread context. It is + * called by iflib to obtain data which has been DMA'ed into host memory. + * Returns zero on success, and EBADMSG on failure. + */ +static int +_ice_ift_rxd_pkt_get(struct ice_rx_queue *rxq, if_rxd_info_t ri) +{ union ice_32b_rx_flex_desc *cur; u16 status0, plen, ptype; bool eop; @@ -340,7 +447,7 @@ ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri) /* Get packet type and set checksum flags */ ptype = le16toh(cur->wb.ptype_flex_flags0) & ICE_RX_FLEX_DESC_PTYPE_M; - if ((iflib_get_ifp(sc->ctx)->if_capenable & IFCAP_RXCSUM) != 0) + if ((if_getcapenable(ri->iri_ifp) & IFCAP_RXCSUM) != 0) ice_rx_checksum(rxq, &ri->iri_csum_flags, &ri->iri_csum_data, status0, ptype); @@ -356,16 +463,14 @@ ice_ift_rxd_pkt_get(void *arg, if_rxd_info_t ri) * @arg: device specific softc structure * @iru: the Rx descriptor update structure * - * Update the Rx descriptor indices for a given queue, assigning new physical - * addresses to the descriptors, preparing them for re-use by the hardware. + * Wrapper function for _ice_ift_rxd_refill() that provides a function pointer + * used by iflib for RX packet processing. */ static void ice_ift_rxd_refill(void *arg, if_rxd_update_t iru) { struct ice_softc *sc = (struct ice_softc *)arg; struct ice_rx_queue *rxq; - uint32_t next_pidx; - int i; uint64_t *paddrs; uint32_t pidx; uint16_t qsidx, count; @@ -377,6 +482,26 @@ ice_ift_rxd_refill(void *arg, if_rxd_update_t iru) rxq = &(sc->pf_vsi.rx_queues[qsidx]); + _ice_ift_rxd_refill(rxq, pidx, paddrs, count); +} + +/** + * _ice_ift_rxd_refill - Prepare Rx descriptors for re-use by hardware + * @rxq: RX queue driver structure + * @pidx: first index to refill + * @paddrs: physical addresses to use *** 3362 LINES SKIPPED *** From nobody Wed Jul 31 07:30:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkJk686Gz5RNbD; Wed, 31 Jul 2024 07:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkJk5bR6z4mjb; Wed, 31 Jul 2024 07:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DgqxkJIocmA9SkPi/zsi7TSe+Qsy5NvxKEmGbW/gwdo=; b=jOB0dBNJRHPdDoJR5dZ/PDUP/02AJca+uF9jYo98CqQIQLSQunu6sZCtgS/Kbk7kaI0q42 su7i3n3ugkKJLcYEwtFY4hB+CxA0NDJ7W71smZ1x28NQe5DAGFpPYoVgds+3qVr18JNG4K 2cBQV1a88MoZht5TG/KNpbT5o3qeI9m7CR/jwRZ3X8p1kzrsYnIXlemnw0dPEZexcjhtYX rUfnI9UKJEM22fE5OWbL7gO4d/AnYm/9f48Pj4A87Nz/ouLyvYHToqOmLto1iMqxmbzxWm 07A37LtRI+30HzgYIsAxbdn8fhxKIae65HypDphAboNpa1tgg3TvQvvZr5XPpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411014; a=rsa-sha256; cv=none; b=mYWss32vIqMWjKaULMPwJjhjf7Iz9J26+7qidiOMyRg8gOtlc66krDYfx1vJuX4K7sTlp6 U/Qh0BeIcYbjMq/VyD0WER3rDLc4sbI6rdQUftLUKHPfSi4LMmcZ1ij5B5cYTOPJDsOeuj BwNbCZG+DuOrLczcxgNJnp8bGdb41YvMs8N93mjy4Kys5Y8AJvpK6ZfYNdLrxzFIPyBNVr AhuJBCFUggyvfbj5NyxE1G4+oblhLfO5lPp0mcU6meIMCl3JXSrkl1nwhMJGCqzG/asH5q xkbTAwZA1Re10jMFHiFVGVhDKE8Z/Z9ASRT1JsioKPu5NSNOPF4G9CxqHaJ03g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DgqxkJIocmA9SkPi/zsi7TSe+Qsy5NvxKEmGbW/gwdo=; b=Wa4QDv0Z3Fy6cgjXPpiZtCKMd3eIcId6ezVaYx0pJOtBTxWQduOiYFSrlcdecwH52Bmuac VwBq9dfdPlzAC1a/SK17t3I16CHH1Ouz+gt1bbzAN6Sz1hMUHRj/oFVr7eSUtSvXOjjvor nvc4ehVWzTCvNuOwcs840vnvgQoN6kU5Y8hw8sSzdPT3/qHSTQO8Mgu07Vu44qwFVDJNNO bylx5BtjA177kxbOOaJBFooZo69bymk7lLG/cuFLpmWFh6Zq7Zr94VWlWZEDod6DM3dnaY yk3emFgiNUXj2r38+s6NWHWjgDtQ6Drl8h6CwZ3YO/wlnk1sMXjd/szkzmQzVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkJk54MVzr4d; Wed, 31 Jul 2024 07:30: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 46V7UEFU063758; Wed, 31 Jul 2024 07:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7UETS063749; Wed, 31 Jul 2024 07:30:14 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:30:14 GMT Message-Id: <202407310730.46V7UETS063749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 511583866352 - stable/14 - Revert "Fix llvm register allocator for native/cross build differences" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 51158386635294dc6cff48090a1a8faa2c97553e Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=51158386635294dc6cff48090a1a8faa2c97553e commit 51158386635294dc6cff48090a1a8faa2c97553e Author: Dimitry Andric AuthorDate: 2024-07-28 11:08:50 +0000 Commit: Dimitry Andric CommitDate: 2024-07-31 07:29:41 +0000 Revert "Fix llvm register allocator for native/cross build differences" In preparation for applying the fix that landed upstream, this reverts commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f: Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 52552d7572a6d3d7d3ce0d6862de9a9d203c5d01) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index afde8d001f88..f3cb7fa5af61 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,12 +256,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - // FreeBSD customization: similar to the HWeight declaration below, add a - // volatile qualifier to avoid slightly different weight results on amd64 - // and i386 hosts, and possibly choosing different registers in the register - // allocator. See for - // more details. - volatile float Weight = 1.0f; + float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Wed Jul 31 07:30:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkJl65gfz5RNPV; Wed, 31 Jul 2024 07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkJl5Zh5z4mdr; Wed, 31 Jul 2024 07: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=1722411015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEAtOuYA5I/0PBep4FzYOUQUSPoMVODvfEp6ob3c/As=; b=erH6da/cgQ4/8aySOk4lD9wTY6dusjsFiwuxCuxPBo+jer9NOVPvZc354sO9x2UwZO3CxE eJ9JtMKWsCxiI0kxHeZI/tk0aNkd/44Pi3920MiAAGp1n82zmsQmS70Z+CMM7TNWAMG9w9 3cquuKGeQI2c6DBM3prE+alWfvg0pU2uiC1kbTpyY43ad0xLY/x4Mlwym/7B4LDlnpNs1u /3y2rUiSp4itaFK9/wGcvy8ps45JfJcQlEy8BBmcV5FpVY+5RutM0oWXbUYizENboT73HI WUnPPhHoc4ged9TpoT+EjHQ0/CbFORxWz8xOUA1chlf+gWWJ/KcwBhl9LjlEoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411015; a=rsa-sha256; cv=none; b=B/42tftm5qquxreETqA9hlzpnYRCEjiHh/AxwitLHAutoN3Nx7IRWBB5oa6pyqhoUodIdZ Cq3CYR5H5o+qVLug/TwfZlnmSpdED59kXi3SlK1JNCsLBD2PDrTYfHQBG79RGmJ1dfp5kZ Fnen5diU4460stoh2MOrq6aKojuBCdO+6T0wRaSLzYpR0JVvslcDwRZFXLa4v6WfkXIyho 6zNRamM7WhllEhtQnB7Bk+7aN8vWxJ3QKGfc3qnX1eDrZqQobT3HEMzwz81qklxZZLYlzT QmxTUmO0qnmSA6ct67JfT2Cot57DlFkz2xo7kH+n3DiHwO7jqPuSnrk2DfUjGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jEAtOuYA5I/0PBep4FzYOUQUSPoMVODvfEp6ob3c/As=; b=Vzx4pBGVvH4SyS3ihucuJX/NVZgaqiNDlR2PQDPg8kmVNhuoFpP9cN+l+Cn4zheS6Ys4Vu vyQwfi5ZjBeT+wJwQCDS3/BYtbqSyh9DNISNfaELKmn+Yd1HNFGcDlTnsLKeNO7J1b3Ca2 Wkd3yW8KnevJNdSUF0gwqtEYq4kuY+JshlCRuAGmkbWxvldYAYiKhNj9LuD4rlOjO+TuXu SvNJgMIAZHj2ECf0xsw/OVqsynylMR7DDLe1ZP4uefsSscQvYHBo6ZY67ZCxe+1YbNp51u FfGii4NivY+n3RtUXzmPIzDHcI40zkXO8zMJoWwTphMQ2kksV8raVIAPuMpIAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkJl5BBMzs8D; Wed, 31 Jul 2024 07: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 46V7UFc3064453; Wed, 31 Jul 2024 07: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 46V7UF3m064445; Wed, 31 Jul 2024 07:30:15 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:30:15 GMT Message-Id: <202407310730.46V7UF3m064445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 96ff33484ee5 - stable/14 - Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 96ff33484ee5f44bc3ac743ce235d23495465904 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=96ff33484ee5f44bc3ac743ce235d23495465904 commit 96ff33484ee5f44bc3ac743ce235d23495465904 Author: Dimitry Andric AuthorDate: 2024-07-28 11:13:37 +0000 Commit: Dimitry Andric CommitDate: 2024-07-31 07:29:47 +0000 Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): [CalcSpillWeights] Avoid x87 excess precision influencing weight result Fixes #99396 The result of `VirtRegAuxInfo::weightCalcHelper` can be influenced by x87 excess precision, which can result in slightly different register choices when the compiler is hosted on x86_64 or i386. This leads to different object file output when cross-compiling to i386, or native. Similar to 7af3432e22b0, we need to add a `volatile` qualifier to the local `Weight` variable to force it onto the stack, and avoid the excess precision. Define `stack_float_t` in `MathExtras.h` for this purpose, and use it. This is the version of the fix for PR276961 that landed upstream. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 1a4b8325f6e3a45c77188343da504fe04495cc46) --- contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h | 8 ++++++++ contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h index aa4f4d2ed42e..afb4fa262152 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h @@ -644,6 +644,14 @@ std::enable_if_t, T> MulOverflow(T X, T Y, T &Result) { return UX > (static_cast(std::numeric_limits::max())) / UY; } +/// Type to force float point values onto the stack, so that x86 doesn't add +/// hidden precision, avoiding rounding differences on various platforms. +#if defined(__i386__) || defined(_M_IX86) +using stack_float_t = volatile float; +#else +using stack_float_t = float; +#endif + } // End llvm namespace #endif diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..fa7ef669ec11 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/VirtRegMap.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -256,7 +257,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // Force Weight onto the stack so that x86 doesn't add hidden precision, + // similar to HWeight below. + stack_float_t Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { @@ -283,11 +286,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, Register HintReg = copyHint(MI, LI.reg(), TRI, MRI); if (!HintReg) continue; - // Force hweight onto the stack so that x86 doesn't add hidden precision, + // Force HWeight onto the stack so that x86 doesn't add hidden precision, // making the comparison incorrectly pass (i.e., 1 > 1 == true??). - // - // FIXME: we probably shouldn't use floats at all. - volatile float HWeight = Hint[HintReg] += Weight; + stack_float_t HWeight = Hint[HintReg] += Weight; if (HintReg.isVirtual() || MRI.isAllocatable(HintReg)) CopyHints.insert(CopyHint(HintReg, HWeight)); } From nobody Wed Jul 31 07:36:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkSW4sc2z5RP2v; Wed, 31 Jul 2024 07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkSW4LYmz4pFn; Wed, 31 Jul 2024 07: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=1722411419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QE0ebUp82Pfyfss2KBEHRV0OhBD0v3O1njCQwSvkXs8=; b=YMXKhtDUo2ymrBkxaqzKNqFN82DP46w+6nBdtNsSYA9JD5hdU0CkxfmWdAq8BQIYUznl9k cY+3Bm+qhDyIpdFgWRx9M1f4/rM5ytoxtE70JAJDqWTbGtYPX/Dp9oqWroOFZaNbn/ZRLl JCiW3EXLim/+ViU7a//nWJ2V9bTjYKULOUJol/CaFAIffZL0/D+azjwPmnus1ETy3+L83g HkBAJumgRAlnUHlKfudMfAmGSqezxgainYqUsIVFsN5XJgOUPJpXhw/83RSWcO/sF6rvph EC5rwqmu7Xcmy9NVvbQikisMYM9+Uyg2Q0076KfOO2kX6wHsrC8UZO7ukv0C/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411419; a=rsa-sha256; cv=none; b=IdWt9hGQR3vzpES3Qm58c1wvOMgd9Jp5mT/yOiSstWMkcUfQI9+Hd56kwLd5rOsEekTbnG 0qFaoSDvi7tXKLTo6wtpWUbsDYEuikk5WbARMwMUPSi7bOQoj7l6jLusx/5lGZD+0g+6UM xlplBXj+FAIhsqodgmfF6D8hUCphxSZ7AT0nUIvW0LNqqSvfsQgStiWhYPzgkmmLCKOyGm JxvynEpSRQjJWQk3C5LYEZ2t1enpaJUfwNmwBwj4yWeD1CmfLG/rTtkSsY5Hgxeu/L1R8X uLYua36KrXs+2pMSj6fjBg0DOa1Id14ZPmhxur8+knW8ZLumaaXpd3Hr+mng/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QE0ebUp82Pfyfss2KBEHRV0OhBD0v3O1njCQwSvkXs8=; b=cZe3RwyuH8JjDbKVBFPiIoEHvds5DXBYOQ2DzXOxmg3K9ONUXJQrjPF45OcYKDEGNCiT9L aCQ2/aQK6ORDz2LI3KBPKJXyUNTLvBCWuVP5T7XkY/0I+yftAuuj3h3BNqkKJSXK9bn/qO QsAWqmWoa/6k/NSOGjFlLlzMJl/JdrENYfJpV2AmZAwUCocl7Zhgj99pOXfMQEa2rWOynI XkESu+ZcoJz+qnym+Bd6AchA/ufTiUZ/Vz+PonAIcH/q7KvHg3PVGkmsVGEPMaG/CnTxZz 0YXV0qsIttgY8EB0fUWU90MIkWt/q6ZUlG7/qx2fIEtZGWE7e9wgdTgMo2OXQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkSW3xcGzsNY; Wed, 31 Jul 2024 07: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 46V7axst073267; Wed, 31 Jul 2024 07: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 46V7axQe073264; Wed, 31 Jul 2024 07:36:59 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:36:59 GMT Message-Id: <202407310736.46V7axQe073264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c8d0dca5e5f7 - stable/13 - Revert "Fix llvm register allocator for native/cross build differences" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8d0dca5e5f75b98c90ccfb60f8a65523072a8c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c8d0dca5e5f75b98c90ccfb60f8a65523072a8c7 commit c8d0dca5e5f75b98c90ccfb60f8a65523072a8c7 Author: Dimitry Andric AuthorDate: 2024-07-28 11:08:50 +0000 Commit: Dimitry Andric CommitDate: 2024-07-31 07:29:57 +0000 Revert "Fix llvm register allocator for native/cross build differences" In preparation for applying the fix that landed upstream, this reverts commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f: Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 52552d7572a6d3d7d3ce0d6862de9a9d203c5d01) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index afde8d001f88..f3cb7fa5af61 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,12 +256,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - // FreeBSD customization: similar to the HWeight declaration below, add a - // volatile qualifier to avoid slightly different weight results on amd64 - // and i386 hosts, and possibly choosing different registers in the register - // allocator. See for - // more details. - volatile float Weight = 1.0f; + float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Wed Jul 31 07:37:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkSX6z18z5RP2w; Wed, 31 Jul 2024 07:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkSX5K30z4pL5; Wed, 31 Jul 2024 07:37:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3iv6M7PbSPY98s4/JIuw7wMtI2nGJf8h5zJB/CbmKw=; b=S8FjzOFTreGRUsZE5JSgs43pPD3Ubv9VVdV8BeZrMtoJyFf2Uf5Ky//3rY9jXoYkeStwHk UtwhxOeBIfTJAUc1mpFTk6+LM6F9GUYaMKFm84XBqGLvDuL5bj2P4tV1XbsSoW7ZvEsLUW OpRgm6LcysYqBBcX0XVB0wzHpKWRQpVcsNzsMD/nQzEMwpsWKMDvVrk9zxQcMok/d0naWD RKDEIeWnvYiZIY9kFyK9ChZCwu0klJ4wzWEbqVUZuG0DeMCn16rHEBW4+8PdEQnTx7JxDj g8sk2Dz9ynrAa45YR9cOh/zMyTl8ckyT5jwiJIKaMGPLYOzwf8UMMJgLuJJ7Eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411420; a=rsa-sha256; cv=none; b=XbtM0FdWYS9g/OTa6iIjG6+07VSr+AK1HdT9P8ahl9+sHfpYu1yDRRnAdwUHi969XsM4f1 Cou5quVYPmZC/4fD3rHO2UhGvVd/MDuFobp7qvfBSufXjA+2PfZxjusbBWyRXvxF4ASexx GNk0Q7Z10Y60w1qCSgebZKOVdbMWBpXBZkG43ZYEXl/GlCJ9x1mLdZ2W4wo9+sqdz1dDvY F/gy5pDucITI6CXPQBagq2Xyf+2UJA6SuP+PbAFfBoVwonBTGJY5vmEbTpg0VcwhFWRok8 etuhQBGQ38YyTUQOrReW+3zUQSprXTFbNXRog/9SnSx4wWfp74oylToO88nU7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q3iv6M7PbSPY98s4/JIuw7wMtI2nGJf8h5zJB/CbmKw=; b=rtHQvS15Y3F3d+zhiH4GkgJui/1O+vMQIWbYEVgBDlzqdqvxuldBZTIxWHA48f4a5ny5yl xlL/3Egtg/g7Qz5yIgi4pE9wERnwxdK9jET8ct4iDflBMcf64al19gCMVsh7DnJlx8Ipx9 zQ0FO2hchOkId4Jk07yi5aKVNAgw8PBgOgbIFwHE9mEFkfdFXK/DNTcdYd8ujgb49KfmZc DwkUjn41d02Bv1v5bCxa5uQi1a0BZrJ6QYIlYAUrmvNNZPZl5i7M2ufy24ywg1YTdbtrGz SpcSZA8/Daia/rYeSTxEgk7mdyEW86fouv8YDQ1ZalZjRw1XMstvUv7fajhepA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkSX4xLNzsVh; Wed, 31 Jul 2024 07:37: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 46V7b0ga073326; Wed, 31 Jul 2024 07:37:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7b0lk073323; Wed, 31 Jul 2024 07:37:00 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:37:00 GMT Message-Id: <202407310737.46V7b0lk073323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 814641415fbe - stable/13 - Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 814641415fbee707b312c334e00a1ebb5157e37b Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=814641415fbee707b312c334e00a1ebb5157e37b commit 814641415fbee707b312c334e00a1ebb5157e37b Author: Dimitry Andric AuthorDate: 2024-07-28 11:13:37 +0000 Commit: Dimitry Andric CommitDate: 2024-07-31 07:29:59 +0000 Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): [CalcSpillWeights] Avoid x87 excess precision influencing weight result Fixes #99396 The result of `VirtRegAuxInfo::weightCalcHelper` can be influenced by x87 excess precision, which can result in slightly different register choices when the compiler is hosted on x86_64 or i386. This leads to different object file output when cross-compiling to i386, or native. Similar to 7af3432e22b0, we need to add a `volatile` qualifier to the local `Weight` variable to force it onto the stack, and avoid the excess precision. Define `stack_float_t` in `MathExtras.h` for this purpose, and use it. This is the version of the fix for PR276961 that landed upstream. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 1a4b8325f6e3a45c77188343da504fe04495cc46) --- contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h | 8 ++++++++ contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h index aa4f4d2ed42e..afb4fa262152 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h @@ -644,6 +644,14 @@ std::enable_if_t, T> MulOverflow(T X, T Y, T &Result) { return UX > (static_cast(std::numeric_limits::max())) / UY; } +/// Type to force float point values onto the stack, so that x86 doesn't add +/// hidden precision, avoiding rounding differences on various platforms. +#if defined(__i386__) || defined(_M_IX86) +using stack_float_t = volatile float; +#else +using stack_float_t = float; +#endif + } // End llvm namespace #endif diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..fa7ef669ec11 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/VirtRegMap.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -256,7 +257,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // Force Weight onto the stack so that x86 doesn't add hidden precision, + // similar to HWeight below. + stack_float_t Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { @@ -283,11 +286,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, Register HintReg = copyHint(MI, LI.reg(), TRI, MRI); if (!HintReg) continue; - // Force hweight onto the stack so that x86 doesn't add hidden precision, + // Force HWeight onto the stack so that x86 doesn't add hidden precision, // making the comparison incorrectly pass (i.e., 1 > 1 == true??). - // - // FIXME: we probably shouldn't use floats at all. - volatile float HWeight = Hint[HintReg] += Weight; + stack_float_t HWeight = Hint[HintReg] += Weight; if (HintReg.isVirtual() || MRI.isAllocatable(HintReg)) CopyHints.insert(CopyHint(HintReg, HWeight)); } From nobody Wed Jul 31 07:41:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYJ4wlMz5RPL4; Wed, 31 Jul 2024 07:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYJ3vWXz4qb3; Wed, 31 Jul 2024 07:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlzLV7mGWHTChjzI7bACYD2ga20i80EStnICeNoI8jw=; b=n7VzMogDekE1OfGGiRF+Ccf8l3/A0wShSlFXMXmvbZ+9STb8bp21bO5hHHW2V+UHMeg/vL pEl+QmXtzO0NeeqdcugxE3uUc6m4MKlWogWA5p3o13kyeIP7bO9XjXFO1k8GO7bPgX5Ko9 8UxSGURP9qYRiyar8G8N0ix1pOZPxnh6zhk4ULy43LhIBUaA7AC6M9iIp6BEw2qY0Pz0a0 ngvK28n56PmXE8wHDIow0GpnTeTod813tMoqUrwgwXJo9/BU+hF9t65tSDZ2Fdabkc0X48 HxAaj09dZn2Phe86Ag7QR+xmU2Hj7xwUGwqhAT2jN558VKfe54xETz10Xp1H0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411668; a=rsa-sha256; cv=none; b=aePQBU5Qsy1aZg2Rmisdr2HK22p/3vV4S1RyMLxQ6ZYtjNfEbjBwpohuy5MvdSQW2E+FzI YAhro0SgZUmAbXXZGf+McQ10bsDgDQtGWOdVqJap3jqQVMoN3rLBZyUix/e3nNNMQE+HXL 9/XC7q1LN5X2f2RLXwEcapFghCPjblYIvV/X3nkIQfZ+Zgu/7n2p5MBg795OTEOWGay5fO NGw8Qx36lGjH032hxi/NR5IeiAgCs9f9tcOZIzc2G1MWjtubpLFgoQog+Uf0rrQzIpoMTa jyNnw/CJ7Nm6HslQ3hfcE8dMuTt9YOBCSOf9BZUAi7aItaqLkkWxdwaQa8rl+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mlzLV7mGWHTChjzI7bACYD2ga20i80EStnICeNoI8jw=; b=FF4P7b2l5tBspdQ9kEIMPIovH/XVDi54c1ZNyOgsYt0Na0VLW4qp9op1ZDrenX57yLd5DN VU5KELq/CT+04aVZmUMUUXyW6ZXGYrGjLcjKSuFI8Ys79RjIRt6aYIgV7Rb5Lxksl0gHdW /M/Zg8iiWiECz4FgjHaKgTvl4u1TgFQHOgxZYiv48qkV0Mxx3crvA76ichzph6r8T3xn+I MNokOzz1YGAl95xD4ejCCwzU9CuwqvH4EbaaHuJ6GliyCKQtfjChReils7079jtSGp+QfY eZtlFOhOX0aGhTAsevgHGUdv89073HOEPx5KO0ct/XaPsDlzsnmw4c8169J1gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYJ3WDMzsDy; Wed, 31 Jul 2024 07:41: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 46V7f8o0084363; Wed, 31 Jul 2024 07:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7f8ZG084360; Wed, 31 Jul 2024 07:41:08 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:08 GMT Message-Id: <202407310741.46V7f8ZG084360@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: 2f6b4611b5b8 - stable/14 - pf: stricter state checking for ICMP and ICMPv6 packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 2f6b4611b5b847aee1ff8d5017a0f8a657f4101d Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2f6b4611b5b847aee1ff8d5017a0f8a657f4101d commit 2f6b4611b5b847aee1ff8d5017a0f8a657f4101d Author: Kristof Provost AuthorDate: 2024-07-09 13:59:33 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:53 +0000 pf: stricter state checking for ICMP and ICMPv6 packets Include the ICMP type in one port of the state key, using the type to determine which side should be the id, and which should be the type. Also: - Handle ICMP6 messages which are typically sent to multicast addresses but recieve unicast replies, by doing fallthrough lookups against the correct multicast address. - Clear up some mistaken assumptions in the PF code: - Not all ICMP packets have an icmp_id, so simulate one based on other data if we can, otherwise set it to 0. - Don't modify the icmp id field in NAT unless it's echo - Use the full range of possible id's when NATing icmp6 echoy ok henning marco testing matthieu todd MFC after: 1 day Obtained From: OpenBSD, mcbride 70bf7555ef4c Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 534ee17e61ee094ec175703bc50e88ff6587703e) --- sys/netpfil/pf/pf.c | 381 ++++++++++++++++++++++++++++++++++++++----------- sys/netpfil/pf/pf_lb.c | 19 ++- 2 files changed, 317 insertions(+), 83 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 1a4ef22ce5de..b3c4d47cabc2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -295,6 +295,8 @@ static void pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *, u_int16_t, u_int8_t, sa_family_t); static int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, struct tcphdr *, struct pf_state_peer *); +int pf_icmp_mapping(struct pf_pdesc *, u_int8_t, int *, + int *, u_int16_t *, u_int16_t *); static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, @@ -341,6 +343,10 @@ static int pf_test_state_tcp(struct pf_kstate **, static int pf_test_state_udp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *); +int pf_icmp_state_lookup(struct pf_state_key_cmp *, + struct pf_pdesc *, struct pf_kstate **, struct mbuf *, + int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int *, int); static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -393,6 +399,8 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; + #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ struct pf_state_key *nk; \ @@ -1745,6 +1753,142 @@ pf_isforlocal(struct mbuf *m, int af) return (false); } +int +pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, + int *icmp_dir, int *multi, u_int16_t *icmpid, u_int16_t *icmptype) +{ + /* + * ICMP types marked with PF_OUT are typically responses to + * PF_IN, and will match states in the opposite direction. + * PF_IN ICMP types need to match a state with that type. + */ + *icmp_dir = PF_OUT; + *multi = PF_ICMP_MULTI_LINK; + /* Queries (and responses) */ + switch (type) { + case ICMP_ECHO: + *icmp_dir = PF_IN; + case ICMP_ECHOREPLY: + *icmptype = ICMP_ECHO; + *icmpid = pd->hdr.icmp.icmp_id; + break; + + case ICMP_TSTAMP: + *icmp_dir = PF_IN; + case ICMP_TSTAMPREPLY: + *icmptype = ICMP_TSTAMP; + *icmpid = 0; /* Time is not a secret. */ + break; + + case ICMP_IREQ: + *icmp_dir = PF_IN; + case ICMP_IREQREPLY: + *icmptype = ICMP_IREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MASKREQ: + *icmp_dir = PF_IN; + case ICMP_MASKREPLY: + *icmptype = ICMP_MASKREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_IPV6_WHEREAREYOU: + *icmp_dir = PF_IN; + case ICMP_IPV6_IAMHERE: + *icmptype = ICMP_IPV6_WHEREAREYOU; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MOBILE_REGREQUEST: + *icmp_dir = PF_IN; + case ICMP_MOBILE_REGREPLY: + *icmptype = ICMP_MOBILE_REGREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_ROUTERSOLICIT: + *icmp_dir = PF_IN; + case ICMP_ROUTERADVERT: + *icmptype = ICMP_ROUTERSOLICIT; + *icmpid = 0; /* Nothing sane to match on! */ + break; + +#ifdef INET6 + case ICMP6_ECHO_REQUEST: + *icmp_dir = PF_IN; + case ICMP6_ECHO_REPLY: + *icmptype = ICMP6_ECHO_REQUEST; + *icmpid = pd->hdr.icmp6.icmp6_id; + break; + + case MLD_LISTENER_QUERY: + *icmp_dir = PF_IN; + case MLD_LISTENER_REPORT: { + *icmptype = MLD_LISTENER_QUERY; + *icmpid = 0; + break; + } + + /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ + case ICMP6_WRUREQUEST: + *icmp_dir = PF_IN; + case ICMP6_WRUREPLY: + *icmptype = ICMP6_WRUREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case MLD_MTRACE: + *icmp_dir = PF_IN; + case MLD_MTRACE_RESP: + *icmptype = MLD_MTRACE; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ND_NEIGHBOR_SOLICIT: + *icmp_dir = PF_IN; + case ND_NEIGHBOR_ADVERT: { + *icmptype = ND_NEIGHBOR_SOLICIT; + *multi = PF_ICMP_MULTI_SOLICITED; + *icmpid = 0; + break; + } + +#endif /* INET6 */ + /* These ICMP types map to other connections */ + case ICMP_UNREACH: + case ICMP_SOURCEQUENCH: + case ICMP_REDIRECT: + case ICMP_TIMXCEED: + case ICMP_PARAMPROB: +#ifdef INET6 + /* + * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH + * ND_REDIRECT can't be in this list because the triggering packet + * header is optional. + */ + case ICMP6_PACKET_TOO_BIG: +#endif /* INET6 */ + /* These will not be used, but set them anyways */ + *icmp_dir = PF_IN; + *icmptype = htons(type); + *icmpid = 0; + return (1); /* These types are matched to other state */ + /* + * All remaining ICMP types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *icmptype = type; + *icmpid = 0; + break; + } + HTONS(*icmptype); + return (0); +} + void pf_intr(void *v) { @@ -4408,8 +4552,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, int tag = -1; int asd = 0; int match = 0; - int state_icmp = 0; - u_int16_t sport = 0, dport = 0; + int state_icmp = 0, icmp_dir, multi; + u_int16_t sport = 0, dport = 0, virtual_type, virtual_id; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; struct pf_kanchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; @@ -4443,33 +4587,37 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, case IPPROTO_ICMP: if (pd->af != AF_INET) break; - sport = dport = pd->hdr.icmp.icmp_id; hdrlen = sizeof(pd->hdr.icmp); icmptype = pd->hdr.icmp.icmp_type; icmpcode = pd->hdr.icmp.icmp_code; - - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: if (af != AF_INET6) break; - sport = dport = pd->hdr.icmp6.icmp6_id; hdrlen = sizeof(pd->hdr.icmp6); icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; break; #endif /* INET6 */ default: @@ -4563,7 +4711,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, } #ifdef INET case IPPROTO_ICMP: - nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET)) pf_change_a(&saddr->v4.s_addr, pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, 0); @@ -4572,11 +4719,12 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[1] != pd->hdr.icmp.icmp_id) { + if (virtual_type == ICMP_ECHO && + nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, sport, - nk->port[1], 0); - pd->hdr.icmp.icmp_id = nk->port[1]; + nk->port[pd->sidx], 0); + pd->hdr.icmp.icmp_id = nk->port[pd->sidx]; pd->sport = &pd->hdr.icmp.icmp_id; } m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); @@ -4584,7 +4732,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: - nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET6)) pf_change_a6(saddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); @@ -6417,15 +6564,73 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, return (pf_multihome_scan(m, start, len, pd, kif, SCTP_ADD_IP_ADDRESS)); } +int +pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, + struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) +{ + key->af = pd->af; + key->proto = pd->proto; + if (icmp_dir == PF_IN) { + *iidx = pd->sidx; + key->port[pd->sidx] = icmpid; + key->port[pd->didx] = type; + } else { + *iidx = pd->didx; + key->port[pd->sidx] = type; + key->port[pd->didx] = icmpid; + } + if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { + switch (multi) { + case PF_ICMP_MULTI_SOLICITED: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; + key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; + key->addr[pd->sidx].addr8[12] = 0xff; + break; + case PF_ICMP_MULTI_LINK: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = 0; + key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + break; + } + } else + PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); + PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + + STATE_LOOKUP(kif, key, *state, pd); + + /* Is this ICMP message flowing in right direction? */ + if ((*state)->rule.ptr->type && + (((*state)->direction == direction) ? + PF_IN : PF_OUT) != icmp_dir) { + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: icmp type %d in wrong direction (%d): ", + icmp_dir, pd->dir); + pf_print_state(*state); + printf("\n"); + } + return (PF_DROP); + } + return (-1); +} + static int pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; - u_int16_t icmpid = 0, *icmpsum; + u_int16_t *icmpsum, virtual_id, virtual_type; u_int8_t icmptype, icmpcode; - int state_icmp = 0; + int icmp_dir, iidx, ret, multi; struct pf_state_key_cmp key; +#ifdef INET + u_int16_t icmpid; +#endif + + MPASS(*state == NULL); bzero(&key, sizeof(key)); switch (pd->proto) { @@ -6435,49 +6640,43 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, icmpcode = pd->hdr.icmp.icmp_code; icmpid = pd->hdr.icmp.icmp_id; icmpsum = &pd->hdr.icmp.icmp_cksum; - - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; +#ifdef INET icmpid = pd->hdr.icmp6.icmp6_id; +#endif icmpsum = &pd->hdr.icmp6.icmp6_cksum; - - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; break; #endif /* INET6 */ } - if (!state_icmp) { + if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, + &virtual_id, &virtual_type) == 0) { /* * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - key.af = pd->af; - key.proto = pd->proto; - key.port[0] = key.port[1] = icmpid; - if (pd->dir == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); + ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + kif, virtual_id, virtual_type, icmp_dir, &iidx, + PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + if (*state != NULL) + PF_STATE_UNLOCK((*state)); + ret = pf_icmp_state_lookup(&key, pd, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); } - STATE_LOOKUP(kif, &key, *state, pd); - (*state)->expire = time_uptime; (*state)->timeout = PFTM_ICMP_ERROR_REPLY; @@ -6500,14 +6699,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[0] != + if (nk->port[iidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, icmpid, - nk->port[pd->sidx], 0); + nk->port[iidx], 0); pd->hdr.icmp.icmp_id = - nk->port[pd->sidx]; + nk->port[iidx]; } m_copyback(m, off, ICMP_MINLEN, @@ -6872,13 +7071,15 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMP; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp_id; + icmpid = iih.icmp_id; + pf_icmp_mapping(&pd2, iih.icmp_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); - STATE_LOOKUP(kif, &key, *state, pd); + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) + return (ret); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6888,21 +7089,23 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp_id) - pf_change_icmp(pd2.src, &iih.icmp_id, + (virtual_type == ICMP_ECHO && + nk->port[iidx] != iih.icmp_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP_ECHO) ? + &iih.icmp_id : NULL, daddr, &nk->addr[pd2.sidx], - nk->port[pd2.sidx], NULL, + (virtual_type == ICMP_ECHO) ? + nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp_id) - pf_change_icmp(pd2.dst, &iih.icmp_id, - saddr, &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, - pd2.ip_sum, icmpsum, - pd->ip_sum, 0, AF_INET); + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, + pd2.ip_sum, icmpsum, pd->ip_sum, 0, + AF_INET); m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); @@ -6924,13 +7127,25 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMPV6; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp6_id; - - STATE_LOOKUP(kif, &key, *state, pd); + pf_icmp_mapping(&pd2, iih.icmp6_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + if (*state != NULL) + PF_STATE_UNLOCK((*state)); + ret = pf_icmp_state_lookup(&key, pd, + state, m, pd->dir, kif, + virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6940,19 +7155,21 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp6_id) - pf_change_icmp(pd2.src, &iih.icmp6_id, + ((virtual_type == ICMP6_ECHO_REQUEST) && + nk->port[pd2.sidx] != iih.icmp6_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP6_ECHO_REQUEST) + ? &iih.icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], - nk->port[pd2.sidx], NULL, + (virtual_type == ICMP6_ECHO_REQUEST) + ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp6_id) - pf_change_icmp(pd2.dst, &iih.icmp6_id, - saddr, &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index eb3d087e3df6..4fcad7e578a8 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -225,6 +225,23 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, if (pf_map_addr(af, r, saddr, naddr, NULL, &init_addr, sn)) return (1); + if (proto == IPPROTO_ICMP) { + if (*nport == htons(ICMP_ECHO)) { + low = 1; + high = 65535; + } else + return (0); /* Don't try to modify non-echo ICMP */ + } +#ifdef INET6 + if (proto == IPPROTO_ICMPV6) { + if (*nport == htons(ICMP6_ECHO_REQUEST)) { + low = 1; + high = 65535; + } else + return (0); /* Don't try to modify non-echo ICMP */ + } +#endif /* INET6 */ + bzero(&key, sizeof(key)); key.af = af; key.proto = proto; @@ -633,7 +650,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, switch (r->action) { case PF_NAT: if (pd->proto == IPPROTO_ICMP) { - low = 1; + low = 1; high = 65535; } else { low = r->rpool.proxy_port[0]; From nobody Wed Jul 31 07:41:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYK0PR0z5RPHK; Wed, 31 Jul 2024 07:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYJ6rvwz4qPY; Wed, 31 Jul 2024 07:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuSXlbEG5c0lZbUEgcBEHfyQ3uEasALS92hycGtsXu8=; b=EZG1j8uG84r2sGar01fQhuBg4RpYVrZPgcVnuJdRmeN8nFryDHKtyfa4LMNuZXOP+JB2mv svSvTp1H35LSvOJ8QY6+IBwIAcmXjvVhAurH0yOCEchVwvVNwA65VyodbNAwn+c3Wf2EuA d0DbvjbVS6quQH3LWUVc+4/Vfj8EiG5QWxoi0Anwf32gp9AOrfS4M/TGjtDXoQMwKLdU2v 6v4rDzcBZENeREgwjR10d+r+vAnTElSAnjLIdBYN7QGLtxP69mNtrvRMCj9/0QCMPaENpR 7eIKRKl++JYs0/7SO+5m0gjeQlQAZi+f77M2Rh2byk2aeJfBtJKodHGI/Lvyow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411668; a=rsa-sha256; cv=none; b=UjcMvw9//FdsJkG8WN/JgnYF1Y3w6qX0XofVFdoC7dQyJ7a0qDaSy/ZaDOrMBibLeSLOG2 sC86MEQ+XMHMWkOzg9vvrEOH4dUrfos+JxPcldAVMwk3VWBLBR8pteJTbq76fspf/xMjtX 9G/5o1nUuzytRcqcWK7AVcHVeHKyOGhGafvpl7W5MvUFSGz5/tfDZFMmMI8a5PNg9PdjOw zWDgwW0n0nPbGbClqySKuMv25ZOm7Ubpi4eXhs5dki/O905y6XbO6ffisAT7t6O48pLl69 YMQdHzoLWwYD8WISOMzQU0G0WzwTXdVHuKgsD6nEimEw8oXOhjUwHgCQOy+j/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uuSXlbEG5c0lZbUEgcBEHfyQ3uEasALS92hycGtsXu8=; b=Cw+uaLy9qEoLyrNnXPw8FuUE1Gdz01b+3jbRS6DCyAl6tBMzahUHaFy4ifQnCRveVmAV3b 7PRCVTAntx2qS0J21Ro5meX5ZndUJj/eSs6UIV+I7M65QqflYU+DaiAd48kM3BHUV16b8n gNr4PgioVl8Ir8NseO3inJsOjSuvx/IE62QtxYCs5km/jTj2ClTpiQxXWphAwBqf1bAdMN wqaGJnsiAlKOv1atrnhpRTBj8hzlov57/XjbzFoe2U7WF+m3DhWMa0C4WAVFdVys4BtBu/ Brp3Lzu5qEBtj5cOqGI59YyiP3hynREtnp5GdiMx9VGoQnL0YoK5zdfSff7YuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYJ656Yzs3J; Wed, 31 Jul 2024 07:41: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 46V7f8cE084481; Wed, 31 Jul 2024 07:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7f8m9084478; Wed, 31 Jul 2024 07:41:08 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:08 GMT Message-Id: <202407310741.46V7f8m9084478@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: f8fbac6b4ff7 - stable/13 - pf: stricter state checking for ICMP and ICMPv6 packets List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: f8fbac6b4ff7ba5256ccaf9caac4adfce2184b75 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f8fbac6b4ff7ba5256ccaf9caac4adfce2184b75 commit f8fbac6b4ff7ba5256ccaf9caac4adfce2184b75 Author: Kristof Provost AuthorDate: 2024-07-09 13:59:33 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:34 +0000 pf: stricter state checking for ICMP and ICMPv6 packets Include the ICMP type in one port of the state key, using the type to determine which side should be the id, and which should be the type. Also: - Handle ICMP6 messages which are typically sent to multicast addresses but recieve unicast replies, by doing fallthrough lookups against the correct multicast address. - Clear up some mistaken assumptions in the PF code: - Not all ICMP packets have an icmp_id, so simulate one based on other data if we can, otherwise set it to 0. - Don't modify the icmp id field in NAT unless it's echo - Use the full range of possible id's when NATing icmp6 echoy ok henning marco testing matthieu todd MFC after: 1 day Obtained From: OpenBSD, mcbride 70bf7555ef4c Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 534ee17e61ee094ec175703bc50e88ff6587703e) --- sys/netpfil/pf/pf.c | 380 ++++++++++++++++++++++++++++++++++++++----------- sys/netpfil/pf/pf_lb.c | 19 ++- 2 files changed, 316 insertions(+), 83 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0c3df612e3f8..9f94da48a15f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -280,6 +280,8 @@ static void pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *, u_int16_t, u_int8_t, sa_family_t); static int pf_modulate_sack(struct mbuf *, int, struct pf_pdesc *, struct tcphdr *, struct pf_state_peer *); +int pf_icmp_mapping(struct pf_pdesc *, u_int8_t, int *, + int *, u_int16_t *, u_int16_t *); static void pf_change_icmp(struct pf_addr *, u_int16_t *, struct pf_addr *, struct pf_addr *, u_int16_t, u_int16_t *, u_int16_t *, u_int16_t *, @@ -320,6 +322,10 @@ static int pf_test_state_tcp(struct pf_kstate **, int, static int pf_test_state_udp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *); +int pf_icmp_state_lookup(struct pf_state_key_cmp *, + struct pf_pdesc *, struct pf_kstate **, struct mbuf *, + int, struct pfi_kkif *, u_int16_t, u_int16_t, + int, int *, int); static int pf_test_state_icmp(struct pf_kstate **, int, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); @@ -373,6 +379,7 @@ extern int pf_end_threads; extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); +enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_SOLICITED, PF_ICMP_MULTI_LINK }; #define PACKET_UNDO_NAT(_m, _pd, _off, _s, _dir) \ do { \ @@ -1699,6 +1706,142 @@ pf_isforlocal(struct mbuf *m, int af) return (false); } +int +pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, + int *icmp_dir, int *multi, u_int16_t *icmpid, u_int16_t *icmptype) +{ + /* + * ICMP types marked with PF_OUT are typically responses to + * PF_IN, and will match states in the opposite direction. + * PF_IN ICMP types need to match a state with that type. + */ + *icmp_dir = PF_OUT; + *multi = PF_ICMP_MULTI_LINK; + /* Queries (and responses) */ + switch (type) { + case ICMP_ECHO: + *icmp_dir = PF_IN; + case ICMP_ECHOREPLY: + *icmptype = ICMP_ECHO; + *icmpid = pd->hdr.icmp.icmp_id; + break; + + case ICMP_TSTAMP: + *icmp_dir = PF_IN; + case ICMP_TSTAMPREPLY: + *icmptype = ICMP_TSTAMP; + *icmpid = 0; /* Time is not a secret. */ + break; + + case ICMP_IREQ: + *icmp_dir = PF_IN; + case ICMP_IREQREPLY: + *icmptype = ICMP_IREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MASKREQ: + *icmp_dir = PF_IN; + case ICMP_MASKREPLY: + *icmptype = ICMP_MASKREQ; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_IPV6_WHEREAREYOU: + *icmp_dir = PF_IN; + case ICMP_IPV6_IAMHERE: + *icmptype = ICMP_IPV6_WHEREAREYOU; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_MOBILE_REGREQUEST: + *icmp_dir = PF_IN; + case ICMP_MOBILE_REGREPLY: + *icmptype = ICMP_MOBILE_REGREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ICMP_ROUTERSOLICIT: + *icmp_dir = PF_IN; + case ICMP_ROUTERADVERT: + *icmptype = ICMP_ROUTERSOLICIT; + *icmpid = 0; /* Nothing sane to match on! */ + break; + +#ifdef INET6 + case ICMP6_ECHO_REQUEST: + *icmp_dir = PF_IN; + case ICMP6_ECHO_REPLY: + *icmptype = ICMP6_ECHO_REQUEST; + *icmpid = pd->hdr.icmp6.icmp6_id; + break; + + case MLD_LISTENER_QUERY: + *icmp_dir = PF_IN; + case MLD_LISTENER_REPORT: { + *icmptype = MLD_LISTENER_QUERY; + *icmpid = 0; + break; + } + + /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ + case ICMP6_WRUREQUEST: + *icmp_dir = PF_IN; + case ICMP6_WRUREPLY: + *icmptype = ICMP6_WRUREQUEST; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case MLD_MTRACE: + *icmp_dir = PF_IN; + case MLD_MTRACE_RESP: + *icmptype = MLD_MTRACE; + *icmpid = 0; /* Nothing sane to match on! */ + break; + + case ND_NEIGHBOR_SOLICIT: + *icmp_dir = PF_IN; + case ND_NEIGHBOR_ADVERT: { + *icmptype = ND_NEIGHBOR_SOLICIT; + *multi = PF_ICMP_MULTI_SOLICITED; + *icmpid = 0; + break; + } + +#endif /* INET6 */ + /* These ICMP types map to other connections */ + case ICMP_UNREACH: + case ICMP_SOURCEQUENCH: + case ICMP_REDIRECT: + case ICMP_TIMXCEED: + case ICMP_PARAMPROB: +#ifdef INET6 + /* + * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH + * ND_REDIRECT can't be in this list because the triggering packet + * header is optional. + */ + case ICMP6_PACKET_TOO_BIG: +#endif /* INET6 */ + /* These will not be used, but set them anyways */ + *icmp_dir = PF_IN; + *icmptype = htons(type); + *icmpid = 0; + return (1); /* These types are matched to other state */ + /* + * All remaining ICMP types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *icmptype = type; + *icmpid = 0; + break; + } + HTONS(*icmptype); + return (0); +} + void pf_intr(void *v) { @@ -3861,8 +4004,8 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, int tag = -1, rtableid = -1; int asd = 0; int match = 0; - int state_icmp = 0; - u_int16_t sport = 0, dport = 0; + int state_icmp = 0, icmp_dir, multi; + u_int16_t sport = 0, dport = 0, virtual_type, virtual_id; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; struct pf_kanchor_stackframe anchor_stack[PF_ANCHOR_STACKSIZE]; @@ -3896,33 +4039,37 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, case IPPROTO_ICMP: if (pd->af != AF_INET) break; - sport = dport = pd->hdr.icmp.icmp_id; hdrlen = sizeof(pd->hdr.icmp); icmptype = pd->hdr.icmp.icmp_type; icmpcode = pd->hdr.icmp.icmp_code; - - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: if (af != AF_INET6) break; - sport = dport = pd->hdr.icmp6.icmp6_id; hdrlen = sizeof(pd->hdr.icmp6); icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; + state_icmp = pf_icmp_mapping(pd, icmptype, + &icmp_dir, &multi, &virtual_id, &virtual_type); + if (icmp_dir == PF_IN) { + sport = virtual_id; + dport = virtual_type; + } else { + sport = virtual_type; + dport = virtual_id; + } - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; break; #endif /* INET6 */ default: @@ -4011,7 +4158,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, } #ifdef INET case IPPROTO_ICMP: - nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET)) pf_change_a(&saddr->v4.s_addr, pd->ip_sum, nk->addr[pd->sidx].v4.s_addr, 0); @@ -4020,11 +4166,12 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[1] != pd->hdr.icmp.icmp_id) { + if (virtual_type == ICMP_ECHO && + nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, sport, - nk->port[1], 0); - pd->hdr.icmp.icmp_id = nk->port[1]; + nk->port[pd->sidx], 0); + pd->hdr.icmp.icmp_id = nk->port[pd->sidx]; pd->sport = &pd->hdr.icmp.icmp_id; } m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); @@ -4032,7 +4179,6 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: - nk->port[0] = nk->port[1]; if (PF_ANEQ(saddr, &nk->addr[pd->sidx], AF_INET6)) pf_change_a6(saddr, &pd->hdr.icmp6.icmp6_cksum, &nk->addr[pd->sidx], 0); @@ -5826,15 +5972,73 @@ pf_multihome_scan_asconf(struct mbuf *m, int start, int len, return (pf_multihome_scan(m, start, len, pd, kif, SCTP_ADD_IP_ADDRESS)); } +int +pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, + struct pf_kstate **state, struct mbuf *m, int direction, struct pfi_kkif *kif, + u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi) +{ + key->af = pd->af; + key->proto = pd->proto; + if (icmp_dir == PF_IN) { + *iidx = pd->sidx; + key->port[pd->sidx] = icmpid; + key->port[pd->didx] = type; + } else { + *iidx = pd->didx; + key->port[pd->sidx] = type; + key->port[pd->didx] = icmpid; + } + if (pd->af == AF_INET6 && multi != PF_ICMP_MULTI_NONE) { + switch (multi) { + case PF_ICMP_MULTI_SOLICITED: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = IPV6_ADDR_INT32_ONE; + key->addr[pd->sidx].addr32[3] = pd->src->addr32[3]; + key->addr[pd->sidx].addr8[12] = 0xff; + break; + case PF_ICMP_MULTI_LINK: + key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; + key->addr[pd->sidx].addr32[1] = 0; + key->addr[pd->sidx].addr32[2] = 0; + key->addr[pd->sidx].addr32[3] = IPV6_ADDR_INT32_ONE; + break; + } + } else + PF_ACPY(&key->addr[pd->sidx], pd->src, key->af); + PF_ACPY(&key->addr[pd->didx], pd->dst, key->af); + + STATE_LOOKUP(kif, key, direction, *state, pd); + + /* Is this ICMP message flowing in right direction? */ + if ((*state)->rule.ptr->type && + (((*state)->direction == direction) ? + PF_IN : PF_OUT) != icmp_dir) { + if (V_pf_status.debug >= PF_DEBUG_MISC) { + printf("pf: icmp type %d in wrong direction (%d): ", + icmp_dir, pd->dir); + pf_print_state(*state); + printf("\n"); + } + return (PF_DROP); + } + return (-1); +} + static int pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) { struct pf_addr *saddr = pd->src, *daddr = pd->dst; - u_int16_t icmpid = 0, *icmpsum; + u_int16_t *icmpsum, virtual_id, virtual_type; u_int8_t icmptype, icmpcode; - int state_icmp = 0; + int icmp_dir, iidx, ret, multi; struct pf_state_key_cmp key; +#ifdef INET + u_int16_t icmpid; +#endif + + MPASS(*state == NULL); bzero(&key, sizeof(key)); switch (pd->proto) { @@ -5844,49 +6048,43 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif icmpcode = pd->hdr.icmp.icmp_code; icmpid = pd->hdr.icmp.icmp_id; icmpsum = &pd->hdr.icmp.icmp_cksum; - - if (icmptype == ICMP_UNREACH || - icmptype == ICMP_SOURCEQUENCH || - icmptype == ICMP_REDIRECT || - icmptype == ICMP_TIMXCEED || - icmptype == ICMP_PARAMPROB) - state_icmp++; break; #endif /* INET */ #ifdef INET6 case IPPROTO_ICMPV6: icmptype = pd->hdr.icmp6.icmp6_type; icmpcode = pd->hdr.icmp6.icmp6_code; +#ifdef INET icmpid = pd->hdr.icmp6.icmp6_id; +#endif icmpsum = &pd->hdr.icmp6.icmp6_cksum; - - if (icmptype == ICMP6_DST_UNREACH || - icmptype == ICMP6_PACKET_TOO_BIG || - icmptype == ICMP6_TIME_EXCEEDED || - icmptype == ICMP6_PARAM_PROB) - state_icmp++; break; #endif /* INET6 */ } - if (!state_icmp) { + if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, + &virtual_id, &virtual_type) == 0) { /* * ICMP query/reply message not related to a TCP/UDP packet. * Search for an ICMP state. */ - key.af = pd->af; - key.proto = pd->proto; - key.port[0] = key.port[1] = icmpid; - if (direction == PF_IN) { /* wire side, straight */ - PF_ACPY(&key.addr[0], pd->src, key.af); - PF_ACPY(&key.addr[1], pd->dst, key.af); - } else { /* stack side, reverse */ - PF_ACPY(&key.addr[1], pd->src, key.af); - PF_ACPY(&key.addr[0], pd->dst, key.af); + ret = pf_icmp_state_lookup(&key, pd, state, m, pd->dir, + kif, virtual_id, virtual_type, icmp_dir, &iidx, + PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + if (*state != NULL) + PF_STATE_UNLOCK((*state)); + ret = pf_icmp_state_lookup(&key, pd, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); } - STATE_LOOKUP(kif, &key, direction, *state, pd); - (*state)->expire = time_uptime; (*state)->timeout = PFTM_ICMP_ERROR_REPLY; @@ -5909,14 +6107,14 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (nk->port[0] != + if (nk->port[iidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, icmpid, - nk->port[pd->sidx], 0); + nk->port[iidx], 0); pd->hdr.icmp.icmp_id = - nk->port[pd->sidx]; + nk->port[iidx]; } m_copyback(m, off, ICMP_MINLEN, @@ -6281,13 +6479,15 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMP; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp_id; + icmpid = iih.icmp_id; + pf_icmp_mapping(&pd2, iih.icmp_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); - STATE_LOOKUP(kif, &key, direction, *state, pd); + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) + return (ret); /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6297,21 +6497,23 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp_id) - pf_change_icmp(pd2.src, &iih.icmp_id, + (virtual_type == ICMP_ECHO && + nk->port[iidx] != iih.icmp_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP_ECHO) ? + &iih.icmp_id : NULL, daddr, &nk->addr[pd2.sidx], - nk->port[pd2.sidx], NULL, + (virtual_type == ICMP_ECHO) ? + nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp_id) - pf_change_icmp(pd2.dst, &iih.icmp_id, - saddr, &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, - pd2.ip_sum, icmpsum, - pd->ip_sum, 0, AF_INET); + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, + pd2.ip_sum, icmpsum, pd->ip_sum, 0, + AF_INET); m_copyback(m, off, ICMP_MINLEN, (caddr_t)&pd->hdr.icmp); m_copyback(m, ipoff2, sizeof(h2), (caddr_t)&h2); @@ -6333,13 +6535,25 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif return (PF_DROP); } - key.af = pd2.af; - key.proto = IPPROTO_ICMPV6; - PF_ACPY(&key.addr[pd2.sidx], pd2.src, key.af); - PF_ACPY(&key.addr[pd2.didx], pd2.dst, key.af); - key.port[0] = key.port[1] = iih.icmp6_id; - - STATE_LOOKUP(kif, &key, direction, *state, pd); + pf_icmp_mapping(&pd2, iih.icmp6_type, + &icmp_dir, &multi, &virtual_id, &virtual_type); + ret = pf_icmp_state_lookup(&key, &pd2, state, m, + pd->dir, kif, virtual_id, virtual_type, + icmp_dir, &iidx, PF_ICMP_MULTI_NONE); + if (ret >= 0) { + if (ret == PF_DROP && pd->af == AF_INET6 && + icmp_dir == PF_OUT) { + if (*state != NULL) + PF_STATE_UNLOCK((*state)); + ret = pf_icmp_state_lookup(&key, pd, + state, m, pd->dir, kif, + virtual_id, virtual_type, + icmp_dir, &iidx, multi); + if (ret >= 0) + return (ret); + } else + return (ret); + } /* translate source/destination address, if necessary */ if ((*state)->key[PF_SK_WIRE] != @@ -6349,19 +6563,21 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - nk->port[pd2.sidx] != iih.icmp6_id) - pf_change_icmp(pd2.src, &iih.icmp6_id, + ((virtual_type == ICMP6_ECHO_REQUEST) && + nk->port[pd2.sidx] != iih.icmp6_id)) + pf_change_icmp(pd2.src, + (virtual_type == ICMP6_ECHO_REQUEST) + ? &iih.icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], - nk->port[pd2.sidx], NULL, + (virtual_type == ICMP6_ECHO_REQUEST) + ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); if (PF_ANEQ(pd2.dst, - &nk->addr[pd2.didx], pd2.af) || - nk->port[pd2.didx] != iih.icmp6_id) - pf_change_icmp(pd2.dst, &iih.icmp6_id, - saddr, &nk->addr[pd2.didx], - nk->port[pd2.didx], NULL, + &nk->addr[pd2.didx], pd2.af)) + pf_change_icmp(pd2.dst, NULL, NULL, + &nk->addr[pd2.didx], 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 30013ab0d8d0..46d3ea8f508d 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -222,6 +222,23 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, if (pf_map_addr(af, r, saddr, naddr, &init_addr, sn)) return (1); + if (proto == IPPROTO_ICMP) { + if (*nport == htons(ICMP_ECHO)) { + low = 1; + high = 65535; + } else + return (0); /* Don't try to modify non-echo ICMP */ + } +#ifdef INET6 + if (proto == IPPROTO_ICMPV6) { + if (*nport == htons(ICMP6_ECHO_REQUEST)) { + low = 1; + high = 65535; + } else + return (0); /* Don't try to modify non-echo ICMP */ + } +#endif /* INET6 */ + bzero(&key, sizeof(key)); key.af = af; key.proto = proto; @@ -606,7 +623,7 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, int direction, switch (r->action) { case PF_NAT: if (pd->proto == IPPROTO_ICMP) { - low = 1; + low = 1; high = 65535; } else { low = r->rpool.proxy_port[0]; From nobody Wed Jul 31 07:41:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYL2SJFz5RPLJ; Wed, 31 Jul 2024 07:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYL02RVz4qg0; Wed, 31 Jul 2024 07:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/GjKuEnqtwHg3cZ4TkFi72QesW2Gzp3pyNpC2fnwN8=; b=fZhAdP1p5kryxN8oNVWcKUp8bES+I8vtW4v3v5LglIVOqIlkCefkScFQClCX5BhrMiogsv eSFNkINgHiooaXQ0Uj6/2YzdDENdOEWxse/t8vA0cOnioRh3jzUMMmNIDr6KnjxtZI6Ljo q1rwpd/OEpz73M0uJnwjN5iDJJjKV2Y1R6f/BrrA5Ht+Ystctt0Lrr9seUwTsv7dCy4urd 4lgMgEmN+MEM3gprzRcjRcecQvNpb2MxwL+bjPOtGbqXray3aOCx8wIDDvcN4SxJwBM/+n zH9BO3VuIsvIhvvlh4zQf5WUFZnkl/TEeZzEAlRtwVu4zmecBwmU6j+4zpaxJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411670; a=rsa-sha256; cv=none; b=mbrq6T/tef7An6XvkTKH6RNT7Af/MXgJ82oXJkPKqFI+EYu/WlWoFVtqOOjg0oFnVARcIb X+iEwixdX6cQKCPaat1I+5RSEo24VwYm5fYdjukBDZB8HflPKg8ziyYFUgS0V1dfBzWZ1q KP6yNn9sMaapCPVsGSk/31V9lgF/QNNUEpEDJQ7gm9vKS+FU4TnH1M2vcicSUj+qvG6ftP SFLgKggUUOs2YFTq/6ofAvrsWQFWOGSrpCwIYYlldgin7Tid/c+t6H2zP+IDQb390LGn3x 4w8fHlgdN7OH9Jwz99b6R+TUt5LQBi9dSprFiEXqYXG9UfeHrm1oLa95ZLNqIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R/GjKuEnqtwHg3cZ4TkFi72QesW2Gzp3pyNpC2fnwN8=; b=snuwVQxAIoP7MwY+OGug48nt4sVYtaZ/hX5RCGg6ya9Q7MiPwZwKjj8DFAGmYF0ojtAThB pc4XqUKp//gi7XDYyOmcDCplUpQUD98EXDHwoUlbMRdrbPD9M13bnZkeXxMuOsxfM1jpj+ DmomEh4ag0xLWIwrVQEpVQYjND/9OLmdDkG+XxopLAFduEb22+G94XyWAC5aTnBVfUhdoz wP0mMh7k9rhjRFuAwE2KlwNJsOM9iwTXOm2LOMMmmzYnQAY/OowKV8nstVt1I1hoNnAp3w 2f3ChKEHIlr0CnEn3k5WF3NifPJMRorqB8OuTwcEOA0eusrdHEVE4+SkqX51qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYK6kGlzsF0; Wed, 31 Jul 2024 07:41: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 46V7f9FY084608; Wed, 31 Jul 2024 07:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7f9Rv084605; Wed, 31 Jul 2024 07:41:09 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:09 GMT Message-Id: <202407310741.46V7f9Rv084605@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: 3cf0fe176e72 - stable/13 - pf: some ICMP types that also have icmp_id, pointed out by markus@ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 3cf0fe176e72a2c6cea6d4b8efd2a10a59c9a89a Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3cf0fe176e72a2c6cea6d4b8efd2a10a59c9a89a commit 3cf0fe176e72a2c6cea6d4b8efd2a10a59c9a89a Author: Kristof Provost AuthorDate: 2024-07-10 11:32:03 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:34 +0000 pf: some ICMP types that also have icmp_id, pointed out by markus@ ok henning markus MFC after: 1 day Obtained From: OpenBSD, mcbride 8c0632cd274b Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit e296b0de9e467b8c5eb853f6cf4c6ea28d4119a2) --- sys/netpfil/pf/pf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9f94da48a15f..66f27f7f45af 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1730,21 +1730,21 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, *icmp_dir = PF_IN; case ICMP_TSTAMPREPLY: *icmptype = ICMP_TSTAMP; - *icmpid = 0; /* Time is not a secret. */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_IREQ: *icmp_dir = PF_IN; case ICMP_IREQREPLY: *icmptype = ICMP_IREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_MASKREQ: *icmp_dir = PF_IN; case ICMP_MASKREPLY: *icmptype = ICMP_MASKREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_IPV6_WHEREAREYOU: From nobody Wed Jul 31 07:41:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYM0Y6Zz5RPLS; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYL62thz4qb9; Wed, 31 Jul 2024 07:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmJCn1tv9yGV/YsSIN2p+QQi7gbReoRqZ1MguxMTT54=; b=v9GTGEMd5V2XYdSk/7tXagVWg8I3mEcuWIU/RkO449CzhS8bNQ3apu6udTIYm7AlHkT4ji hxT4++wYNU2Zaz7yewhg8IMjhyoOXQTzINxDEyIeTLpKiW7T0HLm5dMwpZIxbWKo4zPQCW cUvLWLCekHJ7XShyFiOG9p3yCLdTuAk5KqfQw7RHB3y21iEDaIBzuvW6PU7J/ZdpkSme/D J2n6w4cdXof/fnMHmtsFblOBdjU1x4GDZbTjmzy3URQnqXehPY3lz+RG/0XEPu1gBae2DV EfS/6yRETDBLNMsKPo8usjj+7aKK4SDh1RZjEbvq87j182vdGhvxr0Nox8x5Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411670; a=rsa-sha256; cv=none; b=Jmni9h/GFA+51iQT/+RVnjxvASzlY3DRDxofeBQPHwauuOBjyaYf4qhv7gPyLjrymnitY1 /0zSF0URMiweXu/a6Wd3zc2arUxuELa3U8Fi1CW68Peg2TCb/XKQK522agQs0oovpYyaRz VcyvNaBbPy9eAqj5qeRdfrdaM/Isjc67iMGSpntqijL/IUGIuxk7CKi62ZqfVBgsEBjmPZ 40sOYzefiw2A6dvIoh0Uo9WBxCwornUqR4yxhktetkOHtHXflDPuhqi5oI3JwsQiDOEbZe EMUDxeLS2bKHJTg1TGmdgKHMsQLhjlRdVQ4lujH7uHQgM79lc8ekH92ILAIlNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nmJCn1tv9yGV/YsSIN2p+QQi7gbReoRqZ1MguxMTT54=; b=Q41l+cY7u/C2z4AP6ujEF81q1wQeXqiNq4/40k4t+eke2apw5aetESn4gphnd7zUNVC2nD 6BXHO3J83NEMhOEtTUHYKR/NM2hszFsC95WQkPAT8SG1I+PwqcTVv5BPG4baiVBwDV+7nF sy3kAB5yzEZPOMASgn8snwz+Zb8co7pdzGWD4C85YkSn3EQhBY5LWCOoiN5hGFQbIujzKa 2mpJv8xpvPYbAqNrUcBZzt/gi/9XABz4i2qpgoD/fZwEQKdDPyotODIsrjM+4jA7QYgwpI kLXO6yenVZQWMuTEsB2DbZCb3FvgvuWefCUUX7lHksIyGSR9dUkYK7ZEK50l0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYL5fTyzsYc; Wed, 31 Jul 2024 07:41: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 46V7fAqp084656; Wed, 31 Jul 2024 07:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fA4W084653; Wed, 31 Jul 2024 07:41:10 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:10 GMT Message-Id: <202407310741.46V7fA4W084653@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: 7f77305a5ba4 - stable/14 - pf: split ICMP/ICMPv6 number space in pf_icmp_mapping() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 7f77305a5ba421f901cf3ac59a6449a70645fda4 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7f77305a5ba421f901cf3ac59a6449a70645fda4 commit 7f77305a5ba421f901cf3ac59a6449a70645fda4 Author: Kristof Provost AuthorDate: 2024-07-10 12:10:50 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:53 +0000 pf: split ICMP/ICMPv6 number space in pf_icmp_mapping() In pf_icmp_mapping() the ICMP and ICMPv6 types shared the same number space. In fact they are independent and must be handled separately. Fix traceroute via pf by splitting pf_icmp_mapping() into IPv4 and IPv6 sections. ok henning@ mcbride@; tested mcbride@; sure deraadt@ MFC after: 1 day Obtained From: OpenBSD, bluhm ef4bccd7509e Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 46755f52247bd34a7f013d6844ed0c673ac0defc) --- sys/netpfil/pf/pf.c | 247 ++++++++++++++++++++++++++++------------------------ 1 file changed, 135 insertions(+), 112 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e74a385d0f72..261a52a7c2f0 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1755,7 +1755,7 @@ pf_isforlocal(struct mbuf *m, int af) int pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, - int *icmp_dir, int *multi, u_int16_t *icmpid, u_int16_t *icmptype) + int *icmp_dir, int *multi, u_int16_t *virtual_id, u_int16_t *virtual_type) { /* * ICMP types marked with PF_OUT are typically responses to @@ -1765,128 +1765,151 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, *icmp_dir = PF_OUT; *multi = PF_ICMP_MULTI_LINK; /* Queries (and responses) */ - switch (type) { - case ICMP_ECHO: - *icmp_dir = PF_IN; - case ICMP_ECHOREPLY: - *icmptype = ICMP_ECHO; - *icmpid = pd->hdr.icmp.icmp_id; - break; + switch (pd->af) { +#ifdef INET + case AF_INET: + switch (type) { + case ICMP_ECHO: + *icmp_dir = PF_IN; + case ICMP_ECHOREPLY: + *virtual_type = ICMP_ECHO; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_TSTAMP: - *icmp_dir = PF_IN; - case ICMP_TSTAMPREPLY: - *icmptype = ICMP_TSTAMP; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_TSTAMP: + *icmp_dir = PF_IN; + case ICMP_TSTAMPREPLY: + *virtual_type = ICMP_TSTAMP; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_IREQ: - *icmp_dir = PF_IN; - case ICMP_IREQREPLY: - *icmptype = ICMP_IREQ; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_IREQ: + *icmp_dir = PF_IN; + case ICMP_IREQREPLY: + *virtual_type = ICMP_IREQ; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_MASKREQ: - *icmp_dir = PF_IN; - case ICMP_MASKREPLY: - *icmptype = ICMP_MASKREQ; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_MASKREQ: + *icmp_dir = PF_IN; + case ICMP_MASKREPLY: + *virtual_type = ICMP_MASKREQ; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_IPV6_WHEREAREYOU: - *icmp_dir = PF_IN; - case ICMP_IPV6_IAMHERE: - *icmptype = ICMP_IPV6_WHEREAREYOU; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_IPV6_WHEREAREYOU: + *icmp_dir = PF_IN; + case ICMP_IPV6_IAMHERE: + *virtual_type = ICMP_IPV6_WHEREAREYOU; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case ICMP_MOBILE_REGREQUEST: - *icmp_dir = PF_IN; - case ICMP_MOBILE_REGREPLY: - *icmptype = ICMP_MOBILE_REGREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_MOBILE_REGREQUEST: + *icmp_dir = PF_IN; + case ICMP_MOBILE_REGREPLY: + *virtual_type = ICMP_MOBILE_REGREQUEST; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case ICMP_ROUTERSOLICIT: - *icmp_dir = PF_IN; - case ICMP_ROUTERADVERT: - *icmptype = ICMP_ROUTERSOLICIT; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_ROUTERSOLICIT: + *icmp_dir = PF_IN; + case ICMP_ROUTERADVERT: + *virtual_type = ICMP_ROUTERSOLICIT; + *virtual_id = 0; /* Nothing sane to match on! */ + break; -#ifdef INET6 - case ICMP6_ECHO_REQUEST: - *icmp_dir = PF_IN; - case ICMP6_ECHO_REPLY: - *icmptype = ICMP6_ECHO_REQUEST; - *icmpid = pd->hdr.icmp6.icmp6_id; - break; + /* These ICMP types map to other connections */ + case ICMP_UNREACH: + case ICMP_SOURCEQUENCH: + case ICMP_REDIRECT: + case ICMP_TIMXCEED: + case ICMP_PARAMPROB: + /* These will not be used, but set them anyway */ + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + HTONS(*virtual_type); + return (1); /* These types match to another state */ - case MLD_LISTENER_QUERY: - *icmp_dir = PF_IN; - case MLD_LISTENER_REPORT: { - *icmptype = MLD_LISTENER_QUERY; - *icmpid = 0; + /* + * All remaining ICMP types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + break; + } break; - } +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + switch (type) { + case ICMP6_ECHO_REQUEST: + *icmp_dir = PF_IN; + case ICMP6_ECHO_REPLY: + *virtual_type = ICMP6_ECHO_REQUEST; + *virtual_id = pd->hdr.icmp6.icmp6_id; + break; - /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ - case ICMP6_WRUREQUEST: - *icmp_dir = PF_IN; - case ICMP6_WRUREPLY: - *icmptype = ICMP6_WRUREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case MLD_LISTENER_QUERY: + *icmp_dir = PF_IN; + case MLD_LISTENER_REPORT: { + *virtual_type = MLD_LISTENER_QUERY; + *virtual_id = 0; + break; + } + case MLD_MTRACE: + *icmp_dir = PF_IN; + case MLD_MTRACE_RESP: + *virtual_type = MLD_MTRACE; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case MLD_MTRACE: - *icmp_dir = PF_IN; - case MLD_MTRACE_RESP: - *icmptype = MLD_MTRACE; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ND_NEIGHBOR_SOLICIT: + *icmp_dir = PF_IN; + case ND_NEIGHBOR_ADVERT: { + *virtual_type = ND_NEIGHBOR_SOLICIT; + *virtual_id = 0; + break; + } - case ND_NEIGHBOR_SOLICIT: - *icmp_dir = PF_IN; - case ND_NEIGHBOR_ADVERT: { - *icmptype = ND_NEIGHBOR_SOLICIT; - *multi = PF_ICMP_MULTI_SOLICITED; - *icmpid = 0; + /* + * These ICMP types map to other connections. + * ND_REDIRECT can't be in this list because the triggering + * packet header is optional. + */ + case ICMP6_DST_UNREACH: + case ICMP6_PACKET_TOO_BIG: + case ICMP6_TIME_EXCEEDED: + case ICMP6_PARAM_PROB: + /* These will not be used, but set them anyway */ + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + HTONS(*virtual_type); + return (1); /* These types match to another state */ + /* + * All remaining ICMP6 types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + break; + } break; - } - #endif /* INET6 */ - /* These ICMP types map to other connections */ - case ICMP_UNREACH: - case ICMP_SOURCEQUENCH: - case ICMP_REDIRECT: - case ICMP_TIMXCEED: - case ICMP_PARAMPROB: -#ifdef INET6 - /* - * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH - * ND_REDIRECT can't be in this list because the triggering packet - * header is optional. - */ - case ICMP6_PACKET_TOO_BIG: -#endif /* INET6 */ - /* These will not be used, but set them anyways */ - *icmp_dir = PF_IN; - *icmptype = htons(type); - *icmpid = 0; - return (1); /* These types are matched to other state */ - /* - * All remaining ICMP types get their own states, - * and will only match in one direction. - */ default: *icmp_dir = PF_IN; - *icmptype = type; - *icmpid = 0; + *virtual_type = type; + *virtual_id = 0; break; } - HTONS(*icmptype); - return (0); + HTONS(*virtual_type); + return (0); /* These types match to their own state */ } void @@ -4719,7 +4742,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (virtual_type == ICMP_ECHO && + if (virtual_type == htons(ICMP_ECHO) && nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, sport, @@ -7089,13 +7112,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - (virtual_type == ICMP_ECHO && + (virtual_type == htons(ICMP_ECHO) && nk->port[iidx] != iih.icmp_id)) pf_change_icmp(pd2.src, - (virtual_type == ICMP_ECHO) ? + (virtual_type == htons(ICMP_ECHO)) ? &iih.icmp_id : NULL, daddr, &nk->addr[pd2.sidx], - (virtual_type == ICMP_ECHO) ? + (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); @@ -7155,13 +7178,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - ((virtual_type == ICMP6_ECHO_REQUEST) && + ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && nk->port[pd2.sidx] != iih.icmp6_id)) pf_change_icmp(pd2.src, - (virtual_type == ICMP6_ECHO_REQUEST) + (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? &iih.icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], - (virtual_type == ICMP6_ECHO_REQUEST) + (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); From nobody Wed Jul 31 07:41:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYK5yKcz5RNry; Wed, 31 Jul 2024 07:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYK4zdQz4qS7; Wed, 31 Jul 2024 07:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bhJI3T5i+lZ54Fwl0ALkMvnLbaPdnnkRk5liwAD1SrU=; b=cowkfcTxP1iWck2T39C/YcejeyWV84vjhWoMEodoiol/sDy5YXy3QBuXvT0ZifN2BhPhex vjkCL+/qhiC9GpsLgjMdXCVnlj+xXjlC6dUbI8ts81riHF5ad7J+aoS2TLQ/c1E3+3c9gf IWPCt/D6C8tT2/eRN8ZCJBZN+oGTdhVwbwKZZhtWqi8+sMvGhRzkOWdm62QKWncwtwp5T2 +S3r6KJ/j0wxHiXkwxFxxOMH9L9U6gS1yXixDeI+URzpjEaQLgcPFh4Tq548GB5WCt/E9r Uxas4zjaFsUDrnQyT9Y9blMZ/beuS0+oEXPfV2T6CAgvRsoiXn+IdEAnQOYKCg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411669; a=rsa-sha256; cv=none; b=a+o8hwvcvxcqv7behUr4GTReKT5e5gFpnYdvSBAeZeH8DgurvO137BlFs/DWvS+UjOGE9+ EvYSsYm6aMvRDpAF78f72C1tIPr0v6zWfl/SpKLmRX5jZ8RCLOFBfssgyHkNgHa/TvJazY A2UF1qUNhvb4vdN87k2kwi00D6xdMYSxUDV+ydSpNeZBJDdrXwjtzg7gxmO+R8LgUEQvp0 ibmE/CUCbhOe57bHcjhMns5kMpFkYoFa8ayLo5ZCTUdp3I2v93Epa+A/08VRvSt55nJfcW vHgoVPHz256TwVSWTSGBWvxovSnY8B59rcPleAC781fQALuV/Kstv0N4mQqXGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bhJI3T5i+lZ54Fwl0ALkMvnLbaPdnnkRk5liwAD1SrU=; b=RjR0xU1+utmvCJ5JJ+R2X9g/pWb1WMjq6mAeHqitzgnF/ex1CVhHqeKxueDwWZXqGmcXHP jpkbrutCbbYf6muzHxkdGPQwJLBoqlmfugeIYLxggk+QRYxUbmUHYyiRqqNeot10+r0zBc NVr6mFUn2Dxo57HXvxwxctniyMCYEYHuTkyru5cK7dygSmxpBFyDoX6wlNMAFbRBtOasgd om61hcUyDflmtgjGUygViF3eYkIh9Nv2kBdCPIRgRSWMPuZtppmEDbOpXOHScUCKrOdNm4 aNlNWb6/VHeLPPOAqTXhcS80CwadvL45sh96snU6lpAZeYR5u2fNlQblAvj13A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYK4bBFzsNg; Wed, 31 Jul 2024 07:41: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 46V7f9of084544; Wed, 31 Jul 2024 07:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7f9TZ084541; Wed, 31 Jul 2024 07:41:09 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:09 GMT Message-Id: <202407310741.46V7f9TZ084541@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: c5081b8d3918 - stable/14 - pf: some ICMP types that also have icmp_id, pointed out by markus@ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: c5081b8d3918564c1aba5a5e3f0a5219568e3435 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c5081b8d3918564c1aba5a5e3f0a5219568e3435 commit c5081b8d3918564c1aba5a5e3f0a5219568e3435 Author: Kristof Provost AuthorDate: 2024-07-10 11:32:03 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:53 +0000 pf: some ICMP types that also have icmp_id, pointed out by markus@ ok henning markus MFC after: 1 day Obtained From: OpenBSD, mcbride 8c0632cd274b Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit e296b0de9e467b8c5eb853f6cf4c6ea28d4119a2) --- sys/netpfil/pf/pf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index b3c4d47cabc2..e74a385d0f72 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1777,21 +1777,21 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, *icmp_dir = PF_IN; case ICMP_TSTAMPREPLY: *icmptype = ICMP_TSTAMP; - *icmpid = 0; /* Time is not a secret. */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_IREQ: *icmp_dir = PF_IN; case ICMP_IREQREPLY: *icmptype = ICMP_IREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_MASKREQ: *icmp_dir = PF_IN; case ICMP_MASKREPLY: *icmptype = ICMP_MASKREQ; - *icmpid = 0; /* Nothing sane to match on! */ + *icmpid = pd->hdr.icmp.icmp_id; break; case ICMP_IPV6_WHEREAREYOU: From nobody Wed Jul 31 07:41:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYP1y7gz5RPHT; Wed, 31 Jul 2024 07:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYP0Wzkz4qgD; Wed, 31 Jul 2024 07:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb5jzVfWktrZkppaaTd60sHNUZFJS+WrX197nyPU0Ig=; b=ttGc6z+tOG9h55WYhIHK6nSmGYcn30tK821E2pU4h3zdspP6HvhlyBWcCVgwt94clRvtTS 8+xSvueTW0y8eK962dEQ+6pu4ClitxPL+7QhHhPwjlIBuCQ/LuGw49iR7vPTjE4IDz4DV2 Q0axtnyWNWeQMJusTGstYxEvTXVjigbKzra24ADEirXgKY1MTkwTb2igZw9NEGlRYg3MxV WlkdzUtp/leuPX+hjoNoMQHJrQbnssJmeIYuGh6pNw5xEC4Aq+owMDxa4TzuLOLUAFpFPe 7IgYVABX40sWaWQMvYPTRftC0WpNdqL3V7ISikhG6kXAPsa1zAMpIs1z4JPJyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411673; a=rsa-sha256; cv=none; b=yQd3xX4oTUZIJQhrZFRBWE01klD+tQNpCWb2gzdkaj50DDooORKgJ7sbzvA6wYl3vnmeqv NdCI1eCyU8kaXtO4SZM/sm/6czx8z29nzXwx59woV1zwRvkaGqhDLHiOJ9tOB7RP5PMfxo RjZf3wCEhRy6TQvGQB+t26Bnt5wUTDmHcQDW+ykJbOD5n2fH5+2hydXQPX/Hh269HVo/tK Xe6YOp6f+rg1ceI8N9St91xuUrqcjGabcCbFCxHKhwtMmQy+GHHYnG27I2rkC0D/KBI9do gv/bCOULSf4pI2lk6ns2L0Nw7NQA0kS2iGPsbtu3q5XNLtIyT90SV5fKsaxnZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fb5jzVfWktrZkppaaTd60sHNUZFJS+WrX197nyPU0Ig=; b=VfeaOSDGMy/MaonIBAn7EUBAXG/ntPapikAx/sttFKndIrmfoqc4TFof4KdDJ4+7g5Wb1D l0ubF0yxxpwjhk2+3wFfCZtSRdMNBzCbZ/61KQSi4SL/d1xB0QgVoJrO/CyqwRgE1uied0 cIKaZkT7pWiDWVll8v6gzEsLNNnvuJGZf1ujDmGZSkkTmM24oO96JB2bEfhklDmTfXRv1g o7a8+2I3pmu4MjHo+dgTmdyy5a9JyWFlGgn7mb+UU9f5NWKeP1ATe0OMA7oD+remhXVnV0 kNAx04jAUj+YsT3LAw4eXQynncLunQflUOgMCSS7v+S2NnFQQJje0fzKxmSQGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYP07Tszs3M; Wed, 31 Jul 2024 07:41: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 46V7fCQf084870; Wed, 31 Jul 2024 07:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fCmk084867; Wed, 31 Jul 2024 07:41:12 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:12 GMT Message-Id: <202407310741.46V7fCmk084867@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: 3e1f815655ef - stable/14 - pf tests: ensure we don't confuse different ICMP 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3e1f815655ef66963bc8f9ea9fbd691f2eddd2e8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e1f815655ef66963bc8f9ea9fbd691f2eddd2e8 commit 3e1f815655ef66963bc8f9ea9fbd691f2eddd2e8 Author: Kristof Provost AuthorDate: 2024-07-09 09:22:18 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:53 +0000 pf tests: ensure we don't confuse different ICMP types When creating a state for ICMP (v4 or v6) packets we only used the ID, which means that we could confuse different ICMP types. For example, if we allowed neighbour discovery but not ICMPv6 echo requests an ND packet could create a state that the echo request would match. Test that this is now fixed. Reported by: Enrico Bassetti MFC after: 1 day Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b9f0dbc3d006e0b904ee4275d54459f4edd65bb8) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/icmp6.sh | 89 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 1083f89a5502..9b793417c1d8 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -16,6 +16,7 @@ ATF_TESTS_SH+= altq \ fragmentation_no_reassembly \ get_state \ icmp \ + icmp6 \ killstate \ macro \ map_e \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh new file mode 100644 index 000000000000..35d20c83cc4f --- /dev/null +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -0,0 +1,89 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "zero_id" "cleanup" +zero_id_head() +{ + atf_set descr 'Test ICMPv6 echo with ID 0 keep being blocked' + atf_set require.user root + atf_set require.progs scapy +} + +zero_id_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set block-policy drop" \ + "antispoof quick for { egress ${epair}b }" \ + "block all" \ + "pass out" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 135" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 136" \ + "pass out quick inet6 proto IPV6 from self to any" + + # Now we can't ping + atf_check -s exit:2 -o ignore \ + ping -c 1 2001:db8::1 + + # Force neighbour discovery + ndp -d 2001:db8::1 + + # Verify that we don't confuse echo request with ID 0 for neighbour discovery + atf_check -s exit:1 -o ignore \ + ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 2001:db8::1 \ + --replyif ${epair}a + + jexec alcatraz pfctl -ss -vv + jexec alcatraz pfctl -sr -vv +} + +zero_id_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "zero_id" +} From nobody Wed Jul 31 07:41:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYM1tf0z5RPQm; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYM14mGz4qS9; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1GEW81okbY9dqAFA+3nfUal5aYvKGElko68DsFBG8o=; b=IMIweuYu8XE7qAM6scxtrllssDgTrL0oDahA0GGIJwQ0LQaDaQbIm9YqcuWBb/GZr8oq34 9CRQXQry4DEctle9SOvyJNFW+nRMi/oNZVl9uvzNLXI+dN3GdoTxZaSVPEyOuuU7DfVvpZ cObuJiJqOMIrav6+lOJKKT5rqajQskBkHoeD9QErCaqy+0h3wM0M0v7QKqpKhKPANCoQhz +mWH6G9pp8nqNhniidbIkF4NOdIhnzpAFRwOoKwy0/NS9tpK3euG/6iOVPh7oUO+365Kgv Mz+ZQ3dhDt/m4GsdLWl4CrZ2J4xulI0oJ/BovY3aLPfFh0RIxpTV32sCCUoqMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411671; a=rsa-sha256; cv=none; b=ALsZKlWtkuXfjyLon1kaTiTE4Ls77pMoYGvNAbWkdE3cqmBzFwWll31KjBqWfLJ9J97FbP OQRvZBSlano7+JKT3WSGAajuE92xCYwH64gJlyIKOX2WZrd7pTEgv+pkRAL6yUpyGk5X/e LP4kzIZ0H5rkcTrlbJh0kbBF9tAsizrKHt53BTq3b5kNfCH83Uo0ZRt1vUpuBRiBAHONgq 9FFBJH20ibhathgJS5gcqWxgD5aC1FVRax+2OnFWXlVHhcHytG8rw5GolaxqHHHcC0tilq tFwpGgEi88QbZ4yGKEYWP12/H9zMwyPrgWmkHNa2p2dV+BBmCoU3l79R/cQdwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1GEW81okbY9dqAFA+3nfUal5aYvKGElko68DsFBG8o=; b=lJBWvsTuxBHimmnv4QZ4Q8tSbuXhxjuYopc1Un3OfT0wyXh8SLXZxiOJa/Ebr1RRPyE6gd 2F1PBqEEGW+L0HX7/Ou46Y8woc9RIMUXktqpMKPrf+ifFOaxp0DT04tuqlEsnU8PRTeun+ ElYELCQ7aZh5FqekYxUgHXu5KRNDPJgaWuomeu1isqx/X8I15QuOTJX139uBkTtHyNu6x1 SZe+dP4KjgMteA+p9njurx5YbhhU493SnC7RzbuhXoBGnbKRaLlK1rJcCb87ifo0BcWikM /tYvReEaCY+wTJsNdYpyt2hk1pdzJGXB3TwrOCHNpnnbg7znkymblOpK4VRsjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYM0fxvzsSv; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46V7fAJl084704; Wed, 31 Jul 2024 07:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fA4V084701; Wed, 31 Jul 2024 07:41:10 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:10 GMT Message-Id: <202407310741.46V7fA4V084701@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: 178265a4be8a - stable/13 - pf: split ICMP/ICMPv6 number space in pf_icmp_mapping() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 178265a4be8a81b93a5e6a640905e3382801c5be Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=178265a4be8a81b93a5e6a640905e3382801c5be commit 178265a4be8a81b93a5e6a640905e3382801c5be Author: Kristof Provost AuthorDate: 2024-07-10 12:10:50 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:34 +0000 pf: split ICMP/ICMPv6 number space in pf_icmp_mapping() In pf_icmp_mapping() the ICMP and ICMPv6 types shared the same number space. In fact they are independent and must be handled separately. Fix traceroute via pf by splitting pf_icmp_mapping() into IPv4 and IPv6 sections. ok henning@ mcbride@; tested mcbride@; sure deraadt@ MFC after: 1 day Obtained From: OpenBSD, bluhm ef4bccd7509e Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 46755f52247bd34a7f013d6844ed0c673ac0defc) --- sys/netpfil/pf/pf.c | 247 ++++++++++++++++++++++++++++------------------------ 1 file changed, 135 insertions(+), 112 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 66f27f7f45af..767fecdcb3f1 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1708,7 +1708,7 @@ pf_isforlocal(struct mbuf *m, int af) int pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, - int *icmp_dir, int *multi, u_int16_t *icmpid, u_int16_t *icmptype) + int *icmp_dir, int *multi, u_int16_t *virtual_id, u_int16_t *virtual_type) { /* * ICMP types marked with PF_OUT are typically responses to @@ -1718,128 +1718,151 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, *icmp_dir = PF_OUT; *multi = PF_ICMP_MULTI_LINK; /* Queries (and responses) */ - switch (type) { - case ICMP_ECHO: - *icmp_dir = PF_IN; - case ICMP_ECHOREPLY: - *icmptype = ICMP_ECHO; - *icmpid = pd->hdr.icmp.icmp_id; - break; + switch (pd->af) { +#ifdef INET + case AF_INET: + switch (type) { + case ICMP_ECHO: + *icmp_dir = PF_IN; + case ICMP_ECHOREPLY: + *virtual_type = ICMP_ECHO; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_TSTAMP: - *icmp_dir = PF_IN; - case ICMP_TSTAMPREPLY: - *icmptype = ICMP_TSTAMP; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_TSTAMP: + *icmp_dir = PF_IN; + case ICMP_TSTAMPREPLY: + *virtual_type = ICMP_TSTAMP; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_IREQ: - *icmp_dir = PF_IN; - case ICMP_IREQREPLY: - *icmptype = ICMP_IREQ; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_IREQ: + *icmp_dir = PF_IN; + case ICMP_IREQREPLY: + *virtual_type = ICMP_IREQ; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_MASKREQ: - *icmp_dir = PF_IN; - case ICMP_MASKREPLY: - *icmptype = ICMP_MASKREQ; - *icmpid = pd->hdr.icmp.icmp_id; - break; + case ICMP_MASKREQ: + *icmp_dir = PF_IN; + case ICMP_MASKREPLY: + *virtual_type = ICMP_MASKREQ; + *virtual_id = pd->hdr.icmp.icmp_id; + break; - case ICMP_IPV6_WHEREAREYOU: - *icmp_dir = PF_IN; - case ICMP_IPV6_IAMHERE: - *icmptype = ICMP_IPV6_WHEREAREYOU; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_IPV6_WHEREAREYOU: + *icmp_dir = PF_IN; + case ICMP_IPV6_IAMHERE: + *virtual_type = ICMP_IPV6_WHEREAREYOU; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case ICMP_MOBILE_REGREQUEST: - *icmp_dir = PF_IN; - case ICMP_MOBILE_REGREPLY: - *icmptype = ICMP_MOBILE_REGREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_MOBILE_REGREQUEST: + *icmp_dir = PF_IN; + case ICMP_MOBILE_REGREPLY: + *virtual_type = ICMP_MOBILE_REGREQUEST; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case ICMP_ROUTERSOLICIT: - *icmp_dir = PF_IN; - case ICMP_ROUTERADVERT: - *icmptype = ICMP_ROUTERSOLICIT; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ICMP_ROUTERSOLICIT: + *icmp_dir = PF_IN; + case ICMP_ROUTERADVERT: + *virtual_type = ICMP_ROUTERSOLICIT; + *virtual_id = 0; /* Nothing sane to match on! */ + break; -#ifdef INET6 - case ICMP6_ECHO_REQUEST: - *icmp_dir = PF_IN; - case ICMP6_ECHO_REPLY: - *icmptype = ICMP6_ECHO_REQUEST; - *icmpid = pd->hdr.icmp6.icmp6_id; - break; + /* These ICMP types map to other connections */ + case ICMP_UNREACH: + case ICMP_SOURCEQUENCH: + case ICMP_REDIRECT: + case ICMP_TIMXCEED: + case ICMP_PARAMPROB: + /* These will not be used, but set them anyway */ + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + HTONS(*virtual_type); + return (1); /* These types match to another state */ - case MLD_LISTENER_QUERY: - *icmp_dir = PF_IN; - case MLD_LISTENER_REPORT: { - *icmptype = MLD_LISTENER_QUERY; - *icmpid = 0; + /* + * All remaining ICMP types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + break; + } break; - } +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + switch (type) { + case ICMP6_ECHO_REQUEST: + *icmp_dir = PF_IN; + case ICMP6_ECHO_REPLY: + *virtual_type = ICMP6_ECHO_REQUEST; + *virtual_id = pd->hdr.icmp6.icmp6_id; + break; - /* ICMP6_FQDN and ICMP6_NI query/reply are the same type as ICMP6_WRU */ - case ICMP6_WRUREQUEST: - *icmp_dir = PF_IN; - case ICMP6_WRUREPLY: - *icmptype = ICMP6_WRUREQUEST; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case MLD_LISTENER_QUERY: + *icmp_dir = PF_IN; + case MLD_LISTENER_REPORT: { + *virtual_type = MLD_LISTENER_QUERY; + *virtual_id = 0; + break; + } + case MLD_MTRACE: + *icmp_dir = PF_IN; + case MLD_MTRACE_RESP: + *virtual_type = MLD_MTRACE; + *virtual_id = 0; /* Nothing sane to match on! */ + break; - case MLD_MTRACE: - *icmp_dir = PF_IN; - case MLD_MTRACE_RESP: - *icmptype = MLD_MTRACE; - *icmpid = 0; /* Nothing sane to match on! */ - break; + case ND_NEIGHBOR_SOLICIT: + *icmp_dir = PF_IN; + case ND_NEIGHBOR_ADVERT: { + *virtual_type = ND_NEIGHBOR_SOLICIT; + *virtual_id = 0; + break; + } - case ND_NEIGHBOR_SOLICIT: - *icmp_dir = PF_IN; - case ND_NEIGHBOR_ADVERT: { - *icmptype = ND_NEIGHBOR_SOLICIT; - *multi = PF_ICMP_MULTI_SOLICITED; - *icmpid = 0; + /* + * These ICMP types map to other connections. + * ND_REDIRECT can't be in this list because the triggering + * packet header is optional. + */ + case ICMP6_DST_UNREACH: + case ICMP6_PACKET_TOO_BIG: + case ICMP6_TIME_EXCEEDED: + case ICMP6_PARAM_PROB: + /* These will not be used, but set them anyway */ + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + HTONS(*virtual_type); + return (1); /* These types match to another state */ + /* + * All remaining ICMP6 types get their own states, + * and will only match in one direction. + */ + default: + *icmp_dir = PF_IN; + *virtual_type = type; + *virtual_id = 0; + break; + } break; - } - #endif /* INET6 */ - /* These ICMP types map to other connections */ - case ICMP_UNREACH: - case ICMP_SOURCEQUENCH: - case ICMP_REDIRECT: - case ICMP_TIMXCEED: - case ICMP_PARAMPROB: -#ifdef INET6 - /* - * ICMP6_TIME_EXCEEDED is the same type as ICMP_UNREACH - * ND_REDIRECT can't be in this list because the triggering packet - * header is optional. - */ - case ICMP6_PACKET_TOO_BIG: -#endif /* INET6 */ - /* These will not be used, but set them anyways */ - *icmp_dir = PF_IN; - *icmptype = htons(type); - *icmpid = 0; - return (1); /* These types are matched to other state */ - /* - * All remaining ICMP types get their own states, - * and will only match in one direction. - */ default: *icmp_dir = PF_IN; - *icmptype = type; - *icmpid = 0; + *virtual_type = type; + *virtual_id = 0; break; } - HTONS(*icmptype); - return (0); + HTONS(*virtual_type); + return (0); /* These types match to their own state */ } void @@ -4166,7 +4189,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, pf_change_a(&daddr->v4.s_addr, pd->ip_sum, nk->addr[pd->didx].v4.s_addr, 0); - if (virtual_type == ICMP_ECHO && + if (virtual_type == htons(ICMP_ECHO) && nk->port[pd->sidx] != pd->hdr.icmp.icmp_id) { pd->hdr.icmp.icmp_cksum = pf_cksum_fixup( pd->hdr.icmp.icmp_cksum, sport, @@ -6497,13 +6520,13 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - (virtual_type == ICMP_ECHO && + (virtual_type == htons(ICMP_ECHO) && nk->port[iidx] != iih.icmp_id)) pf_change_icmp(pd2.src, - (virtual_type == ICMP_ECHO) ? + (virtual_type == htons(ICMP_ECHO)) ? &iih.icmp_id : NULL, daddr, &nk->addr[pd2.sidx], - (virtual_type == ICMP_ECHO) ? + (virtual_type == htons(ICMP_ECHO)) ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET); @@ -6563,13 +6586,13 @@ pf_test_state_icmp(struct pf_kstate **state, int direction, struct pfi_kkif *kif if (PF_ANEQ(pd2.src, &nk->addr[pd2.sidx], pd2.af) || - ((virtual_type == ICMP6_ECHO_REQUEST) && + ((virtual_type == htons(ICMP6_ECHO_REQUEST)) && nk->port[pd2.sidx] != iih.icmp6_id)) pf_change_icmp(pd2.src, - (virtual_type == ICMP6_ECHO_REQUEST) + (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? &iih.icmp6_id : NULL, daddr, &nk->addr[pd2.sidx], - (virtual_type == ICMP6_ECHO_REQUEST) + (virtual_type == htons(ICMP6_ECHO_REQUEST)) ? nk->port[iidx] : 0, NULL, pd2.ip_sum, icmpsum, pd->ip_sum, 0, AF_INET6); From nobody Wed Jul 31 07:41:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYN3ZNdz5RPNL; Wed, 31 Jul 2024 07:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYN26kmz4qSF; Wed, 31 Jul 2024 07:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4oFDFXVM4RBM9gLQWsXnAaJIOqoxmqmJEvKNSHM7qk=; b=oMCj4CveTng/uF1MjY47VQyytVRg928usk1tf+hDi16KoeM4GR5Z6tiA9bNfpTHGd7KYRF Pegws6D1TmfNvhs0QaEv+4GuzI5CFuqla5F+lLIXTyegJCkG76pbQ2k+b0xp8QrXMyliJ+ qr/rAjGIqgPUZkW7zHZQ4/5nIK3ATOGiPREHPVGk06KBPkjMQXW8UZYrfw8FntTp6MOxg0 Ajm8k7NbGb62MLo2U5WdNygGhg7/U2s62ZBq7pbMvYGjlVYAhAy+oLnq6VX43aFzNiapLx zZ2RtwRIQ9RxbkmVL+AUSXX+CBFagodkQnDnWuGtkDhMP7LlOAaDcM+rRT2WxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411672; a=rsa-sha256; cv=none; b=tfODAoC8IMwig0I9HBx+KDD+0hpAXgGNI6aH4tAsLAYXAg6+n1DsX6bxKceeb91CZEp9hJ KGed+FXbgpANQMBySjknrTyqnVmQ9Bd6X3Aza7Nrz/hSQDNCz8bYyk0yTziXykPtXassHI SH64p9yNXVPxp+8SC1dGkilO4jB2TOtZIQB+HEl/2mOhv39vyXy4G8pjo5SlRdAOm/K3Fr Jg24RTtpAdA6UduZvsdbB/3ouwp8WfiiwEhn8uTkL4v7aeE25onU27vvj/gguxufGSgkVq qq2InhQ6OMiAbhXeL0e7NQVrsjn++TmYn8qnrztqs7Brbsm1sflu6nFQLWzl/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411672; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z4oFDFXVM4RBM9gLQWsXnAaJIOqoxmqmJEvKNSHM7qk=; b=SIiWU6RYXPnZqqctKX6IJaHJiWLazvZHD9sJZxJwI/M7bil6E4DAI2GvIPUhFWpNNWLiAO DNNpxaSxAloiw2lhwoYj0bJqm1F7jUQPmgBm0x2rOgGcqnP16REget/pRX1+I3HtcZiljK hoqHp39I18FJSH8OdtK4JuSsm3UMqvQO0jquD0LAlZLxXQTCjAwevXweQXx7FQlv7rFto2 6OOH+2cooXrBqjGUybCM1nV81U1HrzjWhBg0Gr3lMJ31YIw/pBPbUbBpZ/2sH46SAAK9k8 nOe/o6Bpb4goBHGLw4KWleTN57bBWIt/Ipj0j36FMIWwSJ+8Xvs1Kja0YXfrAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYN1jqczsSw; Wed, 31 Jul 2024 07:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46V7fCi9084815; Wed, 31 Jul 2024 07:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fCfG084812; Wed, 31 Jul 2024 07:41:12 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:12 GMT Message-Id: <202407310741.46V7fCfG084812@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: 05f91f8dd5ce - stable/13 - pf: allow MLD LR to be sent without state List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 05f91f8dd5ce46d274feff11103249e3d9428f38 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05f91f8dd5ce46d274feff11103249e3d9428f38 commit 05f91f8dd5ce46d274feff11103249e3d9428f38 Author: Kristof Provost AuthorDate: 2024-07-10 12:36:18 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:35 +0000 pf: allow MLD LR to be sent without state Change PF behavior to allow MLD Listener Report packets to be sent without needing a previously created state by MLD Listener Query. It wasn't working because: (1) you might not have a previous MLD Listener Query and (2) the addresses of the Query and Report don't match. ok mikeb@, sashan@ MFC after: 1 day Obtained From: OpenBSD, rzalamena , 5c526dbdb0f2 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 1afe4da75d1d2acd33b25eea942af28aa41c82c2) --- sys/netpfil/pf/pf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 767fecdcb3f1..07d0604e924c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1807,8 +1807,15 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, break; case MLD_LISTENER_QUERY: - *icmp_dir = PF_IN; case MLD_LISTENER_REPORT: { + /* + * Listener Report can be sent by clients + * without an associated Listener Query. + * In addition to that, when Report is sent as a + * reply to a Query its source and destination + * address are different. + */ + *icmp_dir = PF_IN; *virtual_type = MLD_LISTENER_QUERY; *virtual_id = 0; break; From nobody Wed Jul 31 07:41:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYN21dqz5RPNK; Wed, 31 Jul 2024 07:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYM6Nlrz4qg5; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8SqNM5VTKgWrWx7hDcPsaWUIyFNwmTvMxMWcSMc0Ms=; b=CV24rspPA6OEtodMtSc97TjD0YdFnLT1U9mA/P2VGQz5Yp+JOBLnAuQfFxB/77KmK2k/Y1 C/cv+bPMmV5wIfvy+ySY92oebqD/W8G1biQwjP2sIY9z5JhJc5KdhVGD2w2J2j7+Q3ji2w J3dSdAg6B4FMLfoij2J5RqNT3p83HTCqcKtGRzWoSnOdpzBy1cJa1aEWnqBXnDAkbp0i7v 7umK7OcZL/lxhkW/CJUEqJNp9FNpg0Nu2bs/DntgXf367iB007qh6EH+CCIPBGS29Dzmoy UWhPdyLbP8+B70llwD03c9t/y5l1kun3DYT7M+Di5fnWSo6KA+mZmUChOqjGOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411671; a=rsa-sha256; cv=none; b=gf8iSKx81LJ2LQM7pSUYBFahVADSNWi53zOEAnN3R2zlVVnm2Uoi9tLuT/hfhAEVWrwl4y DTlWKrZCSsERCZzcc7tfgoQ3CwHCroa/S+HfGSBUjry+MFazlHmRC7RkLV3eyJFNSua8qX yYEe9nXfxZi/7+asE3/YiwMr0IJCH3mLmByq37O6DuEpnoTKQAZdI6eaJsXHJUJF4/IkKq m+nhY2hEnFcpok1r5hcmaP2mbxm0oXEe2snoedl99Y/rTkpoU8v8iVd8QN/tpHbsah4Vre PQm8nyBMNl6xZGMSPsYtecIjBt1DEUvPQsM2oUg5wACuARtSRi8Uo3dI16rD8w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t8SqNM5VTKgWrWx7hDcPsaWUIyFNwmTvMxMWcSMc0Ms=; b=CU89MAHaDu5BShSYxq66SWtmH7BtTtatgV/1lBVzKrse+1Xy0SEcCCVTX0Nq0duJI6A2WA U5s9wT1VIdgHSIysRIzXW26lzOESfU3Ub1uuh4ukB6fZtu3mu8OSQ4F60hMJqKVtV0DxgX cehux/Hg/I9aPz3Xyvwky3FpiCg3F1kOeuSue/oZC3+xQ5ULwF6LAueKSltm+FWJpA/Dof S2MNgNS3b+D4ZvWOSTyDlAqPfw+fPqQm4BRtWyRs8E9WWpBJRXWlTK3ohK63rhKepG1GMW 6HtyFBdc5FR0YurGZc9n2pujUUjlnCeYV+we4B9m+2oDk2pFtybXfpTgD0JhXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYM5zszzsYd; Wed, 31 Jul 2024 07:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46V7fBL9084761; Wed, 31 Jul 2024 07:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fBfO084758; Wed, 31 Jul 2024 07:41:11 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:11 GMT Message-Id: <202407310741.46V7fBfO084758@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: 3382c691dc6a - stable/14 - pf: allow MLD LR to be sent without state List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 3382c691dc6a0d4e1f39ff67b5507f6542972498 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3382c691dc6a0d4e1f39ff67b5507f6542972498 commit 3382c691dc6a0d4e1f39ff67b5507f6542972498 Author: Kristof Provost AuthorDate: 2024-07-10 12:36:18 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:53 +0000 pf: allow MLD LR to be sent without state Change PF behavior to allow MLD Listener Report packets to be sent without needing a previously created state by MLD Listener Query. It wasn't working because: (1) you might not have a previous MLD Listener Query and (2) the addresses of the Query and Report don't match. ok mikeb@, sashan@ MFC after: 1 day Obtained From: OpenBSD, rzalamena , 5c526dbdb0f2 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 1afe4da75d1d2acd33b25eea942af28aa41c82c2) --- sys/netpfil/pf/pf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 261a52a7c2f0..1fa60ce9d051 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1854,8 +1854,15 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, break; case MLD_LISTENER_QUERY: - *icmp_dir = PF_IN; case MLD_LISTENER_REPORT: { + /* + * Listener Report can be sent by clients + * without an associated Listener Query. + * In addition to that, when Report is sent as a + * reply to a Query its source and destination + * address are different. + */ + *icmp_dir = PF_IN; *virtual_type = MLD_LISTENER_QUERY; *virtual_id = 0; break; From nobody Wed Jul 31 07:41:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYkYP4hbCz5RPC3; Wed, 31 Jul 2024 07:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYkYP2rRtz4qgH; Wed, 31 Jul 2024 07:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73dKPLjIWIITkAdmzYi0F/jeuiUMH7o+dfejES2dCO4=; b=ppurHzJBKgaAKciAzzPMs7r0JUvlVOyauO2Fc6tTAqn05de/DqWIuU37aj71atK9BGwxEG /KYyPVSdWNSBHOhQ0cx+kgerWe6mD9kc/+bzLkwKs0H7qgfPEBVjRLtFIiG7YHFzMaotcq F1GnA/9IKcSeGC6ACMhA9G2i4PhYkZ5FtvwYZqB7ya+Bcw3+HBunA7+gzC2qGd3xSNyAfh Cpa9ev7kOOg/rM4TtESRSoxNg95Wqe87YT6YzsQlOZfJoxJLMRUwf9lmXYlyrEy34TBdUs iIZHYokVqGPgMVBJ2REvqHHCzBpgoQEL18NofHN5obwAtYb3i0uaNaKGnW0UFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722411673; a=rsa-sha256; cv=none; b=Zgpn+p6vG1ee2BqEBuF8aUSNYNcf2W9rLvYTco+qKg+bHPGSfUFXT3tkqUm/TpIJbgjWLs GYed4xrn1TXywknJyqTtOixYpXCJDmeX/0KoCF4HwVye+uvkAqeP8XwkaryIsm23ZpZK6/ UiaYMW7+r3BtpbqrZvjVJtK4Xi2hk8p1sqe0Lz9W9JQiHSK2DDfY6T6V1bwGBOhrBYUxP+ oNESrQbncjiaUR1ylkmtrwS2fLYW7xrONlXVZPDOBWoPCs4WbPnv7MCRs9s+vGOb9RaUhO 5lOFuPrPxB9F4DiPzudBXx0MlM02tsV91CmaTKVZhpEO3sfapTi6ifxZmz51VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722411673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=73dKPLjIWIITkAdmzYi0F/jeuiUMH7o+dfejES2dCO4=; b=H+K2/55bsrtxKikuqcGqsf+Je6dO29gg6blOb7wwcm1ss15GUwdw1J27SRK+vPCVi+2YgH p8MbgHzOnfrMnsiES94ZVAJbEvpQTLBDVxIw8OyCZuebIKFVmfIHH7YMklIMJko0zA5XLw uaFKDsShvCEv3pUzctUqNO3b3esrOCgDU5gWkrmmOryRKQ5tmabNPt33hpJFP1AD5Rl1Wj QfHwwGPwEqm5SeV3Qh5lqHqJZp/zFpwxLPtGQ7gV3IKvC7u2nEOxW2W9kHXcp4YbOIhckk MzKTMVwRvtVnaztD0iYn0U4t25qgRB2nlhGYMjwkTSGGtkq3f4gwaE1oSce+9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYkYP2QJgzsQ8; Wed, 31 Jul 2024 07:41: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 46V7fDYt084929; Wed, 31 Jul 2024 07:41:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46V7fDJs084926; Wed, 31 Jul 2024 07:41:13 GMT (envelope-from git) Date: Wed, 31 Jul 2024 07:41:13 GMT Message-Id: <202407310741.46V7fDJs084926@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: 4ebd7fc30ab7 - stable/13 - pf tests: ensure we don't confuse different ICMP 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ebd7fc30ab779b87c055b0d54eabdd97a9fc730 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ebd7fc30ab779b87c055b0d54eabdd97a9fc730 commit 4ebd7fc30ab779b87c055b0d54eabdd97a9fc730 Author: Kristof Provost AuthorDate: 2024-07-09 09:22:18 +0000 Commit: Kristof Provost CommitDate: 2024-07-31 07:39:35 +0000 pf tests: ensure we don't confuse different ICMP types When creating a state for ICMP (v4 or v6) packets we only used the ID, which means that we could confuse different ICMP types. For example, if we allowed neighbour discovery but not ICMPv6 echo requests an ND packet could create a state that the echo request would match. Test that this is now fixed. Reported by: Enrico Bassetti MFC after: 1 day Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit b9f0dbc3d006e0b904ee4275d54459f4edd65bb8) --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/icmp6.sh | 89 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index ea0d5cb151a2..f033940b4564 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -12,6 +12,7 @@ ATF_TESTS_SH+= altq \ fragmentation \ get_state \ icmp \ + icmp6 \ killstate \ macro \ map_e \ diff --git a/tests/sys/netpfil/pf/icmp6.sh b/tests/sys/netpfil/pf/icmp6.sh new file mode 100644 index 000000000000..35d20c83cc4f --- /dev/null +++ b/tests/sys/netpfil/pf/icmp6.sh @@ -0,0 +1,89 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +common_dir=$(atf_get_srcdir)/../common + +atf_test_case "zero_id" "cleanup" +zero_id_head() +{ + atf_set descr 'Test ICMPv6 echo with ID 0 keep being blocked' + atf_set require.user root + atf_set require.progs scapy +} + +zero_id_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 2001:db8::1 + + jexec alcatraz pfctl -e + pft_set_rules alcatraz \ + "set block-policy drop" \ + "antispoof quick for { egress ${epair}b }" \ + "block all" \ + "pass out" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 135" \ + "pass in quick inet6 proto IPV6-ICMP icmp6-type 136" \ + "pass out quick inet6 proto IPV6 from self to any" + + # Now we can't ping + atf_check -s exit:2 -o ignore \ + ping -c 1 2001:db8::1 + + # Force neighbour discovery + ndp -d 2001:db8::1 + + # Verify that we don't confuse echo request with ID 0 for neighbour discovery + atf_check -s exit:1 -o ignore \ + ${common_dir}/pft_ping.py \ + --sendif ${epair}a \ + --to 2001:db8::1 \ + --replyif ${epair}a + + jexec alcatraz pfctl -ss -vv + jexec alcatraz pfctl -sr -vv +} + +zero_id_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "zero_id" +} From nobody Wed Jul 31 17:23:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYzTN52Zhz5SFZ1; Wed, 31 Jul 2024 17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYzTN4BSSz4HR1; Wed, 31 Jul 2024 17: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=1722446616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YdjjIQ6CyfdOKPzCQmsi35yLwx2D/DYQ6SnIw+Xqh/g=; b=xcnJVTRhOd2tWLhs1z0RK+iDCbIbEx/1EnmEEXVryyv1siXXc/GwnePupe7yVdFa6ywZ9f 5bO711RsEmhNqU116aHjDAb9YeSsO91htmb00fFrql5TyHZGznNpl51BRv9SrZhIr7RTFm bsOqQ6cBH8miPWJ5uWPcQs14VdthWuPt4vjAoe0UXUyi42MWQeeoRJsOhfwaSo40uZL1MN zhwD2MO3gJgf5mFMIb2J/LPjDGHr93PDO0KMp88o1bJmVd4HUQ/DxJ3pNVt2r54hoN8fPl rADwi4dReMbIKOBk6arkk1OwPUfxKZI50WAayAapmWgzR1Pm5puOPqy9Y2gASw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722446616; a=rsa-sha256; cv=none; b=mjxrcOwJc/ALJP1ynVtTwmHdRZFe0t2QunvtjPwMoZFQ8mX2Pkz0BmUP6vdoml1RCw/ML8 JHAXVB43xM35Z4eo256XHWv/ilZTQzYxKG7Yc3YL83CE5D7PRSqSNPc5NB3yA+gAEZTy4A oOQjqaO5xHxyU0ujs6Pp/9KD/iMlDpayZibN1w/zKH0G5fvSIpBvjZ1PbfS1TvTe1CaZbd WczIkrCXPKSLcySLoq8rKRmi9/KLlFMCcyPZyJtGN+pgj4y7Ko1DgMPwTfcauv1PxMb40C rL48EmOAhil5QxcZrcaWeI15a9F7KBi8ozaVtWzNbcmhKbntpFFcAVCHEZ7LkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722446616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YdjjIQ6CyfdOKPzCQmsi35yLwx2D/DYQ6SnIw+Xqh/g=; b=fvzfIHMbGQM624gTIb8RI4j4AsTV8JqxE2Bleunym+nCd2hb65scDkEa7tsCCu6Ntzj1KB 9oirv2djj7PTn1Ue7ClrfmZt+3k6P5Qz+pnRw1B6DXxe2lQ0lkVAnox6JH8ZgJFRX33eO3 lYZeAO6CWhuAvWmbFIMuWehq1/0dJReUDUzzGddSlJ4dF5VCVtV7XAdclMtGbuF5g9PXne 3sZFT2mlxWnxkPIa+j367uhSMuSh3+qPnJBakLChbSYFViJOcukhS6cki+639bf2mIbxjM jzZSkQvHJrE+5DU6WRXI2ov+zGhhYUl0b4jM0uZa9PPBj4FRNt+eoykJOnYH7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYzTN3p8Sz18mn; Wed, 31 Jul 2024 17: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 46VHNae8072753; Wed, 31 Jul 2024 17:23:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VHNauV072750; Wed, 31 Jul 2024 17:23:36 GMT (envelope-from git) Date: Wed, 31 Jul 2024 17:23:36 GMT Message-Id: <202407311723.46VHNauV072750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: bd774d7aa111 - stable/14 - libthr: Preresolve selected EABI symbols on arm. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd774d7aa1117f531b2894a6428aa2792f7bedc8 Auto-Submitted: auto-generated The branch stable/14 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=bd774d7aa1117f531b2894a6428aa2792f7bedc8 commit bd774d7aa1117f531b2894a6428aa2792f7bedc8 Author: Michal Meloun AuthorDate: 2024-07-24 15:11:27 +0000 Commit: Michal Meloun CommitDate: 2024-07-31 12:10:58 +0000 libthr: Preresolve selected EABI symbols on arm. Add the ability to pre-resolve architecture-specific EABI symbols and use it on arm for selected EABI functions. These functions can be called with rtld bind lock write-locked, so they should be resolved in forward. Reported by: Mark Millard , John F Carr Reviewed by: kib, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46104 (cherry picked from commit 5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0) --- lib/libthr/arch/aarch64/include/pthread_md.h | 5 +++ lib/libthr/arch/amd64/include/pthread_md.h | 5 +++ lib/libthr/arch/arm/Makefile.inc | 3 ++ lib/libthr/arch/arm/thr_rtld_arm.c | 67 ++++++++++++++++++++++++++++ lib/libthr/arch/i386/include/pthread_md.h | 5 +++ lib/libthr/arch/powerpc/include/pthread_md.h | 5 +++ lib/libthr/arch/riscv/include/pthread_md.h | 10 +++++ lib/libthr/thread/thr_private.h | 1 + lib/libthr/thread/thr_rtld.c | 3 ++ 9 files changed, 104 insertions(+) diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h index 75e6abf445ba..305abed55d3c 100644 --- a/lib/libthr/arch/aarch64/include/pthread_md.h +++ b/lib/libthr/arch/aarch64/include/pthread_md.h @@ -49,4 +49,9 @@ _get_curthread(void) return (_tcb_get()->tcb_thread); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h index fa0802e64ebb..5b1486b151c0 100644 --- a/lib/libthr/arch/amd64/include/pthread_md.h +++ b/lib/libthr/arch/amd64/include/pthread_md.h @@ -54,4 +54,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/arm/Makefile.inc b/lib/libthr/arch/arm/Makefile.inc new file mode 100644 index 000000000000..4e770cf6b90f --- /dev/null +++ b/lib/libthr/arch/arm/Makefile.inc @@ -0,0 +1,3 @@ +.PATH: ${.CURDIR}/arch/arm +SRCS+= \ + thr_rtld_arm.c diff --git a/lib/libthr/arch/arm/thr_rtld_arm.c b/lib/libthr/arch/arm/thr_rtld_arm.c new file mode 100644 index 000000000000..35f5fe56cfff --- /dev/null +++ b/lib/libthr/arch/arm/thr_rtld_arm.c @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Michal Meloun + * + * 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. + */ + +#include +#include + +#include "thr_private.h" + +int __aeabi_idiv(int , int ); +unsigned __aeabi_uidiv(unsigned, unsigned ); + +struct {int q; int r;} __aeabi_idivmod(int, int ); +struct {unsigned q; unsigned r;} __aeabi_uidivmod(unsigned, unsigned); + +struct {int64_t q; int64_t r;} __aeabi_ldivmod(int64_t, int64_t); +struct {uint64_t q; uint64_t r;} __aeabi_uldivmod(uint64_t, uint64_t); + +void __aeabi_memset(void *dest, size_t n, int c); +void __aeabi_memclr(void *dest, size_t n); +void __aeabi_memmove(void *dest, void *src, size_t n); +void __aeabi_memcpy(void *dest, void *src, size_t n); +void __aeabi_memcmp(void *dest, void *src, size_t n); + +void +_thr_resolve_machdep(void) +{ + char tmp[2]; + + __aeabi_idiv(1, 1); + __aeabi_uidiv(1, 1); + + __aeabi_idivmod(1, 1); + __aeabi_uidivmod(1, 1); + + __aeabi_ldivmod(1, 1); + __aeabi_uldivmod(1, 1); + + __aeabi_memset(tmp, 1, 0); + __aeabi_memclr(tmp, 1); + __aeabi_memmove(tmp, tmp + 1, 1); + __aeabi_memcpy(tmp, tmp + 1, 1); + __aeabi_memcmp(tmp, tmp + 1, 1); +} diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h index 2a396abe3824..cb9af559db32 100644 --- a/lib/libthr/arch/i386/include/pthread_md.h +++ b/lib/libthr/arch/i386/include/pthread_md.h @@ -54,4 +54,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h index 14f1703b5460..31fa9820b26a 100644 --- a/lib/libthr/arch/powerpc/include/pthread_md.h +++ b/lib/libthr/arch/powerpc/include/pthread_md.h @@ -51,4 +51,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/riscv/include/pthread_md.h b/lib/libthr/arch/riscv/include/pthread_md.h index 343f4cae8486..2f70aa5edf25 100644 --- a/lib/libthr/arch/riscv/include/pthread_md.h +++ b/lib/libthr/arch/riscv/include/pthread_md.h @@ -56,4 +56,14 @@ _get_curthread(void) return (NULL); } +static __inline void +_thr_resolve_machdep(void) +{ +} + +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index f89941f96c78..7b8a2d6569f9 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -1103,6 +1103,7 @@ int __Tthr_mutex_trylock(pthread_mutex_t *); bool __thr_get_main_stack_base(char **base); bool __thr_get_main_stack_lim(size_t *lim); int _Tthr_sigqueue(pthread_t pthread, int sig, const union sigval value); +void _thr_resolve_machdep(void); __END_DECLS __NULLABILITY_PRAGMA_POP diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 54560a2f7df2..55197a9c5461 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -276,6 +276,9 @@ _thr_rtld_init(void) _thr_signal_block_check_fast(); _thr_signal_block_setup(curthread); + /* resolve machine depended functions, if any */ + _thr_resolve_machdep(); + uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); From nobody Wed Jul 31 17:23:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYzTn6YWKz5SFwK; Wed, 31 Jul 2024 17:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYzTn64tbz4HfN; Wed, 31 Jul 2024 17:23:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722446637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0T1i624iOycStLi4ugA10txT//3sYQ4HNcRMpMMvSRI=; b=pheXCwI/Mpd+q1sODmnPTRl1i+0NAkM1dzvCSbSFbVwnD5O+oEHM9nOzagSMYXUMoWMaJA g7pe5V+FaOnbBBcIKet49NmRrYq1eGjxBXsx3NJeVrUfr3vKfafWhV3seYc03tJCL4QLex WoMaMhSSy/OXOesWbuxG3ZLM0XmL5//WhrBZsydm532k2epX2VB+cQuh0R4P3qK73Vm26n BnEpgCRwTNLu5zu0sP5B6ZNfI0/HQUntfpoOpEYkWqUTfFHmqeUh3VAc2dLANA0RdfO+zB xbcjUcIwr5osHW48TnMY0YpjL2WDy393n4IAShVgFx7PoclLxYZplpFffNVNxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722446637; a=rsa-sha256; cv=none; b=xtHSw11pUsUZlol0J6YvuU7XfVUNc9307xIwaAHhW/ovZMMAbfPbPkBth4JdFSiQFTF85g n/O3kuZO4oMb6omlH6o0jy4PJLLlTD/0XTyvpnVQK6hPIPbyZA4YaurJsPcuAdUuPxdEDB vbmxVe0Zuy+qoBPbQ+4Vsp6yW+h8aJBTzH8eulEBf1UD5rRG5eHhzDqHlE7LqP6aTVH0Va HcP946TGmmalhdleKe2wsh11c21cNCnmflpFTgO2qkRZtDe39OYU3d1eIoJuYkCti7kfh7 GRCmhqpqUFfxxjTHAlTJPO4hMr48oXysC69CepsYAhGGLZ9GXshJXOxJk0KKsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722446637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0T1i624iOycStLi4ugA10txT//3sYQ4HNcRMpMMvSRI=; b=MsM0W12kfyjoeSWI+Ye7i+CmpyNWuigHp+TtKeMDndRPhqJHGvXCaSsUpHLAWrJHQglje3 KrNydS+4i7AjziUtlkHXHHntlc7T+7vlPwrkew6tsLD08GFXiByZKx9TG0vCGVVcjCaZsZ Rw+SFGwPNfnPSultjoXh0/EOpRLBwQRGQOIPzhuq6kxTEw6+w97Lzut+2noQCE+hwpQ621 tG6XSFCrCoLfKsNp4SEJnMqSkzalYKnMKD6cgV7JHEfOODnM055D3zhXGNaASR1Csz3QCv NWAxIt1BK9K8oP5GMl4ksgCA/DFX4PfSDX3AHiZOP5L32y3X1TULXGCeL4dOjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYzTn5hXYz199h; Wed, 31 Jul 2024 17:23: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 46VHNveo072944; Wed, 31 Jul 2024 17:23:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VHNv2v072941; Wed, 31 Jul 2024 17:23:57 GMT (envelope-from git) Date: Wed, 31 Jul 2024 17:23:57 GMT Message-Id: <202407311723.46VHNv2v072941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 30863065e50d - stable/13 - libthr: Preresolve selected EABI symbols on arm. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 30863065e50de5ae8fcc09f0de8d375e7aa9f621 Auto-Submitted: auto-generated The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=30863065e50de5ae8fcc09f0de8d375e7aa9f621 commit 30863065e50de5ae8fcc09f0de8d375e7aa9f621 Author: Michal Meloun AuthorDate: 2024-07-24 15:11:27 +0000 Commit: Michal Meloun CommitDate: 2024-07-31 12:03:39 +0000 libthr: Preresolve selected EABI symbols on arm. Add the ability to pre-resolve architecture-specific EABI symbols and use it on arm for selected EABI functions. These functions can be called with rtld bind lock write-locked, so they should be resolved in forward. Reported by: Mark Millard , John F Carr Reviewed by: kib, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46104 (cherry picked from commit 5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0) --- lib/libthr/arch/aarch64/include/pthread_md.h | 5 +++ lib/libthr/arch/amd64/include/pthread_md.h | 5 +++ lib/libthr/arch/arm/Makefile.inc | 3 ++ lib/libthr/arch/arm/thr_rtld_arm.c | 67 ++++++++++++++++++++++++++++ lib/libthr/arch/i386/include/pthread_md.h | 5 +++ lib/libthr/arch/mips/include/pthread_md.h | 5 +++ lib/libthr/arch/powerpc/include/pthread_md.h | 5 +++ lib/libthr/arch/riscv/include/pthread_md.h | 5 +++ lib/libthr/thread/thr_private.h | 1 + lib/libthr/thread/thr_rtld.c | 3 ++ 10 files changed, 104 insertions(+) diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h index 75e6abf445ba..305abed55d3c 100644 --- a/lib/libthr/arch/aarch64/include/pthread_md.h +++ b/lib/libthr/arch/aarch64/include/pthread_md.h @@ -49,4 +49,9 @@ _get_curthread(void) return (_tcb_get()->tcb_thread); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h index fa0802e64ebb..5b1486b151c0 100644 --- a/lib/libthr/arch/amd64/include/pthread_md.h +++ b/lib/libthr/arch/amd64/include/pthread_md.h @@ -54,4 +54,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/arm/Makefile.inc b/lib/libthr/arch/arm/Makefile.inc new file mode 100644 index 000000000000..4e770cf6b90f --- /dev/null +++ b/lib/libthr/arch/arm/Makefile.inc @@ -0,0 +1,3 @@ +.PATH: ${.CURDIR}/arch/arm +SRCS+= \ + thr_rtld_arm.c diff --git a/lib/libthr/arch/arm/thr_rtld_arm.c b/lib/libthr/arch/arm/thr_rtld_arm.c new file mode 100644 index 000000000000..35f5fe56cfff --- /dev/null +++ b/lib/libthr/arch/arm/thr_rtld_arm.c @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Michal Meloun + * + * 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. + */ + +#include +#include + +#include "thr_private.h" + +int __aeabi_idiv(int , int ); +unsigned __aeabi_uidiv(unsigned, unsigned ); + +struct {int q; int r;} __aeabi_idivmod(int, int ); +struct {unsigned q; unsigned r;} __aeabi_uidivmod(unsigned, unsigned); + +struct {int64_t q; int64_t r;} __aeabi_ldivmod(int64_t, int64_t); +struct {uint64_t q; uint64_t r;} __aeabi_uldivmod(uint64_t, uint64_t); + +void __aeabi_memset(void *dest, size_t n, int c); +void __aeabi_memclr(void *dest, size_t n); +void __aeabi_memmove(void *dest, void *src, size_t n); +void __aeabi_memcpy(void *dest, void *src, size_t n); +void __aeabi_memcmp(void *dest, void *src, size_t n); + +void +_thr_resolve_machdep(void) +{ + char tmp[2]; + + __aeabi_idiv(1, 1); + __aeabi_uidiv(1, 1); + + __aeabi_idivmod(1, 1); + __aeabi_uidivmod(1, 1); + + __aeabi_ldivmod(1, 1); + __aeabi_uldivmod(1, 1); + + __aeabi_memset(tmp, 1, 0); + __aeabi_memclr(tmp, 1); + __aeabi_memmove(tmp, tmp + 1, 1); + __aeabi_memcpy(tmp, tmp + 1, 1); + __aeabi_memcmp(tmp, tmp + 1, 1); +} diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h index 2a396abe3824..cb9af559db32 100644 --- a/lib/libthr/arch/i386/include/pthread_md.h +++ b/lib/libthr/arch/i386/include/pthread_md.h @@ -54,4 +54,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/mips/include/pthread_md.h b/lib/libthr/arch/mips/include/pthread_md.h index 5ccf16cef1e5..b56f06606a8a 100644 --- a/lib/libthr/arch/mips/include/pthread_md.h +++ b/lib/libthr/arch/mips/include/pthread_md.h @@ -50,4 +50,9 @@ _get_curthread(void) return (NULL); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h index 14f1703b5460..31fa9820b26a 100644 --- a/lib/libthr/arch/powerpc/include/pthread_md.h +++ b/lib/libthr/arch/powerpc/include/pthread_md.h @@ -51,4 +51,9 @@ _get_curthread(void) #define HAS__UMTX_OP_ERR 1 +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/riscv/include/pthread_md.h b/lib/libthr/arch/riscv/include/pthread_md.h index 343f4cae8486..baddfe3ecb22 100644 --- a/lib/libthr/arch/riscv/include/pthread_md.h +++ b/lib/libthr/arch/riscv/include/pthread_md.h @@ -56,4 +56,9 @@ _get_curthread(void) return (NULL); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index e590fb0c1e7a..ec0c617a54c2 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -1102,6 +1102,7 @@ int __Tthr_mutex_lock(pthread_mutex_t *); int __Tthr_mutex_trylock(pthread_mutex_t *); bool __thr_get_main_stack_base(char **base); bool __thr_get_main_stack_lim(size_t *lim); +void _thr_resolve_machdep(void); __END_DECLS __NULLABILITY_PRAGMA_POP diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 3bc07638e6bf..49e20fdf5145 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -275,6 +275,9 @@ _thr_rtld_init(void) _thr_signal_block_check_fast(); _thr_signal_block_setup(curthread); + /* resolve machine depended functions, if any */ + _thr_resolve_machdep(); + uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); From nobody Wed Jul 31 17:23:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WYzTq13Kxz5SFrd; Wed, 31 Jul 2024 17:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WYzTp75Spz4Hrq; Wed, 31 Jul 2024 17:23:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722446639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXPHj7kyFLQUxuPWaHicnujiNjR4p9+l+yE6TxjFhOE=; b=jvNQKr3MaKmFy0V72EZCZi11hFYly4FnqHAtJbIDjBjxCDqxBTsEjrKTwhuTnATIacZdOW JrkQp6MpJ4XuUcN5+6CCqF9iUI1j2TnxKiUaqGXIF8yy1wOOtF2y9PKeUtM17VZibLDrsa yc1Gz7lelrQjTWp5+LIMTliNhj4oDN20NQ78tc+lYV5EQns5+hYZC9PLqb58kxvOEfhdib RwnjHQQQnxyLDoIzeYwZozOqoKu2QuACwR/TUYTtaNiZZtvOp0ToHCkvNgVjHNxGX89Chb pF1XwZBxDEOYbr4mwbO17xXPXAMJ1pfscSBgJ4+SNnsXiRmiGhV6JNyN37bmQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722446639; a=rsa-sha256; cv=none; b=te4XhoIGJeq0lDu2JjHsdyuYZoMj0PylFjeAE7ayzBcV42WLFQtrltVyJZyArItO1u4wQb 6/jBBnP2DkWItQjhn+H3Ao0scGEXM99q7j2mkIoyRxKa06oL7Rir6EWVdoOPLnpXzH/+k3 sH7iXRztDyu172YlikV7unzcKV2GVXQkbI73ZLnfKz5y7Ch++coSbzekx7W5TyEsROHOpI X+vJU/z5Rdsj6XNlBoSKdV6NHY32qp6iMJfPqnrcB1jSkSto2frx9VdoC1gtFdTTrKdoIb XQaHzjPg/b53gY6z+vlLIfaVMHaPwnua5mcivJEly63Nli+bxsrUvw1uMPuG1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722446639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tXPHj7kyFLQUxuPWaHicnujiNjR4p9+l+yE6TxjFhOE=; b=kpE3hA8J0zx3YrZ5CvtEOUQza6c7dfUM6D+t0TX7rJHUtYmu9vFHA10WYfvm2Hj4rg5JLz JkTfawRs8efMKXT46hNk5vkbNycR3dQDVgWNycOsqliI5TU1XqDHXWGiWlyoFvpMvkX4FQ AkjcJPTb+GSbd84jCnAg9fetDcD52WitLIWBlmTdxI6f3xlBlwoLoDOAIFWnlJyEgVnUEF 6fPVLJbZrA3nfC3jv51V9BUbLTd+9uEbcX9GLr0riemgZyvM6ucHm2jQV1d5L/pxEVeV0j 7wvT3hcINXjkfERM2O/dYEV+FY74oJpd5BWq6jVcPrGvNWAKeQugRd8525Y4OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WYzTp6jbfz199j; Wed, 31 Jul 2024 17:23: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 46VHNwgf073001; Wed, 31 Jul 2024 17:23:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VHNwv7072998; Wed, 31 Jul 2024 17:23:58 GMT (envelope-from git) Date: Wed, 31 Jul 2024 17:23:58 GMT Message-Id: <202407311723.46VHNwv7072998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 8ca43e674e3c - stable/13 - gdtoa: Regenerate configuration headers for 32-bit arm. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8ca43e674e3cddf3574e062abde6cd70c120984e Auto-Submitted: auto-generated The branch stable/13 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca43e674e3cddf3574e062abde6cd70c120984e commit 8ca43e674e3cddf3574e062abde6cd70c120984e Author: Michal Meloun AuthorDate: 2023-08-13 05:51:56 +0000 Commit: Michal Meloun CommitDate: 2024-07-31 12:25:35 +0000 gdtoa: Regenerate configuration headers for 32-bit arm. These configuration headers were only guessed, but unfortunately not exactly correctly. Therefore, re-generate them on real HW. Generated on CA15, verified on CA9, CA7(with VFP lite) and on 32-bit ARMv9. PR: 272229 Reported by: Robert Clausecker MFC after: 2 weeks (cherry picked from commit e59b6e48f4c8bbfee43a1bc6d9fd47691d3bd603) --- lib/libc/arm/arith.h | 10 ++++++---- lib/libc/arm/gd_qnan.h | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/libc/arm/arith.h b/lib/libc/arm/arith.h index f0e28d253bf2..36e241f05356 100644 --- a/lib/libc/arm/arith.h +++ b/lib/libc/arm/arith.h @@ -1,19 +1,21 @@ /* * MD header for contrib/gdtoa - */ - -/* + * * NOTE: The definitions in this file must be correct or strtod(3) and * floating point formats in printf(3) will break! The file can be * generated by running contrib/gdtoa/arithchk.c on the target * architecture. See contrib/gdtoa/gdtoaimp.h for details. + * + * Generated on CA15, verified on CA9, CA7(with VFP lite) and on 32-bit ARMv9. + * */ #if !defined(__ARMEB__) && (defined(__VFP_FP__) || defined(__ARM_EABI__)) #define IEEE_8087 #define Arith_Kind_ASL 1 -#define Sudden_Underflow #else #define IEEE_MC68k #define Arith_Kind_ASL 2 #endif + +#define Double_Align diff --git a/lib/libc/arm/gd_qnan.h b/lib/libc/arm/gd_qnan.h index e5c4846e026f..acf13d0b7852 100644 --- a/lib/libc/arm/gd_qnan.h +++ b/lib/libc/arm/gd_qnan.h @@ -4,18 +4,19 @@ * This file can be generated by compiling and running contrib/gdtoa/qnan.c * on the target architecture after arith.h has been generated. * - * XXX I don't have ARM hardware, so I just guessed. --das + * Generated on CA15, verified on CA9, CA7(with VFP lite) and on 32-bit ARMv9. + * */ #define f_QNAN 0x7fc00000 #define d_QNAN0 0x0 #define d_QNAN1 0x7ff80000 #define ld_QNAN0 0x0 -#define ld_QNAN1 0xc0000000 -#define ld_QNAN2 0x7fff +#define ld_QNAN1 0x7ff80000 +#define ld_QNAN2 0x0 #define ld_QNAN3 0x0 #define ldus_QNAN0 0x0 #define ldus_QNAN1 0x0 #define ldus_QNAN2 0x0 -#define ldus_QNAN3 0xc000 -#define ldus_QNAN4 0x7fff +#define ldus_QNAN3 0x7ff8 +#define ldus_QNAN4 0x0 From nobody Wed Jul 31 18:27:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZ0vR2rYjz5SLPW; Wed, 31 Jul 2024 18:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZ0vR2FQ4z4Ndd; Wed, 31 Jul 2024 18:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722450467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1rSxKuQKFq/PKMGNThZ0QAukq9XA2EqUNy4HemsLhk=; b=xYo5xV+AsQV4hOIGgClivGqxcrfcEyNxFUNHUcVQogHH4HvqQImgE4SN4oVrEw5GR77xhL nALj6t6+9k7G99C531cXbBaHCHm69aMQbUoZXa/X6T6uG0xCTSWo0Y+P91erh1aEkgWPWR p+PMWCaggzKwWi5EFtBjfE7E7X2JoCEhojAYAe9aIcLL26AWWOcGaKljcF2kfT+ZDc4hOI lnPkdFUYNLt72CZZse1CNLrZDK8gX/b1ddZEh6zPa63gqoORLk/K9EKVmoHXGac8lkQzrV nAsgOOgvSBMhKy0AJNRuP36/8QmS2+Z+GCEh7ElxqPel8UU+x7jov8JdPdcH2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722450467; a=rsa-sha256; cv=none; b=dac0vleGGAOSGVP8P8pk6+V1aU1CX8UugXwrZesA0vcqRrut4hjLA2KNcb9zHIsKorRdPi sZiw82O9XCvWTh+ghFWeMDxGHKReX5ky0sWlzEM6OzELaNhX7b/brxS+0eOHyLV+ijty+9 aj6Hm4s7lp7kq922uijCZYLxfT0MLuURLba6w091NH4Stfg8+mrMoGsUd+eDwOJbELPMEf Zy6Hbuy7No6BFhHQu3Y9iVWC7IuSBuHN+fBJ0GmwW7cJB+srSvXCF5y98ZdKdTbkl+cJjY RWAjPNJpfsXTI1AVmEpduHCWTkowQc+dezz0fpxrUXjLPmj4aUPKlRo70Z4WvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722450467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1rSxKuQKFq/PKMGNThZ0QAukq9XA2EqUNy4HemsLhk=; b=auQO15pzUBBag3GkL6Blgct0SZ70oPeZqv5sYn0hR+30Ef0eYuC/iZQjNkm+NSp5M+mgEO dqhPXhXcQXLdrSSIy7mGO2R3AlB4rCOTZR4D86DAveGIiUXleIS1ME6X08w6YFaOt5BiPR UF1avNujnAHMTEfZgsQf5yZ+c1E2zpxKu+M8+sQ92UYJ8sr4MQ3yXvCw9iiD8KJU4YU9HN nMScxXE0VH/lm0a5dMjzo26wySJZcGc9O5308vq6g7BPLGvE0HvulOvFOnYfVanUjgWHvC QWAfV7nGBwPaNAvFQXi0nqq8Wdzt5lwQaClHw+YzkkUd53sqUCe27PYs36mOyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZ0vR1rnGz19PY; Wed, 31 Jul 2024 18:27: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 46VIRl0n075003; Wed, 31 Jul 2024 18:27:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VIRlZo075000; Wed, 31 Jul 2024 18:27:47 GMT (envelope-from git) Date: Wed, 31 Jul 2024 18:27:47 GMT Message-Id: <202407311827.46VIRlZo075000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: fb084dd01e25 - stable/14 - Fix mismerge in lib/libthr/arch/riscv/include/pthread_md.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: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb084dd01e25b7fa743e55dac40a0af29b6ea14d Auto-Submitted: auto-generated The branch stable/14 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=fb084dd01e25b7fa743e55dac40a0af29b6ea14d commit fb084dd01e25b7fa743e55dac40a0af29b6ea14d Author: Michal Meloun AuthorDate: 2024-07-31 18:19:38 +0000 Commit: Michal Meloun CommitDate: 2024-07-31 18:27:05 +0000 Fix mismerge in lib/libthr/arch/riscv/include/pthread_md.h Fixes: bd774d7aa1117f531b2894a6428aa2792f7bedc8 --- lib/libthr/arch/riscv/include/pthread_md.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/libthr/arch/riscv/include/pthread_md.h b/lib/libthr/arch/riscv/include/pthread_md.h index 2f70aa5edf25..baddfe3ecb22 100644 --- a/lib/libthr/arch/riscv/include/pthread_md.h +++ b/lib/libthr/arch/riscv/include/pthread_md.h @@ -61,9 +61,4 @@ _thr_resolve_machdep(void) { } -static __inline void -_thr_resolve_machdep(void) -{ -} - #endif /* _PTHREAD_MD_H_ */ From nobody Wed Jul 31 19:02:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZ1gc4bJKz5R8qn; Wed, 31 Jul 2024 19:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZ1gc3k1Jz4RhN; Wed, 31 Jul 2024 19:02:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722452556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YkWIU5IZBnSCqXh0i0f2gtmoJz5U/0p3OHS2XMsYAW4=; b=CVSCu+pAlFXx4WUgS2i+T2nyxqDkaBWKUWUrhXi4Wkr/yb+T5en25RVRzkm8ex3h0973RO CmLfwB0BK0BuZQtlx+yWTsYqTCfqN1PysJz/zmlPuVK6yJpg2g/LBA6tL92fugfnbM+bmu OGMpHXY7S6nNif90Aarpx4G2akOw7uxgSw1DGXB08pzEuPBTKCG8P0U1CqBaAXiuYowEzp e8Taaaz7bIjg/9XAOXabm/AgOuCvI1b8Df4Un3M3+LUZHce+PA+fjwH//Dm45eHWNQUJ4H TNoq3ZUApAuVqQ4dR8jMx3PccSph5msmUunC6F9gUqRDhgOHmTwUcV2fiCMU8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722452556; a=rsa-sha256; cv=none; b=hLho25wEH+eHokd3YWuJwy7Ds3Lag56S3ih0//T4hs5ysJI8qeWDudNShtiB5zMqYikaly wrgg7oQUZXbpp+K883LB1NWI5UoH3vPnrlQ2HrQ8IzFtGa32IPaAMuCUuGN3n73fhyRnQ7 W+XMkgevYdEglH7CQRLCogpZFQk/dwoY5lwOybb/wppkGNjQ3OpTJn9eSeg+BYt7OFw9Tj QK3SsuXYyu/pWoSPqFeY50CQ/un2xMnM9/LbrQDNJVx9Jgw+FyZuZkJjoGYHHQmlL2vU20 q74Qdc3KhzJQu7Pi2YCXL0cOT3syAGJZkssQnN6iHqeNECM/ZIPmenGHbmUtTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722452556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YkWIU5IZBnSCqXh0i0f2gtmoJz5U/0p3OHS2XMsYAW4=; b=TXJmVN4zxe2t3MVRfMxaLS7DzhhU1BuiOgsQE/3XIOX9sCmXU9feYFtfZCXCTqNhCLbFX3 4WdNOnpEhB9L0677573q67UF0pgJgU2JfzTZpMkJ2kD3qWD31rVUCub6mahTN7yKu8Dav3 swN1fn2owD2OU9wYVM/dt6HhAndRxbSqgk2IQMTFLpNoefFpy68/rJrU54PlocNnTZKjeR +BiqFTSajGj0pZZ0XA9xJWm3R1v0tQjkZFh3drImeHMkcLZiVjHrt7Sy9WF5izl8zw6J39 zGo9f1VhfNFTjm404holqyJV7dwPCmYWq650dov3CgWRp8LTdL02Qz0PEmHKhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZ1gc3Jxvz1CSH; Wed, 31 Jul 2024 19:02: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 46VJ2avf042011; Wed, 31 Jul 2024 19:02:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46VJ2avF042008; Wed, 31 Jul 2024 19:02:36 GMT (envelope-from git) Date: Wed, 31 Jul 2024 19:02:36 GMT Message-Id: <202407311902.46VJ2avF042008@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: b72e57d6c941 - stable/13 - rtld: Define MD_OBJ_ENTRY for mips List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b72e57d6c9414005ed991c6cccb1aed24e4718aa Auto-Submitted: auto-generated The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=b72e57d6c9414005ed991c6cccb1aed24e4718aa commit b72e57d6c9414005ed991c6cccb1aed24e4718aa Author: Jessica Clarke AuthorDate: 2024-07-31 18:59:43 +0000 Commit: Jessica Clarke CommitDate: 2024-07-31 18:59:43 +0000 rtld: Define MD_OBJ_ENTRY for mips This is a direct commit to stable/13. Reported by: mmel Fixes: f9210d37c5c6 ("rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry") --- libexec/rtld-elf/mips/rtld_machdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rtld-elf/mips/rtld_machdep.h b/libexec/rtld-elf/mips/rtld_machdep.h index 84e1a1093058..0031b685c15d 100644 --- a/libexec/rtld-elf/mips/rtld_machdep.h +++ b/libexec/rtld-elf/mips/rtld_machdep.h @@ -35,6 +35,8 @@ struct Struct_Obj_Entry; +#define MD_OBJ_ENTRY + /* Return the address of the .dynamic section in the dynamic linker. */ #define rtld_dynamic(obj) (&_DYNAMIC) From nobody Thu Aug 1 09:27:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZNsG6sFgz5SSPb; Thu, 01 Aug 2024 09:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZNsG5yh5z4hZ3; Thu, 1 Aug 2024 09:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722504434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HM+JZ1srluMJdAblhXqK3bq7ce9BHi5Rl1HSUU35BZ4=; b=RDPlgafIP4GpUmCNmFAPM8oi06m0/9L+7FCMaKMfGtsUhzwkslhbbL/aE8Pk678CmRLJXR B8E6ZOFp1mYVgghYBmR3wgSfmeiYIJ6QxvkfK1gOi8tH1jAsO7tXR84Ft4CQzAhbiIy4o7 bPIoI7of7DWqSZOG39xsjoMd7CcR3EyTfR6rvjcVHiDifbtFszUyvYPB4NteEEYJbJa9vr EN0PlHxfkLARGOOjSWhQI/ALQPGLcdyt/aNsocJ4RjCh4RfrlC7X6uUenWsia9HsHo2a1F aGAOUtiLWu7td9sA04hUIkqjw4szztQkOxe4FwR3+v7HQMb1M8c8iQTmBsPLlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722504434; a=rsa-sha256; cv=none; b=rDwJ89D0ImQaEwMHKMP5fLNatHJwIdI4h7qLS6BmXGVHNX3uT3v/WS/6tNkjYFyx8nfhno p8zkPvondjIY5oh1fHMfwldhjO18wbqwSVkh2qSvn/1R8zaC6ewrSsnhL2zwYcimP2Hyn9 A11F7MmvXrxDlagQ1UQm3eLOx1oDUgFsZgXdwAc139GB3Ff2lgqOJFItsoEGg64EPR+BF0 BvQxgoGveOUSI5y/PFPgtHVRmdPq/5jL9UetYqT22AtQ0TX33O9q+3Kf3lTlbEwkw+pJgk O+BB7nOs2k7NSY8KzW4iCE5jiThV+yPxnqhbr75I1rX0c5DzSqXGPHBGxtnOBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722504434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HM+JZ1srluMJdAblhXqK3bq7ce9BHi5Rl1HSUU35BZ4=; b=KiaafAgu+8TeXC43JgPgmTm9gvVaW3utjygtvp2xHhPTdvz24BDbLUAzvubo+XreVPr/C6 nxlT7qP9M7NvyZkLH09avE+sztDekDuPeGOHVGHCkS4zJGYfNsxDlfOKr4L51G+wkc3l/u L9stF1JOvFOgzf1xjWBbkcMTQ2+JWEUIZ8M6LzrnjQoIsqpYSXluyY7joUACQEnpc2Qlux RGl9YVB5/ssXKKg5Lr5XdS/f/k9Mpi+Gqz9V1jYhIq9w8xYR5Yl458OYf7hzMolZ1GYt2f wO4CKVinsG/PizsYxmsYJQaAj2Rn/3pxxZ7Hmyc6EIYgCYBdt0ErRVtj5sZhhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZNsG5ZKwzftN; Thu, 1 Aug 2024 09:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4719REXh098243; Thu, 1 Aug 2024 09:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4719REj9098240; Thu, 1 Aug 2024 09:27:14 GMT (envelope-from git) Date: Thu, 1 Aug 2024 09:27:14 GMT Message-Id: <202408010927.4719REj9098240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michal Meloun Subject: git: 72a1920e73d1 - stable/14 - arm: Add evdev to the TEGRA124 config List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72a1920e73d11bd73b85e8e13caa1d838f9dbd91 Auto-Submitted: auto-generated The branch stable/14 has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=72a1920e73d11bd73b85e8e13caa1d838f9dbd91 commit 72a1920e73d11bd73b85e8e13caa1d838f9dbd91 Author: Mark Johnston AuthorDate: 2024-07-11 19:19:42 +0000 Commit: Michal Meloun CommitDate: 2024-08-01 08:06:08 +0000 arm: Add evdev to the TEGRA124 config This is required for the kernel to link after commit 13d00a43cba4. Fixes: 13d00a43cba4 ("conf: Add usbhid and hidbus to GENERIC* kernel configs") (cherry picked from commit d68d124817780db5f98f65ae02a7ce286cd426eb) --- sys/arm/conf/TEGRA124 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index 16cb5f95d26f..b1c5be8af587 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -129,6 +129,11 @@ device drm2 #device sound #device snd_hda +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev + # HID support device hid # Generic HID support device hidbus # Generic HID Bus From nobody Thu Aug 1 14:47:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZWyX0rQdz5SswD; Thu, 01 Aug 2024 14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZWyX0LHZz4HQc; Thu, 1 Aug 2024 14: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=1722523636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HTCEcOZvw4mqPDYom5BdiBEADxh8JmYWY/gvI/Kl+wk=; b=Tz0pUw8e1CLHFtsAJvym7TFbuLsYsXFTeno/wVbwc1xFirdpFtb7XMjraF0IhnNLMgoi34 U0Im/m/JPvyBdLIfaSfRk3eWXFLnbus6T2ejX3NSIyC+9Fn5Gtxx/s03rIcZ1ZHeuf6YDM fa0sPirnm6m0owZAuVfDo6Bu1nt15BZ31h+72ITjSmFme7vIAbAi6bUtvHdB1Chs+5yqnv 1l4WA2OH+vppwRlx3Fxlu07AXYFxge6elueyrntN83eUoGKVYxUiITO9DFeA+Xei9l5Js7 CG+aSDFAWLEAJLZSJE3h80qbxixX6AAK5iNoIkaYC0tURFQuasCAfsmmh/d7vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523636; a=rsa-sha256; cv=none; b=l057Dd7DplQ/QFsUoGs8KSr55S8rrMV9c6kuUJ4WteMtCJqoUeNhkW0NQ6yMkZ5eR1JY+/ QPuonXEOwAt3+uXpO1ndnoyP3vJtJ+nSuSm5Vw/UM9JRaybZQWKkX6aIqgF7HmnMGNOAsy UliUB5wE1cUTP9BgEU8Y37XHRZqFKojA3WmSxt6AkEHEv07ZfTLlwmH4WQ3r6jLH9gDxLG NznGYfT9bChGQXBUWLcH++bqRhrf+4u1s9FaQjzKtM7WK5NxrOF50UVfEYpivl16c6bsGU jNcUsYJqFSU9G121DHnSSccbQ53BL09ZrDLb/1brOmjq+Ci7swxn43x8iekqTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HTCEcOZvw4mqPDYom5BdiBEADxh8JmYWY/gvI/Kl+wk=; b=sQE9+yZ+NYT9133ZIkrsjaIV6wdZFznj6B1LKLae2jQTy7ifvai6LWP1W96ODPtxGH/MCM tT2TIMJO5vCT5bUnrDMdpoiU0snrmJ95h+7Hbt0UlJP4vbWPKi/tpQCvWr5xaKIZMUNpn8 ZZKEug+w4463zrqevjz2IykRvTW8AoP+/po9+3d62Y6RsmUKmlXpbXAuxyWauZ2GgAW8DA EpW+WxQzJZH4g9tgcHZqRRBm0Aw1yZhflNGqoYRyBKpZdpfqU22a+QGi7y7nM9RRi79nSA I20EVflXoUAm+85e3BneoE3r/iAzfk48Zcud/8DjweRmk0GzQHPav0sb91bU9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZWyW73QZznc1; Thu, 1 Aug 2024 14:47: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 471ElFvT039928; Thu, 1 Aug 2024 14: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 471ElFkS039925; Thu, 1 Aug 2024 14:47:15 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:47:15 GMT Message-Id: <202408011447.471ElFkS039925@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: f8c73ba5981c - stable/14 - mitigations.7: mention supervisor mode memory access protections List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f8c73ba5981c6d66384d5c173b650906b9741ae8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f8c73ba5981c6d66384d5c173b650906b9741ae8 commit f8c73ba5981c6d66384d5c173b650906b9741ae8 Author: Ed Maste AuthorDate: 2024-05-31 14:13:11 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:46:46 +0000 mitigations.7: mention supervisor mode memory access protections Reviewed by: imp (earlier), olce (earlier), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45420 (cherry picked from commit 72ece341b42707af7837357dbb1f2c2fe17507fa) --- share/man/man7/mitigations.7 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index 950d84042c71..f68e3041c88f 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 6, 2023 +.Dd May 31, 2024 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -234,8 +234,26 @@ and it is possible that some applications may not function correctly. .\" .\".Ss Stack Smashing Protection (SSP) .\" -.\".Ss Supervisor mode memory protection -.\" +.Ss Supervisor mode memory protection +Certain processors include features that prevent unintended access to memory +pages accessible to userspace (non-privileged) code, while in a privileged +mode. +One feature prevents execution, intended to mitigate exploitation of kernel +vulnerabilities from userland. +Another feature prevents unintended reads from or writes to user space memory +from the kernel. +This also provides effective protection against NULL pointer dereferences from +kernel. +.Bl -column -offset indent "Architecture" "Feature" "Access Type Prevented" +.It Sy Architecture Ta Sy Feature Ta Sy Access Type Prevented +.It amd64 Ta SMAP Ta Read / Write +.It amd64 Ta SMEP Ta Execute +.It arm64 Ta PAN Ta Read / Write +.It arm64 Ta PXN Ta Execute +.El +.Pp +These features are automatically used by the kernel. +There is no user-facing configuration. .Ss Hardware vulnerability controls See .Xr security 7 From nobody Thu Aug 1 14:47:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZWyY24ykz5Ssqt; Thu, 01 Aug 2024 14:47:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZWyY1f2Yz4HLM; Thu, 1 Aug 2024 14:47:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YfrEBTl6RFAk6HkJpDVLyDSTeUtgV0BHT0m1WK0OvPk=; b=m23/UOSECY+nNJhKU4WDIZcrlOQTm0zvA5YJinCboC1rH9gfrivRjMBjMX+mpPR0hrL6kC 0Ro7PFypxLDdHLtUkqZSjqGGyP1GQ9XHvRsopvDKLShzHAchPGdQTyDOm9mZ8sk39hUBjP T/x9gSaHDtPvy+Mm3nGXEKCjIq2zuCzhJ6zQFyAExZ0nCxALb6RYUTQ6DTfI7QcBUk9J6h Aw38HB7Ck4h6VUypS3TivR9MxhHpVMvRJVYHVSeykWwXFJOvm/acFD+gYqMJIY4FGCCDN/ Oyo2o85etzZx6hpRykwLNF3tG0L5DgPn4k8Bj7ZkDlMWWvlRpyyDTXTcjgqrKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523637; a=rsa-sha256; cv=none; b=LHY5BJFRRn0ULpMZ8UfAsEWVfDQ5738sr8MaCFGEvDYYPFFhIS6jOA7KS5jM0gCyHJ09fk YhCp5UbzmPQkMNL3kTy3mvYQnxJrUcPKiIXUUva8KatjR4i/cffordyWNZ15xn3eEBPbtz POuTS3jw2AVwgXy97ilLmpt6ZguVPW1OF65DBkZKIW+u8FPN1PIp7g5h+4mVQ/8yjOkAYB 30ad4vDNuLGWgL051D592ss/7kDPppvupbD9Tj+vpG5Id7k3wIDGXrGEZoYqF88AePomFx sEyrifiO0WMycbzMPRgnqSk01ZRydpbLmv+vqOVHt11Jq5dJS7BRgbJjHfCpHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YfrEBTl6RFAk6HkJpDVLyDSTeUtgV0BHT0m1WK0OvPk=; b=ZZ0vE1dBrYEWvvGHynCeT1VI9VbI9lckBP0vK3dwzaAd0gPq/x4eV7dzFC/GP9QtHufBE4 plV4MDnTtth9vcTrn/Cr4ZYTjKbS4UcRR6fMvNQrbowsMgfd5uT2KkKhnbvKWYHLlFhts5 8351BHngIQhT5dyZNPEPiyXcl/lqRnGLg5F+KIRKM/SiY1Y61E4lRipeFqUHmMfbVJWa9w hMDJgN1XzSwLHl1qidieQHA9122Zr8//Fx+I8V69+XdlQ+y8KqdsC0+nbokzMznz9KJelX B2bRxfrfR8vk0CbJcAXrY4ccMoo1WIpWpLB1h4VyliHV7/4BaUm2NHcKVthehg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZWyY1Brqzpr6; Thu, 1 Aug 2024 14:47: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 471ElH6Z039978; Thu, 1 Aug 2024 14:47:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471ElHca039975; Thu, 1 Aug 2024 14:47:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:47:17 GMT Message-Id: <202408011447.471ElHca039975@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: 6f303355dca2 - stable/14 - mitigations.7: uncomment reference to recently added section List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 6f303355dca2a5619f0bcaa3b08621a06e0b1ba7 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=6f303355dca2a5619f0bcaa3b08621a06e0b1ba7 commit 6f303355dca2a5619f0bcaa3b08621a06e0b1ba7 Author: Ed Maste AuthorDate: 2024-06-01 11:52:31 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:46:46 +0000 mitigations.7: uncomment reference to recently added section A brief description of supervisor mode memory access protection was added in 72ece341b427. Uncomment the existing reference to this section in the table of contents. Fixes: 72ece341b427 ("mitigations.7: mention supervisor mode memory...") Sponsored by: The FreeBSD Foundation (cherry picked from commit 166ec3e86aa4a48bdf2a56ee065f0173bbb8f745) --- share/man/man7/mitigations.7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index f68e3041c88f..db1b3244862b 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -56,8 +56,8 @@ Relocation Read-Only (RELRO) Bind Now .\".It .\"Stack Smashing Protection (SSP) -.\".It -.\"Supervisor Mode Memory Protection +.It +Supervisor Mode Memory Protection .It Hardware Vulnerability Mitigation Controls .It From nobody Thu Aug 1 14:47:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZWyZ5sfkz5SswJ; Thu, 01 Aug 2024 14:47:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZWyZ2Ww1z4H97; Thu, 1 Aug 2024 14:47:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UFQVIKFlMHbF8M15SGh0gpf1x0CvWpod1SnqqUvWszM=; b=ikauYvceQvCoyQboehBgzq55R8RI5JagL+AD4Zb7siMtHMX1rbFcuHwaOnMkgfTOG3AQ/8 6bzkaUZzK3EbF3QAUNXh2UgT9CtsBP/Nv1IjrWoZMWgQmvNivN3RLr2V9HsTtqIEEk69Lg wcnIsAIHV8mI5scdkY5XmQIE4f6q+YfOEeRKri7mMndQB34PZLwpKc9XIR+BwRLlaCUi+u DmjfL1UaljFkEdy7a7Zip9v51hmNp83WUIqHLa1Hd4aelzeDOVBHoFJIWMLqDoV+1Wsfya icRwybayl4EO9OqLn/YcCYBLooJrb72HAE8mgSx1s5kOn/Rckb9gGkzFa3l1fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523638; a=rsa-sha256; cv=none; b=R0jVOXzp+pYASDKbF2i0ZSaAZQQazDYomDFmv7IyeL8Qy0cW15M7MmLSUymqlzdvaVU1Al y4DsU2DZxGVoEPKnRrq7mlDN1zEUne8JN+mCToSKVQW3XAM5hcECvqw5oEtjzY8gGMRYiC ZaGNG0ClVUAJIpZAnfU2cs0Mw/Ap5FWkZNmTlLVCTqZnIquusbukrr0boGb0Pn5ZwQh+JS OMJ2IQ/nlKAZS/PcuqGyrWXt59b3+mV9hNj3MSj3D+UOlswYtQb0qP24MNsUeM4qgTeopO EounMZqs+slbbQy7w3pgRRyEVsbT1uUoElKH7qq7H0CbtGYnf9Yssp+jOsgeZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UFQVIKFlMHbF8M15SGh0gpf1x0CvWpod1SnqqUvWszM=; b=WS8yz4S7fltI1oAzvZgP88WekvJUi6kuhKmpBhdB4kHNgZt9kFt9mR7MnQjdNJT5bU0GjV qN74C6uuzItMHeydiwybYgxqcBj+8MoPO9A2kWw+xPZMHPlw+c2Nl6gFqyHE1K8FmQTrzl Zho7MVcXOXx3UC0frzMRHnypCn+HkT9RaXYXYI5iGXcBdn2bsYyos30+tB34sFYR5z39pH Z+LCWOwW+L6aOmYZurUlHJc+2OlPbwYE5nwgdglINl8cK8C0ZBD4LkO/uK4d7vYTJJ3CSl shmNq03p+m6sRPrUzIdkWuhbqnhlbway6+8286nTrALapfe9AjbTko56ZlAckQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZWyZ1wspzppN; Thu, 1 Aug 2024 14:47: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 471ElI8D040031; Thu, 1 Aug 2024 14:47:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471ElIKB040026; Thu, 1 Aug 2024 14:47:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:47:18 GMT Message-Id: <202408011447.471ElIKB040026@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: 8b5df7e36afb - stable/14 - mitigations.7: move SSP documentation from security.7 to here List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 8b5df7e36afb64617a0ff9e3692207537472a262 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8b5df7e36afb64617a0ff9e3692207537472a262 commit 8b5df7e36afb64617a0ff9e3692207537472a262 Author: Ed Maste AuthorDate: 2024-06-01 12:07:38 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:46:46 +0000 mitigations.7: move SSP documentation from security.7 to here Stack Smashing Protection (SSP) is a software vulnerability mitigation, and fits with this page. Add a note to the beginning of security.7 providing a more explicit cross reference to mitigations.7. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45435 (cherry picked from commit 297bb39b6f0fcfc5d571dc77008eb7acf138d279) --- share/man/man7/mitigations.7 | 82 +++++++++++++++++++++++++++++++++++++++++--- share/man/man7/security.7 | 10 +++++- 2 files changed, 87 insertions(+), 5 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index db1b3244862b..4beaa4c9f46c 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 31, 2024 +.Dd June 1, 2024 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -54,8 +54,8 @@ Write XOR Execute page protection policy Relocation Read-Only (RELRO) .It Bind Now -.\".It -.\"Stack Smashing Protection (SSP) +.It +Stack Overflow Protection .It Supervisor Mode Memory Protection .It @@ -232,7 +232,81 @@ preventing attacks on the relocation table. Note that this results in a nonstandard Application Binary Interface (ABI), and it is possible that some applications may not function correctly. .\" -.\".Ss Stack Smashing Protection (SSP) +.Ss Stack Overflow Protection +.Fx +supports stack overflow protection using the Stack Smashing Protector +.Pq SSP +compiler feature. +In userland, SSP adds a per-process randomized canary at the end of every stack +frame which is checked for corruption upon return from the function. +In the kernel, a single randomized canary is used globally except on aarch64, +which has a +.Dv PERTHREAD_SSP +.Xr config 8 +option to enable per-thread randomized canaries. +If stack corruption is detected, then the process aborts to avoid potentially +malicious execution as a result of the corruption. +SSP may be enabled or disabled when building +.Fx +base with the +.Xr src.conf 5 +SSP knob. +.Pp +When +.Va WITH_SSP +is enabled, which is the default, world is built with the +.Fl fstack-protector-strong +compiler option. +The kernel is built with the +.Fl fstack-protector +option. +.Pp +In addition to SSP, a +.Dq FORTIFY_SOURCE +implementation is supported up to level 2 by defining +.Va _FORTIFY_SOURCE +to +.Dv 1 +or +.Dv 2 +before including any +.Fx +headers. +.Fx +world builds can set +.Va FORTIFY_SOURCE +to provide a default value for +.Va _FORTIFY_SOURCE . +When enabled, +.Dq FORTIFY_SOURCE +enables extra bounds checking in various functions that accept buffers to be +written into. +These functions currently have extra bounds checking support: +.Bl -column -offset indent "snprintf" "memmove" "strncpy" "vsnprintf" "readlink" +.It bcopy Ta bzero Ta fgets Ta getcwd Ta gets +.It memcpy Ta memmove Ta memset Ta read Ta readlink +.It snprintf Ta sprintf Ta stpcpy Ta stpncpy Ta strcat +.It strcpy Ta strncat Ta strncpy Ta vsnprintf Ta vsprintf +.El +.Pp +.Dq FORTIFY_SOURCE +requires compiler support from +.Xr clang 1 +or +.Xr gcc 1 , +which provide the +.Xr __builtin_object_size 3 +function that is used to determine the bounds of an object. +This feature works best at optimization levels +.Fl O1 +and above, as some object sizes may be less obvious without some data that the +compiler would collect in an optimization pass. +.Pp +Similar to SSP, violating the bounds of an object will cause the program to +abort in an effort to avoid malicious execution. +This effectively provides finer-grained protection than SSP for some class of +function and system calls, along with some protection for buffers allocated as +part of the program data. .\" .Ss Supervisor mode memory protection Certain processors include features that prevent unintended access to memory diff --git a/share/man/man7/security.7 b/share/man/man7/security.7 index 71107b29ba11..697d860a9836 100644 --- a/share/man/man7/security.7 +++ b/share/man/man7/security.7 @@ -26,13 +26,21 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2023 +.Dd June 1, 2024 .Dt SECURITY 7 .Os .Sh NAME .Nm security .Nd introduction to security under FreeBSD .Sh DESCRIPTION +See +.Xr mitigations 7 +for a description of vulnerability mitigations in +.Fx . +This man page documents other +.Fx +security related topics. +.Pp Security is a function that begins and ends with the system administrator. While all .Bx From nobody Thu Aug 1 14:47:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZWyb55nrz5Ssmy; Thu, 01 Aug 2024 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZWyb3WQ0z4H6R; Thu, 1 Aug 2024 14:47:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+pGZjI6zrea3SpA5W8tduDGrwyRyHDaMlQFd3H6uTh8=; b=APVJiHIKXFYUzDTMFoYClQXayE2sUyYimPV9u40Km81zsFsEmxhW+iLmtwxqRT9V692rAX fZfP9pqqzyb7BZ5aPV8fg4pWg2axVmWSCRbds6kINaIXkmU4hXH1gtU2CT0nI4P4ReYvGZ 9YhhIspZMTiwhfyRn709Z3KRAViVzxmoy/euJucKK7po+VR2+OBuqAZ+/5UU8jI7U9EXvA QudxKeMCRD8T9WrZjl0berkcnkumsLJ2V83III8Ju1fLJ3gp8g4S//iN1S0TFMf3GK0O0L 9bxdBw6h1pkfUjhutcajZDJ9dhBhWDDhy2bt2CYa/DM3m07gUfde9AWzdchl1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523639; a=rsa-sha256; cv=none; b=TmXOjCfmozxI737KmtciM8/M60Io6A6hR1Swq34vYQQR40VQpmzyev3Nwo0o8QDJQQ6TJm q7UCIqrcKkIJAtUGOaCVstv6xA38Zg4vxAMVJMY7xbkas+MnnCu5jPln99w238GLyWlyyc RrOQCthzrmQoPDuZIrxfvVCt8vPp2BVufIqeaHefosZaA8P1VBLECvWRuY1exvcPJIkU/m TuHvHxNFSPCN2yi8mArMdG7cB1/Rb+w/YDtTf842hDgnJ1j0pNDZxW70OOvjctjLmJy3Bi PI/OwB5YTUFxLxvYgKQH4MF2lJFsG1NlQp+OVte9MO+zTfmfFeHLya4MYgg+qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+pGZjI6zrea3SpA5W8tduDGrwyRyHDaMlQFd3H6uTh8=; b=VSzL3HiCjtN0aouzZANeINOKs81mTizubu8imRxsEg82aVnU/n/LKOChMRT15aeOgZ3jS3 LTjgcdTc9l7VOcpE5nHOAD3vjDSx5mM1Jqe8yDcrc7Slmb0rbB5cuG0cygtDXfAtuJ25YG cOZTMH2kgWSJvWiXz6BGVpxEAGVxDIXfRINDCOMxAx3E6EKYvobKIs4vEAMImSqUNem5w6 ky/YlSN9Pz0gXE452JavRB9mjzYh/exxVNh9RgrigVZbpgjahUmb36Dj4ocaXM1KLLQdOj vd7vhDF/dytHzBLEN2atmb0u8NzTgfCCLRxbxMP1WM7G23Yok26e3xwsVxBjxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZWyb33sRzpr7; Thu, 1 Aug 2024 14:47: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 471ElJcQ040074; Thu, 1 Aug 2024 14:47:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471ElJpY040071; Thu, 1 Aug 2024 14:47:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:47:19 GMT Message-Id: <202408011447.471ElJpY040071@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: 9420f5d40d11 - stable/14 - mitigations.7: Document riscv's SM[AE]P equivalents List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 9420f5d40d11a84f4d26597b225802fc057e0430 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=9420f5d40d11a84f4d26597b225802fc057e0430 commit 9420f5d40d11a84f4d26597b225802fc057e0430 Author: Jessica Clarke AuthorDate: 2024-05-31 19:54:59 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:46:46 +0000 mitigations.7: Document riscv's SM[AE]P equivalents Its base privileged architecture provides these. Read/write is toggleable via the SUM bit, so use that as its feature name. Execute is always-on so has no name. (cherry picked from commit a5ae2d2ab409834c28e71b1dcde4ebcd0d9b3671) --- share/man/man7/mitigations.7 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index 4beaa4c9f46c..9dceffb368a9 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -324,6 +324,8 @@ kernel. .It amd64 Ta SMEP Ta Execute .It arm64 Ta PAN Ta Read / Write .It arm64 Ta PXN Ta Execute +.It riscv Ta SUM Ta Read / Write +.It riscv Ta - Ta Execute .El .Pp These features are automatically used by the kernel. From nobody Thu Aug 1 14:50:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2814lwz5Ssyc; Thu, 01 Aug 2024 14:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX280TPgz4JSL; Thu, 1 Aug 2024 14:50:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X07Rmka7u9m+g8hY0pP9+2aBZH61ddjD5bUc08/fHhY=; b=a4vSJkSqjRHYVcSnd4fYzaugieBDeSiTLFgz9INDr7qRLpmJ+PBG283mTkXRGWLbdjbkzI QarSfHrxUgFoh0FcHN6nd4Vpeif+2hFPeKprtABfDl0AXk4JWGx8I74SLvNaKM+NhOmDC6 qJ1MrNdAlFyT383ACnovEwQAeOEA37dxZyjSVJSwZEtgcndSg5+KK8kqIRotckJpEfoH1v 4XI369qTTAU1R+Uae4nmKQIBe+cz3NIUx+KBcCqcE3QbTM5QZj5Ml93vELg3aH/+WXeSeU TfKSWo5b7rD9XJ7k69eO28cr7OYVF2eaPnx0V5lEmUCNxX8g5KUnei3u/Wjwnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523824; a=rsa-sha256; cv=none; b=eJ5TJfnX0fXQnsG6TOW5Houkt8AVwWm8BC5uoLCPeWvB44c/y/JlVysO26sNeV1qjrwq8v c+1g7snhGRhSKsgv/8ZU+LnFAeD6SAgfUmsMTMogVjlAm4ZKwdvwVIWtRacf59WCknMMt5 kH4Iv6hpwsR9r3fPotVAY3ruiFML27Mt4WhBQTEWybDDFaAvtxcz8aNEnOKd9BRDjmqEEW 6qnbhLkIYqf7IlZgFTP59/U8hSdX5jC0Yr76+GP7KDqOXp870nxBz0rUB62nYZFk13JGR+ Kh9QLAjatxY6T6pLeVpjjs5/+2ZgZH6mC1ycHNwAzxj1oh/y+kP+DjPKiTFtqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X07Rmka7u9m+g8hY0pP9+2aBZH61ddjD5bUc08/fHhY=; b=YtKylH+kg8o8iKc5P3LWDZXmWfIytw9en5NJO7h/zRyp0j481RQtdqAH9LaIknWmM45P/c a5ZRXgafvPCgTZVfHPWV0b+EYuWiJX9jPhZcP+mbiLqko/dVCDvjtjiD5IUt4QDfcdmRq6 t9j/mRgWilOHdDBoSa1cugVg+SaxDFQAVMmjmL+/Cv8AIpMuJHd+xrgcSdKHVePQAyTf1y f6YAz+OloCUKcuvryDa+TPSSaVFHTQ2f8t9B/WVM83dS8i2JDPqz5j+MJ5bYw2wIEEEbC9 DcWD4ojs3hEMMs8UfIvVu6wh9ZTe9+72uay7RpvX/3DyqWyh4xgsbyMRXFLoOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX280427zpfK; Thu, 1 Aug 2024 14:50: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 471EoN4P049333; Thu, 1 Aug 2024 14:50:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoNql049330; Thu, 1 Aug 2024 14:50:23 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:23 GMT Message-Id: <202408011450.471EoNql049330@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: b56cb540dbfa - stable/14 - stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: b56cb540dbfa5d0d79240eb9f28f333d7d231e48 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b56cb540dbfa5d0d79240eb9f28f333d7d231e48 commit b56cb540dbfa5d0d79240eb9f28f333d7d231e48 Author: Warner Losh AuthorDate: 2024-07-25 03:15:28 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:53 +0000 stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader This saves space to allow pxeboot to work again. Users desiring these features can turn them on for their custom build. While these are useful for some specialized applications, they aren't needed to boot the typical system, and we're low on space. text data bss dec hex filename Before: 465866 20740 31612 518218 0x7e84a loader_lua.bin After: 441535 17484 31092 490111 0x77a7f loader_lua.bin Savings: 28,107 bytes Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42416 (cherry picked from commit 195a96f0b303345818e09ad1d79dc80122804de8) --- stand/i386/loader/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index ab446d67225b..a4aa3a3c4d45 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -4,11 +4,11 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes -LOADER_EXT2FS_SUPPORT?= yes -LOADER_MSDOS_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= yes +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no .include From nobody Thu Aug 1 14:50:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX291yrCz5Ssr6; Thu, 01 Aug 2024 14:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX291RjKz4JHJ; Thu, 1 Aug 2024 14:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yOpedQ1gGCbAD8wS6jvft0W3NHYmUHiXsRDeRrsWfa0=; b=JnpaMZI5x1H9JlWJelZx3/rw7gOa//5mJljwIYIk6jSi4e/5qW5WSP8JpLL9Od3gzaBFuB ur3KCJwmp6JSXWq7wx/NZ63EzjU9m47YsZOChmT9WS0WUi2Hk8f22227zYalSz7uqcGhrm tdEFU9tppfJswTXeVZjf91B9lRNhUzBPQBQdJt0s4wIlItaxkPsLWoSgbaHU1GFUeYiN5v iegqaxcyOmhP/re4t+8tw4K1FEcI4RW4uzhrIo21XfwCU7RX35Pi8ucohBbW910dOx5O8N qqf9ABEFpTzykhW+1+IUIFFz7H4h7E34+a6yB1n6dQMjW5Xo4vbUiQnWTUTZLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523825; a=rsa-sha256; cv=none; b=fy1nLuXfS38RussjAH77bMg2XDr0o05LexFNa534EiDFZanP2AMMnejXuDQnx9Q8nUp3qa TkpKdSmicYzzK1H4yYiIwskRXn5NNlZu8rJIgtu72SSLGApeOiYKtTk+hNUPbOSF53oyUc ZED9lbqLTBpjaORp2vYKS6Ms8uHDZQA719LuA7i17uP6Zj80tBE2E3e79bWXzaLkJNmzkj CSNbPlx9V9AdfWhIZImRlw3byjZz8Xbe2JIR12e9e9OVCTYbdtn14q5X6i5AAMMmvShhiU Z+gj6ijhDfcvBlAXqK76YBxNZ/Fv25t5xE7ZtxvXKRNvbzF6FndJLN7ijKaryg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yOpedQ1gGCbAD8wS6jvft0W3NHYmUHiXsRDeRrsWfa0=; b=SEachAZWHN0ZiNbZGw11Zecq20cjJSdFgUeEBukUxWvXUWgy8uDuQ3JVxS6EimhGllihYx CU1ItzmHXFIYJNou0ep+/bwtfM7SW6lDzslEolEbtD0L63gqQPhEg22AmBz+vKMgzKE03m w53Qv0NU5u48mvF6hFXg3CT1+DyxM8DaWPMNgAoVN3BPYN0CfE7/ro0IgmGRaB5NweVw53 E7jk6pOuvQqp9usfJoI5htNoTUFjqvDSNsiIUoL1dGllfYMtoX8NFxFWsehjzbAKJF5DzJ byFkSlQCjZNImrFvdSR+Awi3GI0OdKJgXv1DYEBBPUcMU0f+fVMp3gWrbyQBFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX291228zpfL; Thu, 1 Aug 2024 14:50: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 471EoPYC049372; Thu, 1 Aug 2024 14:50:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoPkB049369; Thu, 1 Aug 2024 14:50:25 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:25 GMT Message-Id: <202408011450.471EoPkB049369@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: 384215cb9a3d - stable/14 - stand: Remove obsolete junk List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 384215cb9a3d2b9c98cb81958612cb757883d0fd Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=384215cb9a3d2b9c98cb81958612cb757883d0fd commit 384215cb9a3d2b9c98cb81958612cb757883d0fd Author: Warner Losh AuthorDate: 2024-07-29 22:56:28 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:53 +0000 stand: Remove obsolete junk We long ago changed newvers.sh to make these comments bogus. Remove them since every single one of them is broken after the $FreeBSD$ removal. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D45879 (cherry picked from commit 8165650389ba2d0a68cea6902ac3750055cad9da) --- stand/efi/loader/version | 4 ---- stand/efi/loader/version.veriexec | 3 --- stand/i386/loader/version | 4 ---- stand/kboot/kboot/version | 5 ----- stand/powerpc/ofw/version | 4 ---- stand/uboot/version | 4 ---- stand/userboot/userboot/version | 1 - 7 files changed, 25 deletions(-) diff --git a/stand/efi/loader/version b/stand/efi/loader/version index 2bed97c231d2..4d6c3592e10a 100644 --- a/stand/efi/loader/version +++ b/stand/efi/loader/version @@ -1,6 +1,2 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.1: Keep in sync with i386 version. 0.1: Initial i386 version. Derived from ia64. diff --git a/stand/efi/loader/version.veriexec b/stand/efi/loader/version.veriexec index 5c9292310c04..090267dfa9cb 100644 --- a/stand/efi/loader/version.veriexec +++ b/stand/efi/loader/version.veriexec @@ -1,6 +1,3 @@ -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 2.1: SMBIOS 3 support 2.0: Secure boot support 1.1: Keep in sync with i386 version. diff --git a/stand/i386/loader/version b/stand/i386/loader/version index ea8067efa243..e5fdb8976bf2 100644 --- a/stand/i386/loader/version +++ b/stand/i386/loader/version @@ -1,7 +1,3 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.1: New calling conventions for fopen. 1.0: New semantics for finding the kernel, new boot. 0.8: Set/getenv & cia, copyin/out. diff --git a/stand/kboot/kboot/version b/stand/kboot/kboot/version index b24d6ea8e47a..a142c2b0ce2c 100644 --- a/stand/kboot/kboot/version +++ b/stand/kboot/kboot/version @@ -1,6 +1 @@ -$FreeBSD: user/nwhitehorn/kboot/powerpc/kboot/version 224106 2011-07-16 19:01:09Z nwhitehorn $ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 0.1: Initial kboot/PowerPC version. diff --git a/stand/powerpc/ofw/version b/stand/powerpc/ofw/version index 145f69c28aa4..24bdc8254ce3 100644 --- a/stand/powerpc/ofw/version +++ b/stand/powerpc/ofw/version @@ -1,5 +1 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 0.1: Initial OFW/PowerPC version. diff --git a/stand/uboot/version b/stand/uboot/version index 71464740dcc9..e779e403e7ec 100644 --- a/stand/uboot/version +++ b/stand/uboot/version @@ -1,5 +1 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.5: Unified ubldr build diff --git a/stand/userboot/userboot/version b/stand/userboot/userboot/version index 3b86a26c72ae..f361513b2741 100644 --- a/stand/userboot/userboot/version +++ b/stand/userboot/userboot/version @@ -1,4 +1,3 @@ - 1.2: Userboot with lua or forth 1.1: Initial userland boot From nobody Thu Aug 1 14:50:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2B4M1Yz5Sstf; Thu, 01 Aug 2024 14:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2B29Y5z4JW2; Thu, 1 Aug 2024 14:50:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xwlm0OtKMVkmY24qkhmsEXpgA0e3ogvSwnQrINWo4hI=; b=bCA3Pry3QsNlwh+9gini23leERgeAPUlvWWrcBozoDBP94Iz8VPdVannpSkHyUfnzCpvd+ UqmWd+s1bFVLp1s3uUAHT8I2cRrWoLJYeFsiBrxkJr9fiwFDuN/ecSP9dmnmmaLWoVwJUn 4UMNBMcUdhuKrPnLJPGwyJCcm166Dz5x/KkzcvtdEZ4aU+/qPMZcNe+165EGZQonHYZnbI iUzwp306cZmXsHf/y/1L6myWJUyfN3OCAaHUPqmDTuYnNqKQKk5z77TSmcHEniU9UtOnqw kh3KN2A0s91ZUxCfS418Ro+ylQRlsUkYilWoEzQxgrsLHsogC7nLCsdEQ7hITw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523826; a=rsa-sha256; cv=none; b=BHejaN5LTvmNCIUpBRwxXAYXq7BCxw4Tx3CCSq6yCx6BjvLwgTg/1sS2rMoEc08Lr3S8Te 9YLU5NDCpY8U17ZYSdFnJGhXJt/GiVKCJ9u4e7ewSylGrVTXl4iqOCcG4Ac0Tr19i0aD3z P9gEZF4KWUxzl+PrEdLY2zCvzuK+yScEAg+g5see4mXsRiGPYLIcIpQa3h8xFvWPn2DmWK iqFBDpkWW6k+/9dcULx1itgLGu0O1rjOts0v9BN/lBM0bNtCfqjb/BSAWA7ZNPvbMxmrOK +Eo9nUyPD/Oq6lA8xz8jVmEN7eypJSOMWL81UsOmuiSD6+7BxFSjOH9DoM3h0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523826; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xwlm0OtKMVkmY24qkhmsEXpgA0e3ogvSwnQrINWo4hI=; b=tT3sai3J/tBf50Lb9oouCMR/PWPDv39eeXnsSQK1AHZH9acIR+6OzoCVghqj0UQGtVGDGz NRYVIDMq+LghBYucPkrJSr9+x1XEEILAduyk8PZyyth9Y018hs5rtrW2KDKGXgOB/Y0T9p X3gv3FZj4zOLXxusPazborDQl5VHGCFLC+G1mpIqmtxm3OGNB6FNb5x1fiAn6/k8ITjFBU ZXN7heIKFXJ622MBRUmo/WwLbpXfOYUEeRqU4s60VeevvcMymnCTZQdSvr+yfwrSlP2hCM lEaiS60MBhbdXIxb7mgbW1ZjTnKpZtqM1hjL0U7K14fDcZJoPcE1SBxPOt565w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2B1hWLzptX; Thu, 1 Aug 2024 14:50: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 471EoQkZ049421; Thu, 1 Aug 2024 14:50:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoQeO049418; Thu, 1 Aug 2024 14:50:26 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:26 GMT Message-Id: <202408011450.471EoQeO049418@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: 7a50c3f63f54 - stable/14 - stand: Kill commented out line List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7a50c3f63f542ba7a9b2d705591c6dbd47ad31d0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a50c3f63f542ba7a9b2d705591c6dbd47ad31d0 commit 7a50c3f63f542ba7a9b2d705591c6dbd47ad31d0 Author: Warner Losh AuthorDate: 2024-07-29 22:56:48 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 stand: Kill commented out line This line is no longer needed as fallback, and should have been deleted in 7870a52598ad8 instead of commented out, but 26 years later, I have a high degree of confidence that old change was right and we won't need this line as a fallback. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D45880 (cherry picked from commit 65300ca729452f62c201baedcbb4a67f2afc5ed5) --- stand/common/newvers.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stand/common/newvers.sh b/stand/common/newvers.sh index 916fecb98334..369a1c7c76df 100755 --- a/stand/common/newvers.sh +++ b/stand/common/newvers.sh @@ -44,7 +44,6 @@ shift $((OPTIND - 1)) LC_ALL=C; export LC_ALL u=${USER-root} h=${HOSTNAME-`hostname`} t=`date` -#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` bootprog_info="FreeBSD/${3} ${2}, Revision ${r}\\n" From nobody Thu Aug 1 14:50:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2D0bqWz5St2Z; Thu, 01 Aug 2024 14:50:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2C3NKvz4JNQ; Thu, 1 Aug 2024 14:50:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xXUZlDCtXy/HacouUME9z/sFdEDyiGUz/UepGlh9lQ=; b=XgPfaLTpPBzU82TyMlz9MZKBkIglW3WbgA8y4tUmT06bvpoxliBTAKTmb6F5/YZRUXsBGD h4E3R6UVxr+yb8jNiPIhLmQZgkNanhCYbawfIw4C59lWJEILWwOxccwZ0cS5zp3z+jkSbn Hg6Y7/gX7U3J5ImoGlnrTG5gNbiZWmwBItwpLjjsi9xXJrAm91w0P91+NSUBrrKbMM1Gqx rmyqlWp5qMBMmlN1L5kbZdw9Ch844IgX85teOV+3RXecW6kEha97XCULq3o6h6ABA/mosp S8iFj+69fJhSJZ9lysfJauHfFUZMLB7Bo9oKEVKdzb7klzg4MUUObFb1+tXK4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523827; a=rsa-sha256; cv=none; b=VO8SBXM2XMpcKgwBFhVtx5a62Z9fS6zZTKLyaogwip37QzHA/rQXJMHpRVXeo7+8KeaYl6 NUe15RnbL+kYckB4JBju72fg84borro/KnZOmdwZFasPKpxl55juJzv2ElHjIUL/b5QD0C ea8XE2Hd5cpeBNTqTxDLNCQbi5o6utamyX6+XHsu+/mlFjsl8LgisxaUl4FhBeIr5kAh+R tSnwXZYMsYdghxV+Li25p6nmTo7Rm7nk9LdxOLCqyGEtUkeIBHUlrggBO04Y4EOb3ukKCn k0s22bwkSG72xzdZN1+ALNuT/9M/TUUz6FGAIgiVlICtbU9F3qqpL9WBPXaMOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6xXUZlDCtXy/HacouUME9z/sFdEDyiGUz/UepGlh9lQ=; b=ZiJndwFHX/xVQwFoK/fao6AXiQ5VVuOo6hLmC8s3GdcUV+uyyoqj19y5plW8G24f+gVv+H ljMHUrPnT4vqtU9wyCWCT+i+JG7axOHoS/N7GeCuvbWp6+E3gWhxnjopEZJKyiDZ7LQX2J fJhP5V0FvVAH7tqLZgWEJ8QFt0sX0MMp7IgVCjowinjCSCBEcgPDQRQZmJWnpYZTF4C3kx ujZvW49ZcdkHNFOatUjYRAIQCLZNqLZ/TEVttpC9Gpf9D/C8boogSGzdpZzo5G430SzI8q FJBJNKiJsezOuoIPuSfFm2T7oJNQ7Fb0d8X3EuhZYqVszkA6cyCXSQyo2C8xvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2C2zJBzpKJ; Thu, 1 Aug 2024 14:50: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 471EoRgd049463; Thu, 1 Aug 2024 14:50:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoRv5049460; Thu, 1 Aug 2024 14:50:27 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:27 GMT Message-Id: <202408011450.471EoRv5049460@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: 90ca43b5dcf0 - stable/14 - Revert "loader/lua: Remove pager shim" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 90ca43b5dcf0fbf6f28447a09aaee78ec3716d36 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=90ca43b5dcf0fbf6f28447a09aaee78ec3716d36 commit 90ca43b5dcf0fbf6f28447a09aaee78ec3716d36 Author: Warner Losh AuthorDate: 2024-07-29 22:56:55 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 Revert "loader/lua: Remove pager shim" This reverts commit 8b9178cd0d35ff2beafebdd51c8c44ba2b5aeb0f. Really old loader.efi files persist in the field. Revert this to support it. We need to support this through at least 14.2 now, alas. MFC After: 3 days Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45881 (cherry picked from commit b38a82c77ab90eace53c56151b191efd1f4a8439) --- stand/lua/cli.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stand/lua/cli.lua b/stand/lua/cli.lua index 596e55a8d1d8..6832da0a31a5 100644 --- a/stand/lua/cli.lua +++ b/stand/lua/cli.lua @@ -30,6 +30,18 @@ local core = require("core") local cli = {} +if not pager then + -- shim for the pager module that just doesn't do it. + -- XXX Remove after 12.2 goes EoL. + pager = { + open = function() end, + close = function() end, + output = function(str) + printc(str) + end, + } +end + -- Internal function -- Parses arguments to boot and returns two values: kernel_name, argstr -- Defaults to nil and "" respectively. From nobody Thu Aug 1 14:50:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2D6lypz5Ssyj; Thu, 01 Aug 2024 14:50:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2D4Rxrz4JT3; Thu, 1 Aug 2024 14:50:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=27DZwGuAeaKT2geGsUsoCxYsIpMlDTEDe31TdV5D0i8=; b=pfm/46bnsgIZRPkxXiaqfMYnErWRkp+wBtMFIiIqUwGHcOSmu+YvCjzN6/CWSvTP8lQ9Oo CMYj3QPtPGDRXUQkZa+n70sNK3gFWfnwsjA1hhUObeMJhvf6NLqOH0rf8t1etcYHwPBWB4 IVXfODkfUzVyGGntZo7Vd/51K1ZGOetPuSSuIqE0BpE7EWeuEi5EJ1iCZ3sFmVnILpIpju JrqY4sVe39djQnLpyYPLHPcEZcSJSv/DBefI55lTpl4U5B/FEos8A5md1+vxp/hjv1gZxK watpaPyLP4G0ImBw9yTdVd8TkWSEVcnJaczwj13OE66stjtU6dcdS8lGBo6Usw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523828; a=rsa-sha256; cv=none; b=UVxMad1jyPUXk/gXGkvY1deQGtbYblXB7ybH1Kh3DhlVGFbeZQRe5xuqdD1iDOOXcZSJot WSjZrzp0rx0eeXfROpQIUXAms7XCfaVvtRvBU2ZKgIQxgRucCHO0gff+yC48ZVJnmmDGyC EMF6VhoVpqgdPiJu9e+hCZ//cli6Y7DWLjxI8CndTY+fGF/d4+aEpPkK5KTSosN3Z505WD YyTcNDiAN5+rwM339ulIhbQZX3rTiEhw0qx0nVS4ZRR8Mz0YitLOWYry+xtavIQ1uyD5TV gMPMU2OfjO0R//WtWsnLMq7IkoRUmDXNhVK2OMd36IR8Rb/Gercb9P2NVmfLug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=27DZwGuAeaKT2geGsUsoCxYsIpMlDTEDe31TdV5D0i8=; b=TsNyO3g/EUqlW7dyi7QDfpvO1o1sscaidWIHOXdt35zUHr/TIEfaOnmL9kI9d4P8J2h2Wa v8jcEe5qRbh+KKdsrLFPkNK8t+O5moZeZlY7uVFxcvRDjw2drppncur3QZ2iHnhR/tcwuQ G26/1/stzmmyDaNqD9tEOYmA+Z4MspRisZ9OSw/bsK+DSyCC3Vw8lIjNffaspbPWfdBQsn BPJQ1VRSPL+2bFuh6CBBmWXtyH9RNRPtv22lW8wNT3aOp/9xW6JHg+TMLEKz9sRqTSUY7L mvszZXhnLgZpZBtQ624H+jh27qQBN8vSG6JIBcsXt1cYaffZ5muXUX1P+532qw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2D40y7zptY; Thu, 1 Aug 2024 14:50: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 471EoSWi049517; Thu, 1 Aug 2024 14:50:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoSEN049514; Thu, 1 Aug 2024 14:50:28 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:28 GMT Message-Id: <202408011450.471EoSEN049514@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: 598b9677b3e9 - stable/14 - Revert "loader/lua: Remove compat shim for loader.lua_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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 598b9677b3e9ac01d81031d67426e49573b759d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=598b9677b3e9ac01d81031d67426e49573b759d2 commit 598b9677b3e9ac01d81031d67426e49573b759d2 Author: Warner Losh AuthorDate: 2024-07-29 22:57:04 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 Revert "loader/lua: Remove compat shim for loader.lua_path" This reverts commit ab97d42addae97a389c6f22d6bba62ed954bb8e7. There's too many people in the field with FreeBSD 12.0 loader.efi that stubbed their toe on upgrading to 14.1 since they'd not updated loader.efi. While we sort out that mess, add back this workaround. Can revisit after 14.2 maybe. MFC After: 3 days Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45882 (cherry picked from commit 522a65a8d97a0d6b634266f1b4a89aa8f374279c) --- stand/lua/core.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index eaabff6a7602..9226de564348 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -65,7 +65,13 @@ end -- message on failure. function try_include(module) if module:sub(1, 1) ~= "/" then - module = loader.lua_path .. "/" .. module + local lua_path = loader.lua_path + -- XXX Temporary compat shim; this should be removed once the + -- loader.lua_path export has sufficiently spread. + if lua_path == nil then + lua_path = "/boot/lua" + end + module = lua_path .. "/" .. module -- We only attempt to append an extension if an absolute path -- wasn't specified. This assumes that the caller either wants -- to treat this like it would require() and specify just the From nobody Thu Aug 1 14:50:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2G0rTnz5Sswq; Thu, 01 Aug 2024 14:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2F5GzJz4JTC; Thu, 1 Aug 2024 14:50:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o7e+CJju8BIAuNmiVifPNYZFyPkCqhPITrwOS1nqaKA=; b=CZQ+I22cm/d+6HMPRE5aNFUbq3gmQlxCQhYs/2ASJqW68RB1tZySsA9lecyXshk/3XBnLW sZgCZVZUIwFE0jsxzAikhMcyLSDbd/qIA8KwFqdlp9VPVedFGWD/CgPFHt1zV8RKrqWMO8 tRSxOduPp3mrZA7tbQABNBSBWN8HKRn0DTcnAYoQnOdK0c6oGhBxlnd8t7yJmEWYWeBuYR AoaRSwcvjlrPQB6i1DauoACXApb6GSQNJA+kvkEbJF+PptWLxHC4vPZ5HJNdtCW8dixgdE CsfIFq3WCM4ja78ZQEnd++g2B/XEDOaIw1wuSVhTMTpzXIVgRDBcw1wlifyoiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523829; a=rsa-sha256; cv=none; b=kMLF5x82H3kiXTS6mkXeGudPofiKUUsWp4UZOKx7vqKJ9OhdtEi3SiZJkfXEElihz2vd0C gF/CLkhGjXWF2WayBMt+auOkMa9AONzHgAdxNe6qQQdMC/1hbpXNTIXcRW8/6G/AarM2xT /JStWNcymVPGh5p8IMcLVPx8QEIC/hZlhEKEHzy154nUqLck5g2sGWF5F4y6wEextKK5mF DjjWWgtfohCwFewyp/IEPo7/bxXK4DOLG9Gu0B3RDXMHY0X9aolWSeJ/YkcM5Av+M2ThlN Vug28uqPBGENrv9OQCzuS+XAmFJhd5HEkio1hYuhYZXCSZoZW4orGs9YO58Dtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o7e+CJju8BIAuNmiVifPNYZFyPkCqhPITrwOS1nqaKA=; b=vL73AXXlhjFzwscN/J87vN/9ZjgGyBGXlQ+t2zvTL7j+OCSi+BYnhWox1X8MM1Z7jWHHON sENDnuOx9heYHR9WG6HxcTxKEPqQVM7l079KO8pXAtwc6Rqs8nj85IprlrxcDFTvMwBieH bXHZ8FdD1AwmSZgOHN0TAWXl/NlLpptRNN2AEPuKlXPMEr1nIZB1cHnJiYMw2FBViSgVBf G3sKqIbMPlgPHNFOC/TeANt4eXFerQTc2/JC7gjCvMiK8YPdUilJaBhMeOIWuRGyss94z4 RnTxoeGImh3yx758tMwp7ouQZJ1/nvC7k8nD5jzTVhZo4GfIDc+dopnXX99Ibw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2F4rnxzpc4; Thu, 1 Aug 2024 14:50: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 471EoTlo049562; Thu, 1 Aug 2024 14:50:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoToK049559; Thu, 1 Aug 2024 14:50:29 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:29 GMT Message-Id: <202408011450.471EoToK049559@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: 7ffa3b0f69dc - stable/14 - Revert "loader/lua: Remove workaround for command_error" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7ffa3b0f69dcd59dc16dd652744a0d52d84954ed Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7ffa3b0f69dcd59dc16dd652744a0d52d84954ed commit 7ffa3b0f69dcd59dc16dd652744a0d52d84954ed Author: Warner Losh AuthorDate: 2024-07-29 22:57:13 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 Revert "loader/lua: Remove workaround for command_error" This reverts commit 552f3072af54820cf1805f712e2567bc1b7f046d. loader.command_error was added just after 11.2, but appears to not have been back ported to 11.x. 11.0 was the first lua loader release, so keep this compat shim until we sort out what to do. MFC After: 3 days Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45883 (cherry picked from commit 809edb3636a5494ad7d3dfff910e0aab89d83442) --- stand/lua/config.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stand/lua/config.lua b/stand/lua/config.lua index ba6144364247..86f5ef6174a2 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -407,7 +407,12 @@ local function loadModule(mod, silent) end if cli_execute_unparsed(str) ~= 0 then - print(loader.command_error()) + -- XXX Temporary shim: don't break the boot if + -- loader hadn't been recompiled with this + -- function exposed. + if loader.command_error then + print(loader.command_error()) + end if not silent then print("failed!") end From nobody Thu Aug 1 14:50:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2H1XpXz5Ssr8; Thu, 01 Aug 2024 14:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2G6Qzcz4JRL; Thu, 1 Aug 2024 14:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOCk6ulNhHmtH1POAX6UBRq9IeCDDyuIVhyMlcCkAO8=; b=tTgS98YQwMO8jhnSbuJmRokgmTKN/B4tDOWOyeRCtnqM5qRnmlut0hMPangUDr3NM6hO72 QAQAxFnU+evvciuXA6M6E6u6FokX2cCrJXvQrR5hMut5AM+4mzKpKJD5L/JncwEH//WfVM n7y4RO6GuS1xVGWLRhGQTxyC2mnP19RRyQKhjhEV3YeGLwNRzlC3O5cH/VP4eNbEWNHWw6 BEnUEAjdkg//Mu/txRqtWtUh8+JXrGag4pohiYngjZ277mb+D+zKaEfqLbuj7gX51WRoWP Ir0ZRfpw4HybUIqCCKXRKDnOaiBLZBAWsBWscUc7gH4U00jhd+w4LhUI3Pk8uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523830; a=rsa-sha256; cv=none; b=BsZjWLAXGnM64i7fxUzYaRwQae61OBZHPENqX5aL58zGii3muwiqPSLqpeLYIv/XT5P1re CyyyeM4i9yltWA9Oie0sLyVOFv+r4wH1BgYE/wXV0u8xAQciJyYRgWd+v4GPRupp/wZ+ZU MRvkEjS8qQ9BgYBXy6D5A0/xI6nd/ZEeVUqxx6NZgLyXHJBn8Jp2c/uHmLxQqKmhnL9vgh 3lJBwFFNT1/nfgjVU4daVCTkkJXwBOKLDnuGVebAZq/7eDvwqw1hlpXqINmD2Zd1Gk3R7K 71/mrrdv3coiEj+5A4fR/f8X8a4BgOfD9Vcan3dVddnYqupHS4t76G//BhscJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOCk6ulNhHmtH1POAX6UBRq9IeCDDyuIVhyMlcCkAO8=; b=O15pLJcPLDp0r/bNehu2bEnXWwEI0wTDbDcab3iBtpCEPoMdPpArz9EJ7OFG4G+w0YjDdP qeXSU5Rn9fF1sX/vm+u+h7eBG1snerFXzwXTa981C2TGNZ6/Uy44GOQxRsI2pDbRXZswyC cRMetBT3ZNgZ8G/5p2flsJHhjuTI8+RHlOWAJl5TjE+qSJspYxs6x9/JoqYk0oUYYKO8s4 owLVnWAA8vCogq45t69kuo2ChMAQKhbe9yQUIZ1sEpIJ/DGmoaOuecCUjfNL4Ion5IBzPr mTBlpkEd8gbjqCcKg3FzRPXZqmOvdnmWI/Ti1zsMZvUmgK8uVTybvRawOQvYXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2G5gbYzpc5; Thu, 1 Aug 2024 14:50: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 471EoUjc049609; Thu, 1 Aug 2024 14:50:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoUWH049606; Thu, 1 Aug 2024 14:50:30 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:30 GMT Message-Id: <202408011450.471EoUWH049606@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: dd2cfed93331 - stable/14 - loader: Bump all versions to 3.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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd2cfed93331272a624745ffa08c77ab9129384a Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dd2cfed93331272a624745ffa08c77ab9129384a commit dd2cfed93331272a624745ffa08c77ab9129384a Author: Warner Losh AuthorDate: 2024-07-29 22:57:22 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 loader: Bump all versions to 3.0 Each incompatible change we make, we bump the major version. We've not done the bump in a while, so sync everybody to 3.0. Anything older than 3.0 will be given a warning that their boot loader is too old. We check only the major version, though, so minor versions can still be bumped for individual loaders (though I honestly doubt we'll ever need to do that again). Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45888 (cherry picked from commit 9f7f90507528aaa9a2f54575c1d4f4010d01c2e5) --- stand/efi/loader/version | 1 + stand/efi/loader/version.veriexec | 1 + stand/i386/loader/version | 1 + stand/kboot/kboot/version | 1 + stand/powerpc/ofw/version | 1 + stand/uboot/version | 1 + stand/userboot/userboot/version | 1 + 7 files changed, 7 insertions(+) diff --git a/stand/efi/loader/version b/stand/efi/loader/version index 4d6c3592e10a..570796b66956 100644 --- a/stand/efi/loader/version +++ b/stand/efi/loader/version @@ -1,2 +1,3 @@ +3.0: Lua scripts API stability 1.1: Keep in sync with i386 version. 0.1: Initial i386 version. Derived from ia64. diff --git a/stand/efi/loader/version.veriexec b/stand/efi/loader/version.veriexec index 090267dfa9cb..529f3ef5544b 100644 --- a/stand/efi/loader/version.veriexec +++ b/stand/efi/loader/version.veriexec @@ -1,3 +1,4 @@ +3.0: Lua scripts API stability 2.1: SMBIOS 3 support 2.0: Secure boot support 1.1: Keep in sync with i386 version. diff --git a/stand/i386/loader/version b/stand/i386/loader/version index e5fdb8976bf2..82229ae6a06d 100644 --- a/stand/i386/loader/version +++ b/stand/i386/loader/version @@ -1,3 +1,4 @@ +3.0: Lua scripts API stability 1.1: New calling conventions for fopen. 1.0: New semantics for finding the kernel, new boot. 0.8: Set/getenv & cia, copyin/out. diff --git a/stand/kboot/kboot/version b/stand/kboot/kboot/version index a142c2b0ce2c..be162b693ada 100644 --- a/stand/kboot/kboot/version +++ b/stand/kboot/kboot/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 0.1: Initial kboot/PowerPC version. diff --git a/stand/powerpc/ofw/version b/stand/powerpc/ofw/version index 24bdc8254ce3..fd8b01228f46 100644 --- a/stand/powerpc/ofw/version +++ b/stand/powerpc/ofw/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 0.1: Initial OFW/PowerPC version. diff --git a/stand/uboot/version b/stand/uboot/version index e779e403e7ec..0293880a1f90 100644 --- a/stand/uboot/version +++ b/stand/uboot/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 1.5: Unified ubldr build diff --git a/stand/userboot/userboot/version b/stand/userboot/userboot/version index f361513b2741..2fba2c27eabc 100644 --- a/stand/userboot/userboot/version +++ b/stand/userboot/userboot/version @@ -1,3 +1,4 @@ +3.0: Lua scripts API stability 1.2: Userboot with lua or forth 1.1: Initial userland boot From nobody Thu Aug 1 14:50:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2J2sRzz5Sswv; Thu, 01 Aug 2024 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2J0JZzz4JZl; Thu, 1 Aug 2024 14:50:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qbt2WEJiwl9M9RuswbMUcl0dx5TP8kLYW9T9hTJYYcE=; b=pr77PAj/9lzT9MC6fOYEnrrUaB/zL29JWSmhY12bnOOEvFH5FHdhAkgqt/4wJCrBNLuTtO SiV7lUktsgaG+qvSCBj7DFuAmAXfAu/cGExBASigpSzbmFdGwfOSwyxvF4SiEmE0E/HMsZ OIin7XcUOOb3bo84QnReAan40XSCgUf9H89eJ5F1KkJOO3DjZOc7SbaNfBMoHD9fMOWwtS h8yVbnmBRL8Fpeays9Mi0Xev4NINc87IeHOX4CXFTU66X3KC9w7aw1/EknnPk0XeANYvol V1bYJxCCvdEX7pc0Fi+uPYzV+cjYCTufDV/c6l+Gj4wD+yOcUfHsgf0lvP8c+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523832; a=rsa-sha256; cv=none; b=JY/1wfVXnY2INIPImrLqqQm9+vNIIIXHuv9edprezMEdmrlObwqtKJcYkr0VGXd1ob24mf idpZWu1M6NgqfBV78uSUnZKOWABJ/pcc5D7Aaa5iROTaoRv2/V6APmCTv0gEVyY9c3YdAk 3um3AQWE7yK7Hbz/K7fapJOiDoaneGIRSSfAbhEabHAQ64LiQuaX8uUhbXuv8Nr1X8Li2Z nRvr1qKRJgsE4TY0tPKI+E25+GTFPF8aIhMF4HXgG7kyTvTVweADFNVuea6hI39G17g6N5 wjTzUnHaOX46oBGpzqGawy8V1xcEOhr4HxjZkdWpu+ODWx5BUexmy4FbAr1dww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523832; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qbt2WEJiwl9M9RuswbMUcl0dx5TP8kLYW9T9hTJYYcE=; b=r0SaP0k4ql/+VwOPE2hvuYh32K7j+Gm3SaSd04oCgQNnCzZnOJbtrf1yyJKVHyDn/S+/EA Rn/lFjbpBXfavSNYb+4Msvgyg+/vKoPwYYmpa7QUX1HXNpo1mqV2LAxQU6jV9PGMlnVZXO UTzhvovKN6pv7npOSe9lJbEidEHaJnp9xqMhPG10ddrkopsnOw0vyWooQMzhOjWgbskcA2 dcs8qzFJbTDANESoD4hv1chAga+qI+iMZNLB00dPCDTiF9yfeA2Ic1usnAXA5peDl0GagT PEZCSe68L6gwyAxYVvp5Z5T9PdsHNt1/KzHroaBZMhiojj7pWKVp8N9dmHqqpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2H6kgszpKK; Thu, 1 Aug 2024 14:50: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 471EoVAi049672; Thu, 1 Aug 2024 14:50:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoVqW049669; Thu, 1 Aug 2024 14:50:31 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:31 GMT Message-Id: <202408011450.471EoVqW049669@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: 53a4bf76c57b - stable/14 - stand: Print a warning of the loader is too old List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 53a4bf76c57bc02dce7c521235d10dc7fec298a0 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=53a4bf76c57bc02dce7c521235d10dc7fec298a0 commit 53a4bf76c57bc02dce7c521235d10dc7fec298a0 Author: Warner Losh AuthorDate: 2024-07-29 22:57:30 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 stand: Print a warning of the loader is too old If the loader is < 3.0, print a warning that it's too old and needs to be upgraded. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45889 (cherry picked from commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c) --- stand/lua/core.lua | 21 +++++++++++++++++++++ stand/lua/core.lua.8 | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 9226de564348..7b7560ddc820 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -542,6 +542,27 @@ function core.nextConsoleChoice() end end +-- Sanity check the boot loader revision +-- Loaders with version 3.0 have everything that we need without backwards +-- compatible hacks. Warn users that still have old versions to upgrade so +-- that we can remove the backwards compatible hacks in the future since +-- they have been there a long time. +local loader_major = 3 + +function core.loaderTooOld() + return loader.version == nil or loader.version < loader_major * 1000 +end + +if core.loaderTooOld() then + print("**********************************************************************") + print("**********************************************************************") + print("***** *****") + print("***** BOOT LOADER IS TOO OLD. PLEASE UPGRADE. *****") + print("***** *****") + print("**********************************************************************") + print("**********************************************************************") +end + recordDefaults() hook.register("config.reloaded", core.clearCachedKernels) return core diff --git a/stand/lua/core.lua.8 b/stand/lua/core.lua.8 index e12f80671c00..208dbf5e12c9 100644 --- a/stand/lua/core.lua.8 +++ b/stand/lua/core.lua.8 @@ -218,6 +218,10 @@ If there are no elements, this returns nil and nil. If there is one element, this returns the front element and an empty table. This will not operate on truly associative tables; numeric indices are required. +.It Fn core.loaderTooOld +Returns true if the loader is too old. +Specifically, this means, is the loader old enough to require one or more +workarounds in the current lua base modules. .El .Sh SEE ALSO .Xr loader.conf 5 , From nobody Thu Aug 1 14:50:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX2K6VChz5St4f; Thu, 01 Aug 2024 14:50:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX2K196qz4JbC; Thu, 1 Aug 2024 14:50:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fyGG6cM93wHWFxw6c5lo6pB2QNNxbO7Y5BbRi4ASQyk=; b=pQpVUTV1uOI/oJx3slCs702jdVXqmVW585vpMSLXlVIogLp6niwkrxeV/g0gwrTU6Cotg1 bvfN0cBeDeRbpRne2M2p+8Z5ThfBaI6WbmBNx+ibz7aj4+L0sTTvbXABsoETQNR6G1DTTW JMTg9c4ajVOOgpAU0vp8O6vKE8dqUzRVMJUSNGTXyRzfTGrPF+umWy3qmlTcc73zZEG5h3 Q2XpyTW7ncGqjovohKh2oJ6g1rxUCtdMQd6t4UJEzvMSBTp9Xxq8woXjCIdS/7jwgrKXV3 H6eTXup/Z1r3uR2/Wn7e+hq508fViJ5VGhmOJP9rHKWS2RtweqoW3o7GKsX9fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523833; a=rsa-sha256; cv=none; b=ahK9qksX9RlWK2pNSOomCdfrWeJspM8WcLSD1KKVMO5oG6suEMzgWfrdaEXrWOUtm9TbP+ BPNgqcKVUCnf8qjj4YChmg9AHdsuUspJDpFulKYILz/Dj6IN1B8rH5sAVByP0owhtl+Pv5 Ti0o5/TswzPbLJS0c3LfGnwwihyS9hCAwh8cZGMPqJuiwkuMMY2i912cWC8O6AU/JmEsSR jMXIULrF9oMru2fLGaW/0dMBgfNrSYTCppnBIqDOjUGkhCmeglmKlFuFcMJomYtKBbVWtq tvTIP9FglYEEZcW38wnCIkEPBZ7j6F9Ek1pMnPQ8JhSBbGPzqrgVfFlfb1EE4Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fyGG6cM93wHWFxw6c5lo6pB2QNNxbO7Y5BbRi4ASQyk=; b=k+MasTMUh0L6U9D0xkihr7ni7XenetXqv3SUrp/jpc9UGFSM5rQeKfCtnDistDP976rHUk AOmXBufavJWqfYy5+uS6LH25ON7SWrm10HT9/8rWqXMRE9rYPLieMXRAGsZ1dp11OI9G7B qAatun0Z4XnlRJh1GSClEgDLzwJVjjDgA3XEy+IrTzUoTYiLLoOd1p6VPLnD806/3bIThW Qs8I3hcBTcWnW4VJcueJnXXhYGOJ1dqiA3ih/8QDWozrceje41dBcoUQhkf6AqRQIKie6u XW+tU+/ntd98o4uiD4OLxB6NsTSabR0lP7SAV19TMwtiCE0Jy7lqVApUFGV93Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX2K0kxBzpYg; Thu, 1 Aug 2024 14:50: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 471EoWs3049729; Thu, 1 Aug 2024 14:50:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EoWaA049726; Thu, 1 Aug 2024 14:50:32 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:50:32 GMT Message-Id: <202408011450.471EoWaA049726@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: 59bfc69490ea - stable/14 - stand: Add "Loader needs updating" to the first menu item" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 59bfc69490ea033d3c5eeb10c8ddd4aed4fbc4a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=59bfc69490ea033d3c5eeb10c8ddd4aed4fbc4a9 commit 59bfc69490ea033d3c5eeb10c8ddd4aed4fbc4a9 Author: Warner Losh AuthorDate: 2024-07-29 22:57:37 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:49:54 +0000 stand: Add "Loader needs updating" to the first menu item" When the boot loader version is too old, add a warning to the boot menu to maybe catch people's attention. Use the correct loader code that adds an inactive highlighted menu item indicating that an update is needed. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45890 (cherry picked from commit 0eac99f76ec31270f902cc2a0ff5ae4b5b606a65) (cherry picked from commit 7cb65be96d47cbe0b740266bc633d272fc4c5e6b) --- stand/lua/menu.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 4a948acf8241..0587e5ae6586 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -263,6 +263,10 @@ menu.welcome = { menu_entries.boot_envs, menu_entries.chainload, menu_entries.vendor, + { + entry_type = core.MENU_SEPARATOR, + }, + menu_entries.loader_needs_upgrade, } end, all_entries = { @@ -411,6 +415,15 @@ menu.welcome = { end, alias = {"l", "L"}, }, + loader_needs_upgrade = { + entry_type = core.MENU_SEPARATOR, + name = function() + return color.highlight("Loader needs to be updated") + end, + visible = function() + return core.loaderTooOld() + end + }, vendor = { entry_type = core.MENU_ENTRY, visible = function() From nobody Thu Aug 1 14:53:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZX5V0wzzz5StBC; Thu, 01 Aug 2024 14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZX5V03R5z4M05; Thu, 1 Aug 2024 14: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=1722523998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etuLDvM/HV2/xu9tAx2MuIODLMx9n4va3XawOrA5rDA=; b=vGP5VB1E0nG1qvXlWTzNa9F2QBx3yxr1Ieabu8TAkomtxwo85dPm2ZHeoZdTLFqn1HLX/t iAEZ4ctkw+f+sBXgwM9xBlH6zMfP2PoHVuldpVHy6j8/T6v18keq76sZ6vTWnQJh5yeCPr DA/ppRPDJTGdeHp8ilH6skqkiqvktqfbCj+zSYuKuTHIETMtS41BrMeJGZQGCLZo9q60El EUFo16VpFoUkClRH8LYBfBFQAvSaWjDcEIGF/N9krUpE1sZLVge/eW7Sz/gV6I6Z46mpHG dlWwGJoFnlcfhismIFYd/8NZWQ+JU4wjJ616Y+lUkbtLViXSPFQ0fiVJ22crYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722523998; a=rsa-sha256; cv=none; b=vWe+YHlfOWXNPPqhS3ag3lNt8K3s2Rf/4JiVjDLHd5D9K4J8sVDW1qt6EAMWpflFYY/3Du +pbjiZvt39DeRYC5X//Z6TWm2f7QaYO9DKxuDS3EfO/YByeWJM+9isAdDxdZ75dhqE/kQS vq1pz/IEzOf0ObAsjJKAfBe3kKWH1FQjZjUkdsF7ZgwLtcIBbDaVM2M3DJeZr6vKPPyBOR MQNMEA3806QxVt5DePmgJqmW1AVTK1gf5qWsNEZsSO78a2EPI4KjQN4FfI5Kf2Ya0Wd1xf sD3/8Wo2CIJmzA4Kz81Is3Mcm10cCLPFWozdG/qmZYgjYkwMfQcmTuzuYALNYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722523998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etuLDvM/HV2/xu9tAx2MuIODLMx9n4va3XawOrA5rDA=; b=gnNJhg4PX2Z+uqDkYv/WloJmLH/3UEO6cxdmBHYstP3LzZDs2mmEX0VY+IRrxdXqOgp5qJ CkHMd+9nb607TXegw4YdveGRJAbvGQGARkJXeZObst5GJ1M1lpNu3xpwNcFn2RaqdMQpCj cy75sdHYODUvpuriHABvR7ah+yRdIDpSc8OSLILByPsgdu1vgb8AwDCs1PVTQ7rAAa87Bj s71JH4IOmjciYaCTXbgj+AIxYeJOFilrMNo7IDqEYiIlimLcU7FMyGC5JD/irF43PsPv6y GwzTKW9rFakeWdWP2yYFwNn1W0IEJj8J0Dos6ce+reyLee9x2p5n0RRyZcE+Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZX5T6mKrzq1g; Thu, 1 Aug 2024 14:53: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 471ErHjM056772; Thu, 1 Aug 2024 14: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 471ErHTc056769; Thu, 1 Aug 2024 14:53:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:53:17 GMT Message-Id: <202408011453.471ErHTc056769@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: 4ad1f3143006 - stable/14 - splash(4): fix markup around cross-references List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 4ad1f3143006db61a6d2929ee42856e0967e00ec Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4ad1f3143006db61a6d2929ee42856e0967e00ec commit 4ad1f3143006db61a6d2929ee42856e0967e00ec Author: Ed Maste AuthorDate: 2024-07-15 12:53:52 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:53:03 +0000 splash(4): fix markup around cross-references Fixes: 7504e0e3e517 ("splash(4): Document how to use splash screen ...") Sponsored by: The FreeBSD Foundation (cherry picked from commit 004d5af853bfef1eb66394a15ac9e94e6dcebc0a) --- share/man/man4/splash.4 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/man/man4/splash.4 b/share/man/man4/splash.4 index 736703317a7f..af2ae2e4369a 100644 --- a/share/man/man4/splash.4 +++ b/share/man/man4/splash.4 @@ -204,8 +204,8 @@ have the following line in the kernel configuration file. .Dl device splash .Pp Next for -.Xr syscons 4 -, edit +.Xr syscons 4 , +edit .Pa /boot/loader.conf (see .Xr loader.conf 5 ) @@ -244,8 +244,8 @@ bitmap_name="/boot/splash.bin" .Ed .Pp For -.Xr vt 4 -, edit +.Xr vt 4 , +edit .Pa /boot/loader.conf (see .Xr loader.conf 5 ) From nobody Thu Aug 1 14:57:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBP0tZjz5StfZ; Thu, 01 Aug 2024 14:57:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBP0Jd3z4MHr; Thu, 1 Aug 2024 14:57:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFZrt4T7SRcgSEvqZX0wKX9Xx8B8RxaPF76xz73b+2w=; b=I1596kKau7V+SsWMuiGVbgjxb3ybND1hYJ1O8h4NMkqJ2t4xI5z+62t/m7fDan/iU+lj+N EfnP+yU8NA4G3TJ4uEj0It4M52N5xRvjY2y2oG+SNrdrevoLpal5ll5sgS0Q+FgW0pzNup rR1JNVzltFLKHwwwOARIYxFulr41sT+c3eHE/w8YCtKwbn/SX4Qg+sNF+k8XJJkroCWx7q 5eCm/syZCXrbH/JwBBAXvU5Vf2DvA/LdolI4myp87hxDY9wtgMyRNrLmGxgAfcHFagCw5H FcdRcJ/Ag1ufMZB2wNjKqvYEG+QMT3CerSlCuG7Ses6Ix9MPSXUT1XopzoYGZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524253; a=rsa-sha256; cv=none; b=BBF8D+1d2zsncghaHvIS2Lntm2XxOFOaWljVwO0WQB/shiJCpFZzL1+DNobKzMOpi9rPlt h7aclBYMiF7CN59vIeOqRyzWeQLj/nSWjsmdyjHLhyDkgXSEglHJvdbKNK1HvadrKtmTyS Ml4OMh8INkHi46JlfjKDwxiGSf9XkvcB/rqINXjlXC5kjW3ILPvH0kYvfwGJ7DN7q0sfDo 4qPg+zv3pM5G48FYS47EiVeG8V4Rdinu9Z8ae9/EAZOwiyLMyhJuFSud9XwTp0h1w6ybhU 3um0CJDlXlXb/kxMqqXdwMY/AgmZazsUmYVag0E1YWRM3yMgwhY+h8zeK7bDVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VFZrt4T7SRcgSEvqZX0wKX9Xx8B8RxaPF76xz73b+2w=; b=FVH5Rnz20y5WhyyZN0c4WxVNbMdn5VziVPNbGbkxeT/jtIEZQQ7M11FisqSw/YgBGOZniy fLq3++rXf8xwv2xlIWEU1Ge2eukl55KkN9/aGe8k585pQV9zykDTbXhMx3rv74kRmnSD+u HGVJDnESZci69ii+xrV7OWic5UM3DX8BbOxmBlx8IiY7hhWVQpocrzNtAbWQ8DG3NYEukJ Rkl/E6pbvEildMHiopx+lAp4Vzmu0a7R9bvTO6gFdlCvbz94gJlkbUSAPArSW+8w4mPqNa EyrA4+o6HYDcO7LIylkhW1t7XAt2P4qU1/ttlIopxEAlsqtxnCr6ST7Yt2zGWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBN6z8jzpZW; Thu, 1 Aug 2024 14:57: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 471EvWAk057505; Thu, 1 Aug 2024 14:57:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EvW27057502; Thu, 1 Aug 2024 14:57:32 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:32 GMT Message-Id: <202408011457.471EvW27057502@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: 35d217ae021c - stable/13 - stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 35d217ae021cbbde1e7e02dd7a8534235be5741a Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=35d217ae021cbbde1e7e02dd7a8534235be5741a commit 35d217ae021cbbde1e7e02dd7a8534235be5741a Author: Warner Losh AuthorDate: 2024-07-25 03:15:28 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:51:30 +0000 stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader This saves space to allow pxeboot to work again. Users desiring these features can turn them on for their custom build. While these are useful for some specialized applications, they aren't needed to boot the typical system, and we're low on space. text data bss dec hex filename Before: 465866 20740 31612 518218 0x7e84a loader_lua.bin After: 441535 17484 31092 490111 0x77a7f loader_lua.bin Savings: 28,107 bytes Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42416 (cherry picked from commit 195a96f0b303345818e09ad1d79dc80122804de8) --- stand/i386/loader/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 6657b116be30..f76d33ff4499 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -5,11 +5,11 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes -LOADER_EXT2FS_SUPPORT?= yes -LOADER_MSDOS_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= yes +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no .include From nobody Thu Aug 1 14:57:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBQ1P5Lz5Stfc; Thu, 01 Aug 2024 14:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBQ0r5Fz4MFg; Thu, 1 Aug 2024 14:57:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaKZQc2oCXay7vLjkZADYu0BxSjIfWYfcxPCFlih0Ys=; b=igvossbXXmD7ABwOfwlHhE6nbAGaVhHpG/2jQauCFmZHCQuz7NZHvb3NFmzno6LVAGprlP 16bMLd5kUP3tZg5w3WnRodxz+B6a+FR6hbkRR4+5Q/PDnwA7MgY6FTvk2s6ftTWpkbPV1e KOxd+h9QmRy1tLDENw1F4WNebKrHyZ7ohD6y18KQTDuHlI5T5BaVB9KFftlTo6LlLIfX6t TitGV9x9ofYhhKWJz8iM87d+6akZWGT5r5Hd0w+6XozUE4wBSm6nD0z2V9gFOJzFsvWM1i tg4yLFp6TorlDBz3vSy+5c2z5gNMgdDYyZQXCsinUG9XkRjH46PsYClecXbPDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524254; a=rsa-sha256; cv=none; b=fR2GeoTaQv1eYLqAQFVJT5Jy8zzq6NuLM+bkQwBMwqyGcXw9thVHHAQjNLUP0zNNqkmPg1 HeYg+7jwdLMDhPqRdEC+YOcn48dgmhp517QmZrYRFC22D0/UkEqNTLhjlUaowY6nERlV7S SyDTQb9xHkryxpIhWS8F5GplgqCigqnuCEPGrkjYrlsa0c/ROY10A/zFXwl5bTBmsP6R2s NunfyUvtl81droIJnsYXHq4zMnRgvAsfLJWZW7rGDvekN9pBNq48Wjc+yBF7wl2zog7Tx8 zaaGVBxgNXoG6Jw3NhUgZrvxsHREX6ZO8arax4gjHaT6oSCxooxZjUx7GB9/6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WaKZQc2oCXay7vLjkZADYu0BxSjIfWYfcxPCFlih0Ys=; b=Sv1X5j6Qq9dwVUJGctA7D+evbpSj+ZZhSIpAyHVs8nrTs8ej/tzCU14ta64tgLazgiP267 qIPRj/ltvxUD0vA51+QQaTyfA2QNDdLzfdlue64M7TrikybwlLZfCYVozH1HyNyrmuba+c mEddWR928lQMwB2Yr5qBDY7g9gZ+/diaej7Y2wGNU1AySrFSq/KYBvQfO2bzf8AZdO+1aq yAZX0P1GXjq38v5qwIqR1y0zrvgCf4LdT/Z+5SxYojq2Ak8lyqiWu1YAHi+El35NYapOHY n6W+vNHJBJ4rzlMScMbN7cFlJBt6VCXKw4GyGTlFpfSaG47iOvoGNcQLPjW7gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBQ0Rcvzq4b; Thu, 1 Aug 2024 14:57: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 471EvYAM057544; Thu, 1 Aug 2024 14:57:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EvYOl057541; Thu, 1 Aug 2024 14:57:34 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:34 GMT Message-Id: <202408011457.471EvYOl057541@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: 4d66d691e35b - stable/13 - stand: Remove obsolete junk List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 4d66d691e35b59c5acd1ba14cb27859812d3e863 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4d66d691e35b59c5acd1ba14cb27859812d3e863 commit 4d66d691e35b59c5acd1ba14cb27859812d3e863 Author: Warner Losh AuthorDate: 2024-07-29 22:56:28 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:52:08 +0000 stand: Remove obsolete junk We long ago changed newvers.sh to make these comments bogus. Remove them since every single one of them is broken after the $FreeBSD$ removal. MFC Note: veriexec loader not updates since not in 13 Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D45879 (cherry picked from commit 8165650389ba2d0a68cea6902ac3750055cad9da) --- stand/efi/loader/version | 4 ---- stand/i386/loader/version | 4 ---- stand/kboot/version | 5 ----- stand/powerpc/ofw/version | 4 ---- stand/uboot/version | 4 ---- stand/userboot/userboot/version | 1 - 6 files changed, 22 deletions(-) diff --git a/stand/efi/loader/version b/stand/efi/loader/version index 2bed97c231d2..4d6c3592e10a 100644 --- a/stand/efi/loader/version +++ b/stand/efi/loader/version @@ -1,6 +1,2 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.1: Keep in sync with i386 version. 0.1: Initial i386 version. Derived from ia64. diff --git a/stand/i386/loader/version b/stand/i386/loader/version index ea8067efa243..e5fdb8976bf2 100644 --- a/stand/i386/loader/version +++ b/stand/i386/loader/version @@ -1,7 +1,3 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.1: New calling conventions for fopen. 1.0: New semantics for finding the kernel, new boot. 0.8: Set/getenv & cia, copyin/out. diff --git a/stand/kboot/version b/stand/kboot/version index b24d6ea8e47a..a142c2b0ce2c 100644 --- a/stand/kboot/version +++ b/stand/kboot/version @@ -1,6 +1 @@ -$FreeBSD: user/nwhitehorn/kboot/powerpc/kboot/version 224106 2011-07-16 19:01:09Z nwhitehorn $ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 0.1: Initial kboot/PowerPC version. diff --git a/stand/powerpc/ofw/version b/stand/powerpc/ofw/version index 145f69c28aa4..24bdc8254ce3 100644 --- a/stand/powerpc/ofw/version +++ b/stand/powerpc/ofw/version @@ -1,5 +1 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 0.1: Initial OFW/PowerPC version. diff --git a/stand/uboot/version b/stand/uboot/version index 71464740dcc9..e779e403e7ec 100644 --- a/stand/uboot/version +++ b/stand/uboot/version @@ -1,5 +1 @@ - -NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this -file is important. Make sure the current version number is on line 6. - 1.5: Unified ubldr build diff --git a/stand/userboot/userboot/version b/stand/userboot/userboot/version index 3b86a26c72ae..f361513b2741 100644 --- a/stand/userboot/userboot/version +++ b/stand/userboot/userboot/version @@ -1,4 +1,3 @@ - 1.2: Userboot with lua or forth 1.1: Initial userland boot From nobody Thu Aug 1 14:57:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBR4cGNz5StZ9; Thu, 01 Aug 2024 14:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBR1tzrz4MY7; Thu, 1 Aug 2024 14:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXjzf+LRizZgckUsFisR1Vl3mtSTp97Wu5mRE7XlJEg=; b=rJ/l10KWlnnTCDUsR463GARnuMY2NaRXeIsW+ZoxQAKyLjnrfZORysU7bqpo9izcPa0LxD uuM0QzzZnyOnxOAvd8JC9y07p2IKaZ7j3CX8BPtOe1og7VCGvZ1RkJ5FHh/KWdIE1aVriw OhaB/+sE4hkBqvOkk+HbIn0ZB4XcMp5MWYVQNMVBqVWbg9E5u2gN7sTKtPIG1O8iFioso9 isNG7XKeP1c8SacaimjtodVtMbcvt9E56OT19/pz2ATRRYODh6Mx1D8cCKtz7AjH6t7xBV IZEsm+ye12HhfRVm3Vk3kcRYp8mUIjD0CIWPJyest3SSlrDF7Mnqx50pnTVnGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524255; a=rsa-sha256; cv=none; b=tJVH9qqHY6XTeUlg5Ymd7TpzQvhogDnAgn5CCrvAoMJEqi5S3dTzXz0k4cl+xcynx02yFp IXMK19fj5uB02JCWY5MImoaNYl1nkoOdT7bXjvDhHUGTry4/3KUyRWeVPHQDDV2zewkSHk TBMYYEcy6uYlJXk7EYXTaFNi8nImaPBjfvTZlR4Jj8/9Ejv1GB7gGxpfKZBgNzkdPAKSMV SbeAWCP8xtBNqaerPMshYIGIXuCjp20YRyjN0/6h+eqyGSuNCcFcXQ7Euylq8Gfh6YJswZ ftyVLVhkzFVUxM/U1HHkjQ1rJOEOgLmT3sO6NTDhV0hRmv1sug+aFd5XlZ4yzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VXjzf+LRizZgckUsFisR1Vl3mtSTp97Wu5mRE7XlJEg=; b=Q3SFD1xJ1iMaPIBpx2XsY8tyXb7+XjQ3/j0gIEJQzYJLv70RvnPZBhri6ISfuWkecm7N+X xxFL8O4/rGhRVVi3fOgMNSW0V5+qQvASRO80CPscWc5UNhpdx/KjMt9sQyx7Pswi3RZ+Dy lAxImmFVe+8OaquNtpa/zExQ/CXQBjSP5I1fohbK7Y7J8UQVM6cZc0agdeSFeTPebR53aQ L23RwBggkUvB4JgVfj1ltJEIn71VJQMaXL5oUtrmpdpwh/J+OCGtMp390BwZevPecl2F7y QK5D8rfprmqE4Vo03u9wbvqF53K+Di/36zoHNWUobGU6teMCYBT1vWv/VNxY2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBR1TG8zpKb; Thu, 1 Aug 2024 14:57:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471EvZZj057593; Thu, 1 Aug 2024 14:57:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EvZLB057590; Thu, 1 Aug 2024 14:57:35 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:35 GMT Message-Id: <202408011457.471EvZLB057590@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: 747ebeceee51 - stable/13 - stand: Kill commented out line List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 747ebeceee51d5756142231e693fb2fde60698d1 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=747ebeceee51d5756142231e693fb2fde60698d1 commit 747ebeceee51d5756142231e693fb2fde60698d1 Author: Warner Losh AuthorDate: 2024-07-29 22:56:48 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:52:37 +0000 stand: Kill commented out line This line is no longer needed as fallback, and should have been deleted in 7870a52598ad8 instead of commented out, but 26 years later, I have a high degree of confidence that old change was right and we won't need this line as a fallback. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D45880 (cherry picked from commit 65300ca729452f62c201baedcbb4a67f2afc5ed5) --- stand/common/newvers.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/stand/common/newvers.sh b/stand/common/newvers.sh index 9206f60841ce..ee7678597b7a 100755 --- a/stand/common/newvers.sh +++ b/stand/common/newvers.sh @@ -46,7 +46,6 @@ shift $((OPTIND - 1)) LC_ALL=C; export LC_ALL u=${USER-root} h=${HOSTNAME-`hostname`} t=`date` -#r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` bootprog_info="FreeBSD/${3} ${2}, Revision ${r}\\n" From nobody Thu Aug 1 14:57:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBS6mL2z5StjJ; Thu, 01 Aug 2024 14:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBS3MWpz4Mc2; Thu, 1 Aug 2024 14:57:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRdh9sUbtuJglA+keHgNmkSaoc4GVyfF30+KIOGYcZo=; b=dVJfjMsq5Buum1IB1gSVAXAJ1E0t4/lcB59FmanDz+DZtczN5UpYnFp07u7QRZJvbGbr6u RNO6T3CxyDLgs4D0drptzRtbB73ltuFLcd7EFqVepKlxMzQGXYBMNt+Z3Pnc/hp3LcR9cp 83e9UqMD9iVp6N0q3KAAvRfpBVuThIZdpAsBkpjasZDSTMX5rYEkqpnP0DHgtM1YOTfh84 V58agMfU5xC+j2c84wQfgTd44y9gz5DA/L2W/At08C+3DNIlakEa8It728L9Qt/8F9KgSE 8J/OYlYpw3hV4xPD/QGPxuA3r3UeIZWOpyK9RQOouxobvlyALh4mWrACEn+yvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524256; a=rsa-sha256; cv=none; b=rec/gCVfaCJiX0VDI1J1Tk02oiq2KZuhSm8mx2GKm6k0RrmZFFaG7gQftqhlJhu0S5/AgU ScoEEwGLKGe6JJ2Hq3purMafFKxWdaI5apJ+Y4CNPOo5CsT6N6/WtGo5yBF1yKv3tP0osf FcN98SrJ1sseUXjP+58ZEocjqpC6h9xANwF4r21QKkD0gcSz3ro5SXmMNzjFZIxrIHwqZu 3N48/NhDe6l7Gcw4fKfiTcZTklN31U8z53vlBAPzGZcHYZQ+yyYN5ZCDA83gjka4oqK9oe SGLl7o6RWkCrxVg1I58f1451WAXgO+pzvU1dzUEJFAWYEgoSdUZI9EjBQgu4Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRdh9sUbtuJglA+keHgNmkSaoc4GVyfF30+KIOGYcZo=; b=IRaddRETkN5RjgYfYFZKn2VN66obkowbYlAQRcmpB/8WyL+nVDim6LssSFWw3Z54u3rilN 2tKN027abYdwgrwSpGSfpnHpQC0NB5E3HGtrVsFoWiX3NOTthT+Y3QiUfz1EUcuFwZVXMc LKshtkiQqJK4sL/0gGrpI6lJUEAGsUB4Pmpa17DzPLsRYM0TADUG71+YaDDz0BnMzHVDt7 9HJyIJBYsihbU5Fzf724GEgwVSqIox63p4AdQ456N9gBXLC2t0NB/SVwwc4c4aox6bHpIt tDwbz5MFp9IGL9/sq2Tigr8faSA+/L/rqN2txrdKeXJ0UqaeUvqqpbnlhxDUaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBS2SWxzpxq; Thu, 1 Aug 2024 14:57: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 471EvaEq057641; Thu, 1 Aug 2024 14:57:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Eva5v057638; Thu, 1 Aug 2024 14:57:36 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:36 GMT Message-Id: <202408011457.471Eva5v057638@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: 661db7ce611a - stable/13 - loader: Bump all versions to 3.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: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 661db7ce611a83745312edd1a7b3ade62d2273b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=661db7ce611a83745312edd1a7b3ade62d2273b4 commit 661db7ce611a83745312edd1a7b3ade62d2273b4 Author: Warner Losh AuthorDate: 2024-07-29 22:57:22 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:53:29 +0000 loader: Bump all versions to 3.0 Each incompatible change we make, we bump the major version. We've not done the bump in a while, so sync everybody to 3.0. Anything older than 3.0 will be given a warning that their boot loader is too old. We check only the major version, though, so minor versions can still be bumped for individual loaders (though I honestly doubt we'll ever need to do that again). MFC Note: veriexec version not update as not in 13 Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45888 (cherry picked from commit 9f7f90507528aaa9a2f54575c1d4f4010d01c2e5) --- stand/efi/loader/version | 1 + stand/i386/loader/version | 1 + stand/kboot/version | 1 + stand/powerpc/ofw/version | 1 + stand/uboot/version | 1 + stand/userboot/userboot/version | 1 + 6 files changed, 6 insertions(+) diff --git a/stand/efi/loader/version b/stand/efi/loader/version index 4d6c3592e10a..570796b66956 100644 --- a/stand/efi/loader/version +++ b/stand/efi/loader/version @@ -1,2 +1,3 @@ +3.0: Lua scripts API stability 1.1: Keep in sync with i386 version. 0.1: Initial i386 version. Derived from ia64. diff --git a/stand/i386/loader/version b/stand/i386/loader/version index e5fdb8976bf2..82229ae6a06d 100644 --- a/stand/i386/loader/version +++ b/stand/i386/loader/version @@ -1,3 +1,4 @@ +3.0: Lua scripts API stability 1.1: New calling conventions for fopen. 1.0: New semantics for finding the kernel, new boot. 0.8: Set/getenv & cia, copyin/out. diff --git a/stand/kboot/version b/stand/kboot/version index a142c2b0ce2c..be162b693ada 100644 --- a/stand/kboot/version +++ b/stand/kboot/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 0.1: Initial kboot/PowerPC version. diff --git a/stand/powerpc/ofw/version b/stand/powerpc/ofw/version index 24bdc8254ce3..fd8b01228f46 100644 --- a/stand/powerpc/ofw/version +++ b/stand/powerpc/ofw/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 0.1: Initial OFW/PowerPC version. diff --git a/stand/uboot/version b/stand/uboot/version index e779e403e7ec..0293880a1f90 100644 --- a/stand/uboot/version +++ b/stand/uboot/version @@ -1 +1,2 @@ +3.0: Lua scripts API stability 1.5: Unified ubldr build diff --git a/stand/userboot/userboot/version b/stand/userboot/userboot/version index f361513b2741..2fba2c27eabc 100644 --- a/stand/userboot/userboot/version +++ b/stand/userboot/userboot/version @@ -1,3 +1,4 @@ +3.0: Lua scripts API stability 1.2: Userboot with lua or forth 1.1: Initial userland boot From nobody Thu Aug 1 14:57:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBT668Qz5StZD; Thu, 01 Aug 2024 14:57:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBT3l2bz4MPB; Thu, 1 Aug 2024 14:57:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZwvKrVtVDvvMVry9GBEBwpYaPIhfYc31fYiRigfoUY=; b=kKLWqBzu7boYcvlC8XrSqUEG5A6pA7Cn9XIZmnKTXBem/bEXwpWDEG6fTiN+CH3O5dO296 Zpi6GmRswGAHItK4ineQqYfkXUnVfkbzJVIFWt8mYA78v5olA+CeVPVS187c9jSwjsvDy+ mS4XcIIPr2SR+VXmMEdiPHOypUhbMlwO+xUjjOeHkUwongRwde5AWRPI3j4l9htPS8G+sP yWaSAQPdYc3J5/o0rKBG1P0LQ1bOBHGX9r6kdwnwlZCxWn5qDH81bcJ6IbiTsJP4nClNJ/ iJVq+oUk1aQACfn0JjbI+8jaxKEpiqDOrIy+GLxvSMdAsBxCM2Bogapqfcc9Rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524257; a=rsa-sha256; cv=none; b=hQ1FnlAvESpVPN3EP7pTmQId2DCN1BMbrh5LfdIx8HTCaodkfwh8Ps9U5R1ZeKivxXY2c4 9uUDBYdqwyNSquwgKRPVMgqYEoQ7YT1wXzZALN77rxJ0ZtL92O0fP+I1ZNsWwj24koGrhM pArP3APvpZyhv9sOC8hXlHCWKv614uA4Xf5z5QHx/86FK0YSflc+8rE1EFEnLTSq25WKJT zNSJD/c5c127m9MrwXuiRP76XOyq9OPe/mDjkotU3ud1oTJ9iwvjROEIkcd7fx0N4Q60nM qnogrnl430+btbm5/EYY0APFTYQhH9mPHXVwQAf2VD5iMUFjPQa3vpnqkD9PHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GZwvKrVtVDvvMVry9GBEBwpYaPIhfYc31fYiRigfoUY=; b=DYwGOLVmc6CcAiRyDiTC5BE211oVfzJDAPvhw3H/eEQidtAGN4rJJeNhUHQlLlK/g4tqc6 c/dul1T9MJK/nUN47rvtE76OYl29fexHkLPjyor22QOpGe3GKznTacyngMhZ/dZ3+RVeBU H7gjnuDmI2IGmkfJqCms80X6jxDXnaDXv5YPPcOJUlGo3mxl3ZAjP0CXdFrJNK2ttZHkSL elithp/rwL/jW+1QZ1ccVjUs8RmlpdialonzBF9uWH8+WQx6OXdCg8g3PpuMlT7OMEPMyu cv5g/FgxPgAMlFBIAVbUSDLBwmqpI3TnBItzR5En6dk2BubGw7uUjC36HBpdqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBT3JmRzpZX; Thu, 1 Aug 2024 14:57: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 471Evb9u057703; Thu, 1 Aug 2024 14:57:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Evboq057700; Thu, 1 Aug 2024 14:57:37 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:37 GMT Message-Id: <202408011457.471Evboq057700@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: 6b0a2b19c845 - stable/13 - stand: Print a warning of the loader is too old List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 6b0a2b19c84551251336efdde40f96848b199050 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6b0a2b19c84551251336efdde40f96848b199050 commit 6b0a2b19c84551251336efdde40f96848b199050 Author: Warner Losh AuthorDate: 2024-07-29 22:57:30 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:53:46 +0000 stand: Print a warning of the loader is too old If the loader is < 3.0, print a warning that it's too old and needs to be upgraded. Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D45889 (cherry picked from commit a2fd7ae87991044ca283974ced8f6ed635d1cb0c) --- stand/lua/core.lua | 21 +++++++++++++++++++++ stand/lua/core.lua.8 | 4 ++++ 2 files changed, 25 insertions(+) diff --git a/stand/lua/core.lua b/stand/lua/core.lua index 747f8c1f0fcf..81ba5d561442 100644 --- a/stand/lua/core.lua +++ b/stand/lua/core.lua @@ -549,6 +549,27 @@ function core.nextConsoleChoice() end end +-- Sanity check the boot loader revision +-- Loaders with version 3.0 have everything that we need without backwards +-- compatible hacks. Warn users that still have old versions to upgrade so +-- that we can remove the backwards compatible hacks in the future since +-- they have been there a long time. +local loader_major = 3 + +function core.loaderTooOld() + return loader.version == nil or loader.version < loader_major * 1000 +end + +if core.loaderTooOld() then + print("**********************************************************************") + print("**********************************************************************") + print("***** *****") + print("***** BOOT LOADER IS TOO OLD. PLEASE UPGRADE. *****") + print("***** *****") + print("**********************************************************************") + print("**********************************************************************") +end + recordDefaults() hook.register("config.reloaded", core.clearCachedKernels) return core diff --git a/stand/lua/core.lua.8 b/stand/lua/core.lua.8 index e1752475f942..7ab3f6e4ff12 100644 --- a/stand/lua/core.lua.8 +++ b/stand/lua/core.lua.8 @@ -224,6 +224,10 @@ If there are no elements, this returns nil and nil. If there is one element, this returns the front element and an empty table. This will not operate on truly associative tables; numeric indices are required. +.It Fn core.loaderTooOld +Returns true if the loader is too old. +Specifically, this means, is the loader old enough to require one or more +workarounds in the current lua base modules. .El .Sh SEE ALSO .Xr loader.conf 5 , From nobody Thu Aug 1 14:57:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXBV73hBz5StNW; Thu, 01 Aug 2024 14:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXBV4KcGz4MWf; Thu, 1 Aug 2024 14:57:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvaBEiIJuErzIiJPAczDTHvDgG+ub++zlMPGpvfQnIY=; b=RBacljfPHng9LGeCYSWs/tuXu7c9s9iPv2pAuEYLxgl/BEUH/X5T4Mpws7/Ni66M0Fkm9i 9w29GrGqwb8X15kz0v0DDgveYB7VvkNC09uO5CdWKDM3H4uLc7sBpqfZtP6juP/Lpex2VV u+/UwZIrmhayQVT//7qmKf22zyHFwC5R8lYZd0EbSXX86NbwObU1An8lP0DZs1M5s09Ut+ c08M5+/vD4ssCPc63zgaZ1pHmRrjBDQv+Dev67+PB0QLIj/dR/pqoHkUgb8JLqxgud8MMW 4st0AFMKjrsEHm8APSZqkeWQl0Qz2g6hPGSJG1eadBbpj77RjAHOKNBES1GhbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524258; a=rsa-sha256; cv=none; b=wLWPTjKtvCC9oPb8MNPqrzrCAcgyzYd+ixiMnJkPoeJ6+eloxJ3i32TaUOTGbt/GQE2+Pi kshIX1FH7+p7DWxxlL3qVvUDKTMr3TSMgD5zZq+UHSQOi3IgfKY21lwiqG4pzw0YrQfcKy WtqrpCkAEPcS2Wkx1d8CWw1OpiZLSqbCgxnIwGvDRpYOOOn+xPpDxuptSjvhnemu2p8CYZ s8f/HTcVZ3W8LtAiAm2k9jZhR6P+vwPSa04lqcdY+yHkZRpZ1jsZ1usK253ZxycTg/FcL4 08LcfeMXGbouv0MZH4kFTJiFiK+IGGEhQV2HK5RbjfNQ7KvOTgI0PUDxiqQ1cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvaBEiIJuErzIiJPAczDTHvDgG+ub++zlMPGpvfQnIY=; b=NOPaXUjeENJyIcT9965Z7eNFgkXQ2efjJtn2t0X9AUOrXGjgjpn20FMjAvzhG5kvuzWuDT WsRqIW4Nbktmq6fbVeNlwBVQYSR0I3QzoMRyHw+WJ1EmDEyKOTefzpcUkM0SLAiY3yllSp /RY9oOrkgKIpM9GDP4oxRa8lVj3SlVlpZfEkPv5tatvUypUNdFrKGcDsj66oA7wY6eMFEp KLa5ApBhGnh1dE+OjoK/C5aTQ3wKDL2NfX1NAxSZVPwgsdbQ2xx4EVyBHEkv0+D333SqUB lImGz3xDUJkvqlx6PHiksT9+VJPMp9xAR4uCAAa3r6JI2PH9s6qkDg6OH9W73A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXBV3xq4zpxr; Thu, 1 Aug 2024 14:57: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 471EvcMm057763; Thu, 1 Aug 2024 14:57:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471EvcOQ057760; Thu, 1 Aug 2024 14:57:38 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:57:38 GMT Message-Id: <202408011457.471EvcOQ057760@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: 934691dbf34d - stable/13 - stand: Add "Loader needs updating" to the first menu item" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 934691dbf34daaf193451ad9bae978803f813de8 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=934691dbf34daaf193451ad9bae978803f813de8 commit 934691dbf34daaf193451ad9bae978803f813de8 Author: Warner Losh AuthorDate: 2024-07-29 22:57:37 +0000 Commit: Warner Losh CommitDate: 2024-08-01 14:57:14 +0000 stand: Add "Loader needs updating" to the first menu item" When the boot loader version is too old, add a warning to the boot menu to maybe catch people's attention. Use the correct loader code that adds an inactive highlighted menu item indicating that an update is needed. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45890 (cherry picked from commit 0eac99f76ec31270f902cc2a0ff5ae4b5b606a65) (cherry picked from commit 7cb65be96d47cbe0b740266bc633d272fc4c5e6b) --- stand/lua/menu.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua index 7da03ad9e673..d74c7cd68791 100644 --- a/stand/lua/menu.lua +++ b/stand/lua/menu.lua @@ -263,6 +263,10 @@ menu.welcome = { menu_entries.boot_envs, menu_entries.chainload, menu_entries.vendor, + { + entry_type = core.MENU_SEPARATOR, + }, + menu_entries.loader_needs_upgrade, } end, all_entries = { @@ -411,6 +415,15 @@ menu.welcome = { end, alias = {"l", "L"}, }, + loader_needs_upgrade = { + entry_type = core.MENU_SEPARATOR, + name = function() + return color.highlight("Loader needs to be updated") + end, + visible = function() + return core.loaderTooOld() + end + }, vendor = { entry_type = core.MENU_ENTRY, visible = function() From nobody Thu Aug 1 14:59:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXD54S74z5Stfy; Thu, 01 Aug 2024 14:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXD53vX8z4Nww; Thu, 1 Aug 2024 14:59:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g5jj5GrbVe3nC4gWbTKyXd8sxW75KOjuqNFv3laxer4=; b=jGy4dTaPSLLrCCS2dDYJayv2cRxdvnX9606wTYGEeDusZ2jUssNLR9XVHQG2ukF5aNUjFc 8atEJ2PSCnoFPf7I/cC+KrSc86V7n+z+WKEciJuXdyfqexm4ANK9M7OVkFlMo8qQ2g36Qh Xgn6kH5Sno06G2eh6vLgXTgcEwyvE/3/3Uplv3LdtK8zJ+KVZ1oRlJVnlpClT5IPk/j7Nx v4FF5w589odkeDe5r9biwnSvDjjP42FH87zW1tuVVz6Xvh2eYdYxIv7NGc8OaPBd2z3wcn oPyXO9+IwCxr/LO532HvpFdzTqedZncS5WkFMqNYgMypCKmga2N6Sp0EBYUbLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524341; a=rsa-sha256; cv=none; b=aLM+JVbuedfr+eY6mAGjmbeZbQTclhEtQmqSE74QwyCxToDzhPZ5MFWpZmEsbexEiYpzUf YUkCqgpcHdawW+Rx5pAP88OXJTWqhQl0uiL8MGmVWDi8mTh61fGSNpAY3agD1DR/zJzJUa AzLuRP1BZ6BnuT+yJl9zM3GyxAewY9iFJBV0bgSiJl8sukWmAzJhjPAZKWt3W1hzrd7uYt XNbIGbUccbQtvyrXREr/iOfjKWmza+8M0lACBQ1gaeUa1NnzRsNx5m4awa7N6ew3KyBGHE eQlssRu1UCZeyPfi1uJkP5cx41z1gHIy8I/D6vEQSGxZ6zhajUHpaonSis3mkw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g5jj5GrbVe3nC4gWbTKyXd8sxW75KOjuqNFv3laxer4=; b=FZwaAOkEGaRoenqtAMpPzZiKIUjIga40vlctoINAs+qvQDr0Q0xfmI+hDVwHSpItQEClB8 iKMkzo2PP5nmqDtIQb0ToAWUN7Qokd33BMP7Dfh5LsVhttbjYPFReoNsnNKyuciNLgCdWM zq4nBscHWTFLUdZM6yd8wRlx7krS1ozYXyTPoupwHyIyqlHm67lkquNleWN745fBdIMAH1 NGTc/AjRPLwzqsW1bn76hvzvBl58ImLpUlTVQ855Zn/lQ/W0j3q/0xH5H7x3cwEm2swkiG UPn44kJtc03Q6BkR+3S4os4ZpaiEbrHg6nb118GfurF3ldcj3U6+IWuPlgKIFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXD53Vtfzq5c; Thu, 1 Aug 2024 14:59: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 471Ex1Ti058118; Thu, 1 Aug 2024 14:59:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Ex1Nw058115; Thu, 1 Aug 2024 14:59:01 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:59:01 GMT Message-Id: <202408011459.471Ex1Nw058115@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: 5dd58282db16 - stable/14 - mptutil: correct man page date List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 5dd58282db165cf9ccc05bf78f44a5d406654ca8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5dd58282db165cf9ccc05bf78f44a5d406654ca8 commit 5dd58282db165cf9ccc05bf78f44a5d406654ca8 Author: Ed Maste AuthorDate: 2024-05-25 18:00:54 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:55:29 +0000 mptutil: correct man page date PR: 279201 Fixes: 9a49a3792940 ("mptutil: document that disabled/enab...") Sponsored by: The FreeBSD Foundation (cherry picked from commit b128bedfb95c1fefe10e3375b07e200eff8c3664) --- usr.sbin/mptutil/mptutil.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mptutil/mptutil.8 b/usr.sbin/mptutil/mptutil.8 index 47eb9e43d2b9..1aeaafbfa12e 100644 --- a/usr.sbin/mptutil/mptutil.8 +++ b/usr.sbin/mptutil/mptutil.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 24, 2024 +.Dd May 24, 2023 .Dt MPTUTIL 8 .Os .Sh NAME From nobody Thu Aug 1 14:59:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXD66L9Hz5Stg0; Thu, 01 Aug 2024 14:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXD64xYwz4P2V; Thu, 1 Aug 2024 14:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLYB+snWTNL6IHLP8NcPgp5pUejZ+M/GEtfiTOoc5Pg=; b=TNN0lepqBz0opBD1g2oNNLZUSvKKB645AgF8MhqRrz+kYtohNHkcGitE4tc9nDGeLc7/5C /5kWaEBxOJRTXsxqw7Y5vua03awfaKKFqQ2exsWpIF+3pzSVOGNdr3qJ2jB9Kpm/ibn8kX 1MuGYpifBnbEYuj6jGKO/Xn6h7wa+hzQH55D3nhvwflzN3EceeVxekJVefNv0c6XuEVcMY buiWgK3LtycLxFaWmYqn1OEUOca8VSY8HGvpApB6zLLfe5+ZFG6LN4oHmfywjbc11cQsWI tF8cLmIXiRfopw/tYLyaSNxwAIoTo/itcNzq4j3nPgt5qsOlUtOql1ueV+/UvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524342; a=rsa-sha256; cv=none; b=Z0VaRlklXLtkXgUs2CcR+A7Ny+OQQvnQpvsxyi7iia7dvpZAnD/lDJbDXjQzMkR3Y0/qKM dxfNKhDHO1eU9lb5UeCGoZbiG4FuvVeeA4qOuFrxJj8BQJ+MqZ6hEG3b/wkFX5cRgkf8rc g+BMqyIMk3zlwMt2waO2kR2V5VTiU5lv2c7tW0B3pyG3oNC+hlY/NgYaJrUgopBDGnFS/j sXoG3sAh8m7xqlfJgE8qFGIBg82Q1LiWzQjP3crwpivAIF1s0zR70Now5gG4Oq57MRl3Dm Owje91VEZbwI/3hnoJopPiptxOAY0reHjv7CmO5NaBrj17WunCLISZSfK0JYnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nLYB+snWTNL6IHLP8NcPgp5pUejZ+M/GEtfiTOoc5Pg=; b=Z1m9s1wj44tnljyxx0Vc2OuJBEJZq4wZVcGlUL0KhZrfgcE92sCX3+Xg92bNwrb8vlhwY3 zezJZWuR3D9W2gXSRgq2zfCGxEQKJuuswy6ZVIVzu1iT4ww0XSqUpuJ97aokEXy8kH1Ol/ DwD4mW/0XVdYmxv62QF59bh/JcIGG2q9JuE6eqHq5uwuzKFbdbclumjBMtHd48imrmpm7i lItN5BFDNnwFUgxRR/C9mG+084/HICXZHNdShNUzQXukbBrWe3NEmPIp+S7NR5CuX8ZMAt 1hWEO5nECNYUOH9sV/cj/4zAsKJauNCpacoY61FpWpaxEX+CTP23lDIkMPToVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXD64Ctczq1p; Thu, 1 Aug 2024 14:59: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 471Ex26B058160; Thu, 1 Aug 2024 14:59:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Ex2ST058157; Thu, 1 Aug 2024 14:59:02 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:59:02 GMT Message-Id: <202408011459.471Ex2ST058157@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: ecd0ead0635b - stable/14 - ktrace(1): add xref to namei(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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ecd0ead0635b3d220ecf600f9136f12077dd0fca Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ecd0ead0635b3d220ecf600f9136f12077dd0fca commit ecd0ead0635b3d220ecf600f9136f12077dd0fca Author: Ed Maste AuthorDate: 2024-06-10 12:51:01 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:57:48 +0000 ktrace(1): add xref to namei(9) namei was mistaken for a typo (see GitHub pull request #1284). Add an xref to make it clear. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45546 (cherry picked from commit a87651e2ff189cec4c26cb220354f1bc93794f31) --- usr.bin/ktrace/ktrace.1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 1b287af7a611..162706c65e6e 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 -.\" -.Dd April 20, 2024 +.Dd June 10, 2024 .Dt KTRACE 1 .Os .Sh NAME @@ -50,7 +48,8 @@ The utility enables kernel trace logging for the specified processes. Kernel trace data is logged to the file .Pa ktrace.out . -The kernel operations that are traced include system calls, namei +The kernel operations that are traced include system calls, +.Xr namei 9 translations, signal processing, and .Tn I/O . .Pp @@ -201,7 +200,8 @@ Disable tracing of all user-owned processes: .Xr truss 1 , .Xr ktrace 2 , .Xr utrace 2 , -.Xr capsicum 4 +.Xr capsicum 4 , +.Xr namei 9 .Sh HISTORY The .Nm From nobody Thu Aug 1 14:59:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXD81DMxz5StZd; Thu, 01 Aug 2024 14:59:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXD75vKYz4P2X; Thu, 1 Aug 2024 14:59:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=beyhOwCwOF/eZJpK0OmAxnwb1HRZRZpmjfu+nsuR7F4=; b=NOSVQtInAdzzZ1s/rAd4RuJ/XMJvJUs3voqdXNVrh9uNOon/5Jt3B9zO8IoF1M0D/OCKj5 Kl3GdZmzXv0xseZRjRVEY4GeSGi6cERl/eFJy5fCvVAFXHn25kEEh/F2SvfOKeVEXabrEi IFOzz8Zy8q3CMUYQDe6+YVXT2wp4YcGazUQBMyYnbxFTdibGxqESfWtUozpR6j3CTNbhHe +o78l2jlypw4vBWlgnRQhaNT6j2FuKCTIgv1p0fG/IGEjhKit7LFxhJb8eEWq6wgzEyg36 BXppeKhY55pDOS/TaArxCFC2hW6dPjlt39wYZa1QaiBNv6CffAm7jYbgB+AsxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524343; a=rsa-sha256; cv=none; b=wCY7rvQrlIVDGeypGZcdIJIMbzre4LkrRYyvhJcRrGWCSwYu8KcxTGncuZnHYiytIa1UR3 KrcwpAK+xHpXlKFQ11cu083NkPLz0hg6bADg+dzs1F8VvzGieF69tqWJsd8ZyopsFdpUii 1WtWCLEhI3W6znhqrEWgMuit7OiNkOFIA4wpxiPJpRq6o/PEk9m71d8RAWBVfgExC5OBP9 ieQXNhu8dtf6wfUZFjcMTGV1N2nZvtmaSvIa3zVPCzIm8YletIDgYAbH+PD1mZJrdBJTlW 9U15oZIfExnbfJlxBilsyiUWDCKkCg8I7yo45rsjsReePsJeijY+kz0Kd7d+fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=beyhOwCwOF/eZJpK0OmAxnwb1HRZRZpmjfu+nsuR7F4=; b=DIKju3ZJGtZe8jPfur3VCAmwUfwKF3JLVrztsn/UMJ2P5SmXtf8V+wghc1kXvxm3hhWVCf DTgpUTeNS9y7Y3oRA9W2gyKFfcpoOS8FPPIaElZ9F22VWJh8TGLVx8wpdD58yeFM8GdnNX j3Mu+KQHucESN1j+XoINq1De9YQG56N32tTf2e6JhZZb37NwNSrN4ssBTHG41/o4ecVn+7 uHVSyk4saA+brR0qbiNttsOrog2KD2S8Fj1p/K9wZPeN+IyItAri8ksZKLppLuiUtapivg mrBgGly9HSeXjEJbJxn8Dp+bDGR5YAFH3PND2zSrMNB6inKOosGGXCyFT5Mo6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXD75V7bzpqR; Thu, 1 Aug 2024 14:59: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 471Ex3ft058199; Thu, 1 Aug 2024 14:59:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Ex3Or058196; Thu, 1 Aug 2024 14:59:03 GMT (envelope-from git) Date: Thu, 1 Aug 2024 14:59:03 GMT Message-Id: <202408011459.471Ex3Or058196@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: 7110def1b1db - stable/14 - ktrace(1): add more xrefs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7110def1b1dbf33d5f9e4505c0d646495f91acb6 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7110def1b1dbf33d5f9e4505c0d646495f91acb6 commit 7110def1b1dbf33d5f9e4505c0d646495f91acb6 Author: Ed Maste AuthorDate: 2024-06-11 00:31:08 +0000 Commit: Ed Maste CommitDate: 2024-08-01 14:57:48 +0000 ktrace(1): add more xrefs Following commit a87651e2ff18 add xrefs to intro(2) and sigaction(2), and use a consistent form. Suggested by: kib, arrowd Reviewed by: kib (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45555 (cherry picked from commit 0277c0c6f72a964bf0439db1f4558551052e4f3b) --- usr.bin/ktrace/ktrace.1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 162706c65e6e..5cc6df52d69a 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -48,9 +48,13 @@ The utility enables kernel trace logging for the specified processes. Kernel trace data is logged to the file .Pa ktrace.out . -The kernel operations that are traced include system calls, -.Xr namei 9 -translations, signal processing, and +The kernel operations that are traced include system calls +.Pq see Xr intro 2 , +file system path lookups +.Pq Xr namei 9 , +signal processing +.Pq Xr sigaction 2 , +and .Tn I/O . .Pp Once tracing is enabled on a process, trace data will be logged until @@ -120,7 +124,9 @@ trace page faults trace .Tn I/O .It Cm n -trace namei translations +trace +.Xr namei 9 +translations .It Cm p trace capability check failures .It Cm s @@ -198,7 +204,9 @@ Disable tracing of all user-owned processes: .Xr dtrace 1 , .Xr kdump 1 , .Xr truss 1 , +.Xr intro 2 , .Xr ktrace 2 , +.Xr sigaction 2 , .Xr utrace 2 , .Xr capsicum 4 , .Xr namei 9 From nobody Thu Aug 1 15:04:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXL00JbNz5StnP; Thu, 01 Aug 2024 15:04:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXKz6x5Bz4QMT; Thu, 1 Aug 2024 15:04:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgfl0exzEH0uqT6531klkkfU3qKatu+Xia4LJN80bX4=; b=nJ4RsI7RQynlblN1U+tMbocusobvOcQO2/buvU2MtbTs1n5Goe2SbOSNQBZ6321rqS7CR+ sVEw6yQAIrUP+JCrti9nDq4se0+w5/Wqz/RU4anzIR8YzZxe6u6Yq7nns6YWavi6sPIyOj kDBgZ66s1eZf2nPkZ8IcsFl+ECQScArAnnzoJRPfk+FTIRWBaXKKizRNmTW22m8wgjt5bW j4i2Q92NS6hoi3o8n+bCnFLX/GsnDZAJFoTC4dS6pnLnCW/FhM6SFKfbWab9fSLEtufR5R 8oPeCo5by0OK9wdWyg2hebUqsIZLrL7E2TG+7MMF41FIbKCnzjPwmmdyRQU9jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524648; a=rsa-sha256; cv=none; b=U88IzI3UNAFt/T+YqA1snfOdK5jERiz4AAIyKnmE4NdaDP7ehHgnEx14VT6TrV+16XilK5 V4BzWgBi/eRbolQe6OivG6QTWSXKWSpQpGO9+BMGUITMrsWzCFthhkG2LGb+E7ZFaPcqmp Z+aGuXKwmrbBJtFsVEAE+odAPUbRLj+al8velfSk2vQPdUKzEyG0krE789P25Rr1NSnEhv T9qmE7PR5maYx8Q0yJb3uosGaUB6qkJTqlz0djVKn7AaW73kJkqGPrpzI2885B0m4y4das vX8DIncfGuLrXO8X/lNdGk3o8/6kJcNeHDcyJNz9S+AK+/ZPytG2S9xXpKV6Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fgfl0exzEH0uqT6531klkkfU3qKatu+Xia4LJN80bX4=; b=WlWrIrh4D0dYg29YYZETAMz1nto+7nCJW8mtY345aFZWTHW8qu3WACz+dchYA9H1YyN/UB CJoADpOAjaZKbwEkNnF/hLYfT23aBViNhiMceS2BgNJUbvtQX9Xemn+gWOSZiK1umhbW3Z pzyb7g85VrrdKJ3FNit4PFFgGMIl9t3FfDPFSQgZrsqcwElD01qcJZIGaLexvsRal+n+tC BjQNAHgK6eswqXGJRaghVzBEtdqPXQMuscyxClxoMrjyv8bnLI7Voe43kTIkNTdUv25Kj1 Xk1IX8dmdkf35907T+bAif+rLX0DJC9s2wy6kQAf2grpt0XEBoVRsUDTl++yDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXKz6Wp6zpLD; Thu, 1 Aug 2024 15:04: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 471F47kc075047; Thu, 1 Aug 2024 15:04:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471F475l075044; Thu, 1 Aug 2024 15:04:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:04:07 GMT Message-Id: <202408011504.471F475l075044@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: 79853e40abd8 - stable/13 - OpenSSH: correct logic error in ObscureKeystrokeTiming List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 79853e40abd8a63bd53cbf4059032d7143c69300 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=79853e40abd8a63bd53cbf4059032d7143c69300 commit 79853e40abd8a63bd53cbf4059032d7143c69300 Author: Ed Maste AuthorDate: 2024-07-01 13:14:15 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:03:50 +0000 OpenSSH: correct logic error in ObscureKeystrokeTiming Cherry-pick fix: upstream: when sending ObscureKeystrokeTiming chaff packets, we can't rely on channel_did_enqueue to tell that there is data to send. This flag indicates that the channels code enqueued a packet on _this_ ppoll() iteration, not that data was enqueued in _any_ ppoll() iteration in the timeslice. ok markus@ OpenBSD-Commit-ID: 009b74fd2769b36b5284a0188ade182f00564136 Obtained from: openssh-portable 146c420d29d0 Reviewed by: gordon Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45823 (cherry picked from commit b81424adf7181d816c10b1345aaa3305ab0ec304) (cherry picked from commit bf9a275b24f6655616cc691555fe1a36ed5e4338) --- crypto/openssh/clientloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/clientloop.c b/crypto/openssh/clientloop.c index 8ec36af94b3f..6dcd6c8535aa 100644 --- a/crypto/openssh/clientloop.c +++ b/crypto/openssh/clientloop.c @@ -608,8 +608,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout, if (timespeccmp(&now, &chaff_until, >=)) { /* Stop if there have been no keystrokes for a while */ stop_reason = "chaff time expired"; - } else if (timespeccmp(&now, &next_interval, >=)) { - /* Otherwise if we were due to send, then send chaff */ + } else if (timespeccmp(&now, &next_interval, >=) && + !ssh_packet_have_data_to_write(ssh)) { + /* If due to send but have no data, then send chaff */ if (send_chaff(ssh)) nchaff++; } From nobody Thu Aug 1 15:04:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXL115WMz5Sv4N; Thu, 01 Aug 2024 15:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXL10GD3z4QLK; Thu, 1 Aug 2024 15:04:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bptEJ8+ox8wdbrR+JCrnoJEx2YTpYSkjI79GnWrSlq4=; b=OOIQoG+mWOB4HdVSmrgE5YwiSwpizSk3W5QXgUT2AqxV2096OLNImc2mL06GoYoVcZtUJh NYGfPHFulrWS+DE95j7RRB6tabRP/H865X6p5JNuHrxuuKDtUbm13ANPz6aVnkcwPSy4tn MhJiFZsk36Y7pMK1b2zCQ1E7kiHlqyS6qwQOUJNtS2PJgPE6Sq7Op75F4OKLUOPafxwkdS TR+b1wgeyGHZ807HD1QY9TL4wsM/Nep2r3lzdJEHcBT90m93y5qejiCmHvXdJtBHAeNtjW 09VFbE25CQBKAeYpeFAsP+1z9gzZqSSE7/mhC3E4x3j1upEcaxrRoM9SHyMAIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722524649; a=rsa-sha256; cv=none; b=JuRumlmLpN3NFTqWN4fdpAgQRPE9NyVUSJI78rcITReblwokT5+uX8glGfzQI8HE46ecSb 5Sb3qLEDQLrAFiwVYkQXNFbgkwXZj15W1KIivtIaxLildYbWJPSFbE5ZzCInoxu6GU6YD6 XgkFcfsdOCF/TWUVoWCRQawtfBVcGv78XlKxsj60FYsYn0ITq3Wp+Hu1DAA/2Lstb7p0u7 yAhhk1+EXy4vT/3aEW8mzr7cE47bgnLPHr85sD3cuv1fZkTIsrW+N/TJo1rliXXOMW1qY/ nUH6CcVkcNw7MWpffLsA/3bjjn6ecEmgnhBy2FGyKMzOJZqdoL6FvoPGpbvncg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722524649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bptEJ8+ox8wdbrR+JCrnoJEx2YTpYSkjI79GnWrSlq4=; b=mv5mbflP5zeyT2eJB3oAydoFs7FxPcBFSgVR5C1jv9te/gKZmipDw2/dOJYJGjdOyhlz9J TTBxNBS3kjhZQFvXWz4qm3wU8tVf9RcFF4XbeOJTji3q6hLG7gqyuHoScsq+B2LSxn4UrP D2Da33hJK4gDvcyYpCr+IUwKkJ7gXI4gOJByh/unXHrVLXONNPuI5XgH6sm00xJWaY752E qXLhk1Tobby7/FC2UZVWsvm/Bqf+NxJYUOflnTW6HqExNuteB4UmX+yIT6MUMkMUytaXCl ngazahrutCsjda9LUkgoky0SxhS2M7V9UApBKP718a2TDBmjhh+8ZVWXFmufwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXL06yy8zq6Q; Thu, 1 Aug 2024 15:04: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 471F48iK075098; Thu, 1 Aug 2024 15:04:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471F48qG075095; Thu, 1 Aug 2024 15:04:08 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:04:08 GMT Message-Id: <202408011504.471F48qG075095@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: fa492c77a95f - stable/13 - openssh: use '' instead of `' in config.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/13 X-Git-Reftype: branch X-Git-Commit: fa492c77a95f86c91be9e55a73fac05bd41e5fbc Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fa492c77a95f86c91be9e55a73fac05bd41e5fbc commit fa492c77a95f86c91be9e55a73fac05bd41e5fbc Author: Ed Maste AuthorDate: 2024-07-01 14:45:43 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:03:50 +0000 openssh: use '' instead of `' in config.h Autoconf 2.72 uses '' rather tha `' in comments in config.h, from autoconf commit 64df9b4523fe ("Autoconf now quotes 'like this' instead of `like this'"). Switch quoting style now to minimize diffs on the next OpenSSH update and config.h regen. Reviewed by: gordon, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45840 (cherry picked from commit 94416c6939f431b29286a71bb2797e749df9645c) (cherry picked from commit 60f78f8ed14d5e66ce689532e18282a09a1a4e72) --- crypto/openssh/config.h | 614 ++++++++++++++++++++++++------------------------ 1 file changed, 307 insertions(+), 307 deletions(-) diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 9f5cb1800951..78bd4280818a 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -196,19 +196,19 @@ /* Define if you have ut_addr_v6 in utmpx.h */ /* #undef HAVE_ADDR_V6_IN_UTMPX */ -/* Define to 1 if you have the `arc4random' function. */ +/* Define to 1 if you have the 'arc4random' function. */ #define HAVE_ARC4RANDOM 1 -/* Define to 1 if you have the `arc4random_buf' function. */ +/* Define to 1 if you have the 'arc4random_buf' function. */ #define HAVE_ARC4RANDOM_BUF 1 -/* Define to 1 if you have the `arc4random_stir' function. */ +/* Define to 1 if you have the 'arc4random_stir' function. */ /* #undef HAVE_ARC4RANDOM_STIR */ -/* Define to 1 if you have the `arc4random_uniform' function. */ +/* Define to 1 if you have the 'arc4random_uniform' function. */ #define HAVE_ARC4RANDOM_UNIFORM 1 -/* Define to 1 if you have the `asprintf' function. */ +/* Define to 1 if you have the 'asprintf' function. */ #define HAVE_ASPRINTF 1 /* OpenBSD's gcc has bounded */ @@ -220,52 +220,52 @@ /* OpenBSD's gcc has sentinel */ /* #undef HAVE_ATTRIBUTE__SENTINEL__ */ -/* Define to 1 if you have the `aug_get_machine' function. */ +/* Define to 1 if you have the 'aug_get_machine' function. */ /* #undef HAVE_AUG_GET_MACHINE */ -/* Define to 1 if you have the `auth_hostok' function. */ +/* Define to 1 if you have the 'auth_hostok' function. */ #define HAVE_AUTH_HOSTOK 1 -/* Define to 1 if you have the `auth_timeok' function. */ +/* Define to 1 if you have the 'auth_timeok' function. */ #define HAVE_AUTH_TIMEOK 1 -/* Define to 1 if you have the `b64_ntop' function. */ +/* Define to 1 if you have the 'b64_ntop' function. */ /* #undef HAVE_B64_NTOP */ -/* Define to 1 if you have the `b64_pton' function. */ +/* Define to 1 if you have the 'b64_pton' function. */ /* #undef HAVE_B64_PTON */ /* Define if you have the basename function. */ #define HAVE_BASENAME 1 -/* Define to 1 if you have the `bcopy' function. */ +/* Define to 1 if you have the 'bcopy' function. */ #define HAVE_BCOPY 1 -/* Define to 1 if you have the `bcrypt_pbkdf' function. */ +/* Define to 1 if you have the 'bcrypt_pbkdf' function. */ /* #undef HAVE_BCRYPT_PBKDF */ -/* Define to 1 if you have the `bindresvport_sa' function. */ +/* Define to 1 if you have the 'bindresvport_sa' function. */ #define HAVE_BINDRESVPORT_SA 1 -/* Define to 1 if you have the `blf_enc' function. */ +/* Define to 1 if you have the 'blf_enc' function. */ /* #undef HAVE_BLF_ENC */ /* Define to 1 if you have the header file. */ /* #undef HAVE_BLF_H */ -/* Define to 1 if you have the `Blowfish_expand0state' function. */ +/* Define to 1 if you have the 'Blowfish_expand0state' function. */ /* #undef HAVE_BLOWFISH_EXPAND0STATE */ -/* Define to 1 if you have the `Blowfish_expandstate' function. */ +/* Define to 1 if you have the 'Blowfish_expandstate' function. */ /* #undef HAVE_BLOWFISH_EXPANDSTATE */ -/* Define to 1 if you have the `Blowfish_initstate' function. */ +/* Define to 1 if you have the 'Blowfish_initstate' function. */ /* #undef HAVE_BLOWFISH_INITSTATE */ -/* Define to 1 if you have the `Blowfish_stream2word' function. */ +/* Define to 1 if you have the 'Blowfish_stream2word' function. */ /* #undef HAVE_BLOWFISH_STREAM2WORD */ -/* Define to 1 if you have the `BN_is_prime_ex' function. */ +/* Define to 1 if you have the 'BN_is_prime_ex' function. */ #define HAVE_BN_IS_PRIME_EX 1 /* Define to 1 if you have the header file. */ @@ -277,7 +277,7 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_BSTRING_H */ -/* Define to 1 if you have the `bzero' function. */ +/* Define to 1 if you have the 'bzero' function. */ #define HAVE_BZERO 1 /* calloc(0, x) returns NULL */ @@ -289,10 +289,10 @@ /* Define to 1 if you have the header file. */ #define HAVE_CAPSICUM_HELPERS_H 1 -/* Define to 1 if you have the `cap_rights_limit' function. */ +/* Define to 1 if you have the 'cap_rights_limit' function. */ #define HAVE_CAP_RIGHTS_LIMIT 1 -/* Define to 1 if you have the `clock' function. */ +/* Define to 1 if you have the 'clock' function. */ #define HAVE_CLOCK 1 /* Have clock_gettime */ @@ -301,10 +301,10 @@ /* define if you have clock_t data type */ #define HAVE_CLOCK_T 1 -/* Define to 1 if you have the `closefrom' function. */ +/* Define to 1 if you have the 'closefrom' function. */ #define HAVE_CLOSEFROM 1 -/* Define to 1 if you have the `close_range' function. */ +/* Define to 1 if you have the 'close_range' function. */ #define HAVE_CLOSE_RANGE 1 /* Define if gai_strerror() returns const char * */ @@ -313,7 +313,7 @@ /* Define if your system uses ancillary data style file descriptor passing */ #define HAVE_CONTROL_IN_MSGHDR 1 -/* Define to 1 if you have the `crypt' function. */ +/* Define to 1 if you have the 'crypt' function. */ #define HAVE_CRYPT 1 /* Define to 1 if you have the header file. */ @@ -328,111 +328,111 @@ /* Define if your libraries define daemon() */ #define HAVE_DAEMON 1 -/* Define to 1 if you have the declaration of `AI_NUMERICSERV', and to 0 if +/* Define to 1 if you have the declaration of 'AI_NUMERICSERV', and to 0 if you don't. */ #define HAVE_DECL_AI_NUMERICSERV 1 -/* Define to 1 if you have the declaration of `authenticate', and to 0 if you +/* Define to 1 if you have the declaration of 'authenticate', and to 0 if you don't. */ /* #undef HAVE_DECL_AUTHENTICATE */ -/* Define to 1 if you have the declaration of `bzero', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'bzero', and to 0 if you don't. */ #define HAVE_DECL_BZERO 1 -/* Define to 1 if you have the declaration of `ftruncate', and to 0 if you +/* Define to 1 if you have the declaration of 'ftruncate', and to 0 if you don't. */ #define HAVE_DECL_FTRUNCATE 1 -/* Define to 1 if you have the declaration of `getentropy', and to 0 if you +/* Define to 1 if you have the declaration of 'getentropy', and to 0 if you don't. */ #define HAVE_DECL_GETENTROPY 1 -/* Define to 1 if you have the declaration of `getpeereid', and to 0 if you +/* Define to 1 if you have the declaration of 'getpeereid', and to 0 if you don't. */ #define HAVE_DECL_GETPEEREID 1 -/* Define to 1 if you have the declaration of `GLOB_NOMATCH', and to 0 if you +/* Define to 1 if you have the declaration of 'GLOB_NOMATCH', and to 0 if you don't. */ #define HAVE_DECL_GLOB_NOMATCH 1 -/* Define to 1 if you have the declaration of `GSS_C_NT_HOSTBASED_SERVICE', +/* Define to 1 if you have the declaration of 'GSS_C_NT_HOSTBASED_SERVICE', and to 0 if you don't. */ /* #undef HAVE_DECL_GSS_C_NT_HOSTBASED_SERVICE */ -/* Define to 1 if you have the declaration of `howmany', and to 0 if you +/* Define to 1 if you have the declaration of 'howmany', and to 0 if you don't. */ #define HAVE_DECL_HOWMANY 1 -/* Define to 1 if you have the declaration of `h_errno', and to 0 if you +/* Define to 1 if you have the declaration of 'h_errno', and to 0 if you don't. */ #define HAVE_DECL_H_ERRNO 1 -/* Define to 1 if you have the declaration of `loginfailed', and to 0 if you +/* Define to 1 if you have the declaration of 'loginfailed', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINFAILED */ -/* Define to 1 if you have the declaration of `loginrestrictions', and to 0 if +/* Define to 1 if you have the declaration of 'loginrestrictions', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINRESTRICTIONS */ -/* Define to 1 if you have the declaration of `loginsuccess', and to 0 if you +/* Define to 1 if you have the declaration of 'loginsuccess', and to 0 if you don't. */ /* #undef HAVE_DECL_LOGINSUCCESS */ -/* Define to 1 if you have the declaration of `MAXSYMLINKS', and to 0 if you +/* Define to 1 if you have the declaration of 'MAXSYMLINKS', and to 0 if you don't. */ #define HAVE_DECL_MAXSYMLINKS 1 -/* Define to 1 if you have the declaration of `memmem', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'memmem', and to 0 if you don't. */ #define HAVE_DECL_MEMMEM 1 -/* Define to 1 if you have the declaration of `NFDBITS', and to 0 if you +/* Define to 1 if you have the declaration of 'NFDBITS', and to 0 if you don't. */ #define HAVE_DECL_NFDBITS 1 -/* Define to 1 if you have the declaration of `offsetof', and to 0 if you +/* Define to 1 if you have the declaration of 'offsetof', and to 0 if you don't. */ #define HAVE_DECL_OFFSETOF 1 -/* Define to 1 if you have the declaration of `O_NONBLOCK', and to 0 if you +/* Define to 1 if you have the declaration of 'O_NONBLOCK', and to 0 if you don't. */ #define HAVE_DECL_O_NONBLOCK 1 -/* Define to 1 if you have the declaration of `passwdexpired', and to 0 if you +/* Define to 1 if you have the declaration of 'passwdexpired', and to 0 if you don't. */ /* #undef HAVE_DECL_PASSWDEXPIRED */ -/* Define to 1 if you have the declaration of `readv', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'readv', and to 0 if you don't. */ #define HAVE_DECL_READV 1 -/* Define to 1 if you have the declaration of `setauthdb', and to 0 if you +/* Define to 1 if you have the declaration of 'setauthdb', and to 0 if you don't. */ /* #undef HAVE_DECL_SETAUTHDB */ -/* Define to 1 if you have the declaration of `SHUT_RD', and to 0 if you +/* Define to 1 if you have the declaration of 'SHUT_RD', and to 0 if you don't. */ #define HAVE_DECL_SHUT_RD 1 -/* Define to 1 if you have the declaration of `UINT32_MAX', and to 0 if you +/* Define to 1 if you have the declaration of 'UINT32_MAX', and to 0 if you don't. */ #define HAVE_DECL_UINT32_MAX 1 -/* Define to 1 if you have the declaration of `writev', and to 0 if you don't. +/* Define to 1 if you have the declaration of 'writev', and to 0 if you don't. */ #define HAVE_DECL_WRITEV 1 -/* Define to 1 if you have the declaration of `_getlong', and to 0 if you +/* Define to 1 if you have the declaration of '_getlong', and to 0 if you don't. */ #define HAVE_DECL__GETLONG 0 -/* Define to 1 if you have the declaration of `_getshort', and to 0 if you +/* Define to 1 if you have the declaration of '_getshort', and to 0 if you don't. */ #define HAVE_DECL__GETSHORT 0 -/* Define to 1 if you have the `DES_crypt' function. */ +/* Define to 1 if you have the 'DES_crypt' function. */ #define HAVE_DES_CRYPT 1 /* Define if you have /dev/ptmx */ @@ -444,40 +444,40 @@ /* Define to 1 if you have the header file. */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dirfd' function. */ +/* Define to 1 if you have the 'dirfd' function. */ #define HAVE_DIRFD 1 -/* Define to 1 if you have the `dirname' function. */ +/* Define to 1 if you have the 'dirname' function. */ #define HAVE_DIRNAME 1 -/* Define to 1 if you have the `dlopen' function. */ +/* Define to 1 if you have the 'dlopen' function. */ #define HAVE_DLOPEN 1 -/* Define to 1 if you have the `DSA_generate_parameters_ex' function. */ +/* Define to 1 if you have the 'DSA_generate_parameters_ex' function. */ #define HAVE_DSA_GENERATE_PARAMETERS_EX 1 -/* Define to 1 if you have the `EC_KEY_METHOD_new' function. */ +/* Define to 1 if you have the 'EC_KEY_METHOD_new' function. */ #define HAVE_EC_KEY_METHOD_NEW 1 /* Define to 1 if you have the header file. */ #define HAVE_ELF_H 1 -/* Define to 1 if you have the `endgrent' function. */ +/* Define to 1 if you have the 'endgrent' function. */ #define HAVE_ENDGRENT 1 /* Define to 1 if you have the header file. */ #define HAVE_ENDIAN_H 1 -/* Define to 1 if you have the `endutent' function. */ +/* Define to 1 if you have the 'endutent' function. */ /* #undef HAVE_ENDUTENT */ -/* Define to 1 if you have the `endutxent' function. */ +/* Define to 1 if you have the 'endutxent' function. */ #define HAVE_ENDUTXENT 1 -/* Define to 1 if you have the `err' function. */ +/* Define to 1 if you have the 'err' function. */ #define HAVE_ERR 1 -/* Define to 1 if you have the `errx' function. */ +/* Define to 1 if you have the 'errx' function. */ #define HAVE_ERRX 1 /* Define to 1 if you have the header file. */ @@ -486,73 +486,73 @@ /* Define if your system has /etc/default/login */ /* #undef HAVE_ETC_DEFAULT_LOGIN */ -/* Define to 1 if you have the `EVP_chacha20' function. */ +/* Define to 1 if you have the 'EVP_chacha20' function. */ #define HAVE_EVP_CHACHA20 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_get_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_get_iv' function. */ /* #undef HAVE_EVP_CIPHER_CTX_GET_IV */ -/* Define to 1 if you have the `EVP_CIPHER_CTX_get_updated_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_get_updated_iv' function. */ /* #undef HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV */ -/* Define to 1 if you have the `EVP_CIPHER_CTX_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_iv' function. */ #define HAVE_EVP_CIPHER_CTX_IV 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_iv_noconst' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_iv_noconst' function. */ #define HAVE_EVP_CIPHER_CTX_IV_NOCONST 1 -/* Define to 1 if you have the `EVP_CIPHER_CTX_set_iv' function. */ +/* Define to 1 if you have the 'EVP_CIPHER_CTX_set_iv' function. */ /* #undef HAVE_EVP_CIPHER_CTX_SET_IV */ -/* Define to 1 if you have the `EVP_DigestFinal_ex' function. */ +/* Define to 1 if you have the 'EVP_DigestFinal_ex' function. */ #define HAVE_EVP_DIGESTFINAL_EX 1 -/* Define to 1 if you have the `EVP_DigestInit_ex' function. */ +/* Define to 1 if you have the 'EVP_DigestInit_ex' function. */ #define HAVE_EVP_DIGESTINIT_EX 1 -/* Define to 1 if you have the `EVP_MD_CTX_cleanup' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_cleanup' function. */ /* #undef HAVE_EVP_MD_CTX_CLEANUP */ -/* Define to 1 if you have the `EVP_MD_CTX_copy_ex' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_copy_ex' function. */ #define HAVE_EVP_MD_CTX_COPY_EX 1 -/* Define to 1 if you have the `EVP_MD_CTX_init' function. */ +/* Define to 1 if you have the 'EVP_MD_CTX_init' function. */ /* #undef HAVE_EVP_MD_CTX_INIT */ -/* Define to 1 if you have the `EVP_PKEY_get_raw_private_key' function. */ +/* Define to 1 if you have the 'EVP_PKEY_get_raw_private_key' function. */ #define HAVE_EVP_PKEY_GET_RAW_PRIVATE_KEY 1 -/* Define to 1 if you have the `EVP_PKEY_get_raw_public_key' function. */ +/* Define to 1 if you have the 'EVP_PKEY_get_raw_public_key' function. */ #define HAVE_EVP_PKEY_GET_RAW_PUBLIC_KEY 1 -/* Define to 1 if you have the `EVP_sha256' function. */ +/* Define to 1 if you have the 'EVP_sha256' function. */ #define HAVE_EVP_SHA256 1 -/* Define to 1 if you have the `EVP_sha384' function. */ +/* Define to 1 if you have the 'EVP_sha384' function. */ #define HAVE_EVP_SHA384 1 -/* Define to 1 if you have the `EVP_sha512' function. */ +/* Define to 1 if you have the 'EVP_sha512' function. */ #define HAVE_EVP_SHA512 1 /* Define if you have ut_exit in utmp.h */ /* #undef HAVE_EXIT_IN_UTMP */ -/* Define to 1 if you have the `explicit_bzero' function. */ +/* Define to 1 if you have the 'explicit_bzero' function. */ #define HAVE_EXPLICIT_BZERO 1 -/* Define to 1 if you have the `explicit_memset' function. */ +/* Define to 1 if you have the 'explicit_memset' function. */ /* #undef HAVE_EXPLICIT_MEMSET */ -/* Define to 1 if you have the `fchmod' function. */ +/* Define to 1 if you have the 'fchmod' function. */ #define HAVE_FCHMOD 1 -/* Define to 1 if you have the `fchmodat' function. */ +/* Define to 1 if you have the 'fchmodat' function. */ #define HAVE_FCHMODAT 1 -/* Define to 1 if you have the `fchown' function. */ +/* Define to 1 if you have the 'fchown' function. */ #define HAVE_FCHOWN 1 -/* Define to 1 if you have the `fchownat' function. */ +/* Define to 1 if you have the 'fchownat' function. */ #define HAVE_FCHOWNAT 1 /* Use F_CLOSEM fcntl for closefrom */ @@ -561,109 +561,109 @@ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 -/* Define to 1 if the system has the type `fd_mask'. */ +/* Define to 1 if the system has the type 'fd_mask'. */ #define HAVE_FD_MASK 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_FEATURES_H */ -/* Define to 1 if you have the `fido_assert_set_clientdata' function. */ +/* Define to 1 if you have the 'fido_assert_set_clientdata' function. */ /* #undef HAVE_FIDO_ASSERT_SET_CLIENTDATA */ -/* Define to 1 if you have the `fido_cred_prot' function. */ +/* Define to 1 if you have the 'fido_cred_prot' function. */ /* #undef HAVE_FIDO_CRED_PROT */ -/* Define to 1 if you have the `fido_cred_set_clientdata' function. */ +/* Define to 1 if you have the 'fido_cred_set_clientdata' function. */ /* #undef HAVE_FIDO_CRED_SET_CLIENTDATA */ -/* Define to 1 if you have the `fido_cred_set_prot' function. */ +/* Define to 1 if you have the 'fido_cred_set_prot' function. */ /* #undef HAVE_FIDO_CRED_SET_PROT */ -/* Define to 1 if you have the `fido_dev_get_touch_begin' function. */ +/* Define to 1 if you have the 'fido_dev_get_touch_begin' function. */ /* #undef HAVE_FIDO_DEV_GET_TOUCH_BEGIN */ -/* Define to 1 if you have the `fido_dev_get_touch_status' function. */ +/* Define to 1 if you have the 'fido_dev_get_touch_status' function. */ /* #undef HAVE_FIDO_DEV_GET_TOUCH_STATUS */ -/* Define to 1 if you have the `fido_dev_is_winhello' function. */ +/* Define to 1 if you have the 'fido_dev_is_winhello' function. */ /* #undef HAVE_FIDO_DEV_IS_WINHELLO */ -/* Define to 1 if you have the `fido_dev_supports_cred_prot' function. */ +/* Define to 1 if you have the 'fido_dev_supports_cred_prot' function. */ /* #undef HAVE_FIDO_DEV_SUPPORTS_CRED_PROT */ /* Define to 1 if you have the header file. */ #define HAVE_FLOATINGPOINT_H 1 -/* Define to 1 if you have the `flock' function. */ +/* Define to 1 if you have the 'flock' function. */ #define HAVE_FLOCK 1 -/* Define to 1 if you have the `fmt_scaled' function. */ +/* Define to 1 if you have the 'fmt_scaled' function. */ /* #undef HAVE_FMT_SCALED */ -/* Define to 1 if you have the `fnmatch' function. */ +/* Define to 1 if you have the 'fnmatch' function. */ #define HAVE_FNMATCH 1 /* Define to 1 if you have the header file. */ #define HAVE_FNMATCH_H 1 -/* Define to 1 if you have the `freeaddrinfo' function. */ +/* Define to 1 if you have the 'freeaddrinfo' function. */ #define HAVE_FREEADDRINFO 1 -/* Define to 1 if you have the `freezero' function. */ +/* Define to 1 if you have the 'freezero' function. */ /* #undef HAVE_FREEZERO */ -/* Define to 1 if the system has the type `fsblkcnt_t'. */ +/* Define to 1 if the system has the type 'fsblkcnt_t'. */ #define HAVE_FSBLKCNT_T 1 -/* Define to 1 if the system has the type `fsfilcnt_t'. */ +/* Define to 1 if the system has the type 'fsfilcnt_t'. */ #define HAVE_FSFILCNT_T 1 -/* Define to 1 if you have the `fstatfs' function. */ +/* Define to 1 if you have the 'fstatfs' function. */ #define HAVE_FSTATFS 1 -/* Define to 1 if you have the `fstatvfs' function. */ +/* Define to 1 if you have the 'fstatvfs' function. */ #define HAVE_FSTATVFS 1 -/* Define to 1 if you have the `futimes' function. */ +/* Define to 1 if you have the 'futimes' function. */ #define HAVE_FUTIMES 1 -/* Define to 1 if you have the `gai_strerror' function. */ +/* Define to 1 if you have the 'gai_strerror' function. */ #define HAVE_GAI_STRERROR 1 -/* Define to 1 if you have the `getaddrinfo' function. */ +/* Define to 1 if you have the 'getaddrinfo' function. */ #define HAVE_GETADDRINFO 1 -/* Define to 1 if you have the `getaudit' function. */ +/* Define to 1 if you have the 'getaudit' function. */ /* #undef HAVE_GETAUDIT */ -/* Define to 1 if you have the `getaudit_addr' function. */ +/* Define to 1 if you have the 'getaudit_addr' function. */ /* #undef HAVE_GETAUDIT_ADDR */ -/* Define to 1 if you have the `getcwd' function. */ +/* Define to 1 if you have the 'getcwd' function. */ #define HAVE_GETCWD 1 -/* Define to 1 if you have the `getentropy' function. */ +/* Define to 1 if you have the 'getentropy' function. */ #define HAVE_GETENTROPY 1 -/* Define to 1 if you have the `getgrouplist' function. */ +/* Define to 1 if you have the 'getgrouplist' function. */ #define HAVE_GETGROUPLIST 1 -/* Define to 1 if you have the `getgrset' function. */ +/* Define to 1 if you have the 'getgrset' function. */ /* #undef HAVE_GETGRSET */ -/* Define to 1 if you have the `getlastlogxbyname' function. */ +/* Define to 1 if you have the 'getlastlogxbyname' function. */ /* #undef HAVE_GETLASTLOGXBYNAME */ -/* Define to 1 if you have the `getline' function. */ +/* Define to 1 if you have the 'getline' function. */ #define HAVE_GETLINE 1 -/* Define to 1 if you have the `getluid' function. */ +/* Define to 1 if you have the 'getluid' function. */ /* #undef HAVE_GETLUID */ -/* Define to 1 if you have the `getnameinfo' function. */ +/* Define to 1 if you have the 'getnameinfo' function. */ #define HAVE_GETNAMEINFO 1 -/* Define to 1 if you have the `getopt' function. */ +/* Define to 1 if you have the 'getopt' function. */ #define HAVE_GETOPT 1 /* Define to 1 if you have the header file. */ @@ -675,73 +675,73 @@ /* Define if your libraries define getpagesize() */ #define HAVE_GETPAGESIZE 1 -/* Define to 1 if you have the `getpeereid' function. */ +/* Define to 1 if you have the 'getpeereid' function. */ #define HAVE_GETPEEREID 1 -/* Define to 1 if you have the `getpeerucred' function. */ +/* Define to 1 if you have the 'getpeerucred' function. */ /* #undef HAVE_GETPEERUCRED */ -/* Define to 1 if you have the `getpgid' function. */ +/* Define to 1 if you have the 'getpgid' function. */ #define HAVE_GETPGID 1 -/* Define to 1 if you have the `getpgrp' function. */ +/* Define to 1 if you have the 'getpgrp' function. */ #define HAVE_GETPGRP 1 -/* Define to 1 if you have the `getpwanam' function. */ +/* Define to 1 if you have the 'getpwanam' function. */ /* #undef HAVE_GETPWANAM */ -/* Define to 1 if you have the `getrandom' function. */ +/* Define to 1 if you have the 'getrandom' function. */ #define HAVE_GETRANDOM 1 -/* Define to 1 if you have the `getrlimit' function. */ +/* Define to 1 if you have the 'getrlimit' function. */ #define HAVE_GETRLIMIT 1 /* Define if getrrsetbyname() exists */ /* #undef HAVE_GETRRSETBYNAME */ -/* Define to 1 if you have the `getseuserbyname' function. */ +/* Define to 1 if you have the 'getseuserbyname' function. */ /* #undef HAVE_GETSEUSERBYNAME */ -/* Define to 1 if you have the `getsid' function. */ +/* Define to 1 if you have the 'getsid' function. */ #define HAVE_GETSID 1 -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define to 1 if you have the 'gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 -/* Define to 1 if you have the `getttyent' function. */ +/* Define to 1 if you have the 'getttyent' function. */ #define HAVE_GETTTYENT 1 -/* Define to 1 if you have the `getutent' function. */ +/* Define to 1 if you have the 'getutent' function. */ /* #undef HAVE_GETUTENT */ -/* Define to 1 if you have the `getutid' function. */ +/* Define to 1 if you have the 'getutid' function. */ /* #undef HAVE_GETUTID */ -/* Define to 1 if you have the `getutline' function. */ +/* Define to 1 if you have the 'getutline' function. */ /* #undef HAVE_GETUTLINE */ -/* Define to 1 if you have the `getutxent' function. */ +/* Define to 1 if you have the 'getutxent' function. */ #define HAVE_GETUTXENT 1 -/* Define to 1 if you have the `getutxid' function. */ +/* Define to 1 if you have the 'getutxid' function. */ #define HAVE_GETUTXID 1 -/* Define to 1 if you have the `getutxline' function. */ +/* Define to 1 if you have the 'getutxline' function. */ #define HAVE_GETUTXLINE 1 -/* Define to 1 if you have the `getutxuser' function. */ +/* Define to 1 if you have the 'getutxuser' function. */ #define HAVE_GETUTXUSER 1 -/* Define to 1 if you have the `get_default_context_with_level' function. */ +/* Define to 1 if you have the 'get_default_context_with_level' function. */ /* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */ -/* Define to 1 if you have the `glob' function. */ +/* Define to 1 if you have the 'glob' function. */ #define HAVE_GLOB 1 /* Define to 1 if you have the header file. */ #define HAVE_GLOB_H 1 -/* Define to 1 if you have the `group_from_gid' function. */ +/* Define to 1 if you have the 'group_from_gid' function. */ #define HAVE_GROUP_FROM_GID 1 /* Define to 1 if you have the header file. */ @@ -765,7 +765,7 @@ /* Define if HEADER.ad exists in arpa/nameser.h */ #define HAVE_HEADER_AD 1 -/* Define to 1 if you have the `HMAC_CTX_init' function. */ +/* Define to 1 if you have the 'HMAC_CTX_init' function. */ /* #undef HAVE_HMAC_CTX_INIT */ /* Define if you have ut_host in utmp.h */ @@ -789,22 +789,22 @@ /* Define to 1 if you have the header file. */ #define HAVE_IFADDRS_H 1 -/* Define to 1 if you have the `inet_aton' function. */ +/* Define to 1 if you have the 'inet_aton' function. */ #define HAVE_INET_ATON 1 -/* Define to 1 if you have the `inet_ntoa' function. */ +/* Define to 1 if you have the 'inet_ntoa' function. */ #define HAVE_INET_NTOA 1 -/* Define to 1 if you have the `inet_ntop' function. */ +/* Define to 1 if you have the 'inet_ntop' function. */ #define HAVE_INET_NTOP 1 -/* Define to 1 if you have the `innetgr' function. */ +/* Define to 1 if you have the 'innetgr' function. */ #define HAVE_INNETGR 1 /* define if you have int64_t data type */ #define HAVE_INT64_T 1 -/* Define to 1 if the system has the type `intmax_t'. */ +/* Define to 1 if the system has the type 'intmax_t'. */ #define HAVE_INTMAX_T 1 /* Define to 1 if you have the header file. */ @@ -813,25 +813,25 @@ /* define if you have intxx_t data type */ #define HAVE_INTXX_T 1 -/* Define to 1 if the system has the type `in_addr_t'. */ +/* Define to 1 if the system has the type 'in_addr_t'. */ #define HAVE_IN_ADDR_T 1 -/* Define to 1 if the system has the type `in_port_t'. */ +/* Define to 1 if the system has the type 'in_port_t'. */ #define HAVE_IN_PORT_T 1 /* Define if you have isblank(3C). */ #define HAVE_ISBLANK 1 -/* Define to 1 if you have the `killpg' function. */ +/* Define to 1 if you have the 'killpg' function. */ #define HAVE_KILLPG 1 -/* Define to 1 if you have the `krb5_cc_new_unique' function. */ +/* Define to 1 if you have the 'krb5_cc_new_unique' function. */ /* #undef HAVE_KRB5_CC_NEW_UNIQUE */ -/* Define to 1 if you have the `krb5_free_error_message' function. */ +/* Define to 1 if you have the 'krb5_free_error_message' function. */ /* #undef HAVE_KRB5_FREE_ERROR_MESSAGE */ -/* Define to 1 if you have the `krb5_get_error_message' function. */ +/* Define to 1 if you have the 'krb5_get_error_message' function. */ /* #undef HAVE_KRB5_GET_ERROR_MESSAGE */ /* Define to 1 if you have the header file. */ @@ -846,10 +846,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ -/* Define to 1 if you have the `bsm' library (-lbsm). */ +/* Define to 1 if you have the 'bsm' library (-lbsm). */ /* #undef HAVE_LIBBSM */ -/* Define to 1 if you have the `dl' library (-ldl). */ +/* Define to 1 if you have the 'dl' library (-ldl). */ #define HAVE_LIBDL 1 /* Define to 1 if you have the header file. */ @@ -858,25 +858,25 @@ /* Define if system has libiaf that supports set_id */ /* #undef HAVE_LIBIAF */ -/* Define to 1 if you have the `network' library (-lnetwork). */ +/* Define to 1 if you have the 'network' library (-lnetwork). */ /* #undef HAVE_LIBNETWORK */ -/* Define to 1 if you have the `pam' library (-lpam). */ +/* Define to 1 if you have the 'pam' library (-lpam). */ #define HAVE_LIBPAM 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_LIBPROC_H */ -/* Define to 1 if you have the `socket' library (-lsocket). */ +/* Define to 1 if you have the 'socket' library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ /* Define to 1 if you have the header file. */ #define HAVE_LIBUTIL_H 1 -/* Define to 1 if you have the `xnet' library (-lxnet). */ +/* Define to 1 if you have the 'xnet' library (-lxnet). */ /* #undef HAVE_LIBXNET */ -/* Define to 1 if you have the `z' library (-lz). */ +/* Define to 1 if you have the 'z' library (-lz). */ #define HAVE_LIBZ 1 /* Define to 1 if you have the header file. */ @@ -894,65 +894,65 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_LINUX_SECCOMP_H */ -/* Define to 1 if you have the `llabs' function. */ +/* Define to 1 if you have the 'llabs' function. */ #define HAVE_LLABS 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 -/* Define to 1 if you have the `localtime_r' function. */ +/* Define to 1 if you have the 'localtime_r' function. */ #define HAVE_LOCALTIME_R 1 -/* Define to 1 if you have the `login' function. */ +/* Define to 1 if you have the 'login' function. */ /* #undef HAVE_LOGIN */ /* Define to 1 if you have the header file. */ #define HAVE_LOGIN_CAP_H 1 -/* Define to 1 if you have the `login_getcapbool' function. */ +/* Define to 1 if you have the 'login_getcapbool' function. */ #define HAVE_LOGIN_GETCAPBOOL 1 -/* Define to 1 if you have the `login_getpwclass' function. */ +/* Define to 1 if you have the 'login_getpwclass' function. */ #define HAVE_LOGIN_GETPWCLASS 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_LOGIN_H */ -/* Define to 1 if you have the `logout' function. */ +/* Define to 1 if you have the 'logout' function. */ /* #undef HAVE_LOGOUT */ -/* Define to 1 if you have the `logwtmp' function. */ +/* Define to 1 if you have the 'logwtmp' function. */ /* #undef HAVE_LOGWTMP */ -/* Define to 1 if the system has the type `long double'. */ +/* Define to 1 if the system has the type 'long double'. */ #define HAVE_LONG_DOUBLE 1 -/* Define to 1 if the system has the type `long long'. */ +/* Define to 1 if the system has the type 'long long'. */ #define HAVE_LONG_LONG 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_MAILLOCK_H */ -/* Define to 1 if your system has a GNU libc compatible `malloc' function, and +/* Define to 1 if your system has a GNU libc compatible 'malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 -/* Define to 1 if you have the `mblen' function. */ +/* Define to 1 if you have the 'mblen' function. */ #define HAVE_MBLEN 1 -/* Define to 1 if you have the `mbtowc' function. */ +/* Define to 1 if you have the 'mbtowc' function. */ #define HAVE_MBTOWC 1 -/* Define to 1 if you have the `memmem' function. */ +/* Define to 1 if you have the 'memmem' function. */ #define HAVE_MEMMEM 1 -/* Define to 1 if you have the `memmove' function. */ +/* Define to 1 if you have the 'memmove' function. */ #define HAVE_MEMMOVE 1 -/* Define to 1 if you have the `memset_s' function. */ +/* Define to 1 if you have the 'memset_s' function. */ #define HAVE_MEMSET_S 1 -/* Define to 1 if you have the `mkdtemp' function. */ +/* Define to 1 if you have the 'mkdtemp' function. */ #define HAVE_MKDTEMP 1 /* define if you have mode_t data type */ @@ -979,50 +979,50 @@ /* Define if you are on NeXT */ /* #undef HAVE_NEXT */ -/* Define to 1 if the system has the type `nfds_t'. */ +/* Define to 1 if the system has the type 'nfds_t'. */ #define HAVE_NFDS_T 1 -/* Define to 1 if you have the `ngetaddrinfo' function. */ +/* Define to 1 if you have the 'ngetaddrinfo' function. */ /* #undef HAVE_NGETADDRINFO */ -/* Define to 1 if you have the `nl_langinfo' function. */ +/* Define to 1 if you have the 'nl_langinfo' function. */ #define HAVE_NL_LANGINFO 1 -/* Define to 1 if you have the `nsleep' function. */ +/* Define to 1 if you have the 'nsleep' function. */ /* #undef HAVE_NSLEEP */ -/* Define to 1 if you have the `ogetaddrinfo' function. */ +/* Define to 1 if you have the 'ogetaddrinfo' function. */ /* #undef HAVE_OGETADDRINFO */ /* Define if you have an old version of PAM which takes only one argument to pam_strerror */ /* #undef HAVE_OLD_PAM */ -/* Define to 1 if you have the `openlog_r' function. */ +/* Define to 1 if you have the 'openlog_r' function. */ /* #undef HAVE_OPENLOG_R */ -/* Define to 1 if you have the `openpty' function. */ +/* Define to 1 if you have the 'openpty' function. */ #define HAVE_OPENPTY 1 /* as a macro */ #define HAVE_OPENSSL_ADD_ALL_ALGORITHMS 1 -/* Define to 1 if you have the `OpenSSL_version' function. */ +/* Define to 1 if you have the 'OpenSSL_version' function. */ #define HAVE_OPENSSL_VERSION 1 -/* Define to 1 if you have the `OpenSSL_version_num' function. */ +/* Define to 1 if you have the 'OpenSSL_version_num' function. */ #define HAVE_OPENSSL_VERSION_NUM 1 /* Define if you have Digital Unix Security Integration Architecture */ /* #undef HAVE_OSF_SIA */ -/* Define to 1 if you have the `pam_getenvlist' function. */ +/* Define to 1 if you have the 'pam_getenvlist' function. */ #define HAVE_PAM_GETENVLIST 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_PAM_PAM_APPL_H */ -/* Define to 1 if you have the `pam_putenv' function. */ +/* Define to 1 if you have the 'pam_putenv' function. */ #define HAVE_PAM_PUTENV 1 /* Define to 1 if you have the header file. */ @@ -1034,74 +1034,74 @@ /* define if you have pid_t data type */ #define HAVE_PID_T 1 -/* Define to 1 if you have the `pledge' function. */ +/* Define to 1 if you have the 'pledge' function. */ /* #undef HAVE_PLEDGE */ -/* Define to 1 if you have the `poll' function. */ +/* Define to 1 if you have the 'poll' function. */ #define HAVE_POLL 1 /* Define to 1 if you have the header file. */ #define HAVE_POLL_H 1 -/* Define to 1 if you have the `ppoll' function. */ +/* Define to 1 if you have the 'ppoll' function. */ #define HAVE_PPOLL 1 -/* Define to 1 if you have the `prctl' function. */ +/* Define to 1 if you have the 'prctl' function. */ /* #undef HAVE_PRCTL */ -/* Define to 1 if you have the `priv_basicset' function. */ +/* Define to 1 if you have the 'priv_basicset' function. */ /* #undef HAVE_PRIV_BASICSET */ /* Define to 1 if you have the header file. */ /* #undef HAVE_PRIV_H */ -/* Define to 1 if you have the `procctl' function. */ +/* Define to 1 if you have the 'procctl' function. */ #define HAVE_PROCCTL 1 /* Define if you have /proc/$pid/fd */ /* #undef HAVE_PROC_PID */ *** 594 LINES SKIPPED *** From nobody Thu Aug 1 15:10:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXTH2Ty0z5SvTy; Thu, 01 Aug 2024 15:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXTH1Fgzz4SHx; Thu, 1 Aug 2024 15:10:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722525027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zhvkn5VVSXYKvQ6t8zjKJs3UDyl41KoXiKv5tIcbcgE=; b=aOW8AA267mNv3hqGdVbNF7nbvLhAu3qOjAk2xfkr0i9yy3XWsAD8Eshs1sC2C3zMRuUVfJ GwB040A0mA7G+qsrFhCDJimdoEOkDSBwX8Iti6UZvy9K2E+KraugnjfW7suJ0Cv33q8xbu 50SbORA5u/nmd2WmWUj3HVxEFYanCPDZZP33WwjlaN7/Kq+jDqPRbt3w5rysM+oYm+CNUe nxs52PI0ksNvIgA+AZnX7IovEthL+Vb0w8YAGQ1qnSDqwxZXsWEUZekIz1mX2ojqObNHk1 yFcZu1znjUnj+cnmEfTbnfUCAHej3pdau9ODtsxPHMG7vTNC4Fk7OQr9pWmFWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722525027; a=rsa-sha256; cv=none; b=sGe1ri2lL7h3pCNc8dGBe/SR+QKldO6p6VXwzEkRjz2VlxL2A5SewLACj0Ehttok2Ihll7 EgqIYpG3uBbhXDiDXHTwbEWgq5D4/EZa+rh7PWgBfWuJzXm8ptzo+Vdy9CTtKM5PbCMhK4 2UeXrgLwhjHK5lz6CwazSTSdLRtfm4mXZU4hjlF7vbm9AguI+JGaxF0UF8FNEZPJSDFQ5s XsDYqTjC7ZQj8bLqPP9uv6/Nwgu/5Bo1Q/zFsBi6JU1yVns3y0XhK2TEksubIZmMyAELUp bjSF6VnO0QBOjggrn5eY7XUubw7dsKuckUwOoGW/e/yt4mt3zclYDBSzH3Evuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722525027; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zhvkn5VVSXYKvQ6t8zjKJs3UDyl41KoXiKv5tIcbcgE=; b=HbefpoJ8XxipQVDX+UF61Fqa6hjDtCEJhxQz9xxlICuuj+lHvqAM3q23G8J2LpTrMjWcnk OjkqSs/bWR9ZEEgwW611XYaL8IZoBN1i43lVyjS4NAhRI21iOPnJhq2pJDYNYHKz3lCGvB DnrSV8WsN8EbukrWD0FCFVB97x9lPf78jqNNs0AI0LgvDegI4dcPm3WBaMmb0EhUqDkYLb LjM0GSEVUKVV9vVcFSAiCijLeyoOp3HV4tTvrus21sqJ7wSrt8hW5w44gwlomWuns19v0S hIeeUVCI4JSUXi2kXKE4phxZnT3zwe3pIHWF3arXsD8lGPR+SCEyuY2VEGeLag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXTH0P8tzqHl; Thu, 1 Aug 2024 15:10: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 471FAQfn084835; Thu, 1 Aug 2024 15:10:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FAQOa084832; Thu, 1 Aug 2024 15:10:26 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:10:26 GMT Message-Id: <202408011510.471FAQOa084832@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: c9294b873683 - stable/13 - ktrace(1): add xref to namei(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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c9294b873683669819d2a37ba2fa9d3559b6774d Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c9294b873683669819d2a37ba2fa9d3559b6774d commit c9294b873683669819d2a37ba2fa9d3559b6774d Author: Ed Maste AuthorDate: 2024-06-10 12:51:01 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:09:05 +0000 ktrace(1): add xref to namei(9) namei was mistaken for a typo (see GitHub pull request #1284). Add an xref to make it clear. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45546 (cherry picked from commit a87651e2ff189cec4c26cb220354f1bc93794f31) (cherry picked from commit ecd0ead0635b3d220ecf600f9136f12077dd0fca) --- usr.bin/ktrace/ktrace.1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index a6a07bb93caf..6fe8afbb3d0c 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -25,9 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 -.\" -.Dd August 26, 2019 +.Dd June 10, 2024 .Dt KTRACE 1 .Os .Sh NAME @@ -50,7 +48,8 @@ The utility enables kernel trace logging for the specified processes. Kernel trace data is logged to the file .Pa ktrace.out . -The kernel operations that are traced include system calls, namei +The kernel operations that are traced include system calls, +.Xr namei 9 translations, signal processing, and .Tn I/O . .Pp @@ -185,7 +184,8 @@ Disable tracing of all user-owned processes: .Xr kdump 1 , .Xr truss 1 , .Xr ktrace 2 , -.Xr utrace 2 +.Xr utrace 2 , +.Xr namei 9 .Sh HISTORY The .Nm From nobody Thu Aug 1 15:10:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZXTJ4K4Wz5SvMP; Thu, 01 Aug 2024 15:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZXTJ1qtlz4SQW; Thu, 1 Aug 2024 15:10:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722525028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFv+PF7Bix6xwwE3eNBvnaB8PluMiwmXpVj7KcTpUmM=; b=m9Oc+f2rNgt14mNI3Tu0qoLIptD4jsln8/J3ixm5LCoHU9dgvQngXua4PFE1gjJkSpPZ1T lPaymAvyT6W4KzxwiQJ5AsxQGcOa8hyyTUyPl0cEqo9zhhc4UZjcGTGduEd4LVtmE3FbNJ fMeL9tqJDg2KRXuE6iDpda8S4OaJEn+T7p0DxsuK85ieeHcOuqircUJE5q9qc158lH5Kk+ UOTIlt0h7nrkHcsFqqwtuu3uR05KswiJddITZBKzUz+yNBoTAEWr3cSiciMs1KBVX3I+F6 YZc3UUcNuiSizvHza5bEluXqW+NmIIDX9r8sBkAW802Ic+LC/z24U6h06GA4Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722525028; a=rsa-sha256; cv=none; b=WxOQckM7c+7TV8I98HFNype+7HS6Xh0BDJ0qs98qLvYNPx1XZ9bUlDf5kHfh32GTOlm6bD a3R5iixw3dnmR2/iBsJgA9WTVsdKVPs3Kfy3JnB4Ufw4ncLXICTMRcwIpF/KBwXoAxoVlF jbb7zWQ+O0fVZcYCbsdzQWkN2O1deOY3y22PRkAMf8kVXqsBgNQgCchw/xL6yelrHEMfdL +s1nfLRuvkqfKuJAmE+G8TctYx5zDoA9OX+7WyVR4qbjxR2N24sii0WrJ1H3NzxtTnvR2i UMRxKo4RP4wIdHyM6pmypBJYf4oUxMeOE5/Gs1jXbFx2BhFBtEoVRgNhB0yq6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722525028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rFv+PF7Bix6xwwE3eNBvnaB8PluMiwmXpVj7KcTpUmM=; b=KGBHJqvf8jJ8YV5V18R2X7mzpZufElGbYirv7dJtFBes3jU2Fx+CFLHSo50QIm1wvufU9s +D9UmPNGgvgbsfqSYFww8QFrlhIBP/fFHZLxSs/YFbGn8F4LKInMypwt+PXH2FO5inPdQO GChHmpK2MIOoXoqZRA0fv3YqRaFaSijwbtommpv77Dk7nUdSYTJqucW+qMDnGsNd3fku6D nhnj6Fnf8MpGBcEZUylEodhn8w/J9QQYQJNEBZB2X3P3ik8itaFfy0z4ejpJ7ahhDLW2pw VIsevsuIHuirwlZy1aM92ojijeZU6pap1ZveunUkRz9jh/IP72XgaWoY6ZUsSw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZXTJ1MnFzq6W; Thu, 1 Aug 2024 15:10: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 471FASVi084874; Thu, 1 Aug 2024 15:10:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FASDG084871; Thu, 1 Aug 2024 15:10:28 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:10:28 GMT Message-Id: <202408011510.471FASDG084871@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: 0e678b79d7b0 - stable/13 - ktrace(1): add more xrefs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 0e678b79d7b03e7d58e528bed1d87b39eef02c60 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0e678b79d7b03e7d58e528bed1d87b39eef02c60 commit 0e678b79d7b03e7d58e528bed1d87b39eef02c60 Author: Ed Maste AuthorDate: 2024-06-11 00:31:08 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:09:22 +0000 ktrace(1): add more xrefs Following commit a87651e2ff18 add xrefs to intro(2) and sigaction(2), and use a consistent form. Suggested by: kib, arrowd Reviewed by: kib (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45555 (cherry picked from commit 0277c0c6f72a964bf0439db1f4558551052e4f3b) (cherry picked from commit 7110def1b1dbf33d5f9e4505c0d646495f91acb6) --- usr.bin/ktrace/ktrace.1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1 index 6fe8afbb3d0c..4a7aec8c4cfa 100644 --- a/usr.bin/ktrace/ktrace.1 +++ b/usr.bin/ktrace/ktrace.1 @@ -48,9 +48,13 @@ The utility enables kernel trace logging for the specified processes. Kernel trace data is logged to the file .Pa ktrace.out . -The kernel operations that are traced include system calls, -.Xr namei 9 -translations, signal processing, and +The kernel operations that are traced include system calls +.Pq see Xr intro 2 , +file system path lookups +.Pq Xr namei 9 , +signal processing +.Pq Xr sigaction 2 , +and .Tn I/O . .Pp Once tracing is enabled on a process, trace data will be logged until @@ -120,7 +124,9 @@ trace page faults trace .Tn I/O .It Cm n -trace namei translations +trace +.Xr namei 9 +translations .It Cm p trace capability check failures .It Cm s @@ -183,7 +189,9 @@ Disable tracing of all user-owned processes: .Xr dtrace 1 , .Xr kdump 1 , .Xr truss 1 , +.Xr intro 2 , .Xr ktrace 2 , +.Xr sigaction 2 , .Xr utrace 2 , .Xr namei 9 .Sh HISTORY From nobody Thu Aug 1 15:38:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZY5Q0nDDz5SxFZ; Thu, 01 Aug 2024 15:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZY5P5Kddz4WdX; Thu, 1 Aug 2024 15:38:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=628kL9PCjNhE7YPeg5yLI2QtjVVff+ftYAXb42foNrU=; b=lHSoGW5DqeV121GQ7q4y+FQGX/7NWFSJKNJjQVKCHGVavMvvPXxeXDyQlt1hrVuuo++mY2 F0KPFwO7JSoDdWbvNP6OYnGwC+5tKmj6q9PZSQQbVBD/OeZH5WylFpHE3gNkPFROxD12mL pXoAX0OOMiJgV0nRhaz2Ou0AY1yDUwUm08R6NZhu4yWaSMg53Y4Tz+BpfcIAZpB5KOGukl Jl2BcGVp9pDAod2/bTI9iQKhWr3jUJdG4H+n1OxUdJYVIsRV7q64pfjLAQ8DZqJK6P01r+ pjd39uSPl0s6jJgt1EsUuxN8Zzk3K1MzEtBWhCbLY8XH3onXS0HQqNejG0e7zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722526697; a=rsa-sha256; cv=none; b=wzUYA4kVjV3a+V5wskMv+iOqXnaxPKdvWOyJaW4dB0ufg0d16KCbrr0IcScYAG4Fza/6K1 BRh5oF4/VJ6bm8ZfPUnJHTOukI+D1F4WFmIqxpIbgTaw9MJE5jYYvkRO81yklbavSYplVO dtEumGfuYFTfr2EdBFkuwxrXzcSKoFDs+bGsT63f0TQbOZHt3kGTH8z6EzJXB38L7Sn1Oz 3ijDdtWXM0ps4KjU75/xg2NT45J/0C9wXYvT67Ovx6rl4iHCfJtRQa5saizlaleJYwUOas f3AHFmgaNt+Je4i5yFKC9+vbkByGI0oHz0Mc2P5JUeHBSTkpl0tOBFRWGxh4lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=628kL9PCjNhE7YPeg5yLI2QtjVVff+ftYAXb42foNrU=; b=cQV1lo8KsbIii10dZaF6051MYvIGIym1XdmJTj3pLxTMHoVNvz37Ct2l9j1EcZInXE5gBW Jbr1PC+bMrGMCyQEoabGsH1mpnJqPjFtm7bPpmlFfa//FHnI8KtEFK8pflwz5L3PrCMOjU bJTmp72S5U1bfVXQlV5t1EgqTK7P8RtckRV5+szGsOvZbU0gxjC21A4b0rQDO+0IOkrO+W CUAZJYaSa5rwcUXOYmrvIVo81vA1w7QP439Vi+HPFQ8LvjEskzvvBVvNBE7+rCcmjpqBuK /sLcqJ3yHkMR+0ebBfZ/PjavvkrAKH5njHsq+bjKYBQc3y3/VAxn4Rl7vBncRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZY5P4jSkzqnQ; Thu, 1 Aug 2024 15:38: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 471FcHKs026793; Thu, 1 Aug 2024 15:38:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FcHTV026790; Thu, 1 Aug 2024 15:38:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:38:17 GMT Message-Id: <202408011538.471FcHTV026790@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: af20990e9dc1 - stable/14 - tzsetup: add detail for -s option List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: af20990e9dc110adcb36d5774c4b2394a844ac5f Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=af20990e9dc110adcb36d5774c4b2394a844ac5f commit af20990e9dc110adcb36d5774c4b2394a844ac5f Author: Ed Maste AuthorDate: 2024-06-13 15:23:26 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:44 +0000 tzsetup: add detail for -s option Skipping the UTC question via -s will not create or delete /etc/wall_cmos_clock. Reported by: Tomoaki AOKI Reviewed by: imp, allanjude, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45576 (cherry picked from commit 70e3e1bde9bf0ddf7fc18b97487fe2d23d4fc5ed) --- usr.sbin/tzsetup/tzsetup.8 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8 index 109a52beb164..bfa625a1af3a 100644 --- a/usr.sbin/tzsetup/tzsetup.8 +++ b/usr.sbin/tzsetup/tzsetup.8 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 18, 2023 +.Dd June 14, 2024 .Dt TZSETUP 8 .Os .Sh NAME @@ -59,6 +59,10 @@ The name is obtained from .Pa /var/db/zoneinfo . .It Fl s Skip the initial question about adjusting the clock if not set to UTC. +.Nm +will neither create nor delete +.Pa /etc/wall_cmos_clock . +On a newly installed system the hardware clock will keep UTC. .El .Pp It is possible to short-circuit the menu system by specifying the From nobody Thu Aug 1 15:38:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZY5R0Qrzz5SxSR; Thu, 01 Aug 2024 15:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZY5Q67PSz4Wjh; Thu, 1 Aug 2024 15:38:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mxB7w1QgB74XJ1wYlQrPYfLkj4ogv4Dgub6TPdUSeKk=; b=M0wKxFpVe1x48G7TBh9BlqGN32eTuruaJ8ISQjNkKIn73hDfc2lKD5X4mOF44Bi/j3AVe+ 980MR3XTsq0e1Yve9Ml4sfaOrngTnrD3XkQNhiHby1y2O+GnCAGUAU05dIm+V3IJn6qqLU 8u7GVRnXvBa2sjROCUIeoe2KRlp8PtTBPSqXS95fNfUcOKdsUcBq24TxXRLktKG4XjnAbc Suh81NBViNPP0hjC/T4nCN4Wl53rNmMuFdObxK0LwzaSH3Qyvzo4WcLJIFMXD7jW1ZD22M Rm6F5qtZqaQQJUvAs7RjcrF4NDftOjpXd6P1FYKnwryTKaZgsr20WKJyk49Isw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722526698; a=rsa-sha256; cv=none; b=lgHcT+j/VIw63Oi7XncI+oOlGN7idHbfeBEqsfIjL+FUkoy024ZDxKnU0QtKGxE/83NZSP vS9r7slqNktBDNiAa95rlwnqfHV8oc3BeHjdiwxzv7+HHL6Qbwlnou5ffP7Dv21Ix8ZwUs B/2ZT/2x8AufZlHwoQCF02gnQOnm3W7zR6EwJjGONWvOf+lbhKrObGiPWnu07VN5zinRGG RxPMGvhSqNOO1oYXCL5IN/lHSIWLiay/iaHaqYDpCYoMO/53MKio91fA/yEjzqO3JzzLTH tr2smZUB9SBJvm7bTn9nzYEjpO3NLGiXUvnelkM6KBXXaVyHvzFvIkzfvM4gdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mxB7w1QgB74XJ1wYlQrPYfLkj4ogv4Dgub6TPdUSeKk=; b=Hh+/W+KKkuK22OpcsvzizZbqunDKaDgapNe7pMIXaiLMA/yi/p2BS+7gwrvP5XkrjoIisi 371vvcaS5yF4X9LJPX4upvNiOn9sJ6mIMD5FY/ZAky3AmGZyxTI7ZLBGHWthIZGV7AeQ0I lpqV27SpCWsCHopSkBx8URRfYKqmzaxSf4XBZil30uI0x2wJGtv6P7oICylDhOQtK18A5/ UMt5CEHFljyx89XMe94JQea2lQUkyrUkAJh1o5FPIwHOZXXt67agnLdkZEwK7/DnGs3OT5 q8shTCqIfZyS0ethVO6W3iviGxnTmHxohqQtxhbx/ntfSYrxpdRf17mH3r3BnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZY5Q5NMXzr3V; Thu, 1 Aug 2024 15:38: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 471FcITc026840; Thu, 1 Aug 2024 15:38:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FcIfF026837; Thu, 1 Aug 2024 15:38:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:38:18 GMT Message-Id: <202408011538.471FcIfF026837@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: 0673e7e370cb - stable/14 - tzsetup: Correct UTC 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0673e7e370cb95baca8c7132b72f29cf1840c165 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0673e7e370cb95baca8c7132b72f29cf1840c165 commit 0673e7e370cb95baca8c7132b72f29cf1840c165 Author: Ed Maste AuthorDate: 2024-06-13 00:08:04 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:44 +0000 tzsetup: Correct UTC description UTC is Coordinated Universal Time, not Greenwich Mean Time. Reviewed by: imp, allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45573 (cherry picked from commit a16cb8709de7ddc6dd6ab71918af9fc5fd96f377) --- usr.sbin/tzsetup/tzsetup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index eca7358df1df..6cd2e16b607c 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -1024,7 +1024,7 @@ main(int argc, char **argv) "If it is set to local time,\n" "or you don't know, please choose NO here!"); - conf.title = "Select local or UTC (Greenwich Mean Time) clock"; + conf.title = "Select local or UTC (Coordinated Universal Time) clock"; if (bsddialog_yesno(&conf, prompt, 7, 73) == BSDDIALOG_YES) { if (reallydoit) unlink(path_wall_cmos_clock); From nobody Thu Aug 1 15:38:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZY5S3jM6z5SxQY; Thu, 01 Aug 2024 15:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZY5R6yGNz4WbS; Thu, 1 Aug 2024 15:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agLmIo2naQmVPh2Gg2CCWatUzRKj4Yt/2CiIBj2DpbQ=; b=ONb+1g50jSrBRR7J9zEPCK5teN/5meadKnXnGKFXEakUfF8M+dYKS1BDtwUBHD3sPnkxW9 CZSfhOChl5zMBKNt3xwYjzxJ7Bj0GisHtmMUK+8OgEx6gCiYBYlVrzYi/xoyP8ro0pvyxK s/Ew+yJF44mUlAbw+BUpmkYAxNFa89hrSW+IvL+C7YJ3HSWZu0Kwi7TClzy6bCf7whrx2Y oKL9xhu6PycINiXO70igBFOV8BMudiphSxBApMks+XCDGSQWqrRyxkj5+uXkOHBdnIv3lo 24dawM2hWbq3rt2nTg0hZKdWZY1vyGHOoyRvgyTV7eh9b59NcrR/gjkFGCCOzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722526700; a=rsa-sha256; cv=none; b=OrGaOE0m0HnsO5uZYdyHiMRgWkJOj59YKw58AoMsdM6UV8yc2f8HJJq240EVQWrV2lVxDQ K8EkH2qJyIlfCU4hdOl3oImQV5z8I/SE9yuOQU1Ye2DSVnAASfIagEa0Wpi08I612b2YUH f0XBkXI2HpEuV74vY0+lNLBRlBoZRk2F5AMP5HBrZ/39cdcJpSe16f5QKbTqQ/YXe56nAL vKCC1RfOJ7L1i4pV0cS0iakfesyu9Dz/Wq1y38QCCuIv+7ZTBGFuXj8XhkqJF9beHkvhQV C/z999WBbd30g7pY/Bhvu5ZfRFPrvcTwxi+pZNUElPbwJ76ZkZRYe20hM1K8AQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=agLmIo2naQmVPh2Gg2CCWatUzRKj4Yt/2CiIBj2DpbQ=; b=wAiy35sQYos4b6Xl+6KDWCx1+vKN0qkvpDkFDuE+YKpBRRyk9wdDZCpa2Cj2TRcr8qmUp6 tz8BQZZbTIwGLcn9l/B64UvlDuC/l3cU9IhLm4NqpLdkbOQXdKxizfepjLjPvD+6bj6QcX pSiGZeBFdMit/7RIW09Qd27ne0XibGXzg+ckmmOJKqsOMULGpKCNZ95V2ZPgt0fJJGVhBu rFa37Ncp7li7yFFbW87t7wQldgJLvX+tefr01YEiGVUws7d0VWq0ZoP77HrZSggvhfHemA h8gcE18gpNK26/BZby5YoiE41O3JjzzXkXY3W502slW3h3/4EYR5QfaJT42Ceg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZY5R6XGDzqQY; Thu, 1 Aug 2024 15:38: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 471FcJ9e026888; Thu, 1 Aug 2024 15:38:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FcJDS026885; Thu, 1 Aug 2024 15:38:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:38:19 GMT Message-Id: <202408011538.471FcJDS026885@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: fc43a1b6842a - stable/14 - tzsetup: symlink /etc/localtime instead of copying List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: fc43a1b6842afa806dfd7ba48de5bece63d04456 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fc43a1b6842afa806dfd7ba48de5bece63d04456 commit fc43a1b6842afa806dfd7ba48de5bece63d04456 Author: Ed Maste AuthorDate: 2022-10-14 16:44:35 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 tzsetup: symlink /etc/localtime instead of copying Using a symlink means that new timezone data (installed by an errata update, say) will be usable without having to be copied again. Reviewed by: bapt, kevans, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37005 (cherry picked from commit 5e16809c953f4cd19fadb1767469dec319de0353) --- usr.sbin/tzsetup/tzsetup.8 | 2 +- usr.sbin/tzsetup/tzsetup.c | 119 ++++++++++----------------------------------- 2 files changed, 27 insertions(+), 94 deletions(-) diff --git a/usr.sbin/tzsetup/tzsetup.8 b/usr.sbin/tzsetup/tzsetup.8 index bfa625a1af3a..499d25765541 100644 --- a/usr.sbin/tzsetup/tzsetup.8 +++ b/usr.sbin/tzsetup/tzsetup.8 @@ -52,7 +52,7 @@ The following options are available: Open all files and directories relative to .Ar chroot_directory . .It Fl n -Do not create or copy files. +Do not create or symlink files. .It Fl r Reinstall the zoneinfo file installed last time. The name is obtained from diff --git a/usr.sbin/tzsetup/tzsetup.c b/usr.sbin/tzsetup/tzsetup.c index 6cd2e16b607c..617de4efb765 100644 --- a/usr.sbin/tzsetup/tzsetup.c +++ b/usr.sbin/tzsetup/tzsetup.c @@ -744,109 +744,42 @@ static void message_zoneinfo_file(const char *title, char *prompt) static int install_zoneinfo_file(const char *zoneinfo_file) { - char buf[1024]; char prompt[SILLY_BUFFER_SIZE]; - struct stat sb; - ssize_t len; - int fd1, fd2, copymode; - - if (lstat(path_localtime, &sb) < 0) { - /* Nothing there yet... */ - copymode = 1; - } else if (S_ISLNK(sb.st_mode)) - copymode = 0; - else - copymode = 1; #ifdef VERBOSE - if (copymode) - snprintf(prompt, sizeof(prompt), - "Copying %s to %s", zoneinfo_file, path_localtime); - else - snprintf(prompt, sizeof(prompt), - "Creating symbolic link %s to %s", - path_localtime, zoneinfo_file); + snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", + path_localtime, zoneinfo_file); message_zoneinfo_file("Info", prompt); #endif if (reallydoit) { - if (copymode) { - fd1 = open(zoneinfo_file, O_RDONLY, 0); - if (fd1 < 0) { - snprintf(prompt, sizeof(prompt), - "Could not open %s: %s", zoneinfo_file, - strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - - if (unlink(path_localtime) < 0 && errno != ENOENT) { - snprintf(prompt, sizeof(prompt), - "Could not delete %s: %s", - path_localtime, strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - - fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY, - S_IRUSR | S_IRGRP | S_IROTH); - if (fd2 < 0) { - snprintf(prompt, sizeof(prompt), - "Could not open %s: %s", - path_localtime, strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - - while ((len = read(fd1, buf, sizeof(buf))) > 0) - if ((len = write(fd2, buf, len)) < 0) - break; - - if (len == -1) { - snprintf(prompt, sizeof(prompt), - "Error copying %s to %s %s", zoneinfo_file, - path_localtime, strerror(errno)); - message_zoneinfo_file("Error", prompt); - /* Better to leave none than a corrupt one. */ - unlink(path_localtime); - return (DITEM_FAILURE | DITEM_RECREATE); - } - close(fd1); - close(fd2); - } else { - if (access(zoneinfo_file, R_OK) != 0) { - snprintf(prompt, sizeof(prompt), - "Cannot access %s: %s", zoneinfo_file, - strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - if (unlink(path_localtime) < 0 && errno != ENOENT) { - snprintf(prompt, sizeof(prompt), - "Could not delete %s: %s", - path_localtime, strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } - if (symlink(zoneinfo_file, path_localtime) < 0) { - snprintf(prompt, sizeof(prompt), - "Cannot create symbolic link %s to %s: %s", - path_localtime, zoneinfo_file, - strerror(errno)); - message_zoneinfo_file("Error", prompt); - return (DITEM_FAILURE | DITEM_RECREATE); - } + if (access(zoneinfo_file, R_OK) != 0) { + snprintf(prompt, sizeof(prompt), + "Cannot access %s: %s", zoneinfo_file, + strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); } - -#ifdef VERBOSE - if (copymode) + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), - "Copied timezone file from %s to %s", - zoneinfo_file, path_localtime); - else + "Could not delete %s: %s", + path_localtime, strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + if (symlink(zoneinfo_file, path_localtime) < 0) { snprintf(prompt, sizeof(prompt), - "Created symbolic link from %s to %s", - zoneinfo_file, path_localtime); + "Cannot create symbolic link %s to %s: %s", + path_localtime, zoneinfo_file, + strerror(errno)); + message_zoneinfo_file("Error", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + +#ifdef VERBOSE + snprintf(prompt, sizeof(prompt), + "Created symbolic link from %s to %s", zoneinfo_file, + path_localtime); message_zoneinfo_file("Done", prompt); #endif } /* reallydoit */ From nobody Thu Aug 1 15:38:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZY5T399hz5SxNP; Thu, 01 Aug 2024 15:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZY5T0wD2z4WbY; Thu, 1 Aug 2024 15:38:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GEOO/6uB7Oy1xc6byhDktdulNzO2vVh/aaRiTEzed3M=; b=g0M0M2eBRN94aEWcQM8LpzqSaosUfURIJALFUKBCAIl63FzySAPxKqFmUxDSbfXFhzul3n Fars/6boqUNBqFx9pWXkJImUM4jki0welNQPrOUvbZEw1ZE/jC6dHlYR5k4IxSckGDOFjn 2jQI5GJ1xqKw81zEndAh6uBqxAUAXvccgol53eyrFcpuTnpebX2O+dYINbLqSo6re0zzG5 Als53rHbaRs0rdUKdJkB7apG/StyDMj60z5eSOOlJxlwMZKxj7K655UQ1BLAfQn5KBVj/y cSb9t/ghBOiDvgAlSDZzzjFuOcftLhJZQuggQg+1ibraQoKVfDG9tFn5gkgXsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722526701; a=rsa-sha256; cv=none; b=XIfa8d3u52DeVOECaZbNElsLdhkmG4mZcBVFUD70a8zJyY8biGxKo6Hk44QV5C5Sk/kR1H Bt5mFcBH0DXZW0erPXG84mjrpFB9+XjBVA6H+lTp4wd4uaWYek6o+quKHpWXM0T2ENu6zw 3ZHdfQCEfiUzHf5+4xUrBKyWBbXzTofStRzbVwa3GJ5X7B7cX0i0FcxaUmYWa1AVHrPhEL B0eWjBZRG7D8XM2QmbzpR60Urm7qDUdCl4fio4taOVWqWfVsvcXHX8FtxhcJKeKgwY29vR ywPH7vmk7NqqwOvpO+vNgeB4vNfn8DZ7HHQUNVvuFUgFfWYKytdy/QNsbcoo5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722526701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GEOO/6uB7Oy1xc6byhDktdulNzO2vVh/aaRiTEzed3M=; b=smyk+XNOQNaMMYHSNIJnJeNH/c8lkwMcRBPSyC9SeZL1UITF7qw457NFkbaW4vDYtuM+E+ SL2hqysDN/VEr/tnFm4Vx+RRRVRbWHvRlnMRNYZoSE97c97lzVQll1Id0oqaoUJwIC2GG1 TrR6OKf1tF6khqPUe+O+PbDbBXO8/hc9DHKzDISoMJucB63TPhoZLBa4JEKcFGCA8DrnuL /4ap75zxG5jMkqMn1LmB3g2eY5Vh4k/1t+99Xv1Uto+EjpV4hn0iAPRwveEIfsHoLtkfPx Ue2ikdwtGEIDGXgF2Mdwg/miL5PK+pymZRwO1eCheFxIWCg2m45oAh3tzSwEXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZY5T02BRzqQZ; Thu, 1 Aug 2024 15:38: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 471FcKEv026937; Thu, 1 Aug 2024 15:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471FcKWr026934; Thu, 1 Aug 2024 15:38:20 GMT (envelope-from git) Date: Thu, 1 Aug 2024 15:38:20 GMT Message-Id: <202408011538.471FcKWr026934@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: 87f7f0389f8b - stable/14 - etcupdate: temporarily comment out one tzsetup test List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 87f7f0389f8b7bf30ef12df5c0d337cb2789883e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=87f7f0389f8b7bf30ef12df5c0d337cb2789883e commit 87f7f0389f8b7bf30ef12df5c0d337cb2789883e Author: Ed Maste AuthorDate: 2023-11-24 22:28:31 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 etcupdate: temporarily comment out one tzsetup test This test fails after tzsetup was changed to symlink rather than copy the zoneinfo file (5e16809c953f). (cherry picked from commit f72b4f7e149d82ef5b8ed7a3aa415fcd7603b350) --- usr.sbin/etcupdate/tests/tzsetup_test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/tests/tzsetup_test.sh b/usr.sbin/etcupdate/tests/tzsetup_test.sh index dd76884e13eb..155830bddae7 100644 --- a/usr.sbin/etcupdate/tests/tzsetup_test.sh +++ b/usr.sbin/etcupdate/tests/tzsetup_test.sh @@ -232,7 +232,8 @@ echo "Differences for real update:" diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out \ || FAILED=yes -file /etc/localtime "foo" -file /var/db/zoneinfo "foo" +# XXX tzsetup installs a symlink as of 5e16809c953f +#file /etc/localtime "foo" +#file /var/db/zoneinfo "foo" [ "${FAILED}" = no ] From nobody Thu Aug 1 15:39:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZY7D4NX0z5SxLk; Thu, 01 Aug 2024 15:39:52 +0000 (UTC) (envelope-from joe.marcus@gmail.com) Received: from mail-qv1-f50.google.com (mail-qv1-f50.google.com [209.85.219.50]) (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 4WZY7D29FRz4XZb; Thu, 1 Aug 2024 15:39:52 +0000 (UTC) (envelope-from joe.marcus@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-f50.google.com with SMTP id 6a1803df08f44-6b795574f9dso38604726d6.0; Thu, 01 Aug 2024 08:39:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722526791; x=1723131591; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=crEH8dP4ZkppT0t1GUulzIk5Ljdz8HTiIB1f8JfHW1s=; b=xLuucJtEbscq+dNpS5qw5JmmM4B7+Z/WMoeCEHx8l1p7HeA+b4VVOG3UGGhTyxXTOj Em0xhsXi2F0BrqS5nHOyLD5CL/VmlR4xQ0D7fY9WunnR0btQHpJwc+RtneNASimchMoo X+518e1cDc2hCUbQ6A057B8AlAGzlLYDgQaQt7p1RWjrpOmkLtvCu4RI/L7kXSZgu5oF Mjk+0InfIKevSF0rTDMDb82q2z/nSyhsQ4DVFu/1clhFkKtyVXd3OZzoNoigWT1CXZGe Wn8rAT4Fm3PR6/mUn6X8dRa+gwjNAunoQ0QEoZNl1DGRvO/ojLQhAniJ/GSrBtPBv4xy mz5Q== X-Forwarded-Encrypted: i=1; AJvYcCVm5ODk/qaHi3nvtfpxy0vEKSAEzPD4OSYIShjaF7TYQn1PJS/TNVAkBmDWh66E9rREtHRZsGOMbRSaHFuYRLBbXsMYCXZkd4gG3MInup8wyjFHe6sDGhXctqXBMYB7xWzp94e3Xk3vVdcGrldx45pM6EL62YrrOhXvdA82Gab9RpOfrn+zcwAOVlycD+OVV20F X-Gm-Message-State: AOJu0Yz89tPnBoLP7yTC28Ql9S6+XPkiarCGS5IDs5EyZaxiyOZPG032 oZJkrsLiQaQI6unleHBRQWSjeecOOyNttZHGWXKTD8S5NMKEdpXBmuxb X-Google-Smtp-Source: AGHT+IFB0KqXeiaFlBeRkJPhllSGASTcUrTPD/5j7v+RDGex92pKi4Bj804Exzm8ZbZzNqhyiIPLJg== X-Received: by 2002:a05:6214:2b95:b0:6b7:a3f3:8b68 with SMTP id 6a1803df08f44-6bb983744d5mr4804536d6.31.1722526790784; Thu, 01 Aug 2024 08:39:50 -0700 (PDT) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com. [2607:fc50:1:f300::2]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb3f8d80b6sm85254236d6.23.2024.08.01.08.39.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 08:39:50 -0700 (PDT) Received: from [10.50.0.248] (wsip-98-173-86-21.lv.lv.cox.net [98.173.86.21]) (authenticated bits=0) by creme-brulee.marcuscom.com (8.18.1/8.18.1) with ESMTPSA id 471Fdl62010502 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 1 Aug 2024 11:39:48 -0400 (EDT) (envelope-from jclarke@marcuscom.com) X-Authentication-Warning: creme-brulee.marcuscom.com: Host wsip-98-173-86-21.lv.lv.cox.net [98.173.86.21] claimed to be [10.50.0.248] Message-ID: Date: Thu, 1 Aug 2024 11:39:47 -0400 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: 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: 6b0a2b19c845 - stable/13 - stand: Print a warning of the loader is too old To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202408011457.471Evboq057700@gitrepo.freebsd.org> Content-Language: en-US From: Joe Clarke In-Reply-To: <202408011457.471Evboq057700@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS,RDNS_DYNAMIC autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on creme-brulee.marcuscom.com X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-Rspamd-Queue-Id: 4WZY7D29FRz4XZb On 8/1/24 10:57, Warner Losh wrote: > +if core.loaderTooOld() then > + print("**********************************************************************") > + print("**********************************************************************") > + print("***** *****") > + print("***** BOOT LOADER IS TOO OLD. PLEASE UPGRADE. *****") > + print("***** *****") > + print("**********************************************************************") > + print("**********************************************************************") > +end > + Hey, Warner. I know this is an MFC, but could the message be updated with a pointer on _how_ to do that upgrade? I always find myself re-learning the process as FreeBSD has evolved, and a current man pointer would always help. Joe From nobody Thu Aug 1 15:43:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYCK3XWVz5SxVG for ; Thu, 01 Aug 2024 15:43:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 4WZYCK1Yb9z4XtD for ; Thu, 1 Aug 2024 15:43:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1fc4fccdd78so53466175ad.2 for ; Thu, 01 Aug 2024 08:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1722527003; x=1723131803; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=G/ILJNR2Iy43n0L188MPo0oewSepmp/JC4TJoVMSgLU=; b=wKQC+VVER0pGYtyLaS/NoOCt9PEA2Bx0s68QoMv2UNuuBiUxj5u/JMRlPx5s2AFZ9S 1CtRmdqYAPGH1lMHjfa+Fz2/9MiIfhaAqz2lMDyCkpd4jUDUqjb+3Z5ChBfPE8Pcv+ZG C+E5gP0swHVeMw3ulckf4nO28yEM9w7tjjbs2cF0219u2A4EoaaOtLz5jdnVR/kcpWoh hSqqPXQ97MuSX8R1LKmQcC0GJ0q3y1VvBogk3JtzQeeurDmsHRBj810En7ab3CCXju3n 4GGyJbRA184ZC1IyLNea7rjL8YCnTFlwoBSTRvdT9Z2yFfk4wgzVGE1Mv6KhRzGPIrWg Oosg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722527003; x=1723131803; 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=G/ILJNR2Iy43n0L188MPo0oewSepmp/JC4TJoVMSgLU=; b=RuvXI7iV112fDRgqJbI5EMVdOvZ6RYGqWWkHri8XinvZAxgklfJZhNIgsW1+MCCZcq SMCE1AH3PHvIYSgQaJ5iprEMorTJPeXRQ3Am74hz92PREJWIMOvXys22Gryd29WPRbha PEGa76ca3m5kVnZHGS3xlyh4UvtXGY4bmsMUo1Z/awNmmyYyY2gkhVi8VQhJLcURX/Pn r734GO2aGrkME1u8sCCin8NoHlXyte0woiKNiSgpADAGE3eMc4pS7NDsyYx7kaMjryhF QYITPlbquDzpth0fZsgVJIueMrabVi4pgvk9X5jrTymiMss0BjXx73Sto3c5+KY1LQAk N8gw== X-Forwarded-Encrypted: i=1; AJvYcCXjT9oxaM2e/E5dAGpyBke+Pxgz0LezCVGPD90beqAE21VMx/fjjUpwTNKZz67qb7unpzudIRKU0sly+Gm+JaWhUv8EVRtgqKwPXo1Wb+pBNPEV46Q= X-Gm-Message-State: AOJu0Yw7Zv1ORsTKWbVycl8hueEP3+3hQpH6+MDGAlqVHirwUCPncT+d xQ8+uMJ31YX//41BwX4DVWkqr6Nx4GrCWcAz6q11RE0do+QxTnUXknK1aVZemI9iptgUujUkAVt NDVU5ROIWIwTRCcESUxHgtZ7zAeG4stHYcSG7DFBzaefhGn+Y X-Google-Smtp-Source: AGHT+IHtmSRh8hv4GrM/RlXoOhpMShc43eMysi0iyFRCryWLFN2HFHlxpRDGgpTQKwvKh1ScTQvyX6Z7GDdRCeDEn30= X-Received: by 2002:a17:902:edd3:b0:1fc:4aff:5b46 with SMTP id d9443c01a7336-1ff574911a6mr5469785ad.47.1722527002907; Thu, 01 Aug 2024 08:43:22 -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: <202408011457.471Evboq057700@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 1 Aug 2024 09:43:11 -0600 Message-ID: Subject: Re: git: 6b0a2b19c845 - stable/13 - stand: Print a warning of the loader is too old To: Joe Clarke Cc: Warner Losh , src-committers , "" , dev-commits-src-branches@freebsd.org Content-Type: multipart/alternative; boundary="0000000000001ff157061ea112f6" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4WZYCK1Yb9z4XtD --0000000000001ff157061ea112f6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Aug 1, 2024, 9:39=E2=80=AFAM Joe Clarke wro= te: > On 8/1/24 10:57, Warner Losh wrote: > > > +if core.loaderTooOld() then > > + > print("*****************************************************************= *****") > > + > print("*****************************************************************= *****") > > + print("***** > *****") > > + print("***** BOOT LOADER IS TOO OLD. PLEASE UPGRADE. > *****") > > + print("***** > *****") > > + > print("*****************************************************************= *****") > > + > print("*****************************************************************= *****") > > +end > > + > > Hey, Warner. I know this is an MFC, but could the message be updated > with a pointer on _how_ to do that upgrade? I always find myself > re-learning the process as FreeBSD has evolved, and a current man > pointer would always help. > We have a man page for this already, but it's not very good. I'd hoped to do something with release notes for this release. I was racing the freeze deadline with the actual change and was going to chase it with the new / improved docs. Warner > --0000000000001ff157061ea112f6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Aug 1, 2024, 9:39=E2=80=AFAM Joe Clarke <jclarke@marcuscom.com> wrote:=
On 8/1/24 10:57, Warner Losh wrote= :

> +if core.loaderTooOld() then
> +=C2=A0 =C2=A0 =C2=A0print("*************************************= *********************************")
> +=C2=A0 =C2=A0 =C2=A0print("*************************************= *********************************")
> +=C2=A0 =C2=A0 =C2=A0print("*****=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *****")
> +=C2=A0 =C2=A0 =C2=A0print("*****=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0BOOT LOADER IS TOO OLD. PLEASE UPGRADE.=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 *****")
> +=C2=A0 =C2=A0 =C2=A0print("*****=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *****")
> +=C2=A0 =C2=A0 =C2=A0print("*************************************= *********************************")
> +=C2=A0 =C2=A0 =C2=A0print("*************************************= *********************************")
> +end
> +

Hey, Warner.=C2=A0 I know this is an MFC, but could the message be updated =
with a pointer on _how_ to do that upgrade?=C2=A0 I always find myself
re-learning the process as FreeBSD has evolved, and a current man
pointer would always help.
We have a man page for this already, but it's= not very good. I'd hoped to do something with release notes for this r= elease. I was racing the freeze deadline with the actual change and was goi= ng to chase it with the new / improved docs.

Warner
--0000000000001ff157061ea112f6-- From nobody Thu Aug 1 16:07:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYks4QWpz5T0CB; Thu, 01 Aug 2024 16:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYks2WcJz4bRb; Thu, 1 Aug 2024 16:07:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rmcqxz8A1X2jlPgajF3Ks7HlMXoJvUEhr75ZNvRL7Pg=; b=d1KFLH88+sl0z2S/ycNlFR+yK10qTMxdXVsRggkO7gDGxrlMSb8A8I+1jwWPwPJQYcbOXm 1ohIpmO4dkqfNHgGj15O0rA92Wn2XHZpTxh2bLO/wglzDqSxUQOCcKXE9Z0bj9Qk7hmuhx kF4Myd694QgWa8d8BE4/mTKVnrFh4+Hxamw97oV/ylDoTZE7gtAMo3nCDisYq1vmEZ1Ni7 xb9HItz/n2+rVw/UeO25gkLvJ0u2GV73cVxQfBX/QJYV/QmMxvhI4vu7bnrRd+gdGeC8DT 9e7b136+sEIkBGhz0Pf8VNbSJjJVKxbZiKrw+6pXWsOqFSRj4lgl4Tf96wsSqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528437; a=rsa-sha256; cv=none; b=bHUm9bcMxN+8rNXHH9UKHCV2JIQlQM1HVetVnd3lC/IdqglUH+UZ4e4HoPgI4rC/YObpSZ l/JgQ/sb/uTDmgKO3UFfrPjtfIxhU96v00Lizb1UBuabpdpGoFqz8YxtdWm0BmbwjYmcOy gYmSUwz4OjFdFWpXA6cXY5qhGwyu93eZYPBoyc5o6cCAXEx00JJcwPKwjHGuo2o9cZdTuV DbpGfEqRwmD1ezh/XkeTuF2ZVN1CThkVGZlSPOlYArwaE/E8Tm+M6t5LeXMPYfb53YDDtc FDFLr+xvxTW5rFoPVk8c3QR5FnGqYN1e3Tyb2VmDm94M15YzsMl+rVhnhbVLow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rmcqxz8A1X2jlPgajF3Ks7HlMXoJvUEhr75ZNvRL7Pg=; b=lCBtW6fq4lwKlT0DsYsgDFsXUxcJtC3OoliMKIizuFAQxjZECuwA1c/QeV+me4dopUVS6d FVYGTkSrtzV0anxTww39XM78FXyyKQpDvrHbqo5Y8t0Dsvdiia9FZh9sDPqi/iSSipUovH Lo0nDNwCZYkUeyaCaqwqvhdz7kxImW/ceM+fbTUwbfqaaN6oO07dMQnuQY40BW4XPNQ+gR 7jWvxEQeL4zR5zJXJaevPqby1RX7lQ55Ej1QIjMknGDyT7gfnz3AoG96QlHpjtW/8i3wot fFcQwR2CigU2DMjC1dy+aPZk4ErL1inNg9PsK6qJ7hr/Y6SeG9AnFIYX/kcHPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYks27mNzrm4; Thu, 1 Aug 2024 16:07: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 471G7HI8078884; Thu, 1 Aug 2024 16:07:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7HZV078881; Thu, 1 Aug 2024 16:07:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:17 GMT Message-Id: <202408011607.471G7HZV078881@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: 63cd0ebe4be8 - stable/14 - mfc-candidates: fix output order with incorrect commit dates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 63cd0ebe4be8dde0e0cec23920ed40f7618042d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=63cd0ebe4be8dde0e0cec23920ed40f7618042d3 commit 63cd0ebe4be8dde0e0cec23920ed40f7618042d3 Author: Ed Maste AuthorDate: 2024-04-16 15:41:05 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 mfc-candidates: fix output order with incorrect commit dates Previously we obtained the list of MFC candidate hashes (i.e., those commits only in the mfc-from branch), removed the already-merged commits based on "cherry picked from" commit message entries, and then printed the list sorted by commit time. This is usually the correct order, but it is not when commits have non-monotonically-increasing commit times. This is unfortunately the case for a number of commits in our tree. This made it difficult to merge some groups of dependent commits in the correct order. Instead, leave the from-list in git rev-parse order, and move the matching logic to a new lua script. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44808 (cherry picked from commit d51c590023675ca20a7da74d75a3b5a5dcfdfddc) --- tools/tools/git/candidatematch.lua | 66 ++++++++++++++++++++++++++++++++++++++ tools/tools/git/mfc-candidates.sh | 19 ++++------- 2 files changed, 72 insertions(+), 13 deletions(-) diff --git a/tools/tools/git/candidatematch.lua b/tools/tools/git/candidatematch.lua new file mode 100755 index 000000000000..98c247fca339 --- /dev/null +++ b/tools/tools/git/candidatematch.lua @@ -0,0 +1,66 @@ +#!/usr/libexec/flua + +-- MFC candidate script utility - $0 from-file to-file +-- +-- from-file specifies hashes that exist only in the "MFC from" branch and +-- to-file specifies the original hashes of commits already merged to the +-- "MFC to" branch. + +-- SPDX-License-Identifier: BSD-2-Clause +-- Copyright 2024 The FreeBSD Foundation + +-- Read a file and return its content as a table +local function read_file(filename) + local file = assert(io.open(filename, "r")) + local content = {} + for line in file:lines() do + table.insert(content, line) + end + file:close() + return content +end + +-- Remove hashes from 'set1' list that are present in 'set2' list +local function set_difference(set1, set2) + local set2_values = {} + for _, value in ipairs(set2) do + set2_values[value] = true + end + + local result = {} + for _, value in ipairs(set1) do + if not set2_values[value] then + table.insert(result, value) + end + end + return result +end + +-- Main function +local function main() + local from_file = arg[1] + local to_file = arg[2] + local exclude_file = arg[3] + + if not from_file or not to_file then + print("Usage: flua $0 from-file to-file") + return + end + + local from_hashes = read_file(from_file) + local to_hashes = read_file(to_file) + + local result_hashes = set_difference(from_hashes, to_hashes) + + if exclude_file then + exclude_hashes = read_file(exclude_file) + result_hashes = set_difference(result_hashes, exclude_hashes) + end + + -- Print the result + for _, hash in ipairs(result_hashes) do + print(hash) + end +end + +main() diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh index 6610f539fef0..dd88710a4a4a 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -124,16 +124,14 @@ fi # Commits in from_branch after branch point commits_from() { - git rev-list --first-parent $authorarg $to_branch..$from_branch "$@" |\ - sort + git rev-list --first-parent --reverse $authorarg $to_branch..$from_branch "$@" } # "cherry picked from" hashes from commits in to_branch after branch point commits_to() { git log $from_branch..$to_branch --grep 'cherry picked from' "$@" |\ - sed -E -n 's/^[[:space:]]*\(cherry picked from commit ([0-9a-f]+)\)[[:space:]]*$/\1/p' |\ - sort + sed -E -n 's/^[[:space:]]*\(cherry picked from commit ([0-9a-f]+)\)[[:space:]]*$/\1/p' } # Turn a list of short hashes (and optional descriptions) into a list of full @@ -161,16 +159,11 @@ fi commits_from "$@" > $from_list commits_to "$@" > $to_list -comm -23 $from_list $to_list > $candidate_list +/usr/libexec/flua $(dirname $0)/candidatematch.lua \ + $from_list $to_list $exclude_list > $candidate_list -if [ -n "$exclude_file" ]; then - mv $candidate_list $candidate_list.bak - comm -23 $candidate_list.bak $exclude_list > $candidate_list -fi - -# Sort by (but do not print) commit time while read hash; do - git show --pretty='%ct %h %s' --no-patch $hash -done < $candidate_list | sort -n | cut -d ' ' -f 2- + git show --pretty='%h %s' --no-patch $hash +done < $candidate_list rm -rf "$workdir" From nobody Thu Aug 1 16:07:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYkt4cTWz5T074; Thu, 01 Aug 2024 16:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYkt3pJFz4bPY; Thu, 1 Aug 2024 16:07:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQvoWa++mP4pxho0lsth7x2SuiLmdrlo1or05j2qTmw=; b=YBCURWTJj8MF54m01cjq6bWbERpvV91t+2qTu5qYI+gtKHuVbGYZxsxYbt8tH193/PUBLj 1WFLzfVuOuE1jge1eMxBuJEh9aQ+mde0UhXUOKNu3ZFnbyJNqQINxGe156QGG7ezOF0FDz ZDY+OSbmsszYMJ/l6wBhB0E51jvFQvUQOqAu2mMybZCGx5h+7gIgna0TGCpEFCr1mBV0F9 2k7VyOrqlT89JVPU4FdZoCcFQOdMw05rxCXHvfz01KHBda2aNmgkuS2mLeOIGaJbb76rcF HOVSP0mqKSgV1osOSigD05Hdl7wK0PkFd3mnsOR3+dD1Xm2h/IwODpnPr0Zw0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528438; a=rsa-sha256; cv=none; b=O05cnquS4Eb2AG9CfhqyWv2BY+Ld606yYOgZiquwhI7Cx5UixMeHt5Kx5FiGsjv9TCEwLG OXoiR9IyhqWw26XDCupzm0a2bYS4ZPnpimCkwfvwW+Ygxnmn8JMNtkwd61aekcYej9hZBW c///bn+3ApCNci5slpjCiVc/Hplk0RlG6Ji9Hsc9m7cIqMjvhj3Dyg5LnQA0BzlNRIBj9t dl3x9Ddl4ajNDKl+xgTopVVyNWyd0JilyfqNd0QITJny2fcAFWE2dfG3B9SqUD7Uc8Vas+ AGmNUCS5nMvYrG7vMQnCU4Vm/UAw8WvtDN70/Ur1EjgOOkbjA3N1kRnPXHv7Qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KQvoWa++mP4pxho0lsth7x2SuiLmdrlo1or05j2qTmw=; b=HZQCq+Kv1HN25cjDmPC/pe6E+1Zgvhmj6qm27obpXaLQhUbvCtuCB+jhPvORXIgvcf1JuH ChON1mR/atdiG1NrQnRof5gIF+Cf+RPMWzIrtzoTSMgQdSv1RWlPibA6VW7iqazMlmwFqI SutgtRxEhRFD3jYIN+npuwSVh+N6OdUW6ToHEDbKXRrf08DIR2So7E3znidjLzsGvkwee2 UrBQPeqeZ+AbI7FRNZkxpIs2K94zH+1J8gY3DGe/Y2H5fxqxeQSZ843z5PEsHsJ0vOATkA zgxw6jrhPzfQQfcoJmjjBuyTqYus3U5U8LvmqRtSOCPRpcpKKJ83eeeOemTlKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYkt3Pb3zrm5; Thu, 1 Aug 2024 16:07: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 471G7IdS078929; Thu, 1 Aug 2024 16:07:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7Ina078926; Thu, 1 Aug 2024 16:07:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:18 GMT Message-Id: <202408011607.471G7Ina078926@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: 311f95ce3d41 - stable/14 - mfc-candidates: move pretty printing into lua List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 311f95ce3d4111eff1a6242be55adf52283b3e5e Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=311f95ce3d4111eff1a6242be55adf52283b3e5e commit 311f95ce3d4111eff1a6242be55adf52283b3e5e Author: Ed Maste AuthorDate: 2024-04-16 16:49:05 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 mfc-candidates: move pretty printing into lua d51c59002367 moved the MFC hash matching logic into a lua utility script but left the output formatting in the shell script. Simplify this slightly by just printing the formatted output from lua. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44836 (cherry picked from commit 793745fad866f65863ab3b16a17bdf18dc779efd) --- tools/tools/git/candidatematch.lua | 10 +++++++++- tools/tools/git/mfc-candidates.sh | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/tools/git/candidatematch.lua b/tools/tools/git/candidatematch.lua index 98c247fca339..481c1f38fea1 100755 --- a/tools/tools/git/candidatematch.lua +++ b/tools/tools/git/candidatematch.lua @@ -36,6 +36,14 @@ local function set_difference(set1, set2) return result end +-- Execute a command and print to stdout +local function exec_command(command) + local handle = io.popen(command) + local output = handle:read("a") + handle:close() + io.write(output) +end + -- Main function local function main() local from_file = arg[1] @@ -59,7 +67,7 @@ local function main() -- Print the result for _, hash in ipairs(result_hashes) do - print(hash) + exec_command("git show --pretty='%h %s' --no-patch " .. hash) end end diff --git a/tools/tools/git/mfc-candidates.sh b/tools/tools/git/mfc-candidates.sh index dd88710a4a4a..bc1ad602cb1c 100644 --- a/tools/tools/git/mfc-candidates.sh +++ b/tools/tools/git/mfc-candidates.sh @@ -149,7 +149,6 @@ canonicalize_hashes() workdir=$(mktemp -d /tmp/find-mfc.XXXXXXXXXX) from_list=$workdir/commits-from to_list=$workdir/commits-to -candidate_list=$workdir/candidates if [ -n "$exclude_file" ]; then exclude_list=$workdir/commits-exclude @@ -160,10 +159,6 @@ commits_from "$@" > $from_list commits_to "$@" > $to_list /usr/libexec/flua $(dirname $0)/candidatematch.lua \ - $from_list $to_list $exclude_list > $candidate_list - -while read hash; do - git show --pretty='%h %s' --no-patch $hash -done < $candidate_list + $from_list $to_list $exclude_list rm -rf "$workdir" From nobody Thu Aug 1 16:07:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYkw0Mh0z5T075; Thu, 01 Aug 2024 16:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYkv5Fjtz4bFJ; Thu, 1 Aug 2024 16:07:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcBwPpaiMbfM+S+Bw9kij8fCpqiy9uX7LLkqhO4QlZk=; b=xz6gPGbx6eLOYWYAgLDX4sjVVeebjGNYOcbpnNNg8Ag9jGT7LyZrmbXvibcC73SrnlNL8f WoCzFotGuK4GR36EtHT9rt8f/NBLrny/pN7KdxC1UzAernHDz7zXF8hbLJBIXjfuEUQT0v JLZaear6lc1SBgqRMzwDmMcp7Dq+yLV26a9kKk3vz6ibXv5Ci9lkhD2vuX+b8okX6u2D8Y xSWWtEHTr8kHKR0JPktlPSOCxKbMTpN8+4Tlyq0kxkBWDxqdNJakFhHRiKeY6uWWtnPMq0 UXOHVnsWgTOa2l8m0QH6gWQmfqC1sxBzyAEXeT3ZFn9jRJW6zP4fAsYZCCcQxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528439; a=rsa-sha256; cv=none; b=BlWBoP56AAqI8W3dMHrhp06fquhP5JrHjJ2BaBDl/TEfL/1LgyK8Y9dQlwGby01JkLviXw piR74uPqfuDzJiceYFza4E0lqvbT8L2kJKGlQnA5j7eglLj6lk1tmTyFJreTqq8eWtouR3 DpMxR3s7O5bRGWjWinYTOTFsAEs8cQo3HErm1XOxEvq6fBKvlobqoFTrouqND/AtyXbd7c qAnaSgAy/okQDhTV102hkKUzqLteIJD8UY/Cj6VCWU/cLs3+A4T7LsGmmEAHU1/8g51AaW RETbeB8LR6U+9eamHHZJkJei07bfiNWt9BmxKSEIZUVElj3ywMFq37kKzo+UVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BcBwPpaiMbfM+S+Bw9kij8fCpqiy9uX7LLkqhO4QlZk=; b=Bk2mnqZXjAdbcQmCPskMqMrrjZFQ07cc7nlen55bOIaYteHbmYlVGelT7i0u2lnpdWnIpP PgNBExB1KRSidibwq8R7M2ggbpDh9jJ0ZJueoDIJUh/ZBowuSuoO51AKr74FymeMElPu4V inW/9M0WqDv8cyilVW/K/jq81mYiei28eEf2C/JN+9xOL9XoBkoLsplEbBGPEWw1YqilI3 7Yr/5YyNn53oXI1d6UDxn79Rv64qIYtjw6m5kdf7ZyNoKaHb5JsZCPnV2UBSBEXoNZNYzD UXFdHm/+PNonQxmSqSIveD9sR0tObi4i/IdFuV+1ed8gJVVK/Kx+dZFkhJ9gzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYkv4HKCzrZj; Thu, 1 Aug 2024 16:07: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 471G7Jg4078973; Thu, 1 Aug 2024 16:07:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7JO0078970; Thu, 1 Aug 2024 16:07:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:19 GMT Message-Id: <202408011607.471G7JO0078970@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: 1755b9daa693 - stable/14 - libcbor: vendor update to 0.11.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/14 X-Git-Reftype: branch X-Git-Commit: 1755b9daa6938fa549abbe7f99d53bf504ea48c7 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1755b9daa6938fa549abbe7f99d53bf504ea48c7 commit 1755b9daa6938fa549abbe7f99d53bf504ea48c7 Author: Ed Maste AuthorDate: 2024-05-03 23:33:50 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 libcbor: vendor update to 0.11.0 Sponsored by: The FreeBSD Foundation (cherry picked from commit abd872540f24cfc7dbd1ea29b6918c7082a22108) --- contrib/libcbor/.circleci/config.yml | 30 ++-- contrib/libcbor/.cirrus.yml | 26 +++ contrib/libcbor/.readthedocs.yaml | 21 +++ contrib/libcbor/CHANGELOG.md | 15 +- contrib/libcbor/CMakeLists.txt | 18 +- contrib/libcbor/CONTRIBUTING.md | 2 +- contrib/libcbor/Doxyfile | 2 +- contrib/libcbor/README.md | 7 +- contrib/libcbor/appveyor.yml | 14 -- contrib/libcbor/doc/source/api/item_types.rst | 2 +- contrib/libcbor/doc/source/conf.py | 18 +- contrib/libcbor/doc/source/development.rst | 6 +- contrib/libcbor/doc/source/index.rst | 8 +- contrib/libcbor/doc/source/internal.rst | 4 +- contrib/libcbor/doc/source/requirements.txt | 52 +++--- ...fc_conformance.rst => standard_conformance.rst} | 6 +- contrib/libcbor/examples/CMakeLists.txt | 4 + .../bazel/third_party/libcbor/cbor/configuration.h | 4 +- contrib/libcbor/examples/cbor2cjson.c | 123 +++++++++++++ contrib/libcbor/examples/cjson2cbor.c | 4 +- contrib/libcbor/examples/data/all_types.cbor | Bin 0 -> 354 bytes contrib/libcbor/examples/readfile.c | 2 +- contrib/libcbor/oss-fuzz/build.sh | 2 +- contrib/libcbor/src/CMakeLists.txt | 21 ++- contrib/libcbor/src/cbor.c | 82 +++++---- contrib/libcbor/src/cbor/common.h | 2 +- .../libcbor/src/cbor/internal/builder_callbacks.c | 27 +-- contrib/libcbor/src/cbor/internal/loaders.c | 2 +- contrib/libcbor/src/cbor/internal/memory_utils.h | 2 +- contrib/libcbor/src/cbor/internal/unicode.c | 6 +- contrib/libcbor/src/cbor/internal/unicode.h | 6 +- contrib/libcbor/src/cbor/maps.c | 1 + contrib/libcbor/src/cbor/streaming.c | 43 ++--- contrib/libcbor/src/cbor/strings.c | 10 ++ contrib/libcbor/src/cbor/strings.h | 19 +- contrib/libcbor/src/libcborConfig.cmake.in | 8 + contrib/libcbor/test/callbacks_test.c | 25 +++ contrib/libcbor/test/cbor_serialize_test.c | 32 ++++ contrib/libcbor/test/cbor_stream_decode_test.c | 8 +- contrib/libcbor/test/float_ctrl_test.c | 6 +- contrib/libcbor/test/pretty_printer_test.c | 197 +++++++++++++++++++-- contrib/libcbor/test/string_test.c | 67 +++++++ contrib/libcbor/test/tag_test.c | 23 +++ contrib/libcbor/test/test_allocator.c | 2 +- 44 files changed, 746 insertions(+), 213 deletions(-) diff --git a/contrib/libcbor/.circleci/config.yml b/contrib/libcbor/.circleci/config.yml index 69371b67d624..4391ad8d1e9c 100644 --- a/contrib/libcbor/.circleci/config.yml +++ b/contrib/libcbor/.circleci/config.yml @@ -4,12 +4,14 @@ commands: linux-setup: steps: - run: sudo apt-get update - - run: sudo apt-get install -y cmake ${TOOLCHAIN_PACKAGES} - - run: sudo apt install libcmocka-dev + # NEEDRESTART_MODE prevents automatic restarts which seem to hang. + - run: sudo NEEDRESTART_MODE=l apt-get install -y cmake ${TOOLCHAIN_PACKAGES} + - run: sudo NEEDRESTART_MODE=l apt-get install -y libcmocka-dev libcjson-dev build: steps: - run: > cmake -DWITH_TESTS=ON \ + -DWITH_EXAMPLES=ON \ -DCMAKE_BUILD_TYPE=Debug \ -DSANITIZE=OFF \ -DCOVERAGE="${CMAKE_COVERAGE:='OFF'}" \ @@ -31,14 +33,14 @@ orbs: jobs: static-test: - machine: - image: ubuntu-2204:2022.10.2 + machine: &default-machine + image: ubuntu-2204:2023.07.2 environment: TOOLCHAIN_PACKAGES: g++ steps: - checkout - linux-setup - - run: sudo apt-get install -y clang-format doxygen cppcheck + - run: sudo NEEDRESTART_MODE=l apt-get install -y clang-format doxygen cppcheck - run: cppcheck --inline-suppr --error-exitcode=1 . - run: bash clang-format.sh --verbose - run: > @@ -60,14 +62,14 @@ jobs: build-and-test: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine environment: TOOLCHAIN_PACKAGES: g++ CMAKE_COVERAGE: ON steps: - checkout - linux-setup - - run: sudo apt-get install -y valgrind + - run: sudo NEEDRESTART_MODE=l apt-get install -y valgrind - build - test - run: ctest -T Coverage @@ -81,7 +83,7 @@ jobs: build-and-test-clang: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine environment: TOOLCHAIN_PACKAGES: clang CC: clang @@ -94,11 +96,11 @@ jobs: build-and-test-32b: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine steps: - checkout - run: sudo apt-get update - - run: sudo apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386 + - run: sudo NEEDRESTART_MODE=l apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386 # Make cmocka from source w/ 32b setup - run: git clone https://git.cryptomilk.org/projects/cmocka.git ~/cmocka - run: > @@ -117,7 +119,7 @@ jobs: build-and-test-release-clang: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine environment: TOOLCHAIN_PACKAGES: clang CC: clang @@ -130,7 +132,7 @@ jobs: llvm-coverage: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine environment: TOOLCHAIN_PACKAGES: clang CC: clang @@ -145,7 +147,7 @@ jobs: build-and-test-arm: machine: - image: ubuntu-2204:2022.10.2 + <<: *default-machine environment: TOOLCHAIN_PACKAGES: g++ resource_class: arm.medium @@ -157,7 +159,7 @@ jobs: build-bazel: machine: - image: ubuntu-2204:2022.10.2 + image: ubuntu-2204:2023.07.2 environment: TOOLCHAIN_PACKAGES: g++ steps: diff --git a/contrib/libcbor/.cirrus.yml b/contrib/libcbor/.cirrus.yml new file mode 100644 index 000000000000..948ae23b4a98 --- /dev/null +++ b/contrib/libcbor/.cirrus.yml @@ -0,0 +1,26 @@ +freebsd_task: + install_script: + - ASSUME_ALWAYS_YES=yes pkg bootstrap -f && pkg install -y cmocka cmake ninja + build_script: + - mkdir build + - cd build + - cmake -GNinja -DWITH_TESTS=ON + -DCBOR_CUSTOM_ALLOC=ON + -DCMAKE_BUILD_TYPE=Debug + -DSANITIZE=OFF + .. + - ninja -j $(sysctl -n hw.ncpu) + test_script: + - cd build + - ctest -VV + matrix: + # From gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images + - name: freebsd-13-2 + freebsd_instance: + image_family: freebsd-13-2 + - name: freebsd-14-0 + freebsd_instance: + image_family: freebsd-14-0 + - name: freebsd-15-0-snap + freebsd_instance: + image_family: freebsd-15-0-snap diff --git a/contrib/libcbor/.readthedocs.yaml b/contrib/libcbor/.readthedocs.yaml new file mode 100644 index 000000000000..f2514ffae113 --- /dev/null +++ b/contrib/libcbor/.readthedocs.yaml @@ -0,0 +1,21 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: doc/source/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - requirements: doc/source/requirements.txt diff --git a/contrib/libcbor/CHANGELOG.md b/contrib/libcbor/CHANGELOG.md index f2475f308c7a..3c331f9266ab 100644 --- a/contrib/libcbor/CHANGELOG.md +++ b/contrib/libcbor/CHANGELOG.md @@ -4,6 +4,19 @@ Template: Next --------------------- +0.11.0 (2024-02-04) +--------------------- +- [Updated documentation to refer to RFC 8949](https://github.com/PJK/libcbor/issues/269) +- Improvements to `cbor_describe` + - [Bytestring data will now be printed as well](https://github.com/PJK/libcbor/pull/281) by [akallabeth](https://github.com/akallabeth) + - [Formatting consistency and clarity improvements](https://github.com/PJK/libcbor/pull/285) +- [Fix `cbor_string_set_handle` not setting the codepoint count](https://github.com/PJK/libcbor/pull/286) +- BREAKING: [`cbor_load` will no longer fail on input strings that are well-formed but not valid UTF-8](https://github.com/PJK/libcbor/pull/286) + - If you were relying on the validation, please check the result using `cbor_string_codepoint_count` instead +- BREAKING: [All decoders like `cbor_load` and `cbor_stream_decode` will accept all well-formed tag values](https://github.com/PJK/libcbor/pull/308) (bug discovered by [dskern-github](https://github.com/dskern-github)) + - Previously, decoding of certain values would fail with `CBOR_ERR_MALFORMATED` or `CBOR_DECODER_ERROR` + - This also makes decoding symmetrical with serialization, which already accepts all values + 0.10.2 (2023-01-31) --------------------- - [Fixed minor test bug causing failures for x86 Linux](https://github.com/PJK/libcbor/pull/266) (discovered by [trofi](https://github.com/PJK/libcbor/issues/263)) @@ -117,7 +130,7 @@ Next Breaks build & header compatibility due to: - Improved build configuration and feature check macros -- Endianess configuration fixes (by Erwin Kroon and David Grigsby) +- Endianness configuration fixes (by Erwin Kroon and David Grigsby) - pkg-config compatibility (by Vincent Bernat) - enable use of versioned SONAME (by Vincent Bernat) - better fuzzer (wasn't random until now, ooops) diff --git a/contrib/libcbor/CMakeLists.txt b/contrib/libcbor/CMakeLists.txt index 5c0a7846cfa3..16b9f0875d33 100644 --- a/contrib/libcbor/CMakeLists.txt +++ b/contrib/libcbor/CMakeLists.txt @@ -1,14 +1,18 @@ cmake_minimum_required(VERSION 3.0) + project(libcbor) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/") include(CTest) +include(GNUInstallDirs) # Provides CMAKE_INSTALL_ variables SET(CBOR_VERSION_MAJOR "0") -SET(CBOR_VERSION_MINOR "10") -SET(CBOR_VERSION_PATCH "2") +SET(CBOR_VERSION_MINOR "11") +SET(CBOR_VERSION_PATCH "0") SET(CBOR_VERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH}) -set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true) +option(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY "cmake --build --target install does not depend on cmake --build" true) +option(BUILD_SHARED_LIBS "Build as a shared library" false) + include(CheckIncludeFiles) include(TestBigEndian) @@ -19,10 +23,10 @@ endif() option(CBOR_CUSTOM_ALLOC "Custom, dynamically defined allocator support" OFF) if(CBOR_CUSTOM_ALLOC) - message(WARNING + message(WARNING "CBOR_CUSTOM_ALLOC has been deprecated. Custom allocators are now enabled by default." "The flag is a no-op and will be removed in the next version. " - "Please remove CBOR_CUSTOM_ALLOC from your build configuation.") + "Please remove CBOR_CUSTOM_ALLOC from your build configuration.") endif(CBOR_CUSTOM_ALLOC) option(CBOR_PRETTY_PRINTER "Include a pretty-printing routine" ON) @@ -138,12 +142,10 @@ if (COVERAGE) endif() endif (COVERAGE) - # We want to generate configuration.h from the template and make it so that it is accessible using the same # path during both library build and installed header use, without littering the source dir. -# Using cbor/configuration.h in the build dir works b/c headers will be installed to /cbor configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/cbor/configuration.h.in ${PROJECT_BINARY_DIR}/cbor/configuration.h) -install(FILES ${PROJECT_BINARY_DIR}/cbor/configuration.h DESTINATION include/cbor) +install(FILES ${PROJECT_BINARY_DIR}/cbor/configuration.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cbor) # Make the header visible at compile time include_directories(${PROJECT_BINARY_DIR}) diff --git a/contrib/libcbor/CONTRIBUTING.md b/contrib/libcbor/CONTRIBUTING.md index cc834d21a46b..9bd42a06b6dc 100644 --- a/contrib/libcbor/CONTRIBUTING.md +++ b/contrib/libcbor/CONTRIBUTING.md @@ -2,7 +2,7 @@ libcbor is maintained by [@PJK](https://github.com/PJK) in his spare time on a best-effort basis. -Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described belows. +Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described below. ## Principles diff --git a/contrib/libcbor/Doxyfile b/contrib/libcbor/Doxyfile index 2571057646d7..67df45cfbb94 100644 --- a/contrib/libcbor/Doxyfile +++ b/contrib/libcbor/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = libcbor # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.2 +PROJECT_NUMBER = 0.11.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/contrib/libcbor/README.md b/contrib/libcbor/README.md index 6d34ba9d4dcb..ea54bed9437b 100644 --- a/contrib/libcbor/README.md +++ b/contrib/libcbor/README.md @@ -1,16 +1,15 @@ # [libcbor](https://github.com/PJK/libcbor) [![CircleCI](https://circleci.com/gh/PJK/libcbor/tree/master.svg?style=svg)](https://circleci.com/gh/PJK/libcbor/tree/master) -[![Build status](https://ci.appveyor.com/api/projects/status/8kkmvmefelsxp5u2?svg=true)](https://ci.appveyor.com/project/PJK/libcbor) [![Documentation Status](https://readthedocs.org/projects/libcbor/badge/?version=latest)](https://readthedocs.org/projects/libcbor/?badge=latest) [![latest packaged version(s)](https://repology.org/badge/latest-versions/libcbor.svg)](https://repology.org/project/libcbor/versions) [![codecov](https://codecov.io/gh/PJK/libcbor/branch/master/graph/badge.svg)](https://codecov.io/gh/PJK/libcbor) -**libcbor** is a C library for parsing and generating [CBOR](https://tools.ietf.org/html/rfc7049), the general-purpose schema-less binary data format. +**libcbor** is a C library for parsing and generating [CBOR](https://cbor.io/), the general-purpose schema-less binary data format. ## Main features - - Complete RFC conformance - - Robust C99 implementation + - Complete [IETF RFC 8949 (STD 94)](https://www.rfc-editor.org/info/std94) conformance + - Robust platform-independent C99 implementation - Layered architecture offers both control and convenience - Flexible memory management - No shared global state - threading friendly diff --git a/contrib/libcbor/appveyor.yml b/contrib/libcbor/appveyor.yml deleted file mode 100644 index 6a0cca219b92..000000000000 --- a/contrib/libcbor/appveyor.yml +++ /dev/null @@ -1,14 +0,0 @@ -image: Visual Studio 2022 -version: '{build}' -platform: x64 - -skip_branch_with_pr: true - -before_build: -- cmake -H. -Bbuild - -build_script: -- if "%APPVEYOR_REPO_TAG%"=="true" (set CONFIGURATION=RelWithDebInfo) else (set CONFIGURATION=Debug) -- cmake --build build --config "%CONFIGURATION%" - -# TODO enable CMocka tests, maybe package the binaries diff --git a/contrib/libcbor/doc/source/api/item_types.rst b/contrib/libcbor/doc/source/api/item_types.rst index 1452b3e5f90e..1051b97ded7b 100644 --- a/contrib/libcbor/doc/source/api/item_types.rst +++ b/contrib/libcbor/doc/source/api/item_types.rst @@ -1,7 +1,7 @@ Types of items =============================================== -Every :type:`cbor_item_t` has a :type:`cbor_type` associated with it - these constants correspond to the types specified by the `CBOR standard `_: +Every :type:`cbor_item_t` has a :type:`cbor_type` associated with it - these constants correspond to the types specified by the `CBOR standard `_: .. doxygenenum:: cbor_type diff --git a/contrib/libcbor/doc/source/conf.py b/contrib/libcbor/doc/source/conf.py index 585efc8a436f..0eee7103bb5a 100644 --- a/contrib/libcbor/doc/source/conf.py +++ b/contrib/libcbor/doc/source/conf.py @@ -33,7 +33,8 @@ extensions = [ 'breathe', 'sphinx.ext.mathjax', 'sphinx.ext.autodoc', - 'sphinx.ext.ifconfig' + 'sphinx.ext.ifconfig', + 'sphinx_rtd_theme' ] import subprocess, os @@ -76,8 +77,8 @@ copyright = '2014 - 2020, Pavel Kalvoda' # built documents. # # The short X.Y version. -version = '0.10' -release = '0.10.2' +version = '0.11' +release = '0.11.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -127,7 +128,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -285,12 +286,3 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False - - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -# otherwise, readthedocs.org uses their theme by default, so no need to specify it - diff --git a/contrib/libcbor/doc/source/development.rst b/contrib/libcbor/doc/source/development.rst index 13e91ef25762..0b0ac21007ed 100644 --- a/contrib/libcbor/doc/source/development.rst +++ b/contrib/libcbor/doc/source/development.rst @@ -22,15 +22,15 @@ everywhere. Goals ~~~~~~~~~~~~~~~~~~~~~~ -RFC-conformance and full feature support -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Standard conformance and full feature support +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Anything the standard allows, libcbor can do. **Why?** Because conformance and interoperability is the point of defining standards. Clients expect the support to be feature-complete and there is no significant complexity reduction that can be achieved by slightly -cutting corners, which means that the incremental cost of full RFC support is +cutting corners, which means that the incremental cost of full [CBOR standard](https://www.rfc-editor.org/info/std94) support is comparatively small over "almost-conformance" seen in many alternatives. diff --git a/contrib/libcbor/doc/source/index.rst b/contrib/libcbor/doc/source/index.rst index 79293e798c3b..d3d62cf75c41 100644 --- a/contrib/libcbor/doc/source/index.rst +++ b/contrib/libcbor/doc/source/index.rst @@ -9,7 +9,7 @@ Overview Main features - - Complete RFC conformance [#]_ + - Complete `IETF RFC 8949 (STD 94) `_ conformance [#]_ - Robust C99 implementation - Layered architecture offers both control and convenience - Flexible memory management @@ -19,7 +19,7 @@ Main features - Extensive documentation and test suite - No runtime dependencies, small footprint -.. [#] See :doc:`rfc_conformance` +.. [#] See :doc:`standard_conformance` .. [#] With the exception of custom memory allocators (see :doc:`api/item_reference_counting`) @@ -31,9 +31,9 @@ Contents using api tests - rfc_conformance + standard_conformance internal changelog development -.. _CBOR: http://tools.ietf.org/html/rfc7049 +.. _CBOR: https://www.rfc-editor.org/info/std94 diff --git a/contrib/libcbor/doc/source/internal.rst b/contrib/libcbor/doc/source/internal.rst index 2c62a82b2329..e30cb11dffa1 100644 --- a/contrib/libcbor/doc/source/internal.rst +++ b/contrib/libcbor/doc/source/internal.rst @@ -6,7 +6,7 @@ Internal workings of *libcbor* are mostly derived from the specification. The pu Terminology --------------- === ====================== ======================================================================================================================================== -MTB Major Type Byte http://tools.ietf.org/html/rfc7049#section-2.1 +MTB Major Type Byte https://www.rfc-editor.org/rfc/rfc8949.html#section-3.1 --- ---------------------- ---------------------------------------------------------------------------------------------------------------------------------------- DST Dynamically Sized Type Type whose storage requirements cannot be determined @@ -32,7 +32,7 @@ and also borrowing from General notes on the API design -------------------------------- -The API design has two main driving priciples: +The API design has two main driving principles: 1. Let the client manage the memory as much as possible 2. Behave exactly as specified by the standard diff --git a/contrib/libcbor/doc/source/requirements.txt b/contrib/libcbor/doc/source/requirements.txt index a82e34e58ad2..502d79cc62e6 100644 --- a/contrib/libcbor/doc/source/requirements.txt +++ b/contrib/libcbor/doc/source/requirements.txt @@ -1,31 +1,31 @@ -alabaster==0.7.12 -Babel==2.9.1 -breathe==4.33.1 -certifi==2022.12.7 -charset-normalizer==2.0.12 -colorama==0.4.4 -docutils==0.17.1 -idna==3.3 -imagesize==1.3.0 -importlib-metadata==4.11.3 -Jinja2==3.0.3 +alabaster==0.7.13 +Babel==2.13.1 +breathe==4.35.0 +certifi==2023.11.17 +charset-normalizer==3.3.2 +colorama==0.4.6 +docutils==0.18.1 +idna==3.4 +imagesize==1.4.1 +importlib-metadata==6.8.0 +Jinja2==3.1.2 livereload==2.6.3 -MarkupSafe==2.1.1 -packaging==21.3 -Pygments==2.11.2 -pyparsing==3.0.7 +MarkupSafe==2.1.3 +packaging==23.2 +Pygments==2.16.1 +pyparsing==3.1.1 pytz==2021.3 -requests==2.27.1 +requests==2.31.0 snowballstemmer==2.2.0 -Sphinx==4.4.0 +Sphinx==7.2.6 sphinx-autobuild==2021.3.14 -sphinx-rtd-theme==1.0.0 -sphinxcontrib-applehelp==1.0.2 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 +sphinx-rtd-theme==1.3.0 +sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-devhelp==1.0.5 +sphinxcontrib-htmlhelp==2.0.4 sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -tornado==6.1 -urllib3==1.26.9 -zipp==3.7.0 +sphinxcontrib-qthelp==1.0.6 +sphinxcontrib-serializinghtml==1.1.9 +tornado==6.3.3 +urllib3==2.1.0 +zipp==3.17.0 diff --git a/contrib/libcbor/doc/source/rfc_conformance.rst b/contrib/libcbor/doc/source/standard_conformance.rst similarity index 73% rename from contrib/libcbor/doc/source/rfc_conformance.rst rename to contrib/libcbor/doc/source/standard_conformance.rst index 6848fbacd464..62965f0c4493 100644 --- a/contrib/libcbor/doc/source/rfc_conformance.rst +++ b/contrib/libcbor/doc/source/standard_conformance.rst @@ -1,13 +1,13 @@ -RFC conformance +IETF standard conformance ========================= -*libcbor* is, generally speaking, very faithful implementation of `RFC 7049 `_. There are, however, some limitations imposed by technical constraints. +*libcbor* is, generally speaking, a very faithful implementation of `IETF RFC 8949 (STD 94) `_. There are, however, some limitations related to the numerical range and precision available in portable C99. Bytestring length ------------------- There is no explicit limitation of indefinite length byte strings. [#]_ *libcbor* will not handle byte strings with more chunks than the maximum value of :type:`size_t`. On any sane platform, such string would not fit in the memory anyway. It is, however, possible to process arbitrarily long strings and byte strings using the streaming decoder. -.. [#] https://tools.ietf.org/html/rfc7049#section-2.2.2 +.. [#] https://www.rfc-editor.org/rfc/rfc8949.html#section-3.2.3 "Half-precision" IEEE 754 floats --------------------------------- diff --git a/contrib/libcbor/examples/CMakeLists.txt b/contrib/libcbor/examples/CMakeLists.txt index eaf985ba32cd..b1f2ec290e7a 100644 --- a/contrib/libcbor/examples/CMakeLists.txt +++ b/contrib/libcbor/examples/CMakeLists.txt @@ -22,6 +22,10 @@ if(CJSON_FOUND) add_executable(cjson2cbor cjson2cbor.c) target_include_directories(cjson2cbor PUBLIC ${CJSON_INCLUDE_DIRS}) target_link_libraries(cjson2cbor cbor ${CJSON_LIBRARY}) + + add_executable(cbor2cjson cbor2cjson.c) + target_include_directories(cbor2cjson PUBLIC ${CJSON_INCLUDE_DIRS}) + target_link_libraries(cbor2cjson cbor ${CJSON_LIBRARY}) endif() file(COPY data DESTINATION .) diff --git a/contrib/libcbor/examples/bazel/third_party/libcbor/cbor/configuration.h b/contrib/libcbor/examples/bazel/third_party/libcbor/cbor/configuration.h index 3472cf49d8fe..ddf6b9dc5f2b 100644 --- a/contrib/libcbor/examples/bazel/third_party/libcbor/cbor/configuration.h +++ b/contrib/libcbor/examples/bazel/third_party/libcbor/cbor/configuration.h @@ -2,8 +2,8 @@ #define LIBCBOR_CONFIGURATION_H #define CBOR_MAJOR_VERSION 0 -#define CBOR_MINOR_VERSION 10 -#define CBOR_PATCH_VERSION 2 +#define CBOR_MINOR_VERSION 11 +#define CBOR_PATCH_VERSION 0 #define CBOR_BUFFER_GROWTH 2 #define CBOR_MAX_STACK_SIZE 2048 diff --git a/contrib/libcbor/examples/cbor2cjson.c b/contrib/libcbor/examples/cbor2cjson.c new file mode 100644 index 000000000000..99ddc9ee09e1 --- /dev/null +++ b/contrib/libcbor/examples/cbor2cjson.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2014-2020 Pavel Kalvoda + * + * libcbor is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#include +#include +#include + +#include "cbor.h" + +void usage(void) { + printf("Usage: cbor2cjson [input file]\n"); + exit(1); +} + +cJSON* cbor_to_cjson(cbor_item_t* item) { + switch (cbor_typeof(item)) { + case CBOR_TYPE_UINT: + return cJSON_CreateNumber(cbor_get_int(item)); + case CBOR_TYPE_NEGINT: + return cJSON_CreateNumber(-1 - cbor_get_int(item)); + case CBOR_TYPE_BYTESTRING: + // cJSON only handles null-terminated string -- binary data would have to + // be escaped + return cJSON_CreateString("Unsupported CBOR item: Bytestring"); + case CBOR_TYPE_STRING: + if (cbor_string_is_definite(item)) { + // cJSON only handles null-terminated string + char* null_terminated_string = malloc(cbor_string_length(item) + 1); + memcpy(null_terminated_string, cbor_string_handle(item), + cbor_string_length(item)); + null_terminated_string[cbor_string_length(item)] = 0; + cJSON* result = cJSON_CreateString(null_terminated_string); + free(null_terminated_string); + return result; + } + return cJSON_CreateString("Unsupported CBOR item: Chunked string"); + case CBOR_TYPE_ARRAY: { + cJSON* result = cJSON_CreateArray(); + for (size_t i = 0; i < cbor_array_size(item); i++) { + cJSON_AddItemToArray(result, cbor_to_cjson(cbor_array_get(item, i))); + } + return result; + } + case CBOR_TYPE_MAP: { + cJSON* result = cJSON_CreateObject(); + for (size_t i = 0; i < cbor_map_size(item); i++) { + char* key = malloc(128); + snprintf(key, 128, "Surrogate key %zu", i); + // JSON only support string keys + if (cbor_isa_string(cbor_map_handle(item)[i].key) && + cbor_string_is_definite(cbor_map_handle(item)[i].key)) { + size_t key_length = cbor_string_length(cbor_map_handle(item)[i].key); + if (key_length > 127) key_length = 127; + // Null-terminated madness + memcpy(key, cbor_string_handle(cbor_map_handle(item)[i].key), + key_length); + key[key_length] = 0; + } + + cJSON_AddItemToObject(result, key, + cbor_to_cjson(cbor_map_handle(item)[i].value)); + free(key); + } + return result; + } + case CBOR_TYPE_TAG: + return cJSON_CreateString("Unsupported CBOR item: Tag"); + case CBOR_TYPE_FLOAT_CTRL: + if (cbor_float_ctrl_is_ctrl(item)) { + if (cbor_is_bool(item)) return cJSON_CreateBool(cbor_get_bool(item)); + if (cbor_is_null(item)) return cJSON_CreateNull(); + return cJSON_CreateString("Unsupported CBOR item: Control value"); + } + return cJSON_CreateNumber(cbor_float_get_float(item)); + } + + return cJSON_CreateNull(); +} + +/* + * Reads CBOR data from a file and outputs JSON using cJSON + * $ ./examples/cbor2cjson examples/data/nested_array.cbor + */ + +int main(int argc, char* argv[]) { + if (argc != 2) usage(); + FILE* f = fopen(argv[1], "rb"); + if (f == NULL) usage(); + fseek(f, 0, SEEK_END); + size_t length = (size_t)ftell(f); + fseek(f, 0, SEEK_SET); + unsigned char* buffer = malloc(length); + fread(buffer, length, 1, f); + + /* Assuming `buffer` contains `length` bytes of input data */ + struct cbor_load_result result; + cbor_item_t* item = cbor_load(buffer, length, &result); + free(buffer); + + if (result.error.code != CBOR_ERR_NONE) { + printf( + "There was an error while reading the input near byte %zu (read %zu " + "bytes in total): ", + result.error.position, result.read); + exit(1); + } + + cJSON* cjson_item = cbor_to_cjson(item); + char* json_string = cJSON_Print(cjson_item); + printf("%s\n", json_string); + free(json_string); + fflush(stdout); + + /* Deallocate the result */ + cbor_decref(&item); + cJSON_Delete(cjson_item); + + fclose(f); +} diff --git a/contrib/libcbor/examples/cjson2cbor.c b/contrib/libcbor/examples/cjson2cbor.c index eae78e1cf7a6..b67439902442 100644 --- a/contrib/libcbor/examples/cjson2cbor.c +++ b/contrib/libcbor/examples/cjson2cbor.c @@ -7,7 +7,7 @@ /** * This code demonstrates how cJSON (https://github.com/DaveGamble/cJSON) - * callbacks can be used in conjuction with the streaming parser to translate + * callbacks can be used in conjunction with the streaming parser to translate * JSON to CBOR. Please note that cbor_builder_* APIs are internal and thus * subject to change. * @@ -111,7 +111,7 @@ void cjson_cbor_stream_decode(cJSON *source, } void usage(void) { - printf("Usage: cjson [input JSON file]\n"); + printf("Usage: cjson2cbor [input JSON file]\n"); exit(1); } diff --git a/contrib/libcbor/examples/data/all_types.cbor b/contrib/libcbor/examples/data/all_types.cbor new file mode 100644 index 000000000000..00d66a0e667e Binary files /dev/null and b/contrib/libcbor/examples/data/all_types.cbor differ diff --git a/contrib/libcbor/examples/readfile.c b/contrib/libcbor/examples/readfile.c index 3f8db6152800..c6f4a3342d08 100644 --- a/contrib/libcbor/examples/readfile.c +++ b/contrib/libcbor/examples/readfile.c @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) { case CBOR_ERR_SYNTAXERROR: { printf( "Syntactically malformed data -- see " - "http://tools.ietf.org/html/rfc7049\n"); + "https://www.rfc-editor.org/info/std94\n"); break; } case CBOR_ERR_NONE: { diff --git a/contrib/libcbor/oss-fuzz/build.sh b/contrib/libcbor/oss-fuzz/build.sh index 10853a398734..e7b1df3ada0a 100755 --- a/contrib/libcbor/oss-fuzz/build.sh +++ b/contrib/libcbor/oss-fuzz/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash -eu +#!/bin/bash -eux # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/contrib/libcbor/src/CMakeLists.txt b/contrib/libcbor/src/CMakeLists.txt index 72a0c901556d..e9312395db25 100644 --- a/contrib/libcbor/src/CMakeLists.txt +++ b/contrib/libcbor/src/CMakeLists.txt @@ -1,6 +1,5 @@ set(SOURCES cbor.c allocators.c cbor/streaming.c cbor/internal/encoders.c cbor/internal/builder_callbacks.c cbor/internal/loaders.c cbor/internal/memory_utils.c cbor/internal/stack.c cbor/internal/unicode.c cbor/encoding.c cbor/serialization.c cbor/arrays.c cbor/common.c cbor/floats_ctrls.c cbor/bytestrings.c cbor/callbacks.c cbor/strings.c cbor/maps.c cbor/tags.c cbor/ints.c) -include(GNUInstallDirs) include(JoinPaths) include(CheckFunctionExists) set(CMAKE_SKIP_BUILD_RPATH FALSE) @@ -49,3 +48,23 @@ install(FILES cbor.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libcbor.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + +include(CMakePackageConfigHelpers) +configure_package_config_file( + libcborConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libcborConfig.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libcbor + PATH_VARS CMAKE_INSTALL_INCLUDEDIR +) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/libcborConfigVersion.cmake + VERSION ${CBOR_VERSION} + COMPATIBILITY SameMajorVersion +) +install( + FILES + ${CMAKE_CURRENT_BINARY_DIR}/libcborConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/libcborConfigVersion.cmake + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/cmake/libcbor + ) diff --git a/contrib/libcbor/src/cbor.c b/contrib/libcbor/src/cbor.c index 626ddddaecfc..a8b4bcd7a080 100644 --- a/contrib/libcbor/src/cbor.c +++ b/contrib/libcbor/src/cbor.c @@ -9,6 +9,7 @@ #include "cbor/internal/builder_callbacks.h" #include "cbor/internal/loaders.h" +#pragma clang diagnostic push cbor_item_t *cbor_load(cbor_data source, size_t source_size, struct cbor_load_result *result) { /* Context stack */ @@ -289,7 +290,6 @@ cbor_item_t *cbor_copy(cbor_item_t *item) { #include #include -#include #include #define __STDC_FORMAT_MACROS @@ -301,89 +301,105 @@ static int _pow(int b, int ex) { return res; } +static void _cbor_type_marquee(FILE *out, char *label, int indent) { + fprintf(out, "%*.*s[%s] ", indent, indent, " ", label); +} + static void _cbor_nested_describe(cbor_item_t *item, FILE *out, int indent) { - setlocale(LC_ALL, ""); + const int indent_offset = 4; switch (cbor_typeof(item)) { case CBOR_TYPE_UINT: { - fprintf(out, "%*s[CBOR_TYPE_UINT] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_UINT", indent); fprintf(out, "Width: %dB, ", _pow(2, cbor_int_get_width(item))); fprintf(out, "Value: %" PRIu64 "\n", cbor_get_int(item)); break; } case CBOR_TYPE_NEGINT: { - fprintf(out, "%*s[CBOR_TYPE_NEGINT] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_NEGINT", indent); fprintf(out, "Width: %dB, ", _pow(2, cbor_int_get_width(item))); - fprintf(out, "Value: -%" PRIu64 " -1\n", cbor_get_int(item)); + fprintf(out, "Value: -%" PRIu64 " - 1\n", cbor_get_int(item)); break; } case CBOR_TYPE_BYTESTRING: { - fprintf(out, "%*s[CBOR_TYPE_BYTESTRING] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_BYTESTRING", indent); if (cbor_bytestring_is_indefinite(item)) { - fprintf(out, "Indefinite, with %zu chunks:\n", + fprintf(out, "Indefinite, Chunks: %zu, Chunk data:\n", cbor_bytestring_chunk_count(item)); for (size_t i = 0; i < cbor_bytestring_chunk_count(item); i++) _cbor_nested_describe(cbor_bytestring_chunks_handle(item)[i], out, - indent + 4); + indent + indent_offset); } else { - fprintf(out, "Definite, length %zuB\n", cbor_bytestring_length(item)); + const unsigned char *data = cbor_bytestring_handle(item); + fprintf(out, "Definite, Length: %zuB, Data:\n", + cbor_bytestring_length(item)); + fprintf(out, "%*s", indent + indent_offset, " "); + for (size_t i = 0; i < cbor_bytestring_length(item); i++) + fprintf(out, "%02x", (int)(data[i] & 0xff)); + fprintf(out, "\n"); } break; } case CBOR_TYPE_STRING: { - fprintf(out, "%*s[CBOR_TYPE_STRING] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_STRING", indent); if (cbor_string_is_indefinite(item)) { - fprintf(out, "Indefinite, with %zu chunks:\n", + fprintf(out, "Indefinite, Chunks: %zu, Chunk data:\n", cbor_string_chunk_count(item)); for (size_t i = 0; i < cbor_string_chunk_count(item); i++) _cbor_nested_describe(cbor_string_chunks_handle(item)[i], out, - indent + 4); + indent + indent_offset); } else { - fprintf(out, "Definite, length %zuB, %zu codepoints\n", + fprintf(out, "Definite, Length: %zuB, Codepoints: %zu, Data:\n", cbor_string_length(item), cbor_string_codepoint_count(item)); - /* Careful - this doesn't support multibyte characters! */ - /* Printing those is out of the scope of this demo :) */ - /* libICU is your friend */ - fprintf(out, "%*s", indent + 4, " "); - /* XXX: no null at the end -> confused vprintf */ - fwrite(cbor_string_handle(item), (int)cbor_string_length(item), 1, out); + fprintf(out, "%*s", indent + indent_offset, " "); + // Note: The string is not escaped, whitespace and control character + // will be printed in verbatim and take effect. + fwrite(cbor_string_handle(item), sizeof(unsigned char), + cbor_string_length(item), out); fprintf(out, "\n"); } break; } case CBOR_TYPE_ARRAY: { - fprintf(out, "%*s[CBOR_TYPE_ARRAY] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_ARRAY", indent); if (cbor_array_is_definite(item)) { - fprintf(out, "Definite, size: %zu\n", cbor_array_size(item)); + fprintf(out, "Definite, Size: %zu, Contents:\n", cbor_array_size(item)); } else { - fprintf(out, "Indefinite, size: %zu\n", cbor_array_size(item)); + fprintf(out, "Indefinite, Size: %zu, Contents:\n", + cbor_array_size(item)); } for (size_t i = 0; i < cbor_array_size(item); i++) - _cbor_nested_describe(cbor_array_handle(item)[i], out, indent + 4); + _cbor_nested_describe(cbor_array_handle(item)[i], out, + indent + indent_offset); break; } case CBOR_TYPE_MAP: { - fprintf(out, "%*s[CBOR_TYPE_MAP] ", indent, " "); + _cbor_type_marquee(out, "CBOR_TYPE_MAP", indent); if (cbor_map_is_definite(item)) { - fprintf(out, "Definite, size: %zu\n", cbor_map_size(item)); + fprintf(out, "Definite, Size: %zu, Contents:\n", cbor_map_size(item)); } else { - fprintf(out, "Indefinite, size: %zu\n", cbor_map_size(item)); *** 885 LINES SKIPPED *** From nobody Thu Aug 1 16:07:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYkw6Sgpz5T0F6; Thu, 01 Aug 2024 16:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYkw5WN7z4bj3; Thu, 1 Aug 2024 16:07:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahnXYhWJRuJtr8xB1yzJDN1qEk5EmTukzv4GTC6hQrw=; b=I1kusCWH9IAx8571UhniVY9UNbQ3qQ3v4ldsbbZOj5eBSntTKpnxI0Evlb0niz+wl7nP3S XvqVJW+LMaZjpgzr0RintgZ08uNxrgNY1ZmoGU1+QOfCgfLsX+6P8JWjQf+p/1Jp9yPigN sSWr1d8ELdbESQ6f9hhO1wwnhFCC6R5FC8ENAY2Au+HbiFe3LUGsQej6pqwnf4pRgLjpet 7ZFmQq0/ZXb56V9hYP9TsZyY2Q7KRbWH92MmYFdl2ONaICmugymDqL0dHu5HBCxWiBzekZ id5EZWtl8UCtyoQFawl85R9j7toYxvcVmKktoEuJwxkDsyUov04bpBFzdtvewQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528440; a=rsa-sha256; cv=none; b=weRrRRyluvIKN+N0EXpBgcQWraNzYZnqhWEf76bd4aecnTRzU4POOhDeTPStyJfaK2wryS DEEgH1qj5CGJEWJP0UnIEeq98g1iR0yD0wW3u1iLNIR92/dlQYLCiH8M6vHDY4Wnapdj8v hpyDv4gCqcUi5g3QO0vNkO6T9Ep6xLiAqCA0bMy8Ad5GtQQ7IUDr89/AT54X9CxxNNFO0R l0Vtq3Nwn0tkCT3zrZdnU/JC5t9tdJWtJEtg+1S4pu7Rg/c6EDu1ohvJL7qoEiI+rbGoLJ VoL/RBBa4WpJ6jfIbHKlpm9VIQ1BS47WvZREcYNkWXC4GGtASHrDYxmgmDOO1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ahnXYhWJRuJtr8xB1yzJDN1qEk5EmTukzv4GTC6hQrw=; b=Z+L2ueV7LZqS2dPzBNdZ3C0oiiqX2fXIW1H1YTuWr7jtPTrx4f6uT5VsEoCIF7mBu4Ud38 m2GRPdK7NjzH1C6rv9AJ1X9dpxz3qaS++fjJm27IqpbG9kBpmdXI4F2Y/TrFAvNXY/Qycs SPgCkWomhaKz842Nb5F0iXnbcmWWsUjYqQMfc/VmfFLkxistyUxYqY8YyYPEhcRYLHPpv0 xFHkmHzaSoN/eW1QQCdNICl2G2Rl7lXzXQGt1ZUtePyxJsdpLpG9rCwADu44ByxkrXDyQZ Btz61Iyl0KSZQwyY3g0M6TFfzAt2MQ9MQvsKgpLbdzUhMxpH6Matd9vFRnc0sA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYkw540CzrZk; Thu, 1 Aug 2024 16:07: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 471G7KAB079012; Thu, 1 Aug 2024 16:07:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7KWL079009; Thu, 1 Aug 2024 16:07:20 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:20 GMT Message-Id: <202408011607.471G7KWL079009@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: 128bace5102e - stable/14 - libfido2: update to 1.14.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/14 X-Git-Reftype: branch X-Git-Commit: 128bace5102e5871fc0a139bb0a3448a08ea3c13 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=128bace5102e5871fc0a139bb0a3448a08ea3c13 commit 128bace5102e5871fc0a139bb0a3448a08ea3c13 Author: Ed Maste AuthorDate: 2024-05-04 16:51:08 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 libfido2: update to 1.14.0 Sponsored by: The FreeBSD Foundation (cherry picked from commit 60a517b66a69b8c011b04063ef63a938738719bd) --- contrib/libfido2/.actions/build-bsd | 97 +++++++++++ contrib/libfido2/.actions/build-linux-clang | 21 +++ contrib/libfido2/.actions/build-linux-gcc | 23 +++ .../.actions/build-linux-i686-w64-mingw32-gcc | 58 +++++++ .../libfido2/.actions/build-linux-openssl3-clang | 33 ++++ contrib/libfido2/.actions/build-linux-openssl3-gcc | 28 ++++ .../build-linux-openssl3-i686-w64-mingw32-gcc | 59 +++++++ contrib/libfido2/.actions/build-osx-clang | 19 +++ contrib/libfido2/.actions/fuzz-linux | 93 +++++++++++ contrib/libfido2/.actions/llvm.gpg | 52 ++++++ contrib/libfido2/.actions/setup_clang | 17 ++ contrib/libfido2/.gitattributes | 1 + .../libfido2/.github/ISSUE_TEMPLATE/bug_report.md | 80 ++++++++++ contrib/libfido2/.github/ISSUE_TEMPLATE/config.yml | 8 + .../libfido2/.github/workflows/alpine_builds.yml | 39 +++++ contrib/libfido2/.github/workflows/bsd_builds.yml | 32 ++++ contrib/libfido2/.github/workflows/cifuzz_oss.yml | 46 ++++++ .../libfido2/.github/workflows/codeql-analysis.yml | 42 +++++ .../libfido2/.github/workflows/cygwin_builds.yml | 30 ++++ .../libfido2/.github/workflows/linux_builds.yml | 57 +++++++ contrib/libfido2/.github/workflows/linux_fuzz.yml | 41 +++++ .../libfido2/.github/workflows/macos_builds.yml | 32 ++++ contrib/libfido2/.github/workflows/openssl3.yml | 51 ++++++ .../libfido2/.github/workflows/windows_builds.yml | 32 ++++ contrib/libfido2/.gitignore | 9 ++ contrib/libfido2/CMakeLists.txt | 4 +- contrib/libfido2/NEWS | 10 ++ contrib/libfido2/README.adoc | 2 +- contrib/libfido2/examples/README.adoc | 5 +- contrib/libfido2/examples/cred.c | 30 +++- contrib/libfido2/fuzz/Dockerfile | 2 +- contrib/libfido2/fuzz/Makefile | 2 +- contrib/libfido2/fuzz/export.gnu | 2 + contrib/libfido2/fuzz/functions.txt | 63 ++++---- contrib/libfido2/fuzz/fuzz_assert.c | 4 +- contrib/libfido2/fuzz/report.tgz | Bin 357005 -> 361946 bytes contrib/libfido2/fuzz/summary.txt | 18 +-- contrib/libfido2/man/CMakeLists.txt | 3 + contrib/libfido2/man/fido2-assert.1 | 13 +- contrib/libfido2/man/fido2-cred.1 | 13 +- contrib/libfido2/man/fido_assert_new.3 | 14 +- contrib/libfido2/man/fido_assert_set_authdata.3 | 59 ++++++- contrib/libfido2/regress/assert.c | 50 +++++- contrib/libfido2/regress/cred.c | 18 ++- contrib/libfido2/regress/eddsa.c | 2 +- contrib/libfido2/src/assert.c | 68 +++++++- contrib/libfido2/src/export.gnu | 3 + contrib/libfido2/src/export.llvm | 3 + contrib/libfido2/src/export.msvc | 3 + contrib/libfido2/src/fido.h | 4 + contrib/libfido2/src/fido/types.h | 2 + contrib/libfido2/src/webauthn.h | 177 +++++++++++++++++++-- contrib/libfido2/src/winhello.c | 63 +++++++- contrib/libfido2/tools/assert_get.c | 19 ++- contrib/libfido2/tools/cred_make.c | 20 ++- contrib/libfido2/tools/extern.h | 19 +-- contrib/libfido2/tools/fido2-assert.c | 4 +- contrib/libfido2/tools/fido2-cred.c | 4 +- contrib/libfido2/udev/70-u2f.rules | 32 +++- contrib/libfido2/udev/fidodevs | 16 +- contrib/libfido2/windows/build.ps1 | 1 + contrib/libfido2/windows/const.ps1 | 16 +- lib/libfido2/Makefile | 2 +- 63 files changed, 1646 insertions(+), 124 deletions(-) diff --git a/contrib/libfido2/.actions/build-bsd b/contrib/libfido2/.actions/build-bsd new file mode 100755 index 000000000000..66fc4e3ba281 --- /dev/null +++ b/contrib/libfido2/.actions/build-bsd @@ -0,0 +1,97 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +BASE_URL="https://builds.sr.ht" +MANIFEST="$(mktemp)" +LOGFILE="$(mktemp)" +trap '[ -f "${LOGFILE}" ] && cat -- "${LOGFILE}"' EXIT + +# construct the sourcehut build manifest +cat > "${MANIFEST}" <<- EOF +image: ${IMAGE} +packages: + - cmake + - llvm + - pcsc-lite +EOF + +case "${IMAGE}" in + freebsd*) +cat >> "${MANIFEST}" <<- EOF + - libcbor + - pkgconf +EOF + ;; +esac + +cat >> "${MANIFEST}" <<- EOF +sources: + - ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}#$(git rev-parse HEAD) +tasks: + - build: | + if [ "\$(uname)" = "OpenBSD" ]; then + SUDO="doas -u root" + else + SUDO=sudo + fi + SCAN="/usr/local/bin/scan-build --use-cc=/usr/bin/cc --status-bugs" + cd libfido2 + for T in Debug Release; do + mkdir build-\$T + (cd build-\$T && \${SCAN} cmake -DCMAKE_BUILD_TYPE=\$T ..) + \${SCAN} make -j"\$(sysctl -n hw.ncpu)" -C build-\$T + make -C build-\$T regress + \${SUDO} make -C build-\$T install + done +EOF + +q() { + curl \ + --silent \ + --oauth2-bearer "${SOURCEHUT_TOKEN}" \ + --header "Content-Type: application/json" \ + --data @- -- \ + "${BASE_URL}/query" \ + | tee -a -- "${LOGFILE}" +} + +submit_job() { + local manifest="$1" + jq \ + --compact-output --null-input \ + '{ query: $body, variables: { var: $var } }' \ + --arg body 'mutation($var: String!) { submit(manifest: $var) { id } }' \ + --rawfile var "${manifest}" \ + | q \ + | jq --exit-status --raw-output '.data.submit.id' +} + +job_status() { + local id="$1" + jq \ + --compact-output --null-input \ + '{ query: $body, variables: { var: $var } }' \ + --arg body 'query($var: Int!) { job(id: $var) { status } }' \ + --argjson var "${id}" \ + | q \ + | jq --exit-status --raw-output '.data.job.status' +} + +JOB_ID="$(submit_job "${MANIFEST}")" || exit 1 +[ -z "${JOB_ID}" ] && exit 1 +echo "Job '${JOB_ID}' running at ${BASE_URL}/~yubico-libfido2/job/${JOB_ID}" + +while true; do + JOB_STATUS="$(job_status "${JOB_ID}")" || exit 1 + case "${JOB_STATUS}" in + SUCCESS) exit 0;; + FAILED) exit 1;; + PENDING|QUEUED|RUNNING) ;; + *) exit 1;; + esac + sleep 60 +done diff --git a/contrib/libfido2/.actions/build-linux-clang b/contrib/libfido2/.actions/build-linux-clang new file mode 100755 index 000000000000..ba20f1279ec9 --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-clang @@ -0,0 +1,21 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +${CC} --version +SCAN=scan-build${CC#clang} + +# Check exports. +(cd src && ./diff_exports.sh) + +# Build, analyze, and install libfido2. +for T in Debug Release; do + mkdir build-$T + (cd build-$T && ${SCAN} --use-cc="${CC}" cmake -DCMAKE_BUILD_TYPE=$T ..) + ${SCAN} --use-cc="${CC}" --status-bugs make -j"$(nproc)" -C build-$T + make -C build-$T regress + sudo make -C build-$T install +done diff --git a/contrib/libfido2/.actions/build-linux-gcc b/contrib/libfido2/.actions/build-linux-gcc new file mode 100755 index 000000000000..cd42b5eb7bed --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-gcc @@ -0,0 +1,23 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +${CC} --version + +# Build and install libfido2. +for T in Debug Release; do + mkdir build-$T + (cd build-$T && cmake -DCMAKE_BUILD_TYPE=$T ..) + make -j"$(nproc)" -C build-$T + make -C build-$T regress + sudo make -C build-$T install +done + +# Check udev/fidodevs. +[ -x "$(which update-alternatives)" ] && { + sudo update-alternatives --set awk "$(which original-awk)" +} +udev/check.sh udev/fidodevs diff --git a/contrib/libfido2/.actions/build-linux-i686-w64-mingw32-gcc b/contrib/libfido2/.actions/build-linux-i686-w64-mingw32-gcc new file mode 100755 index 000000000000..a89578da0886 --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-i686-w64-mingw32-gcc @@ -0,0 +1,58 @@ +#!/bin/sh -eux + +# Copyright (c) 2022-2023 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +# XXX defining CC and cross-compiling confuses OpenSSL's build. +unset CC + +sudo mkdir /fakeroot +sudo chmod 755 /fakeroot + +cat << EOF > /tmp/mingw.cmake +SET(CMAKE_SYSTEM_NAME Windows) +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +SET(CMAKE_FIND_ROOT_PATH /fakeroot) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +EOF + +# Build and install libcbor. +git clone --depth=1 https://github.com/pjk/libcbor -b v0.10.1 +cd libcbor +mkdir build +(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \ + -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/fakeroot ..) +make -j"$(nproc)" -C build +sudo make -C build install +cd .. + +# Build and install OpenSSL 1.1.1w. +git clone --depth=1 https://github.com/openssl/openssl -b OpenSSL_1_1_1w +cd openssl +./Configure mingw --prefix=/fakeroot --openssldir=/fakeroot/openssl \ + --cross-compile-prefix=i686-w64-mingw32- +make -j"$(nproc)" +sudo make install_sw +cd .. + +# Build and install zlib. +git clone --depth=1 https://github.com/madler/zlib -b v1.3 +cd zlib +make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32- +sudo make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32- DESTDIR=/fakeroot \ + INCLUDE_PATH=/include LIBRARY_PATH=/lib BINARY_PATH=/bin install +cd .. + +# Build and install libfido2. +export PKG_CONFIG_PATH=/fakeroot/lib/pkgconfig +mkdir build +(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \ + -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/fakeroot ..) +make -j"$(nproc)" -C build +sudo make -C build install diff --git a/contrib/libfido2/.actions/build-linux-openssl3-clang b/contrib/libfido2/.actions/build-linux-openssl3-clang new file mode 100755 index 000000000000..2383e51ad8f5 --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-openssl3-clang @@ -0,0 +1,33 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +${CC} --version +SCAN=scan-build${CC#clang} +FAKEROOT="$(mktemp -d)" + +# Check exports. +(cd src && ./diff_exports.sh) + +# Build and install OpenSSL 3.0.12. +git clone --branch openssl-3.0.12 \ + --depth=1 https://github.com/openssl/openssl +cd openssl +./Configure linux-x86_64-clang --prefix="${FAKEROOT}" \ + --openssldir="${FAKEROOT}/openssl" --libdir=lib +make install_sw +cd .. + +# Build, analyze, and install libfido2. +for T in Debug Release; do + mkdir build-$T + export PKG_CONFIG_PATH="${FAKEROOT}/lib/pkgconfig" + (cd build-$T && ${SCAN} --use-cc="${CC}" \ + cmake -DCMAKE_BUILD_TYPE=$T ..) + ${SCAN} --use-cc="${CC}" --status-bugs make -C build-$T + make -C build-$T regress + sudo make -C build-$T install +done diff --git a/contrib/libfido2/.actions/build-linux-openssl3-gcc b/contrib/libfido2/.actions/build-linux-openssl3-gcc new file mode 100755 index 000000000000..344fc12bce8c --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-openssl3-gcc @@ -0,0 +1,28 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +${CC} --version +FAKEROOT="$(mktemp -d)" + +# Build and install OpenSSL 3.0.12. +git clone --branch openssl-3.0.12 \ + --depth=1 https://github.com/openssl/openssl +cd openssl +./Configure linux-x86_64 --prefix="${FAKEROOT}" \ + --openssldir="${FAKEROOT}/openssl" --libdir=lib +make install_sw +cd .. + +# Build and install libfido2. +for T in Debug Release; do + mkdir build-$T + export PKG_CONFIG_PATH="${FAKEROOT}/lib/pkgconfig" + (cd build-$T && cmake -DCMAKE_BUILD_TYPE=$T ..) + make -j"$(nproc)" -C build-$T + make -C build-$T regress + sudo make -C build-$T install +done diff --git a/contrib/libfido2/.actions/build-linux-openssl3-i686-w64-mingw32-gcc b/contrib/libfido2/.actions/build-linux-openssl3-i686-w64-mingw32-gcc new file mode 100755 index 000000000000..3bbb141dad0d --- /dev/null +++ b/contrib/libfido2/.actions/build-linux-openssl3-i686-w64-mingw32-gcc @@ -0,0 +1,59 @@ +#!/bin/sh -eux + +# Copyright (c) 2022-2023 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +# XXX defining CC and cross-compiling confuses OpenSSL's build. +unset CC + +sudo mkdir /fakeroot +sudo chmod 755 /fakeroot + +cat << EOF > /tmp/mingw.cmake +SET(CMAKE_SYSTEM_NAME Windows) +SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres) +SET(CMAKE_FIND_ROOT_PATH /fakeroot) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +EOF + +# Build and install libcbor. +git clone --depth=1 https://github.com/pjk/libcbor -b v0.10.1 +cd libcbor +mkdir build +(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \ + -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/fakeroot ..) +make -j"$(nproc)" -C build +sudo make -C build install +cd .. + +# Build and install OpenSSL 3.0.11. +git clone --branch openssl-3.0.12 \ + --depth=1 https://github.com/openssl/openssl +cd openssl +./Configure mingw --prefix=/fakeroot --openssldir=/fakeroot/openssl \ + --cross-compile-prefix=i686-w64-mingw32- --libdir=lib +make -j"$(nproc)" +sudo make install_sw +cd .. + +# Build and install zlib. +git clone --depth=1 https://github.com/madler/zlib -b v1.3 +cd zlib +make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32- +sudo make -fwin32/Makefile.gcc PREFIX=i686-w64-mingw32- DESTDIR=/fakeroot \ + INCLUDE_PATH=/include LIBRARY_PATH=/lib BINARY_PATH=/bin install +cd .. + +# Build and install libfido2. +export PKG_CONFIG_PATH=/fakeroot/lib/pkgconfig +mkdir build +(cd build && cmake -DCMAKE_TOOLCHAIN_FILE=/tmp/mingw.cmake \ + -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/fakeroot ..) +make -C build 2>&1 +sudo make -C build install diff --git a/contrib/libfido2/.actions/build-osx-clang b/contrib/libfido2/.actions/build-osx-clang new file mode 100755 index 000000000000..b4beea221315 --- /dev/null +++ b/contrib/libfido2/.actions/build-osx-clang @@ -0,0 +1,19 @@ +#!/bin/sh -eux + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +export PKG_CONFIG_PATH="$(brew --prefix openssl@3.0)/lib/pkgconfig" +SCAN="$(brew --prefix llvm)/bin/scan-build" + +# Build, analyze, and install libfido2. +for T in Debug Release; do + mkdir build-$T + (cd build-$T && ${SCAN} cmake -DCMAKE_BUILD_TYPE=$T ..) + ${SCAN} --status-bugs make -j"$(sysctl -n hw.ncpu)" -C build-$T + make -C build-$T man_symlink_html + make -C build-$T regress + sudo make -C build-$T install +done diff --git a/contrib/libfido2/.actions/fuzz-linux b/contrib/libfido2/.actions/fuzz-linux new file mode 100755 index 000000000000..3f57ac40ff4b --- /dev/null +++ b/contrib/libfido2/.actions/fuzz-linux @@ -0,0 +1,93 @@ +#!/bin/sh -eux + +# Copyright (c) 2020-2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +LIBCBOR_URL="https://github.com/pjk/libcbor" +LIBCBOR_TAG="v0.10.2" +LIBCBOR_ASAN="address alignment bounds" +LIBCBOR_MSAN="memory" +OPENSSL_URL="https://github.com/openssl/openssl" +OPENSSL_TAG="openssl-3.0.12" +ZLIB_URL="https://github.com/madler/zlib" +ZLIB_TAG="v1.3" +ZLIB_ASAN="address alignment bounds undefined" +ZLIB_MSAN="memory" +FIDO2_ASAN="address bounds fuzzer-no-link implicit-conversion leak" +FIDO2_ASAN="${FIDO2_ASAN} pointer-compare pointer-subtract undefined" +FIDO2_MSAN="fuzzer-no-link memory" +COMMON_CFLAGS="-g2 -fno-omit-frame-pointer" +COMMON_CFLAGS="${COMMON_CFLAGS} -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" +UBSAN_OPTIONS="halt_on_error=1:print_stacktrace=1:strict_string_checks=1" +ASAN_OPTIONS="${UBSAN_OPTIONS}:detect_invalid_pointer_pairs=2:detect_leaks=1" +MSAN_OPTIONS="${UBSAN_OPTIONS}" + +case "$1" in +asan) + LIBCBOR_CFLAGS="-fsanitize=$(echo "${LIBCBOR_ASAN}" | tr ' ' ',')" + ZLIB_CFLAGS="-fsanitize=$(echo "${ZLIB_ASAN}" | tr ' ' ',')" + FIDO2_CFLAGS="-fsanitize=$(echo "${FIDO2_ASAN}" | tr ' ' ',')" + FIDO2_CFLAGS="${FIDO2_CFLAGS} -fsanitize-address-use-after-scope" + ;; +msan) + LIBCBOR_CFLAGS="-fsanitize=$(echo "${LIBCBOR_MSAN}" | tr ' ' ',')" + ZLIB_CFLAGS="-fsanitize=$(echo "${ZLIB_MSAN}" | tr ' ' ',')" + FIDO2_CFLAGS="-fsanitize=$(echo "${FIDO2_MSAN}" | tr ' ' ',')" + FIDO2_CFLAGS="${FIDO2_CFLAGS} -fsanitize-memory-track-origins" + ;; +*) + echo "unknown sanitiser \"$1\"" 1>&2 && exit 1 +esac + +${CC} --version +WORKDIR="${WORKDIR:-$(pwd)}" +FAKEROOT="${FAKEROOT:-$(mktemp -d)}" +cd "${FAKEROOT}" + +# libcbor +git clone --depth=1 "${LIBCBOR_URL}" -b "${LIBCBOR_TAG}" +cd libcbor +patch -p0 -s < "${WORKDIR}/fuzz/README" +mkdir build +(cd build && cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS_DEBUG="${LIBCBOR_CFLAGS} ${COMMON_CFLAGS}" \ + -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${FAKEROOT}" \ + -DSANITIZE=OFF ..) +make VERBOSE=1 -j"$(nproc)" -C build all install +cd - + +# openssl +git clone --depth=1 "${OPENSSL_URL}" -b "${OPENSSL_TAG}" +cd openssl +./Configure linux-x86_64-clang "enable-$1" --prefix="${FAKEROOT}" \ + --openssldir="${FAKEROOT}/openssl" --libdir=lib +make install_sw +cd - + +# zlib +git clone --depth=1 "${ZLIB_URL}" -b "${ZLIB_TAG}" +cd zlib +CFLAGS="${ZLIB_CFLAGS}" LDFLAGS="${ZLIB_CFLAGS}" ./configure \ + --prefix="${FAKEROOT}" +make install +cd - + +# libfido2 +mkdir build +export PKG_CONFIG_PATH="${FAKEROOT}/lib/pkgconfig" +(cd build && cmake -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS_DEBUG="${FIDO2_CFLAGS} ${COMMON_CFLAGS}" -DFUZZ=ON \ + -DFUZZ_LDFLAGS="-fsanitize=fuzzer" "${WORKDIR}") +make -j"$(nproc)" -C build + +# fuzz +mkdir corpus +curl -s https://storage.googleapis.com/yubico-libfido2/corpus.tgz | + tar -C corpus -zxf - +export UBSAN_OPTIONS ASAN_OPTIONS MSAN_OPTIONS +for f in assert bio cred credman hid largeblob mgmt netlink pcsc; do + build/fuzz/fuzz_${f} -use_value_profile=1 -reload=30 -print_pcs=1 \ + -print_funcs=30 -timeout=10 -runs=1 corpus/fuzz_${f} +done diff --git a/contrib/libfido2/.actions/llvm.gpg b/contrib/libfido2/.actions/llvm.gpg new file mode 100644 index 000000000000..aa6b105aa3d7 --- /dev/null +++ b/contrib/libfido2/.actions/llvm.gpg @@ -0,0 +1,52 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (GNU/Linux) + +mQINBFE9lCwBEADi0WUAApM/mgHJRU8lVkkw0CHsZNpqaQDNaHefD6Rw3S4LxNmM +EZaOTkhP200XZM8lVdbfUW9xSjA3oPldc1HG26NjbqqCmWpdo2fb+r7VmU2dq3NM +R18ZlKixiLDE6OUfaXWKamZsXb6ITTYmgTO6orQWYrnW6ckYHSeaAkW0wkDAryl2 +B5v8aoFnQ1rFiVEMo4NGzw4UX+MelF7rxaaregmKVTPiqCOSPJ1McC1dHFN533FY +Wh/RVLKWo6npu+owtwYFQW+zyQhKzSIMvNujFRzhIxzxR9Gn87MoLAyfgKEzrbbT +DhqqNXTxS4UMUKCQaO93TzetX/EBrRpJj+vP640yio80h4Dr5pAd7+LnKwgpTDk1 +G88bBXJAcPZnTSKu9I2c6KY4iRNbvRz4i+ZdwwZtdW4nSdl2792L7Sl7Nc44uLL/ +ZqkKDXEBF6lsX5XpABwyK89S/SbHOytXv9o4puv+65Ac5/UShspQTMSKGZgvDauU +cs8kE1U9dPOqVNCYq9Nfwinkf6RxV1k1+gwtclxQuY7UpKXP0hNAXjAiA5KS5Crq +7aaJg9q2F4bub0mNU6n7UI6vXguF2n4SEtzPRk6RP+4TiT3bZUsmr+1ktogyOJCc +Ha8G5VdL+NBIYQthOcieYCBnTeIH7D3Sp6FYQTYtVbKFzmMK+36ERreL/wARAQAB +tD1TeWx2ZXN0cmUgTGVkcnUgLSBEZWJpYW4gTExWTSBwYWNrYWdlcyA8c3lsdmVz +dHJlQGRlYmlhbi5vcmc+iQI4BBMBAgAiBQJRPZQsAhsDBgsJCAcDAgYVCAIJCgsE +FgIDAQIeAQIXgAAKCRAVz00Yr090Ibx+EADArS/hvkDF8juWMXxh17CgR0WZlHCC +9CTBWkg5a0bNN/3bb97cPQt/vIKWjQtkQpav6/5JTVCSx2riL4FHYhH0iuo4iAPR +udC7Cvg8g7bSPrKO6tenQZNvQm+tUmBHgFiMBJi92AjZ/Qn1Shg7p9ITivFxpLyX +wpmnF1OKyI2Kof2rm4BFwfSWuf8Fvh7kDMRLHv+MlnK/7j/BNpKdozXxLcwoFBmn +l0WjpAH3OFF7Pvm1LJdf1DjWKH0Dc3sc6zxtmBR/KHHg6kK4BGQNnFKujcP7TVdv +gMYv84kun14pnwjZcqOtN3UJtcx22880DOQzinoMs3Q4w4o05oIF+sSgHViFpc3W +R0v+RllnH05vKZo+LDzc83DQVrdwliV12eHxrMQ8UYg88zCbF/cHHnlzZWAJgftg +hB08v1BKPgYRUzwJ6VdVqXYcZWEaUJmQAPuAALyZESw94hSo28FAn0/gzEc5uOYx +K+xG/lFwgAGYNb3uGM5m0P6LVTfdg6vDwwOeTNIExVk3KVFXeSQef2ZMkhwA7wya +KJptkb62wBHFE+o9TUdtMCY6qONxMMdwioRE5BYNwAsS1PnRD2+jtlI0DzvKHt7B +MWd8hnoUKhMeZ9TNmo+8CpsAtXZcBho0zPGz/R8NlJhAWpdAZ1CmcPo83EW86Yq7 +BxQUKnNHcwj2ebkCDQRRPZQsARAA4jxYmbTHwmMjqSizlMJYNuGOpIidEdx9zQ5g +zOr431/VfWq4S+VhMDhs15j9lyml0y4ok215VRFwrAREDg6UPMr7ajLmBQGau0Fc +bvZJ90l4NjXp5p0NEE/qOb9UEHT7EGkEhaZ1ekkWFTWCgsy7rRXfZLxB6sk7pzLC +DshyW3zjIakWAnpQ5j5obiDy708pReAuGB94NSyb1HoW/xGsGgvvCw4r0w3xPStw +F1PhmScE6NTBIfLliea3pl8vhKPlCh54Hk7I8QGjo1ETlRP4Qll1ZxHJ8u25f/ta +RES2Aw8Hi7j0EVcZ6MT9JWTI83yUcnUlZPZS2HyeWcUj+8nUC8W4N8An+aNps9l/ +21inIl2TbGo3Yn1JQLnA1YCoGwC34g8QZTJhElEQBN0X29ayWW6OdFx8MDvllbBV +ymmKq2lK1U55mQTfDli7S3vfGz9Gp/oQwZ8bQpOeUkc5hbZszYwP4RX+68xDPfn+ +M9udl+qW9wu+LyePbW6HX90LmkhNkkY2ZzUPRPDHZANU5btaPXc2H7edX4y4maQa +xenqD0lGh9LGz/mps4HEZtCI5CY8o0uCMF3lT0XfXhuLksr7Pxv57yue8LLTItOJ +d9Hmzp9G97SRYYeqU+8lyNXtU2PdrLLq7QHkzrsloG78lCpQcalHGACJzrlUWVP/ +fN3Ht3kAEQEAAYkCHwQYAQIACQUCUT2ULAIbDAAKCRAVz00Yr090IbhWEADbr50X +OEXMIMGRLe+YMjeMX9NG4jxs0jZaWHc/WrGR+CCSUb9r6aPXeLo+45949uEfdSsB +pbaEdNWxF5Vr1CSjuO5siIlgDjmT655voXo67xVpEN4HhMrxugDJfCa6z97P0+ML +PdDxim57uNqkam9XIq9hKQaurxMAECDPmlEXI4QT3eu5qw5/knMzDMZj4Vi6hovL +wvvAeLHO/jsyfIdNmhBGU2RWCEZ9uo/MeerPHtRPfg74g+9PPfP6nyHD2Wes6yGd +oVQwtPNAQD6Cj7EaA2xdZYLJ7/jW6yiPu98FFWP74FN2dlyEA2uVziLsfBrgpS4l +tVOlrO2YzkkqUGrybzbLpj6eeHx+Cd7wcjI8CalsqtL6cG8cUEjtWQUHyTbQWAgG +5VPEgIAVhJ6RTZ26i/G+4J8neKyRs4vz+57UGwY6zI4AB1ZcWGEE3Bf+CDEDgmnP +LSwbnHefK9IljT9XU98PelSryUO/5UPw7leE0akXKB4DtekToO226px1VnGp3Bov +1GBGvpHvL2WizEwdk+nfk8LtrLzej+9FtIcq3uIrYnsac47Pf7p0otcFeTJTjSq3 +krCaoG4Hx0zGQG2ZFpHrSrZTVy6lxvIdfi0beMgY6h78p6M9eYZHQHc02DjFkQXN +bXb5c6gCHESH5PXwPU4jQEE7Ib9J6sbk7ZT2Mw== +=j+4q +-----END PGP PUBLIC KEY BLOCK----- diff --git a/contrib/libfido2/.actions/setup_clang b/contrib/libfido2/.actions/setup_clang new file mode 100755 index 000000000000..be06709c88b6 --- /dev/null +++ b/contrib/libfido2/.actions/setup_clang @@ -0,0 +1,17 @@ +#!/bin/sh -eu + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +CC="$1" +APT="http://apt.llvm.org" +CODENAME="$(lsb_release -cs)" +VERSION="${CC#*-}" +apt-get install -q -y software-properties-common +apt-key add ./.actions/llvm.gpg +add-apt-repository \ + "deb ${APT}/${CODENAME}/ llvm-toolchain-${CODENAME}-${VERSION} main" +apt-get update -q +apt-get install -q -y "${CC}" "clang-tools-${VERSION}" diff --git a/contrib/libfido2/.gitattributes b/contrib/libfido2/.gitattributes new file mode 100644 index 000000000000..998f601da4d0 --- /dev/null +++ b/contrib/libfido2/.gitattributes @@ -0,0 +1 @@ +.* export-ignore diff --git a/contrib/libfido2/.github/ISSUE_TEMPLATE/bug_report.md b/contrib/libfido2/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..6e88c1ff8006 --- /dev/null +++ b/contrib/libfido2/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,80 @@ +--- +name: Bug report +labels: 'bug report' +about: Report a bug in libfido2 + +--- + + + +**What version of libfido2 are you using?** + +**What operating system are you running?** + +**What application are you using in conjunction with libfido2?** + +**How does the problem manifest itself?** + +**Is the problem reproducible?** + +**What are the steps that lead to the problem?** + +**Does the problem happen with different authenticators?** + + + +**Please include the output of `fido2-token -L`.** + +
+fido2-token -L +
+
+$ fido2-token -L
+
+
+
+ +**Please include the output of `fido2-token -I`.** + +
+fido2-token -I +
+
+$ fido2-token -I <device>
+
+
+
+ + + +**Please include the output of `FIDO_DEBUG=1`.** + +
+FIDO_DEBUG=1 +
+
+$ export FIDO_DEBUG=1
+$ <command1>
+$ <command2>
+(...)
+$ <commandn>
+
+
+
diff --git a/contrib/libfido2/.github/ISSUE_TEMPLATE/config.yml b/contrib/libfido2/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..3ecb227ffeb0 --- /dev/null +++ b/contrib/libfido2/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Feature Request + url: https://github.com/Yubico/libfido2/discussions/new + about: Share ideas for new features + - name: Ask a question about libfido2 + url: https://github.com/Yubico/libfido2/discussions/new + about: Ask the community for help diff --git a/contrib/libfido2/.github/workflows/alpine_builds.yml b/contrib/libfido2/.github/workflows/alpine_builds.yml new file mode 100644 index 000000000000..c6d826f39835 --- /dev/null +++ b/contrib/libfido2/.github/workflows/alpine_builds.yml @@ -0,0 +1,39 @@ +# Copyright (c) 2022-2023 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: alpine + +on: + pull_request: + branches: + - main + push: + branches: + - main + - '*-ci' + +jobs: + build: + runs-on: ubuntu-20.04 + container: alpine:latest + strategy: + fail-fast: false + matrix: + cc: [ gcc, clang ] + steps: + - name: dependencies + run: | + apk -q update + apk add build-base clang clang-analyzer cmake coreutils eudev-dev + apk add git linux-headers openssl-dev sudo zlib-dev pcsc-lite-dev \ + libcbor-dev + - name: fix permissions on workdir + run: chown root:wheel "${GITHUB_WORKSPACE}" + - name: checkout libfido2 + uses: actions/checkout@v4 + - name: build libfido2 + env: + CC: ${{ matrix.cc }} + run: ./.actions/build-linux-${CC} diff --git a/contrib/libfido2/.github/workflows/bsd_builds.yml b/contrib/libfido2/.github/workflows/bsd_builds.yml new file mode 100644 index 000000000000..366ea2141aca --- /dev/null +++ b/contrib/libfido2/.github/workflows/bsd_builds.yml @@ -0,0 +1,32 @@ +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: bsd + +on: + push: + branches: + - main + - '*-ci' + +jobs: + build: + if: github.repository == 'Yubico/libfido2' + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + image: [freebsd/13.x, openbsd/7.2] + steps: + - uses: actions/checkout@v4 + - name: dependencies + run: | + sudo apt -q update + sudo apt install -q -y curl jq + - name: build + env: + IMAGE: ${{ matrix.image }} + SOURCEHUT_TOKEN: ${{ secrets.SOURCEHUT_TOKEN }} + run: ./.actions/build-bsd diff --git a/contrib/libfido2/.github/workflows/cifuzz_oss.yml b/contrib/libfido2/.github/workflows/cifuzz_oss.yml new file mode 100644 index 000000000000..556d5ad36f7c --- /dev/null +++ b/contrib/libfido2/.github/workflows/cifuzz_oss.yml @@ -0,0 +1,46 @@ +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: cifuzz + +on: + pull_request: + branches: + - main + push: + branches: + - main + - '*-ci' + +jobs: + fuzzing: + if: github.repository == 'Yubico/libfido2' + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + sanitizer: [address, undefined, memory] + steps: + - name: build fuzzers (${{ matrix.sanitizer }}) + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'libfido2' + language: c + sanitizer: ${{ matrix.sanitizer }} + dry-run: false + - name: run fuzzers (${{ matrix.sanitizer }}) + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'libfido2' + language: c + sanitizer: ${{ matrix.sanitizer }} + fuzz-seconds: 600 + dry-run: false + - name: upload crash + uses: actions/upload-artifact@v3 + if: failure() + with: + name: ${{ matrix.sanitizer }}-artifacts + path: ./out/artifacts diff --git a/contrib/libfido2/.github/workflows/codeql-analysis.yml b/contrib/libfido2/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000000..a3a8d54d2daa --- /dev/null +++ b/contrib/libfido2/.github/workflows/codeql-analysis.yml @@ -0,0 +1,42 @@ +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: "codeql" + +on: + pull_request: + branches: + - main + push: + branches: + - main + - '*-ci' + schedule: + - cron: '0 0 * * 0' + +permissions: + security-events: write + +jobs: + codeql-build: + if: github.repository == 'Yubico/libfido2' + runs-on: ubuntu-22.04 + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: init codeql + uses: github/codeql-action/init@v2 + - name: build + env: + CC: gcc + run: | + sudo apt -q update + sudo apt install -q -y libcbor-dev libudev-dev libz-dev original-awk \ + libpcsclite-dev + ./.actions/build-linux-gcc + - name: perform codeql analysis + uses: github/codeql-action/analyze@v2 diff --git a/contrib/libfido2/.github/workflows/cygwin_builds.yml b/contrib/libfido2/.github/workflows/cygwin_builds.yml new file mode 100644 index 000000000000..d8146c54904e --- /dev/null +++ b/contrib/libfido2/.github/workflows/cygwin_builds.yml @@ -0,0 +1,30 @@ +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: cygwin + +on: + pull_request: + branches: + - main + push: + branches: + - main + - '*-ci' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ windows-2022 ] + arch: [ x64 ] + config: [ "Debug", "Release" ] + steps: + - uses: actions/checkout@v4 + - name: build + run: | + .\windows\cygwin.ps1 -Config ${{ matrix.config }} diff --git a/contrib/libfido2/.github/workflows/linux_builds.yml b/contrib/libfido2/.github/workflows/linux_builds.yml new file mode 100644 index 000000000000..ec911cb92d92 --- /dev/null +++ b/contrib/libfido2/.github/workflows/linux_builds.yml @@ -0,0 +1,57 @@ +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# SPDX-License-Identifier: BSD-2-Clause + +name: linux + +on: *** 2233 LINES SKIPPED *** From nobody Thu Aug 1 16:07:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYky2138z5Sysf; Thu, 01 Aug 2024 16:07:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYkx6RG5z4bcg; Thu, 1 Aug 2024 16:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ug9qVoRPzeG6QOc6zNtcleh/71bNmKaePaYeDKMwXaE=; b=txK0LaKuYybNq0oNS+v1gDhmnZXtvcV5J9UXu8pjjOUqlCl5L2++YXdfaSluknYL3eh23c VKRr7sosh+MRZP/sNTf3HlWC8dM1bMsUGkC7IsHhRpw2FSBheAD8etO0lWQ53DiAsbZIxo oBypyndcJQN3BtfBtheTqjChjfdWG2B1TqnbSvFnDUfMPS+pNFEKLPYrjf63ddyYcmugKF 8yx5V/+iBo6RSHmZom/FEfl5oJHQS3xm6znjyVX29Ln5d7EeA+GG2tgFEo/+YBErlO8kxY B3GzQU/kUYbrDqoh/eGinfYXNYHSJcKNpL+DiBMC2D6skRTt+NQTgStfatAktA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528441; a=rsa-sha256; cv=none; b=CPF0JmOg7PLzE/zX/ENOuq1vvYlGY58pfS6mUsDh80KOT3HmNUyrc0zwNnx1XmmM7BbDBT hndACF/XOwG3bcxDUXGarplLvHIA8xL+15BzBt4u1+U5eE7KkCQvbu6p+bdIlwRRq4ziAG ZnWgGYpBP6zvNxzqtkGSDu9YwSw2FMBsH6Tx8Wxx+4jlYejEdz/2ZgWIA9tkDQg0nCnK2q /eQfVoYGDVFXe+fbvCJQ5lXUKI2H0wuVKwx0jdcp3kNUjywScepELXvrQ+SjjkgZZ1WmHC OcK+vKffMG0DONVwrA9JV25YmjjdjZo4YEbYDBaOQY0uh/Vg6lYZka75ubXs7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ug9qVoRPzeG6QOc6zNtcleh/71bNmKaePaYeDKMwXaE=; b=wpC7bkC5cFxNcFmXujiPP1NAEicByL6jhpyArfGz1ohe6TP/BaNtzQV/BDMDuhsfyqtgS2 Sw39lhSaPrChft+3dPju1fi5oMwMOZB1H12JhzsuRMKIyBqsf4s0I7XTL5/KtF0z/tFTbi GOSpovi3ypx7W56jpwWiAz/Pg96FDbgqfv9CBxxsBu34BxsOzg2kPHp/3jqSBScc6gK/fk M6NUVhltrp4Pk3ZGXwy41IkWTybA9omYhMMuSk2EFynbYOPku4pyRFeyP58crsoc80eMbw fVzH6+in7w71b7x9/hZnNgSsUwk8zu8cLCYdYmjlQsEdthpqIcqwOQq6QkZIWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYkx62pNzr98; Thu, 1 Aug 2024 16:07: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 471G7L7G079067; Thu, 1 Aug 2024 16:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471G7Lsf079064; Thu, 1 Aug 2024 16:07:21 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:07:21 GMT Message-Id: <202408011607.471G7Lsf079064@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: a357bacb86a0 - stable/14 - madt: print CPU APIC ID as signed int List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: a357bacb86a0ad2a88dec01df6fa07fc29f956de Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a357bacb86a0ad2a88dec01df6fa07fc29f956de commit a357bacb86a0ad2a88dec01df6fa07fc29f956de Author: Ed Maste AuthorDate: 2024-05-10 18:57:22 +0000 Commit: Ed Maste CommitDate: 2024-08-01 15:11:45 +0000 madt: print CPU APIC ID as signed int Instead of printing something like "MADT: Found CPU APIC ID 4294967295 ACPI ID 512: disabled" print the APIC ID as a singed int for a more user-friendly -1. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45158 (cherry picked from commit 0b272e0926b3c4b1961131119e22ed5791be7230) --- sys/x86/acpica/madt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/acpica/madt.c b/sys/x86/acpica/madt.c index 200eec1fbb28..bff70b0fecfc 100644 --- a/sys/x86/acpica/madt.c +++ b/sys/x86/acpica/madt.c @@ -368,8 +368,8 @@ madt_add_cpu(u_int acpi_id, u_int apic_id, u_int flags) * MP code figure out which CPU is the BSP on its own. */ if (bootverbose) - printf("MADT: Found CPU APIC ID %u ACPI ID %u: %s\n", - apic_id, acpi_id, flags & ACPI_MADT_ENABLED ? + printf("MADT: Found CPU APIC ID %d ACPI ID %u: %s\n", + (int)apic_id, acpi_id, flags & ACPI_MADT_ENABLED ? "enabled" : "disabled"); if (!(flags & ACPI_MADT_ENABLED)) return; From nobody Thu Aug 1 16:11:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYqY5DYQz5T0jg; Thu, 01 Aug 2024 16:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYqY4knqz4fHh; Thu, 1 Aug 2024 16:11:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yBiKQp637oH+cssm5U/ZQikbpuGi9IBWkaFr8LTBFOE=; b=NcMk0c/HY5I987iwbSqaJTYonaHlJ2PTxuo4BXIBJERB4O+864hpr5Zc9NCJAn/N3zijor kK0vaAKC5nMUVrd9OLUV60D+PqdfAenMjkVcBR1qfH0T6h1u8T4G502WuWpmzt+smm1wvu W0JLrRHJrEt4T3uSfoJERfyRoZHtLd2BFIMyXcHIEdIXAmxH97pRMIYmEPV9StPjRLoL7S X2eYiMDXwSXGopICacXdff/foMKB2Oyf2etMQUwwoKwG/PsWRGamfd04nrb+7nKYy3Z0w1 fsAyD8MUUHETgMrMVnMzthWu+1l8Fv4tX7NeFCh/xOW/gFEXrmEKBv2ZIn2R0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528681; a=rsa-sha256; cv=none; b=w5u40g0FyEd/atpi8KBnk8LrfnVxDt0FNfQPPcRw965TmSQNyhz0GNiMxwhIp7OBjp8ZVH orXkm8iHPhx0ioNq315LmahI9beKBtfc60i/OFV5ddnmGXPjFJ/fQV69bAdwAhj6SDvMag tkeNsSqqCfbKmjDk+Bw3Cc7UEbGtx3J1hxmEh/vUAn3G5c+CflWLC6OeOnVnxOnBkN2iAb vhr1futeM6yMylfoA3ErNAsDYvoyTQwwGYbPHBmDN8MojMZHVlYVL5V0s0kgVN956m06Ab USa85TfZ5lBggX/mZ/KySzMiJvPMHR14em8xc+G78j6h9F7td2BJxeWwcRUGyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528681; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yBiKQp637oH+cssm5U/ZQikbpuGi9IBWkaFr8LTBFOE=; b=q4LZv7RfyaosvDR2rV/zHHJYxapzpjzxH6wNEsECcecSiztxKmu4Libn1PSNBgedR1je1G lZfwZpLdVYNd9hkPMkgY2YWdgzM1ZFA7WbR/i1Fkd+z+DfUvON5AO9ainvhEuhOntg4Xzu XnjRqokASkCOYkG3m9syaLBFpZ02ixy2LoaX8EohFRnF6w7PxPnjlUrt1TGxiQCdAkHuRf yViQWPYB3//6tXF29XQcn9ppQNEJx+eru+VRVUztRJgV0c+J4JHS1yiZhbVs79BhCKG9kv DlomE0ZcFOvhAKdGIPzBRjchzREp/kYpSxlJ42I0+wMBLixgsNJfiJEH+9ERVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYqY4LWYzr6q; Thu, 1 Aug 2024 16:11: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 471GBLSq092773; Thu, 1 Aug 2024 16:11:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GBL2A092770; Thu, 1 Aug 2024 16:11:21 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:11:21 GMT Message-Id: <202408011611.471GBL2A092770@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: 1f645823e0ea - stable/14 - etcupdate(8): improve phrasing List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1f645823e0ea70d606853fd9043eae1729e94313 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1f645823e0ea70d606853fd9043eae1729e94313 commit 1f645823e0ea70d606853fd9043eae1729e94313 Author: Ed Maste AuthorDate: 2024-07-16 01:44:11 +0000 Commit: Ed Maste CommitDate: 2024-08-01 16:10:26 +0000 etcupdate(8): improve phrasing Reported by: igor(1) (cherry picked from commit afd67a1677999b0f9d82d29bfd7c767f665e76e8) --- usr.sbin/etcupdate/etcupdate.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/etcupdate/etcupdate.8 b/usr.sbin/etcupdate/etcupdate.8 index 82c36fc9cb68..5eb2aa644037 100644 --- a/usr.sbin/etcupdate/etcupdate.8 +++ b/usr.sbin/etcupdate/etcupdate.8 @@ -485,7 +485,7 @@ as additional parameters to when building a .Dq current tree. -This can be used for to set the +This can be used to set the .Dv TARGET or .Dv TARGET_ARCH From nobody Thu Aug 1 16:11:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYqZ6Gkbz5T0V6; Thu, 01 Aug 2024 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYqZ5jxtz4f8M; Thu, 1 Aug 2024 16:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M11Df93j0EPwOdW0faSfkEdk7LmCHBzufetCe+xvsBM=; b=njLpJxxMgvY3McWfbOXCZpJ8wkYydt7UCYUcNMG2hmQeHHZ0EcY1EMLer3goGZAXhlolJL fkdHBXOtvF+5WCWAcghTkR+AM/2Cj2+YA9BXuzj/XQIMUrgZSk/3+FOZumkw9CSZI/9mqL aGrdLXQCVDEVhEUVfwtOsOcqfiFufdj27RiDyG0xLTFCaBEUlGTQxs31nlH2tFieVWZV4l jT2aOP+3Y0zA/Kp5VucPL0Y2hTUa9etiX6JCrK6UT17mn2YRcftrkuNQPa80lHTEAzqbW8 P/5g7NSxJM+p+Y5fA4CwmDpScSTWH3bAk35s5w625b8XwgicHs4qMhLPf2f58A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528682; a=rsa-sha256; cv=none; b=cEWuF5ZKVvQJ3zi8jOvkjEuHjYAWcKX5qIcbH+Qb7RkK8cWpTAP9c1wiC/CVd+R7Q8zcJl ht0UdGtkDXxxBs7Sf1fBip+QfpAGZCNzaNvFgrT6KiXIqPYIqPNja53pxHxe9JOWr3WcYw 9HKQWaezUXFzoz7ZX5gINDqogHYjvZBbMAef0wia1qAr0BNvN3RMRehSTSWm0ze+mnfkl5 /i/BkLEhyIgI+GCVYqkJCW9UbJhsso+qSknAa/V2wsKBxW57+nPf7ZL2G54HS3ywhMnJpf Mi14y7F+gpZgvzid4s9/+Z9+Z71/4/8r3WQpUq3ICdYJIvPEsXJje6kRIJjwOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M11Df93j0EPwOdW0faSfkEdk7LmCHBzufetCe+xvsBM=; b=T1/7v3bAu6ISLO7nAUEOgEtsV2NScnpbcskbq8xKtqDrkMtjuv+mmWop3KSDSgCeoscA6D 3EhDgb3cDSg7vzChfa4SMYx71uKnLodn8CyvXzxsnhIdhX/zrFs5FQ/N48RNLZyPLwc5hc pPsIxc0vA/wUzbOp3PSgsLK8Uwdz34Udc+sxgdUdVzDBHvOek8EYQc4ats03nTKVA89XxK 2+KycMblMIwnB0r7gDhdndo/e5oBFq1+EdTSKpdo5eD0pUQnpYoUfjCQJQfD3lXh1KQua0 MoxuJZPtHX2uf4i9DBrh7tMz6NZeud7rxKIxS9fcR5/NVZqHYM6yYiuRkvPU9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYqZ5Htxzrb0; Thu, 1 Aug 2024 16:11: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 471GBMrs092821; Thu, 1 Aug 2024 16:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GBMnF092818; Thu, 1 Aug 2024 16:11:22 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:11:22 GMT Message-Id: <202408011611.471GBMnF092818@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: 35957d27eab4 - stable/14 - iichid: Soften "Interrupt setup failed" 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 35957d27eab4eea77b0daf70b2ee5f636d69a484 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=35957d27eab4eea77b0daf70b2ee5f636d69a484 commit 35957d27eab4eea77b0daf70b2ee5f636d69a484 Author: Ed Maste AuthorDate: 2024-07-23 17:37:15 +0000 Commit: Ed Maste CommitDate: 2024-08-01 16:10:26 +0000 iichid: Soften "Interrupt setup failed" message Users may interpret the message as a possible hardware error, but the issue is in fact unimplemented functionality. Reword the message to avoid implying it is an error. Reviewed by: wulf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46092 (cherry picked from commit 0ac6cc3fd7473a7a8596fa73322a67fc1d78df53) --- sys/dev/iicbus/iichid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 222f20842a04..1e0dac2ee5dd 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -1154,7 +1154,7 @@ iichid_attach(device_t dev) if (sc->irq_res == NULL || error != 0) { #ifdef IICHID_SAMPLING device_printf(sc->dev, - "Interrupt setup failed. Fallback to sampling\n"); + "Using sampling mode\n"); sc->sampling_rate_slow = IICHID_SAMPLING_RATE_SLOW; #else device_printf(sc->dev, "Interrupt setup failed\n"); From nobody Thu Aug 1 16:11:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYqc45sXz5T0jk; Thu, 01 Aug 2024 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYqc0Zb3z4fKm; Thu, 1 Aug 2024 16:11:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uuh2tGpCPyIrQ1ABhHpoQ4oo+CfzeISmaDeN1XOgOvM=; b=G9dKkUMnI4yWp89pmrVlyM7WONtdE8YXMNSE4/Uwmm5jr3L+pIEk1xvybQu5I3ruGsroLs ZxweN1XCnpz+h/ZKG2hUpT/ZuKqG2LzCb3Lk8MgrPmxAPWa6oesksaImjc95nJ+FlyVKnH w9ALyFviiMfrbaqkHFMHuidpPdC68uqEdTy6ID1gkMkvxWx9igSGL5lzv+odx3eAksMcGV nRbH1ZxylDmi5dQ7SSkjpPGgCHGa43EyK5XT9rBtUKfqOW+SsQdJ9SCFJg4R3n4ddkoxhF Jao3ox91Nn7nE9vl0v2zJ7eMW2OBJZD64X9nLpWO3OyKbzYdImneXU7stQQZBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722528684; a=rsa-sha256; cv=none; b=vZa+1rqmJdD9GTxRb0mktNHp9i9MZPZXkUO0qE4xC38v3z5EtotGYvzAassVx6QN25JFRS azr8BSXEhfYlneqnaxM+gXJvm4DIwUp97h5v5Cx2yp+zDb52kKl8Gd9DJaDeb1kM4u0X/g iw8w3Ihg+27Xa3mJTEYbiN/3Fw11xGxWDb01pRzehPHpGMyk6jzWSrSPoyCDjVi4Ujt/2e natnP3dllVLyi7/VpyRgPfKmv+Tois8IbBiz38dSEiTceVNMLbczO1vfBFXUSBrcxnhiuT cRf7v/Qfsst0p+qj+WoMYFNmvvoohXXh0YNTUCzuYEaYzn8VDWGMc/JQ/B4XGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722528684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Uuh2tGpCPyIrQ1ABhHpoQ4oo+CfzeISmaDeN1XOgOvM=; b=xX7P/O5zUtgMETdzVytsF0cLbfO7wwudRkVz/q/IkT6nOIJa+1+G1u+/eXHKdmH6C/cArp l8Wb7isxkGTGAXxqZEBYA0FLq1YiF/oUh0QAH4piZiembk+a6XmBhhM+DtRnr431b/YtA0 lI/GywaOj5s/inS8WqnVWzaNorD56PpGO5a2HeJ7NxOKVwF09ArTRY3KbOIsVJ7OLrLrng yGpcnqeqcI2N0roVRJuHUsJr4XxgdSL0QR7uY+JnWuLrEt3FRG+JCEuJzrCEazJk9Hp8nx XOwAkw1lNezfUC/WL+yw48D8wYy4rP38VmSWSQF4RMFx+gmjW9JLG7MCdN7s/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYqb6MDqzr9L; Thu, 1 Aug 2024 16:11: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 471GBNQ6092886; Thu, 1 Aug 2024 16:11:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GBNEl092883; Thu, 1 Aug 2024 16:11:23 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:11:23 GMT Message-Id: <202408011611.471GBNEl092883@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: 34f7ebd56319 - stable/14 - vt/sc: retire logic to select vt(4) by default for UEFI boot List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 34f7ebd56319c909f6b05ce0273b688074345c66 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=34f7ebd56319c909f6b05ce0273b688074345c66 commit 34f7ebd56319c909f6b05ce0273b688074345c66 Author: Ed Maste AuthorDate: 2024-05-24 21:36:09 +0000 Commit: Ed Maste CommitDate: 2024-08-01 16:10:26 +0000 vt/sc: retire logic to select vt(4) by default for UEFI boot We previously defaulted to using sc(4) with a special case to prefer vt(4) when booted via UEFI. As vt(4) is now always the default we can simplify this. Reviewed by: imp, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45356 (cherry picked from commit 9b1de7e4844d951a7d7335cbde75a86a2380e220) --- sys/amd64/amd64/machdep.c | 9 --------- sys/kern/kern_cons.c | 18 ------------------ sys/sys/cons.h | 1 - 3 files changed, 28 deletions(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index ea440f46a12f..f5c49c6ca243 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1465,15 +1465,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) r_idt.rd_base = (long) idt; lidt(&r_idt); - /* - * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) - * transition). - * Once bootblocks have updated, we can test directly for - * efi_systbl != NULL here... - */ - if (efi_boot) - vty_set_preferred(VTY_VT); - TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); TUNABLE_INT_FETCH("machdep.mitigations.ibrs.disable", &hw_ibrs_disable); diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c index 24952561449b..2b28c51984e1 100644 --- a/sys/kern/kern_cons.c +++ b/sys/kern/kern_cons.c @@ -715,7 +715,6 @@ sysbeep(int pitch __unused, sbintime_t duration __unused) /* * Temporary support for sc(4) to vt(4) transition. */ -static unsigned vty_prefer; static char vty_name[16]; SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name, 0, "Console vty driver"); @@ -740,10 +739,6 @@ vty_enabled(unsigned vty) break; } #endif - if (vty_prefer != 0) { - vty_selected = vty_prefer; - break; - } #if defined(DEV_VT) vty_selected = VTY_VT; #elif defined(DEV_SC) @@ -758,16 +753,3 @@ vty_enabled(unsigned vty) } return ((vty_selected & vty) != 0); } - -void -vty_set_preferred(unsigned vty) -{ - - vty_prefer = vty; -#if !defined(DEV_SC) - vty_prefer &= ~VTY_SC; -#endif -#if !defined(DEV_VT) - vty_prefer &= ~VTY_VT; -#endif -} diff --git a/sys/sys/cons.h b/sys/sys/cons.h index 5ad85a516dc5..75dc66aa252f 100644 --- a/sys/sys/cons.h +++ b/sys/sys/cons.h @@ -145,7 +145,6 @@ int constty_clear(struct tty *tp); #define VTY_SC 0x01 #define VTY_VT 0x02 int vty_enabled(unsigned int); -void vty_set_preferred(unsigned int); #endif /* _KERNEL */ From nobody Thu Aug 1 16:16:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxr510Hz5T0fJ; Thu, 01 Aug 2024 16:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxr4NPxz4gSK; Thu, 1 Aug 2024 16:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Skpaka0IWCpg08LV2qy8Dz5484PCXwhFkA6cBPE4NYg=; b=aq3kqYiuvnWs2V8b6sZk1wuIp9RIfPgujqyG0JBkYHJN2kI14j2Y9j7kAM4FdhdN29Hapc RPyj0F6oQuiTscJMbdnvw72h8nWFlttnrfDAzpRHHmRQV4OqxanxdRkxqG+0Q5MFpI/783 QxhVuHfoZK1dAxkWU+65HGmUvYOkMrjqIs0tcsNymzMApSJpbMhaKnZhUgMpwo0OgyBxWI gkaD0noqraHWUmfyeyPz5Mp31B05FdrwisDQgYJMumSxVO8mz2nNZuVlFJ8ewbUaQADemO 9Ma1wETKM788XTuJU0VJfPTRkGLraIdvUtqv3zavsWeH8URoKPHLGdjL6BooTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529008; a=rsa-sha256; cv=none; b=iSDQP/hQAI2mOXB0uVCIjdEKoWvlXknBj9hULqb5l6g3tQ5WTNUpJGAGeO0R9vOY5EarwX i2E5tpBpOc842Fvm45KrugRUaSsu9GuzWR88S77AwydceMehgoaq44OyxXtKlWM3Xiac5B yRJNQNs3YI5/QJ+bJOFzOynz6w+9YPqkzHQF36Az6vbLnwjcIIB/xPJxQR1JhOiM9quxhi /r/ORoCpZbh1Kk9Uwqe9CXAWrA3evTvtmG4fVhtlX2VdLhOdUId15zqHFhCQYYQRTaIcBW pzxsIMra3h0sztB4zQMDdpggVxIsBF/iEzoIuc72FvPYk6Wz7Fz0BQvh2sBIpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Skpaka0IWCpg08LV2qy8Dz5484PCXwhFkA6cBPE4NYg=; b=mJcKWBKltBNo2yZ0nDZ5OzTbgfLDu9KgGHVBnQ9DmdeSUbOvkxqHLhL0T07gDeemGdwC8r A28dbjxKbfNVGdvt+Kt95rB44PBHU9/SDy6SiIFUWgJcMzOYC6tHNhEvRGg1RTIpG+7GH4 lBjteBmuqx6e8t9IyCJcxMUq08+WkTkkhRIqp9ZonpS3DARHd+SLhUMP+1HBQkgZU69wNC jePNAvuZFyucK3CKNaunh8OQvoQE/m4S6Dui/hBb9LHVPB8mOJ8iSnrM/Vx7wzwUDb+J4l KzHcHFMImUjK3X+YW2UnNsIYbCPhbizmE8HLPXGPl2lswQgrTjUUDDo0iz+Rlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxr3nV3zs96; Thu, 1 Aug 2024 16:16:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471GGms0095623; Thu, 1 Aug 2024 16:16:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGm7m095620; Thu, 1 Aug 2024 16:16:48 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:48 GMT Message-Id: <202408011616.471GGm7m095620@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: 1a34a8f57f0a - stable/14 - tarfs: Fix typo. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1a34a8f57f0a7e6b2fa4217f7988044171b09436 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1a34a8f57f0a7e6b2fa4217f7988044171b09436 commit 1a34a8f57f0a7e6b2fa4217f7988044171b09436 Author: Trond Endrestøl AuthorDate: 2024-07-24 11:30:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 tarfs: Fix typo. MFC after: 3 days PR: 280354 (cherry picked from commit 124ae0e8af8fbc8384a660583f47f112f392395e) --- share/man/man5/tarfs.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/tarfs.5 b/share/man/man5/tarfs.5 index 56c56ac43287..ed76d2b4b2b8 100644 --- a/share/man/man5/tarfs.5 +++ b/share/man/man5/tarfs.5 @@ -72,7 +72,7 @@ When using to create the tar file, this can be achieved using the .Cm zstd:max-frame-size and -.Cm ztsd:frame-per-file +.Cm zstd:frame-per-file options. Sensible frame sizes are powers of 2 between the system's base page size (see From nobody Thu Aug 1 16:16:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxs5m3Kz5T0cG; Thu, 01 Aug 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxs52X8z4gDm; Thu, 1 Aug 2024 16:16:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbTU3FdbcVFwTx5z78Ds81uGnNHuGWupdZNKZdppCh8=; b=i8lsH5GKN/HM3M1VEGYejHxa8Kke3c4Xnf1Zlla7mJfv7Vmx9FyPjIyB+u2rwlM2HDZK4l +q1mFZ3bM2p9Y0Ly5y+A7doyZMIWu8tT9UtFIfUEoJWiz5k4dmYspdWnYABNHh/J16zzyn qUXGCM20QFumSTkhHH1QrOAEW4a+QsEkxm+RUnzEIyPVvGFiPHX8F7LPqwAeBEgY3DO21+ /DDdudAu6dPowA8FoqxVGqcz/SaElBXafY9v/cux0+dxEGizKLtgrSmBYe+c3pVaF9gzC8 BdcijKjQoGAv0exkZYRpU3fDJbTCvABt8WarU/uhwq4ZdlXMwfZdFY+Eo6J6Fg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529009; a=rsa-sha256; cv=none; b=tY/A36zJPGvU3xzyUtMhjUPnnXviRwQI5f3lB/itELUm3yxIgFgLj1VUuQ8Xw0pDhR5GrT mZ2ijbjcwSjJMqKcKQyIgOj7DYDDQnh9TiXgFWneodCsJSF7gcmRlPuSL/wRzJsh2rBPJ1 V4cgFS/FSnZKqEgH/fEXokBHWMpCQgEi7ZyWnWMTsh0zcV4lFrdqAxnmWVdfzUJ3tt6goO hGT6xZ6RgmNlqHFDkvjrxbeddi9+mRGp1IfwXNwl7dRrmZXXFlQjmCGlrN8cKba8BsBJOI do922ig9RJk8khmhDo/uqEibEJ6m83MBeP1B36cH/IuEozRq3JmoQ+xUaAHWhQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SbTU3FdbcVFwTx5z78Ds81uGnNHuGWupdZNKZdppCh8=; b=YJidV8vwNTAtcq6AQL9a+adK/40M/RXGIIhs+Ix4lWpOXKunMHUwaPK4nKdBDrq6qyPGPt 7yJOw/WSfRF8aQQsPw5Y3qWIltBGUocnL+RkFA3qUAEclnK7BEAyoSt3hIubscmUW2Ufr4 EavFR+5NdBdVFAXIpSYQdQ2wz7gyhtGArB/s0/A5q8kTb3ItSYFtE4cy2ySSirkjOqeOO0 qkS8eCqtWUdf8WOUUffSEWTuwPq2YlRE0qEEXCcFlbY/ZDcII2962TjCaCDf+NIv+SLmef /u/xCt16T3Pfi8BiQWguquK/0RvKhzS8vXBE9siKFbJiIfa9ISwlJFAHe1O5ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxs4L2hzs97; Thu, 1 Aug 2024 16:16: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 471GGnuj095683; Thu, 1 Aug 2024 16:16:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGnTe095680; Thu, 1 Aug 2024 16:16:49 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:49 GMT Message-Id: <202408011616.471GGnTe095680@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: e6d9c11666f7 - stable/14 - ls: Make -, apply to -s as well as -l. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e6d9c11666f785ec45cb6f7e05fc87012d6bb4d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d9c11666f785ec45cb6f7e05fc87012d6bb4d5 commit e6d9c11666f785ec45cb6f7e05fc87012d6bb4d5 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 ls: Make -, apply to -s as well as -l. While here, remove a bogus comment about a gcc bug. The bug was in ls, which used an incorrect format string, and in libc, which accepted it. MFC after: 1 week Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D46067 (cherry picked from commit 647d4a8cafd2c9b291cab388191bc7fcfe12a66b) --- bin/ls/ls.1 | 4 +++- bin/ls/ls.c | 3 ++- bin/ls/print.c | 14 ++++++-------- bin/ls/tests/ls_tests.sh | 16 ++++++++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 1b0f24593adc..4d20f02261c9 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -31,7 +31,7 @@ .\" .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" -.Dd February 21, 2024 +.Dd July 22, 2024 .Dt LS 1 .Os .Sh NAME @@ -436,6 +436,8 @@ output is not to a terminal. .It Fl , (Comma) When the .Fl l +or +.Fl s option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned by .Xr localeconv 3 , diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 59ff12547787..1ad346440f02 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -981,7 +981,8 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); + d.s_block = snprintf(NULL, 0, f_thousands ? "%'ld" : "%ld", + howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; diff --git a/bin/ls/print.c b/bin/ls/print.c index 16c4f48624d0..417586665eb1 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -227,7 +227,7 @@ printlong(const DISPLAY *dp) (void)printf("%*ju ", dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) - (void)printf("%*jd ", + (void)printf(f_thousands ? "%'*jd " : "%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); strmode(sp->st_mode, buf); aclmode(buf, p); @@ -406,7 +406,7 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield) chcnt += printf("%*ju ", (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) - chcnt += printf("%*jd ", + chcnt += printf(f_thousands ? "%'*jd " : "%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); #ifdef COLORLS if (f_color) @@ -759,12 +759,10 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); - } else if (f_thousands) { /* with commas */ - /* This format assignment needed to work round gcc bug. */ - const char *format = "%*j'd "; - (void)printf(format, (u_int)width, bytes); - } else - (void)printf("%*jd ", (u_int)width, bytes); + } else { + (void)printf(f_thousands ? "%'*jd " : "%*jd ", + (u_int)width, bytes); + } } /* diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index c82b4e8c8851..c732b60b21a4 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -800,6 +800,21 @@ s_flag_body() done } +atf_test_case scomma_flag +scomma_flag_head() +{ + atf_set "descr" "Verify that -s, prints out the size with ',' delimiters" +} + +scomma_flag_body() +{ + export LC_ALL=en_US.UTF-8 + atf_check -e ignore dd if=/dev/urandom of=file bs=65536 count=64 + blocks=$(stat -f "%b" file) + cblocks=$(printf "%'d" $blocks) + atf_check -e empty -o match:"$cblocks[[:space:]]+file" ls -s, file +} + atf_test_case t_flag t_flag_head() { @@ -972,6 +987,7 @@ atf_init_test_cases() atf_add_test_case q_flag_and_w_flag atf_add_test_case r_flag atf_add_test_case s_flag + atf_add_test_case scomma_flag atf_add_test_case t_flag atf_add_test_case u_flag atf_add_test_case v_flag From nobody Thu Aug 1 16:16:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxv1Ctwz5T0Yk; Thu, 01 Aug 2024 16:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxt5m11z4gDs; Thu, 1 Aug 2024 16:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IKhvyNAtOuuVyEug2Y2JomZOqPIaBpDgqIvzDQX2zcY=; b=LjlqCGUVP4LpbBd1s7PJZhZYnZFq2EflAqDVIM571PKeMbGMzbAX1cZNAm1oqeKWU5VGsC iRjW34upQGqR2IbDTjFFx5SxxEH40OdztkmXck/ipvE0S2qclG/HEL3hSrmlXa//Gb64E8 aDjoBJ/XXIrYm3UBZsczgp1EZIA59MfOgFjv63JPlPVLh9afCsjNkAvlFQheThA3BunbAq JW9Td+DrhrqTmm938n+kQlSPkc4TZquDF/SmrHnk0ywiFg5wIkG7NowK0dt2TSOBgQNjQl PRh66Yx7pduJhX3kettlkeLAUonPdDNSxowS5Jq8WBrecWGACJKoBfvj74sNEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529010; a=rsa-sha256; cv=none; b=jHBlZUa1sycc7Yc89w009lb7Ijy4ezRbPuFPJ0FQYxHtOA7RbgrKCGoqOXlF2B0vGwxDIn WnrnZksEyaaX2deNLYqfaXt0zww1GwzjTIrtG1evNBXCUnfDNwMyARjB1JCcYMBNhmI7ff 69KT2ZztiCt4CnS+8eQ/0zPMaYo8Rwd13d8j3wVNsl9cTZ+QLFd6AuieZC1RqFc+xIeWJj rnSoZhOx0oHpTUPOiZQ52Hj6HXxHzQjNhrM2SBad15Txi0zDPc7/9uMlQFtWAt3Y58EveQ YY32tkdiKCOqow5QdbxUyjOgruJzjHRJP2GOmBl06Wh2uJX8beN+D5ztQYihXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IKhvyNAtOuuVyEug2Y2JomZOqPIaBpDgqIvzDQX2zcY=; b=M1am7npredFewiwkYmTQEC7oC/2tbai/0tThfwA52TF6nMhFBuTsBkOrvjkq478pRR9k/i okKNfv+lZZb5A/UuYCeOi1hpGQwYXBPjLnan+9zwse5EKMFgVxN32AS9uSLEioa1kmEFok ss+7Hrim62MD52TNBrQ08kR8C7h4KJzjw4BVpXDLunBEns3QCtz+c4T3wqeJ45yObLaHWH TmLplznsLBu4NEqQrdlKTKUnbMMn7wj9/wkehA7qL2v5XYrPZkZ7nM3rdpIRt/TgPzUCtT m9biMecKVnEHQmiTxT+yjo9jBAa1WdrHVT+Ll/GqMTPFZFUr/tYV8V0riOHhrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxt5Mwtzrbg; Thu, 1 Aug 2024 16:16: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 471GGo7t095742; Thu, 1 Aug 2024 16:16:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGoO5095739; Thu, 1 Aug 2024 16:16:50 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:50 GMT Message-Id: <202408011616.471GGoO5095739@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: ece4e05f4bf9 - stable/14 - pax: Clear arcn in each read function. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: ece4e05f4bf96a5bd2dad61ad057aa076ae5dc36 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ece4e05f4bf96a5bd2dad61ad057aa076ae5dc36 commit ece4e05f4bf96a5bd2dad61ad057aa076ae5dc36 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 pax: Clear arcn in each read function. Instead of initializing individual fields to zero, clear the entire struct prior to populating it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46097 (cherry picked from commit f890020d43bf2070f12ffec37bcd9579f6fb1347) --- bin/pax/cpio.c | 12 +++--------- bin/pax/tar.c | 20 ++------------------ 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 76edca3c6f91..0b5b95bb5ef5 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -280,13 +280,13 @@ cpio_rd(ARCHD *arcn, char *buf) */ if (cpio_id(buf, sizeof(HD_CPIO)) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); hd = (HD_CPIO *)buf; /* * byte oriented cpio (posix) does not have padding! extract the octal * ascii fields from the header */ - arcn->pad = 0L; arcn->sb.st_dev = (dev_t)asc_ul(hd->c_dev, sizeof(hd->c_dev), OCT); arcn->sb.st_ino = (ino_t)asc_ul(hd->c_ino, sizeof(hd->c_ino), OCT); arcn->sb.st_mode = (mode_t)asc_ul(hd->c_mode, sizeof(hd->c_mode), OCT); @@ -315,8 +315,6 @@ cpio_rd(ARCHD *arcn, char *buf) /* * no link name to read for this file */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; return(com_rd(arcn)); } @@ -561,8 +559,8 @@ vcpio_rd(ARCHD *arcn, char *buf) return(-1); } + memset(arcn, 0, sizeof *arcn); hd = (HD_VCPIO *)buf; - arcn->pad = 0L; /* * extract the hex ascii fields from the header @@ -609,8 +607,6 @@ vcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = VCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } @@ -857,7 +853,7 @@ bcpio_rd(ARCHD *arcn, char *buf) if (bcpio_id(buf, sizeof(HD_BCPIO)) < 0) return(-1); - arcn->pad = 0L; + memset(arcn, 0, sizeof *arcn); hd = (HD_BCPIO *)buf; if (swp_head) { /* @@ -919,8 +915,6 @@ bcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = BCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } diff --git a/bin/pax/tar.c b/bin/pax/tar.c index cbe2dbab64f8..785dd32c4838 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -373,9 +373,9 @@ tar_rd(ARCHD *arcn, char *buf) */ if (tar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; /* * copy out the name and values in the stat buffer @@ -402,8 +402,6 @@ tar_rd(ARCHD *arcn, char *buf) * to encode this as a directory */ pt = &(arcn->name[arcn->nlen - 1]); - arcn->pad = 0; - arcn->skip = 0; switch(hd->linkflag) { case SYMTYPE: /* @@ -440,8 +438,6 @@ tar_rd(ARCHD *arcn, char *buf) arcn->type = PAX_DIR; arcn->sb.st_mode |= S_IFDIR; arcn->sb.st_nlink = 2; - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; break; case AREGTYPE: case REGTYPE: @@ -449,8 +445,6 @@ tar_rd(ARCHD *arcn, char *buf) /* * If we have a trailing / this is a directory and NOT a file. */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; if (*pt == '/') { /* * it is a directory, set the mode for -v printing @@ -727,10 +721,9 @@ ustar_rd(ARCHD *arcn, char *buf) */ if (ustar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; - arcn->nlen = 0; hd = (HD_USTAR *)buf; /* @@ -777,15 +770,6 @@ ustar_rd(ARCHD *arcn, char *buf) if (uid_name(hd->uname, &(arcn->sb.st_uid)) < 0) arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT); - /* - * set the defaults, these may be changed depending on the file type - */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; - arcn->pad = 0; - arcn->skip = 0; - arcn->sb.st_rdev = (dev_t)0; - /* * set the mode and PAX type according to the typeflag in the header */ From nobody Thu Aug 1 16:16:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxw0yzcz5T0jG; Thu, 01 Aug 2024 16:16:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxv6f32z4gL8; Thu, 1 Aug 2024 16:16:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GACh6Jc8COdoLgBKBwre3JyS+NaQTbzbGAxB2hz7ce8=; b=Tz4IV8gCeb4Krz3MMExf9+ngfYWoRmmZbN6IIZnkCwkLFCjLTGIYBG0/t93E+syQwgtBRC dXxpe8kFRt95oeuN0Tu1ownotyFPS+SXuajFMkiyq4HZTiL1Q42CWhY56ta4R+TuLtw6xS 9V/01N06GqYhev8fo4m8pUJ9aAqLcfDy3kG0EA5xssgsqBE+yFpsOl2Mhqi0VTpJXw9LKj rfnTasdgofWydwAwOsjBBKU0ykkSI9i8CnpQkYxveQ8yv4zj21DNA9fL7hyFveV4jC1KuM ImSmY/pjHfiUqe8eWRd5ymI9Rz+rvy1+4FPgSbC/FXejLgceff6gqRxDlTZh0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529011; a=rsa-sha256; cv=none; b=vTv1b4hgpdmUDyE5t+Eu6H0ipcHIfoG9At+7T8NXdwRwisMXUigxRnHBN6cOgQG9gKgk8J Jq+RXvCI8tDFS/MSsem+dCyZ5wZO1kQMgBBHcDJgLxapJUQQq449KueLBQb5ZOw41oBcdB q/urHPxyhihozhgG7A0ZblkHxrHssKlxz5ACPd4qU6dfyP+PkQ1NoT+8c+bR6Du/1jSpAz ZSEZrOCJcM0qFXlTgxtje8HAFJafdV17UR9L5AZ8rpNujqv4uEMxWfv57EmvNMcSMIiczp 37FiwWNCmzdb4QahiSjzhWWq+3L7Bj/o38QfxfDRTPAW/a6Owcz/1rBi6tcPeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529011; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GACh6Jc8COdoLgBKBwre3JyS+NaQTbzbGAxB2hz7ce8=; b=KAmND36qz6FMlUdf2pQUFUO9VnPtx0MwKUTO/Vt1d+p3SusW9A1pfGE2KTlzDkIWe1aLsH twv36BYXXMxHmj43M1bkbeD80zMftbeJrFN2meDy1ht7ZouibaleKO6uDFPM1Rc5HbAcJ2 fStTdKhsyiD0JgvaSreto+w7X0LGhagzSCzJNsr9bieyZRWtOkeeNNNTCjPuv8h2jbJWqb 80R6unOu2mQwKCPTrMpITU4QYJpYTgeoT/vIxoPg8BDKi9iBfKR6smOSwtYuC1btNkCc2h 6el2B5Yqa9B/pUNdtCbCUOB2iYPk+Mpa0ASWGEsRWMmH8tc9p5h+zvkf3LMehw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxv6G35zs98; Thu, 1 Aug 2024 16:16: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 471GGpBa095790; Thu, 1 Aug 2024 16:16:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGpvn095787; Thu, 1 Aug 2024 16:16:51 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:51 GMT Message-Id: <202408011616.471GGpvn095787@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: 45fc37334d07 - stable/14 - diff: Fix usage message and documentation. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 45fc37334d077d635dbfdd13f5e085513bf09d49 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=45fc37334d077d635dbfdd13f5e085513bf09d49 commit 45fc37334d077d635dbfdd13f5e085513bf09d49 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:21 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 diff: Fix usage message and documentation. The `--ignore-all-space` option was incorrectly documented as `--ignore-all-blanks` in some (but not all) places. MFC after: 3 days PR: 280434 Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46160 (cherry picked from commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6) --- usr.bin/diff/diff.1 | 6 +++--- usr.bin/diff/diff.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index c10b130a2d72..3996f0388665 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -29,7 +29,7 @@ .\" .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" -.Dd June 29, 2024 +.Dd July 26, 2024 .Dt DIFF 1 .Os .Sh NAME @@ -199,7 +199,7 @@ .Op Fl aBbditwW .Op Fl -color Ns = Ns Ar when .Op Fl -expand-tabs -.Op Fl -ignore-all-blanks +.Op Fl -ignore-all-space .Op Fl -ignore-blank-lines .Op Fl -ignore-case .Op Fl -minimal @@ -422,7 +422,7 @@ output adds character(s) to the front of each line which may screw up the indentation of the original source lines and make the output listing difficult to interpret. This option will preserve the original source's indentation. -.It Fl w -ignore-all-blanks +.It Fl w -ignore-all-space Is similar to .Fl b -ignore-space-change but causes whitespace (blanks and tabs) to be totally ignored. diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 24e851ae9dbf..ba88964ca131 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -592,7 +592,7 @@ usage(void) " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" " [-F pattern] [-S name] [-X file] [-x pattern] dir1 dir2\n" - " diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n" + " diff [-aBbditwW] [--expand-tabs] [--ignore-all-space]\n" " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" " [--suppress-common-lines] [--tabsize] [--text] [--width]\n" From nobody Thu Aug 1 16:16:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxx2Ksdz5T0x8; Thu, 01 Aug 2024 16:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxx0hzMz4gJ1; Thu, 1 Aug 2024 16:16:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSIps5iR5gL4KUQ8BymwAHA4mPJrmTxy6f0VkPhqMug=; b=A3t5d8aMT7bmKFKF/SWvCnkD4hogoBWqVjj8ijSFogvoMKpICt4uQFjhEl4aNZn104eEEx YscwwIipfnZAoeXNI/t0uOPD2eRxDRdD3swTG9UpHYtQWqJvKghNoi6fPmGZcnqlSaZotl twj+i1ehg20tT1+pPcP+Vu6CbDD1MqWRs8u+5PBStN+yzpA/xLTXbxkf+gjPZmNpg2DWXy D9qWP75IrLb7sXQYy9z1bYk3lmJ8icdxddWvk7TZpkKIqw/rAWBTDD6RjrIz4bCU0kSr4y /YvVqup7aPTrdXM8QcnT8SYZaYff04artL2/ZoZ2Zo5NzW8/EQ2UaMjxjLiuyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529013; a=rsa-sha256; cv=none; b=PdZWAbDy4/kIimjc1OrrdxD/9IdNzi0cxixfbf9IJcCAxO0E9mzu3THbm16L32kJ/bqw0t 2PRvFEo2CcI+V44oiP+YqRaFS1oIAAkI19BAGUZ8qqlV8c/TxdYko+QqUu4Hfp8ZwR52ej FglfOKafwHlmpc0aqUls8CJWt62Cpefs7TSkj5LlTDENyuv0oNjthIctkQ7PrXNKw+7rpv dfshi4t65CRafIAKdFOAdL5kcjrnEa1GNSmH6sACm2bKJsTJv9NShVWnY2cOber9XP0Zqv 0yBx3tF0crpAwnoEAaacq0+pLm3R4WZRgbSKC9g70m3+6cI6PLVgxFslRIiWJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TSIps5iR5gL4KUQ8BymwAHA4mPJrmTxy6f0VkPhqMug=; b=XVzQycUgbOWFMAPAJpNnhXlfJ29qvswUQ0FrphEUBxBj7U3THekMwiGFthj2SQjnH+m+Ag Bt0U3obMZ+KL5T2DkgTbLiaaoy6J04BSjORuOyaWNgiEAWkRaZq/6LXg8PN4+l0aO06nrK tKvsBg99Z+BMi0X5XBSpD5aDLPyqJMZiy0dPeWZ3yGSLk3TtpTfhUAlwfG/zjTBNSob6xF Ua46XYY4kq+pp5Z9eikMm1D/InTmbMVC8QjhkWh/tNaWiFiTzQM9qweqoEErEHeWauN3Ys QLQyAbFwojQn9D+RZ5cy08S8DrnwpNvvGBQz3VgzHJt5foHbHqXISJGEg0H3Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxw6pkzzrws; Thu, 1 Aug 2024 16:16: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 471GGqrf095832; Thu, 1 Aug 2024 16:16:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGqb8095829; Thu, 1 Aug 2024 16:16:52 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:52 GMT Message-Id: <202408011616.471GGqb8095829@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: 094f58809682 - stable/14 - sdiff: Fix 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 094f58809682a693918efe6aba5d33d6dae33c25 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=094f58809682a693918efe6aba5d33d6dae33c25 commit 094f58809682a693918efe6aba5d33d6dae33c25 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:25 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 sdiff: Fix usage message. The `--ignore-all-space` option was incorrectly documented as `--ignore-all-spaces`. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46161 (cherry picked from commit ca75b7dac886de66fc06fd31facfa2c561f7567e) --- usr.bin/sdiff/sdiff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index 6402b85017a7..daa0f43e0b0e 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -130,7 +130,7 @@ static const char *help_msg[] = { "\t-I RE, --ignore-matching-lines=RE: ignore changes whose line matches RE.", "\t-i, --ignore-case: do a case-insensitive comparison.", "\t-t, --expand-tabs: expand tabs to spaces.", - "\t-W, --ignore-all-spaces: ignore all spaces.", + "\t-W, --ignore-all-space: ignore all whitespace.", "\t--speed-large-files: assume large file with scattered changes.", "\t--strip-trailing-cr: strip trailing carriage return.", "\t--ignore-file-name-case: ignore case of file names.", From nobody Thu Aug 1 16:16:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxy2fChz5T0fR; Thu, 01 Aug 2024 16:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxy15PZz4gFY; Thu, 1 Aug 2024 16:16:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GguIuc8y9/UBYa+kXNalwtMz3IxrUWM4HGbbrm63sQ8=; b=I52+DjtdWjGG/XDIKCmhMDLi9sP1Mjplm/qg4S/nZnOWfZUmz36HSkUQIUn7w3mlG8Sxc6 Q+AtefAQnFoD+Xpb+utQ70pNW9m/l6jl0nN2fAZv4yiz5/XRM6ekDEk/bWYQopW9el7hXW 8ldcy/KgvDxSEgPMk1SAONtQOLy2yGpO/ThSSJpNY7KtWEvr9Np3yXGBG1tLA5UQRL8IW5 5rfxkSTzqUZmHm7rrpBBMYqG+/3t8A/T6thfGEwezJlV0ybSue3wGQBfG8PBzrZ3Rgy/gW czUaa7EOWER+Kcrk6KG86RMmSPvCPK117W8sLDLu5J/TmX8VO/njVzaoGKhxyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529014; a=rsa-sha256; cv=none; b=ctiFhsIranvVzrfhmVmwLaFnEcrOQ0aSRIelR3wZYY6Dw9u8qfdsge0yzoLCvD9LZq0JYN e7JK/jnP6B7FiV1rOLnufGgTmN935wWODHwm6c+ZUcKci+ri+upR9TR1JN6xA+L9yIUkL4 i6i3QZoAQImJxNHqYPeDXGiSC/1tAnKXDZI3P8hIQa8bVBNvo9g+6tHSfQNK9ZRxL+WZ9b QItLRsp9gFLAgzquHhuNW32qiWtHdDtfTWMuvVqa2jQ/Ur17fyrVixpCTQg8wjBwt94Y9U GHoIfBZ8FYPlJHdpMZntu+e2B67Z8BFp03yHEKeYJbw08c0FeSjl4SWqtSbeYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GguIuc8y9/UBYa+kXNalwtMz3IxrUWM4HGbbrm63sQ8=; b=ZhW9ccDz5e7GECOCXzDqVwAk8ZCwAXVOxWXLwtp2kI1vg7Bpnxvm6y0T+J3BOi3EaXUdxs c3AXn6PP3FBiS1kA2RsbyYbiEenfK3+Gf/5ImbUxZHxFy+vetASGeTCw7tN919B/HF6oE0 WuECOANjJ9K0mD0gAryxtiJRVY5HSp8ajWyWcx+bFJo4T/oG4QsOC5AClnqM2NwQFjeYnm +hlFeGvXQpYOb0qy7aehBKSmvm4Rb+WqPse0bCTQVslzD7f/rB+d9CaE4AHZswKzkdbF7h +hzZAywHtOiHUvWrdLeatxGRoOMrv3x0xLHNSoG8gKGclLPgJMLTbrLw7SI+QQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxy0Sv4zrs3; Thu, 1 Aug 2024 16:16: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 471GGrE3095874; Thu, 1 Aug 2024 16:16:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGrOk095871; Thu, 1 Aug 2024 16:16:53 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:53 GMT Message-Id: <202408011616.471GGrOk095871@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: ea68175b07e0 - stable/14 - diff: Fix integer overflow. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: ea68175b07e0cd8e51249d2858749481352aa553 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ea68175b07e0cd8e51249d2858749481352aa553 commit ea68175b07e0cd8e51249d2858749481352aa553 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 diff: Fix integer overflow. The legacy Stone algorithm uses `int` to represent line numbers, array indices, and array lengths. If given inputs approaching `INT_MAX` lines, it would overflow and attempt to allocate ridiculously large amounts of memory. To avoid this without penalizing non-pathological inputs, switch a few variables to `size_t` and add checks while and immediately after reading both inputs. MFC after: 3 days PR: 280371 Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D46169 (cherry picked from commit 9317242469f1ca682626d9806f8caf65d143c09a) --- usr.bin/diff/diffreg.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index ffb3f90beede..2635c95daf6e 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -204,9 +204,9 @@ static int *klist; /* will be overlaid on file[0] after class */ static int *member; /* will be overlaid on file[1] */ static int clen; static int inifdef; /* whether or not we are in a #ifdef block */ -static int len[2]; -static int pref, suff; /* length of prefix and suffix */ -static int slen[2]; +static size_t len[2]; /* lengths of files in lines */ +static size_t pref, suff; /* lengths of prefix and suffix */ +static size_t slen[2]; /* lengths of files minus pref / suff */ static int anychange; static int hw, lpad, rpad; /* half width and padding */ static int edoffset; @@ -400,6 +400,10 @@ diffreg(char *file1, char *file2, int flags, int capsicum) status |= 1; goto closem; } + if (len[0] > INT_MAX - 2) + errc(1, EFBIG, "%s", file1); + if (len[1] > INT_MAX - 2) + errc(1, EFBIG, "%s", file2); prune(); sort(sfile[0], slen[0]); @@ -525,18 +529,17 @@ prepare(int i, FILE *fd, size_t filesize, int flags) sz = 100; p = xcalloc(sz + 3, sizeof(*p)); - while ((r = readhash(fd, flags, &h)) != RH_EOF) - switch (r) { - case RH_EOF: /* otherwise clang complains */ - case RH_BINARY: + while ((r = readhash(fd, flags, &h)) != RH_EOF) { + if (r == RH_BINARY) return (false); - case RH_OK: - if (j == sz) { - sz = sz * 3 / 2; - p = xreallocarray(p, sz + 3, sizeof(*p)); - } - p[++j].value = h; + if (j == SIZE_MAX) + break; + if (j == sz) { + sz = sz * 3 / 2; + p = xreallocarray(p, sz + 3, sizeof(*p)); } + p[++j].value = h; + } len[i] = j; file[i] = p; @@ -547,7 +550,7 @@ prepare(int i, FILE *fd, size_t filesize, int flags) static void prune(void) { - int i, j; + size_t i, j; for (pref = 0; pref < len[0] && pref < len[1] && file[0][pref + 1].value == file[1][pref + 1].value; @@ -685,7 +688,7 @@ static void unravel(int p) { struct cand *q; - int i; + size_t i; for (i = 0; i <= len[0]; i++) J[i] = i <= pref ? i : @@ -712,7 +715,7 @@ check(FILE *f1, FILE *f2, int flags) ixold[0] = ixnew[0] = 0; /* jackpot = 0; */ ctold = ctnew = 0; - for (i = 1; i <= len[0]; i++) { + for (i = 1; i <= (int)len[0]; i++) { if (J[i] == 0) { ixold[i] = ctold += skipline(f1); continue; @@ -812,7 +815,7 @@ check(FILE *f1, FILE *f2, int flags) ixnew[j] = ctnew; j++; } - for (; j <= len[1]; j++) { + for (; j <= (int)len[1]; j++) { ixnew[j] = ctnew += skipline(f2); } /* @@ -1474,9 +1477,9 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) b = d = 0; /* gcc */ lowa = MAX(1, cvp->a - diff_context); - upb = MIN(len[0], context_vec_ptr->b + diff_context); + upb = MIN((int)len[0], context_vec_ptr->b + diff_context); lowc = MAX(1, cvp->c - diff_context); - upd = MIN(len[1], context_vec_ptr->d + diff_context); + upd = MIN((int)len[1], context_vec_ptr->d + diff_context); printf("***************"); if (flags & (D_PROTOTYPE | D_MATCHLAST)) { @@ -1577,9 +1580,9 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags) b = d = 0; /* gcc */ lowa = MAX(1, cvp->a - diff_context); - upb = MIN(len[0], context_vec_ptr->b + diff_context); + upb = MIN((int)len[0], context_vec_ptr->b + diff_context); lowc = MAX(1, cvp->c - diff_context); - upd = MIN(len[1], context_vec_ptr->d + diff_context); + upd = MIN((int)len[1], context_vec_ptr->d + diff_context); printf("@@ -"); uni_range(lowa, upb); From nobody Thu Aug 1 16:16:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYxz6wkYz5T0fS; Thu, 01 Aug 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYxz3Cg8z4gYM; Thu, 1 Aug 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=edN+VRywm4BO+TK2TUXv4BUfERDaN2p3JWHoOHVg2Jo=; b=dyrTp+HQVuo8B6d75AUNBw3aXG69vjUEgm79SnpMeQsydyLK7cSa+NB/w9XvxXgL7fcBn1 rQMiAyMZvJhc6SoF2bEJLeaDX9ZerfDsOagZqlLwbKcDg6owstRcD0ijOQY1kYDqrq0PW8 nIGU9PIXPrbtplMGWL7feJtLhc8QwhjTMPgJYrXsfOuFPyOfUoyanISd+xB1fzdhPVjOi9 s0l9W24m9SM4mRkx04bzOugz3+yOamsOM1zRwYEWCCHK0v7VXFVhGXndaCNu59czlGFA/W s7Gqi5vppUSOeA8WdpZW5B4k3CvsK7ZE2fBs32JB2x0l9lHskkMZmaEyR7cB5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529015; a=rsa-sha256; cv=none; b=UNwORUU6W7P8uOKE/hzld+PHXYwmqTn83SXaKopMIlr0ibhAGMWG2ULECan7x7KOPkqh+W RxjkbbsQwL9IN0dUrbbqOTr7mQdexYOi7U1jdb7L+24TclBPXSlHy9CHlU+z4WaD+C3q6f bOO46dGoHVk1Eilmcpbz8ATpHptrqkkU8qQUg0LW02r9e5L4Z+5Kbwvat+upSTDV2yUPRP oVgnDrBIuT3OKzTlwWm8UIXS/cEk8zRBz8LveWlB6iwfqnOrDvKLfoSPx2VgMHoY57XEQs D6mSHzzgLUripN05PJHw36ryk/+6j3+pJiuHPafG8kIULlEUTcEVadHNlesn/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=edN+VRywm4BO+TK2TUXv4BUfERDaN2p3JWHoOHVg2Jo=; b=Ge7TKA1nIqJxxG+iZV0myM5pGXK/hzqyLFpVXwfWXdcr4Qr6/XVnxYkw9P0l9yHlFwHOBu mcOhB/ypJCjEQKMCMsoI3fO+A7gKR2r3KssBfkrcT9RwLDvbJJ47px+foZ+KNItijXvELC VHKwQpIaZ7XsAjV/QHDiccIpFdwGYTOB/TxMq1cw8Ly7R9oUgMK7Bt8r145xyDynkKQBQ+ a14GLO0xOh5w2z5rHNjZy5MCK5R0/j+J/wcUXGrIHUCLP8nOhiXZBDCvOUIeO8tY9Ez6pZ I6QwfsgiUS2cpeJ7sfti2FxG8OMX5Ez5QSBeFQBCUxy5yj5qDK1I0VpXamVdGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYxz1fWvzrpw; Thu, 1 Aug 2024 16:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471GGtCD095922; Thu, 1 Aug 2024 16:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGtPs095919; Thu, 1 Aug 2024 16:16:55 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:55 GMT Message-Id: <202408011616.471GGtPs095919@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: 91b21801e817 - stable/14 - ifnet(9): Remove mention of defunct ifaddr_byindex(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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 91b21801e817a1de85cf98a931e01e45b5e0a22b Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=91b21801e817a1de85cf98a931e01e45b5e0a22b commit 91b21801e817a1de85cf98a931e01e45b5e0a22b Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:33 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:57 +0000 ifnet(9): Remove mention of defunct ifaddr_byindex(9). Fixes: 964b8f8b993d MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46174 (cherry picked from commit 9f080f17a6a740ce9c1fa45862fb689263908c90) --- ObsoleteFiles.inc | 3 +++ share/man/man9/Makefile | 1 - share/man/man9/ifnet.9 | 12 +----------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index b99bd4f890e5..4ae15082cdfd 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240801: retire ifaddr_byindex +OLD_FILES+=usr/share/man/man9/ifaddr_byindex.9.gz + # 20240509: Remove remnants of portsnap(8) OLD_DIRS+=var/db/portsnap diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index eff555170276..c2e145eaeb08 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1334,7 +1334,6 @@ MLINKS+=ifnet.9 if_addmulti.9 \ ifnet.9 ifa_ifwithnet.9 \ ifnet.9 ifa_ref.9 \ ifnet.9 ifaddr.9 \ - ifnet.9 ifaddr_byindex.9 \ ifnet.9 ifaof_ifpforaddr.9 \ ifnet.9 ifioctl.9 \ ifnet.9 ifpromisc.9 \ diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9 index b835c51c546f..41cbfd8dad42 100644 --- a/share/man/man9/ifnet.9 +++ b/share/man/man9/ifnet.9 @@ -75,8 +75,6 @@ .\" .Ss "Interface Address Functions" .Ft "struct ifaddr *" -.Fn ifaddr_byindex "u_short idx" -.Ft "struct ifaddr *" .Fn ifa_ifwithaddr "struct sockaddr *addr" .Ft "struct ifaddr *" .Fn ifa_ifwithdstaddr "struct sockaddr *addr" "int fib" @@ -196,8 +194,6 @@ address .Xr link_addr 3 ) describing the link layer implemented by the interface (if any) is accessed by the -.Fn ifaddr_byindex -function or .Va if_addr structure. (Some trivial interfaces do not provide any link layer addresses; @@ -1183,9 +1179,7 @@ structure to be the first element in that list. (A pointer to this address structure is saved in the .Vt ifnet -structure and is accessed by the -.Fn ifaddr_byindex -function.) +structure.) The .Fa ifp must have been allocated by @@ -1502,10 +1496,6 @@ precisely .Fa addr will be returned. .Pp -.Fn ifaddr_byindex -returns the link-level address of the interface with the given index -.Fa idx . -.Pp All of these functions return a null pointer if no such address can be found. .Ss "Interface Multicast Address Functions" From nobody Thu Aug 1 16:16:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZYy06Nvkz5T0Yq; Thu, 01 Aug 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZYy0375mz4gbt; Thu, 1 Aug 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1gS7VD8toQ2nXJey5pLT0os98h09z3BY54yhITRmVQ=; b=tQVVrz4BngPh3NgGTLP6qsxaSMKAtw1Y9R3Om8HkmDkmO2af5xPR2+YxdbvIkcgv8wtg4C k0MJoQVGCQLHC8NSxIJYS7pxbEn3g9tYPdzit+8Z7aMZwmQjOvoWXj0jxMOs0//7Px5rCC SOpN+aU4YQqdksBVNzJFZW0dIIvPo3PD+OkWcJbUjgLmjmT8ErW+u8jJOzx/CCp/QbuWKn SYkcEIwvuPJOqDa5CWpBKWnvcXlKXmug47OS4BIWUOFSJMFqsYk4EEEEsl3B1n3YHbaKEX NCV5yhpPbBlfyBkU2PYoC+mq/hxlK+ro88qRUKFXgod+RyM1VuSZIUS+47Piug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722529016; a=rsa-sha256; cv=none; b=y4wHj+zyXvmgZXWoxo0DnivYsUbfqbWJ7VCnMeqKdKizG6f7w99GXfj6eFCv9ZOo9r/dyk vXMgltq9Nak5re9alNVS/If7tJZq5FbESDvW09n8ikfjYIJDGQDl5XXUo5yj5VTaCG4fcY qD1MNonPmab1UxHtTNxoSQ9MtldEhiMlZkveKWkDex5Lo6dr1i5IR3/310Rb2AkkSjGrLg nYVp2RuRZ5cK2GZTgWLdv0zhZLuJhVGIgQXCJtZcizzKeLFq82fdC1V2ylQLTN0fVFcg6x 8ITqnDCdHxReFK7CIeHvNe72ImtjwKBWyU/H/fcEPdBBdIOxP8RQqYxqYtlTwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722529016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O1gS7VD8toQ2nXJey5pLT0os98h09z3BY54yhITRmVQ=; b=NR9n9H660t0MeMruHpG7dYwtGY9J5ki13gYxBYjXDlpPSR2WSiGl/GNGINHKXChKeSeHVV tKBXNa7AZ6TNndkozs/WDv86JGCN3U0hYseQZg4SBbzru5dMC0uYBN7jTY3Mh2YimH1GyC E8Q70nxxw6xskEps8WJe5zr9PzxWBL+kZP14/Y5JYX32SiUMSPV6YRJgHoiJWGQoOU9oaj /eTW0hd0c5EpRKbPs//ldsRnxvEy37qRiZSJS97z5/llko32xnWniZ7hDqzpFIKHSs7b32 4v+cDudSXxdWMCsr80gWx+anqGXfQ/IjzISDQmiax6/xOAP0hkhRt9c2AAgqlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZYy02dZ3zrs4; Thu, 1 Aug 2024 16:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471GGu9A095983; Thu, 1 Aug 2024 16:16:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GGuhE095980; Thu, 1 Aug 2024 16:16:56 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:16:56 GMT Message-Id: <202408011616.471GGuhE095980@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: 2495f56913fb - stable/14 - filemon: Document how to build into the kernel. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 2495f56913fb90d48f7f1bf3d2617f260c977844 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=2495f56913fb90d48f7f1bf3d2617f260c977844 commit 2495f56913fb90d48f7f1bf3d2617f260c977844 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-30 19:04:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:15:58 +0000 filemon: Document how to build into the kernel. MFC after: 3 days Reviewed by: olce, imp Differential Revision: https://reviews.freebsd.org/D46184 (cherry picked from commit 057453ffdf57bdfcbadb5d1834d425812e01ff43) filemon: Not an option. MFC after: 3 days (cherry picked from commit b4e4512d4669267fb220b7c1a2844c506673a3ce) --- share/man/man4/filemon.4 | 4 +++- sys/conf/NOTES | 3 +++ sys/conf/options | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/man/man4/filemon.4 b/share/man/man4/filemon.4 index 2561e1e89bf5..b6755494e432 100644 --- a/share/man/man4/filemon.4 +++ b/share/man/man4/filemon.4 @@ -29,13 +29,15 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 1, 2023 +.Dd July 30, 2024 .Dt FILEMON 4 .Os .Sh NAME .Nm filemon .Nd the filemon device .Sh SYNOPSIS +.Cd device filemon +.Pp .In dev/filemon/filemon.h .Sh DESCRIPTION The diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 2011f8edcc74..20465d9aaf32 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2859,3 +2859,6 @@ device xz # xz_embedded LZMA de-compression library # Kernel support for stats(3). options STATS + +# File system monitoring +device filemon # file monitoring for make(1) meta-mode diff --git a/sys/conf/options b/sys/conf/options index 37f09dc7ff3b..1d156ca41a49 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -105,7 +105,6 @@ CY_PCI_FASTINTR DEADLKRES opt_watchdog.h EXPERIMENTAL opt_global.h DIRECTIO -FILEMON opt_dontuse.h FFCLOCK FULL_PREEMPTION opt_sched.h GZIO opt_gzio.h From nobody Thu Aug 1 16:46:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcX564Rz5T32F; Thu, 01 Aug 2024 16:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcX48r0z4nJc; Thu, 1 Aug 2024 16:46:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530812; h=from:from:reply-to:subject:subject: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+/vAr0wWjpFHUSQtqipWFB4FQXreiZolpZdB+LsHvM=; b=gA2RZRIfFpjj4/gnM0jRmlZMcPnSlAMOZPh6/F12RleQHArlFbIXQRwODKQQHAUdcLoroH rmE0IbuqNTyOW71vHOm7dogUhctZcAQHGEjNIvGsLndaMm8S0UzSdCZx24c3O2Tn5kYKiO nqXV6/NuRVqh87Z5vPu2aQgdK9aYy0b+rE6+4vNz/Bcqgif/MqXhrdDsKC1l0TiOlg0/LN H5jj1MYLV5hj1yCY/lifwJyy0i6FobRrd+mmAI7XkDsIsJbwKNGGBJsTg5ylOBjGq5nIoS afzRK5VStTALaZBPtX4NnHmqwDPzfKfb+bEgxZauz27K2UzjWPmX92YsgwE/ww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530812; a=rsa-sha256; cv=none; b=Ae4I2QvKMH1g7IymhZzjFqoGkMw2wWzGQbEZWIu61Gj0fy3UUVDa2tpmizcC2lWCNZi9xW WqwrBDRMOAaqOjDIIojI3qjn27dbL9fnnxkCr+To1cHaFRyQ82mOmc2bOit+4lAJv7Fq2h aSBx5gv8zPdNCkNo541muWN5hMfgH7f7y3tSiOSOhUkcUOiDIMwewTmNYirB7y2dkwpDuq nmp0OFNZjVNrEPXkhkQdHSYQfA0M8yeAM2g/HXPYSACFxckz57yCc6L65OFbbLTqTpiqbY sAwcOV6gtRjObXyUbCIKluwOeSM50flQhGSDnYXMGGS6jty4Vu5COYd+of2mBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530812; h=from:from:reply-to:subject:subject: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+/vAr0wWjpFHUSQtqipWFB4FQXreiZolpZdB+LsHvM=; b=Q2E78QRuOHNd49RdzVkeV9y4v6L3iFw9fM8oRMW51hbu8Id9Rf+aAYoLQFOpnsUaESWoSn UuTIzuUCteRfv7gOJDO7v+meS5KZE/D/NUb8v8yEYvGuuPk11CjGiMO7DUGLnr6NTV5xBt WfpwxQGuIF6oWpKiLLtT3v1IvY0rERm9Gm36PhMuTVtto/T1+NVOuOaNutZdZrYHdjXZQ1 gDfCbF5UrCVyqqm7TvwD+5Dq+z3ZLO3dfe0uJsvOOcK6pl2A/r806Wt0Nacu0hBhUoCy/8 wl8RAXFEvkmTYUXBHsHdjXHXn4wNMuD8gdkjkHYImYRnkzqF/ZsY0H5I+vicCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcX3f5SzsSn; Thu, 1 Aug 2024 16:46: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 471GkqL9046463; Thu, 1 Aug 2024 16:46:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GkqPB046460; Thu, 1 Aug 2024 16:46:52 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:52 GMT Message-Id: <202408011646.471GkqPB046460@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: 600504767528 - stable/13 - ls: Make -, apply to -s as well as -l. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 600504767528cce6b0e4f9eb44e9d4cec856abc8 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=600504767528cce6b0e4f9eb44e9d4cec856abc8 commit 600504767528cce6b0e4f9eb44e9d4cec856abc8 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:42:33 +0000 ls: Make -, apply to -s as well as -l. While here, remove a bogus comment about a gcc bug. The bug was in ls, which used an incorrect format string, and in libc, which accepted it. MFC after: 1 week Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D46067 (cherry picked from commit 647d4a8cafd2c9b291cab388191bc7fcfe12a66b) --- bin/ls/ls.1 | 4 +++- bin/ls/ls.c | 3 ++- bin/ls/print.c | 14 ++++++-------- bin/ls/tests/ls_tests.sh | 16 ++++++++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index e8b9835e6038..ccb9087dd764 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -31,7 +31,7 @@ .\" .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" -.Dd October 31, 2022 +.Dd July 22, 2024 .Dt LS 1 .Os .Sh NAME @@ -439,6 +439,8 @@ output is not to a terminal. .It Fl , (Comma) When the .Fl l +or +.Fl s option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned by .Xr localeconv 3 , diff --git a/bin/ls/ls.c b/bin/ls/ls.c index a04e455e8b06..6338e8c19581 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -968,7 +968,8 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); + d.s_block = snprintf(NULL, 0, f_thousands ? "%'ld" : "%ld", + howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; diff --git a/bin/ls/print.c b/bin/ls/print.c index 3d6feff1fdb7..e67596c198ba 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -227,7 +227,7 @@ printlong(const DISPLAY *dp) (void)printf("%*ju ", dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) - (void)printf("%*jd ", + (void)printf(f_thousands ? "%'*jd " : "%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); strmode(sp->st_mode, buf); aclmode(buf, p); @@ -404,7 +404,7 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield) chcnt += printf("%*ju ", (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) - chcnt += printf("%*jd ", + chcnt += printf(f_thousands ? "%'*jd " : "%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); #ifdef COLORLS if (f_color) @@ -757,12 +757,10 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); - } else if (f_thousands) { /* with commas */ - /* This format assignment needed to work round gcc bug. */ - const char *format = "%*j'd "; - (void)printf(format, (u_int)width, bytes); - } else - (void)printf("%*jd ", (u_int)width, bytes); + } else { + (void)printf(f_thousands ? "%'*jd " : "%*jd ", + (u_int)width, bytes); + } } /* diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index 682682691b7a..780376b9de3c 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -799,6 +799,21 @@ s_flag_body() done } +atf_test_case scomma_flag +scomma_flag_head() +{ + atf_set "descr" "Verify that -s, prints out the size with ',' delimiters" +} + +scomma_flag_body() +{ + export LC_ALL=en_US.UTF-8 + atf_check -e ignore dd if=/dev/urandom of=file bs=65536 count=64 + blocks=$(stat -f "%b" file) + cblocks=$(printf "%'d" $blocks) + atf_check -e empty -o match:"$cblocks[[:space:]]+file" ls -s, file +} + atf_test_case t_flag t_flag_head() { @@ -971,6 +986,7 @@ atf_init_test_cases() atf_add_test_case q_flag_and_w_flag atf_add_test_case r_flag atf_add_test_case s_flag + atf_add_test_case scomma_flag atf_add_test_case t_flag atf_add_test_case u_flag atf_add_test_case v_flag From nobody Thu Aug 1 16:46:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcY690jz5T32J; Thu, 01 Aug 2024 16:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcY54h4z4mlZ; Thu, 1 Aug 2024 16:46:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02f/17IhFAxoxDiz+/DnJ3ykvOggx4A6+nZicqaWZAc=; b=PKzGfAMrCzdfNNxCY73pYSNO9GLSFJZ7ibtkFaVTFJVE6SHb99GhXSlu50yOueKN4pCIv/ cH9MihAL+S1GN1in7NKjCA/kS+o30XDQMHw6qW+0LHnAj8KptDl1cY2brT1pZqyuYBhOGs 8QgtvoLm8GWd0ioRTJjAAvaX0eO6rcBGSjqpkPk3EAYYemH1UoQVmr0/sgatHJmgbNaOns DMJ95Ewdfu1jn+dySwRtSeuqehKtt9TBujschRhO3+RL5n7mXjNaZKtzlXtO4/7c8+yJcx XBj4wETDDBzTFXsa+2eSfxLnxJ49SuxscNzQm9fS8OlkmS1HvGEs0oFJKxTniQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530813; a=rsa-sha256; cv=none; b=fzil5S4vSnoLRbZqxnHJqsXVFZYPzCWNxvz5bV5f17EAxfRlthZ9IUcZyQFTtegd+sWsNt IYpzhJQlXyEHftCuAGsH1DAOSvGIII2BEtSMBaBInMFeF3jUYDqrMgJB0Nc4eLick08bgX VNzd6jNv8v5TqEtiGA6TjdaaHKYTYneKe4WaFQC2AFxYZ9CVSt3wRUTvCC1ZtWtoDBYsFX D4nfun5Cf3OPeTZlgxzusJZeiNG/Pg5DHJf2WsehxeSNeEiaY2aPU3RrkOHBcLJrdIDcnU Cq+Tf+WJbWPt/O00JCGDWNFpuewhP9L9DLmP9hrLJmG3c8/HqvEiGlqYtdObUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=02f/17IhFAxoxDiz+/DnJ3ykvOggx4A6+nZicqaWZAc=; b=WudgGcJMzfk0etramTKWPmHEGHRVFHTLFL+yVNMoerZgq4jW2Bpxl/H4HtrJnkFk7Y5Csx 22t1qgmKMeEud8HmdSMj9NjqICdpS3RPel8PInzUDa4jX+hyJIgLPkiyEL3ycG4q0QqxvM poW0PaodvvN3rTYi5oxONUMHRGp07EtorAM2vqCROXCx5vf9goB9jEhNTbfyNI+iuKe/d2 h7D+VNIcXi4KnSzUaD3+9rVGx2GsyVKsbWK3nwV1a2kIGSZk4l+oeR/FX3ENYihY52pWho hHvCHPGYWwtkuihqgCq5Yfd+5fAlhkP+sJiRxtaUdulpexKJKtKkGu38UFkWhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcY4PtjzsFN; Thu, 1 Aug 2024 16:46: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 471GkrKc046514; Thu, 1 Aug 2024 16:46:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Gkrwp046511; Thu, 1 Aug 2024 16:46:53 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:53 GMT Message-Id: <202408011646.471Gkrwp046511@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: b7834095749d - stable/13 - pax: Clear arcn in each read function. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: b7834095749d56d7d35871918ed371f133fcb624 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=b7834095749d56d7d35871918ed371f133fcb624 commit b7834095749d56d7d35871918ed371f133fcb624 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:42:34 +0000 pax: Clear arcn in each read function. Instead of initializing individual fields to zero, clear the entire struct prior to populating it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46097 (cherry picked from commit f890020d43bf2070f12ffec37bcd9579f6fb1347) --- bin/pax/cpio.c | 12 +++--------- bin/pax/tar.c | 20 ++------------------ 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 76edca3c6f91..0b5b95bb5ef5 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -280,13 +280,13 @@ cpio_rd(ARCHD *arcn, char *buf) */ if (cpio_id(buf, sizeof(HD_CPIO)) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); hd = (HD_CPIO *)buf; /* * byte oriented cpio (posix) does not have padding! extract the octal * ascii fields from the header */ - arcn->pad = 0L; arcn->sb.st_dev = (dev_t)asc_ul(hd->c_dev, sizeof(hd->c_dev), OCT); arcn->sb.st_ino = (ino_t)asc_ul(hd->c_ino, sizeof(hd->c_ino), OCT); arcn->sb.st_mode = (mode_t)asc_ul(hd->c_mode, sizeof(hd->c_mode), OCT); @@ -315,8 +315,6 @@ cpio_rd(ARCHD *arcn, char *buf) /* * no link name to read for this file */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; return(com_rd(arcn)); } @@ -561,8 +559,8 @@ vcpio_rd(ARCHD *arcn, char *buf) return(-1); } + memset(arcn, 0, sizeof *arcn); hd = (HD_VCPIO *)buf; - arcn->pad = 0L; /* * extract the hex ascii fields from the header @@ -609,8 +607,6 @@ vcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = VCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } @@ -857,7 +853,7 @@ bcpio_rd(ARCHD *arcn, char *buf) if (bcpio_id(buf, sizeof(HD_BCPIO)) < 0) return(-1); - arcn->pad = 0L; + memset(arcn, 0, sizeof *arcn); hd = (HD_BCPIO *)buf; if (swp_head) { /* @@ -919,8 +915,6 @@ bcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = BCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } diff --git a/bin/pax/tar.c b/bin/pax/tar.c index cbe2dbab64f8..785dd32c4838 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -373,9 +373,9 @@ tar_rd(ARCHD *arcn, char *buf) */ if (tar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; /* * copy out the name and values in the stat buffer @@ -402,8 +402,6 @@ tar_rd(ARCHD *arcn, char *buf) * to encode this as a directory */ pt = &(arcn->name[arcn->nlen - 1]); - arcn->pad = 0; - arcn->skip = 0; switch(hd->linkflag) { case SYMTYPE: /* @@ -440,8 +438,6 @@ tar_rd(ARCHD *arcn, char *buf) arcn->type = PAX_DIR; arcn->sb.st_mode |= S_IFDIR; arcn->sb.st_nlink = 2; - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; break; case AREGTYPE: case REGTYPE: @@ -449,8 +445,6 @@ tar_rd(ARCHD *arcn, char *buf) /* * If we have a trailing / this is a directory and NOT a file. */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; if (*pt == '/') { /* * it is a directory, set the mode for -v printing @@ -727,10 +721,9 @@ ustar_rd(ARCHD *arcn, char *buf) */ if (ustar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; - arcn->nlen = 0; hd = (HD_USTAR *)buf; /* @@ -777,15 +770,6 @@ ustar_rd(ARCHD *arcn, char *buf) if (uid_name(hd->uname, &(arcn->sb.st_uid)) < 0) arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT); - /* - * set the defaults, these may be changed depending on the file type - */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; - arcn->pad = 0; - arcn->skip = 0; - arcn->sb.st_rdev = (dev_t)0; - /* * set the mode and PAX type according to the typeflag in the header */ From nobody Thu Aug 1 16:46:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcb11vsz5T2ph; Thu, 01 Aug 2024 16:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcZ5s5jz4nB0; Thu, 1 Aug 2024 16:46:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6vAWTzOtJ/4H/I0MpqcSShSJsGWtRRS2dymQJDgWpS0=; b=Nk5Sw2ArGw3GLcqp74slB80NiOpzD2A7tE8I2WI4rPUJYubeXGQCY+ZLt8/Q09PVd/pOrv wJ72RYLANTcRvubvoueH9c9mu575eX8gK6EdQUn42X/hzwrZtSnIKsu55/kZoUkjOVl703 OByRrkces4opd/nrBviUgSNpNG9jPL0qdrQWfhqwq8C/s34detNxOW3KoypNBMqjdFRbzR BO25xYHrHWZcW8MNQ/Z00A/dubyy8ysYaakwLUXeL6WmsWVLZODU3vG9T7BOgAXK6E1OuC sOkvu3fvu6+8fU4NfsSv3/QJtk34RbtiyQQTal7cQ/NFfNTLGUZroLM25yxSHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530814; a=rsa-sha256; cv=none; b=vRHpDw5opqluxrJr/tVlGzakviKtLd1DjK0sPpV6zDVXrKbefiLAkC8+WcZ1iWXo/ZNep+ Oe0F/Q0ljnKkZBfwEzFk/uaOeyHsqD/1CpJA1SBmm/+ZdmhsXdQjQxN3sm/BLuZ1e+Ydot 1OpjgEKD2lodsNYF3y7vORM5ok8DW08cuUInN5SvY3rhIFR8QbYiBNLsr+l8rPOwUlvjWC YJ4m0T59D0xKxsNGsEjUkbtf0MFdKNAX8ohy8eKu/QZ9oTL31583EKhpgnhzRK9x7dZDTt 7hv3UQqgr3s7SyJeCDb1Q8hGpfc19h/S1pgxUw7QVVN2Ugqymq86pq4jyT0XcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6vAWTzOtJ/4H/I0MpqcSShSJsGWtRRS2dymQJDgWpS0=; b=bknKrObx/RdDAQ9UHntW1yC3pDQ3ykRhxww1TDobYnCkQ012AL39e7U2Vlt3ARtzlXEm9m OfIFc1ra4q6+UX/dKM3EtOoRLWuq+r5rpEcyQYhTkICuLSTcC23ww5948OK1asD/p29QTW I93mLxRcepbwR5lAhW50Pji9OXl0TLc1o23sxfvRf2Ks8AN1+oGSeccMMJFh6eYDZ4JXwh MdWL+L9bjpgpgjsiqX9I3H+Ef2B2V0VWO0wXNeLnVzj/kYqjgHQ3p+It8e7WVC8JpO82KV JJPyhwoccq9yJx+Szbf4ypYdHv9vbPia2Qcsh9b5xKyPGJhPmNiwio09wuTJkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcZ5R6czsps; Thu, 1 Aug 2024 16:46: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 471Gksw2046562; Thu, 1 Aug 2024 16:46:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GksoO046559; Thu, 1 Aug 2024 16:46:54 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:54 GMT Message-Id: <202408011646.471GksoO046559@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: ae8b85ac1125 - stable/13 - diff: Fix usage message and documentation. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: ae8b85ac11257f1166dfe25c354bf0d4bd64b98d Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ae8b85ac11257f1166dfe25c354bf0d4bd64b98d commit ae8b85ac11257f1166dfe25c354bf0d4bd64b98d Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:21 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:43:02 +0000 diff: Fix usage message and documentation. The `--ignore-all-space` option was incorrectly documented as `--ignore-all-blanks` in some (but not all) places. MFC after: 3 days PR: 280434 Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46160 (cherry picked from commit ab830de9f58c1b257e42b4fbdd46b3ca6a837ee6) --- usr.bin/diff/diff.1 | 6 +++--- usr.bin/diff/diff.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index 19c4fa0579f3..c75e2ec95de0 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -29,7 +29,7 @@ .\" .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" -.Dd June 19, 2020 +.Dd July 26, 2024 .Dt DIFF 1 .Os .Sh NAME @@ -184,7 +184,7 @@ .Nm diff .Op Fl aBbditwW .Op Fl -expand-tabs -.Op Fl -ignore-all-blanks +.Op Fl -ignore-all-space .Op Fl -ignore-blank-lines .Op Fl -ignore-case .Op Fl -minimal @@ -380,7 +380,7 @@ output adds character(s) to the front of each line which may screw up the indentation of the original source lines and make the output listing difficult to interpret. This option will preserve the original source's indentation. -.It Fl w -ignore-all-blanks +.It Fl w -ignore-all-space Is similar to .Fl b -ignore-space-change but causes whitespace (blanks and tabs) to be totally ignored. diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index a5128944674b..71f0ac94c7ab 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -532,7 +532,7 @@ usage(void) " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" " [-S name] [-X file] [-x pattern] dir1 dir2\n" - " diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n" + " diff [-aBbditwW] [--expand-tabs] [--ignore-all-space]\n" " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" " [--suppress-common-lines] [--tabsize] [--text] [--width]\n" From nobody Thu Aug 1 16:46:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcc2rmGz5T2pk; Thu, 01 Aug 2024 16:46:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcb6nTcz4n7c; Thu, 1 Aug 2024 16:46:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XQrfM/hoT8fBy7MwgXsM1202z82jDcrsr6nLTLDlMtg=; b=xfFubXf8AtXHMRt4QnMcq+iz/wNMwb48UB6EZYjC5F8W3VKYambm73mRvSPgL+urldM3wQ xkJAlTvQA3fHYie27kGYaaK5BlTKMKrLD6lkyKYY2e3/gEv/w43Nnb0ajJ3AGv0b0D6A7y aBshqxg8/c8PZ8Ncf/h32VRXhKc+DhdNC+gqQaYM6w+Dx7rRQezIADSvr7qHHgA2DCcVLX q3/dzT1ge/JdRS+YgTnY9DdhYCepe6Z/H8Tec8TnbOqnY+4waRMHsiq7Jpbi0lyu/bKY6O kBeNlIkeYYHUOAQcj0hLvnWG1VCA1eALU9SiphaE52rnk8yrc/KWx+16JRcUtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530816; a=rsa-sha256; cv=none; b=L52ulct4KjNv7eTnmRGlYkHCMmFL7wP5pehq7m4P9t5V1CWBOyDgiWwNoLQiYnQBe77B3i 0jomJVWezUr/q1nI34HuepWC26iWu1BoOjASJFQUK08hdRn80d89nYa/NGihQqQr4geSB8 WVJbqbhcZFXJmjeoKQLUX0ho64C+LETzbxqE2ow/KAZRkq7PPhstzXyxJ1SsLW2nPOQqq7 lWwunm3nRuUKpZjruDLUdZCib376kbw+tLJ/a78OD4yfdBzIRJEedPXD61VSq33xSacDvw ZCoHmcUr/Clvy+JoDLrCmPlkARhBUVFeFPhLxy40MgbkLLWxWixQ2QpNW9iVJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XQrfM/hoT8fBy7MwgXsM1202z82jDcrsr6nLTLDlMtg=; b=XYJ0dIyISLKSLDIId1HT3zuRjFFy4ND7Iss/qk2h23ad26ZaXJGKqmiTxIUGwy15uhamEz spQ7F5FE1OqNyePIjJ3U6HqhF8B8fp7TaXBV6GU5imb4le6m0ORMAumM5Masxre8FvQwbb LcvULKU5tcNg/h5PpkKzVZZMZaiU1Kjx1Lt0uUSBDJZNkikffgQEpRyT0qmQqZMBOGGwD8 hhlRYJyzX8K57j7ITLDWazCICFKrDZisfim6MSghtgkDyl51k60jRmKLki9RAmfrMldxgx OpJTKwyV5pgvFoXlQUNq0R040liw5MNDSHN/ejY837BeGRiteOei4YE8f+pFMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcb6Q2BzsSp; Thu, 1 Aug 2024 16:46: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 471GktWj046607; Thu, 1 Aug 2024 16:46:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471GktLi046604; Thu, 1 Aug 2024 16:46:55 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:55 GMT Message-Id: <202408011646.471GktLi046604@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: 9c2b6778b2f1 - stable/13 - sdiff: Misc cleanup. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 9c2b6778b2f1f7e7355846ce28c80a88ae462cb4 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=9c2b6778b2f1f7e7355846ce28c80a88ae462cb4 commit 9c2b6778b2f1f7e7355846ce28c80a88ae462cb4 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 17:39:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:43:03 +0000 sdiff: Misc cleanup. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43943 (cherry picked from commit 3cc86989bfbe27c91b5db592c2af33fef153e230) --- usr.bin/sdiff/sdiff.c | 102 +++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index b863d5875db6..3dcf18caed0c 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -19,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -69,11 +69,11 @@ static STAILQ_HEAD(, diffline) diffhead = STAILQ_HEAD_INITIALIZER(diffhead); static size_t line_width; /* width of a line (two columns and divider) */ static size_t width; /* width of each column */ static size_t file1ln, file2ln; /* line number of file1 and file2 */ -static int Iflag = 0; /* ignore sets matching regexp */ -static int lflag; /* print only left column for identical lines */ -static int sflag; /* skip identical lines */ -FILE *outfp; /* file to save changes to */ -const char *tmpdir; /* TMPDIR or /tmp */ +static bool Iflag; /* ignore sets matching regexp */ +static bool lflag; /* print only left column for identical lines */ +static bool sflag; /* skip identical lines */ +FILE *outfp; /* file to save changes to */ +const char *tmpdir; /* TMPDIR or /tmp */ enum { HELP_OPT = CHAR_MAX + 1, @@ -206,14 +206,13 @@ FAIL: int main(int argc, char **argv) { - FILE *diffpipe=NULL, *file1, *file2; - size_t diffargc = 0, wflag = WIDTH; - int ch, fd[2] = {-1}, status; - pid_t pid=0; - const char *outfile = NULL; - char **diffargv, *diffprog = diff_path, *filename1, *filename2, - *tmp1, *tmp2, *s1, *s2; - int i; + FILE *diffpipe, *file1, *file2; + size_t diffargc = 0, flagc = 0, wval = WIDTH; + int ch, fd[2], i, status; + pid_t pid; + const char *errstr, *outfile = NULL; + char **diffargv, *diffprog = diff_path, *flagv; + char *filename1, *filename2, *tmp1, *tmp2, *s1, *s2; char I_arg[] = "-I"; char speed_lf[] = "--speed-large-files"; @@ -228,20 +227,21 @@ main(int argc, char **argv) * waste some memory; however we need an extra space for the * NULL at the end, so it sort of works out. */ - if (!(diffargv = calloc(argc, sizeof(char **) * 2))) - err(2, "main"); + if ((diffargv = calloc(argc, sizeof(char *) * 2)) == NULL) + err(2, NULL); /* Add first argument, the program name. */ diffargv[diffargc++] = diffprog; - /* create a dynamic string for merging single-switch options */ - if ( asprintf(&diffargv[diffargc++], "-") < 0 ) - err(2, "main"); + /* create a dynamic string for merging single-character options */ + if ((flagv = malloc(flagc + 2)) == NULL) + err(2, NULL); + flagv[flagc] = '-'; + flagv[flagc + 1] = '\0'; + diffargv[diffargc++] = flagv; while ((ch = getopt_long(argc, argv, "aBbdEHI:ilo:stWw:", longopts, NULL)) != -1) { - const char *errstr; - switch (ch) { /* only compatible --long-name-form with diff */ case FCASE_IGNORE_OPT: @@ -259,14 +259,13 @@ main(int argc, char **argv) case 'i': case 't': case 'W': - diffargv[1] = realloc(diffargv[1], sizeof(char) * strlen(diffargv[1]) + 2); + flagc++; + flagv = realloc(flagv, flagc + 2); /* * In diff, the 'W' option is 'w' and the 'w' is 'W'. */ - if (ch == 'W') - sprintf(diffargv[1], "%sw", diffargv[1]); - else - sprintf(diffargv[1], "%s%c", diffargv[1], ch); + flagv[flagc] = ch == 'W' ? 'w' : ch; + flagv[flagc + 1] = '\0'; break; case 'H': diffargv[diffargc++] = speed_lf; @@ -275,21 +274,21 @@ main(int argc, char **argv) diffargv[0] = diffprog = optarg; break; case 'I': - Iflag = 1; + Iflag = true; diffargv[diffargc++] = I_arg; diffargv[diffargc++] = optarg; break; case 'l': - lflag = 1; + lflag = true; break; case 'o': outfile = optarg; break; case 's': - sflag = 1; + sflag = true; break; case 'w': - wflag = strtonum(optarg, WIDTH_MIN, + wval = strtonum(optarg, WIDTH_MIN, INT_MAX, &errstr); if (errstr) errx(2, "width is %s: %s", errstr, optarg); @@ -305,13 +304,12 @@ main(int argc, char **argv) } } - /* no single switches were used */ - if (strcmp(diffargv[1], "-") == 0 ) { - for ( i = 1; i < argc-1; i++) { - diffargv[i] = diffargv[i+1]; - } - diffargv[diffargc-1] = NULL; + /* no single-character options were used */ + if (flagc == 0) { + memmove(diffargv + 1, diffargv + 2, + sizeof(char *) * (diffargc - 2)); diffargc--; + free(flagv); } argc -= optind; @@ -356,7 +354,7 @@ main(int argc, char **argv) diffargv[diffargc++] = NULL; /* Subtract column divider and divide by two. */ - width = (wflag - 3) / 2; + width = (wval - 3) / 2; /* Make sure line_width can fit in size_t. */ if (width > (SIZE_MAX - 3) / 2) errx(2, "width is too large: %zu", width); @@ -365,21 +363,18 @@ main(int argc, char **argv) if (pipe(fd)) err(2, "pipe"); - switch (pid = fork()) { - case 0: + if ((pid = fork()) < 0) + err(1, "fork()"); + if (pid == 0) { /* child */ /* We don't read from the pipe. */ close(fd[0]); - if (dup2(fd[1], STDOUT_FILENO) == -1) - err(2, "child could not duplicate descriptor"); + if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) + _exit(2); /* Free unused descriptor. */ close(fd[1]); execvp(diffprog, diffargv); - err(2, "could not execute diff: %s", diffprog); - break; - case -1: - err(2, "could not fork"); - break; + _exit(2); } /* parent */ @@ -453,6 +448,9 @@ main(int argc, char **argv) processq(); /* Return diff exit status. */ + free(diffargv); + if (flagc > 0) + free(flagv); return (WEXITSTATUS(status)); } @@ -552,7 +550,7 @@ prompt(const char *s1, const char *s2) const char *p; /* Skip leading whitespace. */ - for (p = cmd; isspace(*p); ++p) + for (p = cmd; isspace((unsigned char)*p); ++p) ; switch (*p) { case 'e': @@ -578,10 +576,10 @@ prompt(const char *s1, const char *s2) /* End of command parsing. */ break; case 's': - sflag = 1; + sflag = true; goto PROMPT; case 'v': - sflag = 0; + sflag = false; /* FALLTHROUGH */ default: /* Interactive usage help. */ @@ -702,7 +700,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) p = line; /* Go to character after line number. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; @@ -714,7 +712,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) if (c == ',') { q = p; /* Go to character after file2end. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; @@ -733,7 +731,7 @@ parsecmd(FILE *diffpipe, FILE *file1, FILE *file2) q = p; /* Go to character after line number. */ - while (isdigit(*p)) + while (isdigit((unsigned char)*p)) ++p; c = *p; *p++ = 0; From nobody Thu Aug 1 16:46:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcd5vRCz5T3Dc; Thu, 01 Aug 2024 16:46:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcd0nnYz4nGy; Thu, 1 Aug 2024 16:46:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fA4c8UaMAsp/+qjhBS0mKdb9bCLrrRCsnP+rZGunoQ=; b=LN7HAjeFOfOZo80d0gTG7kSbFmXb/kk9pIMcvGQOzwAQRZZhTgqObhD3JSa+Q2wMenXwgp VCoViqZQx8KlQU3fFr1LRpcJvQFAVbptvXJnrIEplRUHwwGFfODo41ogBOjpvcvfx+qANW X9h3gSnDtRzC0rlBPKAmnZ64MBqqEK546JON7ClD9sa5w5c0E6I7pP0thp8VT5MXIIGY0C zeoZvQlh8RS9TEGbJpxke8v6otmaAL6sfXC0UY9fCtcmbYRlYwUJzy6CuQdtwGsb8zRrSK ByMRyggishrHe12O8a/vKB5WsFFgLiog8XhorV3y8anad8kGOgA8oUvVhXPIvg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530817; a=rsa-sha256; cv=none; b=ZoSAGIP+YeycL+v1HpcSxQBEg98t/DEqsoT/LrshNAn5PmaPnmWOlQb8ljZ2pXzByC6Gcr Sc/SR8c5CeXruKVDa/4nRi/d+zGXv495LmT92Hn6iNTn0tBxm4nWmAOwKoJfUTbkfe8RGN jTMrGIE6p363vkUTpAMXINwwb52N+o+qEVOBEsvL50fc56NHvv1+VyMrFI7dw4kvPPEHwW GD/U89Ken7CR9wGI3aF0j5WKsW6IJ9TabEtQeWFFquZiVdLXdwlBoUutmS8j495mWLV30v pY+sY5vtLUDGyKkog3dz/nP5JlxLhVsJjmt4uecy54pGCwvySTfoLcgewwce6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0fA4c8UaMAsp/+qjhBS0mKdb9bCLrrRCsnP+rZGunoQ=; b=iNIgcfPaX2Nyz2qhmxFnlMd95oa2bK4s9QTlYegqp+fCnGl0RkXQt5cCAS/RatWbgDMx8D zc7Qd2or4Fy2Owino73UtHbd7fg4+agPpGDNAug2DjNcfpTq7iPX1Tc3sGTsyW6jJj4sLf ojZ2DJaRpPbOpb5mEYZBuGY7ocLT3qJGxvPtFKJ5iay0hLSxDcLoELfTkuC3cYZ5cpYN7V jsbwI5pLekuqdi8afdLtD3YqK/mY65XpO5WHe5FsLEqMlJztyFKsGP+ehOv3E6CCW23DiI DS7aeiTer+TXRrK7jrsxr5KchbVjTx/m6bT/n1nGUgNrjm+7Sj6VTB1QvRIPbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcd0Gt8zsSq; Thu, 1 Aug 2024 16:46: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 471GkuSo046654; Thu, 1 Aug 2024 16:46:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Gku6i046651; Thu, 1 Aug 2024 16:46:56 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:56 GMT Message-Id: <202408011646.471Gku6i046651@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: 174337b9eca0 - stable/13 - sdiff: Fix --expand-tabs and --tabsize. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 174337b9eca0d28b96f2749b44ff4e29d201c144 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=174337b9eca0d28b96f2749b44ff4e29d201c144 commit 174337b9eca0d28b96f2749b44ff4e29d201c144 Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 17:39:28 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:46:18 +0000 sdiff: Fix --expand-tabs and --tabsize. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43941 (cherry picked from commit a834edfccd14a8c0f152a3b0078469af8e05f3fd) sdiff: Fix binary case. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D43942 (cherry picked from commit ad7bef8b890768e68a48bbfa6b92ebf635068504) sdiff: Fix usage message. The `--ignore-all-space` option was incorrectly documented as `--ignore-all-spaces`. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46161 (cherry picked from commit ca75b7dac886de66fc06fd31facfa2c561f7567e) --- usr.bin/sdiff/sdiff.1 | 4 +- usr.bin/sdiff/sdiff.c | 134 ++++++++++++++++++++++---------------- usr.bin/sdiff/tests/sdiff_test.sh | 36 ++++++++++ 3 files changed, 116 insertions(+), 58 deletions(-) diff --git a/usr.bin/sdiff/sdiff.1 b/usr.bin/sdiff/sdiff.1 index ef9bb95a0990..ca6594c6479a 100644 --- a/usr.bin/sdiff/sdiff.1 +++ b/usr.bin/sdiff/sdiff.1 @@ -3,7 +3,7 @@ .\" Written by Raymond Lai . .\" Public domain. .\" -.Dd April 8, 2017 +.Dd February 16, 2024 .Dt SDIFF 1 .Os .Sh NAME @@ -117,8 +117,6 @@ Ignore all spaces. Ignore blank lines. .It Fl E -ignore-tab-expansion Treat tabs and eight spaces as the same. -.It Fl t -ignore-tabs -Ignore tabs. .It Fl H -speed-large-files Assume scattered small changes in a large file. .It Fl -ignore-file-name-case diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c index 3dcf18caed0c..daa0f43e0b0e 100644 --- a/usr.bin/sdiff/sdiff.c +++ b/usr.bin/sdiff/sdiff.c @@ -51,7 +51,7 @@ static void astrcat(char **, const char *); static void enqueue(char *, char, char *); static char *mktmpcpy(const char *); static int istextfile(FILE *); -static void binexec(char *, char *, char *) __dead2; +static int bindiff(FILE *, char *, FILE *, char *); static void freediff(struct diffline *); static void int_usage(void); static int parsecmd(FILE *, FILE *, FILE *); @@ -72,6 +72,8 @@ static size_t file1ln, file2ln; /* line number of file1 and file2 */ static bool Iflag; /* ignore sets matching regexp */ static bool lflag; /* print only left column for identical lines */ static bool sflag; /* skip identical lines */ +static bool tflag; /* expand tabs */ +static int tabsize = 8; /* tab size */ FILE *outfp; /* file to save changes to */ const char *tmpdir; /* TMPDIR or /tmp */ @@ -127,8 +129,8 @@ static const char *help_msg[] = { "\t-d, --minimal: minimize diff size.", "\t-I RE, --ignore-matching-lines=RE: ignore changes whose line matches RE.", "\t-i, --ignore-case: do a case-insensitive comparison.", - "\t-t, --expand-tabs: sxpand tabs to spaces.", - "\t-W, --ignore-all-spaces: ignore all spaces.", + "\t-t, --expand-tabs: expand tabs to spaces.", + "\t-W, --ignore-all-space: ignore all whitespace.", "\t--speed-large-files: assume large file with scattered changes.", "\t--strip-trailing-cr: strip trailing carriage return.", "\t--ignore-file-name-case: ignore case of file names.", @@ -208,7 +210,7 @@ main(int argc, char **argv) { FILE *diffpipe, *file1, *file2; size_t diffargc = 0, flagc = 0, wval = WIDTH; - int ch, fd[2], i, status; + int ch, fd[2], i, ret, status; pid_t pid; const char *errstr, *outfile = NULL; char **diffargv, *diffprog = diff_path, *flagv; @@ -247,7 +249,6 @@ main(int argc, char **argv) case FCASE_IGNORE_OPT: case FCASE_SENSITIVE_OPT: case STRIPCR_OPT: - case TSIZE_OPT: case 'S': break; /* combine no-arg single switches */ @@ -257,7 +258,6 @@ main(int argc, char **argv) case 'd': case 'E': case 'i': - case 't': case 'W': flagc++; flagv = realloc(flagv, flagc + 2); @@ -287,6 +287,9 @@ main(int argc, char **argv) case 's': sflag = true; break; + case 't': + tflag = true; + break; case 'w': wval = strtonum(optarg, WIDTH_MIN, INT_MAX, &errstr); @@ -298,6 +301,11 @@ main(int argc, char **argv) printf("%s\n", help_msg[i]); exit(0); break; + case TSIZE_OPT: + tabsize = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr) + errx(2, "tabsize is %s: %s", errstr, optarg); + break; default: usage(); break; @@ -348,6 +356,15 @@ main(int argc, char **argv) filename2 = tmp2; } + if ((file1 = fopen(filename1, "r")) == NULL) + err(2, "could not open %s", filename1); + if ((file2 = fopen(filename2, "r")) == NULL) + err(2, "could not open %s", filename2); + if (!istextfile(file1) || !istextfile(file2)) { + ret = bindiff(file1, filename1, file2, filename2); + goto done; + } + diffargv[diffargc++] = filename1; diffargv[diffargc++] = filename2; /* Add NULL to end of array to indicate end of array. */ @@ -385,26 +402,6 @@ main(int argc, char **argv) if ((diffpipe = fdopen(fd[0], "r")) == NULL) err(2, "could not open diff pipe"); - if ((file1 = fopen(filename1, "r")) == NULL) - err(2, "could not open %s", filename1); - if ((file2 = fopen(filename2, "r")) == NULL) - err(2, "could not open %s", filename2); - if (!istextfile(file1) || !istextfile(file2)) { - /* Close open files and pipe, delete temps */ - fclose(file1); - fclose(file2); - if (diffpipe != NULL) - fclose(diffpipe); - if (tmp1) - if (unlink(tmp1)) - warn("Error deleting %s.", tmp1); - if (tmp2) - if (unlink(tmp2)) - warn("Error deleting %s.", tmp2); - free(tmp1); - free(tmp2); - binexec(diffprog, filename1, filename2); - } /* Line numbers start at one. */ file1ln = file2ln = 1; @@ -416,20 +413,10 @@ main(int argc, char **argv) /* Wait for diff to exit. */ if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status) || WEXITSTATUS(status) >= 2) - err(2, "diff exited abnormally."); + errx(2, "diff exited abnormally"); + ret = WEXITSTATUS(status); - /* Delete and free unneeded temporary files. */ - if (tmp1) - if (unlink(tmp1)) - warn("Error deleting %s.", tmp1); - if (tmp2) - if (unlink(tmp2)) - warn("Error deleting %s.", tmp2); - free(tmp1); - free(tmp2); - filename1 = filename2 = tmp1 = tmp2 = NULL; - - /* No more diffs, so print common lines. */ + /* No more diffs, so enqueue common lines. */ if (lflag) while ((s1 = xfgets(file1))) enqueue(s1, ' ', NULL); @@ -447,26 +434,55 @@ main(int argc, char **argv) /* Process unmodified lines. */ processq(); +done: + /* Delete and free unneeded temporary files. */ + if (tmp1 != NULL) { + if (unlink(tmp1) != 0) + warn("failed to delete %s", tmp1); + free(tmp1); + } + if (tmp2 != NULL) { + if (unlink(tmp2) != 0) + warn("failed to delete %s", tmp2); + free(tmp2); + } + /* Return diff exit status. */ free(diffargv); if (flagc > 0) free(flagv); - return (WEXITSTATUS(status)); + return (ret); } /* - * When sdiff detects a binary file as input, executes them with - * diff to maintain the same behavior as GNU sdiff with binary input. + * When sdiff detects a binary file as input. */ -static void -binexec(char *diffprog, char *f1, char *f2) +static int +bindiff(FILE *f1, char *fn1, FILE *f2, char *fn2) { - - char *args[] = {diffprog, f1, f2, (char *) 0}; - execv(diffprog, args); - - /* If execv() fails, sdiff's execution will continue below. */ - errx(1, "could not execute diff process"); + int ch1, ch2; + + flockfile(f1); + flockfile(f2); + do { + ch1 = getc_unlocked(f1); + ch2 = getc_unlocked(f2); + } while (ch1 != EOF && ch2 != EOF && ch1 == ch2); + funlockfile(f2); + funlockfile(f1); + if (ferror(f1)) { + warn("%s", fn1); + return (2); + } + if (ferror(f2)) { + warn("%s", fn2); + return (2); + } + if (ch1 != EOF || ch2 != EOF) { + printf("Binary files %s and %s differ\n", fn1, fn2); + return (1); + } + return (0); } /* @@ -512,11 +528,11 @@ printcol(const char *s, size_t *col, const size_t col_max) * If rounding to next multiple of eight causes * an integer overflow, just return. */ - if (*col > SIZE_MAX - 8) + if (*col > SIZE_MAX - tabsize) return; /* Round to next multiple of eight. */ - new_col = (*col / 8 + 1) * 8; + new_col = (*col / tabsize + 1) * tabsize; /* * If printing the tab goes past the column @@ -524,12 +540,20 @@ printcol(const char *s, size_t *col, const size_t col_max) */ if (new_col > col_max) return; - *col = new_col; + + if (tflag) { + do { + putchar(' '); + } while (++*col < new_col); + } else { + putchar(*s); + *col = new_col; + } break; default: - ++(*col); + ++*col; + putchar(*s); } - putchar(*s); } } diff --git a/usr.bin/sdiff/tests/sdiff_test.sh b/usr.bin/sdiff/tests/sdiff_test.sh index 100fa1b123b0..83ed93503f18 100755 --- a/usr.bin/sdiff/tests/sdiff_test.sh +++ b/usr.bin/sdiff/tests/sdiff_test.sh @@ -191,6 +191,40 @@ short_body() $(atf_get_srcdir)/d_input2 >/dev/null ; cat merge.out" } +atf_test_case tflag +tflag_head() +{ + atf_set "descr" "Checks tab expansion" +} +tflag_body() +{ + printf "a\tb\n" >a + printf "b\ta\n" >b + atf_check -s exit:1 -o match:$'a\tb' \ + sdiff a b + atf_check -s exit:1 -o match:"a {7}b" \ + sdiff -t a b + atf_check -s exit:1 -o match:"a {3}b" \ + sdiff -t --tabsize 4 a b +} + +atf_test_case binary +binary_head() +{ + atf_set "descr" "Checks binary file handling" +} +binary_body() +{ + printf "a\0\n" >a + printf "b\0\n" >b + atf_check -o empty sdiff a a + atf_check -o empty sdiff a - 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: c14665b4aee7 - stable/13 - diff: Fix integer overflow. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: c14665b4aee7e1594467bac4a9d9cc5c66173975 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c14665b4aee7e1594467bac4a9d9cc5c66173975 commit c14665b4aee7e1594467bac4a9d9cc5c66173975 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-29 14:02:29 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:46:19 +0000 diff: Fix integer overflow. The legacy Stone algorithm uses `int` to represent line numbers, array indices, and array lengths. If given inputs approaching `INT_MAX` lines, it would overflow and attempt to allocate ridiculously large amounts of memory. To avoid this without penalizing non-pathological inputs, switch a few variables to `size_t` and add checks while and immediately after reading both inputs. MFC after: 3 days PR: 280371 Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D46169 (cherry picked from commit 9317242469f1ca682626d9806f8caf65d143c09a) --- usr.bin/diff/diffreg.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index a73020c44a80..fb01fa24a281 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -217,9 +217,9 @@ static int *klist; /* will be overlaid on file[0] after class */ static int *member; /* will be overlaid on file[1] */ static int clen; static int inifdef; /* whether or not we are in a #ifdef block */ -static int len[2]; -static int pref, suff; /* length of prefix and suffix */ -static int slen[2]; +static size_t len[2]; /* lengths of files in lines */ +static size_t pref, suff; /* lengths of prefix and suffix */ +static size_t slen[2]; /* lengths of files minus pref / suff */ static int anychange; static int hw, padding; /* half width and padding */ static int edoffset; @@ -391,6 +391,10 @@ diffreg(char *file1, char *file2, int flags, int capsicum) status |= 1; goto closem; } + if (len[0] > INT_MAX - 2) + errc(1, EFBIG, "%s", file1); + if (len[1] > INT_MAX - 2) + errc(1, EFBIG, "%s", file2); prune(); sort(sfile[0], slen[0]); @@ -529,18 +533,17 @@ prepare(int i, FILE *fd, size_t filesize, int flags) sz = 100; p = xcalloc(sz + 3, sizeof(*p)); - while ((r = readhash(fd, flags, &h)) != RH_EOF) - switch (r) { - case RH_EOF: /* otherwise clang complains */ - case RH_BINARY: + while ((r = readhash(fd, flags, &h)) != RH_EOF) { + if (r == RH_BINARY) return (false); - case RH_OK: - if (j == sz) { - sz = sz * 3 / 2; - p = xreallocarray(p, sz + 3, sizeof(*p)); - } - p[++j].value = h; + if (j == SIZE_MAX) + break; + if (j == sz) { + sz = sz * 3 / 2; + p = xreallocarray(p, sz + 3, sizeof(*p)); } + p[++j].value = h; + } len[i] = j; file[i] = p; @@ -551,7 +554,7 @@ prepare(int i, FILE *fd, size_t filesize, int flags) static void prune(void) { - int i, j; + size_t i, j; for (pref = 0; pref < len[0] && pref < len[1] && file[0][pref + 1].value == file[1][pref + 1].value; @@ -708,7 +711,7 @@ static void unravel(int p) { struct cand *q; - int i; + size_t i; for (i = 0; i <= len[0]; i++) J[i] = i <= pref ? i : @@ -735,7 +738,7 @@ check(FILE *f1, FILE *f2, int flags) ixold[0] = ixnew[0] = 0; jackpot = 0; ctold = ctnew = 0; - for (i = 1; i <= len[0]; i++) { + for (i = 1; i <= (int)len[0]; i++) { if (J[i] == 0) { ixold[i] = ctold += skipline(f1); continue; @@ -835,7 +838,7 @@ check(FILE *f1, FILE *f2, int flags) ixnew[j] = ctnew; j++; } - for (; j <= len[1]; j++) { + for (; j <= (int)len[1]; j++) { ixnew[j] = ctnew += skipline(f2); } /* @@ -1488,9 +1491,9 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) b = d = 0; /* gcc */ lowa = MAX(1, cvp->a - diff_context); - upb = MIN(len[0], context_vec_ptr->b + diff_context); + upb = MIN((int)len[0], context_vec_ptr->b + diff_context); lowc = MAX(1, cvp->c - diff_context); - upd = MIN(len[1], context_vec_ptr->d + diff_context); + upd = MIN((int)len[1], context_vec_ptr->d + diff_context); printf("***************"); if ((flags & D_PROTOTYPE)) { @@ -1591,9 +1594,9 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags) b = d = 0; /* gcc */ lowa = MAX(1, cvp->a - diff_context); - upb = MIN(len[0], context_vec_ptr->b + diff_context); + upb = MIN((int)len[0], context_vec_ptr->b + diff_context); lowc = MAX(1, cvp->c - diff_context); - upd = MIN(len[1], context_vec_ptr->d + diff_context); + upd = MIN((int)len[1], context_vec_ptr->d + diff_context); printf("@@ -"); uni_range(lowa, upb); From nobody Thu Aug 1 16:46:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZZcg3nWbz5T3HB; Thu, 01 Aug 2024 16:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZZcg2f8sz4nS1; Thu, 1 Aug 2024 16:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=az4SOe+oOpgj7M4aevgMcLDSVqwYiriAKRepCPgfLtE=; b=kUIXLzEDljwPVQxdQkKJaA8eRs6nOnADQ3JDFBf+WFsavMO+raaRZvEEU6PGg6ugPqMgWD G1eTpalC5tlJ1oVRZ2DqB6J7V6bDRSWImSQz5HsBj4hSp9at7Hb74J1Z6LFsbPeP6rRa0V pbv86rZWIHuotHhNoPOTRt3rBVLH48xIMA3JjsvgOlZr2HsYOwcZU2vyATq1Iovorj5JUf zh04iKM8fEEFzv9hsxX8ChNHvNKDBi7CJg0ZyhsBiQfQBC/UOf2lOBy1/rT0pR+Y3eBhwR 9xQCHcK6EIOpZg8PomScxnpzbAhuVFdEYXUPleadd6FUFZGp+pnrT/AlDoT1NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722530819; a=rsa-sha256; cv=none; b=WPGF8OhwhBUWKh0SGMLI1+Yl+MKqXQKmSCYVZS/Fm10HEA/Fys6XgsRRHONaDNSiUBO0+K UDt3CsyjFpOhIXTdjN9L8iujb9B4e8fT/JtnkkHssOsXnlzDgO/QbyjWSBBeLXEwmBYoRh Ny6W/CMkeoeHweIuPfZGZTvLm8xkhdcaLMAbvz6p5UUA0oKGl8swsPNzDq4Iz5nhH4pqGq i/pZOsfjTtVFHdFbbLGXe5FSRUmldNh5UoJNeYGIWKJeBt4kfvGhJ0NfjHLZEvrHogW71y 4xEFf2k6duzoHZKfvQWmRocjLEbGYBmFfDAVB4RkF85S6l8cxPb/w7d7w1FwFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722530819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=az4SOe+oOpgj7M4aevgMcLDSVqwYiriAKRepCPgfLtE=; b=LcFfXmUwzFODDUrbSML5aCJf4djxoDDnGQUy8qp67hCTnecbmvFNedj1WRZaErSFPN6DZR Bp+qhIsedmMJSFtkpiu7jr2Yk7m5XbMGG4W/gm52vH+VGGEjDUv6id82DsPLVoL9nYeJg6 +y3MknQUu17GOrwmeDG+EJL0WrVJLvc+FHQWtT+9n4LZeQJ2DIjVBSqIHosWuQkHai8Uri 79aNloKGr2bcvuww4I27yQVwi/VIvIyitlCNnFNh26r7V9ydah9XnZl3ZWNgzNOtU+Jy8Q cYVp5v8ZjL+1xlOtlR3oY+zRHhcDSmdoQj5ar/0as14mI6hGmuUrHQrqAZg6dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZZcg2GRSzsLG; Thu, 1 Aug 2024 16:46:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471GkxUv046751; Thu, 1 Aug 2024 16:46:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Gkx0U046748; Thu, 1 Aug 2024 16:46:59 GMT (envelope-from git) Date: Thu, 1 Aug 2024 16:46:59 GMT Message-Id: <202408011646.471Gkx0U046748@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: 4d7c715bd954 - stable/13 - filemon: Document how to build into the kernel. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 4d7c715bd954eda85fbfff410f448fe3d816deec Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=4d7c715bd954eda85fbfff410f448fe3d816deec commit 4d7c715bd954eda85fbfff410f448fe3d816deec Author: Dag-Erling Smørgrav AuthorDate: 2024-07-30 19:04:16 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-08-01 16:46:19 +0000 filemon: Document how to build into the kernel. MFC after: 3 days Reviewed by: olce, imp Differential Revision: https://reviews.freebsd.org/D46184 (cherry picked from commit 057453ffdf57bdfcbadb5d1834d425812e01ff43) filemon: Not an option. MFC after: 3 days (cherry picked from commit b4e4512d4669267fb220b7c1a2844c506673a3ce) --- share/man/man4/filemon.4 | 4 +++- sys/conf/NOTES | 3 +++ sys/conf/options | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/man/man4/filemon.4 b/share/man/man4/filemon.4 index c2b077059ef2..6e7d05aeea13 100644 --- a/share/man/man4/filemon.4 +++ b/share/man/man4/filemon.4 @@ -29,13 +29,15 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 1, 2022 +.Dd July 30, 2024 .Dt FILEMON 4 .Os .Sh NAME .Nm filemon .Nd the filemon device .Sh SYNOPSIS +.Cd device filemon +.Pp .In dev/filemon/filemon.h .Sh DESCRIPTION The diff --git a/sys/conf/NOTES b/sys/conf/NOTES index c688f7947123..46800301657a 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -2847,3 +2847,6 @@ device xz # xz_embedded LZMA de-compression library # Kernel support for stats(3). options STATS + +# File system monitoring +device filemon # file monitoring for make(1) meta-mode diff --git a/sys/conf/options b/sys/conf/options index 6a45645c376a..a62380b1efe2 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -100,7 +100,6 @@ DEADLKRES opt_watchdog.h EXPERIMENTAL opt_global.h EXT_RESOURCES opt_global.h DIRECTIO -FILEMON opt_dontuse.h FFCLOCK FULL_PREEMPTION opt_sched.h GZIO opt_gzio.h From nobody Thu Aug 1 17:35:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZbj84Bk0z5T62M; Thu, 01 Aug 2024 17:35:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZbj82GHtz4tpY; Thu, 1 Aug 2024 17:35:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6k+ba46Z1iR4fQeJeje63CYPhbVP2fGT7I6AJ4Octc4=; b=ReT6irlou7RYmQaN0o5iWK/ti0Z5Qj76vtyeUkJxzGXIaTp/KVOZxu8n5EQJeOBCGd34fV GaIfv9sz9mnCCnYx95GE6AgHiggnIFTDK6iqHZ9M1DhAqFkXR34HYCqLrfUajhdZBMOYIA AoP69DgFoD+f7hh8368AjLXiN68+yCXVWxV48fS9O1pviUXG3u2p7dimbfHd6H08WDzvU2 ybgNR+N6xHRoCWJKUtHUebMYob+jLu032wyem5nx6hk20HdpJ5watafnkQTWDbpY5YzLZR TBozdF+wVUuzVeaB8XAhRL/VaRva2it3pgaMMrPtoaFiWlFMwOcLK/XTfnhI3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722533756; a=rsa-sha256; cv=none; b=lfsD2QufYwSqd0evsnF7isVks6tm49bZTpbLQ7fSIOBQbiaZHLIdCpupP/xNSQfODav+gt jofkjch0yqEptCtp6CCygnccyHyNf2z3yVd/2PzqFrKHmtZllHiLnQ7k7W0okafJAAT/j2 QIztlfIhT1TQ6h9kv23OWyRyx59vMJoZ+iqdAe2je6kRAMHfTz8mF2zez2wEZ+oeniVR09 NBHIH8PR7G6xbMLS3YkEG1nJyqWmx4+ggebZy08fREDRworgLr+t69pLGBib0Py79kMeL/ /KYDtP2eo0oZ4mXW6JrDVFRr3aJVySEVZl+U2K3YT2aqQ/LWyyj+PxjLlr2Jrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6k+ba46Z1iR4fQeJeje63CYPhbVP2fGT7I6AJ4Octc4=; b=n076fY3HXc55sInEMKeRYh/oTzCQsBdyNXdRFhc9NsLWloWfw49kyDT0qLFo8kRxzgEAJJ EsrXxFok4a51Uh8civgMKNKKkggIo2EQQVNpStpzX/ThYM8uxdeWe+jkHE33q3s459LpFZ 888csTA3IYg+mdaE2SkCi20ljdOcjmfjCHgiv6LJtRwX3rJZnw822d+/YDMs+H9PwEfekR MgKHsRUhn/cvXJ7RefkpXYDodpJjbm4kqEKlE8hprmR2MnqYb/n1wlgzf3fY9ajEq+Nebw Ad8idg74vcaXpg834noBCSmOEhh18+tOU3IA0mbcV2P4MYnKfC8PLPPS50o0tQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZbj81lZvzv2Z; Thu, 1 Aug 2024 17:35: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 471HZu5r031685; Thu, 1 Aug 2024 17:35:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471HZuXa031682; Thu, 1 Aug 2024 17:35:56 GMT (envelope-from git) Date: Thu, 1 Aug 2024 17:35:56 GMT Message-Id: <202408011735.471HZuXa031682@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: dbb6f488df6e - stable/14 - hda: add support for Tiger Lake-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/14 X-Git-Reftype: branch X-Git-Commit: dbb6f488df6e890a5946390b235c1f36c4ce5f77 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dbb6f488df6e890a5946390b235c1f36c4ce5f77 commit dbb6f488df6e890a5946390b235c1f36c4ce5f77 Author: Adam Retter AuthorDate: 2024-06-14 15:57:15 +0000 Commit: Ed Maste CommitDate: 2024-08-01 17:34:50 +0000 hda: add support for Tiger Lake-H PR: 272682 Reported by: Miguel Salcedo Reviewed by: emaste (cherry picked from commit fb1028dcd4aedc4d48dbd97314f008c663b2e711) --- sys/dev/sound/pci/hda/hdac.c | 1 + sys/dev/sound/pci/hda/hdac.h | 2 ++ sys/dev/sound/pci/hda/hdacc.c | 1 + 3 files changed, 4 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index f3dff2052b51..64243e9d6227 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -109,6 +109,7 @@ static const struct { { HDA_INTEL_CMLKLP, "Intel Comet Lake-LP", 0, 0 }, { HDA_INTEL_CMLKH, "Intel Comet Lake-H", 0, 0 }, { HDA_INTEL_TGLK, "Intel Tiger Lake", 0, 0 }, + { HDA_INTEL_TGLKH, "Intel Tiger Lake-H", 0, 0 }, { HDA_INTEL_GMLK, "Intel Gemini Lake", 0, 0 }, { HDA_INTEL_ALLK, "Intel Alder Lake", 0, 0 }, { HDA_INTEL_ALLKM, "Intel Alder Lake-M", 0, 0 }, diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index 191c835595ef..abb6148c3369 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -98,6 +98,7 @@ #define HDA_INTEL_CMLKLP HDA_MODEL_CONSTRUCT(INTEL, 0x02c8) #define HDA_INTEL_CMLKH HDA_MODEL_CONSTRUCT(INTEL, 0x06c8) #define HDA_INTEL_TGLK HDA_MODEL_CONSTRUCT(INTEL, 0xa0c8) +#define HDA_INTEL_TGLKH HDA_MODEL_CONSTRUCT(INTEL, 0x43c8) #define HDA_INTEL_MTL HDA_MODEL_CONSTRUCT(INTEL, 0x7e28) #define HDA_INTEL_ARLS HDA_MODEL_CONSTRUCT(INTEL, 0x7f50) #define HDA_INTEL_ARL HDA_MODEL_CONSTRUCT(INTEL, 0x7728) @@ -910,6 +911,7 @@ #define HDA_CODEC_INTELGMLK1 HDA_CODEC_CONSTRUCT(INTEL, 0x280d) #define HDA_CODEC_INTELICLK HDA_CODEC_CONSTRUCT(INTEL, 0x280f) #define HDA_CODEC_INTELTGLK HDA_CODEC_CONSTRUCT(INTEL, 0x2812) +#define HDA_CODEC_INTELTGLKH HDA_CODEC_CONSTRUCT(INTEL, 0x2814) #define HDA_CODEC_INTELALLK HDA_CODEC_CONSTRUCT(INTEL, 0x2815) #define HDA_CODEC_INTELJLK HDA_CODEC_CONSTRUCT(INTEL, 0x281a) #define HDA_CODEC_INTELELLK HDA_CODEC_CONSTRUCT(INTEL, 0x281b) diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c index 009c9098ac3b..81395a1a9ae7 100644 --- a/sys/dev/sound/pci/hda/hdacc.c +++ b/sys/dev/sound/pci/hda/hdacc.c @@ -393,6 +393,7 @@ static const struct { { HDA_CODEC_INTELGMLK1, 0, "Intel Gemini Lake" }, { HDA_CODEC_INTELICLK, 0, "Intel Ice Lake" }, { HDA_CODEC_INTELTGLK, 0, "Intel Tiger Lake" }, + { HDA_CODEC_INTELTGLKH, 0, "Intel Tiger Lake-H" }, { HDA_CODEC_INTELALLK, 0, "Intel Alder Lake" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From nobody Thu Aug 1 17:35:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZbj94jcPz5T5yY; Thu, 01 Aug 2024 17:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZbj935yTz4tpZ; Thu, 1 Aug 2024 17:35:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGByeNjqhJj9cFwsFNq44akymCAGtt8zkh3zy82tkso=; b=Q1ADoShHffqwmXVvTh4uPCAFODvreB3fHVI6yO5//3CYSHwsjinAjcn+LJoaIpG+qzTFJK HpbwPxNR/5YAW6c6UPVKFz0vVHifuSmu7G8tUxpgP4sJA9mEcRDo53NmbX+jg3sJXY8Val Fb6QaWIh62Yeiy0CISPQlvsAGMmXWHsvlK17efHgE4VMRCHF8AxeA5PBE6PT+7ZVHacVit bLSMd8Z/QOi+pgHHsGVBHeJIlo2KelLLTUA3YI4fBzTNt19ncQjqQH3TlPyJb6onpz3t4Z BHDtuS3jHby1NYGwpWTnJhnraZCi+/NPF80g8Hq0GEaV8lxDAb8AaiooA/JbuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722533757; a=rsa-sha256; cv=none; b=X6EBP3NfgCPuVxPZfNEv2sXlSmQFsZ+ciL+qj5KZb/aHQNr2nn4Acos2BGU+4juArpbysq j/DfBlu2gz6XWQa9RnOUirWAI0tXY8/joMMq08updiTkcHsMMytc6qDrbHgycGSKAro2ZH Xel3E8PGJ73YFYyjL398zvDU65w8esrk/xs9qYWHUEalNhn7qW4DtTlgPLEgZGrdh/ihhC D7hCG0iWwnjQ5cHeKqMPbNd0PyiSNB0a7+zhp41pTJovkkwwl3UbSx17AVz1FtX5R1JEkX PQCKlWdWPr0a2oFDI3U4z1MT/vsAVD1reQ1IlonDI6h+i4YmqjvOB/4TxfM56A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bGByeNjqhJj9cFwsFNq44akymCAGtt8zkh3zy82tkso=; b=W7N7sBd7Le4y/IOkQ7M+ynyDLf6n8aM5vCA2G7WfEfE25+igiOFNZYTg7BreKGm6JxDZra ZCkX1dFLaZx7//X2EE3fvtTxLxmOoyLE1ZDtRoEhYMZFvNFzoQr/IwHguS9NnNUxA2Jk3/ hpJvVFggCVQL39A6PbWI6niNFw43i1bAVWnejgv+SWAJJjX050ndfRZw9kqf6pNZabeDK2 ztdHv9kpizqAgrySleJ5wbaswVheHhQsOvX5fUG132CoP4mWCXoA66vxtY/ZpEPofxSYiW rrQhrrpwokq4bB0FRaivam60NkI5mXJGkzqu3HIW6/06JeIW2VHDrleZWrorGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZbj92j3gzt5B; Thu, 1 Aug 2024 17:35: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 471HZvbw031739; Thu, 1 Aug 2024 17:35:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471HZvWk031736; Thu, 1 Aug 2024 17:35:57 GMT (envelope-from git) Date: Thu, 1 Aug 2024 17:35:57 GMT Message-Id: <202408011735.471HZvWk031736@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: 88069992b210 - stable/14 - bhyve: avoid resource leak in error 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88069992b210f659327024babb80589d86a2c119 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=88069992b210f659327024babb80589d86a2c119 commit 88069992b210f659327024babb80589d86a2c119 Author: Pierre Pronchery AuthorDate: 2024-05-16 16:55:54 +0000 Commit: Ed Maste CommitDate: 2024-08-01 17:34:50 +0000 bhyve: avoid resource leak in error path In e820_finalize(), the e820_fwcfg_item variable, containing the etc/e820 file (for the e820 table from the BIOS) is not free()'d when it could not be added to the QEMU firmware configuration device (fw_cfg). Reported by: Coverity Scan CID: 1522761 Reviewed by: corvink, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45223 (cherry picked from commit e9806d21282d3d5486b99b5c7062b490b00d8323) --- usr.sbin/bhyve/amd64/e820.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.sbin/bhyve/amd64/e820.c b/usr.sbin/bhyve/amd64/e820.c index 456ce0330b50..9d95ec8ce688 100644 --- a/usr.sbin/bhyve/amd64/e820.c +++ b/usr.sbin/bhyve/amd64/e820.c @@ -483,6 +483,8 @@ e820_finalize(void) e820_fwcfg_item->size, e820_fwcfg_item->data); if (error != 0) { warnx("could not add qemu fwcfg etc/e820"); + free(e820_fwcfg_item->data); + free(e820_fwcfg_item); return (error); } free(e820_fwcfg_item); From nobody Thu Aug 1 17:35:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZbjC0Dmvz5T6M6; Thu, 01 Aug 2024 17:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZbjB4K3jz4tXy; Thu, 1 Aug 2024 17:35:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZttNOnFtI0o6f2wvh+HLVQdwyXBnC5PabCKmP/wC8M=; b=VbjTe+Z88QMiqfSEtSLcH5o7dRtHDY/5ITSUnTf7urfMcjemMlSYx0+TSwGAiy8W4ikce4 tP9laYy/AqmC4wYod9XJYx8FJ3e2bAyolMZTZ3u6rAkeiiS1RSXwAgxAzFT2JCki8W3oCH 5l4nA6gptD1N4urSvNMxPaov3Q54YN0oXu8ej2+XHiiqTLqbSO2wjhwg0StDzxDYKAbnyo yMgdHh1YtrWLZyAiEyDR140gWFSDdCEXWYBMOxPrJjWNXUu3cbe5A1VFamB6/qUhVmjEun 13eHzQAidnMm96++R1pDqP41JvWPqCetxuQ68wPxG/gjrYqjHbz+OPj7bMh+1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722533758; a=rsa-sha256; cv=none; b=y4r2mog6wljiedX9PLdCP9JMtm+p/5jdFuAK4dvGC4xv1GwWxv5hGW0jisov0WUChn7bd8 rbCr93cvJ18NDsdQs1Dx+GvaKuBpD6gzainDSQt9k1p9Q1plgcxmG5KDB9SF8QBfy4tTXq L+QI+c+ncOpUJOVpVQTXysv4ojgEid9G/a19wbBrKoO5gj9coZjJEnvdMsqxOnIkmoc84c i2roY4n/2PyDkRe/Ght6e3VWFKQoqGdJuErPhTL5LmU9u69VtZ1U3ji/9n3XIF8k9/UPqs c1+pdXRDqh5YISlNksV+K8mdhCrXO0EGav/HJPSM/bs9GcnJsPQY8xQkpr8+Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zZttNOnFtI0o6f2wvh+HLVQdwyXBnC5PabCKmP/wC8M=; b=TUDrVay6WUyREUwe5571CVgKeZ4eOmTVQStEu4ogXCE3j/c5c+LP6+dFmg5A/oG53GPb2M m4fiKudx3xORFCZiUkqRmwO7dLn9W6GvqYiHShi+GkkPjufyll5CuJbxKCAtWb0lUdDxIy 7BL9j9rG2Tkv/6eicd8y15edDuKIdF09QEXg3qUisijNkdA7F/QlwR3TQ2dfu187XDexIA OcgbeZitbIF23zGEl75RYikCwAofcD1cdrGo4XrMiVYqhl1yjdkKVzCDu8Rmx4TO5tpAAh 133NH00vsHLreHEesqkB9mdg8jSXNGBP0UpXP8ZovtOTNtGIUropnllSMZcBkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZbjB3k33ztnw; Thu, 1 Aug 2024 17:35: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 471HZwEf031787; Thu, 1 Aug 2024 17:35:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471HZwi2031784; Thu, 1 Aug 2024 17:35:58 GMT (envelope-from git) Date: Thu, 1 Aug 2024 17:35:58 GMT Message-Id: <202408011735.471HZwi2031784@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: bd208ed0ab94 - stable/14 - uipc_shm: Fix double check for shmfd->shm_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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bd208ed0ab94d92443feff6eea2240f498deed65 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=bd208ed0ab94d92443feff6eea2240f498deed65 commit bd208ed0ab94d92443feff6eea2240f498deed65 Author: Ricardo Branco AuthorDate: 2024-05-20 13:09:08 +0000 Commit: Ed Maste CommitDate: 2024-08-01 17:34:50 +0000 uipc_shm: Fix double check for shmfd->shm_path Reviewed by: emaste, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1250 (cherry picked from commit 7975f57b7e14b146ca730421ef9e2094c242e9c0) --- sys/kern/uipc_shm.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 0bfbc636e405..20dbe59e2a96 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -1909,21 +1909,19 @@ shm_fill_kinfo_locked(struct shmfd *shmfd, struct kinfo_file *kif, bool list) kif->kf_un.kf_file.kf_file_mode = S_IFREG | shmfd->shm_mode; kif->kf_un.kf_file.kf_file_size = shmfd->shm_size; if (shmfd->shm_path != NULL) { - if (shmfd->shm_path != NULL) { - path = shmfd->shm_path; - pr_path = curthread->td_ucred->cr_prison->pr_path; - if (strcmp(pr_path, "/") != 0) { - /* Return the jail-rooted pathname. */ - pr_pathlen = strlen(pr_path); - visible = strncmp(path, pr_path, pr_pathlen) - == 0 && path[pr_pathlen] == '/'; - if (list && !visible) - return (EPERM); - if (visible) - path += pr_pathlen; - } - strlcpy(kif->kf_path, path, sizeof(kif->kf_path)); + path = shmfd->shm_path; + pr_path = curthread->td_ucred->cr_prison->pr_path; + if (strcmp(pr_path, "/") != 0) { + /* Return the jail-rooted pathname. */ + pr_pathlen = strlen(pr_path); + visible = strncmp(path, pr_path, pr_pathlen) == 0 && + path[pr_pathlen] == '/'; + if (list && !visible) + return (EPERM); + if (visible) + path += pr_pathlen; } + strlcpy(kif->kf_path, path, sizeof(kif->kf_path)); } return (0); } From nobody Thu Aug 1 17:35:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZbjD0h31z5T69f; Thu, 01 Aug 2024 17:36:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZbjC54gVz4tVZ; Thu, 1 Aug 2024 17:35:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wW5htx+nWVFZvdyCkq6lx2qj+nsblTv/MyxSjxKsDjs=; b=oG/lbGJx3uLEDai8FMH21OHdAIMJB2D45sMj47GOSUjl450U7tZ89qrhhocCkYinxUyiY1 N2gIA5mbSSmkzrSEttfI539HhkpqKVOF6zFYJNCvF/S1Ii1Mhi2jeRNepTfxF7XGnZuN4P 6KCPmBPQsxOaPKgs985n799RUwJRbVKg3CRPao2UvIHuPGYTU0R9AlIRZptz2mOHuZbal+ tnhSZpLx2CYDUvAy+Dpvec45FVWBnGaHC9myohrVuSmcKN3qD//aKvMD/2Mi4qNu9NlWF9 /X16owyscJpZpEBpBeCrX5lCu5XgwScSskdc7rUJHTkSi/UEoNTG1OANiUHVNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722533759; a=rsa-sha256; cv=none; b=rwXYtr8dK77H4VCoWk3aIBbHv3Oa4Uvyem6ObpHBEoj6ted4lj7zWwD64nocYoqb1AXaBf SJoD43AIBv/LJJmX8KnqpLWC8prULTLUzHPyYUE7cNSFbl7FXFcD/qaIRgZ7sn58crfWrj ayDydxaOLVwDBRngNF6Sq7VbndDd7+gvplmuHvXDUe6s/usXG8r7v9x2F82NEvf2AryCai zQ53S154J6UDn3rUco0+ut/cCQM/tdi1QsI/YPI48i4oFGEXU/dvWTDxb4lmZrNyRWCzU1 TIiwr8ebdqUJGCF3icOlxl44DEHa3HOAq1V5pmHuO4YkKSVhh3C7N7oST+xb6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722533759; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wW5htx+nWVFZvdyCkq6lx2qj+nsblTv/MyxSjxKsDjs=; b=FXY9MYB76ILCT6NP5O60AvyktoccqSRJBK+OyIqFFL9Qm1EwZ0fmlc5jeXSdI9HvqnJ2GU RXkHJN1ge1H6S6ORODKy2QKfolFtCyCN4EHNJ0hIfuSnHxz+6K4O4Z+vRr52TNiCs+4WBZ MM/dzlWFovtJXVE74l0nZLYS3N7FotltPGB+VrdjVSQP21vvBSTsakuv99L/BUDnT+Q2Fx vVFk3D7ilEDzEBsXAdot59tmGzLEZoZ/PASLi+imY7Ng2YY+wadIuLwlPYg44aZtR8YEl9 /0Q8sOxz5IdIArL2WzrODEdxf5EFUrF3hTXfd2iLZlftmBAyb9w29OG53JqjjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZbjC4hk8zv53; Thu, 1 Aug 2024 17:35: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 471HZxHU031842; Thu, 1 Aug 2024 17:35:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471HZx3b031839; Thu, 1 Aug 2024 17:35:59 GMT (envelope-from git) Date: Thu, 1 Aug 2024 17:35:59 GMT Message-Id: <202408011735.471HZx3b031839@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: 25114e7dd759 - stable/14 - newsyslog: Fix case of the 'P' flag in newsyslog.conf(5) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 25114e7dd75958a4ce844b2f86f7a9a6c9950de8 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=25114e7dd75958a4ce844b2f86f7a9a6c9950de8 commit 25114e7dd75958a4ce844b2f86f7a9a6c9950de8 Author: Joshua Kinard AuthorDate: 2024-05-25 20:52:11 +0000 Commit: Ed Maste CommitDate: 2024-08-01 17:34:50 +0000 newsyslog: Fix case of the 'P' flag in newsyslog.conf(5) PR: 279303 Reviewed-by: emaste Signed-off-by: Joshua Kinard (cherry picked from commit a8f86ecd6104b1f127b426be278a9031789b4413) --- usr.sbin/newsyslog/newsyslog.conf.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5 index f0823303e1c1..b9fdb47fd712 100644 --- a/usr.sbin/newsyslog/newsyslog.conf.5 +++ b/usr.sbin/newsyslog/newsyslog.conf.5 @@ -316,7 +316,7 @@ log file using .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. -.It Cm p +.It Cm P indicates that the zero-th rotated file should not be compressed. .It Cm R if this flag is set the From nobody Thu Aug 1 18:02:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZcHN0L7vz5R9cq; Thu, 01 Aug 2024 18:02:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZcHM6zWxz417g; Thu, 1 Aug 2024 18:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722535328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJ1VjSvEfY/G657RpNy88wL9Egr2u8aDSW9/6p0gWbE=; b=uP6rAuikXY1HOC6v1sn82nKdaYT26rSE1fvnKlSm39IuZNAHlrRfChJLOYLijJerMX9V3t /MMgAmZW9l6+a7UPPgs/b6P/+q9fNXShVozFqAGHJgwo5lXoeNCwsuSvPxdsIMabRnB/8H DUXNygJFcS20b0dUhkOfzM730JsRngjGfzSBQdwAA96r3Qi2R8Fea+dEC97IK0BQPr8si1 +/hL9NJ41qcJKZVYpXE0rA9zVNIHVsIvOTgnd79ZB+kSlM88O1K3ItLUbHxRv16qCgzXMK fZwx1gT6HooaZp18H9JQp+coqmJxRogJ655SR1aiZy/f84tI1oeaVb7Kj/t92g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722535328; a=rsa-sha256; cv=none; b=ktSFMmoxNDRU95Xrk6q6vKLmP8sd3WObxhcEFAqvrZky7sLUzzHvSq5+svwZuYDLolHKnd EKltpCITyMxDrTK8NBBLq8fMZZWPSjqj+oXYC8aQovRJSTL5Jnzc71ut1qHS+WJLv+C3Ey 66r/OWVA/RNTJmMxNio17VXmZUpJha4fQvLY0FLRv9/t1ATmxpeP63+anmpVsz/fxoHjP7 42dTBZT6V7/m0gqQeVSBk4vqSKjtwj8oQCvemdfZGQONbL7mJ3STSCVWILjab6w27lpVob FjrfaLhkmZD3z7be/Oq6VxJb2/QMmdJpDV8+sVsQMhx7ZpUBVZ1frd3yLzwoJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722535328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NJ1VjSvEfY/G657RpNy88wL9Egr2u8aDSW9/6p0gWbE=; b=CquZ2k9PFb6RiIOr9fTtV/DhFhEwrjLPF95h1kmoETzCrolhsg6v1xD7Rb2WFTUox8bnfp x/+hbFsWqoJfdxMYVZMSxS3WDafe5p2x9W2bbnYQi45hlqDWCuyS06/83pSN3uWZvNhsHw MwPkoPqs8mRn9qduoaj2pTDRX+fLCIt8zFSw/rM5kJrF8QBCoMzr4CeUaC4sJOQxBH5ytk NXbTsIRQv6Znryxm3hpZmbhQD4SDJSlXLjUU1EWru4LnchZXSevAZiVLmFuqwXGdX+NpPO gygrgrgdahkjF2+hahqsAFx1eaClfI5u/AL1jW7vW38upMIHs8333DtpGwYnKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZcHM6bbSzvNn; Thu, 1 Aug 2024 18:02: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 471I27Ku081237; Thu, 1 Aug 2024 18:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471I27CE081234; Thu, 1 Aug 2024 18:02:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 18:02:07 GMT Message-Id: <202408011802.471I27CE081234@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: 352dd826ffdd - stable/14 - fibs: Limit the WARNING message to only once when setting up with multiple fibs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 352dd826ffdd88d26744023fe8bcff795bdf64d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=352dd826ffdd88d26744023fe8bcff795bdf64d8 commit 352dd826ffdd88d26744023fe8bcff795bdf64d8 Author: Zhenlei Huang AuthorDate: 2024-08-01 18:00:45 +0000 Commit: Zhenlei Huang CommitDate: 2024-08-01 18:00:45 +0000 fibs: Limit the WARNING message to only once when setting up with multiple fibs In main [1] this warning message is suppressed but no plans to MFC the change as the message may be still useful for users that upgrade from older releases to 14.x or 13.x. Well emitting this warning message every time increasing the fib number is confusing for users not for the feature `net.add_addr_allfibs`, let's limit it to be printed only once. 1. a48f7a2eb90b fibs: Suppress the WARNING message for setups with multiple fibs This is a direct commit to stable/14 and stable/13. PR: 280097 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46204 --- sys/net/route/route_tables.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index fd211bcd5dda..f1c96f813d91 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -218,6 +218,7 @@ populate_kernel_routes(struct rib_head **new_rt_tables, struct rib_head *rh) static void grow_rtables(uint32_t num_tables) { + static bool printedonce; struct domain *dom; struct rib_head **prnh, *rh; struct rib_head **new_rt_tables, **old_rt_tables; @@ -231,10 +232,12 @@ grow_rtables(uint32_t num_tables) new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *), M_RTABLE, M_WAITOK | M_ZERO); - if ((num_tables > 1) && (V_rt_add_addr_allfibs == 0)) + if (num_tables > 1 && V_rt_add_addr_allfibs == 0 && !printedonce) { + printedonce = true; printf("WARNING: Adding ifaddrs to all fibs has been turned off " "by default. Consider tuning %s if needed\n", "net.add_addr_allfibs"); + } #ifdef FIB_ALGO fib_grow_rtables(num_tables); From nobody Thu Aug 1 18:21:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZcjZ65pjz5RCLG; Thu, 01 Aug 2024 18:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZcjZ5fSxz42tk; Thu, 1 Aug 2024 18:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722536482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l26naueaE8y3r0MHEeuXQwjiqsSawRyANDzrAk1qP5s=; b=E+W/irIckVXuFTG0H5vGLMtvyCGTUHffWUkpQxgmHzVo6hon+4va/ln3GjDn0+/nNaW+4q Vc6QEoWvC2t9mKVK98dz6l1hJqzDcCx0LlDOtfG+GBBQA22qbhJ+nDmn/MciN3pqiMGAKQ 5pF2jnvmRPAmJ98iNhMJ3h5B9hHHGlB9qb492e0DpfroP5vTCp7sw/E+FXYzAStgUNmfQY z8WWLwBFfTEwc/f8Unom6QZjBYseDOcRE6pUMSJZTlZLF7ahGatnKUzDaDiKVHFyf1ckmd EqwdzwvQb8R7Mc5jQ1vcBgjZQ52JuLBRWBbQRq5qC33VKCLo776bTtg1zKYQsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722536482; a=rsa-sha256; cv=none; b=ksJHcHmFcAcP5oSX/yQdR8uZMKtOpU+oczj5U/uFOXXNUzUqyjmg3vANht/HiHJ2+2Xgiw mSWy062Kn3mse1iqBIwMahQdXUi47ywUqxxJ5nxTeioepoqTklxaE+npyY8fTQNDwfl/9g s0kiAGH/yEzk3hAMNznCwFps/0ZtR8gCLKDjQtkK6XQi9lNgcZIeSfYbsAw9HvNp1IXS8I 9v3SJyXuy88WXUosFUAhq4FaP7hIfnBdku6ZTPgZDxJihcduNoQQCSZS2QB2DWtuVaVkMe yw38DQdStSbuyVrb7veQT8vT79OoXzoW3qB0ipGWyEYBWK/QXyKLwi9QM2GOcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722536482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l26naueaE8y3r0MHEeuXQwjiqsSawRyANDzrAk1qP5s=; b=H9bm9tV8bP+NbRjKOmmC+2D9kNGzeWQmlCrnKwa5Lb6Ho3+Wa6AxScbVQWvYKmsJO+NfuX JbqzVeuEnoqtm50OL/GHxuQwkoaGHCM3qUBLHPJiqCn8OVRaZc9zS0c4dvOrUkHZ62WBkk V1NBAdIuZf18e8eFZT750tiMfe0mtVL6BvgSpIVNwomTioNLVVL0HbfXWJ8vegOdhn/C// DKAKNdRuCMRQcYYWq6ML01ZIfxIKxJNs8NkBv7taPiqlbEKjGPh9ES8h4ErJlUtRLfHbEI JsqWRGe9Bl3WX7Vkrdd9T+eKJythEYUE3LpD7ghr2D1XLo4sZVXxAGpgT8+rhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZcjZ5GDBzvJl; Thu, 1 Aug 2024 18:21: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 471ILMMa010387; Thu, 1 Aug 2024 18:21:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471ILMYb010369; Thu, 1 Aug 2024 18:21:22 GMT (envelope-from git) Date: Thu, 1 Aug 2024 18:21:22 GMT Message-Id: <202408011821.471ILMYb010369@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: 7797719d3a8b - stable/13 - fibs: Limit the WARNING message to only once when setting up with multiple fibs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7797719d3a8b1eb50e57c6652f744a6bffc91599 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7797719d3a8b1eb50e57c6652f744a6bffc91599 commit 7797719d3a8b1eb50e57c6652f744a6bffc91599 Author: Zhenlei Huang AuthorDate: 2024-08-01 18:00:45 +0000 Commit: Zhenlei Huang CommitDate: 2024-08-01 18:04:54 +0000 fibs: Limit the WARNING message to only once when setting up with multiple fibs In main [1] this warning message is suppressed but no plans to MFC the change as the message may be still useful for users that upgrade from older releases to 14.x or 13.x. Well emitting this warning message every time increasing the fib number is confusing for users not for the feature `net.add_addr_allfibs`, let's limit it to be printed only once. 1. a48f7a2eb90b fibs: Suppress the WARNING message for setups with multiple fibs This is a direct commit to stable/14 and stable/13. PR: 280097 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46204 (cherry picked from commit 352dd826ffdd88d26744023fe8bcff795bdf64d8) --- sys/net/route/route_tables.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 45c1b6cab8ed..47fe5cfae1dd 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -217,6 +217,7 @@ populate_kernel_routes(struct rib_head **new_rt_tables, struct rib_head *rh) static void grow_rtables(uint32_t num_tables) { + static bool printedonce; struct domain *dom; struct rib_head **prnh, *rh; struct rib_head **new_rt_tables, **old_rt_tables; @@ -230,10 +231,12 @@ grow_rtables(uint32_t num_tables) new_rt_tables = mallocarray(num_tables * (AF_MAX + 1), sizeof(void *), M_RTABLE, M_WAITOK | M_ZERO); - if ((num_tables > 1) && (V_rt_add_addr_allfibs == 0)) + if (num_tables > 1 && V_rt_add_addr_allfibs == 0 && !printedonce) { + printedonce = true; printf("WARNING: Adding ifaddrs to all fibs has been turned off " "by default. Consider tuning %s if needed\n", "net.add_addr_allfibs"); + } #ifdef FIB_ALGO fib_grow_rtables(num_tables); From nobody Thu Aug 1 20:04:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZg0l2cnMz5RMNN; Thu, 01 Aug 2024 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZg0l1zhFz4G5K; Thu, 1 Aug 2024 20: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=1722542679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L94Mi/ESuybUXyb7CbsBvfgnQlrSGqXQWRUJ8jqvHtg=; b=L6GbciaKI0avm1eSF4p6lUJa5mzm+hIk8ix8d9ecZ7XVWOkMhwLsks2j1PIFIWNpgDgYV9 hapT/bPMqCRn5HCoRgXsNC4ro2PtOfVALOuLW3Y7uvpfVsInW2HJ7r2V9YOJw6coGBa00W AIWwOv4m+XhT7nEhTa7CbD3H99wOrc9nn4IvhR3F+YKQESdT7WwIv0dBgtOIgW4wbiwHdh NluqBXfg8kTfIipiWSd+odkVL6ZQ33mX8FOhJZhxUA3ATCpPNhL/PE8wgcvsY2gIuLmJZ7 CYqX4prsEVlMrIflqQqJQUUG9S5EQp0+dW5uuNQwoDduO2A8kqsm9aRUUVdmgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722542679; a=rsa-sha256; cv=none; b=ydT9eNJZl161EStGzTX0JNUaEuY5yTiwHWe8eV3EdPp7R0OwYbS0K4y53oo+l3aDcTFYcQ PJ74cK712zSMSLlI+PqTXK4rx6a8XOXhHn6pB5lOCJxE7BReBGsZ0WIgPsB9aTgo5EMCvc YMXnPwRKjPYtzN/ronE/2kvjBZcE4WBh2L/qYkmS2QwD5Jo+Y3KtzTk6vuPgc67+evFjnL XF/y7LZ1Y6T+Th4BgOGUDgI9Lo797YMoo73EvKFAdBeeKvn6PTb58pk4VdBGgJ6H37mufj nWrZuDt2biQDAvstulHgmHmJWV8z/LqpWsAcmkLCMc1xgAu9lHztLN8wJF6Ekg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722542679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=L94Mi/ESuybUXyb7CbsBvfgnQlrSGqXQWRUJ8jqvHtg=; b=IHnWb284ZP/bXbBanx1EtQoOuFY+15U30Qobs8FVQ7DU/S5NxqQTK+D3/u70jPoB2N6QZy 1UWDF/k9Af49FaA6F7WYxx8wP9f4TzXhIackDcS09ohZQyuLfSaA+dv2r7Sv+NXJJCSiJQ zE4ZYjAtWPPVkfydUyzM92Fpryy40tIjiW4MVVnacqk74BbueLcSxLrTVwZoHG8voIHxCZ sP3Rv1JneIyl3I5b6LSbLiA+C6WVLmgnmTAlu8wTjCdkwWNG/Uc7gIVesPvNqN/uWLFKiw JKpD+0PcoPX5oELRJ08vZyYNhTHNbyTJ5k29Ig4vpao2PPeG/zla6n2iMV+h3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZg0l1Dz5zykj; Thu, 1 Aug 2024 20: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 471K4dbf086334; Thu, 1 Aug 2024 20: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 471K4dKx086331; Thu, 1 Aug 2024 20:04:39 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:04:39 GMT Message-Id: <202408012004.471K4dKx086331@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: 78de1d02e0ce - stable/13 - vnic: fix compilation of an IPv6 only kernel List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 78de1d02e0cebc2009e0dcb04b7b7309f326133a Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=78de1d02e0cebc2009e0dcb04b7b7309f326133a commit 78de1d02e0cebc2009e0dcb04b7b7309f326133a Author: Michael Tuexen AuthorDate: 2024-02-06 21:47:16 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:02:55 +0000 vnic: fix compilation of an IPv6 only kernel Sponsored by: Netflix, Inc. (cherry picked from commit 1d3d30c8d2e41052796c5bdd9220d7e3daabccad) --- sys/dev/vnic/nicvf_queues.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c index 4410bd4998dd..e1f434d0eb18 100644 --- a/sys/dev/vnic/nicvf_queues.c +++ b/sys/dev/vnic/nicvf_queues.c @@ -1744,10 +1744,15 @@ nicvf_sq_add_hdr_subdesc(struct snd_queue *sq, int qentry, struct ether_vlan_header *eh; #ifdef INET struct ip *ip; +#endif +#if defined(INET6) || defined(INET) struct tcphdr *th; #endif +#ifdef INET + int iphlen; +#endif + int ehdrlen, poff, proto; uint16_t etype; - int ehdrlen, iphlen, poff, proto; nic = sq->nic; From nobody Thu Aug 1 20:18:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgJB1yQQz5RNkx; Thu, 01 Aug 2024 20:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgJB1KRZz4H8J; Thu, 1 Aug 2024 20:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oFZxlBZFXed0QYjBS87mMAVFnF0nGQTxXraeDnr/p40=; b=d1RESzsmNi8uMC3cUbEezzocw5A88JTlWDyj55fgN/lTBE5q1WnaBK4vx8jguHrE8boNxe cqu8eU+QK+sc8CPURuWAGNo9EvVHlXln5jzsYvYvT1ABCVVbbzQyLRp9sbI/YrsoMYwdTR KVAHDk9ShQFk3U9DotgeMdVdMKald3GwJkEvKf2HT6XO68Gzdd6aFhkhdQO+Yf0wvSiX8J z3FLAGINBlqbvCWybtak6NuKMzn9jR30EOUs2j7v3SfcJNtjqiIPUTkXcvLvKeBoRBQygX GGtjRgzYXUFkJVslynESFKxj1SV7p9Whx1L6Xi64owkYl2Yo6rWkHe21uiS4gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722543482; a=rsa-sha256; cv=none; b=p++g53NCTX2q2YYfLVX/hVFJu0iE+z4GWPM3Jj14AVu/uEDOlwe/xFEMkn0pnqJAbbNdjQ 4ZYtcaRVS/QZpuAx8OUoXj4dnihEiBhTw8IIRBGP/43rEzLIxvcEZ33ELK9BOCpmOoKvDq QCP0O2tlj42zm0ZIL1E4TEtphr9OKoA0b7uBvbDQqsmKI82R2BL6XKizinAcAfzs+032ep SVYkdsbGrlPLXo0En4BL5iVqRhak8zgtim1tobAf2OGDMsb/KgwR/HBPAChTIERrOaRw+v qYzyos1mQ+a10vApr04rBw6N5qTvEliOVHpi0kdhTyZSZEo/2jpcGrB+E9vkcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oFZxlBZFXed0QYjBS87mMAVFnF0nGQTxXraeDnr/p40=; b=jaXgLidY/lm0aoMx924QnMQMBgfZxI5wv9oNc4HdWDVQvGasO15KtwAJ80XdjqwfmxRTbt v2j3aOMQiQJEjbB9J/jsNeeA5ecPFlNpgPKDTGkxB4QDOxBBPaMKGXIRjyhju7AzQSvCQZ 1mRtByQX87x8NLou1OiNi3PIRc/Ku+MDOQhrHiC5hoQOQcxWQiCyf2o+y1OE65AaJp5Ba7 vw9hYQMtiHanDQoCck1617YKUtg+G1hFRX/mSPjLAma3w6z55mkCtFsp1n6NgBE5oj/lI8 Psbl8v1KUHhtS9Eo7FCn2ON87TF4XVlqy9x243sTWvGOFvV8Md0xvz2SfWTSgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgJB0pLVzybZ; Thu, 1 Aug 2024 20:18: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 471KI1N7003986; Thu, 1 Aug 2024 20:18:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KI15j003983; Thu, 1 Aug 2024 20:18:01 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:18:01 GMT Message-Id: <202408012018.471KI15j003983@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: bf28627b71c6 - stable/13 - sctp: improve 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bf28627b71c6feae3f3fdf614c7b65d71d682bac Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bf28627b71c6feae3f3fdf614c7b65d71d682bac commit bf28627b71c6feae3f3fdf614c7b65d71d682bac Author: Michael Tuexen AuthorDate: 2024-02-23 20:40:46 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:15:42 +0000 sctp: improve consistency (cherry picked from commit 533faf21c19d0fa4bc3c0a986c67667991f90883) --- sys/netinet/sctp_output.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 7626e4ec066c..ab97d9b13e5d 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5019,11 +5019,20 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, at += padded_size; break; case SCTP_HAS_NAT_SUPPORT: + if (padded_size != sizeof(struct sctp_paramhdr)) { + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error nat support %d\n", plen); + goto invalid_size; + } *nat_friendly = 1; +<<<<<<< HEAD /* fall through */ +======= + at += padded_size; + break; +>>>>>>> 533faf21c19d (sctp: improve consistency) case SCTP_PRSCTP_SUPPORTED: if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp/nat support %d\n", plen); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp %d\n", plen); goto invalid_size; } at += padded_size; From nobody Thu Aug 1 20:19:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgKc1gbnz5RNqR; Thu, 01 Aug 2024 20:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgKc0mW3z4HcZ; Thu, 1 Aug 2024 20:19:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJRhr1jh3kdWUY/PHJW+SB3FoRc1FVuvXxfs4HZDc0g=; b=G89At2X2KqO1GKBgAAn7iAuWsYctbJxwMexRzgxWlkkWpcvZ1lrov0oRhTZVxZk7FNlQ1c cd/oVXwYeAp1GiIC1aItTYDuu2KrJnJso/HF0ogdTo7Lc053WX4ErQz5nx/87Sg3yQUjQ4 hoJsRTFeTACD1tTiruYI4JrJWGvpJNcg7WcQKydXFWCxwTdIgQ1i9/TmyJaRTcF+4lRWif tmQLqGNXzQXHhOF/ociyw3SR5glYNDSQnXeiSpzdznBeJSR92a0W3XSjuAdoLWPXqwOsSs FLEs7Zep4wUF0p6Ihh3m9tJT6uqujWS0MbJ5fDi1hqa9LeMXaww/5qwRqBrw5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722543556; a=rsa-sha256; cv=none; b=d+/YCpJMbNMcJXaADSpX8y+WHZUYmyY7Qm3hgebbnupwaK59Nk7lddIstWiy3pVhu0dTXn XHkxQeIjbhyjBTYMLWzdnk3UmEQbZ7vitee97pAKGbhcPTgtYHlEJ9ia1D1TxmVfZBg9t/ hoLWebfAVhMYdbuU8W8ryyT/Yl8WH6chklIJK4jz8WT9dLchdU158/Bfa2ptpMiphLHKHO SrIRsF/B6eA4M2ZrDfN/e9+QHe/chHvhV5Mpc+2NJoWzLRlLf22Mt0wMx/M8FLizzdT+nv uwhCFjy/0Fab7wPG2dXk/Pp5gg44g+pYg5O5QJTUuj3UfkdpFF45MoH8GL2xnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJRhr1jh3kdWUY/PHJW+SB3FoRc1FVuvXxfs4HZDc0g=; b=WIEeRXw9YaQF39Pi9VjUm9wp+zbyPukNfxDzb6IWbAzait10jG4RQ6KuePsSYUEbJSTpWq BZNJIFEjxJzsnI9mcmMUyrsqEozNR0Tu2YnnH0lLAQ3hzKP7HaBTdXjBZxz87Zktu4zu0d QbXMyy5IQkzqTniFJtQPvvVQILsbuhPXbmMrcUaeDVO/Y0JUkjp2J2oj7Q+d3zP7qcxvDo DY4AN1B2h8R+t2pCUf8W2nWkwXp7UemL/VcGcWNv54RbK0m04N8IafIo0KPKt2kNMYTwI/ 0DCSPcRfqAkLV6MDlVu2edntqBK/45Aa9GjF11M8gnZEH8llYQGQjis9fJvfpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgKc0Mctz101f; Thu, 1 Aug 2024 20:19: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 471KJF8u004338; Thu, 1 Aug 2024 20:19:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KJFUK004335; Thu, 1 Aug 2024 20:19:15 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:19:15 GMT Message-Id: <202408012019.471KJFUK004335@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: 25152e8f1a37 - stable/13 - Revert "sctp: improve 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 25152e8f1a37fbb785bfc56a83a68860fe75f8ea Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=25152e8f1a37fbb785bfc56a83a68860fe75f8ea commit 25152e8f1a37fbb785bfc56a83a68860fe75f8ea Author: Michael Tuexen AuthorDate: 2024-08-01 20:19:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:19:05 +0000 Revert "sctp: improve consistency" This reverts commit bf28627b71c6feae3f3fdf614c7b65d71d682bac. --- sys/netinet/sctp_output.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index ab97d9b13e5d..7626e4ec066c 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5019,20 +5019,11 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, at += padded_size; break; case SCTP_HAS_NAT_SUPPORT: - if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error nat support %d\n", plen); - goto invalid_size; - } *nat_friendly = 1; -<<<<<<< HEAD /* fall through */ -======= - at += padded_size; - break; ->>>>>>> 533faf21c19d (sctp: improve consistency) case SCTP_PRSCTP_SUPPORTED: if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp %d\n", plen); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp/nat support %d\n", plen); goto invalid_size; } at += padded_size; From nobody Thu Aug 1 20:21:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgMz6rDWz5RNjQ; Thu, 01 Aug 2024 20:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgMz6N6dz4Hqb; Thu, 1 Aug 2024 20:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kr8lLOsHyQN+2JEMlXnnU6hLDz1MpGuMK1vwvLh/mgA=; b=nF/ZovXanF3upXGUseQ+KGJqRxQTY/74RhVm5WnXNdQgJJ50IfWHfZ6dUU86r82R7jQ77f l6DkYqBPHKelsoLry0x8PEwfdWv3LKghGR2b7MKFDTRd02YEKOOj0JBDSl9HHFjg2BH16w hQpxE8fMMDnhoh+twa24ium9y5pRELIb0LtY6wYyOeU43h2L2fNUU80MxY1CFyJ4NRohYr LXN5OoVgBN0eco9ASBvpPO/GuRDYruFp/c7mOJ5yF3A69YNE5a7lmrGvO1ml10VFiiFkI9 CRx6tRtB728bbFNsTZwH2em5SSRctn0g2T4ORqAEVn92QoEc+NYxcZqXFLIZyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722543679; a=rsa-sha256; cv=none; b=kaUwO2a6JFKmeqxOO98A0k/b1jl72F99dCOSKdi3PXyzyhm2sAGc1VMnyDmmrCCNg2iUl5 Qq3kYK3utkTRm5LK/Z123iwfOX1YGxRzQlUfCiEwSRcMzp79nzULzSslvXshUgYxF2SRcq sbb9+V7w1JQIo1CYp51GlshJpLGtbMgiurufqJ5nYqu8gxKTMAkZLlz8sTE4uji8ZxeLGn cFBAVms/1g3zsC3/xMEfkHk4B4r5EUXhWS2cWcVDYfqLSDMkIg4G5ZTmmQdDGL5fLHkkl4 E17b8QFecZNdBtTEcTyfPmMmlZPirCjmqfAOvhxmqng/xBuPaaa/2Poxp9w+mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kr8lLOsHyQN+2JEMlXnnU6hLDz1MpGuMK1vwvLh/mgA=; b=az5HqW34umZGdZ9aNmvcrn6rCivZ2KpOJilgTjDMsrohgobXSgF6VjW8jtkrPi0W/olGH5 IixiF+j2lddWfKpkFGJ/Z4sUDn46i3iSIetLHrVERmeatg3D/80uUgNYYn80SQGElsnHBp Pw7T4kv3LmJFCFg+pJWV1At5l5DL+IOPvIwLE9ZJ72aDaJLCN2jvbOd5OU/y5AWYRPPMkV TcRKyhXTO/RAOE6qVdFVZDOHc6w8pSTbROC2Dr7hWMsbCSaBbykKu5Iodyt7TxqOY/oJi2 g8/ek4M+513sT6Jllpw5CGC/GWJbXJpgvkYyEt2+vpwo0IBJmu+JsezEvJ6thQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgMz5zGwzybr; Thu, 1 Aug 2024 20:21:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471KLJQU015274; Thu, 1 Aug 2024 20:21:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KLJ7L015271; Thu, 1 Aug 2024 20:21:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:21:19 GMT Message-Id: <202408012021.471KLJ7L015271@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: af08cafda0d1 - stable/13 - sctp: improve 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af08cafda0d10a64bae8328126868c527171963b Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=af08cafda0d10a64bae8328126868c527171963b commit af08cafda0d10a64bae8328126868c527171963b Author: Michael Tuexen AuthorDate: 2024-02-23 20:40:46 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:20:46 +0000 sctp: improve consistency (cherry picked from commit 533faf21c19d0fa4bc3c0a986c67667991f90883) --- sys/netinet/sctp_output.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 7626e4ec066c..f13010e54521 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -5019,11 +5019,16 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, at += padded_size; break; case SCTP_HAS_NAT_SUPPORT: + if (padded_size != sizeof(struct sctp_paramhdr)) { + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error nat support %d\n", plen); + goto invalid_size; + } *nat_friendly = 1; - /* fall through */ + at += padded_size; + break; case SCTP_PRSCTP_SUPPORTED: if (padded_size != sizeof(struct sctp_paramhdr)) { - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp/nat support %d\n", plen); + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Invalid size - error prsctp %d\n", plen); goto invalid_size; } at += padded_size; From nobody Thu Aug 1 20:24:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgS45L1qz5RPMy; Thu, 01 Aug 2024 20:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgS44l81z4JRB; Thu, 1 Aug 2024 20:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TvjOHRxTNj3WC31n3rXPb2d3efGu+WImTFaVP0M8xvg=; b=l9pzAdjq8jpcIR9TZ1P44k4P0WE7LYJ/hTSPe9685KsQu3NmrdSWL8YP00+aK744WAQ7er ICGSUGmkokQHmJC3mpP9rP83cQHAvqt7m6UAhbISeLwUZPj+m2B3pZEIYf3z5TMZUCDaRt fuVqSsVKY306Z4nSUBvsrG8ui/HXPJER4uy71JMvw8tb42cI5sFWwNfilDetdbJ0v0flXk vN/kicI1/nSwl5BnwudNMLE4M6QYknVM9Ylj7RTMlzZB7x0LakWyl26KQkP9gsShlcUUu4 JKveKHeMQhD0gZKK/qLX66cOr9KhmOEk2cx449UVn3zID3f8r9CZ34cQ4sppqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722543892; a=rsa-sha256; cv=none; b=hojjk7bacX92y+Eam14oMeaoQYd3N4nMO2w3vzFtHmWJmXlnJU2J7+yuiIq2R94U0uo7XE 27ITPKMKeTRq4qgL7LnuYcSDB+N8H5XmT9HUr/0IHuzLYxqWnnoA9OrjkJeQks0BBr4Tbd 32Eakq2Jj6AiB635/Ms9jqL3ttqD7UUM/7tJWGeYLCrHzqvOmED6g0fir/F6Q9ZVoek+CP DV6JQqIgcfeWNXPcHHF7LmA+d6/MQLM33nkecEuyU9exy9JCtHjvjxPP3AS0J98Yko8vkM 7GGq4kjJANjaFFiaKrzuhWbHZxt4+j0XlBteqtmQ7dLqeBalw3cD4bPDvu7ycg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722543892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TvjOHRxTNj3WC31n3rXPb2d3efGu+WImTFaVP0M8xvg=; b=drNIasiJbdrsRUnD//HOpRJtDTyc1w06m6aYtqXxV9uDBXsEbd2xeJG2eG6ATWjVi6C3NU iw4YAz2iByrEtBhBB9kSbwn6VxvcLyYa0pFfl5Q2rHMtUZ6P9zhL3TZMDOExvWmY69HSqf HK7rgLMJg9fzaBMny1NUEAJ/bOLbhQQ0s8FdeAGFHf4z4xQdD+CLI41hcg2qcSzdFBkX6t NEmcO0ZpHHWUDllNfJvPG+dtAbRhMDvCAw4aOgv0Vf8Khym7dG+Kj682E7pEaB8cxVT0o5 G9qD+YtNF35zCeY+Jct1cyc+G+m0e+olBSIcZIplnY87TrKlyjFweL6/d8rGZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgS44KvTz10G2; Thu, 1 Aug 2024 20:24: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 471KOqD2020455; Thu, 1 Aug 2024 20:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KOq5k020451; Thu, 1 Aug 2024 20:24:52 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:24:52 GMT Message-Id: <202408012024.471KOq5k020451@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: 2290185085ee - stable/13 - tcp: no data on SYN segments unless doing TFO List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 2290185085eecbaecefa70cc9b3769b7518c9bb2 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2290185085eecbaecefa70cc9b3769b7518c9bb2 commit 2290185085eecbaecefa70cc9b3769b7518c9bb2 Author: Michael Tuexen AuthorDate: 2024-03-22 10:12:56 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:24:18 +0000 tcp: no data on SYN segments unless doing TFO Ensure that there is no data on SYN segments unless doing TFO. This check is already in RACK and BBR. Reported by: glebius Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44384 (cherry picked from commit af700f430fd86ba3eae63e587985a12436db8f69) --- sys/netinet/tcp_output.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index ba559500552b..d95174e53789 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -482,6 +482,12 @@ after_sack_rexmit: (tp->t_tfo_client_cookie_len == 0)) || (flags & TH_RST))) len = 0; + + /* Without fast-open there should never be data sent on a SYN. */ + if ((flags & TH_SYN) && !(tp->t_flags & TF_FASTOPEN)) { + len = 0; + } + if (len <= 0) { /* * If FIN has been sent but not acked, From nobody Thu Aug 1 20:27:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgWQ72p1z5RPQ2; Thu, 01 Aug 2024 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgWQ6TyXz4Jfy; Thu, 1 Aug 2024 20:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmujPb6JfKT5k2reTYdTZNX2kcqmhpQUYcZQ1tGCFYA=; b=JqgR3IhXDI+W1M30MjuZtZe8MQ080l9JcC6OG1JnPHZ6NPDwBFhxSDhIIYGuWBz+hyaq4A SoZhbwZnAByCtXgagZEzLXf+/6+/p2BN+rn7otM7cuWx649cEn+Zl+o4slK9cStW0QU4VT cVu07gJsI3k1zYt6reLqvYsIqbAWNnus/QyPFlYz9KYLdaqaYJPpAJynrBIwpdV+lhOB4b ASE18MfI/r64DJG+pG6ikuBN536MNThy8InfrqIKEgGnC+YsyjC4ELMFhstFOtT8TzTcmz r7Y8Wmt/VI3zKFL6Dw6iq3btF1yTcX0WiFjtIjiWYA8rg8jckoNPe46yebKTDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544066; a=rsa-sha256; cv=none; b=K9VSM/wCCW7ajI6DtyomoWS/MbGk5Q4A+ZXLKusvkbaSXMZ65ZPTVemju35T5vOfJPQ/n4 38rgh4KOihuSBjX7j2XgfrH240GkVK3BSvVKuEPwVuQy8KYJRI6yFDvGa2Fs2UB+mUpftm EliE1AsaCy/7afqDleTIIf/rQ/l1Kq+p9zSO1s25cB2qkKLU8BBEEwZYJx/N7LRWfKPDAm 3X/ueodQkVYRWHWYdXFoa0WcFdAyD9TWOarESm6VypCSdRs1Tud9KaJJxbJaw/DcJkzmRc rP2Up8xqMJXmE7DkAyZp8+HwzURDdQVMAd3YIGStuShnR07IstWR4R8xl+uzZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KmujPb6JfKT5k2reTYdTZNX2kcqmhpQUYcZQ1tGCFYA=; b=vm6VLDWoGdVC2GPVk9qxAmTitDzyrIcZCzZ9mQmsylbNUjhIUK2UX9PdoC6KhecXzbHtV8 5xOS38B7dri7A+BFKzKbeBpSEIDIFfGWUKQ6nxR8XQWkV2GS0FBIsc9PVxPHJpBiPr5O1O Ls3TIZfJcMxmG2raAA8fiZrGU13GfdTR4DcWXmiG2Rr+8TllCAsOXkb62gb0Y1MHvP940Q h/WA9CimVRzEGgbWGdsOEcZAuFuy9kc+g68PINQNRa7GBTNoQOjybJTYrfglWu5jF/Ga5f oSKZRQo5jiZOYjiETN/k78kM4sJt1IuESQKFUcAWy39zZEXb4KU/i+fUDlZWvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgWQ5ysTz10G3; Thu, 1 Aug 2024 20:27: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 471KRkns020935; Thu, 1 Aug 2024 20:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KRk5t020932; Thu, 1 Aug 2024 20:27:46 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:27:46 GMT Message-Id: <202408012027.471KRk5t020932@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: bbd1d17ff339 - stable/13 - tcp bblog: use correct 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bbd1d17ff339f43159f79fce9bd68a85520b81a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=bbd1d17ff339f43159f79fce9bd68a85520b81a7 commit bbd1d17ff339f43159f79fce9bd68a85520b81a7 Author: Michael Tuexen AuthorDate: 2024-03-27 13:31:48 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:27:09 +0000 tcp bblog: use correct length The length of tldl_reason is TCP_LOG_REASON_LEN, not TCP_LOG_ID_LEN. No functional change intended. Reported by: Coverity Scan CID: 1418074 CID: 1418276 Reviewed by: glebius, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44510 (cherry picked from commit ed505f893ab08aa61e2a1046ae54df357a108260) --- sys/netinet/tcp_log_buf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_log_buf.c b/sys/netinet/tcp_log_buf.c index 27b587f6ec9a..f51adf09391a 100644 --- a/sys/netinet/tcp_log_buf.c +++ b/sys/netinet/tcp_log_buf.c @@ -2234,7 +2234,7 @@ tcp_log_dump_tp_logbuf(struct tcpcb *tp, char *reason, int how, bool force) if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else - strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_ID_LEN); + strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); entry->tldl_ie = inp->inp_inc.inc_ie; if (inp->inp_inc.inc_flags & INC_ISIPV6) entry->tldl_af = AF_INET6; @@ -2324,7 +2324,7 @@ tcp_log_dump_node_logbuf(struct tcp_log_id_node *tln, char *reason, int how) if (reason != NULL) strlcpy(entry->tldl_reason, reason, TCP_LOG_REASON_LEN); else - strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_ID_LEN); + strlcpy(entry->tldl_reason, "UNKNOWN", TCP_LOG_REASON_LEN); entry->tldl_ie = tln->tln_ie; entry->tldl_entries = tln->tln_entries; entry->tldl_count = tln->tln_count; From nobody Thu Aug 1 20:28:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgXV4MXpz5RPV3; Thu, 01 Aug 2024 20:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgXV3rCjz4Jvr; Thu, 1 Aug 2024 20:28:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVtFfNHYFCErao+3L6HmDmCr1NsScuX+QtNpOihPOas=; b=hyjubZoPuXiOzp2vaMGYWfo8voHXvBDuDxRQdwmnFrBSr3SqFCLsrbxIhNxfnPh7CYTuI4 DB5zq34vUU/jFy9r/ayKrtBWrvkzCnpFX8hSudUBqZfd2BjoII0uKX9ywUEOheacVky7wf Pt1YA40AFkhOiy5L8iqcTpgYPXKDUZ+p68ok1AsbMz8PB/tjxXvbWuJM8Y+sJ30vex9aC8 gDvX2AjOX7ed6pNxu8G24O9z/rLqTgVgxS9Dj+jDU5deyu2Ch45GMldbNUqCrNAxvoJL/1 HWIlXoNwTPJgUwrGbrkoz2QWjf+4PSYuVs+577iqD7B1BOCDHdAYE0Q7cuoSoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544122; a=rsa-sha256; cv=none; b=G0CpfJnQ0vT9rc72hhz0sLVtT5PCaN5OZL+TZ3a7RFlXeygfEf8Yi4s6BX1KKBx897sHFC lseW9WlN82zzhk74HWTNOAHKiy/HLEXVh2eByKywYt/pYZsiCX7aEW8pEOZRfSaNeVub/I 3iL8SAKXr0xeT3SwGw9bpK+D+Zj8tT4yjUcCWoQRThhVC4C1X9zUNjzAKk8F+Qwz4YqyL8 VIs+p2W+nhFOAY09GNCScrp0aZcEq0pTxQv20m4HuGR6guRWRrIrysSO1QSL6ccD/gIY29 iaWS8R+EMMYVJtZzckugim/3JoizsyymntYjRm5JdHV2p0vTpOip6EwgskiqJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jVtFfNHYFCErao+3L6HmDmCr1NsScuX+QtNpOihPOas=; b=yEz5Mc3f61A03XKFqQu2rpcbaVU9QaZFmFuZKAstMDGcBdj/4bwMEuBYyPxh6CuYevmDmn vppQ1jYOUS5+CZpJjPS261NQSN5aqSWHm5tiTPM0EnWTILkcj/+tdlBWZbfX+o+NT93gNR uSKvI2nfx/v8aQRlMk8chcYnvlvoPzYyJMz00/TLxJnRrq2Q4stKXlAM4KCyVXotfQyGpP 515lg8dSwmfkwg5Vwyh5548MHXGyrp3ZEvr0RuH9dOGQvGT1FnRZVst3w2768l9Wo3MtKo QJHqnCa0wU94kWsfDeJzBhDuG4WiUotC0yjujIt9SEM651/ODXOG/oQAEhuvIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgXV3Rb5z10Jn; Thu, 1 Aug 2024 20:28: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 471KSg8R021175; Thu, 1 Aug 2024 20:28:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KSgte021172; Thu, 1 Aug 2024 20:28:42 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:28:42 GMT Message-Id: <202408012028.471KSgte021172@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: d341a5645144 - stable/13 - tcp hpts: improve 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d341a5645144da014cb800dc98ed5c785df504f4 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d341a5645144da014cb800dc98ed5c785df504f4 commit d341a5645144da014cb800dc98ed5c785df504f4 Author: Michael Tuexen AuthorDate: 2024-04-01 19:51:59 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:28:16 +0000 tcp hpts: improve consistency The target_slot argument of max_slots_available() can be NULL. Therefore, check for this in all places. Right now, all callers provide non-NULL pointer. Reported by: Coverity Scan CID: 1527732 Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44527 (cherry picked from commit b600644fdd6cefb1b90d76fdd5aa595946611a7d) --- sys/netinet/tcp_hpts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 18576e181b6f..4c177367a7ea 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -796,7 +796,8 @@ max_slots_available(struct tcp_hpts_entry *hpts, uint32_t wheel_slot, uint32_t * * "0". */ counter_u64_add(combined_wheel_wrap, 1); - *target_slot = hpts->p_nxt_slot; + if (target_slot) + *target_slot = hpts->p_nxt_slot; return (0); } else { /* From nobody Thu Aug 1 20:30:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgZ63xLYz5RPX5; Thu, 01 Aug 2024 20:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgZ63WPyz4K4r; Thu, 1 Aug 2024 20:30:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyvWQnXF+Fbk5u0OwYTc1oYZJuuX8CI3xvxGQovv0JQ=; b=GUCI6SWM+AnPiaf0CU61svpvj0nb3DMWRCnx6hCa3eiW0Py1ikxojNv6VJcYYW3yRVZ8mP tTd8RwKldfmuQVj6QYrCyMKET9KcEz3vjHRoiPQvq/ISAdf/OZ0Zc8mBLWAzLMVnjbXalR 38xreguYDKPqQMxSlyaI/QdMVE8x1O0TSnoOCe9B+ob/0q6PQ3J4PXb2An47nPwFffIa/w RNuUWOEtfaN47jMOjiQwBaJvakHH9Ar8hkhRBTbZfnelRhGLfhD93omnUWDadZTqm7d31v 94VSCKWPqWwC6oQUzDgaSgIENSXx25ToVblV8Mx9FLxHriu7egQoSkLAlJCgbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544206; a=rsa-sha256; cv=none; b=s/tBrn2doMTRQ8ZcPnBga3F19ntnotC4eFXvb0KNzxm3J/9t9+aYnE3ovG4xAzMvghbnn0 /XaGs3xx3AnGCWw8vBmDG1xWkApf4L+0XBUlO2wlhroKjR0FJa2oXI+lPi7aeeFuAhd/l7 yTfFsgLpDKuiqhNFP12MsGxQQpqsDcSL7M2dYPxkL2+YVZmv98SGNHm8Tb//k1VdiYKk5t KjzVLfdoUSZoEPECH6XkBbTL2DTqMjr5wv/Dl8qZ6cFZ4juulE/7O8zOqx70X3i3LrWY45 oXNoX71ie5TadlyxpGuyzW9TUCFORPFNfLFcACmgcbp52ekM2iLQXqMsG9StTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KyvWQnXF+Fbk5u0OwYTc1oYZJuuX8CI3xvxGQovv0JQ=; b=VI323y2+paB/6nKXzu++QXpAzFKznlKNnx88l91UySSDM0JvF4fho5x/kYcdYt2t+wbLZt WXVwIqMrFhNp4+oZW1uuRN3ZZjnY05kLQcMvspvBFaF5TQ6ylHkZlp92ta9mPvYFClxD66 kGe32HgYsp0jfjd9ToSw3cqtttR3hwQUJ/ehF6Fw2CfGfcAyL60ZeNehbF9A5g6AfEeYYv nYTyq3lsNOVGIJ8BXCMRY7MZf/xBoWja7aobpc8Ocgcijh2WRMycWyA+zuCk8zwM8ZvHJw 2JIjFz2qXcmuhcU35KReN+PU+1RoYner25ws/bAmYr9NQr2mkC0LVUD38tQHhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgZ637hcz100G; Thu, 1 Aug 2024 20:30: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 471KU6Hf024436; Thu, 1 Aug 2024 20:30:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KU6HR024431; Thu, 1 Aug 2024 20:30:06 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:30:06 GMT Message-Id: <202408012030.471KU6HR024431@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: 0cf2b6fe97fb - stable/13 - tcp: fix comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 0cf2b6fe97fbb6920aeb5e51068063a457b0bb56 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=0cf2b6fe97fbb6920aeb5e51068063a457b0bb56 commit 0cf2b6fe97fbb6920aeb5e51068063a457b0bb56 Author: Michael Tuexen AuthorDate: 2024-04-03 16:21:19 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:29:24 +0000 tcp: fix comment Make the comment consistent with the code. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44611 (cherry picked from commit 5a268d868890dbbfe96361906be20d01cc252b2f) --- sys/netinet/tcp_var.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 6815c6533073..e2578a9bc892 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -553,10 +553,10 @@ struct tcptw { * and thus an "ALPHA" of 0.875. rttvar has 2 bits to the right of the * binary point, and is smoothed with an ALPHA of 0.75. */ -#define TCP_RTT_SCALE 32 /* multiplier for srtt; 3 bits frac. */ -#define TCP_RTT_SHIFT 5 /* shift for srtt; 3 bits frac. */ -#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 2 bits */ -#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 2 bits */ +#define TCP_RTT_SCALE 32 /* multiplier for srtt; 5 bits frac. */ +#define TCP_RTT_SHIFT 5 /* shift for srtt; 5 bits frac. */ +#define TCP_RTTVAR_SCALE 16 /* multiplier for rttvar; 4 bits */ +#define TCP_RTTVAR_SHIFT 4 /* shift for rttvar; 4 bits */ #define TCP_DELTA_SHIFT 2 /* see tcp_input.c */ /* From nobody Thu Aug 1 20:32:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgd90lHwz5RPsb; Thu, 01 Aug 2024 20:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgd873Njz4Kf4; Thu, 1 Aug 2024 20:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uFMT6dzHJOSrrm/OWMNzfCdSmuFxcnNN9shIkTeoT60=; b=GOeOAhnkVKng6QGRX8lmmGjfyna6hfqmKmOC4yJtf2WAV5TCwURPPeRsthqE6LfB49n1hb xUJwEUIYkMxY7AJZhtmv/95ijqblk2uqKyEUearjDMrI5WltyWva81X5ZCe2g2Oo+OvhOc KNvRSQWNsPnYhnBi5Uo6m2HIUk97a1npK72Jfyt65jCE4guy7zeSDynAzzJObbR/lBN54F d2YLEGr7ikuLeIglf2h/3EsliZIrgPhI8b8Tw+xH5gBrL3Tu8+Sd/F2ucpXxoirQkZM700 U0coiJmJZKAKbdeLk8JHzLlSVBWAA9iDwEIzhW9XpG5qp/kYNXX9OU3+nCdPFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544365; a=rsa-sha256; cv=none; b=sLZezbuozQAjAkJUOAMfzWb47vL4SPB37w2T12wn3bO8jyXb8EJQ5JLDPa3b7Aw9snGP0h ZBEhcy++wHurL3M5sbqDNiBHy1bSHPUhtXexU6FvwfySkgT6RBvle4gZjnTGjpelwdfbxI lDtkjGGt+BtcooNjQ8dG+AKIx2X4EcJASUH49MEBVZxFmb11OZfj3rGNh8C2f7fY2A1o5/ 4yBPWS4P9IwF9SNDLkCS8koDdjsvBdNoiNRzvN2y1HOz0+W6UhVQLeyQtf2A3KWCeSuzsw Q91SPBIOmpngTKAyZ9TcNzDUmyd7z7JdXaStpUvDopdq8Y6JC35U/NmXtW+szQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uFMT6dzHJOSrrm/OWMNzfCdSmuFxcnNN9shIkTeoT60=; b=Qp98zzl56Ja+Qi0nxVb7H3Viz3146fiuSqqA5Kj1k35CcVbp5t6OAKu30Mp5O5Mz2Vw1I6 OKa8TshVlzJeCbtVRcKTWvEXmVp5wR6ESg/90J9NQvVsVKIMPJh9ur4wxhIeRjepeCubYp AIAmiFDBh1tg6lkVeiI2ZK5VW67AOY0fE6mKlr4eB/fcpSukRgEz39a8zD2rErwYtGVmkV Mvw1DL0w//OaCI+8bOdf+wt8s9Nhqnq/nCOktbRv2YCescjQz5Mm2hO4QuMsYUqyGj6ACq ZbewzhDNplGhjGHdKvIwPh455R2e7+d3sJc20c29rodRotukW4UAu3FKyvws8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgd86frdz10XP; Thu, 1 Aug 2024 20:32: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 471KWiUX037319; Thu, 1 Aug 2024 20:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KWiNB037316; Thu, 1 Aug 2024 20:32:44 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:32:44 GMT Message-Id: <202408012032.471KWiNB037316@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: 7f328eb439a3 - stable/13 - tcp hpts: initialize variable List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 7f328eb439a32176b4e6d00c0d4d3fdff53a06ee Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7f328eb439a32176b4e6d00c0d4d3fdff53a06ee commit 7f328eb439a32176b4e6d00c0d4d3fdff53a06ee Author: Michael Tuexen AuthorDate: 2024-04-05 15:30:31 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:32:02 +0000 tcp hpts: initialize variable Ensure that tv.tv_sec is zero in all code paths. Reported by: Coverity Scan CID: 1527724 Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44584 (cherry picked from commit aaaa01c0c858fd703194c6cbd515dd514574381f) --- sys/netinet/tcp_hpts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 4c177367a7ea..ee4e68572c47 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1995,6 +1995,7 @@ tcp_hpts_thread(void *ctx) * enough activity in the system that we don't need to * run as often (if we were not directly woken). */ + tv.tv_sec = 0; if (hpts->p_direct_wake == 0) { counter_u64_add(hpts_back_tosleep, 1); if (hpts->p_on_queue_cnt >= conn_cnt_thresh) { @@ -2019,7 +2020,6 @@ tcp_hpts_thread(void *ctx) * Directly woken most likely to reset the * callout time. */ - tv.tv_sec = 0; tv.tv_usec = hpts->p_mysleep.tv_usec; } goto back_to_sleep; From nobody Thu Aug 1 20:40:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgnx1D7vz5RPqn; Thu, 01 Aug 2024 20:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgnx0N2zz4LPD; Thu, 1 Aug 2024 20:40:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EaNK8BfW8ETXIDIxaFuX8KqxBil9yBwLhKOJv10XUVo=; b=g3flY9uIDTvuOOe+YM1+IQo5nNnmVR0aDG41uyuK1JfbJEsEO6IJH2UGPzhcB9c/uOVs07 a7lpFKJo1lZoNUezlRI5F6vAcdhLTElhzkzPT9KKR6Olm9iYEr19PNCf5Ki5RkRydMdHPq lPrHq5beU8gF62uUROo0xsXZB1C0MLlb4dmQ7mafPJjgt6Tg0o7s3jGHZ/r8aR+L/tPVWB eX0q7+1oAwnl2f84xKTTljMEP9IxcQcXiiNMQqBedbtbSWbxNGhA0c25PcIc06uE/Kq6xu iBwOEsUrJN8xsgDllfih8uPRUH9iFut64tOtq5c0Joc/dnx79IBr9REMem8SeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544821; a=rsa-sha256; cv=none; b=pKlaE0fc0LfDGNFRXdwskRJKxo1zyOPqIPfS4YRKYxzN/SffM0Buv+sQtK78TLtVd6kP69 ZwMTL+MvVODAzfyFEzOHiPxc/6ksPRIS91Gpox3TepVqBI51raUbtLnmB00eDf6zvPoWzd tBMnW3DEllZoZEeDO/3p7CgWF0bWiQtx1+sSy0T+phtmVcwUeKVdX5sum5GADVswwaG1cR oyFPz1KGFbmc7QaknLBCFykjL+Bo7DbwrfLjDS4tC/MOLNLiag8KOmyJJrh4EOIX0xxrDi i1hqJ/7fMsFmbBrVFU1TVJFsgneHXtieWb6PrSU6OX0V5yvQLmDFeVhYHR7p4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EaNK8BfW8ETXIDIxaFuX8KqxBil9yBwLhKOJv10XUVo=; b=YYb9d9tNXyqz2BqFM9gRCXU0kWUaFwvz8RkhGeXFWnAvwkgA/umFnC2tu5afEKgYBHyhVf Iq6p19gZqtkXdUKbqY4qdjUmkLJ3fb3W0GhBCsNC3H4MT5SQ0qk/qAzNrtqC+A188Eycgv 8vm8hVx8k9jQrhY6uwSu12bOKHItHPGUpgtQliljzlQrezmnB9HDxAQzejxK7oeSVxCvyr K6JWk9B+CwL8XDDZP1OJScLijCxqODuWGc6vfl/Wy8kg6fWs4ZOVdBbq9aOX+vBXwDvZHP U3Zlet9QTvwDOWuBq0yttfYj7KCQofPGwwbcq+RkLKF2oPJ+wAt6oNJ/y1IfvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgnw74t5z102Z; Thu, 1 Aug 2024 20:40: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 471KeKx1047159; Thu, 1 Aug 2024 20:40:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KeKTW047156; Thu, 1 Aug 2024 20:40:20 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:40:20 GMT Message-Id: <202408012040.471KeKTW047156@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: f6599909ba6e - stable/13 - tcp rack: fix memory corruption List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: f6599909ba6ec846883e6142b909590b6dfdb6f9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f6599909ba6ec846883e6142b909590b6dfdb6f9 commit f6599909ba6ec846883e6142b909590b6dfdb6f9 Author: Michael Tuexen AuthorDate: 2024-04-06 07:55:46 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:35:33 +0000 tcp rack: fix memory corruption When in rack_output() jumping to the label out, don't write errno into the log buffer, since the pointer is not initialized. Reported by: Coverity Scan CID: 1523773 Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44647 (cherry picked from commit d902c8f55b8da6902ab45e67ed756cc99f5a9d5a) --- sys/netinet/tcp_stacks/rack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 3e3900844989..7429dcac5d5b 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -18324,12 +18324,12 @@ send: mtu = inp->inp_route.ro_nh->nh_mtu; } #endif /* INET */ - -out: if (lgb) { lgb->tlb_errno = error; lgb = NULL; } + +out: /* * In transmit state, time the transmission and arrange for the * retransmit. In persist state, just set snd_max. From nobody Thu Aug 1 20:41:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgqp6MMZz5RQP0; Thu, 01 Aug 2024 20:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgqp5x6bz4LnV; Thu, 1 Aug 2024 20:41:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKG9ZWmRBIX8WubKNWouQd4sQB5oe+zMcWQGWM/iCbI=; b=koSomKvILEV/3T+Gh6VBmeFgNwp56QE8fTddDKNz9kXnGTtSL6n/5CTE9bsBV3bu7a448m 4cd5uqVP3g91Q4OmyYAIVySH5UnaqbB9VSqQFqjRcVcYcxAlIVAkh5alvHdlO//QLqF8sD LwBoNx9QYmLsrKrice6dPh/SWZIUb7aVEsSNYwJCVJIt55eB5TX1bHTy+e7KeLglvKA+mh JgsofBXJa5fwli81l6JZ0wki3+qhvXkNVgy5DaBU9ZWmyBOSqwEaeowLFheaTPrsseu5q9 kzfAleK+ahogEhJtw0iquv+w+B6cQI1VDpPMdC75PZ0+9RgGqJ0mOrY4vmYf8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544918; a=rsa-sha256; cv=none; b=I4TU7SLjIsGAAnmKIUlfnefp7SxDmz7XdLUq6Z6W0ItKHknN2bJfMvCZX7U1tf8YR2ZnVN CZEdQG8l2d3TXYRPrqEbEsKRAxhRa6ckqOhUX/QlJvbnuAeGP9/zfQg0xo4w/UydEw2aHC AwpmU0PQx9uT9cZE5oZuzZf3UaoAtqIIa7XeTJzIs4PgyRdlHEydAiz/KQFXxlZVNB/Rto szLjT25loZsBfRcmjoCjq/pFVhvFQzIpr6WXaUjGNHww8l5e39zKOWsEWp8jy/FA4fNsEo gqYsbDsOvLfk40MrJqUmeu1b+peGLJfXNUkBk3u0BKIB74bQnF7RV2jQ7LMWWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PKG9ZWmRBIX8WubKNWouQd4sQB5oe+zMcWQGWM/iCbI=; b=NjGLKUkQQ3qn8kKyvXsun0x7CXhraJ93bAm2zE7gkoVL7Y1MGTWxkoyb4SSoKZL/sO0UfA yD0rzJV72GBje1aWqhx75Xpm9k7l5n8FGK5kIqlPJx5y1rWfD3asgaLGrCfTBD3TmqgE10 PZ4vpBwpebLcCpamxnBGtb6ZN8NxLcvJox1Ev+TyYhKhLn5UY3ICKuCNXGuzhY2ZYsJCLj LvBjOuUhkQsqXhjJGeiqwsoma1olKvMiNxR6bgq/lsn7jppXPn3/IcnHDEBbjoy+85qsyH octeRUHtxx3Sh1QdJdwQIAf2MqG0Y2uUk8Le59Y1VRz0uu9Pgbrt8MUmAmy0AA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgqp5XP0z10hh; Thu, 1 Aug 2024 20:41: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 471KfwJI054416; Thu, 1 Aug 2024 20:41:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471Kfwp2054413; Thu, 1 Aug 2024 20:41:58 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:41:58 GMT Message-Id: <202408012041.471Kfwp2054413@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: 5b1ebb6ef6b1 - stable/13 - tcp: add some debug output List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 5b1ebb6ef6b187f3b7a9de58164d69ff2e09e2b8 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5b1ebb6ef6b187f3b7a9de58164d69ff2e09e2b8 commit 5b1ebb6ef6b187f3b7a9de58164d69ff2e09e2b8 Author: Michael Tuexen AuthorDate: 2024-04-07 20:41:24 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:41:21 +0000 tcp: add some debug output Also log, when dropping text or FIN after having received a FIN. This is the intended behavior described in RFC 9293. A follow-up patch will enforce this behavior for the base stack and the RACK stack. Reviewed by: rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44669 (cherry picked from commit e8c149ab85c7834f76325864f22ca89298e65f75) --- sys/netinet/tcp_input.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index af6afbd271bb..df4205ef84e1 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3298,6 +3298,35 @@ dodata: /* XXX */ len = so->so_rcv.sb_hiwat; #endif } else { + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { + if (tlen > 0) { + if ((thflags & TH_FIN) != 0) { + log(LOG_DEBUG, "%s; %s: %s: " + "Received %d bytes of data and FIN " + "after having received a FIN, " + "just dropping both\n", + s, __func__, + tcpstates[tp->t_state], tlen); + } else { + log(LOG_DEBUG, "%s; %s: %s: " + "Received %d bytes of data " + "after having received a FIN, " + "just dropping it\n", + s, __func__, + tcpstates[tp->t_state], tlen); + } + } else { + if ((thflags & TH_FIN) != 0) { + log(LOG_DEBUG, "%s; %s: %s: " + "Received FIN " + "after having received a FIN, " + "just dropping it\n", + s, __func__, + tcpstates[tp->t_state]); + } + } + free(s, M_TCPLOG); + } m_freem(m); thflags &= ~TH_FIN; } From nobody Thu Aug 1 20:43:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZgsL6zRTz5RQmn; Thu, 01 Aug 2024 20:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZgsL6QHKz4MBp; Thu, 1 Aug 2024 20:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jneHdxRaFsL/2fJGLq6FSUgWBMSY1wJuOv3jKwKg5M=; b=JiWkT931MHWIAGuFW3Y/GcgmOWrdA+pDkHjMXL2YmrfzEgvmK6ylu0J/ICgxxsKLUzYGjs wcpGR8vN1Kb9D6TF+ntiLIquPu0diWXvYC0dKfp60TZPhxgJqklxdTXodDLC4ExXHnTVWk 0Lm5HCDfutsNduDgxUY5Q1g7g3yTtA0T+k/QFLK9Xn1N791EnMBTyr1pXMGtLJfC+8/zPM PJFVERCNFCcMbL6Z0ma2hHlJIstyd2/mD6wnMbJv53M+tRuRX8iq9K16BU/w7yR30WqTqZ gmlCliWnM9OaZNZzrvgxTUkei0VQU8Iu6pg5zvquF4dGjknzvxn9ddfqNtlmlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722544998; a=rsa-sha256; cv=none; b=KYlxt9BsAwjaDxqe1M2hs/5wxG6EoSh+gwsatCY18g4NX8SrL5wFhu583zVFG6zDukIm7S hLD2kEHKF6qN5ZA84PQaqaxIfmkFjOgTrQblVZ9Tq7g00DdWarVSUB0wE00CXf7nuypmtV GziBvEqBWzjg63vkh9DG953Xici/RDdxADomZPeEOD/Z+ayQD51H3aozQkaPW1ygl6tXLe cXPzaMGzNfS2bIXIGkBz1dniZdQY2CUVJlqP+nBHEcXs+pyy7ZZbJ0M+IWwBjawtiUyNf9 py4fMk7Ha9TTlopmnWO/FWojvfjIqVWF43twE4TIvAtkVuqYz/NgGtvIogSnsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722544998; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jneHdxRaFsL/2fJGLq6FSUgWBMSY1wJuOv3jKwKg5M=; b=Ife+fUf0mYDi8jw3qVgB1SsB5YDbTFhJep3hiBmcSrwpyB4jhPxIA5wXYLYUNTDc+eXrKu I/PB1j0ufpTaHh4Hr1CKTqFIXbG4N6zlpeIiXaek/83i5x4AX2u0Yv2H8SVaQxdMZRSOwy P4SAWtknLhQU04FWVGrorZKXcFg6lbmpFAWx8uJO1RsDsh8tCKtNkZBg2ER3uLJ6AABAbf lySGKgPcZTOdOcGCTb8aCkEE/wyrziFdRK3tcvkXPSF7elGc+EoVp4VEzsRS5s5zP104+X qt7Qp+Z++r9GWk60IrjUj0SDw1eIOlgxd3qNM59JF6aWLvA5NO9jMm9D11hT7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZgsL61hzz10LX; Thu, 1 Aug 2024 20:43: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 471KhIAW054726; Thu, 1 Aug 2024 20:43:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KhIYh054723; Thu, 1 Aug 2024 20:43:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:43:18 GMT Message-Id: <202408012043.471KhIYh054723@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: e5555583b0cf - stable/13 - tcp bbr: improve code 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5555583b0cf71c506fdf8d121beca79c38477c9 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e5555583b0cf71c506fdf8d121beca79c38477c9 commit e5555583b0cf71c506fdf8d121beca79c38477c9 Author: Michael Tuexen AuthorDate: 2024-04-15 21:52:08 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:42:52 +0000 tcp bbr: improve code consistency Improve code consistency with the RACK stack. Reviewed by: gallatin, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44800 (cherry picked from commit 605a00660eadb210ed76d49df551f3f33bbb4da7) --- sys/netinet/tcp_stacks/bbr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 805ffa492c56..8fde062c0dc7 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -11920,7 +11920,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv) uint32_t recwin, sendwin; int32_t sb_offset; int32_t flags, abandon, error = 0; - struct tcp_log_buffer *lgb = NULL; + struct tcp_log_buffer *lgb; struct mbuf *m; struct mbuf *mb; uint32_t if_hw_tsomaxsegcount = 0; @@ -13732,12 +13732,12 @@ send: mtu = inp->inp_route.ro_nh->nh_mtu; } #endif /* INET */ -out: - if (lgb) { lgb->tlb_errno = error; lgb = NULL; } + +out: /* * In transmit state, time the transmission and arrange for the * retransmit. In persist state, just set snd_max. From nobody Thu Aug 1 20:53:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZh5R5Ywjz5RRQc; Thu, 01 Aug 2024 20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZh5R2dHRz4NSJ; Thu, 1 Aug 2024 20: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=1722545627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCYAm6xKBM+RWXr5MJ6ntazcGVqmkRGyrJzCGtCmjhQ=; b=i6iksyvTHy5cDyd2t51ypQWOxHS10yH/q5GAkurXWpM1z02tYAY4mOS3Hmn54tQUT/mJQM 7HTvRP8EKR04Cmd6g4kDgLRPrFdXwWgnO3bNhhI+mTL1r73nTQNR8MQxghHRUkGD85eF3H IN0P0iKkdbgYy3Qz7wvB/AZoplJFPTA1JcK4baVLhE7jMxv3A/lP3nsx3SrcK+H8aVKfWw 8faPJ03RaxLas/RwzBn46AuL9GAViSym9UAKT4i8uy23kRRUGEMhhv0UKjPVl3bbmmZQBW 7rDb4L5XUC+EzrZ2fAgP2/iNExwIb3GtvbCYIQEvU7LX9j96MHuYNm3eHPz0rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722545627; a=rsa-sha256; cv=none; b=rGySP4xeAnNchu311WIYr1ORPbpdiMz7Vjrld8F47eji0Jb7QsDAq6cSV1wsoCQ96rDrYj RHJXCV4cQjKTPKRtKqKEKFDeVWV+SXjdRYreQpexO8wT1J9A/g3nxw6/xAWZ8lQpgbm8sy /pVYlPRS+WgmrdlTaUk0Ubfw+vrkaJZIzPW7UlAz3S8GOO+0h+j7+ukuv8YLWDnQeNieyu jrcoZ/wgh/4W9S1yQHuMpsz7TVK/C3lbBukNrbpBGRb/RP82Goic0zmJgC9XKoSeZSJY9B rnq3OR5CaWtJ2SidiIGwhpwE2dGN3gUmoueohAcuwvI3bzs4Tr3iXqZHzRo+bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UCYAm6xKBM+RWXr5MJ6ntazcGVqmkRGyrJzCGtCmjhQ=; b=xl5295GmyB8Vpciw00HxUINEVgkMo3T1zhg15YXkKNdZDW9Y4paTf4dEpan1zQ9ke5dwG1 3PolcHpvjXB8zCeaS14wtDszNyizajkKS6LBCOG+dvuVD1WbAEvlOHHucvWrbl5Hb2yAqL 4Ef0d1rBOlPR0dwwVxF4d7PHT2G2IkGka68/LjbAGflJgeaI2hzwlsA1DtJwUTcP+77juY 1V/gpjTHneX+wT+b7EZJd3kVt90Xna2yACDlopGmf1xtRr6fzXF+yN5OfJRXTnCiXblgLZ ATn9piCykM2PSY2i7U73q8VPGu3kapwzM4+wLjxWQ1nEh2bu7nPVSRajt+koLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZh5R2F6Lz10pD; Thu, 1 Aug 2024 20: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 471KrlTm071672; Thu, 1 Aug 2024 20: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 471KrlVf071669; Thu, 1 Aug 2024 20:53:47 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:53:47 GMT Message-Id: <202408012053.471KrlVf071669@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: dd718119f202 - stable/13 - sctp: document sctp_recvmsg as implemented List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: dd718119f202503826311c9455d625671f944155 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=dd718119f202503826311c9455d625671f944155 commit dd718119f202503826311c9455d625671f944155 Author: Michael Tuexen AuthorDate: 2024-05-02 13:17:43 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:52:09 +0000 sctp: document sctp_recvmsg as implemented PR: 275990 (cherry picked from commit eee88ef45f78d7f9996a740c2a554bc6e8496114) --- lib/libc/net/sctp_recvmsg.3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/net/sctp_recvmsg.3 b/lib/libc/net/sctp_recvmsg.3 index a5f794743f53..a529fc29110a 100644 --- a/lib/libc/net/sctp_recvmsg.3 +++ b/lib/libc/net/sctp_recvmsg.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 23, 2015 +.Dd May 2, 2024 .Dt SCTP_RECVMSG 3 .Os .Sh NAME @@ -39,8 +39,8 @@ .In netinet/sctp.h .Ft ssize_t .Fo sctp_recvmsg -.Fa "int s" "void *msg" "size_t len" "struct sockaddr * restrict from" -.Fa "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" +.Fa "int s" "void *msg" "size_t len" "struct sockaddr *from" +.Fa "socklen_t *fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" .Fc .Sh DESCRIPTION The From nobody Thu Aug 1 20:57:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZh9T46bFz5RRnv; Thu, 01 Aug 2024 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZh9T2sM2z4P4r; Thu, 1 Aug 2024 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5g+pHC5XhKz9Lv8gJL9nOuYEyZPgua7BxbEYq3dEgk4=; b=oYevxK4aec9KXMl2ch1LmIY3nje/8gypsdVF9NnCEUUnBCAXM87HmU5UDN54Z7zN5yvUWH y1Q8JCnmfxhM7LM4tmIvSckHLRzlJTUrfrcScAQH6q8PisQhx8pRfkqefG+AcJQ8785YHR rkMYRu5Jl/rhbMp6GbA1ss2ylgyhwZhJ59m8yQUUXKxps1t1VTFGY+xp/S598Va76iXHvY k/9Qi4BqkMXfQhw4blDgA01LRIhAjU5L7rKAClyhHP3XFqQXJ4dCFFCP1yNseG8b1hiN5M WGwDCT3z++IvilTPYPkdJpoJzeFyunsExyr47NiAHd9zw+9BlihkdkuhVlOOiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722545837; a=rsa-sha256; cv=none; b=mC445JkBGW85gQqqW0pveKbmScjwqx9qKZlHziFpfHt6cQHbNvjjDLLI2cnICerBcv/gbq Jwm1ext/liXFi1okGQ308qj8gYWBr8rgxVdxN9NIfUv0FASOhr8wevtTaekBlmzlzNGUQw jh9MhwcK/7NTn4HjhsOOu8JGU78ggH/aRQRj6mJ4U9O3zMCOaP4/jZRX07vLBkI9XOnELS d8UaKye/7XSUOJYl1pJ9wno3p+2mDV5D6wQ00tZJdJeZ4B/mQAphc1grKXOHxPhmGN3SO8 Cu9+/Tq1am+pGJ6S9lRlil+vnhIb5YZMX49s9L2X0D1Rdmnnidhm3wLqMY/Pcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545837; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5g+pHC5XhKz9Lv8gJL9nOuYEyZPgua7BxbEYq3dEgk4=; b=Wbc7w5DXDUY4TYYQahr0RXnWt9H0O2RO89iKjXj2kpz/OEcxbsFHsii5TjaH958j+MkvWL yIXreROQfbWS36w+EK0ClDr8nawdPsjFF4Y1Zm12327PJJpCby5B+n1exS+U+vT0Fc/AhR hHaOae90KWaaWuZ0pLz+EiyCiHYT6rjGXaFtplb1cbedBfB5Yfpv4m2mSDHWrumtqmZMRP Hk0913kn1oDvtv/iMiL9cDyKuh6nUNh5nrXKNNbsDBtgiCOj814mHWX8pEuni5OIFkN4AD BGMuTsWhmlETRev+/fJZ9iR1G9d/2S57o3+uEE7OuU/pkSyM1Qmj9pwQiFf+zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZh9T25PPz103b; Thu, 1 Aug 2024 20:57:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471KvHXV072286; Thu, 1 Aug 2024 20:57:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KvHPq072283; Thu, 1 Aug 2024 20:57:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:57:17 GMT Message-Id: <202408012057.471KvHPq072283@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: 75ee09cf628c - stable/13 - sctp: add missing check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 75ee09cf628c6cfb58a26283fcf1c05b5c97306f Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=75ee09cf628c6cfb58a26283fcf1c05b5c97306f commit 75ee09cf628c6cfb58a26283fcf1c05b5c97306f Author: Michael Tuexen AuthorDate: 2024-05-08 21:01:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:56:27 +0000 sctp: add missing check If memory allocation fails, m is NULL. Since this is possible, check for it. Reported by: Coverity Scan CID: 1086866 (cherry picked from commit 3d40cc7ab888a37a3ba085f377a057396a7d2476) --- sys/netinet/sctp_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index f13010e54521..13a9a65da9eb 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6635,7 +6635,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, } else { m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); - SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + if (m != NULL) { + SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + } } if (m != NULL) { struct sctp_paramhdr *ph; From nobody Thu Aug 1 20:58:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhBm68Zgz5RRpB; Thu, 01 Aug 2024 20:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhBm5Yg1z4P6W; Thu, 1 Aug 2024 20:58:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7p8Fr/tx5A1PLkjBSMHaZIFbxoVoQGoxwTQaCWh/Z0=; b=ZOF8Qr9lfN1ixTVmzGciHwe3PTVaWGGYyUK4pvaGx5OnmaXd6ctZjyS8R91z9Xczn6GI7j ieiweJ8FOjyrH4i3SSn5wVueV242LudOppXM4N0IyS8+u4f80S2ihaCN7AONDT2AjoWEnx ZNkJR4Umkw24m8FxWRLwhQc3sj98QQSrjYaY3COtI+e8XE6AT2fUK1NyT6PsIdCEyORGVY dh/CyiGJ6y0Rgbgt37liP5gX5DarSqOe0yba6WIfK3a6cFeWswzUrN7F5tduy1TQKWJIKs 3ipV9/u+RpkUEI85We45GTrB5ldwZF+7O17vQeDdup1kBrE/IwieFpMGWIY2Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722545904; a=rsa-sha256; cv=none; b=h321XdX1A7s2Jp/lnyX+25T8xfHBb+Ond/uof6b8Ac3VPYpdizUjRvleakHayGYerlijl3 LVJcXRiw6vpRUUpivbkFEwsMUAqwM3eWoHgbb55ONB6sm1yndSyz4gbYzn7M2Uzbf6TvUW U3mE1/PXhs7os/2yN4OZ6fSYU7Y3wpoi18Y47ExYKRvwgj20CnKOYC6hMCZyiY+IQkvTXW rHssUf/Det9bD6npkvtbq56CTdjWpEhj1PN0cJYQmgATzsS09GwEgYvuzS5LyKrRDD292E AG9Z2JQwjOQmiI0I2cnToO2xVYasgW+jPzz/BeB4hQt6bmfGf1tBnh/y8hQQmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x7p8Fr/tx5A1PLkjBSMHaZIFbxoVoQGoxwTQaCWh/Z0=; b=UmTFBtYQUG3AL/vZKx+uX6iB/2HNc5fxJYSQlpZbP7EqbbB2jJ6TpFqhLnbTMCJ06CU7A2 QmNCCXFJ926VDfyVl7S1MSttc1jpqF6RUNzJ8IJT/1eKWmI2D7oG+/MmyMYASgnTYhGNBl Zzmymmpg5JDvjhwOrDAmON2F1Yrdf8OyPKWjpynYvtSHjeC67nhHjiWkaHLurS5b+OwOZz 2YrYyCDEslaL0kvMbRkSlJNQ3aFjYmpeLDJX/2OJyJo99AX7ffmkmslefMnDRTxlGPOFEH CK9+YAKDX6Eq2ATBZzpACSJNK3zheQGGQfwGMJUSSRMl9Lfq7IXTLN6SJ/fotg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhBm55qhz10m2; Thu, 1 Aug 2024 20:58: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 471KwOn3072570; Thu, 1 Aug 2024 20:58:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KwO7N072568; Thu, 1 Aug 2024 20:58:24 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:58:24 GMT Message-Id: <202408012058.471KwO7N072568@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: 27f782e804a0 - stable/13 - sctp: fix sctp_sendall() when an mbuf chain is provided List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 27f782e804a00e15e40e28efea6aa88450838e13 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=27f782e804a00e15e40e28efea6aa88450838e13 commit 27f782e804a00e15e40e28efea6aa88450838e13 Author: Michael Tuexen AuthorDate: 2024-05-08 21:41:17 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:57:54 +0000 sctp: fix sctp_sendall() when an mbuf chain is provided In this case uio is NULL, which needs to be checked and m must be copied into the sctp_copy_all structure. Reported by: Coverity Scan CID: 1400449 (cherry picked from commit e187fa56904712cb4dac9e14c81c88821582aeb4) --- sys/netinet/sctp_output.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 13a9a65da9eb..e719a5706f3b 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6841,10 +6841,20 @@ static int sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, struct sctp_nonpad_sndrcvinfo *srcv) { - int ret; struct sctp_copy_all *ca; + struct mbuf *mat; + ssize_t sndlen; + int ret; - if (uio->uio_resid > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { + if (uio != NULL) { + sndlen = uio->uio_resid; + } else { + sndlen = 0; + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + sndlen += SCTP_BUF_LEN(mat); + } + } + if (sndlen > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { /* You must not be larger than the limit! */ return (EMSGSIZE); } @@ -6856,12 +6866,10 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, return (ENOMEM); } memset(ca, 0, sizeof(struct sctp_copy_all)); - ca->inp = inp; if (srcv != NULL) { memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); } - /* Serialize. */ SCTP_INP_WLOCK(inp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) != 0) { @@ -6872,15 +6880,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, } inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; SCTP_INP_WUNLOCK(inp); - /* * take off the sendall flag, it would be bad if we failed to do * this :-0 */ ca->sndrcv.sinfo_flags &= ~SCTP_SENDALL; /* get length and mbuf chain */ - if (uio) { - ca->sndlen = uio->uio_resid; + ca->sndlen = sndlen; + if (uio != NULL) { ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); @@ -6892,20 +6899,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, return (ENOMEM); } } else { - /* Gather the length of the send */ - struct mbuf *mat; - - ca->sndlen = 0; - for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { - ca->sndlen += SCTP_BUF_LEN(mat); - } + ca->m = m; } ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, (void *)ca, 0, sctp_sendall_completes, inp, 1); - if (ret) { + if (ret != 0) { SCTP_INP_WLOCK(inp); inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; SCTP_INP_WUNLOCK(inp); From nobody Thu Aug 1 20:59:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhD05bGvz5RRjx; Thu, 01 Aug 2024 20:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhD055hMz4PM7; Thu, 1 Aug 2024 20:59:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1cT5MBtnUs1dxYvpz1nxY6w7qZqZf5APKg4EtKt+rg=; b=DjigQnTR+mFpqVAXCuOArzz9uQyGEou68F5rE8six81MckjAmGARvcGzrIiwi31Y24n0t3 op6/7pQNd+teQxAK8lXo1XKhYbpGGySqiX4cki2TCkrCIX7JyNIdURic0IZTrFPOx/oqmw wD5IUVTv1GbiIq36SpybBKxCVabd1TLUix2R/DnipYnvoWquU/ZliJs6AdJm7J7fdWMCqr TKyi6vSDvUNkGoq0aJx4h4rMYev0lwsSNkDdNmKpWsL3eGfRA7jPFA6RIZxB0hDEtRG0Sv knAfXYlmjILPJdPpByyyC0l6Aw81qz/G4mU3esv4XJqtrbAL3hKra+pCHg9oaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722545968; a=rsa-sha256; cv=none; b=bkGDEbRdTTtoRJqibs389FPte07+Cy20QYgAX7vtDN2VJYGfUsmwaRG/aLhE/Y0bbmBLL3 68zYNwZ2Ob5v2daZq6XOrHYiETBIMF9yQUrGB+7ckJ8u7OY2iaGXuOStXuirJSLajc3DXo +AA93KMs+hlNEW+K8je2wFBnWVQqpv/f6Lc60fUqkpYgHE92kdtp4uXK7GtE4ezhN0+/tJ AnY1ITynPGwPFN5Ftx+gW/S/B9E5mYM3XmQx0pmkDuFRamqFrA3B/6vsnNYHRnR97+iNak InoBXI9rg6PkTny9vXUF5GhTqP7syfJfZOpkMrmRdIkpLzNsoNxxz1mf+X6MXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722545968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b1cT5MBtnUs1dxYvpz1nxY6w7qZqZf5APKg4EtKt+rg=; b=m2WJXuFKr08bJh7wvXqvtPRdtNrrzFEKjHgKA0PwNvbRv+nBouEGbQTj3pCLGbnzBJ0OYZ /PUjOIj8ZAgaWSOiP8LwleQiGUXbs25KlkpvKhK+UU1ZA51OvvVB96BUD2/GJmU6YGNgx1 UqypFZBvf0z2XmsE7ndJTDIpnCFp2LglHJTW7aXsPQV7vEtsGX3nIG8nFsBXIw79DrFfFV jDYtb+tHYrS1t+zIKitKAOM54VytTG76yjz2EvRY5GVRBVTSS+KsvhauMisG+VY3J6GAi/ vmBy2cU1WEIeTisYodA0ynJ+Q8k5V+FPbemInrijfaKNIqRYVjVSij6k9w/YTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhD04f2Pz10jY; Thu, 1 Aug 2024 20:59: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 471KxS1L072870; Thu, 1 Aug 2024 20:59:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471KxSKP072867; Thu, 1 Aug 2024 20:59:28 GMT (envelope-from git) Date: Thu, 1 Aug 2024 20:59:28 GMT Message-Id: <202408012059.471KxSKP072867@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: 1de31f53f9e4 - stable/13 - sctp: don't provide uninitialized memory to process_chunk_drop() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 1de31f53f9e4f3fd9e3cf72f2cfc7d62d17bf1e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1de31f53f9e4f3fd9e3cf72f2cfc7d62d17bf1e7 commit 1de31f53f9e4f3fd9e3cf72f2cfc7d62d17bf1e7 Author: Michael Tuexen AuthorDate: 2024-05-08 22:17:13 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 20:58:51 +0000 sctp: don't provide uninitialized memory to process_chunk_drop() Right now, the code in process_chunk_drop() does not look the the corresponding fields. Therefore, no functional change intended. Reported by: Coverity Scan CID: 1472476 (cherry picked from commit 83dcc7790b11e605c32ec9a091c6bba3bc921083) --- sys/netinet/sctp_input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 7ad9eec07897..b6239b0d9ad6 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4229,6 +4229,8 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *cp, SCTP_STAT_INCR(sctps_pdrpmbda); } } else { + desc.tsn_ifany = htonl(0); + memset(desc.data_bytes, 0, SCTP_NUM_DB_TO_VERIFY); if (pktdrp_flags & SCTP_FROM_MIDDLE_BOX) { SCTP_STAT_INCR(sctps_pdrpmbct); } From nobody Thu Aug 1 21:05:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhM130cFz5RS2H; Thu, 01 Aug 2024 21:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhM128ZBz4Q7Q; Thu, 1 Aug 2024 21:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7DXbapQQs5fVltH4+rxX4UKSwxbGVShnK+jxlMrur0=; b=gzyk3OsNJbxta2hDJMJlniBjEpmkxYzU/HDFSBIl2mRlB+gSR5xoaK50FNpW2VSPARZi2z UHjuZf1citSU3t0WK8IRhjP5j/aCoNHbBTcWDjE1AKBaO8UIBo2dp7aWPessjDQ6jEE9in DsVCl00ImxHbDsPymjY0HNVkiM/PgIZo5QddC7zk+yMqFEy+mwdJVlHYVQ9WxtwHm1TOqQ 6CypShCED9Ke2dvCZAxqGbhVj9/rDVJu/bq2Lcxo/L6Sqy5vINnEpqDc9eHBqVW2KFChdt ff8ULQCgHwiqrv/EJ8j98V59QI6A8R5qTQpy3Inex8TOeI6oNOKpRUYkP7vfqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546333; a=rsa-sha256; cv=none; b=l6800jdZB+dqmRUUYDc0enLc7+nhh1UklYvl7AVZCjTl2DDdiJKaqNazu5HZmcyJn7AmUh Ai3CAZXHjBq3x6hgiKpi1riWG2RYgeVWYgOIFpxsJUX80FUOsQdkJtHQ+uiSv6MKSWDHll i9AkIDIRM3+eGQJ5hWKS51uQ8kYMT72cFrm0m/XkpZXAvOo54cTCUPaLS83s8vTCnyyK6h M0aKe0MNkHDP1l+0/KYaEuP9Jd0si4rOCPmh0ucR3dvHZ8xpR18RqkIW5K4wnvIUC9cmaa ZE4n7CV8OHl08hCwkukWA00EbM1DBlBtSg0AIX4aiPf2kaFDGUdpmsFwkws3ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=v7DXbapQQs5fVltH4+rxX4UKSwxbGVShnK+jxlMrur0=; b=Gq1MckTc/3JywGB+m7LtW1J7GIAWkNUklhh2CcF2z6vPJhDs9ioYn1/NvxNomQvCA4ZL15 xl3NbJTq76+cfwL73eJ++9eBDilLZM9bX6jtME1AM3NRp4UiytzwpJSDei85a+XiEKU6Dp N8Jrv1ialRYNQLQc0Z98e9NqfpCxKYnTWvcjqqkbW+8UF818N5GHqMLHex63UMf5VXkEFo zcOByYEI5/foTpWGxQp374T5Gc3jRUZrhtkAvaE/LZRqw9qFOIXXWk5y6QYgRBFMbpweSx eVOljPnIlbEIi668e7jhl5cFUagoBheTdv/g1E+2M56fr/bCtYNJidxYaJKM+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhM11kmbz10pp; Thu, 1 Aug 2024 21:05: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 471L5XQn090569; Thu, 1 Aug 2024 21:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L5Xfq090566; Thu, 1 Aug 2024 21:05:33 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:05:33 GMT Message-Id: <202408012105.471L5Xfq090566@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: 8dca32bcccaa - stable/13 - sctp: minor cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 8dca32bcccaa02f1dceb20944a74c7bf1623241b Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8dca32bcccaa02f1dceb20944a74c7bf1623241b commit 8dca32bcccaa02f1dceb20944a74c7bf1623241b Author: Michael Tuexen AuthorDate: 2024-05-08 22:51:09 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:04:57 +0000 sctp: minor cleanup No functional chnage intended. (cherry picked from commit 0d15140d6d3470db45d823e4f3a5ec05693b097d) --- sys/netinet/sctp_indata.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index a30fd95fef30..4c40e0de4326 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -5241,6 +5241,10 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, uint32_t mid; int need_reasm_check = 0; + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + asoc = &stcb->asoc; mid = strmin->last_mid_delivered; /* @@ -5278,11 +5282,9 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, /* deliver it to at least the delivery-q */ if (stcb->sctp_socket) { sctp_mark_non_revokable(asoc, control->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, - 1, SCTP_READ_LOCK_HELD, - SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } } else { /* Its a fragmented message */ @@ -5352,8 +5354,7 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, strmin->last_mid_delivered = control->mid; if (stcb->sctp_socket) { sctp_mark_non_revokable(asoc, control->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, + sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } @@ -5394,6 +5395,11 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, * it can be delivered... But for now we just dump everything on the * queue. */ + + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + if (!asoc->idata_supported && !ordered && control->first_frag_seen && SCTP_TSN_GT(control->fsn_included, cumtsn)) { From nobody Thu Aug 1 21:06:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhNB3cKWz5RS0f; Thu, 01 Aug 2024 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhNB35bTz4Qj6; Thu, 1 Aug 2024 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nJFbDbI6wvaknenLeTXwzJW23t8soN4h+ZaRsLBny0o=; b=veMMeik6Lm1Nmnq1weuRFQkaqRtKoViUlrduiAIOcWd9uAIF3TQJbPIAHmTpQNP82G8a/9 MlH6p3zexKaamQmbgoJNo3h300IB3xWC5CNbtQpS+9dc74tkqKfN+tfB5p1NaJktRussK5 dqL/aqrTXPySbkz8kiXD42EFGwO+Uultcbb3DbpxXI5w1tL1TX//uh6En9eMf2M5O0+vyq tU4hmdQKylvw0sw2yuDXSzAEwmiaujIva0k8piW9aCnTr4ag47vH+Nit7Tdu6Rz2u5Sai1 6CDhWX9nRukiSMm8YXpPxQJSVnEEG+vcoZUZmCzm2Fcs7zcc4fB5TpRYXRstag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546394; a=rsa-sha256; cv=none; b=FyoS1uAdc7i3eOS64VvAw3+cl5FrmLBYgKbrE4Tf7RG9fbtM13QWBEPu/OR6g+SYlDbWwi V5pGrzvvF2r9ePumivLAwjOYGs/TmejmVksMUkbbQA14PqwU7D1mPdeYtV2KNRUl9c3Kml 3BckLGZCjqAh+PgXyeZlBukp0uVbISnJ3uCJxNiaencKpNabzpkN8xvPNvWGU4AwtuQfYZ Wvv6PeOtc3Qh194NVb7BpA+r3/SfOz+0+oO3wCBUTgOAODS0d/FgCJyEPRTLs00a0vayKv Dz7GsqqHL8zWqQeBtFsXiEGz6mBnxkgV07iGDRBXTQPW4rEncqX1Ymz3xuDyrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nJFbDbI6wvaknenLeTXwzJW23t8soN4h+ZaRsLBny0o=; b=gghtRo/pL1fyVUY7BblHzZklKIEf7vVu8DAGg1f1cKmsWmxxnEG8gYjb1mwiLYER/aIbbX 3bIOA5n7XDAuqKfpKf5TTlKHGCVgNuvSxJwJrJcSAfhyvUJ+7bJmfQRjzY6uWh65oVNDFN h8zGbRTUu/KRC4qtRgree0TaflnlIQjmEH1dDqenEWnEdfdBlHv0ybs7jyGv1u0nYGPQvi x/5k+7SVstiEP0ZKGolusS3Q6sEWiPUsPmDoj9WQ95jAxbJ3jlVxgGDdj0LlZGGkR2Enmr b5PNnUeR42Ti180lKwGHBR4G7a78TQxkvlQFvzZmNuvD3F4KluBYvId+CRxNqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhNB2hvTz10pr; Thu, 1 Aug 2024 21:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471L6YxW091120; Thu, 1 Aug 2024 21:06:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L6YMn091117; Thu, 1 Aug 2024 21:06:34 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:06:34 GMT Message-Id: <202408012106.471L6YMn091117@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: e25611e85841 - stable/13 - sctp: store cookie secret change time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: e25611e8584178822a6587d74591db5557b5db69 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e25611e8584178822a6587d74591db5557b5db69 commit e25611e8584178822a6587d74591db5557b5db69 Author: Michael Tuexen AuthorDate: 2024-05-10 18:09:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:05:57 +0000 sctp: store cookie secret change time as time_t Reported by: Coverity Scan CID: 1492349 CID: 1493281 (cherry picked from commit 9d8a3718e24c9ec1ffca6efba64aba3e308aee96) --- sys/netinet/sctp_input.c | 4 ++-- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_pcb.h | 4 ++-- sys/netinet/sctputil.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index b6239b0d9ad6..65a60d539a5e 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2327,7 +2327,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, } ep = &(*inp_p)->sctp_ep; /* which cookie is it? */ - if ((cookie->time_entered.tv_sec < (long)ep->time_of_secret_change) && + if ((cookie->time_entered.tv_sec < ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* it's the old cookie */ (void)sctp_hmac_m(SCTP_HMAC, @@ -2350,7 +2350,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, /* compare the received digest with the computed digest */ if (timingsafe_bcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) != 0) { /* try the old cookie? */ - if ((cookie->time_entered.tv_sec == (long)ep->time_of_secret_change) && + if ((cookie->time_entered.tv_sec == ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* compute digest with old */ (void)sctp_hmac_m(SCTP_HMAC, diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 3435377e1064..5d603a3f26d0 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2569,7 +2569,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) /* Setup the initial secret */ (void)SCTP_GETTIME_TIMEVAL(&time); - m->time_of_secret_change = (unsigned int)time.tv_sec; + m->time_of_secret_change = time.tv_sec; for (i = 0; i < SCTP_NUMBER_OF_SECRETS; i++) { m->secret_key[0][i] = sctp_select_initial_TSN(m); diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index ca51f519a24d..4334595f208f 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -263,8 +263,8 @@ struct sctp_base_info { * access /dev/random. */ struct sctp_pcb { - unsigned int time_of_secret_change; /* number of seconds from - * timeval.tv_sec */ + time_t time_of_secret_change; /* number of seconds from + * timeval.tv_sec */ uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]; unsigned int size_of_a_cookie; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 8b2e95158ebc..68484409d038 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1942,7 +1942,7 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - inp->sctp_ep.time_of_secret_change = (unsigned int)tv.tv_sec; + inp->sctp_ep.time_of_secret_change = tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; inp->sctp_ep.current_secret_number++; From nobody Thu Aug 1 21:07:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhPN5Sqxz5RSPb; Thu, 01 Aug 2024 21:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhPN4rK2z4R8H; Thu, 1 Aug 2024 21:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZojAjUHU8xUWg0dqyEuYQ398v6D0z0s5HLJK4mtiI4=; b=VN08NU4GmCjqRaIHkQausUmQaoofLiwHVFNe76vZ05t7c4DTJwg8i3XCw4S01bKX1fjRDN hnGyxU7HNR+3LaBeaE1VXfGqFB2hdC6hw2jORbbOxasCRncRbJ7SyoTVlbNYIoPUw7eCvN rGZQgxDzcy1BpTYYA8ebuAJRg7Yxmzi2JOUyjBKWZv12cMed/7tmVdabN62zkZGrXOVepZ xt5K+Umy2LdHTU1sCLgBc9R4ND0elxrd3XH22vVFBmgpmzw0fpC8dqhs3ayGNVEQMQd1Cr ziBQ3sEO2GrB3nDRvyonaiqa981qpSxxNA5o5fYentQ81Ol0tJztLmER24cBPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546456; a=rsa-sha256; cv=none; b=VQTH4ShP8/nYMRtAcIb2+iT+5IFbrs0qjXvCn8vq34EnYQ4dArkXYIx67etNBvt4QdxG7x JdN8UlRs6Xwx6nzKyTqDx+XyDc3yhq6LnZa4/3UdG41N8HdFFjgJexBo32cBkmyEsfgUus CvhT2OhUsiNbB3/cqZH0GuWmvzccYzLpj50akn1zPh6fs+z9jpsoIkg6guMoT3V3khnZRi PYISMxyhfm1x6nGA72Ic8EpqDMwTmQgVkLBWNAO7ihyqHwOxj8TkjGiPFhO/gOhmFlhyBH HIP0uEv5qLkSvZprH65k0rRqfYaqOUO2Cp+Frn9XtLN/+cBrTpeiM8rqW82+Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ZojAjUHU8xUWg0dqyEuYQ398v6D0z0s5HLJK4mtiI4=; b=p0GxjGDxWKN3gkk6fFvwTwpKLBOuR4w9pRLWTeshaxQFo4ZMNOZd78Fxq0XgHehl7oczhB Vw2iy0UE1tpVhgwRmC/CbmRNXtuHacDeCf2YKO+bsm5S96Ka5ZbLgQad1WVE/wFSwa2yxb zH9Dg4b2jcqdx5a51Zuj7xhoNglfPCC4ekRhpPYOSPoK7/xdHXek17BIyHAUswcQjVz4W6 cF2hFkb8yEACpJeOvi7x5kHF+j90tW/nqJWniyHmZUgZNggkeVD24a6iIdWnccfDxxDJig JpZN/zEYr8B4w+QxaZ/1CyC35cRoM7GQ2hVUhjGKWrDYy+B62aTElYoeFgx7+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhPN4RR4z11DR; Thu, 1 Aug 2024 21:07: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 471L7aAQ091400; Thu, 1 Aug 2024 21:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L7asV091397; Thu, 1 Aug 2024 21:07:36 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:07:36 GMT Message-Id: <202408012107.471L7asV091397@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: 90f47ea0d6a5 - stable/13 - sctp: store vtag expire time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 90f47ea0d6a5fe56953ecc8749a11126b874b51d Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=90f47ea0d6a5fe56953ecc8749a11126b874b51d commit 90f47ea0d6a5fe56953ecc8749a11126b874b51d Author: Michael Tuexen AuthorDate: 2024-05-10 18:25:04 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:06:50 +0000 sctp: store vtag expire time as time_t Reported by: Coverity Scan CID: 1492525 CID: 1493239 (cherry picked from commit 42aeb8d490fb7e8f4c9d27b3797179b861bd85e3) --- sys/netinet/sctp_pcb.c | 12 ++++++------ sys/netinet/sctp_pcb.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 5d603a3f26d0..f3b51b796df0 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4540,7 +4540,7 @@ sctp_del_remote_addr(struct sctp_tcb *stcb, struct sockaddr *remaddr) } static bool -sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) +sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, time_t now) { struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; @@ -4562,7 +4562,7 @@ sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) } static void -sctp_set_vtag_block(struct sctp_timewait *vtag_block, uint32_t time, +sctp_set_vtag_block(struct sctp_timewait *vtag_block, time_t time, uint32_t tag, uint16_t lport, uint16_t rport) { vtag_block->tv_sec_at_expire = time; @@ -4577,13 +4577,13 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; struct timeval now; - uint32_t time; + time_t time; int i; bool set; SCTP_INP_INFO_WLOCK_ASSERT(); (void)SCTP_GETTIME_TIMEVAL(&now); - time = (uint32_t)now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); + time = now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = false; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { @@ -4595,7 +4595,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) continue; } if ((twait_block->vtag_block[i].v_tag != 0) && - (twait_block->vtag_block[i].tv_sec_at_expire < (uint32_t)now.tv_sec)) { + (twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { if (set) { /* Audit expires this guy */ sctp_set_vtag_block(twait_block->vtag_block + i, 0, 0, 0, 0); @@ -6726,7 +6726,7 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * return (false); } } - return (!sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec)); + return (!sctp_is_in_timewait(tag, lport, rport, now->tv_sec)); } static void diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 4334595f208f..ae062c553a57 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -130,7 +130,7 @@ struct sctp_block_entry { }; struct sctp_timewait { - uint32_t tv_sec_at_expire; /* the seconds from boot to expire */ + time_t tv_sec_at_expire; /* the seconds from boot to expire */ uint32_t v_tag; /* the vtag that can not be reused */ uint16_t lport; /* the local port used in vtag */ uint16_t rport; /* the remote port used in vtag */ From nobody Thu Aug 1 21:08:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhQL3JcQz5RSbN; Thu, 01 Aug 2024 21:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhQL2Vcyz4RGZ; Thu, 1 Aug 2024 21:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ptE438r/kB/5FjMHObr2Id2T/JcN1nbh6yFgD9y554=; b=LtFehEFfOsxHzNQX4ojIE8Nmf1SJ0RhrhRHqbzta0Qic2b/O+pSxHzaCYOTqMbNvZ5y/S6 H4Nz3BoPWL46Mbl8pPfAaWlVKoN+5QUdKjCLP6kJkA8usfIUatO4vch144rRxBE0RjQijw 1RbExgfRg0alP7r3wVNswtUWbJTeEUhF6xmbZGtRBx/vcdUZrtYD8m+f8t6riBEWaYPYmV dRLjyI9FzuEByIrP2Q90lL+Cbe+vyeN4cVXx/tinp4ZwOR9//xAvQIiMC7aOwwdxnZEZGf IcnSmHHJCrWRGAZO+c+pp13zdexSQVve2zGAFVZu3JQKkT/X2GvcNQtuZ5MV7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546506; a=rsa-sha256; cv=none; b=TobscA513Oq7980SG7PwrSP7U5T5dXL5rBEq9lhExOwFkXSEKthzEbm1C55ZmZLiACRkxX o1pzaOwIQhFSnrMvqlxWn7aKhhojWoJwUD5YUm4mIGW7wRY5H197AefpxO0n7wsjBZgV4t g3G3hh3TB+KtMMyRYQcsTQPhizHcZS6H1I1+pj/Ghhsw84sBoDIlhAoqtebG8PKjKW21Yb K/hFlMz2rPo62r5KvPDra8X6chFMyyNBO77eR2Q1f2Ma+J8smQsTczH6utHTTSXhBs+DIa pR+rqw1QXWOc/RV8SQ8brNUNONLUwj+UrwFk5k9DBgi6Pm4worlDGduAmiQ+dQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546506; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ptE438r/kB/5FjMHObr2Id2T/JcN1nbh6yFgD9y554=; b=REQ07uZDq92rjJbJSkRWV+6wYCJxDCBv4vWpk36lOOAQ/dgaN9cZVy1rE9z2sCaky5fZhQ s93C4xNcJN51pwJz+LvVZInBw6TYyeIQkpRSSz9P3hvjG81e9hABO9cMhD3QkvjJVLkpTn eKOi0CcC1tZQy69AX/+TJtBNj/TQP4aVQaXLrKxFVX7wF0U5gstYSirC/yPEGbFHmven+g IC+pFmWPivH7zY17oq/396yGUPz8ce/WbPhUdMOoOblv0eLqCfXYMohFO/Tu/aN6hqk3oM 9Ou6ypoXG5lwg5FNI5G8/Vi76K5Q6gwynsr+UvnHpgI+iVRxElXSUr6X3yh5HA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhQL25Gtz111s; Thu, 1 Aug 2024 21:08:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471L8QRa091656; Thu, 1 Aug 2024 21:08:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L8Q9b091653; Thu, 1 Aug 2024 21:08:26 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:08:26 GMT Message-Id: <202408012108.471L8Q9b091653@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: 8d9cdf264e43 - stable/13 - sctp: store heartbeat creation time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 8d9cdf264e43209a367d519b9443888dd0bccdf4 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8d9cdf264e43209a367d519b9443888dd0bccdf4 commit 8d9cdf264e43209a367d519b9443888dd0bccdf4 Author: Michael Tuexen AuthorDate: 2024-05-10 18:40:15 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:07:52 +0000 sctp: store heartbeat creation time as time_t Reported by: Coverity Scan CID: 1493087 (cherry picked from commit b67716dd58b93f373523cf35373c56fcfad44b12) --- sys/netinet/sctp_header.h | 2 +- sys/netinet/sctp_output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h index 811cb8bab158..0fbfbd213eed 100644 --- a/sys/netinet/sctp_header.h +++ b/sys/netinet/sctp_header.h @@ -83,7 +83,7 @@ struct sctp_supported_addr_param { /* heartbeat info parameter */ struct sctp_heartbeat_info_param { struct sctp_paramhdr ph; - uint32_t time_value_1; + time_t time_value_1; uint32_t time_value_2; uint32_t random_value1; uint32_t random_value2; diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index e719a5706f3b..bf4d383d732c 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -11286,7 +11286,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked) /* Fill out hb parameter */ hb->heartbeat.hb_info.ph.param_type = htons(SCTP_HEARTBEAT_INFO); hb->heartbeat.hb_info.ph.param_length = htons(sizeof(struct sctp_heartbeat_info_param)); - hb->heartbeat.hb_info.time_value_1 = (uint32_t)now.tv_sec; + hb->heartbeat.hb_info.time_value_1 = now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ hb->heartbeat.hb_info.addr_family = (uint8_t)net->ro._l_addr.sa.sa_family; From nobody Thu Aug 1 21:09:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhRg0sk9z5RSWB; Thu, 01 Aug 2024 21:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhRg0L2Qz4RPq; Thu, 1 Aug 2024 21:09:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8y/cGIMK/sUmlju4uAv2a7BKaWrszcgTDpt0WyQVd4=; b=wrcoucqQbph2ajbYxnuiLrLoZak/lJ/1iykjCMLEGHL7S3ydJrmmfe3Z27dA2M6yI3wboo aqP91h4nL2IjN4rPyGNKJ34CxW5dlFzElHRHUR075SsU/vCNOta/T+rKV6fjxXAKKTCMLK 1k09WJLV02PEZPFkJOz+MDRkuitStgcvOkjfwW2pb2udOdnyWqEONaNBlE9DCC99GBGvuv AfkzKgijiGQDu2yh9qzm/iqNq9nCdBgMzCbJ9kqICi/zdrTmVtMoQ8MjidtDaWahns06cl Nzd6zQOXI6JJ25dcTFXsX+HYohzb7IeCz7aV8R4z5aFbkfyR8GhIeASBkcndhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546575; a=rsa-sha256; cv=none; b=CD+U2VzOwMzmFpJMlRl2oXDzh1OEkpHwxZ98mq5x2Lf7Xf/n93p2QrPM+9bZCVAjaHqt3M XR378MbD0yRFbma79BINfssyffodN6/7HPUPT9FF7vpjSGZdlJB9mgI4Wy8J+WzAA36xqV 3deB+FnSa4Lv794YNPcGlwnwH2xhDUlTcK9to+AdQ/VEfWqtNHeR9wgd6puyaEBbnV7dXz GzPsw/qvTiOLruVxiLTB0pFXUxKzUenHZ2+KAiP9mcJ8pJcVWCZdf5fgZJ1+1EJYzztavS 1joObbG5BJuP0268GcEWULp+dYBW2Juakvk/w1jzLADG2PNiAI2CdzUkguGTSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546575; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j8y/cGIMK/sUmlju4uAv2a7BKaWrszcgTDpt0WyQVd4=; b=uDpo5jKiphZr2XmlN0EI/zcccO5ZhndjweGwk12gHAORJoklXsXhmQBjjpfieZCu5+9yz1 492yeB73AluTHdRYv+JIaXRSRxNMD0aXu6bLoUCuzqncBCqcQXK/kw/LRE+4pfKC4i6RjC wQcrqFyrwQ3prBMZ5SbrHmlTLG2mhlS7H8dlsuzCL7V0cNYOEYZeK7dnS2n044ca60ssX8 9/SsVvF4t/rKw/2o7iRreRvx/OTDLRIsL3P2tbKgV+u/wuOfW+qnRdM71VyXK6/wUrByte CP9RyT9eI6kpSMXR+Sbn8dPQI7lu0y145GLXQwJVN7Rjix+Cv73vlonv4c6T3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhRf73xGz11DS; Thu, 1 Aug 2024 21:09: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 471L9Y8S091957; Thu, 1 Aug 2024 21:09:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471L9Y4m091954; Thu, 1 Aug 2024 21:09:34 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:09:34 GMT Message-Id: <202408012109.471L9Y4m091954@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: 162c10990fdd - stable/13 - sctp: improve heartbeat timer computation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 162c10990fdd2f82d479598f39af250191928453 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=162c10990fdd2f82d479598f39af250191928453 commit 162c10990fdd2f82d479598f39af250191928453 Author: Michael Tuexen AuthorDate: 2024-05-10 18:58:01 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:09:03 +0000 sctp: improve heartbeat timer computation PR: 278666 Reviewed by: Albin Hellqvist Pull Request: https://reviews.freebsd.org/D45107 (cherry picked from commit 5120ea0d8871fd5d56a8fb70117b727b9d8a4e62) --- sys/netinet/sctputil.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 68484409d038..40a7500fc69c 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2287,19 +2287,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } else { to_ticks = net->RTO; } - rndval = sctp_select_initial_TSN(&inp->sctp_ep); - jitter = rndval % to_ticks; - if (to_ticks > 1) { - to_ticks >>= 1; - } - if (jitter < (UINT32_MAX - to_ticks)) { - to_ticks += jitter; - } else { - to_ticks = UINT32_MAX; - } if (!((net->dest_state & SCTP_ADDR_UNCONFIRMED) && (net->dest_state & SCTP_ADDR_REACHABLE)) && ((net->dest_state & SCTP_ADDR_PF) == 0)) { + if (to_ticks > 1) { + rndval = sctp_select_initial_TSN(&inp->sctp_ep); + jitter = rndval % to_ticks; + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; + } else { + to_ticks = UINT32_MAX; + } + } if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { to_ticks += net->heart_beat_delay; } else { From nobody Thu Aug 1 21:12:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhVs1WwTz5RT9S; Thu, 01 Aug 2024 21:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhVs15FBz4Rjt; Thu, 1 Aug 2024 21:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EmhD9BE9DmTQXbQaLfdSo2IvpCgVFzyOPEJ5VmwUf9I=; b=HX2SLh19DA5LiD++s1hrGae3L5+Sc8OgFapngRiH1Yiv9/ZNRnEUYR/ZVdjsjq10Zq6/vE bbcJnwPjg7ouS6yCNJF8WQyHWH4go09pDK8wNJPMMXi3X4LhtXB2zBVfVhoxLdOVCPD4Zh DU5iDD/0UnKGpBS8wUU/M+3T1lcY/x1OcJsFpHUIwRdsuagy5oNQGiHY9roUBxb9PyuQ3Z TXk3eBQmzaMJEoqCwpCGl4EziWoNLOfRaU3NkqrUo2JpcogXiZBAo4A4nOrqGKxrAVRz2+ o8B4RGjV4k9ZyL3VhhNnqFfnnxEf5JszTkdtJhu5jaw56eJMTlavXNsV0m2x9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722546741; a=rsa-sha256; cv=none; b=IDSwYiyPW4xHyKadEiBYUs4wQSCMymkAFF+Aej/0WyeIsMgyCtK5HhEGPgu7AW1IRpxeQa O5lJZCtQcgDZlGexG1sycdSMAIqcG2YG0x0Dc9hspXoqKtQkLQfxMSdw/3K+g/CBlF3H9D QmGI/nwNKouHGIgpni2jRDikQkSiGyUiasXWDCcB2Ko5/0NwPvalwLZ095r+TJ4aZ1Dkt5 NydyGa3jPm6O4wcW6Fw9LHDf1pGYeBkdCRYs56o33WkKZ9MjIK3lnFYXtgDghEpWinTa9H 4M53B6byPQLd3zphBL+QsxbB9Upffs37iBHt6RJBl5tMQsDyhhzHBhWTFkvOSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722546741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EmhD9BE9DmTQXbQaLfdSo2IvpCgVFzyOPEJ5VmwUf9I=; b=Hkl86fEkT0N9rvLlCnX04iM5n6lrjRpou/vPtcUPuUOTaW3PArGZzw1hyIhSLCrqMw2eSg b+QS1a8L6agdT0JkNiktghivDGDmPPL6WRZ7CcrHzEfCUBfwEQSpBGtD/dRfJKlAj2aie2 8punPjjbp2o+iNfkyqsDBa9RcvzXamuH6mJEd4tssbIvzKMJDT7rg1nu1kYw+CL54iZJQa 6eTkhNERq/yRoOFiOauTb4XNuoo0+5y/l4ASajjAKVL90AUpduXCSW3BUWtiPBhXRdKORk Bqjf1SD3lTIAPjLEzsTO81j7ocB7zeV8bCkwyc9/ByyoQuE8L+CsQCjVV5Yx2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhVs0hvTz114m; Thu, 1 Aug 2024 21:12: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 471LCL7M007964; Thu, 1 Aug 2024 21:12:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471LCL0X007961; Thu, 1 Aug 2024 21:12:21 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:12:21 GMT Message-Id: <202408012112.471LCL0X007961@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: c4dbe6976bd7 - stable/13 - blackhole.4: improve man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: c4dbe6976bd725b9e69290aa017e0ef18b5d7880 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c4dbe6976bd725b9e69290aa017e0ef18b5d7880 commit c4dbe6976bd725b9e69290aa017e0ef18b5d7880 Author: Michael Tuexen AuthorDate: 2024-05-22 18:36:24 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:11:54 +0000 blackhole.4: improve man page Not the connection is dropped, but the incoming SYN segment. Reviewed by: concussious.bugzilla_runbox.com Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45296 (cherry picked from commit a45a9e61b498393b05f3e1e2e3e6131c7b484dc4) --- share/man/man4/blackhole.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/blackhole.4 b/share/man/man4/blackhole.4 index 00c8e3d7a2b6..090f330a6ed8 100644 --- a/share/man/man4/blackhole.4 +++ b/share/man/man4/blackhole.4 @@ -10,7 +10,7 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.Dd November 3, 2021 +.Dd May 22, 2024 .Dt BLACKHOLE 4 .Os .Sh NAME @@ -51,7 +51,7 @@ when unexpected packets are received. .Ss TCP Normal behaviour, when a TCP SYN segment is received on a port where there is no socket accepting connections, is for the system to return -a RST segment, and drop the connection. +a RST segment, and drop the incoming SYN segment. The connecting system will see this as a .Dq Connection refused . From nobody Thu Aug 1 21:16:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZhbs56sxz5RScJ; Thu, 01 Aug 2024 21:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZhbs4YTcz4S4R; Thu, 1 Aug 2024 21:16:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722547001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xwE7B6elp+L0aD2w/I/ZMGun8AfyzcP1ubaLXBJsfck=; b=Rmcl6KqMVNXdjJxkLdHnW96BCshr7wt0wSQReDQnlaUil4jFtwBITTnDHFtJ6hb+onxFYL xOOQ7hHjOhL7zaMC28JD5mkQVGrwN/otgt8/A2OtZpNbkbnQ6Ys3ENPpnebfTEufx5SZaF gpEPPCu1BDzyRwXGEIYUQmzXz0BWa0lIYKdVGhHoawJaUf3M/p5++SXQjsB9Un1i0v2inA 5MxySquPRiwfqcie5e1NA/Bv0Dena3FKain8Xln8fgSrjcuEJADXkcD0Rn2kBfe+Em90GC FowCv4x0uwFlpDc/Op9wdpTsYYu4XpQWYDPS2rmS95TsZ2yiptO+Aogd+ZzxEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722547001; a=rsa-sha256; cv=none; b=n9VYKGzzKAyrtWVs5Hbl2rZB0HJdFXQwZN0wE62PB0gsAdgDfuE7Tn76EBDDRZbRST4z4q 50IVixy67lpjegC6zrkqDa+h7Te7CwJEwbUWXBMqrTn+ApjPp2hFY1eJagAVz6hv8nOLEV LWfaMADEgCoQhdn7+rNTF8C8Rqf0nwLrtidZKVWo9LZjtM7TuoYHW9bI9aFPL53HQQ1dwS yWFCpzjt9LTddwnEFM+4uVmYdIxDYNe+IKLLmCs4WCTxPjqmFNP6asXfqmv8w/zs8c4ogX kXrWOPq0vZU1wFHx1jlHTi4WZuU1upc4zknGw6Dm2ONrpGfwArdeJ45R+JeR3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722547001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xwE7B6elp+L0aD2w/I/ZMGun8AfyzcP1ubaLXBJsfck=; b=gXnR4UB8T4tbiwCNOZrPLq7rmOA/e+bVNck9/4t6uWV/TpP06lCJy9nfbmJkIjcsOMRZcD 5vy7DI5BHmk/ZRTDlga5EXRkhQhEPtGLyF2l//V1hcbdqaIKdfHPfzX3aXhqfnFg8D4afR L1geie2ceFZ7KHZT85Hblvf4OSY6DTYYh0xqBJHQb2smUocRVz5raS9yd+lXDNDsL7fBsp 1Ulhl0acIk7JG0H0Sw35T8dJm84w2WB51tTzvwV/TEq+H7aQMxXwpDCjndwaJHXoxHIr2a w11ShSKKnhyzOlqlziqCsEsg4qdRASRR8acf0aplipmDYjbw40CPmsSpvkFkzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZhbs49b9z11Gp; Thu, 1 Aug 2024 21:16: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 471LGfCg008660; Thu, 1 Aug 2024 21:16:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471LGfEr008657; Thu, 1 Aug 2024 21:16:41 GMT (envelope-from git) Date: Thu, 1 Aug 2024 21:16:41 GMT Message-Id: <202408012116.471LGfEr008657@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: 8f31e64ca336 - stable/13 - lo: update man page since SCTP checksum offloading is supported List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 8f31e64ca336e90b7fdfee4d185773f677341626 Auto-Submitted: auto-generated The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=8f31e64ca336e90b7fdfee4d185773f677341626 commit 8f31e64ca336e90b7fdfee4d185773f677341626 Author: Michael Tuexen AuthorDate: 2024-06-23 11:27:54 +0000 Commit: Michael Tuexen CommitDate: 2024-08-01 21:16:21 +0000 lo: update man page since SCTP checksum offloading is supported The loopback interface supports SCTP checksum offloading in addition to TCP and UDP. Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45698 (cherry picked from commit 60117f9ee58e202be55a8af5bb6b6c768e7a940e) --- share/man/man4/lo.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/lo.4 b/share/man/man4/lo.4 index 7bc806e5a005..f1ac67c7d7db 100644 --- a/share/man/man4/lo.4 +++ b/share/man/man4/lo.4 @@ -29,7 +29,7 @@ .\" .\" @(#)lo.4 8.1 (Berkeley) 6/5/93 .\" -.Dd January 25, 2012 +.Dd June 23, 2024 .Dt LO 4 .Os .Sh NAME @@ -57,11 +57,11 @@ be configured first unless no hardware interfaces exist. .Pp If the transmit checksum offload capability flag is enabled on a loopback -interface, checksums will not be generated by IP, UDP, or TCP for packets +interface, checksums will not be generated by IP, UDP, TCP, or SCTP for packets sent on the interface. .Pp If the receive checksum offload capability flag is enabled on a loopback -interface, checksums will not be validated by IP, UDP, or TCP for packets +interface, checksums will not be validated by IP, UDP, TCP, or SCTP for packets received on the interface. .Pp By default, both receive and transmit checksum flags will be enabled, in From nobody Thu Aug 1 22:27:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9J4rGFz5RZ6l; Thu, 01 Aug 2024 22:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9J4K4rz4YGL; Thu, 1 Aug 2024 22:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL5mD39Qwp+RiObkHgQb/z3c+Q4lM5LNd5CgCYBSbVA=; b=yow694EUW7iD2welhv3KFtBg1ygBydCbUeR8IHQjnuzKcxsrWqkrt2uMYiXgsjyvPixOtQ lUQvkqcBsveqsDxdKpPLwMUVSxnTE0IhBQLm22BbUs3ArYFZgNE6reDIEQjiRFCCEr0ekv JhWnncyQHmpWyKaWEGUQDD6i4dsS9H1GV8xZhYabuqA/YnuG7LW3EqIX1xD7dmyCl8azbG tESMzvzL+k0bhYPIhegZ81bXmInOSH7ULZ7Hs+cRhu0DlExEWTfAvxuy3ANkRxhz2mh84u jyKuXJQAH641vqJo6Tl8dNoj/LqLMfBBjCrRxMn9QLSNJyH764HMI9o0P19KgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551236; a=rsa-sha256; cv=none; b=jPKkUfi20zYObIWZzEG38rL8nTUbqPxOVv28qiEMOM8cVCS5b2x/pESn2gbK63k9+V6gyR F3iJewzTR66ZEVv1FvTPOj5RDIye/Fa5sLNljjZcTy9yqf+o7Pz+z/sMSRoO3udt8Q3zp9 +XVi6TNW+gX10o2+3GkUnu0hqv5lqoEPYM77qVRQthIL8KCPa9vRQuafBJ2dUhDkUpk9aP tgr0FOUdSui0ncgJr17ftx5vgND8f/OBtgtNI4XRZe93Nq1uD8xZ6XhtFm4uERc6nDUfBO NnT1RigiE9hXxLHu3kNfJ5UR2Gl8pqMMUsD1bgC/YjJoMAi1JPXkARD1Tr53cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cL5mD39Qwp+RiObkHgQb/z3c+Q4lM5LNd5CgCYBSbVA=; b=oTKes1oTlG6Cv1KaQwckbzpHFTm65XUM0F35GSVC1XcWJl5UKXRH+W0t7bOefM+ScuqPYn GZxq7JQGQQP8ZaLw+4zlN7UphOdM04L4Ro98Iqw7lECp68wwqSO/duM6E4R9Sv4qkmgOZv O0ipR/D4q+soiUJYB/l0f/G6PEqk1xWSjG+poBhPHqZ3g0xQYzwQG5yUB/e/kau2epVBk7 oV/zKC6EKuF8ASTdD81m/hzvY7wywf6CLmXTFdZ0l+GvqgW7lhVlhentvVmR/f1iKgMgpe qeiPhHayYhFHG7C7B/sFc4uV2ePEHuQqQvM2aMo1yvmOaiZFoxXAj4CX93u+7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9J3wKLz12Wd; Thu, 1 Aug 2024 22:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRGNv026673; Thu, 1 Aug 2024 22:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRG3h026670; Thu, 1 Aug 2024 22:27:16 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:16 GMT Message-Id: <202408012227.471MRG3h026670@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: 73b587e2ee99 - stable/14 - LinuxKPI: Set suspend type on syspend/resume cycle enter List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 73b587e2ee993512f37fc6ec754ab59d7357ea41 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=73b587e2ee993512f37fc6ec754ab59d7357ea41 commit 73b587e2ee993512f37fc6ec754ab59d7357ea41 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:41 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:37 +0000 LinuxKPI: Set suspend type on syspend/resume cycle enter Recent amdgpu depends on pm_suspend_target_state value to separate S3 and S0ix support. Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu (in bugzilla) MFC after: 1 week (cherry picked from commit 8ace984e477b0ee1fcc317752603ec4fe9c7f636) --- sys/compat/linuxkpi/common/src/linux_acpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_acpi.c b/sys/compat/linuxkpi/common/src/linux_acpi.c index e7b6854ecf13..60ec838e9da7 100644 --- a/sys/compat/linuxkpi/common/src/linux_acpi.c +++ b/sys/compat/linuxkpi/common/src/linux_acpi.c @@ -109,12 +109,14 @@ linux_handle_power_suspend_event(void *arg __unused) * TODO: Make acpi_sleep_event consistent */ linux_acpi_target_sleep_state = ACPI_STATE_S3; + pm_suspend_target_state = PM_SUSPEND_MEM; } static void linux_handle_power_resume_event(void *arg __unused) { linux_acpi_target_sleep_state = ACPI_STATE_S0; + pm_suspend_target_state = PM_SUSPEND_ON; } static void From nobody Thu Aug 1 22:27:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9K632cz5RZP2; Thu, 01 Aug 2024 22:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9K5Ryjz4YRW; Thu, 1 Aug 2024 22:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vEhQ8M/VVVATLh2DXY8UERgCU3BS3vCRSM+dpZEhOT4=; b=JDi+viH/6Qv0xRr1oVZnqM/ifBWXbdhhxjygC4wST8X8aBljg6qN3/p3urhoFIfrnn577Z 4ANsQ5QyxRRZGmh+AzSRIl+UKsgzPF77y1W10GukW8EWlcXtVYVkOIpYA/rkGnAuBL58fb N+GtQ5DeIDbYC/w0aZWkegRxgr4ZCMo9KoY3L08PoeRX3V4SeWSAuPEVRpi6NkCgDo+kyP G28GA/Qyi1EtR5C1m/uRiycddewEUpSeLv2ImFI0lYptl/2A7Zimsc/C9+88Ss5b3zI6TF FqRqI3iO9EdzWsD2qbl92CnzjSTM3gtWst/XyCHR8G/KWx0b0s+50TLI7U28EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551237; a=rsa-sha256; cv=none; b=sTMTDtlgDCZMa2jwMTPGXD5Jhw0euUFpqrOwcmjaJ8AuNHIiHA5k+JapI85fsX55kPR3JC imqoGVUa0Gc/WSlxSvOT4hx8scnjIlCgnAqUAZ1FHp6kv2ZT46xYB0VBl+elN30Z7v1m4n 5YY0LLhsKxXgTLTk21Qhbcjq0jyNYEeXNyGToOzGz7VOcIb9chDwxAd8uEzwLhg02zIMpa eGYKNDqNHPRFJ25Sl/zYgaA7otpfqLCseZ61EW0T0vtm9m6sHURZRjt5BWdQ9oSSlihLPU O3EXtDTvzzIw+lq0hkTGTJlV+rMjJopd0fX7j97t6ZtUibLfpmwyIC8PagB0IA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vEhQ8M/VVVATLh2DXY8UERgCU3BS3vCRSM+dpZEhOT4=; b=eJVx8+NgBlkxM3qBslmvJyk8ok4JAhqpKgq5k2UuIYaaCe4oJ4zKvyeQu1gWI+ROuKvV0g Ku5UjGySRQ+nk5N9dkzz//7FKnX+8x6DoPPw3H/yIAq/xNgOYYpkKEi1sYWhxKeRedC7+X miJBONM/E3ETtgeQqTHT8wW+far1hx2ieEy2L7QlYinh/XQoW2YDXpMDifCZd7qLeaeIEm 6espapO00WV4zANlweKsP7wShh9ghFohMV0mFsjmlFlhtZXh4idRxr1mr+sNFsDkFPLQmi 0bUkjgqgAnFZ31+v/MTZB7rELwwkY0maR7nglwfuCky8Wkklxs0H6TJp6EqDtA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9K53HNz12l6; Thu, 1 Aug 2024 22:27:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRH7b026713; Thu, 1 Aug 2024 22:27:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRHXg026710; Thu, 1 Aug 2024 22:27:17 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:17 GMT Message-Id: <202408012227.471MRHXg026710@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: 9c67525fc362 - stable/14 - LinuxKPI: Add ms_to_ktime List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 9c67525fc36260e5ada6902a96c81bb36805e395 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9c67525fc36260e5ada6902a96c81bb36805e395 commit 9c67525fc36260e5ada6902a96c81bb36805e395 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:37 +0000 LinuxKPI: Add ms_to_ktime Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit aafe4126f7942daef5b7d522bd4fafc5deddb0bf) --- sys/compat/linuxkpi/common/include/linux/ktime.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/ktime.h b/sys/compat/linuxkpi/common/include/linux/ktime.h index b13c7182bc61..53c2abd64fc6 100644 --- a/sys/compat/linuxkpi/common/include/linux/ktime.h +++ b/sys/compat/linuxkpi/common/include/linux/ktime.h @@ -69,6 +69,12 @@ ktime_to_ms(ktime_t kt) return (ktime_divns(kt, NSEC_PER_MSEC)); } +static inline ktime_t +ms_to_ktime(uint64_t ms) +{ + return (ms * NSEC_PER_MSEC); +} + static inline struct timeval ktime_to_timeval(ktime_t kt) { From nobody Thu Aug 1 22:27:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9M1ctlz5RYyw; Thu, 01 Aug 2024 22:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9L6QwJz4YGh; Thu, 1 Aug 2024 22:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvw/L8ZQc8tbjkbEK+qeE8+9obEbRkmv0n1cBv18pa4=; b=sYDvSRPsQOAHLfiV/de0r1G3a4CZKaaGdBeltGRbIDW6G3uMPgFlH8Sceg0DZr+HWRgRwh pikA2EN3o2/cNQDrFuST0zszyO+68W+XihXFOYo2UYkIrok+whM9pxm6EhsU0xhbOknHfo QbBBJIkySkSdA6At/ig483kUqzB1RzL4r5wpUz39s6mvBHsbLZvrrDLzljIMHgrSdri2Ih A2AFkq/Eb0WfkiNh+opI3R50q+lgaRgt71jxSvprAxVe7RehOqKeSIdsS1bYPf2Ro2P8UU qWIJNMP25BxZ2PqdrA/KeyazkQ/k65XbrZ0cXrnni2t+e6CWHcOmaUOWBgjm0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551238; a=rsa-sha256; cv=none; b=MwOHV4725AUXpzTj7uOTpNSHsUn3V9v5PnYfkyAOdJP1fZTRx6ctFPh/aYqHl+QRY1sxVk 7k0jaSEHX+SDYlMD53BO8vtUDroGBFo66K+68QEGqppvs6Mr970T9292J/ZWEQmJ0T3i68 B++vc3xo8qKzD18cjBJSluQJgdgpmIEaW3U7ZFq7RAR/HOLedBYvMy7kM1LmDbVZu0VQ6u /+8h143fQNNqI993D7ylsgOnnXmQ2oyP2aURpYGYdrUl+Km78pZSX/gVdUFFxmkI+xFfx0 PFIivUzhAdmw+4JPFGJqLwCswFDWLgTB9QnsqdeonPiBUu3TyvfaQHlmIxl7KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fvw/L8ZQc8tbjkbEK+qeE8+9obEbRkmv0n1cBv18pa4=; b=lSQR7koaDfSNm//xmx8Uh5xubGDFPmsq1sTlebzL/s7vtTlNG4rYnvl2sUOKNf+AUJ4JA0 4KGN+gLME0XgT+bAsL+2ks/3yYxQlz1QBcq5pf0BUx0ZqaY0YbLzicuzd/nuFjwnEbVtrz Ug2JiJNojS/2JqF96nvxxC35415s7v34Rl6jObtI3dT6hXfLmTCQjig4LNKdV+xFhzL/wU vAZ3wlZ38NBAC7A8sv6CIRCjFe1uSuz6kre/+1iJVPdUf/1y5r+4uhzc1WJSCcLgU8Xq3M xKiZk6+FlL7c0JFGt1Xtx9zixoFGGSE0mC8daH0DnvkECInOCersv9ulFTwtoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9L5jstz12nl; Thu, 1 Aug 2024 22:27:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRIXD026755; Thu, 1 Aug 2024 22:27:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRIgW026752; Thu, 1 Aug 2024 22:27:18 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:18 GMT Message-Id: <202408012227.471MRIgW026752@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: 9319e47c1ab5 - stable/14 - LinuxKPI: Add strnchr function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 9319e47c1ab562d577d4359599aecb80a3dd7dbf Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9319e47c1ab562d577d4359599aecb80a3dd7dbf commit 9319e47c1ab562d577d4359599aecb80a3dd7dbf Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:37 +0000 LinuxKPI: Add strnchr function strnchr() finds a character in a length limited string. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 month (cherry picked from commit 19703887666da09c79c571bc78f0923bae62be91) --- sys/compat/linuxkpi/common/include/linux/string.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 9302c95e8636..1fae23ad902a 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -226,6 +226,21 @@ strscpy_pad(char* dst, const char* src, size_t len) return (strscpy(dst, src, len)); } +static inline char * +strnchr(const char *cp, size_t n, int ch) +{ + char *p; + + for (p = __DECONST(char *, cp); n--; ++p) { + if (*p == ch) + return (p); + if (*p == '\0') + break; + } + + return (NULL); +} + static inline void * memset32(uint32_t *b, uint32_t c, size_t len) { From nobody Thu Aug 1 22:27:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9N228Gz5RZ6n; Thu, 01 Aug 2024 22:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9N0Vnyz4YS5; Thu, 1 Aug 2024 22:27:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rQXUMEj3fmkLhJ+vxn62Fbif4U+r48G/RlcaIQh13wQ=; b=GvjkgZ8HKTdwWs1aiQ8uYB+ce79o22EdnvBTDujqMleWcqbZ1zdMHZhUUZMWf82Z21wcDg duza163AgHbs+no6vZryhheCVwoEJhVQtvNA1M0SLo6ofvDgRNezv1RNUWD/Z2+tcsax/J BRcgOuCNQQEbkIHzWhljY++flv916pcH1M2IyNo+F6hiCz/BqiIo1vUWDVxWxLIYthGpxX F/qbP9L7PiCWzvKFDkwxdGnXTJLhUkWJA7aCZnpCAQ8J0dI6IbFRbHb9zV144M4Pk70UsJ uzUrNDWFRbEvVeBovA2yFhJAmAlhNQRzwtrsWoTQ3e2CFpH4MOj1tHo64yvOJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551240; a=rsa-sha256; cv=none; b=LIRL5Q7uZbYJZvqD/WRXiGoJM475k9vatVaBCUm9NUtuVHo1nxi7GOt0Mwtbux8Xr+MxoF wPUi49NzpDTzP9qjzXxgJenpTt2x5leqQh0d3QAKRvRuCtprc76eK8q0SnES14dXWBg5cC q4ptFFNOoNzF0a3RwXjvYt4OEmHepWStBNTZC/I0uSN+7FRqsBUC24JIelw+aMVnOvhzsU +/Ssa3zrL/m6Ksaacdc+CfYVsc6UD53D6WZeXsX92w797cs9VtvD54ItQHuRPa8V5D8Y9q BKgdxTPDge3BOeeB175hPasbFhrDc6MZHf+16Oemx1ZhbTBi5FZzaRiSjPLCvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rQXUMEj3fmkLhJ+vxn62Fbif4U+r48G/RlcaIQh13wQ=; b=b0nLVZkwxUazFPwFZ/VTOXTe9mEMiAa8TF1w0Yn5waAwTmyhOaABVGS12FGjF+ynHOaxZx DjgqqIHXL8225eKsCCh2kX4S0mC/VR/THrsas8iqIH9SKinOPxvxB/oy0F4BBH3hbzIIpV M4ePzYmodmb0bWulzMmCdGK+ZdVsT3ERfekWsbn0t0X2e9ocZbiEJdUCIpoAL/STcylEXs uXh2Y2Eqf2LnvKIBEg+RN192ny3URPGnpR2nDuM13Z4HgAjxUdKDwhS/LwSuvAR+ggc+hr jiPgoXxmzLpLS0uc9p2337XV/M79VSrCpBvQjyHrvGOzfoWmGG+HSnrOncCdaA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9M71z4z12tF; Thu, 1 Aug 2024 22:27:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRJvk026800; Thu, 1 Aug 2024 22:27:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRJMA026797; Thu, 1 Aug 2024 22:27:19 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:19 GMT Message-Id: <202408012227.471MRJMA026797@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: 265b5c165756 - stable/14 - LinuxKPI: Move [SU](8|16|32|64)_(MAX|MIN) defines to linux/limits.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 265b5c165756c09d044e3239ca83a9857ebfb27b Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=265b5c165756c09d044e3239ca83a9857ebfb27b commit 265b5c165756c09d044e3239ca83a9857ebfb27b Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:37 +0000 LinuxKPI: Move [SU](8|16|32|64)_(MAX|MIN) defines to linux/limits.h Some source files get them from linux/limits.h directly rather than from linux/kernel.h. While here replace Linux constant values with sys/stdint.h provided ones. Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 8cfd1dd821bd8102dd91971c6ac88a64e25057d1) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 14 +------ sys/compat/linuxkpi/common/include/linux/limits.h | 47 +++++++++++++++++++++++ sys/compat/linuxkpi/dummy/include/linux/limits.h | 0 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index c8fbacedc561..ab264d3896de 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -71,19 +72,6 @@ #define KERN_INFO "<6>" #define KERN_DEBUG "<7>" -#define U8_MAX ((u8)~0U) -#define S8_MAX ((s8)(U8_MAX >> 1)) -#define S8_MIN ((s8)(-S8_MAX - 1)) -#define U16_MAX ((u16)~0U) -#define S16_MAX ((s16)(U16_MAX >> 1)) -#define S16_MIN ((s16)(-S16_MAX - 1)) -#define U32_MAX ((u32)~0U) -#define S32_MAX ((s32)(U32_MAX >> 1)) -#define S32_MIN ((s32)(-S32_MAX - 1)) -#define U64_MAX ((u64)~0ULL) -#define S64_MAX ((s64)(U64_MAX >> 1)) -#define S64_MIN ((s64)(-S64_MAX - 1)) - #define S8_C(x) x #define U8_C(x) x ## U #define S16_C(x) x diff --git a/sys/compat/linuxkpi/common/include/linux/limits.h b/sys/compat/linuxkpi/common/include/linux/limits.h new file mode 100644 index 000000000000..716366033bb3 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/limits.h @@ -0,0 +1,47 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Serenity Cyber Security, LLC. + * + * 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 _LINUXKPI_LINUX_LIMITS_H +#define _LINUXKPI_LINUX_LIMITS_H + +#include +#include + +#define U8_MAX UINT8_MAX +#define S8_MAX INT8_MAX +#define S8_MIN INT8_MIN +#define U16_MAX UINT16_MAX +#define S16_MAX INT16_MAX +#define S16_MIN INT16_MIN +#define U32_MAX UINT32_MAX +#define S32_MAX INT32_MAX +#define S32_MIN INT32_MIN +#define U64_MAX UINT64_MAX +#define S64_MAX INT64_MAX +#define S64_MIN INT64_MIN + +#endif diff --git a/sys/compat/linuxkpi/dummy/include/linux/limits.h b/sys/compat/linuxkpi/dummy/include/linux/limits.h deleted file mode 100644 index e69de29bb2d1..000000000000 From nobody Thu Aug 1 22:27:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9P2x0Nz5RZTt; Thu, 01 Aug 2024 22:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9P15Bdz4YPw; Thu, 1 Aug 2024 22:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YcJA7DJICx0watMfoVOFpkyAie1kRaF9H7mJpqAf0UM=; b=pTkA2w2Xgh4yHtmOVuih5reoWVBK5esYoV0hLinbIZk8aKRReXXnRBSG5dFeTgO37fMlZl 7WHuwXASx2NZfAro/uSWkBGgMcNvO3wPEKJGIiB/ODGsC83S9I8S9uEQvTOktXgsE6Icg/ UT5R0V24vfVOf6ps5ncNCAZvF2uG9xynXFEJJWczXNDG6VQsmC0A91Ue5duuMGxpimT05z rUhkncQ89y5oueMB6uPtnbdw3N9B/7024QyCjv8VTcDrmlELEoIN1K3suTVJOdsVbILdJa nJX0u04/KdvL9kNhBMgigX0qD0L8HOvtFfPy0/bs43xkhTDUbqkBGeAi65Vv3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551241; a=rsa-sha256; cv=none; b=KccfA/XSYA9EGQ7UJHwVUclkrCdoSGc4cLvgUTDik9DdqVbqDJtfGydjVM8KR7+HD68dJs 2jzD1+1WHx5Q0c8OZavmA44iytlEMhGMai0gG/dP9obOK5nW/z8WffqG3Pp/X2J3727FC5 zCBIU0raMqgOhd3uVL4a7Ri1KqnMrXvI97RV4rYafGxT/BiE2c2qniIgtWSw4oE4vHFxSp o7U9gxK9RSau0ErQHeB6HRemZAp2E383Qnd7sBF/DvySPNUgOFLHKjLM5vYMVPr5/LeHDU kQKNSbmcvx0dnb61y2VTYxrPWs+6QdmkdJq0dqsE4i13IXmDiLpZ9HeV5C3yTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YcJA7DJICx0watMfoVOFpkyAie1kRaF9H7mJpqAf0UM=; b=ibtNgEIJTlIB7FJv7wIgpg0H8M13ZbR2wLtt6t3Sy+AR09N5j7Aqaku72BVXczt0OUl6/7 ckZagH8DvT/0uEOi2d87pjKbQLMRifesAFWzVkxQpvgUNtGaH58ws9/t8BEtCvMiMWYhHB 0CZaxwEpiEGeHeJ4mHLVovvFRCli6wcG7Brl20SHP3T97yw8HTbEuSD28CUmt5f/QFLBAH EpJsfEQ1R9B8+WQyaJp3haV3fVFJgQXh/kSeTJlclaa1b9rm0HZ+nZsXz5HQ76JRqZap3g nkrWyCjHHkn/jt0KDVUoqX5Mei+Qrp2GZi7KYsYTyTUIeVZI7Gi51YKLGu4oDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9P0g3pz13Cr; Thu, 1 Aug 2024 22:27:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRL94026839; Thu, 1 Aug 2024 22:27:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRLhL026836; Thu, 1 Aug 2024 22:27:21 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:21 GMT Message-Id: <202408012227.471MRLhL026836@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: e180ccb095a9 - stable/14 - LinuxKPI: Import vanilla linux/overflow.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e180ccb095a9ad6393946b2f8e20d66f61433f10 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=e180ccb095a9ad6393946b2f8e20d66f61433f10 commit e180ccb095a9ad6393946b2f8e20d66f61433f10 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Import vanilla linux/overflow.h It is dual-licensed (GPLv2 & MIT) and self-contained header file. No need to reimplement it. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 3208d4ad2b8320a24af4a8293f7fd3ef9c35caa6) --- .../linuxkpi/common/include/linux/compiler.h | 3 + sys/compat/linuxkpi/common/include/linux/device.h | 1 + sys/compat/linuxkpi/common/include/linux/kernel.h | 29 -- sys/compat/linuxkpi/common/include/linux/mm.h | 1 + .../linuxkpi/common/include/linux/overflow.h | 392 ++++++++++++++++++--- sys/compat/linuxkpi/common/include/linux/string.h | 1 + sys/compat/linuxkpi/common/include/linux/vmalloc.h | 1 + 7 files changed, 352 insertions(+), 76 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index 59c7d3cc04e7..d59e6faed12d 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -121,4 +121,7 @@ #define sizeof_field(_s, _m) sizeof(((_s *)0)->_m) +#define is_signed_type(t) ((t)-1 < (t)1) +#define is_unsigned_type(t) ((t)-1 > (t)1) + #endif /* _LINUXKPI_LINUX_COMPILER_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 4ac041298ab7..770c5c334c9a 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -45,6 +45,7 @@ #include #include #include +#include #include /* via linux/dev_printk.h */ #include #include diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index ab264d3896de..254b7729b96c 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -594,12 +594,6 @@ linux_ratelimited(linux_ratelimit_t *rl) return (ppsratecheck(&rl->lasttime, &rl->counter, 1)); } -#define struct_size(ptr, field, num) ({ \ - const size_t __size = offsetof(__typeof(*(ptr)), field); \ - const size_t __max = (SIZE_MAX - __size) / sizeof((ptr)->field[0]); \ - ((num) > __max) ? SIZE_MAX : (__size + sizeof((ptr)->field[0]) * (num)); \ -}) - #define __is_constexpr(x) \ __builtin_constant_p(x) @@ -609,29 +603,6 @@ linux_ratelimited(linux_ratelimit_t *rl) */ #define is_signed(datatype) (((datatype)-1 / (datatype)2) == (datatype)0) -/* - * The type_max() macro below returns the maxium positive value the - * passed data type can hold. - */ -#define type_max(datatype) ( \ - (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MAX : UINT64_MAX) : \ - (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MAX : UINT32_MAX) : \ - (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MAX : UINT16_MAX) : \ - (is_signed(datatype) ? INT8_MAX : UINT8_MAX) \ -) - -/* - * The type_min() macro below returns the minimum value the passed - * data type can hold. For unsigned types the minimum value is always - * zero. For signed types it may vary. - */ -#define type_min(datatype) ( \ - (sizeof(datatype) >= 8) ? (is_signed(datatype) ? INT64_MIN : 0) : \ - (sizeof(datatype) >= 4) ? (is_signed(datatype) ? INT32_MIN : 0) : \ - (sizeof(datatype) >= 2) ? (is_signed(datatype) ? INT16_MIN : 0) : \ - (is_signed(datatype) ? INT8_MIN : 0) \ -) - #define TAINT_WARN 0 #define test_taint(x) (0) #define add_taint(x,y) do { \ diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 8c50a2bbb3bc..1356d64dde28 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/sys/compat/linuxkpi/common/include/linux/overflow.h b/sys/compat/linuxkpi/common/include/linux/overflow.h index bb9ac5bc5ffd..9ba9b9500f11 100644 --- a/sys/compat/linuxkpi/common/include/linux/overflow.h +++ b/sys/compat/linuxkpi/common/include/linux/overflow.h @@ -1,51 +1,349 @@ -/*- - * Copyright (c) 2020 The FreeBSD Foundation - * - * This software was developed by Emmanuel Vadot 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 __LINUXKPI_LINUX_OVERFLOW_H__ -#define __LINUXKPI_LINUX_OVERFLOW_H__ - -#include -#include - -#define check_add_overflow(a, b, c) \ - __builtin_add_overflow(a, b, c) - -#define check_mul_overflow(a, b, c) \ - __builtin_mul_overflow(a, b, c) - -static inline size_t -array_size(size_t x, size_t y) +/* SPDX-License-Identifier: GPL-2.0 OR MIT */ +#ifndef _LINUXKPI_LINUX_OVERFLOW_H +#define _LINUXKPI_LINUX_OVERFLOW_H + +#include +#include +#ifdef __linux__ +#include +#endif + +/* + * We need to compute the minimum and maximum values representable in a given + * type. These macros may also be useful elsewhere. It would seem more obvious + * to do something like: + * + * #define type_min(T) (T)(is_signed_type(T) ? (T)1 << (8*sizeof(T)-1) : 0) + * #define type_max(T) (T)(is_signed_type(T) ? ((T)1 << (8*sizeof(T)-1)) - 1 : ~(T)0) + * + * Unfortunately, the middle expressions, strictly speaking, have + * undefined behaviour, and at least some versions of gcc warn about + * the type_max expression (but not if -fsanitize=undefined is in + * effect; in that case, the warning is deferred to runtime...). + * + * The slightly excessive casting in type_min is to make sure the + * macros also produce sensible values for the exotic type _Bool. [The + * overflow checkers only almost work for _Bool, but that's + * a-feature-not-a-bug, since people shouldn't be doing arithmetic on + * _Bools. Besides, the gcc builtins don't allow _Bool* as third + * argument.] + * + * Idea stolen from + * https://mail-index.netbsd.org/tech-misc/2007/02/05/0000.html - + * credit to Christian Biere. + */ +#define __type_half_max(type) ((type)1 << (8*sizeof(type) - 1 - is_signed_type(type))) +#define type_max(T) ((T)((__type_half_max(T) - 1) + __type_half_max(T))) +#define type_min(T) ((T)((T)-type_max(T)-(T)1)) + +/* + * Avoids triggering -Wtype-limits compilation warning, + * while using unsigned data types to check a < 0. + */ +#define is_non_negative(a) ((a) > 0 || (a) == 0) +#define is_negative(a) (!(is_non_negative(a))) + +/* + * Allows for effectively applying __must_check to a macro so we can have + * both the type-agnostic benefits of the macros while also being able to + * enforce that the return value is, in fact, checked. + */ +static inline bool __must_check __must_check_overflow(bool overflow) { - size_t retval; + return unlikely(overflow); +} + +/** + * check_add_overflow() - Calculate addition with overflow checking + * @a: first addend + * @b: second addend + * @d: pointer to store sum + * + * Returns 0 on success. + * + * *@d holds the results of the attempted addition, but is not considered + * "safe for use" on a non-zero return value, which indicates that the + * sum has overflowed or been truncated. + */ +#define check_add_overflow(a, b, d) \ + __must_check_overflow(__builtin_add_overflow(a, b, d)) + +/** + * check_sub_overflow() - Calculate subtraction with overflow checking + * @a: minuend; value to subtract from + * @b: subtrahend; value to subtract from @a + * @d: pointer to store difference + * + * Returns 0 on success. + * + * *@d holds the results of the attempted subtraction, but is not considered + * "safe for use" on a non-zero return value, which indicates that the + * difference has underflowed or been truncated. + */ +#define check_sub_overflow(a, b, d) \ + __must_check_overflow(__builtin_sub_overflow(a, b, d)) + +/** + * check_mul_overflow() - Calculate multiplication with overflow checking + * @a: first factor + * @b: second factor + * @d: pointer to store product + * + * Returns 0 on success. + * + * *@d holds the results of the attempted multiplication, but is not + * considered "safe for use" on a non-zero return value, which indicates + * that the product has overflowed or been truncated. + */ +#define check_mul_overflow(a, b, d) \ + __must_check_overflow(__builtin_mul_overflow(a, b, d)) + +/** + * check_shl_overflow() - Calculate a left-shifted value and check overflow + * @a: Value to be shifted + * @s: How many bits left to shift + * @d: Pointer to where to store the result + * + * Computes *@d = (@a << @s) + * + * Returns true if '*@d' cannot hold the result or when '@a << @s' doesn't + * make sense. Example conditions: + * + * - '@a << @s' causes bits to be lost when stored in *@d. + * - '@s' is garbage (e.g. negative) or so large that the result of + * '@a << @s' is guaranteed to be 0. + * - '@a' is negative. + * - '@a << @s' sets the sign bit, if any, in '*@d'. + * + * '*@d' will hold the results of the attempted shift, but is not + * considered "safe for use" if true is returned. + */ +#define check_shl_overflow(a, s, d) __must_check_overflow(({ \ + typeof(a) _a = a; \ + typeof(s) _s = s; \ + typeof(d) _d = d; \ + u64 _a_full = _a; \ + unsigned int _to_shift = \ + is_non_negative(_s) && _s < 8 * sizeof(*d) ? _s : 0; \ + *_d = (_a_full << _to_shift); \ + (_to_shift != _s || is_negative(*_d) || is_negative(_a) || \ + (*_d >> _to_shift) != _a); \ +})) + +#define __overflows_type_constexpr(x, T) ( \ + is_unsigned_type(typeof(x)) ? \ + (x) > type_max(typeof(T)) : \ + is_unsigned_type(typeof(T)) ? \ + (x) < 0 || (x) > type_max(typeof(T)) : \ + (x) < type_min(typeof(T)) || (x) > type_max(typeof(T))) + +#define __overflows_type(x, T) ({ \ + typeof(T) v = 0; \ + check_add_overflow((x), v, &v); \ +}) + +/** + * overflows_type - helper for checking the overflows between value, variables, + * or data type + * + * @n: source constant value or variable to be checked + * @T: destination variable or data type proposed to store @x + * + * Compares the @x expression for whether or not it can safely fit in + * the storage of the type in @T. @x and @T can have different types. + * If @x is a constant expression, this will also resolve to a constant + * expression. + * + * Returns: true if overflow can occur, false otherwise. + */ +#define overflows_type(n, T) \ + __builtin_choose_expr(__is_constexpr(n), \ + __overflows_type_constexpr(n, T), \ + __overflows_type(n, T)) - if (__builtin_mul_overflow(x, y, &retval)) - retval = SIZE_MAX; - return (retval); +/** + * castable_to_type - like __same_type(), but also allows for casted literals + * + * @n: variable or constant value + * @T: variable or data type + * + * Unlike the __same_type() macro, this allows a constant value as the + * first argument. If this value would not overflow into an assignment + * of the second argument's type, it returns true. Otherwise, this falls + * back to __same_type(). + */ +#define castable_to_type(n, T) \ + __builtin_choose_expr(__is_constexpr(n), \ + !__overflows_type_constexpr(n, T), \ + __same_type(n, T)) + +/** + * size_mul() - Calculate size_t multiplication with saturation at SIZE_MAX + * @factor1: first factor + * @factor2: second factor + * + * Returns: calculate @factor1 * @factor2, both promoted to size_t, + * with any overflow causing the return value to be SIZE_MAX. The + * lvalue must be size_t to avoid implicit type conversion. + */ +static inline size_t __must_check size_mul(size_t factor1, size_t factor2) +{ + size_t bytes; + + if (check_mul_overflow(factor1, factor2, &bytes)) + return SIZE_MAX; + + return bytes; +} + +/** + * size_add() - Calculate size_t addition with saturation at SIZE_MAX + * @addend1: first addend + * @addend2: second addend + * + * Returns: calculate @addend1 + @addend2, both promoted to size_t, + * with any overflow causing the return value to be SIZE_MAX. The + * lvalue must be size_t to avoid implicit type conversion. + */ +static inline size_t __must_check size_add(size_t addend1, size_t addend2) +{ + size_t bytes; + + if (check_add_overflow(addend1, addend2, &bytes)) + return SIZE_MAX; + + return bytes; +} + +/** + * size_sub() - Calculate size_t subtraction with saturation at SIZE_MAX + * @minuend: value to subtract from + * @subtrahend: value to subtract from @minuend + * + * Returns: calculate @minuend - @subtrahend, both promoted to size_t, + * with any overflow causing the return value to be SIZE_MAX. For + * composition with the size_add() and size_mul() helpers, neither + * argument may be SIZE_MAX (or the result with be forced to SIZE_MAX). + * The lvalue must be size_t to avoid implicit type conversion. + */ +static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) +{ + size_t bytes; + + if (minuend == SIZE_MAX || subtrahend == SIZE_MAX || + check_sub_overflow(minuend, subtrahend, &bytes)) + return SIZE_MAX; + + return bytes; } -#endif /* __LINUXKPI_LINUX_OVERFLOW_H__ */ +/** + * array_size() - Calculate size of 2-dimensional array. + * @a: dimension one + * @b: dimension two + * + * Calculates size of 2-dimensional array: @a * @b. + * + * Returns: number of bytes needed to represent the array or SIZE_MAX on + * overflow. + */ +#define array_size(a, b) size_mul(a, b) + +/** + * array3_size() - Calculate size of 3-dimensional array. + * @a: dimension one + * @b: dimension two + * @c: dimension three + * + * Calculates size of 3-dimensional array: @a * @b * @c. + * + * Returns: number of bytes needed to represent the array or SIZE_MAX on + * overflow. + */ +#define array3_size(a, b, c) size_mul(size_mul(a, b), c) + +/** + * flex_array_size() - Calculate size of a flexible array member + * within an enclosing structure. + * @p: Pointer to the structure. + * @member: Name of the flexible array member. + * @count: Number of elements in the array. + * + * Calculates size of a flexible array of @count number of @member + * elements, at the end of structure @p. + * + * Return: number of bytes needed or SIZE_MAX on overflow. + */ +#define flex_array_size(p, member, count) \ + __builtin_choose_expr(__is_constexpr(count), \ + (count) * sizeof(*(p)->member) + __must_be_array((p)->member), \ + size_mul(count, sizeof(*(p)->member) + __must_be_array((p)->member))) + +/** + * struct_size() - Calculate size of structure with trailing flexible array. + * @p: Pointer to the structure. + * @member: Name of the array member. + * @count: Number of elements in the array. + * + * Calculates size of memory needed for structure of @p followed by an + * array of @count number of @member elements. + * + * Return: number of bytes needed or SIZE_MAX on overflow. + */ +#define struct_size(p, member, count) \ + __builtin_choose_expr(__is_constexpr(count), \ + sizeof(*(p)) + flex_array_size(p, member, count), \ + size_add(sizeof(*(p)), flex_array_size(p, member, count))) + +/** + * struct_size_t() - Calculate size of structure with trailing flexible array + * @type: structure type name. + * @member: Name of the array member. + * @count: Number of elements in the array. + * + * Calculates size of memory needed for structure @type followed by an + * array of @count number of @member elements. Prefer using struct_size() + * when possible instead, to keep calculations associated with a specific + * instance variable of type @type. + * + * Return: number of bytes needed or SIZE_MAX on overflow. + */ +#define struct_size_t(type, member, count) \ + struct_size((type *)NULL, member, count) + +/** + * _DEFINE_FLEX() - helper macro for DEFINE_FLEX() family. + * Enables caller macro to pass (different) initializer. + * + * @type: structure type name, including "struct" keyword. + * @name: Name for a variable to define. + * @member: Name of the array member. + * @count: Number of elements in the array; must be compile-time const. + * @initializer: initializer expression (could be empty for no init). + */ +#define _DEFINE_FLEX(type, name, member, count, initializer) \ + _Static_assert(__builtin_constant_p(count), \ + "onstack flex array members require compile-time const count"); \ + union { \ + u8 bytes[struct_size_t(type, member, count)]; \ + type obj; \ + } name##_u initializer; \ + type *name = (type *)&name##_u + +/** + * DEFINE_FLEX() - Define an on-stack instance of structure with a trailing + * flexible array member. + * + * @type: structure type name, including "struct" keyword. + * @name: Name for a variable to define. + * @member: Name of the array member. + * @count: Number of elements in the array; must be compile-time const. + * + * Define a zeroed, on-stack, instance of @type structure with a trailing + * flexible array member. + * Use __struct_size(@name) to get compile-time size of it afterwards. + */ +#define DEFINE_FLEX(type, name, member, count) \ + _DEFINE_FLEX(type, name, member, count, = {}) + +#endif /* _LINUXKPI_LINUX_OVERFLOW_H */ diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index 1fae23ad902a..32470312b78b 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -37,6 +37,7 @@ #include #include #include /* for BITS_PER_LONG */ +#include #include #include diff --git a/sys/compat/linuxkpi/common/include/linux/vmalloc.h b/sys/compat/linuxkpi/common/include/linux/vmalloc.h index 0a5cf0d409bf..00650a2df9b6 100644 --- a/sys/compat/linuxkpi/common/include/linux/vmalloc.h +++ b/sys/compat/linuxkpi/common/include/linux/vmalloc.h @@ -29,6 +29,7 @@ #ifndef _LINUXKPI_LINUX_VMALLOC_H_ #define _LINUXKPI_LINUX_VMALLOC_H_ +#include #include #define VM_MAP 0x0000 From nobody Thu Aug 1 22:27:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9Q3X27z5RZ6t; Thu, 01 Aug 2024 22:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9Q1dBfz4YF2; Thu, 1 Aug 2024 22:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4mc97po1HKOirXJ4BWM8vn8Lcwr6yV8kqka5U+4quPg=; b=Rr0PZd8tdZeLdplkKj+F0qx9qRAXDOlcBeTNX8nJu+VcXKtc7sNEnXFVdUMsLD1pVcy7u1 Mvv3+Kmhh1kiI1Wh3g34GpUY711cwAB2neBqVypFOh1KZk+tWXAvSg0Ggex50ToeyMzy4f X/+k+1GobfsAOl68r8lI1HtmgEg36QV1fcctSmzqRS3vTETIAPdZSy+AYipQurpW4FKU+b q2Bgd1z9dSRtSpWImmoJVFfMzN+8Wqq8P5Jlc1ivLo/cwulb6BvXuJu0KErDOSQm1ieAoI O6jD8PM6RmlrSBJlzhzeWYKrCFT9cq9IBG9em/J3oep2xjOQdGhC8vbKk2qvzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551242; a=rsa-sha256; cv=none; b=wPdRFYcTTjETJBPGgAQzeBvEG3Hx1FLD8IxNG31NpWbrKKiM7Vei5BN9afXNYbXo5Hz4sE UDSJwA8q/Ek/GnaWA4FJAoalIabkwrSLsOB+CEf1yXbIQGC6+TADjcQz3rrpGOlPZ5utzz YQ+cWQShLIzAm5NyesA8BYx8CkzWxpsrsPREvA81jgyEpwedwVCcTh9GuZa/5YR3oQmZWW C7VP0t6sv8j0la+HQAOr8u6TcVkDfp7X8Hbbp9gqT4zQA0yheCqxCo20lHg6d/WcLNDiTY CIHGGg63GMeXrpOSuZShS4yXM3zT1NCzn0x35NHIyMoqAESeRFkl4+zPnHoHxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4mc97po1HKOirXJ4BWM8vn8Lcwr6yV8kqka5U+4quPg=; b=aZN5RoBTKuLmN5y/ycfEoZBtZuEZ3Hxz9fQuyZjtlQncoJEBeuc/HIATmV03A7CwJv4+j8 Cg9g45A3ctkt59MixBo+3RvATfs4tb5y/iDSyoMDeuuchZr+Vvs3xpqcu1ACrQChZylfE3 2DiDTDacChOOUGhLA3eMqsXxjDMufkwK1YpgmjdIRCMIBGlddihTizjX8o+12DYsJHfozm xLu42PL8QspRZ9VVr42dejwe3iZoIVXwxhWI/7yAGxfCx+1485ma8WYEdFtwkhAMNlDsNz r4Dfe+JJeN4igMYOsuUo2jxk54/8WtpoZGr6aojKjiJF5gD9ykol84ErnVlf2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9Q1DcGz13Cs; Thu, 1 Aug 2024 22:27:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRMNZ026884; Thu, 1 Aug 2024 22:27:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRM71026881; Thu, 1 Aug 2024 22:27:22 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:22 GMT Message-Id: <202408012227.471MRM71026881@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: 5496fab6a2e8 - stable/14 - LinuxKPI: Add VM_ACCESS_FLAGS define to linux/mm.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5496fab6a2e87b2fde3410093308fe6e3e1b9518 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5496fab6a2e87b2fde3410093308fe6e3e1b9518 commit 5496fab6a2e87b2fde3410093308fe6e3e1b9518 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add VM_ACCESS_FLAGS define to linux/mm.h VM_ACCESS_FLAGS is a basic access permission flags. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 38c276a43f2d55e19ff6bd15ab5730315d41e3a8) --- sys/compat/linuxkpi/common/include/linux/mm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 1356d64dde28..1a7bae27fa8b 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -56,6 +56,8 @@ CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); #define VM_WRITE VM_PROT_WRITE #define VM_EXEC VM_PROT_EXECUTE +#define VM_ACCESS_FLAGS (VM_READ | VM_WRITE | VM_EXEC) + #define VM_PFNINTERNAL (1 << 8) /* FreeBSD private flag to vm_insert_pfn() */ #define VM_MIXEDMAP (1 << 9) #define VM_NORESERVE (1 << 10) From nobody Thu Aug 1 22:27:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9R5XK3z5RZ4d; Thu, 01 Aug 2024 22:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9R2Spzz4Yb2; Thu, 1 Aug 2024 22:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hu2k/QPGad3Bn/fo9WF7f4dpj8K4o5b8NrqfevrK600=; b=Ln3LPMAfL/ZWgE8YdYCVntw3SRmCDEbz08D6i+wmyNwWrzH7euPb4jnBJ7iniU2EdBr6bt mevSBvvAXRmX6n6rX/MbaO92Qw/6vPaIYV7EqjREzXrs8iLk927yxWYMN3KQ/+UMy6y1pt 5HaSlj23X+Rr6U+m7z8SL5+5w4HouWyOgJA4rBYmyV5DvoNNrp+jYtg5n1w7O1Gj+liZTD Q92dL9AZniaJbOseTJg5JCjOf65uHLaDd35wwp5GjAY0QaBh7FhfDJiqLR0f1aRScSWIt9 nVG++CNOcAVIFDAEP9iY79i5DJ0Dlq2UmjEZ5H+cBeWUeja1ahwXs6RpwkV6Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551243; a=rsa-sha256; cv=none; b=sYwa+fQX9nQ94tUEtrqaSrSeE3jIRx90kvwcOJxR5jQiDEYFn/8jqG1GIrUxAEw0f9anPB tWOOpLesyKp98Y6XxG2azfjy4sxvsdRrvN0yuhU6RpI9uu1za/eR+7otRR9hiLRyKzfNd0 5X/KRhcdsaq3KoSbkl9KC9OwnkY2+Pdfl/nlZ/tAj4nxB9s1dWz3ahWDbSTvRYFlIguZO2 DKRvN6m6U6IuD1ueFau81A/6CAOzKW6X6hrop1NSTmJMbEA69bPb8oD6qyEtXtDgg6Y6d8 6ec3m2miVj1nneUbA0cKLlrayjLBcjaNlQSksiPJ9D3gM08z1tNJgfnmpotTRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hu2k/QPGad3Bn/fo9WF7f4dpj8K4o5b8NrqfevrK600=; b=Vf0z5FMsddiQq6rhkbF9KDQ9J5xe+tLxHECHnNyiaZHiEignWrl+UACUOvmfIzj2q40/Nh 5tRTeGIstf+I8KD4SWt2AbkCpjFQTLLlArcCJxaTV5donfZox15IFSUHN/YMoy7nQNzW0J DIS9bXrkU/cRJAgvHA//otqc5gAVkTCaBCDwu5rJeLK4QiwHyePYA554X1GE1G6p6nEh33 Mydzk38KTPHGE5xN2VSd8p4aytTQCvzKZVF+i/iVKJSY9Er4TK21Uyh3J0CL5WmJxezz+k ADnKdfgeXjV1aV/8wALZK/fUzpeZW6HQXdZiAXVbRq8r8hn63kHH9lKnjlcSeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9R22S0z12tG; Thu, 1 Aug 2024 22:27: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 471MRNvI026923; Thu, 1 Aug 2024 22:27:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRNsw026920; Thu, 1 Aug 2024 22:27:23 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:23 GMT Message-Id: <202408012227.471MRNsw026920@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: 4242e224e6b7 - stable/14 - LinuxKPI: Add get_random_u32_below function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 4242e224e6b7d00020a9fcee9bc020d0816630df Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4242e224e6b7d00020a9fcee9bc020d0816630df commit 4242e224e6b7d00020a9fcee9bc020d0816630df Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add get_random_u32_below function get_random_u32_below returns a random integer in the interval [0, ceil), with uniform distribution. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 9289c1f6f1514e714b17026c50ec09282f079cba) --- sys/compat/linuxkpi/common/include/linux/random.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/random.h b/sys/compat/linuxkpi/common/include/linux/random.h index e87d4412ea4e..808c5bc55974 100644 --- a/sys/compat/linuxkpi/common/include/linux/random.h +++ b/sys/compat/linuxkpi/common/include/linux/random.h @@ -96,6 +96,12 @@ get_random_u64(void) return (val); } +static inline uint32_t +get_random_u32_below(uint32_t max) +{ + return (arc4random_uniform(max)); +} + static __inline uint32_t prandom_u32(void) { From nobody Thu Aug 1 22:27:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9S4YD8z5RZWf; Thu, 01 Aug 2024 22:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9S2ywsz4YSm; Thu, 1 Aug 2024 22:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfW6qkN2/qeyGVsVLOXWIzt7eVsrXzaPz6Iq7qAOsjk=; b=kk7uLDnCtmuSri2aUYnTJVaSAeneNcH5uHpCHkXFI0thh6bECw9bYQUIrtHRepocf4/g7k LIz4cJBjFLDN+D829p+AF3bDdG0A73k612InSCb1DINOekjLtncKGSIhtBkbIi0yWeRNhl uxuxGEoLeP0L831Jkry/19L0H+pfl9aC9xNjDl7rumxHukXPzfhrSAfxYNlzE+hl0Am8vw BqFejQ46ZKipb3kf7zo0K4177uwWPXBaNE3DNJs1Q9r4dSd6REBKJUCF/VRAZLy1e8fgVR Y44mgg/66IpB5+Lz6/ny+09cXtTCFHxk03qJXCRyYhLfUJ2D/MXEYRjbzpLtPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551244; a=rsa-sha256; cv=none; b=QvBWGT3Z7+oGdVHTRDDbPwxgnsKrVmLK1rvMiGD5cI33Zvuuo/PpDkUwXfSj3U91oUW33j 3lXg/5UEK1fy7/wTFUBKN4ehH5dDJ+fK50MbhJxYobbjo9dy4yMYxQdUP19OIdFbx0Nkwr j0wnmTt6q3JlghGMKghw4a7hshq5xUHqQJY3597frortnaIxETfMoYOhXJy+TvaH1cnbQh PuLqOYXO0t0dAzFrkgyv6ENa1vNGtRmBkeLtercKdsim5juRMIX3X/u02RaWeq3Ik/YMaD RniBixrbBsJGRcVyEr3Sn5PdR43lrq6kcPfYdiqeBP3ER/Zy7I+v3QTJbFSJpg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pfW6qkN2/qeyGVsVLOXWIzt7eVsrXzaPz6Iq7qAOsjk=; b=HdMY1bi9/3ItQ8gTHXdR8maqCeHR5bWQjU1wZ1lnQbjWrG4pWHiXNBfd+XthUE2o2EQe1N 8uBTJsJ4AogoU4fdgtLtorAm5mqdGprY0LeKvvnFjHATbnvZaCokYAAIOJZuQDI4opUYof mU4ie77g7oykPFaTJ42P/POWSYyYhY652y/QKAZaS/hv8YDs3V5Pjnim97VRS2jzR4MjE4 iHKf2+0Z8buT6mO25CNqXsLg5eN0L43wfVp9ZG0fPplAaPj0IwMR6lqEmruX5qtGnTCJkh QKHtX2Kolr9MyJ9W/NfYPytoTrzkd3unuUaZ5QJAvRlYhMj4T9t0IhwZwidOyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9S2ZSWz12l7; Thu, 1 Aug 2024 22:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRO5M026965; Thu, 1 Aug 2024 22:27:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRO8R026962; Thu, 1 Aug 2024 22:27:24 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:24 GMT Message-Id: <202408012227.471MRO8R026962@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: 5ea6546660de - stable/14 - LinuxKPI: Improve timer_shutdown_sync List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 5ea6546660def3b853208c3eee236a21d9a317f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea6546660def3b853208c3eee236a21d9a317f8 commit 5ea6546660def3b853208c3eee236a21d9a317f8 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Improve timer_shutdown_sync timer_shutdown_sync not only shutdowns a timer but prevents it rearming. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 61fb195e8dd08d4b006a176c09682f061424cb95) --- sys/compat/linuxkpi/common/src/linux_compat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 894e233042e3..90d03d480089 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1920,6 +1920,10 @@ linux_timer_callback_wrapper(void *context) timer = context; + /* the timer is about to be shutdown permanently */ + if (timer->function == NULL) + return; + if (linux_set_current_flags(curthread, M_NOWAIT)) { /* try again later */ callout_reset(&timer->callout, 1, @@ -1992,6 +1996,7 @@ int timer_shutdown_sync(struct timer_list *timer) { + timer->function = NULL; return (del_timer_sync(timer)); } From nobody Thu Aug 1 22:27:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9T4v6Kz5RZ74; Thu, 01 Aug 2024 22:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9T3mDGz4YVm; Thu, 1 Aug 2024 22:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjsSQxv1CtgI3nFHb5MEHienGpoSde8jFUKIVbR/f4M=; b=k10TMFFfUrfnkp1g+u7/eT01tnEltWOY66CR9RxmHzvDor4KmpQn9V1ZfZApCcJPOD1pbi DkdxhFXYbKgTuCX6XA7bL8u9lZAC62BV6AGijbqWBtXSF+1IL9fmeKd5ZXPHsLrQ47pggl DPWQKKW3cLqT6iSPrDMJSEbiEI7XEPNohvkL++HqMEMQTIgKvYFLRXP0gg9pvzfUAHG4vA wAZlnfQf5Py2nf25M1FhvPKF0y+MVteIj4YjfsHSXw4XB+ux6BaajpybiVXQjuok6Zkv3i iijd+srZk6kg4r5CmEb27RkOtrGs1o5SSn73mlRxyW0s+GVfKhCQIW42OkUWyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551245; a=rsa-sha256; cv=none; b=aLTWxA81hXAKPk/4i9sNv/efG7Vug1us/paRJRVfuGHd+GTYl6qnQ+J737G0z3B61uSmdv si0K0hNBlcnBLIpkOVK4z+QzpOsHrmrEg7GJmmqd4MITn1Uk7OxSBRuk8gF2j1K+E4jkhm TcQur2SjsVw4FUTbQ/MCYlUdfN14y1VYk6wmyBOQ70Qn7Bqj9MMYuxRvrpoEpydtL5fGpF QP4s2bYTWRklHSM82T7eJnrOjQvYgtB/G+NIST+IAI4rGQDed5rd6veees+IQmg0ThuELF DdahhPfnaZTS++mzpGG8u67XMKkwZZ3R0xHqBtUsG1Vxtd9x7ci6e3vXD+MY+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YjsSQxv1CtgI3nFHb5MEHienGpoSde8jFUKIVbR/f4M=; b=wHJPkYLZW7cdEZnUdS5GxJVvVOT5LF/W4+9curgq7rl5GokRfZf2rxKUL4B/8lWj6GA6Qo vvBo83RMzXXs0SOcKbJgQXbegFq1osuT/WoC9bY+izTh4bhk/ikhyBwijCsbGsG6Vaq+ZL IS1oNJFqHBbe/z6jykXUxJVq4vlOWn5tw8XNBt7eVpql4lxg9vPfdN2AApMt9ZwdLuDtBN fwjB9mAOUN1rj+9PZLugp3g563qmOZffs8cL3i0ZBxpDJwDziTA+f6VzqNwIfxLUR65/S1 tBjaMvu9BqfGs5JQCc6rs1kGkNlDeodFx8n/QM3FDWfLz8WwIwBzlfbcY88saQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9T3Msjz13Ct; Thu, 1 Aug 2024 22:27:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRPb4027006; Thu, 1 Aug 2024 22:27:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRPnu027003; Thu, 1 Aug 2024 22:27:25 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:25 GMT Message-Id: <202408012227.471MRPnu027003@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: b4fb139e286b - stable/14 - LinuxKPI: Add vm_flags_(clear|set) 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b4fb139e286baf742095716e8dabcbc3553eccb4 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b4fb139e286baf742095716e8dabcbc3553eccb4 commit b4fb139e286baf742095716e8dabcbc3553eccb4 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add vm_flags_(clear|set) functions Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 06902a447934e855dc8f7eaf95b4235c684b264d) --- sys/compat/linuxkpi/common/include/linux/mm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 1a7bae27fa8b..0030cc6fb7a9 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -324,6 +324,18 @@ vm_get_page_prot(unsigned long vm_flags) return (vm_flags & VM_PROT_ALL); } +static inline void +vm_flags_set(struct vm_area_struct *vma, unsigned long flags) +{ + vma->vm_flags |= flags; +} + +static inline void +vm_flags_clear(struct vm_area_struct *vma, unsigned long flags) +{ + vma->vm_flags &= ~flags; +} + static inline struct page * vmalloc_to_page(const void *addr) { From nobody Thu Aug 1 22:27:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9V6V37z5RZWm; Thu, 01 Aug 2024 22:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9V51D9z4Yh3; Thu, 1 Aug 2024 22:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ywo/f7ixMDoQotB3qHwJM8vB0bvbeZftaoM7NapL9kE=; b=yp7new59XIt0ffQCT2tsfoAe2P2E3SK0PnOdXllUC7gOxmQmkiWXQhOtb+KyLxWUl7TXnW IGHeBaJxxhHNJOLGUEa5JncnyS03VJ8/uVrck3jjQp1lRoTdGg+xa0LQD6Ebw8pH4ugxb4 JcW99ZpxKOFOb4eaDcL3YjUnRIAaFQtm7JLVYU9O2l8a6nC/3nvEOt+rTgml7gbVRwaNSI SjYFwMbtjCrjgXho2PIooYyMI2Xnf73pobjgVRlg9gsoFLBKt7RI1wlvtdbxkmkWpMoT4s iDg7ax0oVsK+m0aV/OverDGeYYFpWYnlBh7Jgwcu0J+KMLGcndwzxWCHBttlKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551246; a=rsa-sha256; cv=none; b=L7bttmysFNQFrgxA6FWwbO9gev2sDXva1ddk0hq27o6C1l6DOPyN5TmdzHVKEYvYnJ/rEQ UezfCG64wphzcrH/2b/nfxkEH95d+2Ti+zUnSVLdC5tMRjWYK39IlXyVPG4Amrq2AhYEZb JbGFVCwTr1h4qbEp12JVdrqDGmE1Po5JauPS+GgxLdlOzlUYMuN/0+VXnbBeFPdPWktgi+ ILYMpKUXxQIsiGpDn/NbBGu1Rby6YazwLuMenIzU/KM+KpyogJkhMAipJd9TAOIL/3CCRt frwqSGwlS6aN1DcLUf+ku7dCztSfkgmAaPno8+EA67T/qO7R0NSzgRxU5JZ6Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ywo/f7ixMDoQotB3qHwJM8vB0bvbeZftaoM7NapL9kE=; b=LcUUEeyUjx+SWMYqqER2AyHjfYP/L+wgYAt4V89rrLERjejlLGocc9SKp4i8HFymdlCYUv QlYT1cf8EyUuWV3Pks4AKsEUUOCXzkgSsBljC/TAAMjriL8n3dINed0ibEXz1H7YykwhUi SmeWr2M14cJnJMPnN8kXnDL8lO1nDqPXugbRDwge2XulMa+mC3W+gKClTcaUK74cpik3gA QU0xywnqBD6H4SzrmGq0yLjYM1AhcacRgYFDuAZD4IMmZiBFP5LGcYPQWEX2DUXvsEhVkk BsIWu4mGBLoky6JFrDseD7McpKNeQrbylflGdQO3sTJdq/hN/r8iu3x8S85bIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9V4cchz13BW; Thu, 1 Aug 2024 22:27:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRQpd027045; Thu, 1 Aug 2024 22:27:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRQK0027042; Thu, 1 Aug 2024 22:27:26 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:26 GMT Message-Id: <202408012227.471MRQK0027042@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: fbb9ca960d8d - stable/14 - LinuxKPI: Add PTR_IF macro List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: fbb9ca960d8d0282fac3f2b31649f3cecdc5bc11 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=fbb9ca960d8d0282fac3f2b31649f3cecdc5bc11 commit fbb9ca960d8d0282fac3f2b31649f3cecdc5bc11 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add PTR_IF macro Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit e0eeeca8b83a17aeebc4da525e813699bf3fabc2) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 254b7729b96c..26fc2b8a4862 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -133,6 +133,8 @@ extern int linuxkpi_warn_dump_stack; #define printk(...) printf(__VA_ARGS__) #define vprintk(f, a) vprintf(f, a) +#define PTR_IF(x, p) ((x) ? (p) : NULL) + #define asm __asm extern void linux_dump_stack(void); From nobody Thu Aug 1 22:27:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9X0PRtz5RZSM; Thu, 01 Aug 2024 22:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9W63Bqz4YcR; Thu, 1 Aug 2024 22:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UoBqu4K81dVqrjKwamunxEx4Rz0P771LP4IgQGpy5AM=; b=EgMInwHP9R+xfeJP5uhP06xZukAvW+9cm0LIU4+8s1xyzYjkPubfUJ6EAWXM1I5R2HLV2Z Q3t/AFvxzjIPB2VdMiix+RbJ8qSAxZaqoAQnpqZQs2l4rAPHDfatr1tO6hxTeLnLRA7qoB IPl/qWq8trs8OWeYtfowoFS/UFAHafLXQD/mn72uTLZ+cY2PTKu3Zaq7RJ6/+8CAq8TLIX GvnRkZWBiKNqbOQFtscY6WE0H8SYXRR22sfKuHdmTwIsZyFuJeSTN9NeJI4OloIFPa7RQJ hTtigxQtreFgxXAcSlv6aF/Pc+LSPyDtLMSff2Ih89UaHkPaMNSWA53ysQ6edg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551247; a=rsa-sha256; cv=none; b=vZzYTaM6/4XL29GJyVeMA3B5H7bT/lDbCvCOqqdjTHjtgsLK7DW5FFlgmXbvN8lphDkOMc PP1Z3lztC3kseiCkZmQcDvMR+C5/X39un9Xb+poFFCvaUK+Xass8dSv930UpNYJ1NHmATi SLitcptTdPr/Kzqjr9KUo9TJvozMYm88L8QyCyEVqnH8FxqmgezFJLBxleZz1FwyDMCewE Kor4Jv7KinzEZ2O2iEou5X0HmXmuKQPA4yhUuAcDe3Dg9Xxah3xSaOSwhrZMF3cglKLfHX qznLLJN+ZHdnNpSzeYb0KFq2AVYN05gviPvWFp75H3R4hBij1QO1iqPBr+EfEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UoBqu4K81dVqrjKwamunxEx4Rz0P771LP4IgQGpy5AM=; b=ThVUnypOy8U6Qg7XmXULL0r5dlcgSqkX+Y864+cSYq0hISuzqNkxPOivB7x2O3+9FwCC9G P7cHd6ySkYxj9xLNkyZ20ragjcUa543MAOLe5FOcRECkScY27oJ1lNQJEU/YflT8R3Z9ew 4VZ00pkD/m+pPWhuHqlt/wz4RkKnlu373mCICxESEDOT1inqdNMZBdrTH7muuVQl1HIpha 64gPUYFd5cCLbJ3iufLUpclCpQVBZYQbwkCeBlc4x5U8MtM/7PDudA5FxoS6LyKhUBa8Zc tuDtjvH7FxhsJz8KqxsJnb7RIFg79aRmu1m1OBL+cVlHsl2PbcZ0LsdXtPLCRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9W5ctQz12Jh; Thu, 1 Aug 2024 22:27:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRRSB027090; Thu, 1 Aug 2024 22:27:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRR9Y027087; Thu, 1 Aug 2024 22:27:27 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:27 GMT Message-Id: <202408012227.471MRR9Y027087@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: 33b5923a9d5a - stable/14 - LinuxKPI: Add the accelerator PCIe class List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 33b5923a9d5af18924e162d062328d65729b86bb Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=33b5923a9d5af18924e162d062328d65729b86bb commit 33b5923a9d5af18924e162d062328d65729b86bb Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add the accelerator PCIe class Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit e8f59f4d31b243a6f296e819a5912ba63789ae32) --- sys/compat/linuxkpi/common/include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci_ids.h b/sys/compat/linuxkpi/common/include/linux/pci_ids.h index b52ecc525db6..2f02d6ad1c14 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci_ids.h +++ b/sys/compat/linuxkpi/common/include/linux/pci_ids.h @@ -39,6 +39,8 @@ #define PCI_BASE_CLASS_BRIDGE 0x06 #define PCI_CLASS_BRIDGE_ISA 0x0601 +#define PCI_CLASS_ACCELERATOR_PROCESSING 0x1200 + /* XXX We should really generate these and use them throughout the tree. */ From nobody Thu Aug 1 22:27:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9Y254Xz5RZV5; Thu, 01 Aug 2024 22:27:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9X6jb1z4YfY; Thu, 1 Aug 2024 22:27:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37VpnetjxCpmAW2ZTOC4l/a11+D3aiILqx5itjzaaOs=; b=OJRMAAfkqp37pIfffbsd0qK/oZT7SMHbe1TKplnkjXZOicMUE7lEfIosNCV6Q0mLGL6gy9 V442K6GWg2jdOWG1E/akideDbVaDWNvo5YF9cwiNpf5VR3h/sBfgNbM+TuWleIuKFv0xA+ CTfgWan45yoRAROjGk+sSZAJqvurhJt2IjP9+pr3/yQAXUlcjhB3qZGwjSYFhPmCICO27s zAzCzhGiL1UErLf8bxSnnlFJUGP7UQXDM3CSh7uM9GlI71K7uXYwg8It7eSJFHkxiCL8pe H3OotnxGU/yQovorUtcHluVaO40QAR7IRQUTz16GPXBuetPGmOSPv1zDTJIkAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551248; a=rsa-sha256; cv=none; b=KCYLGxBTIkmANqOQMrz+S+8fOixvPXBWIJub7KNvfji4L72NQAYkpXnhMRAOfkUBoabazi /oUPHlT4B+0icZtPbGf7iNPHOksQkpxnwfm0bumRaNZ4065lxkCOw4S21uEGn/BtrOWd3w yX0Wty4KfP8ThBzLj4Ph8hKK+1g5JqWqvLiiGBFZ8C0/5LZohBDctV03wmmejyWGdEmus+ GddyCZ5Bk9QXD7+BxHPwq27xr5JZffrPkpmnjUZZuTCoCCpROKqVvZcpS7IGSL6uwqTDKL qcFBS3ewsMhYqR4EKhSI2JylxYyxy41WfnSYQ/wW7kR+4CcrcimCSWpe3EzCgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37VpnetjxCpmAW2ZTOC4l/a11+D3aiILqx5itjzaaOs=; b=KSMlZRjP/uyyvg7DGzWQT4NAhcuS80FOn5IDzfzNQ59w02SldKVUYQRFf/InRBoWJZbmmE acOmSnaYf4r18kamR6GSEOczadtOCW1TQxMSBjxGM9z8ZlL2y06vbMstjM89bJ4wihFVBF FVflqlwext9s2D1bN62TFdAYfdiozGktD1+czVgoJaWpQ24Y5DGcIqf0V7qrxVNhI48Lap FTS0qCEgyrenNGb8ZdDnWMeCj4+rBlZ44QP4pINjUKJA3N48XPwAK4NGhHCmHcDyRdE8t2 MFSexEaIJSpoXAzPVlPemrtLHYEFvYGg6JiURk379mj+qZ8/frAjw0qCjkpMnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9X6Khgz12Jj; Thu, 1 Aug 2024 22:27: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 471MRSsO027135; Thu, 1 Aug 2024 22:27:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRSdH027132; Thu, 1 Aug 2024 22:27:28 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:28 GMT Message-Id: <202408012227.471MRSdH027132@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: acfd6cea1f57 - stable/14 - LinuxKPI: Add pci_dev_id to linux/pci.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: acfd6cea1f570baf0ec866b42f9fe56de1ec1ea9 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=acfd6cea1f570baf0ec866b42f9fe56de1ec1ea9 commit acfd6cea1f570baf0ec866b42f9fe56de1ec1ea9 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:38 +0000 LinuxKPI: Add pci_dev_id to linux/pci.h It returns bus/device/function number for given PCI device. Also add intermediate PCI_DEVID macro used in some drivers. Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit f1206503e5a0073f56710bfebb6e503dcf612536) --- sys/compat/linuxkpi/common/include/linux/pci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 98ba160150f7..f8ee6c5600da 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -94,6 +94,7 @@ MODULE_PNP_INFO("U32:vendor;U32:device;V32:subvendor;V32:subdevice", \ #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) #define PCI_FUNC(devfn) ((devfn) & 0x07) #define PCI_BUS_NUM(devfn) (((devfn) >> 8) & 0xff) +#define PCI_DEVID(bus, devfn) ((((uint16_t)(bus)) << 8) | (devfn)) #define PCI_VDEVICE(_vendor, _device) \ .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ @@ -386,6 +387,12 @@ dev_is_pci(struct device *dev) return (device_get_devclass(dev->bsddev) == devclass_find("pci")); } +static inline uint16_t +pci_dev_id(struct pci_dev *pdev) +{ + return (PCI_DEVID(pdev->bus->number, pdev->devfn)); +} + static inline int pci_resource_type(struct pci_dev *pdev, int bar) { From nobody Thu Aug 1 22:27:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9Z4BNVz5RZMm; Thu, 01 Aug 2024 22:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9Z0kDGz4Yfs; Thu, 1 Aug 2024 22:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8YrXVOK1Xj8oRj6os8o86jTeeCs82mKShpEs2gGp5lg=; b=byJJzXYem8a0kl37iaDZU3DWvatgzkiKjNMq5sBFL+aJrmKAmaWJx4K0dzfyfdAiZDVWoi z8uU3aTsUZyjvSnPIigJS9mhLlNhoqb8nuE81bwNZXqkr98y+06evuyywKvcDta+1GwILy uZ+Hl5fe9b+lyLASDPYXchPUqg+UVxOZ7r6d5rADgHzAGU4lTpjrnNRIL6+RFA4koUHHN2 u5+YxLCU8w1DYGXbceA1UlEguTWmhd1kCZ7lsiJUjZnnkYgsfdq1FBCAhfktOGV2N5LNBn y7nzZc7nwoSuo1+3h0H+SI7vqsw00y2jHG/MWPt10eSHeIpTHIrypQpuH2FxUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551250; a=rsa-sha256; cv=none; b=ltoUURq/bk2u73Pco0ZlsMLASu5W+42rwSmeWmk7NMW4UBzrkJwIYzZ8VXRtXMpS3ciEQc ob6eHcRYb0kYPaxbElV6xAdEqzPpiJWJL635iRF1AMlXc0ryBb80w6kJOa53+9Q5EV7t27 Eg+BUj3PJX2IS7UQAfEsKXite+/jss77EcbLi+RLqObWoMeDvoH44WbOfJANw7qoU4HW9A GN7XEunZfbxkGUwISb+EyymYU45LViBlcoNvlLEs8/LddKPyuJdxC3CuoJQGOMZFR6ZYrJ dySid/rcTFiJA/kfaDcW/Vizm3FJYIuyQa5Hst3QIMIs5fXhVXyg7duQ3JETxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551250; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8YrXVOK1Xj8oRj6os8o86jTeeCs82mKShpEs2gGp5lg=; b=mJUEcY286awu/90FFZ5LpvAGcHYQDAu/orTQsUdpIFxz7njQt57x6WvQbR7wFjP1utwOqn ANVUqLI1laBH91ueIE2DaNML6ykpiiPL9r1Uxa514DgpX8oDVssOlbvhMG96pQOsNXu0vx W2p08CnzW3ifug4LSqkCCYoP6heCGg8wFi0A4OofQC7gHMq5a8TqQ/jdPVZXwNt8jbrkax k+dfSt1SmB6o+E/Ny2PDQSaWiNp6TPwJU/5/JVS9jBpZaw1iOsVFSO0xthGU4H4dqGxX4H 4+oBA8nNLQQZBpNRVwfXr1lxJ7fq0IW+nYTK+uZ0ypaA7I/2QX/2APyQ4srgrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9Z0LM0z12Jk; Thu, 1 Aug 2024 22:27: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 471MRTx1027188; Thu, 1 Aug 2024 22:27:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRTXo027185; Thu, 1 Aug 2024 22:27:29 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:29 GMT Message-Id: <202408012227.471MRTXo027185@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: 8ce07593a947 - stable/14 - LinuxKPI: Add ACPI_ID_LEN const to linux/mod_devicetable.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8ce07593a947d506b5e643129da730d6b2ca07b5 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8ce07593a947d506b5e643129da730d6b2ca07b5 commit 8ce07593a947d506b5e643129da730d6b2ca07b5 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Add ACPI_ID_LEN const to linux/mod_devicetable.h Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit f7ea333e2b20b5850d5be4eee1d26873111f47ff) --- sys/compat/linuxkpi/common/include/linux/mod_devicetable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h b/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h index 5becc12ef960..87bd6ec24bce 100644 --- a/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h +++ b/sys/compat/linuxkpi/common/include/linux/mod_devicetable.h @@ -78,4 +78,6 @@ struct dmi_system_id { #define I2C_NAME_SIZE 20 #define I2C_MODULE_PREFIX "i2c:" +#define ACPI_ID_LEN 16 + #endif /* __LINUXKPI_LINUX_MOD_DEVICETABLE_H__ */ From nobody Thu Aug 1 22:27:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9b4Zrcz5RZWx; Thu, 01 Aug 2024 22:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9b1lXTz4Yl9; Thu, 1 Aug 2024 22:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5PxQtsBb5DoaozlDhCUt61dpGKknVRO+6F3A4KGlpaQ=; b=I6S+UB/oICnPSVyeOu3pNdGWfidMEFXcVvWCDRZm4PnVceur+JmbZZKRWnGEVx2IOKFp7/ qEUBJ/XjWnCIT850yOdPjD7PllD8lc5uUurxq3YFK/5JA4uNV8FRbxLt3eXiMcrPlISIv6 JsGWPwXwKSL2aCSPtEknf3ucAE6xCbq4rAul4vL6qDj4NxGmGWK5bOACCJs+yEPLFnu3QE 49ELBEq38rMF5pJqxgRCsfURCEOnLV2R+PJ3t8hNXB8WOwDx+9HiYjFrYrYVx11OrDxZVr cz6Nl44YwsQ4q55kTQZCQiczmAFbLqWH2CDcC3/yYK8VAKg27B5C2BHgqYWj/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551251; a=rsa-sha256; cv=none; b=i3OPUFwT5Ot1KMfYoCoR35kSCFwHHRI/qDlkjHa2FuFNmXaqLc7XCm+8nie+U2SGcbTLEL GMQRG2WV8ScMRRH/OF44Hod+UF3NfuGNxr90RMWMlpw2hhxNcHbZ/rVmbYFVVupsmrWcNk gn5/9NZVp4H9RuD02m3zj8FS7/azFDjPwOTd8VIQ8fHlkUQBb1xytSUnbdxvj0MqKCAs75 KB1lwfcYiELNvlQZlalAmDNcReme7EENORK19dRmxsmVovroC6VLrS1z3jMxmQbXBYhw2m yvFHADxGrAvMat7oJFX56Mfj1EW/Bn9OYXZR9Au7CJ92hZuo/wbH2HHvjClIjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5PxQtsBb5DoaozlDhCUt61dpGKknVRO+6F3A4KGlpaQ=; b=kfjB08fFKOVjacQ3Z4JcvKJAqxxVM56a6/VVvqZgcYhqMOfAHuIJdeVtXqcmQomBa4W8Vt nqglweHm/pa5HWj2pWPglxaoYImW8FmI5flJ8ecuTiTjfCkusSgKyfIDhg5i9Z4dqnY07M YhrMwiYlRUnXt9u88zSMcnAzZxryKSOWjvCo6ZzxeOjt2bZo7bzZPpCTlqihYoCg/Za9jU kj+PxCbOJdRm1lblFOlMJJhqPY3Fc48FzZRfcWM/IJFl9hKbcWIAcmkxXUZUK6u1raJ5yt 74/osbicflSdVPlmghDkj67SAWHyHwYGLAQOrvO66TUDl00LtfZrrx5KhuJjxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9b1KMdz12tH; Thu, 1 Aug 2024 22:27: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 471MRVer027230; Thu, 1 Aug 2024 22:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRVsk027227; Thu, 1 Aug 2024 22:27:31 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:31 GMT Message-Id: <202408012227.471MRVsk027227@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: 1a045267a3e5 - stable/14 - LinuxKPI: Add want_init_on_free to linux/mm.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1a045267a3e5fa3c6aba879cde5a860d1e467421 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1a045267a3e5fa3c6aba879cde5a860d1e467421 commit 1a045267a3e5fa3c6aba879cde5a860d1e467421 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Add want_init_on_free to linux/mm.h want_init_on_free returns if heap memory zeroing on free is enabled. FreeBSD does not zeroes heap memory on free(). Sponsored by: Serenity Cyber Security Reviewed by: emaste MFC after: 1 week (cherry picked from commit 56041ee817fff844e5b2de7eedc447e388ab988e) --- sys/compat/linuxkpi/common/include/linux/mm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 0030cc6fb7a9..109bfffe7d6a 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -382,4 +382,10 @@ might_alloc(gfp_t gfp_mask __unused) #define is_cow_mapping(flags) (false) +static inline bool +want_init_on_free(void) +{ + return (false); +} + #endif /* _LINUXKPI_LINUX_MM_H_ */ From nobody Thu Aug 1 22:27:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9c4Rmmz5RZPL; Thu, 01 Aug 2024 22:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9c2gc0z4YjG; Thu, 1 Aug 2024 22:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TjANUkXj+kiM0PZVGRLNnUQWaDZOmu2mNkt4ZrdLaLY=; b=ZeOvS70995qpG/x6nKikRqtlLWzhpc3ETmn/s1q0A7h39WBmJqfPb6IW/+pGjusN4q6oyQ q0C6DwDmEdgdwSWho7dE8MBP6frbdHyIs1Qu3Wfajo1QeB2CN+eGJTyA7i2tuS8dDiWrlP XIHaanybpk6SeSnz3SKVOiI8gQB2WDUAoi9wPGQWZfygj4B0nYkm7KezlMchLpnNMG+6oE wwXMFSENkEpeds6/araRcIamVORhFMAKjIeNnkU+dJ9v/Ox5mHdTqQPG0SiEpXO1HrT6sn zNHOpCJF5XR5UF36axP7j5jnrTYrWVU+7UGG2v4LniNaOp70SygoZLEz4lv1ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551252; a=rsa-sha256; cv=none; b=Atyn9QB7lPAAmbK/ibyMEN476SC3DuBPn1t7O0oJVGT6ieWP/r/OkLawDihK5CSH+KIJm3 PQV4dbJ0y8PRhKvuUkO5pn9xFE5SSXhRNFjQtuRAuHdfPMYErHdq+4hIc68yrKRcangCpY iih0Xt0qiRb9/yod0WMJ3DSugYo1rYsW/ngia5gW/x+4ODvDa0TqQ040CyJTOEnNdUYckx k+ZDJNCAZjd+PJsUSvv0KLQwWQfa4RBc7hDo6/ikPpJpBM54O1pT01kEclsP+TLMOWC0mU RoaoydzfOjCv/4iv+ZgaQds5nGp+iEtArL3gNzv9GgpuQeHCl5R5uyZzOEP6kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551252; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TjANUkXj+kiM0PZVGRLNnUQWaDZOmu2mNkt4ZrdLaLY=; b=JKjwj2PYavuXxiVh7ORBhoKWexHsXJYLy+mNcPB3Pl3sIBHoir2FOFkAbun3l+/V8F6+5L J3z42nsl/Ds3gJJJl9eZ8gPgmaxK6AfziQ1e+dc+QEvJKNz3IWy/ETe/zV70Lxy12Dvtj8 ItJ/spLaSYViFLtpP8Lu3YYZG3t1ZN3tgBRJuUEnybg2ImkGFCkqjnvNNsCdqE+cuxW1Hy l6i1okXIgACiL4O91CUdAejEtbISZv0nxS65Dx3YRU4FeLiglqq76Z2403kIv6eOgtSvqu TO/BrbGsquRv7q4+stB7n5vILzMOugXFGDadKTs+tYyT52jtEjk5M0cy+m9EJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9c2JHpz12hq; Thu, 1 Aug 2024 22:27: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 471MRWKB027273; Thu, 1 Aug 2024 22:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRWuL027270; Thu, 1 Aug 2024 22:27:32 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:32 GMT Message-Id: <202408012227.471MRWuL027270@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: eb3e82e91761 - stable/14 - LinuxKPI: Stub sysfs_remove_link in linux/sysfs.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eb3e82e91761582eb5c40f06801b0b3151c4b9f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3e82e91761582eb5c40f06801b0b3151c4b9f4 commit eb3e82e91761582eb5c40f06801b0b3151c4b9f4 Author: Vladimir Kondratyev AuthorDate: 2024-04-08 06:47:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Stub sysfs_remove_link in linux/sysfs.h sysfs_create_link is stubbed already. Stub sysfs_remove_link too to be feature-complete. Sponsored by: Serenity Cyber Security, LLC Reviewed by: emaste MFC after: 1 week (cherry picked from commit 4e7aa03b7076353af4b960ade67f093af5736d38) --- sys/compat/linuxkpi/common/include/linux/sysfs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/sysfs.h b/sys/compat/linuxkpi/common/include/linux/sysfs.h index 4a65095d9eb1..b5ad73e4460b 100644 --- a/sys/compat/linuxkpi/common/include/linux/sysfs.h +++ b/sys/compat/linuxkpi/common/include/linux/sysfs.h @@ -164,6 +164,12 @@ sysfs_create_link(struct kobject *kobj __unused, return (0); } +static inline void +sysfs_remove_link(struct kobject *kobj, const char *name) +{ + /* TODO (along with sysfs_create_link) */ +} + static inline int sysfs_create_files(struct kobject *kobj, const struct attribute * const *attrs) { From nobody Thu Aug 1 22:27:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9d6vZwz5RZX0; Thu, 01 Aug 2024 22:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9d3hvhz4Ylg; Thu, 1 Aug 2024 22:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ydqngpG63ztxmjTNwVg+lga94BEsD1JO2oCrIrBNzo=; b=qymd2hMIzcHtkeUROYiH1EogrQB8lRxe1nPWRkpp8cRaEUk+7/qL5pjzI5rru/BnTprJTi DBpfdhB2V/ANXHocDwSsFyocBLPGkKD7YLq2o/a1z8qjK7mpHho5U1mO0cA75FeMkvmQfk M15TT/CJbsZgV3i1YcF8Dn4yot6gC3r3qJrCoh8eNCrIQr5tEdrSUIaKNrBq8TkB59dqMV yJ1zhwwJNjZ2/l+Xf9cWP05l13q7gQc24y9IMieYqPNYXb+zQfQwUJag2sLANkRLpRQd8s iUWX6R8ymP99q3wjlweyI1du6Q1nXm8qI6XyEOuNBy5EyhwY4vTed5H2mjrP3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551253; a=rsa-sha256; cv=none; b=UFjm7vyPZhXI3v5EF1L6euUJcPLaisvqadwBY1cgdP7YGWHqE+5yCGeJpDva+sWceYQcPm kD7Su5qBgqs4Ztl0Us/dalFSLV/Mn9RuU7bDCYQH+dm9uWrWAbDb04aCpfofYRor285lbZ MNwW64EjPUs1pK49mST3G2rxNd+cxTwy6o9MIV1vWNlZ17WAo76R/caJVPmXJv7ySMVySS CTlK3wZXBHPKrcdTPng7RSUFuOHdEOMRyI+jdHS4Zu0hzwT+pEjZa0BpmXmqYzgf6fOQMu ENLa0LfPWlLumly7rLIYeYJRdnOisVUnzwDcnnxmMSUljhlEVKNRvnIWdub5zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ydqngpG63ztxmjTNwVg+lga94BEsD1JO2oCrIrBNzo=; b=uDeFTGRnavxl3Om/2nonVfSkPEycJz+dG6abG3fvkr6HJiYVB1G42s1KPn6JO2tmOJEX4j u4LPTXNk0gXAE+8WpldWS8qwzO/JUPgpT807ari9/F+lgsW1f8Fz3hcj77mNtfdPcsIhw4 G4krbKPnHNZg73Pl1DQJdoPmNiqr852cY4iQXZzpmf3oT6l9z1xzIrRu384vhl3bMZJq17 MQGy0bqv98+C+kxUA+kD4+eS81nem11paqbg+WGHWXkLVQsX1C2cG0JiybMNYiEPvx9mjq Hw6Qhk3LJaQ/Y51Jfkfw67akhIYbeu0y29bL7v2/XvMPOLLSjTA/dflOFP3xgg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9d3KHTz12nm; Thu, 1 Aug 2024 22:27: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 471MRXO5027324; Thu, 1 Aug 2024 22:27:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRXt5027321; Thu, 1 Aug 2024 22:27:33 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:33 GMT Message-Id: <202408012227.471MRXt5027321@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: 0ce38f6c0c82 - stable/14 - LinuxKPI: lockdep_assert: wrong 'cond' used in WARN_ON MACRO List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 0ce38f6c0c822af3b41d9eb63669acef57dd9af9 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce38f6c0c822af3b41d9eb63669acef57dd9af9 commit 0ce38f6c0c822af3b41d9eb63669acef57dd9af9 Author: Alvin Chen AuthorDate: 2024-06-06 20:42:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: lockdep_assert: wrong 'cond' used in WARN_ON MACRO 'cond' in WARN_ON need be bracketed, otherwise it is wrong for multiple conditions. Reviewed by: wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D44604 (cherry picked from commit 21f4cf5ccf87fd15d4d71f89d4c3ecab13f26146) --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index a379e191aad7..5291be79218e 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -50,8 +50,8 @@ struct pin_cookie { #define lockdep_unregister_key(key) do { } while(0) #ifdef INVARIANTS -#define lockdep_assert(cond) do { WARN_ON(!cond); } while (0) -#define lockdep_assert_once(cond) do { WARN_ON_ONCE(!cond); } while (0) +#define lockdep_assert(cond) do { WARN_ON(!(cond)); } while (0) +#define lockdep_assert_once(cond) do { WARN_ON_ONCE(!(cond)); } while (0) #define lockdep_assert_not_held(m) do { \ struct lock_object *__lock = (struct lock_object *)(m); \ From nobody Thu Aug 1 22:27:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9g1RFzz5RZK0; Thu, 01 Aug 2024 22:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9f5xZDz4Yx6; Thu, 1 Aug 2024 22:27:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpYWqUBW86OTSTOuGft+lA5WNhqQ1we3Ojp/coW0yrk=; b=RDhd2LHga2D7P09xAxXrjnO/LR6lFyfdLMTKxKPSRVRJblSmPiw/D/UIS3CSObkhj9aryD M8+vroDIH53/a6fzZIqwgjU3os1EGwzrcgCgeO+jkrKaFjqSSeFL0oKgHZ9O5A7u1gpTdT hl82EuA0cMTkJZG9STcY4LhOIhxRUh4JWaq+Thb+MGGkc/xB5ZMufzKWhnfnjT4E8dPsov KrmAuzRlWJ4flf6sG30fnB3RdqvNCJhlTr1qMXj1IF0jMyIfQxU3yv5Z0crbqIa08Q6GcG q1DKs4b2RxiKcMAhpJWs2B6qvxTVmOlGtqwZUoboDP4MBCFhii5imtmDSBQoBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551254; a=rsa-sha256; cv=none; b=BnSfVauLbwwVSQR3W7OR6ZABGrGcSrLx2p1/nXOwfPY9emRV8XWX+KLnmcu3Py4m18qFp8 +A/MvpRIsAjBoOmW6/9Hwg1+N2TZwpmf+zDa94c/BMawIBZtWbspYek1Nk6Mcpud2obUsq ruKYccUMRAMATm6uTfO1VkI8M8KI6qRzlBv5TVkaIu+EJu0pWDs1pVcnZw97UbMEOBAorC KZkhfkgMQ8tTxBDC6mwIlW6+H9lrrEubnWvsouCJ06xggRLCMySffU0dlYntyl+/sxsGYD kzhLRmHAmP50o63VjnAzXqahXdTuDRg/WKN0E9SGjQ7AEWp89cSEVUl7TJdJlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551254; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XpYWqUBW86OTSTOuGft+lA5WNhqQ1we3Ojp/coW0yrk=; b=rgGx9tuaxcv/5Ueo04NI4f3jP2pUmsKfJJYZMgL3+2nqHdK2YEpNxUu1ItXHzKyuvTtK0r LoXLCVrH3HdyVDv6FBQYzwjymvT8X2VS04/T23J6LZpxfd7D56hRIBLZKRSGoS6cen4pkm Ax5j1LEPDKUBf4ge78puDiMgQ+P/S042YDPD7cL7pqPWqp9hIZi7o0MMY/4sgFKg5RF7Tx yryufev/VMEQUXNKuoWEmV9roDyl3LbnF5A8z7SSIqEM/QwsQ5R4tSFrtPd4Hk2HyhJmgD 9Ph9YtbsotvI+aG4b7mmZFeeY9VM7/EFDl5WBK2mqzyZFhMyrnUOidYRIeEjSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9f5YXKz13GK; Thu, 1 Aug 2024 22:27: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 471MRYu8027381; Thu, 1 Aug 2024 22:27:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRYtK027378; Thu, 1 Aug 2024 22:27:34 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:34 GMT Message-Id: <202408012227.471MRYtK027378@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: 89e485e04d54 - stable/14 - linuxkpi: Allow ida_destroy and idr_destroy to be called multiple times List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 89e485e04d547b236f32e3d4eb9ece0684ef01e0 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=89e485e04d547b236f32e3d4eb9ece0684ef01e0 commit 89e485e04d547b236f32e3d4eb9ece0684ef01e0 Author: Austin Shafer AuthorDate: 2024-06-06 20:42:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 linuxkpi: Allow ida_destroy and idr_destroy to be called multiple times This fixes some weird behavior triggered by nvidia-drm.ko: some DRM cleanup functions will be called multiple times, leading to a double free. drm_mode_config_cleanup will be called twice, causing ida_destroy to be called twice. Although calling the cleanup twice doesn't seem very clean, on Linux this seems to be permissable as it handles it just fine. Not doing these checks causes mutex panics and double frees. In order to preserve this behavior this change checks if the objects have already been destroyed and bails if so. This fixes the panic seen when unloading the nvidia-drm driver. MFC after: 1 week Reviewed by: bz, manu Differential revision: https://reviews.freebsd.org/D44865 (cherry picked from commit 613723bac219cb08ac1ad0afd3e07850d7fccc10) --- sys/compat/linuxkpi/common/src/linux_idr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_idr.c b/sys/compat/linuxkpi/common/src/linux_idr.c index b80f8c168d45..8d7f76c7964b 100644 --- a/sys/compat/linuxkpi/common/src/linux_idr.c +++ b/sys/compat/linuxkpi/common/src/linux_idr.c @@ -179,6 +179,14 @@ idr_destroy(struct idr *idr) { struct idr_layer *il, *iln; + /* + * This idr can be reused, and this function might be called multiple times + * without a idr_init(). Check if this is the case. If we do not do this + * then the mutex will panic while asserting that it is valid. + */ + if (mtx_initialized(&idr->lock) == 0) + return; + idr_remove_all(idr); mtx_lock(&idr->lock); for (il = idr->free; il != NULL; il = iln) { @@ -803,4 +811,5 @@ ida_destroy(struct ida *ida) { idr_destroy(&ida->idr); free(ida->free_bitmap, M_IDR); + ida->free_bitmap = NULL; } From nobody Thu Aug 1 22:27:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9h3Fc4z5RZMt; Thu, 01 Aug 2024 22:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9g5syPz4YxL; Thu, 1 Aug 2024 22:27:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=utt4jYwK0yZGlD4myxjE9kTvJhsfaWtTEdeAdIPE/u4=; b=jizt+pFmpIZRdcUY9gTF7njgUNyjiMsX5r/dFhERH19ZuhE33OYJSRRQRVvb0hDJNx9hfD uF+ssUTpIk+Ezjf5o1a/gHQeFaAO98nNO8Wjz9UB9aZdN+q/Fp5GJw1elY/zN4fE4wvJ0E Iaf5LFveopzf1VOC+UHJdHmhT00Ly5b3qifRiL6G280W14CSVBd0Y2R6U0foTgLkPmmRry jY96E+DKh6MQLLETK0hkfIpgTOR7Znj3NN9Wjb1wqO9aXNNOHel3CGEk5OYNoPvDiy1Dgn FSM5ttyvOFZ9iMjgYTXXHFKDLaSzsAS0E7OW3IrtgMMes58aY09PkUgAIIUC1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551255; a=rsa-sha256; cv=none; b=WV3bhpFTMigHkgXIDQ9w+32DbmNX5JZSSzmogn+rpjKHSx11LZJz6iCQ/L8mzJNhn5q/cd eYtZ1t5AXoeCTTi/Hbn2On0RIGn+1H4olSBNrjO/V7IFpqZGTLmm+U4HPSnqWCYkCKuf4F GAF4D3WeZT+DHzOTt+Ftm09I/pRXg12QhNf0qHz31lysdu/CRRFry5VigHqXE5LOlGLlyf e204v4BfOgUMFsdmwS0Tq7iFPgYCUWm8zsYUPIB2PHFk/Nhy3WfY0/6X9A/tmiE9UHjvfx X/bskB9vvXdwwWfb3rhxiXWoRi/RHPcKnUfREMrQcckE/woAXdius1HDCjw0qg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=utt4jYwK0yZGlD4myxjE9kTvJhsfaWtTEdeAdIPE/u4=; b=HFYa+fIf09eKfcIyl8RvZLuoS7kBiYDQvCys6MN0HaLTG0jQbdK2lnpICjZtAZsK+57fF/ sILW9F3V0x8slx+zN0iKkFcN3WPJnVGedKyK2xi/DgDUh+rWh76mIlHO/weQyCyrZxQ50W s+yii+9TuAnvpVmr1Yztv0uEFq74W/P+XLb/Qhwnpq1UusmPiAdihQCX6GsptHNdXUHGzn Awd6IlHkVDlYoL+sGNZyv0YKus2DAYGLRZnlsKdz/T6vTApW5YeCht2E2laYo9KXXiFi/Z Ai1DISuScv6kO4EmBvMGX7ua3MI8jFArG2NjXe83nczVJuOt3zv1ovLLQwCq7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9g5TvMz13Cv; Thu, 1 Aug 2024 22:27: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 471MRZGV027444; Thu, 1 Aug 2024 22:27:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRZbY027441; Thu, 1 Aug 2024 22:27:35 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:35 GMT Message-Id: <202408012227.471MRZbY027441@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: 80ade5b6940e - stable/14 - LinuxKPI: Move page_address definition from linux/gfp.h to linux/mm.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 80ade5b6940e6f29cbb429ecc807da3f40a4edac Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=80ade5b6940e6f29cbb429ecc807da3f40a4edac commit 80ade5b6940e6f29cbb429ecc807da3f40a4edac Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Move page_address definition from linux/gfp.h to linux/mm.h To match Linux. Some future changes may depend on proper location. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D45448 (cherry picked from commit cb8bfc4db8ca8f4ed03406a554e77a013696c8e0) --- sys/compat/linuxkpi/common/include/linux/gfp.h | 9 --------- sys/compat/linuxkpi/common/include/linux/mm.h | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index e5dd2e44b0fa..e285f8591a3c 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -85,15 +85,6 @@ struct page_frag_cache { int pagecnt_bias; }; -/* - * Resolve a page into a virtual address: - * - * NOTE: This function only works for pages allocated by the kernel. - */ -void *linux_page_address(struct page *); - -#define page_address(page) linux_page_address(page) - /* * Page management for unmapped pages: */ diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 109bfffe7d6a..41af4be4c015 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -178,6 +178,14 @@ get_order(unsigned long size) return (order); } +/* + * Resolve a page into a virtual address: + * + * NOTE: This function only works for pages allocated by the kernel. + */ +void *linux_page_address(struct page *); +#define page_address(page) linux_page_address(page) + static inline void * lowmem_page_address(struct page *page) { From nobody Thu Aug 1 22:27:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9k2cxfz5RZ7S; Thu, 01 Aug 2024 22:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9k0d4qz4Ymq; Thu, 1 Aug 2024 22:27:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B0LaqHwCsD+KCB9Kv9SRKVoUDN8afvWNKQpFpQiuBw=; b=hU3nhEwVgtYGfJ6VvreNYrTGSwsc98VTlQcw0+IgLndxJceePZVontDthrJvb6Zcp8fQus lKmd89azlGkIvHX1DN/MK2S3bBPPIfTbwZaxYK8m0Ze3TYkDqtZtMCUJ9FX8HUjT3sZDc6 ULVPElqNh2gnt2fBuIMyM2wfs/CiiTKkEYX9ZO5tWYHGJvmLU3fRs55y7EkFEQwgqwaIpE Zxet7E3GorXL7VCj6KURdDRxk9kIPHQVVQbbZeMy6fYkIBwTSoZaArpl5lplhVGiXXb0EK ulktmruTBPqfqwRFZXEZbYbL4lVdXCWqHbmIhg/zuWMIeEtpUT8tzbQgVuH4tA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551258; a=rsa-sha256; cv=none; b=KSzVfyTY3iXIOONyMBg0IEmXECOm7YByA6KeyJPHERi5XuiEMszqeCYFon3BT9Y1eSTPvd VFgA/fU30c952itv3cKgt1mFlHO04xW/EYZ+sdjv+WiW3KB2XLEnJK9Hdu2LaDWmXjnJOo FpfifSjkrtYi+aqCVg1cMOMTEkDYMhgF/LTADzb/tIKPJqaPOj1yWjxcU0K+dPalCvJLtN YMEHpAe7ll5jxfZd+UkBzvXSInVOp8uJp4jaLS4yT/+hCbVVcybx+WWvjW7VkeO2EKrC1Q DVEaDQ3cAjT9tCeUTmmcsleMcCkYn9P/jELAv/vgaXy8y9TVCOvljqgMfLiyKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B0LaqHwCsD+KCB9Kv9SRKVoUDN8afvWNKQpFpQiuBw=; b=bjwGDB9rW1Y0G1o3clffZpCIsRyVhEAmTuxb/dvAzuHUw83XvfLUrq7KM61ysnwYZz67by Vu7UEVc8Y64x58RyTqqcL0eyo0D3zP7J6SwvNPv9bOVh6ElWzg+TpSDqF1fJFPuogO5wiL sWm2/8mKoS30pVAJMPh/yxq6yuia5p86j3WxMNVdiujMp22vze1WtxDALxVOpXWc3iFgeo ED8iWjpu0BEuuerjrNPOVLz2pCXPNtsmcgztUaDiWZ8QeF4WhFqkfy41R410pcwyx0Zjb8 WaLyAOiMtQEi2MZChm7v+PJM+p6XvidrlzdnyZzZgRfrwnnAgPpqFvWC84Qyjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9k0F8Nz12nn; Thu, 1 Aug 2024 22:27: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 471MRbuG027540; Thu, 1 Aug 2024 22:27:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRbZV027537; Thu, 1 Aug 2024 22:27:37 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:37 GMT Message-Id: <202408012227.471MRbZV027537@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: ef2a82120fc1 - stable/14 - LinuxKPI: Add min_not_zero() to linux/minmax.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ef2a82120fc1a742236368d527bab8e864c40e60 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ef2a82120fc1a742236368d527bab8e864c40e60 commit ef2a82120fc1a742236368d527bab8e864c40e60 Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Add min_not_zero() to linux/minmax.h It returns the minimum that is not zero, except both equals to zero. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz, emaste, ssaxena Differential Revision: https://reviews.freebsd.org/D45450 Differential Revision: https://reviews.freebsd.org/D45451 (cherry picked from commit 07c7c41ca1e31c20c2e2d8fb68c148f521831e4d) --- sys/compat/linuxkpi/common/include/linux/minmax.h | 7 +++++++ sys/dev/bnxt/bnxt_re/bnxt_re.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/minmax.h b/sys/compat/linuxkpi/common/include/linux/minmax.h index 465607371b9b..d48958f0899f 100644 --- a/sys/compat/linuxkpi/common/include/linux/minmax.h +++ b/sys/compat/linuxkpi/common/include/linux/minmax.h @@ -7,6 +7,7 @@ * Copyright (c) 2014-2015 François Tigeot * Copyright (c) 2015 Hans Petter Selasky * Copyright (c) 2016 Matt Macy + * Copyright (c) 2023 Serenity Cyber Security, LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,6 +44,12 @@ #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) +#define min_not_zero(x, y) ({ \ + __typeof(x) __min1 = (x); \ + __typeof(y) __min2 = (y); \ + __min1 == 0 ? __min2 : ((__min2 == 0) ? __min1 : min(__min1, __min2));\ +}) + #define min_t(type, x, y) ({ \ type __min1 = (x); \ type __min2 = (y); \ diff --git a/sys/dev/bnxt/bnxt_re/bnxt_re.h b/sys/dev/bnxt/bnxt_re/bnxt_re.h index 3bf0bbeb1061..56b3c8c0488c 100644 --- a/sys/dev/bnxt/bnxt_re/bnxt_re.h +++ b/sys/dev/bnxt/bnxt_re/bnxt_re.h @@ -100,10 +100,12 @@ * @x: value1 * @y: value2 */ +#ifndef min_not_zero #define min_not_zero(x, y) ({ \ typeof(x) __x = (x); \ typeof(y) __y = (y); \ __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) +#endif struct ib_mr_init_attr { int max_reg_descriptors; From nobody Thu Aug 1 22:27:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9j2rQ7z5RZ7Q; Thu, 01 Aug 2024 22:27:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9h6x2fz4Z3C; Thu, 1 Aug 2024 22:27:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SURfE1MFpE58B8czSJhyeTtJHVGVRAtWof+tSwpud+Q=; b=jzMFgS7DL2q/vOL5cY8X2YNc5eR4XqO681ncCcqNkGB8kMZqvbAivsdqWaLiHSUXyVSgri 3gabdFcLV/iw60I4M04ibwDDuxNYdHp0CsLDaMWNKkkqzUuuLqDH8aCFlPvOy16WN8K8q4 XYmW1udg245und1l1FUdiBx2jH2yUYSPPFKOYJuFInFVpb/T4v1W3JHc4WhVyYdl/KEPm8 ULFF48D0wxd63i1fLOUx1rpgVK19qghGcDRAEQNvy04x1r7Au+s6KWMpM0jfjT684EF4Y4 AtrnH7pgVSC4nGJjABTi49Cqsa5P5GdqUf9Vc2GVyxDBLb9nDo9MKM1xuw851w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551257; a=rsa-sha256; cv=none; b=HFOJGWWytzkXo6j5mM9wKsxrvteS6tOOzrGa0kD8PGn+XcxwRUu/JdPaKT5Ql7Q3b27Cw1 ZU3ZmPJZe2sYmxgTpSZMim44V33xofkXQu21fRVW993Iu2gOvhxKvuk4yWK6hS7scMHCCM yX0e0ciaKiFef7wNBity2vLOGJP4XvSv3lFqhxOHHR2H77rc8Xk4nZ9n4orBOl+vlL1qPZ eR2I4xKSWoWBYh/nYV2Pxkf5LTmy3XVJCLMMxvGrJK5s5bUZhBfTN6BFt69yTTAF1b3859 cC2/6jq0r/jdFMAiDhuHcfELwIRGfnrMZgXSQPUJd4EGYKsZCsJOHks8gLgiJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SURfE1MFpE58B8czSJhyeTtJHVGVRAtWof+tSwpud+Q=; b=BgQZ1OEqw9+i//+hKlGjyRNXOjuczA92ztD3gLooR47su8HnUnB/wJk3R9qCehw8Fk2Hy2 E4Kl442ini/USBe0/2W1wrrcyq8bcwRUhSHwyc8RgknqNKlAIGlNVlH+6G13DkdjM0IpHG zp0Sx3tRkl1jscnDChAcM2TZ/8qDOQW6Fm7HH5YhOCsTzyG0zywj0GVnI8XQYck28NWdTx FtcG/Bwy4AvTS/6M32oOrzkwrmjTyit6/m8GDwMmQLPFMBIFZFYIGnZ+JFh7jj9euge6m1 zXqwNyWYd2oPoj6P6BhXCO94nOjEdQ/mH71MhPAQolBa4LTv5y6AaPVfg4yz2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9h6TrKz12tJ; Thu, 1 Aug 2024 22:27: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 471MRaBu027496; Thu, 1 Aug 2024 22:27:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRadv027493; Thu, 1 Aug 2024 22:27:36 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:36 GMT Message-Id: <202408012227.471MRadv027493@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: 18a9913f9ff0 - stable/14 - LinuxKPI: Move linux/minmax.h content out of linux/kernel.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18a9913f9ff02da049cdbd9dbfba9ee0244c1979 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=18a9913f9ff02da049cdbd9dbfba9ee0244c1979 commit 18a9913f9ff02da049cdbd9dbfba9ee0244c1979 Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:06 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Move linux/minmax.h content out of linux/kernel.h To match Linux and allow direct linux/minmax.h inclusion. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D45449 (cherry picked from commit f79474c4e3eeb48c6acb0a9e3163195a50cef577) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 28 +--------- sys/compat/linuxkpi/common/include/linux/minmax.h | 67 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 27 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 26fc2b8a4862..7679c7f519af 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -518,29 +519,9 @@ kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, return (kstrtou8(buf, base, p)); } -#define min(x, y) ((x) < (y) ? (x) : (y)) -#define max(x, y) ((x) > (y) ? (x) : (y)) - -#define min3(a, b, c) min(a, min(b,c)) -#define max3(a, b, c) max(a, max(b,c)) - -#define min_t(type, x, y) ({ \ - type __min1 = (x); \ - type __min2 = (y); \ - __min1 < __min2 ? __min1 : __min2; }) - -#define max_t(type, x, y) ({ \ - type __max1 = (x); \ - type __max2 = (y); \ - __max1 > __max2 ? __max1 : __max2; }) - #define offsetofend(t, m) \ (offsetof(t, m) + sizeof((((t *)0)->m))) -#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) -#define clamp(x, lo, hi) min( max(x,lo), hi) -#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) - /* * This looks more complex than it should be. But we need to * get the type for the ~ right in round_down (it needs to be @@ -560,13 +541,6 @@ extern bool linux_cpu_has_clflush; #define cpu_has_clflush linux_cpu_has_clflush #endif -/* Swap values of a and b */ -#define swap(a, b) do { \ - typeof(a) _swap_tmp = a; \ - a = b; \ - b = _swap_tmp; \ -} while (0) - #define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) #define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \ diff --git a/sys/compat/linuxkpi/common/include/linux/minmax.h b/sys/compat/linuxkpi/common/include/linux/minmax.h new file mode 100644 index 000000000000..465607371b9b --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/minmax.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2014-2015 François Tigeot + * Copyright (c) 2015 Hans Petter Selasky + * Copyright (c) 2016 Matt Macy + * + * 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 _LINUXKPI_LINUX_MINMAX_H_ +#define _LINUXKPI_LINUX_MINMAX_H_ + +#include +#include +#include + +#define min(x, y) ((x) < (y) ? (x) : (y)) +#define max(x, y) ((x) > (y) ? (x) : (y)) + +#define min3(a, b, c) min(a, min(b, c)) +#define max3(a, b, c) max(a, max(b, c)) + +#define min_t(type, x, y) ({ \ + type __min1 = (x); \ + type __min2 = (y); \ + __min1 < __min2 ? __min1 : __min2; }) + +#define max_t(type, x, y) ({ \ + type __max1 = (x); \ + type __max2 = (y); \ + __max1 > __max2 ? __max1 : __max2; }) + +#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max) +#define clamp(x, lo, hi) min(max(x, lo), hi) +#define clamp_val(val, lo, hi) clamp_t(typeof(val), val, lo, hi) + +/* Swap values of a and b */ +#define swap(a, b) do { \ + __typeof(a) _swap_tmp = a; \ + a = b; \ + b = _swap_tmp; \ +} while (0) + +#endif /* _LINUXKPI_LINUX_MINMAX_H_ */ From nobody Thu Aug 1 22:27:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9l3g6bz5RZcd; Thu, 01 Aug 2024 22:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9l1R17z4Z5N; Thu, 1 Aug 2024 22:27:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrpSWYJcgxqXeAFtpt1tHWMFMliz+HPE1CanbcoKF4g=; b=Lm4gqGnXDYwSufpkfbOiKlbM+Wzh9Bnt4mBYyajub86X2a9nH8mVw9A9qbdPUM62KZm+W5 sBUXR5iNwGj86E7JPCt1ZtxdveoP5PAAlc+WUbrph0z+rnnmUgWEqD463YgnEbYrJKZfVa aOdIVoNaR/Bs0Cy/i1o8tM7xk+tca81Ot19+paXUuy6IOAMuEOFqFvXRNPJeNe6oLZ3LQt ukURT1czQoZIhwO1Bv1KgQ0zf2d4afUSlDUY+cBds+yPV2FNo9TK4UoPwZXIBWzkMmJsgJ fJDTzeepom57pTI9Sg27yTEdlSG5EuVez41RYwidL7LmqxUxOw9zWL5hHigYCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551259; a=rsa-sha256; cv=none; b=P77RaZEsZTfzHNyqXFj2XiLLXjbA/2Hqm5992CnYe83f3PGB4oCpwOrA04Oi+EH8L9C5vO 0noiFF68DylLQZS/R8QjJIihjnBVOMCpAgI8QiipNdK324726rjBK7lgVvjaYLQcvgwKeA 50M8dhI/7OphsfIK4KJVCKUwN49ye+jBHLAlw71R7qZeyCLaFypYgiLmP3a7Z/goIxOrTT beM3coGoUTeKw699TVwRKzOv5KeSJYSKznMw3hkoWdGDqsNO01qC+WWNlwr45kRwr0AcmC Sn6MLKjYb5a5ocuUU0aOjQaKG70+odF3xFC8sLnjWa+r0Pd+aquJhtw81jDsiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FrpSWYJcgxqXeAFtpt1tHWMFMliz+HPE1CanbcoKF4g=; b=OvNVpIDQZ/ebD2XuXnaT3QGUvBXr7w6IK9HIIBh8R3NY8sizFWhjccxqi+YcXk4eOs8x/1 ryd6cxqaQjejYSBTOESfc3kBy+OhTNgN+eBNWrjK7eISGaAjdEK69DxI1rV19466Dlb1g/ njOk0XYRuxk1GZHzJkyFi2ZPPfDgZvsDUSNmmZ8DKdoan3SswzHysK+IxNdOvjk0Vo+RnJ uDUlVCRP0OgKeeQsTB10Krzu+ePbklpztvb2IGkheqxPXsQKIOF+uVsICKd77Z2Ttp85IV E8g6V0xItpjMmQzhetfsuwVUslx4UorPIcj2B17rdwqxD4lkY3Q+pIQZSmbK1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9l11PWz12l8; Thu, 1 Aug 2024 22:27: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 471MRd3v027592; Thu, 1 Aug 2024 22:27:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRdx0027589; Thu, 1 Aug 2024 22:27:39 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:39 GMT Message-Id: <202408012227.471MRdx0027589@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: 9cc3f82da43a - stable/14 - LinuxKPI: Move linux/math.h content out of linux/kernel.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9cc3f82da43a4d26fcaaf1d07da6d76d3222a3d8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=9cc3f82da43a4d26fcaaf1d07da6d76d3222a3d8 commit 9cc3f82da43a4d26fcaaf1d07da6d76d3222a3d8 Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:39 +0000 LinuxKPI: Move linux/math.h content out of linux/kernel.h To match Linux and allow direct linux/math.h inclusion. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D45452 (cherry picked from commit 588064e658d32f037854dd852b988728197a28de) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 32 +---------- sys/compat/linuxkpi/common/include/linux/math.h | 67 +++++++++++++++++++++++ 2 files changed, 68 insertions(+), 31 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 7679c7f519af..93549178f9d9 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -125,10 +126,7 @@ extern int linuxkpi_warn_dump_stack; #undef PTR_ALIGN #define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a))) #define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0) -#define DIV_ROUND_UP(x, n) howmany(x, n) #define __KERNEL_DIV_ROUND_UP(x, n) howmany(x, n) -#define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) -#define DIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n)) #define FIELD_SIZEOF(t, f) sizeof(((t *)0)->f) #define printk(...) printf(__VA_ARGS__) @@ -522,16 +520,6 @@ kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, #define offsetofend(t, m) \ (offsetof(t, m) + sizeof((((t *)0)->m))) -/* - * This looks more complex than it should be. But we need to - * get the type for the ~ right in round_down (it needs to be - * as wide as the result!), and we want to evaluate the macro - * arguments just once each. - */ -#define __round_mask(x, y) ((__typeof__(x))((y)-1)) -#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) -#define round_down(x, y) ((x) & ~__round_mask(x, y)) - #define smp_processor_id() PCPU_GET(cpuid) #define num_possible_cpus() mp_ncpus #define num_online_cpus() mp_ncpus @@ -541,24 +529,6 @@ extern bool linux_cpu_has_clflush; #define cpu_has_clflush linux_cpu_has_clflush #endif -#define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) - -#define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \ - __typeof(divisor) __d = (divisor); \ - unsigned long long __ret = (x) + (__d) / 2; \ - __ret /= __d; \ - __ret; \ -}) - -static inline uintmax_t -mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor) -{ - uintmax_t q = (x / divisor); - uintmax_t r = (x % divisor); - - return ((q * multiplier) + ((r * multiplier) / divisor)); -} - typedef struct linux_ratelimit { struct timeval lasttime; int counter; diff --git a/sys/compat/linuxkpi/common/include/linux/math.h b/sys/compat/linuxkpi/common/include/linux/math.h new file mode 100644 index 000000000000..fc4542c83f1f --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/math.h @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2014-2015 François Tigeot + * Copyright (c) 2016 Matt Macy + * Copyright (c) 2019 Johannes Lundberg + * + * 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 _LINUXKPI_LINUX_MATH_H_ +#define _LINUXKPI_LINUX_MATH_H_ + +#include + +/* + * This looks more complex than it should be. But we need to + * get the type for the ~ right in round_down (it needs to be + * as wide as the result!), and we want to evaluate the macro + * arguments just once each. + */ +#define __round_mask(x, y) ((__typeof__(x))((y)-1)) +#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1) +#define round_down(x, y) ((x) & ~__round_mask(x, y)) + +#define DIV_ROUND_UP(x, n) howmany(x, n) +#define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) +#define DIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n)) + +#define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) +#define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \ + __typeof(divisor) __d = (divisor); \ + unsigned long long __ret = (x) + (__d) / 2; \ + __ret /= __d; \ + __ret; \ +}) + +static inline uintmax_t +mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor) +{ + uintmax_t q = (x / divisor); + uintmax_t r = (x % divisor); + + return ((q * multiplier) + ((r * multiplier) / divisor)); +} + +#endif /* _LINUXKPI_LINUX_MATH_H_ */ From nobody Thu Aug 1 22:27:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9r33tJz5RZZL; Thu, 01 Aug 2024 22:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9q5GBRz4Z6D; Thu, 1 Aug 2024 22:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSIdV9pgptEaBbNURAzhdLSexnNfXqHe1JXUDDQhq64=; b=el8EkwIvepFtYnaCucpCgB4UYUNr0wlNJ7wTF27MPqBT6xQMJSrl959pCgYWgnjh5GW8dF bu6tHBg5tG/oCua8EPnsZPNbDMh79QK9tFwSjU/BBAfmtoZ8mcLVNFmmr3qbxhHRVW7h+p 9AoHsBRe/exrsJ89dJtEKCEeo7rqJP/SCMurxHTYn3DN4qPJZdrX5tK513jEnsjZ4YZDD0 rbngRq6k2dcugG02blD6vmDwZd0xSRyYwJ5b+TtOWWjfqnbKbUtaXJctQ/tq+N9hPbI5lh Bl1lEKvrBZ4bLgT3wLRm/XbjsezV830cE0zmO6Bc3ZvQmtdIK3mygWQ1BT3hmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551263; a=rsa-sha256; cv=none; b=D+o53wS1IIxz7XToZqU+qZ7wEnmCXmTUTpgIkhSffvpE8DQle6ppNS+Et2H1p0uEKJv5A8 eFEagqsEeY+SxzoKeZzi08uVf+o+WONEXt7AqTU2Kl28+U6lQcG9faAEzqnHdC6SINrK2x vpY9j4TTIk+9alPod2ex7ZK2laxvkJz1mXtGrgIVnrGGt1AYg+cn/qvsiGCNr7z1jAtgRh ispT0aQc+1SkLtHFcy9gA7nvxPr5Ki+dtLNPZ+Wb9YqIqVKxTgQLOAlFl4Dt0V2yE+PrD0 douHFi07BV9/NT/AHefY2JP3FIA/rIrehFmQar9584vjuqXKZ7tstGklTocq/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSIdV9pgptEaBbNURAzhdLSexnNfXqHe1JXUDDQhq64=; b=DvlxyA4DkpxDuN6IjUs5aaNxbN51RQ/A0rOB8qEYXLElO6Vgec28pVeaY5DCvFc7nVn3B+ oGjgEESui201T2rE/lewEMmi2NoiE6GmJ4R99oSh8mpvl5k7Dw07JrfUNQxprSyW9vyNpp vrzrLqMYhvCGcSkLiQl7d2CRsA84v0erhAVOtoz1qkzid/cdmyk7PcoEu1Pucd+/0FBJyy 5YPcKh0I4GXmpsUYwfUQUbw3mo2Y/e7kWNV8SOhRm69fvlrSoucbGH9rxGxng8tH9Dolbq SBcz97fvbmIE4hci0ENR00o+nR7Ui8zfTLFnsb186An8Jk61Qnl2DkKziUE4pg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9q4tKHz12tK; Thu, 1 Aug 2024 22:27: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 471MRhiL027787; Thu, 1 Aug 2024 22:27:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRhpu027784; Thu, 1 Aug 2024 22:27:43 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:43 GMT Message-Id: <202408012227.471MRhpu027784@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: ad02fbb03652 - stable/14 - LinuxKPI: Convert Linux integer types to ISO C99 in linux/kstrtox.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ad02fbb0365238f277b93a8aa5092961c3331efa Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ad02fbb0365238f277b93a8aa5092961c3331efa commit ad02fbb0365238f277b93a8aa5092961c3331efa Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Convert Linux integer types to ISO C99 in linux/kstrtox.h Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D45465 (cherry picked from commit db42bd1f71b1a29b392aacbd5b7aaca4c8d7e85d) --- sys/compat/linuxkpi/common/include/linux/kstrtox.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kstrtox.h b/sys/compat/linuxkpi/common/include/linux/kstrtox.h index b723bd4a6fd0..0567aa99f7a4 100644 --- a/sys/compat/linuxkpi/common/include/linux/kstrtox.h +++ b/sys/compat/linuxkpi/common/include/linux/kstrtox.h @@ -137,7 +137,7 @@ kstrtouint(const char *cp, unsigned int base, unsigned int *res) } static inline int -kstrtou8(const char *cp, unsigned int base, u8 *res) +kstrtou8(const char *cp, unsigned int base, uint8_t *res) { char *end; unsigned long temp; @@ -149,13 +149,13 @@ kstrtou8(const char *cp, unsigned int base, u8 *res) end++; if (*cp == 0 || *end != 0) return (-EINVAL); - if (temp != (u8)temp) + if (temp != (uint8_t)temp) return (-ERANGE); return (0); } static inline int -kstrtou16(const char *cp, unsigned int base, u16 *res) +kstrtou16(const char *cp, unsigned int base, uint16_t *res) { char *end; unsigned long temp; @@ -167,20 +167,20 @@ kstrtou16(const char *cp, unsigned int base, u16 *res) end++; if (*cp == 0 || *end != 0) return (-EINVAL); - if (temp != (u16)temp) + if (temp != (uint16_t)temp) return (-ERANGE); return (0); } static inline int -kstrtou32(const char *cp, unsigned int base, u32 *res) +kstrtou32(const char *cp, unsigned int base, uint32_t *res) { return (kstrtouint(cp, base, res)); } static inline int -kstrtos64(const char *cp, unsigned int base, s64 *res) +kstrtos64(const char *cp, unsigned int base, int64_t *res) { char *end; @@ -197,7 +197,7 @@ kstrtos64(const char *cp, unsigned int base, s64 *res) static inline int kstrtoll(const char *cp, unsigned int base, long long *res) { - return (kstrtos64(cp, base, (s64 *)res)); + return (kstrtos64(cp, base, (int64_t *)res)); } static inline int @@ -218,7 +218,7 @@ kstrtou64(const char *cp, unsigned int base, u64 *res) static inline int kstrtoull(const char *cp, unsigned int base, unsigned long long *res) { - return (kstrtou64(cp, base, (u64 *)res)); + return (kstrtou64(cp, base, (uint64_t *)res)); } static inline int @@ -301,7 +301,7 @@ kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, static inline int kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, - u8 *p) + uint8_t *p) { char buf[8] = {}; From nobody Thu Aug 1 22:27:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9m5346z5RZZG; Thu, 01 Aug 2024 22:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9m2b0jz4YqQ; Thu, 1 Aug 2024 22:27:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lAs+1KA2ZCtPSapRx8IFYZz8NnnpbcnJ7Err2Toh9Y0=; b=Kpu873zImBlRIZ2HbbjqSIOBntLXNiLXvqvLJr09MUETi2Io+P9FSbjKCjYUmE0Kf/1yyy xFnJGRSXowSIuC79u10xvk2tdhGRap8CcCX5mbz63B+6DLpLjDLIYVkTHtvLeGAvqVytAo rZWPrD87qUkI70joKILkRNUAuy21X8DRlbOH3Bpi+SZneNZj1hHSw4Ox/upY9JGwAO8JJf APKTMzVwJenasQHG067f5g3nRjGT7V4pBzUbnbwKYlvi4JPh76XhML9A/MV14bsJO+ltJB zLK7L1ZoBKFVofqE30dCTBNS7kTaRc40NdWSKu6ZpXVSxVd7uVmC7OVWZE/6EQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551260; a=rsa-sha256; cv=none; b=SaOPKcHFYSs/5YxpyMD3qQ1bTzecxP12E0XhWU5kHF/U1+MoQItbnPWFKmRJpDhXHjz4LM rBURvVPtNxyHYzqnDENCBrEPMUYFMeGq5sVqIFgHuw6XuJz6eM4hc9eMuLG5EhEdpiOYjC EKMynVweomVJuz35+uhrlbBrUW4bh17Wrtz8TljOpA6FyFyCjE2LuArD2/7I6p0f0vGf9d wW893bXTlRJC6F0lcZ+fkAR8PcBqDu04TIbfkg7sLmciZ0xHWNx7fAiiL0LytvSIEhBog0 J3/foUOyBeFksN+bBfcoWAXi3XdNQffp4gW1ASl6pt+vcRHEvR8hf46lU+iKBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lAs+1KA2ZCtPSapRx8IFYZz8NnnpbcnJ7Err2Toh9Y0=; b=W4NEpomofXgNGR6NMbFMCNf1bA8ctjs4FvsVA7vVry5SpZJvS6ULClLbttTFJ+va1RCWun wX8oP9ZP7jrzndXUx7L4n/Fxp4zGdgLEUWlSH0mAN618RnW4bMKgMMKcCueNAjW3Bb2vId FE0ofDbTrrTevc9JTtS2MPEwYWqoMw3RIMs22rptqqkwzHBuGn43mWQSTIgjxJ7QFOGp8n 64e+8BFsDf2m0RBChkGyTIJgsq0ygLqfr3yUBozAfzf+OjtMNotKWeAG5dXdr7H1WWtvFL hVNCKoKQBYFziqlhJfei5FTTKdXyoHR4ZcP9bW+X4keUAl7OHhhCmlECFAwb+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9m2BXzz12Jl; Thu, 1 Aug 2024 22:27: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 471MReXE027634; Thu, 1 Aug 2024 22:27:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRe2x027631; Thu, 1 Aug 2024 22:27:40 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:40 GMT Message-Id: <202408012227.471MRe2x027631@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: 42aeb3866cea - stable/14 - LinuxKPI: Add abs_diff to linux/math.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 42aeb3866cea6b00c00de0f5f0ecb09c863ee18f Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=42aeb3866cea6b00c00de0f5f0ecb09c863ee18f commit 42aeb3866cea6b00c00de0f5f0ecb09c863ee18f Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Add abs_diff to linux/math.h It returns absolute value of the difference between the arguments. Add LinuxKPI version check as the macro was moved from drm-kmod to linux/math.h in Linux kernel commit 46f12960aad (6.6 timeframe). Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D45453 (cherry picked from commit afc450fac9f04f11cd916916ac28ffc52a973e1e) --- sys/compat/linuxkpi/common/include/linux/math.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/math.h b/sys/compat/linuxkpi/common/include/linux/math.h index fc4542c83f1f..dad7fa7fbe9c 100644 --- a/sys/compat/linuxkpi/common/include/linux/math.h +++ b/sys/compat/linuxkpi/common/include/linux/math.h @@ -5,6 +5,7 @@ * Copyright (c) 2014-2015 François Tigeot * Copyright (c) 2016 Matt Macy * Copyright (c) 2019 Johannes Lundberg + * Copyright (c) 2023 Serenity Cyber Security, LLC. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -55,6 +56,14 @@ __ret; \ }) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60600 +#define abs_diff(x, y) ({ \ + __typeof(x) _x = (x); \ + __typeof(y) _y = (y); \ + _x > _y ? _x - _y : _y - _x; \ +}) +#endif + static inline uintmax_t mult_frac(uintmax_t x, uintmax_t multiplier, uintmax_t divisor) { From nobody Thu Aug 1 22:27:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9q6nnSz5RZN0; Thu, 01 Aug 2024 22:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9p44QQz4Z1l; Thu, 1 Aug 2024 22:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GsrRceYU7bueKJuQuuG4ux2jZp9Qgyfxnly72tZIaZI=; b=snL8W+Vs/Z3fGotZB/7uql63EMhdQk+NHStaZIZ3Q1+MszcUHwFqr6t1mKqKb+HYiZkNCY b2d9bhRethr3ve1/9u0OJotHetP5l1tNaXS7UVgXoNr/chotcc11AU+mg5J1/Nu1LeYJkE LxDGwBtOhbK7dZQg6nsIEFIgeV57GgxtqaYsJKIq1oLjmQz7vrtHT9fzLxL94wQD9fAhiS CR6DxaNaRE4Krrx7sqQoRjXc4l81amuKSqN1Oj+UYyZpieAKsDslxXjZvmxGLVHdTEDTBS 1z3Lm9IFDTfS8JFeB+SMTsgtCMv9xJLA9221hAS1ZqAxftznb9S73txqtazlcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551262; a=rsa-sha256; cv=none; b=B0hMz7XNDovx+M7MlzRKS3HZNIOY1U90Do5eXy4Ko6Ne7hhTYJxppyaLU4V1KTCKKfrENf YCcojToAiEhGsszl2FzV/j0PUQJUTE/YMKSSDWpxhCXS3AtMsfyksGtBIrzoIdSOdtBByw e3T3KbbZFbOGPfk2Sb0hDAgP6n4bMNxLyBv0qqWSzlgrcr6WQIp2v7boUgmZUq1aPHnM+2 B8m2EfyW+2ewHCx7QMcyngGQN+mxG/HSuvAKa6w+5IkcsdLk6Km44ctzdBVEN0L3IX5mee 3rbPmDxmcJ5az5yKhoGMjeXIPqdsbauAuXZ3xMzazOonzPXVj0Bmx2DqyHI+Tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GsrRceYU7bueKJuQuuG4ux2jZp9Qgyfxnly72tZIaZI=; b=qu97TciAoJgmE5oDOxTbhlrZFrjZwzu5DXQINI3GkPQcUKRrdSFosYgLkmRPr7zy5QBnBP Ot9kGotvBVXSo88qM6hkyeQ8NNR1UMKH9I6oHGRx1Dm8a3qYrkkPlKgxsyRsoBchLlh/5t REPJ+bQ0BKw4yNAkveVRxtJlTfmgDumCtOvil/TFr4q/AkCnEAu5BaQpowp19RGvmtkOag LSQrZBco1O/UQ1+ZbFPMt4d6SkRGNf1d2eni4uhFy6YXXhbgP+RGv6tenyq6TCSWhOFgrY lKoEj/aMFC2ElS8Jb9NtV/ZfDFMsdIRzbrEJ1taPloWa0DjUVo/IIlaJz9OYbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9p3WXGz12np; Thu, 1 Aug 2024 22:27: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 471MRgsb027728; Thu, 1 Aug 2024 22:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRg95027725; Thu, 1 Aug 2024 22:27:42 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:42 GMT Message-Id: <202408012227.471MRg95027725@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: 89e36e9f296b - stable/14 - LinuxKPI: Add kstrtoll to linux/kstrtox.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 89e36e9f296b9592d70798abaa5a6e1edfdb63ad Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=89e36e9f296b9592d70798abaa5a6e1edfdb63ad commit 89e36e9f296b9592d70798abaa5a6e1edfdb63ad Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Add kstrtoll to linux/kstrtox.h kstrtoll converts a string to a long long. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D45455 (cherry picked from commit d207a2dee332706c352bf35c7e6ecea5240b1ceb) --- sys/compat/linuxkpi/common/include/linux/kstrtox.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/kstrtox.h b/sys/compat/linuxkpi/common/include/linux/kstrtox.h index 5dfc56d40d6e..b723bd4a6fd0 100644 --- a/sys/compat/linuxkpi/common/include/linux/kstrtox.h +++ b/sys/compat/linuxkpi/common/include/linux/kstrtox.h @@ -7,6 +7,7 @@ * Copyright (c) 2018 Johannes Lundberg * Copyright (c) 2020-2022 The FreeBSD Foundation * Copyright (c) 2021 Vladimir Kondratyev + * Copyright (c) 2023 Serenity Cyber Security, LLC * * Portions of this software were developed by Bjoern A. Zeeb and * Emmanuel Vadot under sponsorship from the FreeBSD Foundation. @@ -193,6 +194,12 @@ kstrtos64(const char *cp, unsigned int base, s64 *res) return (0); } +static inline int +kstrtoll(const char *cp, unsigned int base, long long *res) +{ + return (kstrtos64(cp, base, (s64 *)res)); +} + static inline int kstrtou64(const char *cp, unsigned int base, u64 *res) { From nobody Thu Aug 1 22:27:41 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9p2Y5kz5RZX9; Thu, 01 Aug 2024 22:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9n3mchz4Z04; Thu, 1 Aug 2024 22:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ga9Fgf9Vgs9ECHqerHHYfPjKkqrsTcLQGnYtzyAsCx0=; b=EhzBifgNTytyGS0ckt1d51ZyYr04wN5aiusXCCpxEcFI4fVi75weBJJ5Jnch2dCde0H6vQ 0ZJcpthIY9Fl73mZ9wVYq4T9lS19pW7ttps5Gyrw37TxQGgGrz3qHEUm5Xa7czLl/cly4E y/I8/P4OTB2wge8dJ47t94ESpVWC1uumo49c0jYoVRRJuliLGxMlYoUhMmy5Fjx2nVXtro SoP/iPkhGAei6BNsEuu2uE1GRLzQpSq9RgzJzn1lHV9Jzk18eIHwkLUs397PMskOQUtkla 7s52reB8XM+jDRJ3GzFGrURnmyDUe5/IseaB2Wc5u1a0LvFWCXVBNWqCdFEceg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551261; a=rsa-sha256; cv=none; b=RFGN7yAqP6ANs4rJfZlbZI8QPUezPfM6PRpgnQfXkoLbKQDQsqDlgk27yE1d9jH6OUfqlU ie5Vz56LN+0ybwVKnOOK7+Kh0nfoCzPAjzxFo5thA3MirfLCnQD/xt9eXwCM9voMfdBaYi SPDGbkYyjoTj5x70pH0o5WAJW7wmzU/MU65rc1VWCZORp0aS1KRJUTlfFGTah24dlO2Nqw AcsHzTMoVx8Q9l2Z85FzCjxZRXqlzx9X1b8nGvqlAVpBezVf7Gcs0NQYwsnzrpQcE48ft7 6bZ5Ab/zxh7HA4iHm3RUYoXcxbiA3I0YJMGE1lJkH9PWccJ+Nq7TX7fFP3LjTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ga9Fgf9Vgs9ECHqerHHYfPjKkqrsTcLQGnYtzyAsCx0=; b=Q0iRT3ZD/DvcFG/16qlEKEXNU9dnC5L3Lz83rZT3spoZ8bOlD/eZYwtk9WfQqNyY729/eM P1CKe9/vic9tI9am8hGs236eC2WyFmmRtCNLR74n6iMCvfUBDjlypT5RL6iRzdRllYripG BDwHUPUl1KkHeRw4w6LnjOyFYmPeDTljGTdMSDOWhjnzBQOOi160X8phTFICNWksD8DeGb MFtfbXcWg0rUCBkEBfUrXrLkDDZSzml1YE7bEfErarEHTY7J5Nam7YFd0NSHC7Kp4sLAD7 PLTP86JJ3365RdlD8Fi6RSeGNXkpLIyRfTgFzClPDTMFk271zDpvzZsg8N2Hsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9n36CNz12hr; Thu, 1 Aug 2024 22:27: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 471MRf6u027685; Thu, 1 Aug 2024 22:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRfMf027682; Thu, 1 Aug 2024 22:27:41 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:41 GMT Message-Id: <202408012227.471MRfMf027682@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: fb884c724402 - stable/14 - LinuxKPI: Move kstrto* functions to linux/kstrtox.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fb884c7244028465fbad701937a555efa630e183 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=fb884c7244028465fbad701937a555efa630e183 commit fb884c7244028465fbad701937a555efa630e183 Author: Vladimir Kondratyev AuthorDate: 2024-06-06 20:42:07 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Move kstrto* functions to linux/kstrtox.h from linux/kernel.h to match Linux and allow direct linux/kstrtox.h inclusion. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D45454 (cherry picked from commit a97f3a9ec96a2de542326a158d1ab8e65ad4fe5f) --- sys/compat/linuxkpi/common/include/linux/kernel.h | 248 +---------------- sys/compat/linuxkpi/common/include/linux/kstrtox.h | 310 +++++++++++++++++++++ 2 files changed, 311 insertions(+), 247 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 93549178f9d9..0b6bca5f388b 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -270,253 +271,6 @@ extern int linuxkpi_debug; #define _RET_IP_ __builtin_return_address(0) -static inline unsigned long long -simple_strtoull(const char *cp, char **endp, unsigned int base) -{ - return (strtouq(cp, endp, base)); -} - -static inline long long -simple_strtoll(const char *cp, char **endp, unsigned int base) -{ - return (strtoq(cp, endp, base)); -} - -static inline unsigned long -simple_strtoul(const char *cp, char **endp, unsigned int base) -{ - return (strtoul(cp, endp, base)); -} - -static inline long -simple_strtol(const char *cp, char **endp, unsigned int base) -{ - return (strtol(cp, endp, base)); -} - -static inline int -kstrtoul(const char *cp, unsigned int base, unsigned long *res) -{ - char *end; - - *res = strtoul(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - return (0); -} - -static inline int -kstrtol(const char *cp, unsigned int base, long *res) -{ - char *end; - - *res = strtol(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - return (0); -} - -static inline int -kstrtoint(const char *cp, unsigned int base, int *res) -{ - char *end; - long temp; - - *res = temp = strtol(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - if (temp != (int)temp) - return (-ERANGE); - return (0); -} - -static inline int -kstrtouint(const char *cp, unsigned int base, unsigned int *res) -{ - char *end; - unsigned long temp; - - *res = temp = strtoul(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - if (temp != (unsigned int)temp) - return (-ERANGE); - return (0); -} - -static inline int -kstrtou8(const char *cp, unsigned int base, u8 *res) -{ - char *end; - unsigned long temp; - - *res = temp = strtoul(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - if (temp != (u8)temp) - return (-ERANGE); - return (0); -} - -static inline int -kstrtou16(const char *cp, unsigned int base, u16 *res) -{ - char *end; - unsigned long temp; - - *res = temp = strtoul(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - if (temp != (u16)temp) - return (-ERANGE); - return (0); -} - -static inline int -kstrtou32(const char *cp, unsigned int base, u32 *res) -{ - - return (kstrtouint(cp, base, res)); -} - -static inline int -kstrtou64(const char *cp, unsigned int base, u64 *res) -{ - char *end; - - *res = strtouq(cp, &end, base); - - /* skip newline character, if any */ - if (*end == '\n') - end++; - if (*cp == 0 || *end != 0) - return (-EINVAL); - return (0); -} - -static inline int -kstrtoull(const char *cp, unsigned int base, unsigned long long *res) -{ - return (kstrtou64(cp, base, (u64 *)res)); -} - -static inline int -kstrtobool(const char *s, bool *res) -{ - int len; - - if (s == NULL || (len = strlen(s)) == 0 || res == NULL) - return (-EINVAL); - - /* skip newline character, if any */ - if (s[len - 1] == '\n') - len--; - - if (len == 1 && strchr("yY1", s[0]) != NULL) - *res = true; - else if (len == 1 && strchr("nN0", s[0]) != NULL) - *res = false; - else if (strncasecmp("on", s, len) == 0) - *res = true; - else if (strncasecmp("off", s, len) == 0) - *res = false; - else - return (-EINVAL); - - return (0); -} - -static inline int -kstrtobool_from_user(const char __user *s, size_t count, bool *res) -{ - char buf[8] = {}; - - if (count > (sizeof(buf) - 1)) - count = (sizeof(buf) - 1); - - if (copy_from_user(buf, s, count)) - return (-EFAULT); - - return (kstrtobool(buf, res)); -} - -static inline int -kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, - int *p) -{ - char buf[36] = {}; - - if (count > (sizeof(buf) - 1)) - count = (sizeof(buf) - 1); - - if (copy_from_user(buf, s, count)) - return (-EFAULT); - - return (kstrtoint(buf, base, p)); -} - -static inline int -kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, - unsigned int *p) -{ - char buf[36] = {}; - - if (count > (sizeof(buf) - 1)) - count = (sizeof(buf) - 1); - - if (copy_from_user(buf, s, count)) - return (-EFAULT); - - return (kstrtouint(buf, base, p)); -} - -static inline int -kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, - unsigned int *p) -{ - - return (kstrtouint_from_user(s, count, base, p)); -} - -static inline int -kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, - u8 *p) -{ - char buf[8] = {}; - - if (count > (sizeof(buf) - 1)) - count = (sizeof(buf) - 1); - - if (copy_from_user(buf, s, count)) - return (-EFAULT); - - return (kstrtou8(buf, base, p)); -} - #define offsetofend(t, m) \ (offsetof(t, m) + sizeof((((t *)0)->m))) diff --git a/sys/compat/linuxkpi/common/include/linux/kstrtox.h b/sys/compat/linuxkpi/common/include/linux/kstrtox.h new file mode 100644 index 000000000000..5dfc56d40d6e --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/kstrtox.h @@ -0,0 +1,310 @@ +/*- + * Copyright (c) 2010 Isilon Systems, Inc. + * Copyright (c) 2010 iX Systems, Inc. + * Copyright (c) 2010 Panasas, Inc. + * Copyright (c) 2017-2018 Mellanox Technologies, Ltd. + * All rights reserved. + * Copyright (c) 2018 Johannes Lundberg + * Copyright (c) 2020-2022 The FreeBSD Foundation + * Copyright (c) 2021 Vladimir Kondratyev + * + * Portions of this software were developed by Bjoern A. Zeeb and + * Emmanuel Vadot 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 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_KSTRTOX_H_ +#define _LINUXKPI_LINUX_KSTRTOX_H_ + +#include +#include +#include + +#include +#include + +#include + +static inline unsigned long long +simple_strtoull(const char *cp, char **endp, unsigned int base) +{ + return (strtouq(cp, endp, base)); +} + +static inline long long +simple_strtoll(const char *cp, char **endp, unsigned int base) +{ + return (strtoq(cp, endp, base)); +} + +static inline unsigned long +simple_strtoul(const char *cp, char **endp, unsigned int base) +{ + return (strtoul(cp, endp, base)); +} + +static inline long +simple_strtol(const char *cp, char **endp, unsigned int base) +{ + return (strtol(cp, endp, base)); +} + +static inline int +kstrtoul(const char *cp, unsigned int base, unsigned long *res) +{ + char *end; + + *res = strtoul(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int +kstrtol(const char *cp, unsigned int base, long *res) +{ + char *end; + + *res = strtol(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int +kstrtoint(const char *cp, unsigned int base, int *res) +{ + char *end; + long temp; + + *res = temp = strtol(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + if (temp != (int)temp) + return (-ERANGE); + return (0); +} + +static inline int +kstrtouint(const char *cp, unsigned int base, unsigned int *res) +{ + char *end; + unsigned long temp; + + *res = temp = strtoul(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + if (temp != (unsigned int)temp) + return (-ERANGE); + return (0); +} + +static inline int +kstrtou8(const char *cp, unsigned int base, u8 *res) +{ + char *end; + unsigned long temp; + + *res = temp = strtoul(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + if (temp != (u8)temp) + return (-ERANGE); + return (0); +} + +static inline int +kstrtou16(const char *cp, unsigned int base, u16 *res) +{ + char *end; + unsigned long temp; + + *res = temp = strtoul(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + if (temp != (u16)temp) + return (-ERANGE); + return (0); +} + +static inline int +kstrtou32(const char *cp, unsigned int base, u32 *res) +{ + + return (kstrtouint(cp, base, res)); +} + +static inline int +kstrtos64(const char *cp, unsigned int base, s64 *res) +{ + char *end; + + *res = strtoq(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int +kstrtou64(const char *cp, unsigned int base, u64 *res) +{ + char *end; + + *res = strtouq(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int +kstrtoull(const char *cp, unsigned int base, unsigned long long *res) +{ + return (kstrtou64(cp, base, (u64 *)res)); +} + +static inline int +kstrtobool(const char *s, bool *res) +{ + int len; + + if (s == NULL || (len = strlen(s)) == 0 || res == NULL) + return (-EINVAL); + + /* skip newline character, if any */ + if (s[len - 1] == '\n') + len--; + + if (len == 1 && strchr("yY1", s[0]) != NULL) + *res = true; + else if (len == 1 && strchr("nN0", s[0]) != NULL) + *res = false; + else if (strncasecmp("on", s, len) == 0) + *res = true; + else if (strncasecmp("off", s, len) == 0) + *res = false; + else + return (-EINVAL); + + return (0); +} + +static inline int +kstrtobool_from_user(const char __user *s, size_t count, bool *res) +{ + char buf[8] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtobool(buf, res)); +} + +static inline int +kstrtoint_from_user(const char __user *s, size_t count, unsigned int base, + int *p) +{ + char buf[36] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtoint(buf, base, p)); +} + +static inline int +kstrtouint_from_user(const char __user *s, size_t count, unsigned int base, + unsigned int *p) +{ + char buf[36] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtouint(buf, base, p)); +} + +static inline int +kstrtou32_from_user(const char __user *s, size_t count, unsigned int base, + unsigned int *p) +{ + + return (kstrtouint_from_user(s, count, base, p)); +} + +static inline int +kstrtou8_from_user(const char __user *s, size_t count, unsigned int base, + u8 *p) +{ + char buf[8] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtou8(buf, base, p)); +} + +#endif /* _LINUXKPI_LINUX_KSTRTOX_H_ */ From nobody Thu Aug 1 22:27:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9s6fVsz5RZSj; Thu, 01 Aug 2024 22:27:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9r60G6z4ZF0; Thu, 1 Aug 2024 22:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XuL9CFcQ3Okt4wpRbSZ5UzA6Y4+iuCtQmbYIaLtW/CU=; b=bMtwPP/yZJuJW0IRNtBiSQobKKO+RnV9jeTx7Z0pES0oAj10MfZm+GDTXJu1J8WAl4ex+R 8Vn/DfqhKd+A0+SXhhm29ogp+0yuVi6ilLJqYYU4UwaIZ5QTQstEbsfN/jQnOjlHrIuG+/ 9CuRXCehJAOa3G+xRmDFeIDA+hgIhdLiStDh/m4nyvd3aoApvrWYp/Dkoh2TQCcY0mL7j9 cmV4xomsUumT1VpFCTR12hcI5+f0nz25Q9hREnLV050oS80XVfA/mewBzVys5CuaK+BUn6 hgQtKSH8KUNxkE1JBpuAI45eBMrBNJzhw6eQLmveX80ZJbSspvESUhLIBDN2Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551264; a=rsa-sha256; cv=none; b=RUr/PE1OmE0NbRok7myvhzbdpetyaoKV2ibmneYrQmujFTkbjjNxCcrU5JM4Jm/r1xo4V7 aUo7WxH+IvKrtVmfaMNH8xOu+YjAa/C/XEfJ7CJHqnvRaYLf4T/+bwHk+Gji6fZcgZQNru 97i9PiQtWm6f3mRHPaT6vCrzmLZgIzanLkW4YPuk01WBpF4WpdJKjSASMdyYDIQJULnG2a qPtAaQ+ttMuU8c1o7Fuj7WCSGVw5IT1cUQRgyRjvggbt2SWyWVroXpXnzX4pseyN7uiM35 DWSjN2bV0WaGAuEpnMj4hPe+EB3dnYuOsf0A/nwG/5z3GHj6LP2V/NN9pJEnkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551264; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XuL9CFcQ3Okt4wpRbSZ5UzA6Y4+iuCtQmbYIaLtW/CU=; b=vubC+9mX2FoxxupZrpAnwkRpSHcAvm6Cm2/MN98v3j1LaCEprWZzp9uPskmAin3iOqyL+/ YGceTHFe9jmwC8EMhcmS9LlsyWwxWrM/5GLJaucBPFYjpHYsZnJ7E35g+oGKt6F3AQhVdG IeOaG37G5tIVwHlVY/oWd16pgp0baIOK3HLh32koGpLB4PE887CRkKscSjsU22OlCfw2US MlmIJ6EloY2wZx0k7qJ0cBywzjfem45N1coSJQNW6SR2SyOhv6hTZ73edKdehGohxP+1GC mqVjz1KITgtOdMXXKEf74BPJGy/klwilnfj5qILJW5C7YhXogWxZcQ5tbmKLrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9r5ckbz12tL; Thu, 1 Aug 2024 22:27:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 471MRiIR027841; Thu, 1 Aug 2024 22:27:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRi0C027838; Thu, 1 Aug 2024 22:27:44 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:44 GMT Message-Id: <202408012227.471MRi0C027838@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: 55d41986ffd4 - stable/14 - x86/pci_early_quirks: Sync Intel 11th+ gen PCI IDs with Linux List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 55d41986ffd4b4c6236075c31c4c1f5448249d41 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=55d41986ffd4b4c6236075c31c4c1f5448249d41 commit 55d41986ffd4b4c6236075c31c4c1f5448249d41 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:42:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 x86/pci_early_quirks: Sync Intel 11th+ gen PCI IDs with Linux Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu, imp Differential Revision: https://reviews.freebsd.org/D45617 (cherry picked from commit 249e24d76a7c369fcfd08b1b3d0802dea94b7c6c) --- sys/x86/pci/pci_early_quirks.c | 2 ++ sys/x86/pci/pci_early_quirks.h | 50 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/sys/x86/pci/pci_early_quirks.c b/sys/x86/pci/pci_early_quirks.c index 40340c76005a..275108270bd0 100644 --- a/sys/x86/pci/pci_early_quirks.c +++ b/sys/x86/pci/pci_early_quirks.c @@ -260,7 +260,9 @@ static const struct pci_device_id intel_ids[] = { INTEL_RKL_IDS(&intel_stolen_ops_gen11), INTEL_ADLS_IDS(&intel_stolen_ops_gen11), INTEL_ADLP_IDS(&intel_stolen_ops_gen11), + INTEL_ADLN_IDS(&intel_stolen_ops_gen11), INTEL_RPLS_IDS(&intel_stolen_ops_gen11), + INTEL_RPLP_IDS(&intel_stolen_ops_gen11), }; /* diff --git a/sys/x86/pci/pci_early_quirks.h b/sys/x86/pci/pci_early_quirks.h index 2af0408e0ea5..020e9fd359db 100644 --- a/sys/x86/pci/pci_early_quirks.h +++ b/sys/x86/pci/pci_early_quirks.h @@ -466,16 +466,25 @@ INTEL_VGA_DEVICE(0x5A4C, info) /* ICL */ -#define INTEL_ICL_11_IDS(info) \ +#define INTEL_ICL_PORT_F_IDS(info) \ INTEL_VGA_DEVICE(0x8A50, info), \ - INTEL_VGA_DEVICE(0x8A51, info), \ - INTEL_VGA_DEVICE(0x8A5C, info), \ - INTEL_VGA_DEVICE(0x8A5D, info), \ INTEL_VGA_DEVICE(0x8A52, info), \ + INTEL_VGA_DEVICE(0x8A53, info), \ + INTEL_VGA_DEVICE(0x8A54, info), \ + INTEL_VGA_DEVICE(0x8A56, info), \ + INTEL_VGA_DEVICE(0x8A57, info), \ + INTEL_VGA_DEVICE(0x8A58, info), \ + INTEL_VGA_DEVICE(0x8A59, info), \ INTEL_VGA_DEVICE(0x8A5A, info), \ INTEL_VGA_DEVICE(0x8A5B, info), \ - INTEL_VGA_DEVICE(0x8A71, info), \ - INTEL_VGA_DEVICE(0x8A70, info) + INTEL_VGA_DEVICE(0x8A5C, info), \ + INTEL_VGA_DEVICE(0x8A70, info), \ + INTEL_VGA_DEVICE(0x8A71, info) + +#define INTEL_ICL_11_IDS(info) \ + INTEL_ICL_PORT_F_IDS(info), \ + INTEL_VGA_DEVICE(0x8A51, info), \ + INTEL_VGA_DEVICE(0x8A5D, info) /* EHL */ #define INTEL_EHL_IDS(info) \ @@ -483,6 +492,7 @@ INTEL_VGA_DEVICE(0x4551, info), \ INTEL_VGA_DEVICE(0x4555, info), \ INTEL_VGA_DEVICE(0x4557, info), \ + INTEL_VGA_DEVICE(0x4570, info), \ INTEL_VGA_DEVICE(0x4571, info) /* JSL */ @@ -536,6 +546,7 @@ INTEL_VGA_DEVICE(0x4682, info), \ INTEL_VGA_DEVICE(0x4688, info), \ INTEL_VGA_DEVICE(0x468A, info), \ + INTEL_VGA_DEVICE(0x468B, info), \ INTEL_VGA_DEVICE(0x4690, info), \ INTEL_VGA_DEVICE(0x4692, info), \ INTEL_VGA_DEVICE(0x4693, info) @@ -561,6 +572,12 @@ INTEL_VGA_DEVICE(0x46C2, info), \ INTEL_VGA_DEVICE(0x46C3, info) +/* ADL-N */ +#define INTEL_ADLN_IDS(info) \ + INTEL_VGA_DEVICE(0x46D0, info), \ + INTEL_VGA_DEVICE(0x46D1, info), \ + INTEL_VGA_DEVICE(0x46D2, info) + /* RPL-S */ #define INTEL_RPLS_IDS(info) \ INTEL_VGA_DEVICE(0xA780, info), \ @@ -568,6 +585,25 @@ INTEL_VGA_DEVICE(0xA782, info), \ INTEL_VGA_DEVICE(0xA783, info), \ INTEL_VGA_DEVICE(0xA788, info), \ - INTEL_VGA_DEVICE(0xA789, info) + INTEL_VGA_DEVICE(0xA789, info), \ + INTEL_VGA_DEVICE(0xA78A, info), \ + INTEL_VGA_DEVICE(0xA78B, info) + +/* RPL-U */ +#define INTEL_RPLU_IDS(info) \ + INTEL_VGA_DEVICE(0xA721, info), \ + INTEL_VGA_DEVICE(0xA7A1, info), \ + INTEL_VGA_DEVICE(0xA7A9, info), \ + INTEL_VGA_DEVICE(0xA7AC, info), \ + INTEL_VGA_DEVICE(0xA7AD, info) + +/* RPL-P */ +#define INTEL_RPLP_IDS(info) \ + INTEL_RPLU_IDS(info), \ + INTEL_VGA_DEVICE(0xA720, info), \ + INTEL_VGA_DEVICE(0xA7A0, info), \ + INTEL_VGA_DEVICE(0xA7A8, info), \ + INTEL_VGA_DEVICE(0xA7AA, info), \ + INTEL_VGA_DEVICE(0xA7AB, info) #endif /* _PCI_EARLY_QUIRKS_H_ */ From nobody Thu Aug 1 22:27:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9w3Tfmz5RZmZ; Thu, 01 Aug 2024 22:27:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9w1rzwz4ZFP; Thu, 1 Aug 2024 22:27:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iU/FQG3pm9hGfgUzpWz8EwbQU3n2nQrdfu/kFJHq2vw=; b=RoX+PQavWSRpRCXepOPplkbZIp4NKICfUdKpmym6XLKmYlFlHCCNRGORL/8YdVc+GQIBWF HucK7f3UULIXPGSjW9eGJXMGGJj1EAJbXcIzni3akim9Mr98ql5UXXpJXfnj7xS7SyvrZ7 VtxjtMp6riJAGTYzC7MGmJa5saPqSyue/MdsqSAQ2Q0906OEIP4s8lGrK/EzERJ7G80ljH cnDVZPfpUy4fUZKpJmG7LQBN6eo1Olbb8+MUPYGvAp+69g/tldJfhCOzGitEzwnbXjGBlw NHLGRQQW/qGTlcRpnAU3NZYOnF+3ZgE36TOEuJEEjluI+GR+RZx/VpDAOVDVGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551268; a=rsa-sha256; cv=none; b=uIw6SLzBS9Naej8qW8GYXwmxkIjBT/XRQMLNL8U1zmQIhUjy409kaZJFABA4IxE56fH45I EkFporo5KoDAQmlww9nEqfRetc633QHVTAeJfh+P3oIgZK31B9mN4EShTYB657RgUDKdZu 0J0GPu7o/kjBsfo+Aup6ywY1VbcYMQ4QgQj3Y7avsmrSzaoAN7cPqAjzM+REHInXsyToDm nWq8IMo179dJw5J3wV9QOgh2fgnHRIQ68U/WSFs59wU+iugu3FgJh55oJTytC4S6OJSYrM oedm8nzD9WLSsvwFIfBJ2yV1ilmwQSQxnWYo8Eh2Go4yV+ZjbgVzDGDRRI0weg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iU/FQG3pm9hGfgUzpWz8EwbQU3n2nQrdfu/kFJHq2vw=; b=xwh1/8+go7jtVlgbZdWBZAeQSKVxk0QqBGeDcRf+NvA826dnDRKO3iYCjY/o+38LZdUZPo btA3xpGiS8FCSpW/SdYmSwgQsvzWla87PRIdCqFYaxeq2cBjFeGlQ5DeV/pUlxmvJVhdSS Kxw8uQ5tQYTMnsDsSzg/Bok2pC0/B75fRU+0AWaGVeO3+01lZmSVHDU/Y96atx8vrnWYfq 5cRNdaLPAxmsSDjdV0oSZt0vDVh+HRFe9oHGxfcPr9HmJUDXE49yQ6/RhVRlVr0dIQdeSC uWJ4UY32g4mV8YW1rVT9+/CzKAAYn5VXftxqsjWsezTcfTYUvQcjD7w808TUIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9w15nXz13Cw; Thu, 1 Aug 2024 22:27: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 471MRm3T027991; Thu, 1 Aug 2024 22:27:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRmfg027988; Thu, 1 Aug 2024 22:27:48 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:48 GMT Message-Id: <202408012227.471MRmfg027988@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: 1e30fc5d7ffa - stable/14 - LinuxKPI: Remove owner argument from class_create function on KPI layer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 1e30fc5d7ffaa39281a0309c594a031d74ffd20a Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=1e30fc5d7ffaa39281a0309c594a031d74ffd20a commit 1e30fc5d7ffaa39281a0309c594a031d74ffd20a Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:44:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Remove owner argument from class_create function on KPI layer to chase Linux 6.4 Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D45610 (cherry picked from commit 460908ea55e67baf85d5cd1b6093154739cc0b9a) --- sys/compat/linuxkpi/common/include/linux/device.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 770c5c334c9a..98c16212512d 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -342,6 +342,9 @@ put_device(struct device *dev) } struct class *class_create(struct module *owner, const char *name); +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60400 +#define class_create(name) class_create(NULL, name) +#endif static inline int class_register(struct class *class) From nobody Thu Aug 1 22:27:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9v3Zfgz5RZXY; Thu, 01 Aug 2024 22:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9t04LPz4Z2K; Thu, 1 Aug 2024 22:27:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTJMSjb67SpNYdHjl2LlDDEdGlg6QIB5ktDZQBHnpvU=; b=DoLSszOZyhSzv/6cVzVf8bOZ/wlbnIqKhbECcp+b9YJrCQ2n3peLqHXeezMMnw5DJ0i2aX 4Iu7WtYP+t5G9TQo0oPr5ujZgxvk384/IRPAer9aCw/nrZXfQNo0sOb9mkkYTstxkjUbqW basBuDDXTH5Enr5a0vu3rgimEM1gIbswZZvShpKXZzYeUDNvtQmo0Yud9y1Hr0Qibmi+NU GEp6YywLaYdZnKjsuOw+f+BxzTcdDUWnPIhpGUjllj3D1WnEbehe879WiajD61/SIL8ArA nDuhSSNekak7Y9kR/ivlrtIGduLt0OhNyN/4endMLge/Y20Txkj3VsikqHCxnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551266; a=rsa-sha256; cv=none; b=RgiMzjp8iVA+Arnhe/m0lTN+1UntBwOQrynK91rF5KTMkaTQqnOaAeL8UEGVg/lhGTMRiH sm62bzFtQB5pxUzG5U0JnyYgJ/5uzdtbZ0trp+h/84Zdx2YciHIXaoSeh6GUoC7vP7wK3D JrPAH8XKDqgiW/GywuOGsw3FnjU0yFf5jA/nM4bZETx5XgayVgkt5yOuwqN0vui8T13o/3 2Q926SE4NVF2+Hs794xv905ykF/AbWWBL4LTGH8WfFovr+9gdp67ZMe1+Mx0DpLEkbqKe7 tE66nBKUR2SaKLmUqOW3r/oGWbn53yn5BN+/jF03vP8OmPk7azswdC/pDoksdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LTJMSjb67SpNYdHjl2LlDDEdGlg6QIB5ktDZQBHnpvU=; b=bjveuxwRW/S7ICbMfHmnlbNFqVMrlQ8kQ0AzdNaoaPZ1H32kLzpRtAQR/mfcRWuws0AAOm iNkNHycZ27y+pLNEwKfyDv7u08o8BNf3/FfhHa5szQDo4Jwr1xusFQScrQhP02S8xy45RT Q4Ampr+MWaivuQ7jJaIyK8kFefdY5rcw6gYrTuVqJIE7NgN84mTm2eC0TGmABYb51LsNCx 6IEgPbhSxQGTv+WUVqWAMmEwy4T1XyQvkMs2SYdc1otUgfbnx7hUNShY0PfL8hknMUTian /PfBgg+8iT+vHs4ESw1EgWZ2P1LyR8Ln6AkQXC1XNJjPGXRyT7EsLLjggLOe1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9s6nTVz12hs; Thu, 1 Aug 2024 22:27: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 471MRjTE027880; Thu, 1 Aug 2024 22:27:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRjCc027877; Thu, 1 Aug 2024 22:27:45 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:45 GMT Message-Id: <202408012227.471MRjCc027877@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: 4f0f1f1a6e2a - stable/14 - LinuxKPI: Add rb_add_cached function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 4f0f1f1a6e2aabd265cc6e25fd14c846da1bb8b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=4f0f1f1a6e2aabd265cc6e25fd14c846da1bb8b8 commit 4f0f1f1a6e2aabd265cc6e25fd14c846da1bb8b8 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:43:16 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Add rb_add_cached function rb_add_cached inserts node into the leftmost cached tree Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45608 (cherry picked from commit a5cac2e672a7d94c0391076e7452d6a487f7b5c1) --- sys/compat/linuxkpi/common/include/linux/rbtree.h | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/rbtree.h b/sys/compat/linuxkpi/common/include/linux/rbtree.h index 78bf938eb000..e6033cfd760d 100644 --- a/sys/compat/linuxkpi/common/include/linux/rbtree.h +++ b/sys/compat/linuxkpi/common/include/linux/rbtree.h @@ -175,6 +175,30 @@ rb_replace_node_cached(struct rb_node *old, struct rb_node *new, root->rb_leftmost = new; } +static inline struct rb_node * +rb_add_cached(struct rb_node *node, struct rb_root_cached *tree, + bool (*less)(struct rb_node *, const struct rb_node *)) +{ + struct rb_node **link = &tree->rb_root.rb_node; + struct rb_node *parent = NULL; + bool leftmost = true; + + while (*link != NULL) { + parent = *link; + if (less(node, parent)) { + link = &RB_LEFT(parent, __entry); + } else { + link = &RB_RIGHT(parent, __entry); + leftmost = false; + } + } + + rb_link_node(node, parent, link); + rb_insert_color_cached(node, tree, leftmost); + + return (leftmost ? node : NULL); +} + #undef RB_ROOT #define RB_ROOT (struct rb_root) { NULL } #define RB_ROOT_CACHED (struct rb_root_cached) { RB_ROOT, NULL } From nobody Thu Aug 1 22:27:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9v4N1mz5RZXZ; Thu, 01 Aug 2024 22:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9v0m2dz4Z2S; Thu, 1 Aug 2024 22:27:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ddXgbLK+hBljDmNTXBCF/e1JXY4XexfkMz/QJmkTEM=; b=OuCTGg/E/q3FcaYT5qEGLW1T1OKrFr5u0ViSbFNfZmYSo4Eb8LrqSFJiTJMr/3U8d97E51 BXgTgW9QcVrrs1cTKLExsRwhfFsvVT3apJ+UrNR5bZKF6VN1FHQzBltPCh2YQn216xGQ7r GxLkHaVnOJygG+KLqOhOZ+xu5JIt+dbUCLqkDTAgs2F7iCJsnOHcKP7SMAF6WaIu0DBbtL f6+dBDvNT1y2D/xGBBMewt+lTA1nrXJy6f6zG9d6/u34OhwmAMO/asHGLEjuQaDqHbbk2Z PuT18YunugDSz7OtgpvZn8oTiRfg5lOlj8GkQl6h8zWeZ8SCX/7VvxgvQFj4Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551267; a=rsa-sha256; cv=none; b=qEUMgUmfL5+WGrSAjbzGSGCdBtjjR2XmF9YhrVNgr4RrLUokZcBgEvWylPv6h2KEu1SgDx 9r6hAf8Vw/dE0IF+V/m8JgRl38/jy1Kt21xBRv4t6bedI51euyYz8qof6OXBox3SC1y+2B goPmLNaF8AJiH4C4WxjZPaHJbdAKIIP1ab9apw5PNu6+oAfgUUM6Jb3K4Zkxs3f+d+mt7d r1exGCWWilOOObfbYQ0aMiDJWtNAuR59Tknbx1p/L9hk5scWQBE3u9K+FyXcngBLphIJlh 1vfgrnUdu83hZzAVb+16s+Xw/hhfs9eUpf7Ff6214zmZXObC/0ZtX2ZwnDGG5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0ddXgbLK+hBljDmNTXBCF/e1JXY4XexfkMz/QJmkTEM=; b=cOW9FtU+lrEgBqLPL7g+23dEAm0s5ZFHyxaDIkRAVVKgLJqq3tTk07tsmF1PBDp6kaxLCW cFsVzp3EX9awn32826bJmjy08vtm5egbpFUnrn99y26rCEi50ig6qznDu0T8rL1/TGbRqV J+SSs/P0/TvsprM2MA8NB74W95cKC7kz/rBOIFfgVlwvAem158OtEhavAlPZQObgxGY2Ab iHLJisO3Snauj/qJUOxeKjKO9PF5x0yfOfz2VNX9rIQQ4Qfz9xngBB0q3Jz1oGKW58EU6v oufQBGLT354CNf3bl+161uLRlnhovModjmyysDEPC5dc+s/HqZdC0QvrcFbdsQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9v0NVdz12nq; Thu, 1 Aug 2024 22:27: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 471MRknO027925; Thu, 1 Aug 2024 22:27:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRknM027922; Thu, 1 Aug 2024 22:27:46 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:46 GMT Message-Id: <202408012227.471MRknM027922@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: ddde8df29363 - stable/14 - LinuxKPI: Add kmap_local_page function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: ddde8df29363d4dfccb39975039d56e93275f061 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ddde8df29363d4dfccb39975039d56e93275f061 commit ddde8df29363d4dfccb39975039d56e93275f061 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:43:43 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:40 +0000 LinuxKPI: Add kmap_local_page function kmap_local_page maps a page for temporary usage Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45609 (cherry picked from commit 73f3589120e61b4b9df1ef60c5be12ccd81878f2) --- sys/compat/linuxkpi/common/include/linux/highmem.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index f770bef6b3b7..252d16b2ea70 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -93,6 +93,12 @@ kmap_atomic(struct page *page) return (kmap_atomic_prot(page, VM_PROT_ALL)); } +static inline void * +kmap_local_page(struct page *page) +{ + return (kmap(page)); +} + static inline void * kmap_local_page_prot(struct page *page, pgprot_t prot) { From nobody Thu Aug 1 22:27:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9z2ZY4z5RZbl; Thu, 01 Aug 2024 22:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9y3QSFz4ZR5; Thu, 1 Aug 2024 22:27:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ZrgE7al9u+Aaa5hcrumNZkhpLhcD7uo020zqqKrF0M=; b=c3H/ufanryCTH1HNo+xZehKDZEn1I/p9BzG/pUS8RI1RNok3yzqvIuZqvuercFdLvoSBbp HMGXyFwUiGlghYqpqecy9pGlgjBSrMG+t/8HN77vmL9l71mhTZWmOxqDoMTXXrER5bRaNu hnMtCy5R4DMFi6KVk0RhtgD/tzV4/p/Ei1Ym3S67c0echRLSihvE3xO4Z2ZN+YKbnPB1qY 5aFwp1QmfiOFi4kNtHTwiDGmS1rrUZ35fYf9in4U5Q6jYJIv7ylfxlUkDmKluYJL8YiIXn rbjauObmkV8ThPYhy+YtfUjuz1YMOI/dBy3mZXKyax0QfshtnZbmDVMUshg8Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551270; a=rsa-sha256; cv=none; b=KcXgf9pK5p68Nh3gYFE6VszR900bhaPsf4omYpgXORsg5wRkkZLkp2cdKVwXTvBj1x6k/n 3qD486USq6mMRynbOe+xBpbaMA/VvkTqUbFw2xnIFu0iYRh9PMk+oDuseG0Sobzbsw8s42 wQsWaiNcBJ77SES/fDcIvuPp1jWo8/PgUldvF1oF1/HXY6c1F3Cxxu6eXKKXjgbFmWoZkU EnY3DIQAOsoMADwAE87ozadUAGXB0keVS1LewIzPaeSjyTKdsSzIx5AgzyCt4F/hlQIqsD mnuWW+aE9lWYnRY+7SSCuE4p/rvld3ip6HxHjt7LErArcGDvnyEOBQuf09Oezg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ZrgE7al9u+Aaa5hcrumNZkhpLhcD7uo020zqqKrF0M=; b=fmhZSYBNzPtW5SyD5KDUalHbjw3hroNsXqTDDhwGp4sQnIDo6iTiEE5vF4hg5jvvaqLqAg /UndC7yT44WZBYmeQNAUvzpV3fVEdWgpFhGEtrF5+at2iCnhFOTL7F2JfFD7ZPDwfkBZQY splVGgQgVEljKIEtSiOxNnSNOEcTgGfOF+z3jJZyF8yVT1MHOr/B7752gejLcx3vxxH7Ft e2Cu3JlJssfzwsWFp5jY5RABE0qMo6Ub4QM0PXmFnGi37ppf3qKw11V2L3bYfOzSpH7w4x XN6RqIkfgdH6mEL0v2cJDfZb2O4m63X+mfEwMTpzwYN5mPrYkB4ldKOUPxtBug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9y32V3z12Jm; Thu, 1 Aug 2024 22:27: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 471MRofe028084; Thu, 1 Aug 2024 22:27:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRo9U028081; Thu, 1 Aug 2024 22:27:50 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:50 GMT Message-Id: <202408012227.471MRo9U028081@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: fe431f8c0822 - stable/14 - LinuxKPI: Add header polution to compile linux/numa.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fe431f8c08225715b97250040bb263603c1861e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=fe431f8c08225715b97250040bb263603c1861e9 commit fe431f8c08225715b97250040bb263603c1861e9 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:44:56 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Add header polution to compile linux/numa.h Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz, emaste Differential Revision: https://reviews.freebsd.org/D45612 (cherry picked from commit d21316ff22b1468304b6db9c336f66a09c4f7be8) --- sys/compat/linuxkpi/common/include/linux/highmem.h | 1 + sys/compat/linuxkpi/common/include/linux/mm.h | 1 + sys/compat/linuxkpi/common/include/linux/mmzone.h | 1 + 3 files changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h index 252d16b2ea70..b8874481f9c6 100644 --- a/sys/compat/linuxkpi/common/include/linux/highmem.h +++ b/sys/compat/linuxkpi/common/include/linux/highmem.h @@ -43,6 +43,7 @@ #include #include +#include #include #define PageHighMem(p) (0) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index 41af4be4c015..e2bda799dc77 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sys/compat/linuxkpi/common/include/linux/mmzone.h b/sys/compat/linuxkpi/common/include/linux/mmzone.h index 49cc218c6fce..9fd481e18ee4 100644 --- a/sys/compat/linuxkpi/common/include/linux/mmzone.h +++ b/sys/compat/linuxkpi/common/include/linux/mmzone.h @@ -4,6 +4,7 @@ #define _LINUX_MMZONE_H #include +#include #include #define MAX_ORDER 11 From nobody Thu Aug 1 22:27:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB13Hfgz5RZhk; Thu, 01 Aug 2024 22:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9z62l3z4ZDL; Thu, 1 Aug 2024 22:27:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCXI1FLs8H//PoPVJHJc7UTEcujLD5oGtFMgwWaalSI=; b=qKEEL/vUiww8FA+eHtgzHq6DKka1e37fQOUD/z719uAMdq/p1eJ7b6/Vjy/9tt6e1NbEco es52a3MXqAy/LwTNI5x64ekgAt3McOvW4q/yweaaZGpNpmKSGGwx5MczAa46S85/PM96pa eJhiFWl7IwgfwQQ+wSeqTBUUN+hs3dAsjJIs58Q4zi92+MBbD0D1RVgvtpzhL78le8AbPm Fw7umPKCo4v5/doN2GVAE/fRx5sJYbIIslOYnMBkJIr/aedp74uIEMInjSt8g063zV6w9H ewMgwYft/0bgMQlVcMCDBWxckGS5xwR6PX0UW+klOK8kwxvE+dYUV9HqFYPY+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551271; a=rsa-sha256; cv=none; b=u2EcNQwdbfpF7XiE0uRuIdUIR1FkWDu4fpUvO6Kz2s7N+gMN0yHfG4duz5fO4dSC+ZQi9e CTLKHbv7eEJCVTizs12om5b3MVIeFyw1X75pTZw+zi/Oyn/U5KqqD1iB2BCNWnwnds1FgD fKDBPmXxnFM98yILJGm3Mnwi7kGjB5hh0RZR4pB+P2KDXNdJvwSetUu324FZY7zWr3qP4Q 7KXGFDi4IO9j3nc6878AzA7h2ev96acJZx+hT4mPq6C85enUoX/3ful59d422qwVHVfgfF ICvAvtUOsp+ltZJa1Z9CRIxahMyXde7kfUxh3WKOvuzClN+cddRzXOYRj0ssng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qCXI1FLs8H//PoPVJHJc7UTEcujLD5oGtFMgwWaalSI=; b=U6aB0JDXhbgL2+uQ4/gby2ZEvT/p4qX9aalmjZvMnwgD0NsE/m2PaJbRC12jfpKtr1jpoI 6Yz+MRPMLkNI6WoFa88d1VUMkwUU8I6oYqPwEca0HKtd7GOXHDlXtq2HRZx6+e9qe2BXO4 uu/MLAhumVMBH7rJkPCDIioamEMlqMwAB0VvMUT3MywnW71KM59m3RpnwvxPigWy/6e0Ya Y2sRlJbnLpj2iSZ4n7YuzFH/LMzYaBWUG+2Ti3myLsIyajEaGKwkiFmnEk59vnc8mW2lum /CAJUDTZftHLb4giWnvv5Q3UZrjG9OWss1yCylz3uoBl7adu3+ySG1wWGJlW8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9z42zVz12tM; Thu, 1 Aug 2024 22:27: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 471MRpDI028133; Thu, 1 Aug 2024 22:27:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRp3R028130; Thu, 1 Aug 2024 22:27:51 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:51 GMT Message-Id: <202408012227.471MRp3R028130@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: c0b32a4ea49e - stable/14 - LinuxKPI: Remove linux/sched.h include from linux/kernel.h 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c0b32a4ea49e50ef45c0247b922ca68a4229b768 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=c0b32a4ea49e50ef45c0247b922ca68a4229b768 commit c0b32a4ea49e50ef45c0247b922ca68a4229b768 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:47:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Remove linux/sched.h include from linux/kernel.h header This include prevents usage of any kernel.h helpers in sched.h and all of dependencies. Linux does not have it too. Fix building of kernel and drm-kmod after than. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45692 (cherry picked from commit 256eb8d5361143b7d436a195530e0eefe1450e6d) --- sys/compat/linuxkpi/common/include/linux/gpf.h | 33 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/idr.h | 1 + sys/compat/linuxkpi/common/include/linux/kernel.h | 1 - .../linuxkpi/common/include/linux/scatterlist.h | 3 ++ sys/compat/linuxkpi/common/src/linux_rcu.c | 1 + 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/gpf.h b/sys/compat/linuxkpi/common/include/linux/gpf.h new file mode 100644 index 000000000000..01e883a94728 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/gpf.h @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Serenity Cyber Security, LLC. + * + * 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 _LINUXKPI_LINUX_GPF_H_ +#define _LINUXKPI_LINUX_GPF_H_ + +#include + +#endif /* _LINUXKPI_LINUX_GPF_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/idr.h b/sys/compat/linuxkpi/common/include/linux/idr.h index ca3f8171ff44..7f55b8e57c7e 100644 --- a/sys/compat/linuxkpi/common/include/linux/idr.h +++ b/sys/compat/linuxkpi/common/include/linux/idr.h @@ -34,6 +34,7 @@ #include #include +#include #include #define IDR_BITS 5 diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 0b6bca5f388b..0786151c4ca8 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index e462d5c649f1..51ced19e6b5b 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -32,8 +32,11 @@ #define _LINUXKPI_LINUX_SCATTERLIST_H_ #include +#include +#include #include +#include #include #include #include diff --git a/sys/compat/linuxkpi/common/src/linux_rcu.c b/sys/compat/linuxkpi/common/src/linux_rcu.c index 20fdf186a78a..4515684aabc7 100644 --- a/sys/compat/linuxkpi/common/src/linux_rcu.c +++ b/sys/compat/linuxkpi/common/src/linux_rcu.c @@ -42,6 +42,7 @@ #include #include +#include #include #include #include From nobody Thu Aug 1 22:27:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZk9x4yHPz5RZY5; Thu, 01 Aug 2024 22:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZk9x2Nf0z4ZQq; Thu, 1 Aug 2024 22:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tWEf98xe0AtT7wGu5bUgk6P39p2EMQMaYlP6QRh8oKI=; b=dD10rauL5BsC+/7ee7CwMfgyvP2KsI+zymqc9pZTeZ2Hm4Q/L95vcCz5iYsJmZOtkWtU2c 1cPbtImPzfQEVYQ8FVjJbmsljt4FeEta0tIl12c1GtBRNtHmPjhjDiYMWPCBUoJK+NyzHL K4vHuaY0WbWT/7DxLFL6cq0nKhWqZ2M9pqFLYPoA7aXx20ZoMghEFkF2cNu/zZBxPuFCO8 2ufSsotg61PnFSp3fsW7lWx90Z6c+W6X6HrZ/krBQVSNvVKRnYtCkXs7OKl56oT1jK2iBM nUio5VUKJyiZ3ySHjznyxEQR7ISweq95WsKL30nNVFIDBYsZSWjyA+6qOfc8eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551269; a=rsa-sha256; cv=none; b=Vuk3RSKHd9rJWNNYSm0MUa1YgEVyEX2WF1lF9FNIo3g9VSUCHRmx5xgi2mUWw1AOxKyPL+ r41LeQEr+VtDpD0m+mY5JQ3AlzkIwlR4pe6OkfCAZARx6hPd/BgOYsAtyghxEtz6QJQ+iA eOdDc8As1Lmb7ixGdvyDvJ4Z+ZqodWPQG4BXabj0rvaGK55eiPSBIHc9QvF/Jt2Yqykh4u mVybJUyTbnM90CnNg64o8gnRQnfzloz76PhdJ8a2tGxJpKRvWbkUnnlKxQXUCxLaA27Ofl vGDd3jvAkvfPG4Al5kujOK3xL4Jx3GaH0Tux0VQIv6xcLBaids6MH8M/zYYyOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tWEf98xe0AtT7wGu5bUgk6P39p2EMQMaYlP6QRh8oKI=; b=rRuY+EQfW0SeyCgVQnyZznmULfZplMttyh68WU9Cu4WRyDX9qnhuqcN+TradwDJj/wZ/vx /VIiBh2RMoRvh+a9+K2/I+AN9VvsUqvyF6481xtlwH1UiJdyYJW6m74ZE8SyhXH9ntzET3 s334pLXI0vA2sP7aBMoAA7TeMbuaGWXX6W08LfYfL+dKZsSIG/TwDLOydchrKsBXoKXxSZ zk9/PyIxQC7usfaA5lT/qUmlCqxs0y5woHAmCH+UDggx3RA6zUXRZkNg5rmKdLSpx9PEiw aFG+8Dzk73nR0o9FvWIogmp9COhHZOMZ3XxAN05aUeTpmj4SYfM38f3gyw+vVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZk9x20d8z12nr; Thu, 1 Aug 2024 22:27: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 471MRnqs028036; Thu, 1 Aug 2024 22:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRnI4028033; Thu, 1 Aug 2024 22:27:49 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:49 GMT Message-Id: <202408012227.471MRnI4028033@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: 28b5a9b45888 - stable/14 - LinuxKPI: Add smp_store_release and smp_load_acquire 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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 28b5a9b458886028e64147996ff0745af23388e8 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=28b5a9b458886028e64147996ff0745af23388e8 commit 28b5a9b458886028e64147996ff0745af23388e8 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:44:37 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Add smp_store_release and smp_load_acquire functions Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45611 (cherry picked from commit 597ffdc1d3503110165dd57685c29da64386a7db) --- sys/compat/linuxkpi/common/include/asm/barrier.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/asm/barrier.h b/sys/compat/linuxkpi/common/include/asm/barrier.h index d09f9c6d2c97..39c5139cb322 100644 --- a/sys/compat/linuxkpi/common/include/asm/barrier.h +++ b/sys/compat/linuxkpi/common/include/asm/barrier.h @@ -58,4 +58,7 @@ #define smp_mb__before_atomic() barrier() #define smp_mb__after_atomic() barrier() +#define smp_store_release(p, v) do { smp_mb(); WRITE_ONCE(*p, v); } while (0) +#define smp_load_acquire(p) ({ typeof(*p) _v = READ_ONCE(*p); smp_mb(); _v; }) + #endif /* _LINUXKPI_ASM_BARRIER_H_ */ From nobody Thu Aug 1 22:27:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB3092Hz5RZfM; Thu, 01 Aug 2024 22:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB16M93z4ZTH; Thu, 1 Aug 2024 22:27:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXCtb//uvpHJiledPqWtSzt6ZkDl0IbHYXV2cNgIiVw=; b=pOW2pf7Mw4fjcc1olKUVx/eKI6pj5PZngre6IbF6p4KY/L08vjfXrU1IsFYiy1iVSPrOcs k9ml98fMKCQg7IFyACurk1RycC8BDDLSjXYIWoKonqQyYGOPXbttSp+6gFCbhRS4Ts/6Ip q72ZUrdRaaLmVAQYLLmFqBdA+WEM7YxUhdRLFEryukZ7hdUdlqP/18XwUbqGAPIVILq7dZ UaYHCrymHVuFQYVy5p2dBd0QCzoxgQ54EJLb97+waYStjkQUtmrmzS4DCaElE53xYc7QbT HfC0xfsCsdbMRu5LMu0hqKisSMEA6YF/HPNH1doE4gfW8CsDG3QETnZGmbegLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551273; a=rsa-sha256; cv=none; b=GXUwrQ1a3++Z9XEmy4MPqeq3BLSYmx22r8iYyrF/jeBuXahfxCyy+F7OxEIw1T4f41jhEk yAEhMRg3ijoGPVRnrcTqIz8ZIhbacuys8Wqjxa3rz5WMq4wUeosasa4A2jsRD78DZ8h0ie ZTa6ZnbEw1N9yWSHNaPF5YylSPX/sc0vXK1nUPLMD44dVPQE5Ht+zkdmQvDWmAh/bj85Ds DVv2CNhY/sOe0PebX/LJIjGJr/89MvhodT5HAX064VXFePkmV2g+fPbRCW6JYLmKufwwE8 hrjLlPVaDiMIxQdG7bfFsNPB8sEkzaikDLmElEWjvT1lF/WYyysr+ZMuJwaIHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXCtb//uvpHJiledPqWtSzt6ZkDl0IbHYXV2cNgIiVw=; b=pxgF8/lYmE4mFKLCH0LBs/zbcLLYiXS3xw9ZPBxNl3A5Xa3Oik2nMugmz7LM8EC5lYqbNi O6TP3rJhkHuerc+WNs2WsBjwSYjkjtUYMS0iKGFuqg+ZhXlZYkFKPVenIno740mf0ifWwU 8IKgzMCA0dPJw9jiS0g/USxf+qebrvOFF+rzrjvQZSf35ab3g4hsD0VxQ+SPRX+IRXpWRE z57+kJjVNW9UEFlg7tH7wT+QFMCcQDYnn9Wtgai0Jh8l5afhWsq4nVfjXxRUEUUEZsKVwu 4dtKZbxD+Sbd6+xj/0JuAxn6hMfCdVZXiCd7WSW9ZOEIxxRGxEJ5KRYV8wbGKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB15z45z12tN; Thu, 1 Aug 2024 22:27: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 471MRrEr028230; Thu, 1 Aug 2024 22:27:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRrL6028227; Thu, 1 Aug 2024 22:27:53 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:53 GMT Message-Id: <202408012227.471MRrL6028227@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: 3eb02936927e - stable/14 - LinuxKPI: Remove vmas argument from get_user_pages on KPI layer List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 3eb02936927e0977ef6d17fb47187aa4d9309c76 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=3eb02936927e0977ef6d17fb47187aa4d9309c76 commit 3eb02936927e0977ef6d17fb47187aa4d9309c76 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:51:04 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Remove vmas argument from get_user_pages on KPI layer To chase Linux kernel 6.5 Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D45614 (cherry picked from commit e1b0f431a109683ca7c232fb9282f3afabfdf12d) --- sys/compat/linuxkpi/common/include/linux/mm.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h index e2bda799dc77..56c849b02c32 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm.h +++ b/sys/compat/linuxkpi/common/include/linux/mm.h @@ -279,14 +279,27 @@ extern long get_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **, struct vm_area_struct **); +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60500 +#define get_user_pages(start, nr_pages, gup_flags, pages) \ + get_user_pages(start, nr_pages, gup_flags, pages, NULL) +#endif +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60500 +static inline long +pin_user_pages(unsigned long start, unsigned long nr_pages, + unsigned int gup_flags, struct page **pages) +{ + return (get_user_pages(start, nr_pages, gup_flags, pages)); +} +#else static inline long pin_user_pages(unsigned long start, unsigned long nr_pages, unsigned int gup_flags, struct page **pages, struct vm_area_struct **vmas) { - return get_user_pages(start, nr_pages, gup_flags, pages, vmas); + return (get_user_pages(start, nr_pages, gup_flags, pages, vmas)); } +#endif extern int __get_user_pages_fast(unsigned long start, int nr_pages, int write, From nobody Thu Aug 1 22:27:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB35YxFz5RZbw; Thu, 01 Aug 2024 22:27:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB275Pwz4ZTS; Thu, 1 Aug 2024 22:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BA9O7DeYyNxY7oGZOzwbtJznsz5Y+6X8QkULG16IYSE=; b=u4omA2FfGkoI/ISCk3oGWJgynPodEG7CCDGSEAl9tLHIBlW1MmtJfm5KCL4n2S3cuGaMId poAzJW5uxCjA6fHoutbTvCSql8b7uVIAhHJQw9l4mn/XJ6/3JOZnW4AMF5Nh65F8WwatJi G6JSzF+u6nFKTld85iqwkTOXhmal2qN7KNWXENxXRrcw1Dbnm4vGZtx6KjavlSh2oYQOr7 bX0OgE0xHLZVtd06/yju1mfDe+F9gzqo53LHnNgUxjXsZboEOkafNGYZiVzISqbguXK/mM IUWLjVLTZfr8CT6UvN8q4rySTI3PxSX/Iv5YGXZUmgfZNhelaYLKRruUarAozg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551275; a=rsa-sha256; cv=none; b=MRmsJLkeTnGS3BqLk3+0iQpRXT4s82XLirGWpjwtUhhldZEFq4/quDiwHZT+jhA9KHfBgT 0gju3Bl4nVNxLtlLe0Wb1MxRcVAgqGO2EUU63dp7hzPNcYykGkJCAkvKKr36GKTOfQDC90 s3ucogVZIcavtYl+pSAJhidAXbJzq1pFFPuM8VH/UXym81QwdyEkzncf+i+09/65ikze2H 6CsMOBQTKbR5kdiM3LhpJNYXMHjKolysQb/8zeQgtUvLgBQr3u2JPyF4KjV+uC7cv3Vhxd 2ZkCCKFmI8wpWQwQDaLZeXiPrKLGODjDPh1wVZI5Zm3PYOa/jwS6rva4pobAmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BA9O7DeYyNxY7oGZOzwbtJznsz5Y+6X8QkULG16IYSE=; b=GoTVR2eMeYz7E1kVCqsmUU9VW9YlHq6wi4GWfymh3/AB/bM4EX4KzNhoX3x5WpFb8yaw8/ zpmqdCFFzos+wsujD6WoxfINoqMx/e4/J09UhDv6SbFjSJ39wXrhEefnKFsNz0dmIB4Ia9 hexB78qeTAYXIlXRzoYen8ONEgS9z04sP3MO2osY9y24IFR7ip8+msHqZR9C7nH3Csyz8d ZLTFWK+FyvTrfFSk9JnQOpzH82ddRgpxeFdKzQKP+ts6pq5Zfq7aUAi4kdYzctldAUCBWG xpcQGj0ShGz+Jh9z7h1AZ0tVsGIjRDdiPYeS0JnEe2aKHXjljUby4sAUMNPuwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB26jZJz12l9; Thu, 1 Aug 2024 22:27: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 471MRsuu028275; Thu, 1 Aug 2024 22:27:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRsQG028272; Thu, 1 Aug 2024 22:27:54 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:54 GMT Message-Id: <202408012227.471MRsQG028272@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: 88ca9c822616 - stable/14 - LinuxKPI: Add DEFINE_DEBUGFS_ATTRIBUTE_SIGNED to linux/debugfs.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88ca9c8226165e31991c25a246d825706c8ec2e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=88ca9c8226165e31991c25a246d825706c8ec2e7 commit 88ca9c8226165e31991c25a246d825706c8ec2e7 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:51:34 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Add DEFINE_DEBUGFS_ATTRIBUTE_SIGNED to linux/debugfs.h Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45615 (cherry picked from commit 8c5c572125665e3fd8a033d1a8b0a370e5a43e24) --- sys/compat/linuxkpi/common/include/linux/debugfs.h | 2 ++ sys/compat/linuxkpi/common/include/linux/fs.h | 12 ++++++++-- sys/compat/linuxkpi/common/src/linux_simple_attr.c | 27 ++++++++++++++++++---- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/debugfs.h b/sys/compat/linuxkpi/common/include/linux/debugfs.h index 470b50cb730c..13186334d75c 100644 --- a/sys/compat/linuxkpi/common/include/linux/debugfs.h +++ b/sys/compat/linuxkpi/common/include/linux/debugfs.h @@ -88,6 +88,8 @@ void debugfs_remove_recursive(struct dentry *dentry); #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \ DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) +#define DEFINE_DEBUGFS_ATTRIBUTE_SIGNED(__fops, __get, __set, __fmt) \ + DEFINE_SIMPLE_ATTRIBUTE_SIGNED(__fops, __get, __set, __fmt) void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, bool *value); diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index ebe262926e97..74288f9cd461 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -375,7 +375,7 @@ simple_read_from_buffer(void __user *dest, size_t read_size, loff_t *ppos, MALLOC_DECLARE(M_LSATTR); -#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \ +#define __DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt, __wrfunc)\ static inline int \ __fops ## _open(struct inode *inode, struct file *filp) \ { \ @@ -386,10 +386,15 @@ static const struct file_operations __fops = { \ .open = __fops ## _open, \ .release = simple_attr_release, \ .read = simple_attr_read, \ - .write = simple_attr_write, \ + .write = __wrfunc, \ .llseek = no_llseek \ } +#define DEFINE_SIMPLE_ATTRIBUTE(fops, get, set, fmt) \ + __DEFINE_SIMPLE_ATTRIBUTE(fops, get, set, fmt, simple_attr_write) +#define DEFINE_SIMPLE_ATTRIBUTE_SIGNED(fops, get, set, fmt) \ + __DEFINE_SIMPLE_ATTRIBUTE(fops, get, set, fmt, simple_attr_write_signed) + int simple_attr_open(struct inode *inode, struct file *filp, int (*get)(void *, uint64_t *), int (*set)(void *, uint64_t), const char *fmt); @@ -400,4 +405,7 @@ ssize_t simple_attr_read(struct file *filp, char *buf, size_t read_size, loff_t ssize_t simple_attr_write(struct file *filp, const char *buf, size_t write_size, loff_t *ppos); +ssize_t simple_attr_write_signed(struct file *filp, const char *buf, + size_t write_size, loff_t *ppos); + #endif /* _LINUXKPI_LINUX_FS_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_simple_attr.c b/sys/compat/linuxkpi/common/src/linux_simple_attr.c index 27dc7beb8707..ecd1e135026c 100644 --- a/sys/compat/linuxkpi/common/src/linux_simple_attr.c +++ b/sys/compat/linuxkpi/common/src/linux_simple_attr.c @@ -139,12 +139,13 @@ unlock: } /* - * simple_attr_write: write contents of buffer into simple attribute file + * simple_attr_write_common: write contents of buffer into simple attribute file * * @filp: file pointer * @buf: kernel space buffer * @write_size: number bytes to be transferred * @ppos: starting pointer position for transfer + * @is_signed: signedness of data in @buf * * The simple_attr structure is stored in filp->private_data. * Convert the @buf string to unsigned long long. @@ -154,8 +155,9 @@ unlock: * On success, number of bytes written to simple attr * On failure, negative signed ERRNO */ -ssize_t -simple_attr_write(struct file *filp, const char *buf, size_t write_size, loff_t *ppos) +static ssize_t +simple_attr_write_common(struct file *filp, const char *buf, size_t write_size, + loff_t *ppos, bool is_signed) { struct simple_attr *sattr; unsigned long long data; @@ -173,7 +175,10 @@ simple_attr_write(struct file *filp, const char *buf, size_t write_size, loff_t mutex_lock(&sattr->mutex); - ret = kstrtoull(buf + *ppos, 0, &data); + if (is_signed) + ret = kstrtoll(buf + *ppos, 0, &data); + else + ret = kstrtoull(buf + *ppos, 0, &data); if (ret) goto unlock; @@ -187,3 +192,17 @@ unlock: mutex_unlock(&sattr->mutex); return (ret); } + +ssize_t +simple_attr_write(struct file *filp, const char *buf, size_t write_size, + loff_t *ppos) +{ + return (simple_attr_write_common(filp, buf, write_size, ppos, false)); +} + +ssize_t +simple_attr_write_signed(struct file *filp, const char *buf, size_t write_size, + loff_t *ppos) +{ + return (simple_attr_write_common(filp, buf, write_size, ppos, true)); +} From nobody Thu Aug 1 22:27:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB21Qm6z5RZhl; Thu, 01 Aug 2024 22:27:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB05BZMz4Z7Q; Thu, 1 Aug 2024 22:27:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bnb9iK14z5pSaCS5+ZCxMCRVGHvanyNwGGK3ajgQ/uU=; b=sR/I7ANXYiHzZT4VIVlz9s/nVH6ikY2WyXB//ENKJMQr3lW18RMh6JO5NCboqy4866i4FG W4X5mi+2DZRWxxNsN3W+fgHnp+2/0x294/3NBlwrM/+L9dMd5SPAmdcwlo9fZ1gvphXuem xaZ86k7Rx+TpfZcqJjLE8Jx9DCxoPz+PmVt801u+228yUhTJ0ZWi5T4Enrhh2Qu8OZh4VV ifHqdm594Vf/9vw8O8DiIV5ZWhTDcLR4iXoGkVTKeaHt9Durbjpj+n+cIuKOZiN8+XTLFO IxSK/oLlgLkyDAgWmk0mA7qlQiKrkniNlA4GMjze1tyvlnivm2HXvE8MfNWaUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551272; a=rsa-sha256; cv=none; b=yFfFeiQmx2Rr0H+aoEYPJgfFPStrMhk3X7XSDNb27Y5ql/dRF0KA6lQqNuzGiUGKzQitnw wz6ykdRFdeDO3F+NMceoa1tcOpuET5KQj4rVjZn+UMGMrSX1xBTU47Z5qFqThAdHQ5kTb3 k0wZY3ERxmYAZl+WbdPXg4LNQjS6gYNV7D4LWwoFZOVdFKYnwsJEj83lcqN/Z7LMu+F91a vOKIucswiG4XLXPCE9ONfEpq7ofNNQcz7v4zOy93+QtV7IN1qLtWy9bdtTqDnoXK2OwU1U F0ohna3M4biEZUPe79A2GXxlrPgIhzFLoH4JNaKOY1sRCmwjofo1WaKoI0Vw8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bnb9iK14z5pSaCS5+ZCxMCRVGHvanyNwGGK3ajgQ/uU=; b=T6YpJAnG4bxd/B0zUgTMGWnEdo24PUE9GZwP/SQWjFqayTwwNRurS7JNV2Rg8Vsq2hLY7Z u06U+myczK1CniIPD/SdldQX6tySkI2Jq6DapokJkslj91WTQJnDFZ/A+cTZw5AWbH3AoG wtI+Pkrm9nBRLFIF4nNOu61qcvls5eD4nkOnriBIGkHgLQP/PNDyetk+68J1JBoBCjCQuC C20AtuByAVi24YOFKsAskkwbhwh1QPOlc/XfyVDsotD98+iOEz9ncOofm0VZJHlQK0hhTP c6+HioupBn+aWKSgHox5TA2EMDBRCp+gSB5zN9AO2wd7EFFz4ZSph3Vwrn+BoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB04pzwz13BX; Thu, 1 Aug 2024 22:27: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 471MRqkN028176; Thu, 1 Aug 2024 22:27:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRqUm028173; Thu, 1 Aug 2024 22:27:52 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:52 GMT Message-Id: <202408012227.471MRqUm028173@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: f1f6228a6658 - stable/14 - LinuxKPI: Add linux/nodemask.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f1f6228a6658dd6a3409ee159628713e1aeef2a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=f1f6228a6658dd6a3409ee159628713e1aeef2a4 commit f1f6228a6658dd6a3409ee159628713e1aeef2a4 Author: Vladimir Kondratyev AuthorDate: 2024-06-26 20:49:52 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:09:41 +0000 LinuxKPI: Add linux/nodemask.h and dummy num_possible_nodes() implementation. We do not fully support NUMA in LinuxKPI yet. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45613 (cherry picked from commit 889f74af66b82e4401fb69ed8af6b9b4f48ce53b) --- .../linuxkpi/common/include/linux/nodemask.h | 40 ++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/sched.h | 1 + 2 files changed, 41 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/nodemask.h b/sys/compat/linuxkpi/common/include/linux/nodemask.h new file mode 100644 index 000000000000..e61573bbc19f --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/nodemask.h @@ -0,0 +1,40 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Serenity Cyber Security, LLC. + * + * 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 _LINUXKPI_LINUX_NODEMASK_H_ +#define _LINUXKPI_LINUX_NODEMASK_H_ + +#include /* pr_debug */ + +static inline int +num_possible_nodes(void) +{ + pr_debug("%s: TODO\n", __func__); + return (1); +} + +#endif /* _LINUXKPI_LINUX_NODEMASK_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h index 8cb6b12100d5..80354493f955 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched.h +++ b/sys/compat/linuxkpi/common/include/linux/sched.h @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include From nobody Thu Aug 1 22:27:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB63SDzz5RZpy; Thu, 01 Aug 2024 22:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB52LkXz4ZXC; Thu, 1 Aug 2024 22:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QeYYn/Z6vE+5PQCGXSPYzuEAFqVTDxVQAv01MoQ1FCk=; b=CiODkbBvXaXiP01LlIyNKZiDm2QKZSf6Q1hBNyEM8lAd3md6Byil//CauU48dLNkUXdFkC KbnW9g5+EcR7ct0bdOVD0akG1rMc5tNSfuvsP9+8oaNsI7d5yoNsOjgjiODZkDvvB/pzBR /BrtmbjsJZszGJvJu8N4ViCSU7K36rQB9ICkYlCVfiyLniAQqotzRudjQB1ivVh/AEc8P7 HSmkvv69UaPG+n7ylNcuqjyq8woHIPbZApzpvIpg5l+bbJMLYl77+jQf3Ec3RhJZJl5MZx EucivveftDCI9ZVPv1DVIeiDmEdhys4WXzBPpxJWKuwkUt0Ct4NevHl6H+nRKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551277; a=rsa-sha256; cv=none; b=J5qBRjTYTPhPILOSd15lO7FuLbj/CrHbrutlLrL4u32S1mZF/6fayI7T7w1Az1OxYl/Itn f1R9SkJlnk/4cQBGLMaRPx/FVpqXAsduczx3Nsh0JUQpv8l1xb4XkJTgU3XSH5HfDPd8/m 1i1QvOL0zZTyTHli+6UJFb+5v8nXQ4kzrJV3pwCB0AUZ1wW9sBRCxO7fKx2wEkLT204DBL sU13Z6uNVX1Z3KgDQpxrpgSs3W/I0OBN7a+9lwXcMoWvb/oTnHOkwialK2Z3MJ243INGSX 55ZdlkvVEVYeGYXQ1o6MXBVAmo9vxzvvFjJzg/jYKVkWR+13qYf/snThlqq+xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551277; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QeYYn/Z6vE+5PQCGXSPYzuEAFqVTDxVQAv01MoQ1FCk=; b=XV3zhABd4xuGSX6I8Ks9+9Ud3bME4Uds0iJ+tfNT+BDt3l8g7o2HSNfOIKU+A7Q5qF3vCD uL266s19cb5gHghKomrPzmhFlajoe1/9TlBbTVSLbhCAs1fcPU6UINgSwvbiNtvwpAiBpq aiUf80tfY0aoqjEMfKymkJvO5tOy6/5vF8omD8+Zok89Pyd0ngQZrgk5lYFoM2nFhvSTFJ H7gEx0ccLAANCZY77JCnsapagBrJ58/frLvOQsfhDX8Cs1FZ5u9mcWOH8JXA+DmfPrjeS7 wXU3JeYYFtt5LZW/Wb78jDIQPJjhTbvIkAFyFaD51zok3jiFTGWlHa3B9M6SMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB51wvpz12Jn; Thu, 1 Aug 2024 22:27: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 471MRvOL028377; Thu, 1 Aug 2024 22:27:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRvMx028374; Thu, 1 Aug 2024 22:27:57 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:57 GMT Message-Id: <202408012227.471MRvMx028374@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: d8394e282f47 - stable/14 - LinuxKPI: Add kvrealloc to linux/slab.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8394e282f47f6e0f5670ca37d0d9c1d87b73933 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d8394e282f47f6e0f5670ca37d0d9c1d87b73933 commit d8394e282f47f6e0f5670ca37d0d9c1d87b73933 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:08:28 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:14:10 +0000 LinuxKPI: Add kvrealloc to linux/slab.h Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45616 (cherry picked from commit ab6e1167909bf1e2792a2ba33000e13d33aaf551) --- sys/compat/linuxkpi/common/include/linux/slab.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 298306b6ea05..e2d17e0558c2 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -91,6 +91,8 @@ struct linux_kmem_cache; #define ZERO_SIZE_PTR ((void *)16) #define ZERO_OR_NULL_PTR(x) ((x) == NULL || (x) == ZERO_SIZE_PTR) +extern void *lkpi_kmalloc(size_t size, gfp_t flags); + static inline gfp_t linux_check_m_flags(gfp_t flags) { @@ -212,13 +214,29 @@ kfree_sensitive(const void *ptr) zfree(__DECONST(void *, ptr), M_KMALLOC); } +static inline void * +kvrealloc(const void *ptr, size_t oldsize, size_t newsize, gfp_t flags) +{ + void *newptr; + + if (newsize <= oldsize) + return (__DECONST(void *, ptr)); + + newptr = kvmalloc(newsize, flags); + if (newptr != NULL) { + memcpy(newptr, ptr, oldsize); + kvfree(ptr); + } + + return (newptr); +} + static inline size_t ksize(const void *ptr) { return (malloc_usable_size(ptr)); } -extern void *lkpi_kmalloc(size_t size, gfp_t flags); extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); extern void *lkpi_kmem_cache_alloc(struct linux_kmem_cache *, gfp_t); From nobody Thu Aug 1 22:27:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB53Mcvz5RZpx; Thu, 01 Aug 2024 22:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB42Tqtz4ZX4; Thu, 1 Aug 2024 22:27:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551276; h=from:from:reply-to:subject:subject: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+XW0fw9k2ty3+WsVx4UA95YE5mTHJtxKL+THtAVaW8=; b=j86kX6a7ana+/TTKkLYmASOxIxzqNNwAR+kMBp/GUrXgWMdCOx/O8grd8hBeQkGVNonzmr ffDGReKG6wcAMc1N1mdTQdivouh7EU1pjKvXNNMrgbuEummPyj9Kvp5MTdJe8ANBThLDZZ ckt2tuWUjBf0kzxmvXaPhvdYc2tkyBV/O3e1OKg35gdegQ23hksX0G9Ns5NxrmW7asC/Ez oEaomVLrU3bL9OnpF83DC1jLUpVDunrgiXxjA9diq4nGVV1lJuPnd7Q7xKFgxtdd5OeDYD 5CHBxroqyB7m6E+vJ553QgW5IToPiPkOg24wCFOlk0calS93pP6jh0gEBy9wmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551276; a=rsa-sha256; cv=none; b=j4oF/gu6PhCkXIR3/qC5BGAJYNLjubpY9CXFXyNtOBopOvwu52OQ8pjhjz66pJkraJtRIg Gk387dzvKjs9TTckyCEomXn32X7GMKoI6CYVxuoX197u9LFl3eNMVWwIMLEWxaKy/EumPc 4VP2LRYsb4JPlHxqGjSLbsFSx2+EgNA75eBa2oOdoC9aEM+TGY1le1FKJGfBecbEDsI19E 8zxvyxeJKbA367mx/XmeO/aDGu8hkhbiaSyyPjQJ+Gufb+L9LRovkubLZ2VtNz4Pwy8dZS zasCifelA1d5WFFny5gJB8cKbmrP4Q6hKiFGXj1MAuTYRqvZGkSJp6gG3f4twA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551276; h=from:from:reply-to:subject:subject: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+XW0fw9k2ty3+WsVx4UA95YE5mTHJtxKL+THtAVaW8=; b=e++qd5Xk5fxFDDrD4Ub5+k3++647cj6x5u8aCYo1xCvsHKZJjniIwmetsZrzqigNMfv0ml ePBt+lxOvckzhVWqFVOC7NR+btzR63+Oxh9tLNNSSoqElknkoXU1+ynkzP1bFIGmQNUqsC 1Yai1nghy67FxueLN3KQLi+g6Yt6e6ynHYJeloOaUawiz6NPxAre1dRYYLVW7GQSuXH5cC KegeMI+R/7wX8D3Jmnfgo84okOenceW2lcG+grGIFaR+gnwcFhRdcNFmaN2TdBdu7GSaOW HxKgDrLrFZUg9wNY1kaJg5mLzLWRw0gWCWxFtHB8WeXIGC8WESV72hADsQEBDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB40rpPz12tP; Thu, 1 Aug 2024 22:27: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 471MRufJ028334; Thu, 1 Aug 2024 22:27:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRuRu028331; Thu, 1 Aug 2024 22:27:56 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:56 GMT Message-Id: <202408012227.471MRuRu028331@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: 8a6ec2975633 - stable/14 - LinuxKPI: Automatically enable drm support for devices named "drmn" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 8a6ec2975633f9649c1d8fcb92df55a8a349f554 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8a6ec2975633f9649c1d8fcb92df55a8a349f554 commit 8a6ec2975633f9649c1d8fcb92df55a8a349f554 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:02:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:14:03 +0000 LinuxKPI: Automatically enable drm support for devices named "drmn" This allows replace linux_pci_(un)register_drm_driver calls with driver renaming to FreeBSD name. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45906 (cherry picked from commit 5d20075f8b9f7107aa0a246e5165d9816e816a44) --- sys/compat/linuxkpi/common/src/linux_pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 551b924d6f5e..3ed0f268d5f9 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -975,10 +975,10 @@ linux_pci_register_driver(struct pci_driver *pdrv) { devclass_t dc; - dc = devclass_find("pci"); + pdrv->isdrm = strcmp(pdrv->name, "drmn") == 0; + dc = pdrv->isdrm ? devclass_create("vgapci") : devclass_find("pci"); if (dc == NULL) return (-ENXIO); - pdrv->isdrm = false; return (_linux_pci_register_driver(pdrv, dc)); } @@ -1165,7 +1165,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) { devclass_t bus; - bus = devclass_find("pci"); + bus = devclass_find(pdrv->isdrm ? "vgapci" : "pci"); spin_lock(&pci_lock); list_del(&pdrv->node); From nobody Thu Aug 1 22:28:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBB5RBpz5RZwm; Thu, 01 Aug 2024 22:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBB09swz4Zdy; Thu, 1 Aug 2024 22:28:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mnpvqyonL6E/Hx3V8qgLfYtR4SDPazpMfYWQYNfsvG0=; b=IS5qcwdzNUYV5mYsbQDGJGs6ol2Qsa0E3AtapLAFPvQbGNdNfCIBgsvED/wLGnDkc4g1rB hQcemQtN1Rt1N5QvE10FTIJRjstpWgTLVzMMhZap1CdjCgXkDVfxzLsTU0z6YjutBmle64 U7SDbwcrex1ezTOoPgj/bFjJfDgbSLwO59Z6A6WqVOkjpwDcabP/ciQ940RxP79981PFuw /Jop9VWUTHV0hF9X9l8U9LjkZWFJ56MVsLLFzUbUHFb1LphT64f8lkT0oKuf6zFyjvG6gA V3FNROsSKj9WyuptUr4SP29rW5NdwCxQ207WeRtxFcSb3vkBhbJChj9105QMOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551282; a=rsa-sha256; cv=none; b=Bw+WSn6V1nES3PbrNse92XgMzEJGOckw2X7lvuTm+mluQiQ627iHweX0Jj9AuzqOqCKpGF +fZuhmfTkVysEfG6g8+rw2ef2VWh5lXUzQxeotFMEjxdpTfqoErgEKZYKifG5j2lSycjTB 7FLysfYOUADg56N3t+Frg5rAO2WaUgqFUmqYMcfvnPPJQF0X5SUDc26Jm7zcFm6fpK0IQF ATPlJ3AMp7BazYl73DHoQf37qvHWb+xzgoIPpexx0eyoUFmkCD5WOeU8qc22GNKLCs+pkk CbL3EKyWBDebpns1cNCj5IjE/mXRuYB6KpFfjWXLZhCoFgfbA6F8BWbKgWcCmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mnpvqyonL6E/Hx3V8qgLfYtR4SDPazpMfYWQYNfsvG0=; b=fkk19JDbg7c0dEYhTA8B+Mzw4tg6vE/s4VS5ng/AP2cSXBitA6JduqFZ23rhoDrZzEmZsc hFZTP41tcyiDeqGiFYmTNDHW3wEJas1nE7zAhQI+axodYqX5/wd69sz4uEDcJ6AdOzaKy3 EClbO5Wk0WyjpjFBO52zR231KtIx2Z2Gb5lo4pI2cDHhDd+KEz0YVON/px6EQGv1ob/m/Y 52AHKheBEk2nAfhJ9RBQJDfYcwZ+LqV6pg9KctrfzT/hhkTtk0kiSU5lYFM64R2Yn6Dzrz weBEghosndxqJCASDJE8RQiSDEUxGOCjYEq88OyEbgBM1h6sZ7Dy6dZpQk4+OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB96Pvkz12lB; Thu, 1 Aug 2024 22:28: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 471MS1Vk028549; Thu, 1 Aug 2024 22:28:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS1NO028546; Thu, 1 Aug 2024 22:28:01 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:01 GMT Message-Id: <202408012228.471MS1NO028546@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: b71e429d5478 - stable/14 - LinuxKPI: Add devm_device_add_group to linux/device.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b71e429d54780ddc447b74d551eac38761847360 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b71e429d54780ddc447b74d551eac38761847360 commit b71e429d54780ddc447b74d551eac38761847360 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:09:12 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:28 +0000 LinuxKPI: Add devm_device_add_group to linux/device.h devm_device_add_group creates a managed attribute group for a device. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45845 (cherry picked from commit a1181662d3707d8165d7153a0aa5d76ea1ddc11a) --- sys/compat/linuxkpi/common/include/linux/device.h | 4 +++ sys/compat/linuxkpi/common/src/linux_compat.c | 30 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 98c16212512d..de7e66d9a4ad 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -700,4 +700,8 @@ int lkpi_devm_add_action_or_reset(struct device *dev, void (*action)(void *), vo #define devm_add_action_or_reset(dev, action, data) \ lkpi_devm_add_action_or_reset(dev, action, data) +int lkpi_devm_device_add_group(struct device *dev, const struct attribute_group *group); +#define devm_device_add_group(dev, group) \ + lkpi_devm_device_add_group(dev, group) + #endif /* _LINUXKPI_LINUX_DEVICE_H_ */ diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 90d03d480089..ec4e59f66e7f 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -2615,6 +2615,36 @@ device_can_wakeup(struct device *dev) return (false); } +static void +devm_device_group_remove(struct device *dev, void *p) +{ + const struct attribute_group **dr = p; + const struct attribute_group *group = *dr; + + sysfs_remove_group(&dev->kobj, group); +} + +int +lkpi_devm_device_add_group(struct device *dev, + const struct attribute_group *group) +{ + const struct attribute_group **dr; + int ret; + + dr = devres_alloc(devm_device_group_remove, sizeof(*dr), GFP_KERNEL); + if (dr == NULL) + return (-ENOMEM); + + ret = sysfs_create_group(&dev->kobj, group); + if (ret == 0) { + *dr = group; + devres_add(dev, dr); + } else + devres_free(dr); + + return (ret); +} + #if defined(__i386__) || defined(__amd64__) bool linux_cpu_has_clflush; struct cpuinfo_x86 boot_cpu_data; From nobody Thu Aug 1 22:28:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBF5L2Pz5RZfc; Thu, 01 Aug 2024 22:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBF3Yx6z4ZsM; Thu, 1 Aug 2024 22:28:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oZAN0PIB2bFVXigkiVJKB/BIfNxgL3d7JhImG4J+7as=; b=jrVwvtS45iRkUfMMCy2jWVWomjsj5TfoKHCx4bBoItjd5X1lUwPfX6C7ZRBJWCOFe0C/sM 35CiZc82g1TAvgHHMUxtTxCpn5quhlWtaROMuPS7vBA3NBKr2RbbbQdOeJQ/OfiWBzKsmR bavpVWpX9gmFvv49KN4nGItdFCIhhmzRRCbNYMwOjSwDc63v27DN3qmDQg9wFXv/zDlDqk FTYs0KT7QFNn2kOKeoRL/aXyNJ6YDC+lut9/CAv0m2ljpuw4bBQvKZfV3Sl5PPhwzqy8nx 1TS5qmVrWImK0WzG2PayMDimo45NyZ5fwWsjwECm7KRxwbQhXTtumivnE2pqdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551285; a=rsa-sha256; cv=none; b=IdcDf77TnzDc0sipkB2Qei5Kt/u7QcbV2ZKP6MJP+2L5MIdJqydEjHkvsBsQNoDuJNNoRz Rv1yQM3Xzu8JEyenEwI97UUJQ7BZ9NsrciLbIUSXLtrW1mqTfMeO+mFX5HgKjR+BpkpzX+ Zdc6trMs3jZFnXCzqb4APUsBEnMwdx4uTziiDU4owYrNw2TTC8b5W3eTvWg+tqIh4rdt5N Mxf83Zq9foeBrLjhrkURl/PhYrLT8gFz0KjFBvNkBbLKttslp8a8LYMLTmmS5ck+y9yaio RsVFHrvMuGYnzqeLZ80NcHnowpBIJgo1NjVPsdpDgd68n1OwRHFcfcHc0mHQbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oZAN0PIB2bFVXigkiVJKB/BIfNxgL3d7JhImG4J+7as=; b=pG119SwMuI6YZvN3stAuFnbRIYnbtPE2ng9zJ1tuyhsu8tRw7l/2+BarTKgIj/3g77LGXx Z1plZZGNZbzQIyYwN/Rv+AFHbx4A53BeR/ZrTKc2M6VFYqJZYfeXPsAm1qxVXKCQNpd5bx 1sEyYTA0vJom1/RPeSwzHQml7QCzkHVp5WtaAhvTZMdmC4a+uKsNyQsAZnDmjipZy5pzM6 2Jy8trncFZ/P7F4dyf0kj3j7LfFNYNe6ijmOEJh7i0og+Lac34JRWQUJHzuSqJEYm5N8gU kqz5UUgsWD5TOQwJEDzMfrHB/EFkx+/c3PX43uSNprPtjTM/4XA5XdaDCA6I3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBF3BVFz13BZ; Thu, 1 Aug 2024 22:28: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 471MS5Ul028689; Thu, 1 Aug 2024 22:28:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS5jL028686; Thu, 1 Aug 2024 22:28:05 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:05 GMT Message-Id: <202408012228.471MS5jL028686@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: 7cc3cbdaa1bb - stable/14 - LinuxKPI: Add linux/eventfd.h and linux/memremap.h dummy headers List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 7cc3cbdaa1bb4ff913ff28716d02f9543aa26a2d Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7cc3cbdaa1bb4ff913ff28716d02f9543aa26a2d commit 7cc3cbdaa1bb4ff913ff28716d02f9543aa26a2d Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:09:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:56 +0000 LinuxKPI: Add linux/eventfd.h and linux/memremap.h dummy headers Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45848 (cherry picked from commit 7774e08adf6c6364a0c7f07e8c40fb1ea7cc78e5) --- sys/compat/linuxkpi/dummy/include/linux/eventfd.h | 0 sys/compat/linuxkpi/dummy/include/linux/memremap.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/linux/eventfd.h b/sys/compat/linuxkpi/dummy/include/linux/eventfd.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys/compat/linuxkpi/dummy/include/linux/memremap.h b/sys/compat/linuxkpi/dummy/include/linux/memremap.h new file mode 100644 index 000000000000..e69de29bb2d1 From nobody Thu Aug 1 22:27:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB81qdSz5RZfb; Thu, 01 Aug 2024 22:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB74Vtxz4ZVP; Thu, 1 Aug 2024 22:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JNrMgNwmemy3F3zEkV++UQ074XiESLbjeY8dslFWec4=; b=cA7sTB4pJ+53N8KALuzO65eStIJ/hVA+4ayrcRkAQjjL44biKqny98prHmHgwo90hqnoSW rZBlRwN5ESMSbKSje5igBEAdBlYvTZbEb83N5L/8etKXnBEHbN21QexDfYzcLGRx2F/p9Q wJUBoZR5wL/Hew/kT1rVf1N2+KqzuwoNXbkb4L1hdJaYp246eX6cEUVC4cO8G5i/kJq5Tr 4qqZ8QHFjUGY4NlLKSMCDybJK86ew2RH/R4NHdxarxQVC4T4vMWKNyvo92xqKFaXwAIFkZ Fo4SYpUd/+Ax3Lt/zu29OV4rhuAZgBZ0ILs0od0vantUGLyvvt34kmefqE23Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551279; a=rsa-sha256; cv=none; b=HUPqEqiChBrcpFI0xnZFP2tM1kkuALw+etoPhDqrs632upNzLtfSo1atXR4lch+9Q+ciWp JzzDKD86KaVKnFemdZmH1Vbzuf6NFRgFuOaJfkJdmZwlcuPAJL4PUFhth0WEeJJV1QqBeQ nkfMlixNriGPDKzm4uLhxH9GSaZ7oVnEE643aDhfhvnmw9GUO/1qSHsaRVsOW0cenE7gl8 HUKCey7lu07qPDibNZl4KGckUEc1z0Tc1mqZn+hjd7emlrj93yo3I0BhEMZ4sWOwrcPXwe W/Cue8HnKJk+6R0TJBHkdiJA69gAuCHJ66kF5+tsVc28Pgta7QyjbOaKo22GmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551279; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JNrMgNwmemy3F3zEkV++UQ074XiESLbjeY8dslFWec4=; b=fFoFgaQryllyBUOTFl8KHFtxygc3iHp7zXHA/KVTBH71m0dqWwF6SVmj8U1hWuC/b4hYoD 4DjTo91tIjgiHHH9o2MbjwrZIU530ZgCD/KeZZfVBCj059dIzQ4y5eoNczt8OlKfhQP47s 2TaFlmbuKvNxTZwOtZBDH8McAhtL+0Ps0ANdzMh1fYWVUoeiGnpJ9tjoX5hpPo+3wk69II BrlL6+fC34UL9SyaHMRTVvXqufKC0WbGqA2AlMmM0p5V13teYZa9YHWPUDtNZAqIXoM2nG MGO+N4ZX7fU7d/vv1uL2Og+dCPJk38vwFHUzSYI18Ka4u6jabzh4Nba7kzvBtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB74054z12nt; Thu, 1 Aug 2024 22:27: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 471MRxkf028462; Thu, 1 Aug 2024 22:27:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRxIe028459; Thu, 1 Aug 2024 22:27:59 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:59 GMT Message-Id: <202408012227.471MRxIe028459@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: 0ab568c2fff7 - stable/14 - LinuxKPI: Add __diag macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 0ab568c2fff71b67021310a4f951a113b5ba5974 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=0ab568c2fff71b67021310a4f951a113b5ba5974 commit 0ab568c2fff71b67021310a4f951a113b5ba5974 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:08:48 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:11 +0000 LinuxKPI: Add __diag macros __diag macros turn individual warnings and errors on and off locally, depending on version of compiler. Add dummy implementation as drm-kmod set warnings separately for each file. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D45842 (cherry picked from commit 742088d9fb545296c8677119757a967141ba7d4a) --- sys/compat/linuxkpi/common/include/linux/compiler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index d59e6faed12d..c82b9acd53fb 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -89,6 +89,10 @@ #define __printf(a,b) __printflike(a,b) +#define __diag_push() +#define __diag_pop() +#define __diag_ignore_all(...) + #define barrier() __asm__ __volatile__("": : :"memory") #define lower_32_bits(n) ((u32)(n)) From nobody Thu Aug 1 22:28:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBG6qQHz5RZYf; Thu, 01 Aug 2024 22:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBG4v0sz4Zc7; Thu, 1 Aug 2024 22:28:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9Nl7m3wIn+Ic/Xg3yBcZBHU18cDjBELWCi0wG8Zpp0=; b=q2KQy0mRFGHlR96Bz9aCY1mNFF2L3+2u03vnjjTErF1ZKOGsi71iwcgt8INPskDHCPzSJo wUpUciKB+m6k3bDBOXM//96FrQeAXilyDvKWrPlfCbNG3TJ094zuFVqECn7f39nhWzx5Z4 FmG8bbLU9jdsb8qdNh1KGk8WrZ4fusi82gramHqDf2UAJX+AhJGe45WyQdNNYOzlqwLwG1 LHHwhgthQwYzUuLH1h9Ep64E8EbusLUjaC+jkyQmbbGnKA4taJG/nBeC5KKLqE8kLUxmCa xK7DVgOeGeMAfxOvUsxK4o+Idb3DDtxWEOAvywkxYxGRaoRra+bN71YvHQYVKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551286; a=rsa-sha256; cv=none; b=jnv0WZNaxVQxr3k524ZLvGoIJYpBcZl2zWyVlM2q++/9Rk3c+AUgM/5LIFot9VxexnE69h YYizsRGXGCql++MIo01u3Gzt9FNRxiQv87A58jticrGGpiDOTzCmn4cKb5VBJnm7Ksxci0 mfFlEKr9wNHDmD2D6kS+b/f/txjTKuEbydBNt9oXMXK2q9VV722QsQqCA6lTWisu8uezJl dKeJ/M2p7WYv9027ReNEQJPphD963QGzpm8tAlBhhlFtOwjxLjXt+iQpBv+NA/AQALIY7m Cf6LwA6oR8lJqVANaMiBsioeJfqMv1aTw/3lfriF76/wkOiioPSXNPH2rZj2Aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a9Nl7m3wIn+Ic/Xg3yBcZBHU18cDjBELWCi0wG8Zpp0=; b=YkeQwpMCHxeB0agQqxJStwKt0sHD+Z8Jj6Hfb34l+CCepI3MBs3DspzRGZczxa8Bn1SnpS H2R7/FUpUzZf8J3iWtFSkzhAm7LW/wL0fe8GR4f3reMK5mrFs80kzNoKYElOesKQ/QH06l yF9Z5AyaZ3QhixSrKUf2OF1WYOW5NzA81K5xzrBBn12NmZq10JyQluWfuUTJ5IRBRqSBMu GapUb1OUApSuuvm3DrJghI5iCOdMYfeQEIAng4j5/Y18BFTOxoQgUwbT2Du7nK2WjbDLkB JteO9TZIreUaFFyVcAuKyEbZTEgnubaYK1V+osNNgO/2NkzA/X+L7ec/zIqlBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBG4WCdz12nx; Thu, 1 Aug 2024 22:28: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 471MS6fc028728; Thu, 1 Aug 2024 22:28:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS6FN028725; Thu, 1 Aug 2024 22:28:06 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:06 GMT Message-Id: <202408012228.471MS6FN028725@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: 7403f2c657dc - stable/14 - LinuxKPI: Add pci_iomap_range function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 7403f2c657dc66665d6cff9ab4cd67d2f3d0cf56 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7403f2c657dc66665d6cff9ab4cd67d2f3d0cf56 commit 7403f2c657dc66665d6cff9ab4cd67d2f3d0cf56 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:10:25 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:16:23 +0000 LinuxKPI: Add pci_iomap_range function pci_iomap_range creates a virtual mapping cookie for a PCI BAR. As compared with pci_iomap it got extra offset parameter. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45904 (cherry picked from commit fcc350c375f776318d0da8021109631492ab9261) --- sys/compat/linuxkpi/common/include/linux/pci.h | 4 ++++ sys/compat/linuxkpi/common/src/linux_pci.c | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 027dc0dfca0b..f9b60ae186b5 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -362,6 +362,8 @@ bool pci_device_is_present(struct pci_dev *pdev); int linuxkpi_pcim_enable_device(struct pci_dev *pdev); void __iomem **linuxkpi_pcim_iomap_table(struct pci_dev *pdev); +void *linuxkpi_pci_iomap_range(struct pci_dev *pdev, int mmio_bar, + unsigned long mmio_off, unsigned long mmio_size); void *linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size); void linuxkpi_pci_iounmap(struct pci_dev *pdev, void *res); int linuxkpi_pcim_iomap_regions(struct pci_dev *pdev, uint32_t mask, @@ -774,6 +776,8 @@ static inline void pci_disable_sriov(struct pci_dev *dev) { } +#define pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) \ + linuxkpi_pci_iomap_range(pdev, mmio_bar, mmio_off, mmio_size) #define pci_iomap(pdev, mmio_bar, mmio_size) \ linuxkpi_pci_iomap(pdev, mmio_bar, mmio_size) #define pci_iounmap(pdev, res) linuxkpi_pci_iounmap(pdev, res) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 3ed0f268d5f9..c41a55fc9f87 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -756,7 +756,8 @@ _lkpi_pci_iomap(struct pci_dev *pdev, int bar, int mmio_size __unused) } void * -linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size) +linuxkpi_pci_iomap_range(struct pci_dev *pdev, int mmio_bar, + unsigned long mmio_off, unsigned long mmio_size) { struct resource *res; @@ -766,7 +767,14 @@ linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size) /* This is a FreeBSD extension so we can use bus_*(). */ if (pdev->want_iomap_res) return (res); - return ((void *)rman_get_bushandle(res)); + MPASS(mmio_off < rman_get_size(res)); + return ((void *)(rman_get_bushandle(res) + mmio_off)); +} + +void * +linuxkpi_pci_iomap(struct pci_dev *pdev, int mmio_bar, int mmio_size) +{ + return (linuxkpi_pci_iomap_range(pdev, mmio_bar, 0, mmio_size)); } void @@ -775,7 +783,9 @@ linuxkpi_pci_iounmap(struct pci_dev *pdev, void *res) struct pci_mmio_region *mmio, *p; TAILQ_FOREACH_SAFE(mmio, &pdev->mmio, next, p) { - if (res != (void *)rman_get_bushandle(mmio->res)) + if ((bus_space_handle_t)res < rman_get_bushandle(mmio->res) || + (bus_space_handle_t)res >= rman_get_bushandle(mmio->res) + + rman_get_size(mmio->res)) continue; bus_release_resource(pdev->dev.bsddev, mmio->type, mmio->rid, mmio->res); From nobody Thu Aug 1 22:27:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB71vLLz5RZfW; Thu, 01 Aug 2024 22:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB63Yydz4ZXN; Thu, 1 Aug 2024 22:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f5NEbLS+yeeo5GOzx3gcyWh5mOvRVsp3ilsOEkkOec0=; b=KJhtC2gWRIYwCR9H+7DpIR0w49IDoRpyp1hIo2inVKN5LAe3buxRbY+qwh+dKg1uVQpJHJ dYMcvaL8ESmyxzYIzAXlcBeyxX7M00Xp6b1Y1aDdoWxwLI9+EKd77pWZfGZ46GUvDz6SLt kfcXAeGBFksmS2ZtGv8jn3GSANwyehOBndcfCBBb1jeeoRLNdKMw3PqkAUVL/BQYSBS9bA SnmktH215hX+Sbbtqj16g3gJ8/XMbu9i0QX9Cp1K3/1meIixFaFheQkkckgFix7c5OOaop UXC2SiVvymuSeiHRP0UXj+dvkRDdzvXoAyIECtnUiN9H9E5WQikb48KLikkvlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551278; a=rsa-sha256; cv=none; b=icZGUaeg4axMbR4XqHWrWJKuAOY+rtGdFbOY9bFh3uJPWazBYai8nz9Yrym17DpuZ9/0FU w8ZR2tZaO/791wI7if9EMkPTHJdfgGCZap9oN52No58eXTzEJ5qVTaKx3TjpYOTBXFYCpX dxz30+5ViTBzM/jXvK4itxDfu42lbh2iuETR38qgI/3JY7IGSBiGaSmRy2jJWaO5mj2zIb c1BhvSSSDLDvYT51q7zzDUFY/vl+kTAIcBrBIy1pYxunU2ziUt2hm+0UZyFJ+YFFIxMhYM RqZD+eYjZyI48+fh/A5hPRZHpdGl16IAu/SAGXwpU+JNdzzubtnjtFiFSJIIJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551278; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f5NEbLS+yeeo5GOzx3gcyWh5mOvRVsp3ilsOEkkOec0=; b=USxQzK/RHxF/xwN/kjc0sDSiB7f85jYxcN7GxnBhhIgmNSchgxlX+d+ks+AkhZJDhj+0gI 6onegGNieANZF64NyzMO95ulfe7r3z2xaJFugZRFG+IAA7zHIBygawtvURfVBX27D+nQqO ZlcaYwfJO4VUX8ss0caj9yanmtEcb0ON0/63xFiAqNGkZ3eHjLwkfXSwJJQy8zkHYRnSHh C9pTIWNSD76z95nLru3/Vc4cfV0/uj16qY1rQNTKqMIAHjTMKtWAEfsd91rUn/VOnOH4u+ wYb/XK6xlbPVoXow3aCN1k2RDXWdrqT7A5wzid8KwXKGIaFPw9KcIVRBttoGzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB62mBTz12ns; Thu, 1 Aug 2024 22:27: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 471MRwsF028422; Thu, 1 Aug 2024 22:27:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MRwg5028419; Thu, 1 Aug 2024 22:27:58 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:27:58 GMT Message-Id: <202408012227.471MRwg5028419@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: b5d03f42e9bd - stable/14 - LinuxKPI: Add kmalloc_size_roundup function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: b5d03f42e9bdfa31a4d3db06640f25f091a1fc5f Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b5d03f42e9bdfa31a4d3db06640f25f091a1fc5f commit b5d03f42e9bdfa31a4d3db06640f25f091a1fc5f Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:08:37 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:04 +0000 LinuxKPI: Add kmalloc_size_roundup function kmalloc_size_roundup reports allocation bucket size for the given size. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, emaste Differential Revision: https://reviews.freebsd.org/D45841 (cherry picked from commit ab1a5d8e2ade8c706ff8cd7aa3d5c88a95633228) --- sys/compat/linuxkpi/common/include/linux/slab.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index e2d17e0558c2..3f2d1621e148 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -237,6 +237,14 @@ ksize(const void *ptr) return (malloc_usable_size(ptr)); } +static inline size_t +kmalloc_size_roundup(size_t size) +{ + if (unlikely(size == 0 || size == SIZE_MAX)) + return (size); + return (malloc_size(size)); +} + extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); extern void *lkpi_kmem_cache_alloc(struct linux_kmem_cache *, gfp_t); From nobody Thu Aug 1 22:28:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBD6d5dz5RZYd; Thu, 01 Aug 2024 22:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBD2Vkhz4Zk8; Thu, 1 Aug 2024 22:28:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2LfOhQD81MAfIdK3QYKEB1Lm26267OkFFydeBpdqyk=; b=P7OZ6RXXsxwXH/8M3M2/GsggxKpdh4lu1fgXLNlzG/L2AmdPepHpDPkyYjndsZiWPzHUpk NTq/UvBGsSdnb2cQTan3tL19h+b7rvYW9PmSyOA+srLWA/v+qJCDhv6+++snghuWiRfSg0 KyHN3xYCmW4eOR2a8Mjx6orOyZLyfw3ZjPM6dHxXvP/zq74ZiG9Xz2+epxB6jtlMVFVKp0 1ajwEMqMGJil4gq1ByDhxERfBlYvXy1d5iQ5VvvmzjUh7oT2SZ5yeJ5AgG8ZkWnVij8Mfv KebxsvTq0Ur3C9O8zTJJohYGxrbyZAKxPXUU8lwU1A4+iPAkDBtvDbaUhKIuYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551284; a=rsa-sha256; cv=none; b=ODeRAYqNP3S2nyMkkd/dYelnIE3Djqfrx72bn7bKYE2r/rCFw1oEJEjnBKuJ5Aak2U/XOL sfhu6+yqvDBUp/zAxP6JWkNqCyMX9xHUuU5ZWAA0nf+SDNn+3WO/eqQBSfLYANEVdeM1VL vNha5dQIfEdo55sDWyZY2oCObAcsxGrGVoAGVnd6wAsOgLvazoB9Csg1i7IEyCeuIdgBZ1 FqaM7amGmY3CTu79v4n4MulDlsQ7kmGyKLTiN4zXRTSqCvJZkV1/ckn0vu3aRlMWersKoW dGqT+6FNdmQ7MgSp/utfr04rOYLKcaYH+OtA1LxB18/zP5puVbIoz5NEkiRzVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/2LfOhQD81MAfIdK3QYKEB1Lm26267OkFFydeBpdqyk=; b=bJ2uLQv0DmIZbySgjH1/SCcW6Wz9+gC1C+TpX+rc5SJsiF/soPrE+k1D0iv3dJOOGlx9dJ J7FrkpG1XTVaXKBpqGObcy8fF2GFNdJ25UBQMAutxrLCZwQFAUXhNbo4VoKXoLG3Ru7AUi iPBGIkYBGwNYn5kaSGyC/3VX0yOvUxCIA2bR6jTFr079/eFjDoqEt6lhRpNxoYpwpvSHEL pS6uUfPgdrqBh9lvJfhJJRk7GuaOUVtVXAm0U3miEGMeXQf7B4Gxf+XU3Ux8zCqQlhw4zw ZOAAW3KI2jVti9GwgskBuchMsl2klUr/QLiUx4fjGCDv/3sF8nCz7a7Prv0qEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBD1wFMz12nw; Thu, 1 Aug 2024 22:28: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 471MS4RX028641; Thu, 1 Aug 2024 22:28:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS4Uw028638; Thu, 1 Aug 2024 22:28:04 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:04 GMT Message-Id: <202408012228.471MS4Uw028638@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: d23c4b1a558f - stable/14 - LinuxKPI: Add acpi_dev_get_first_match_dev and acpi_device_handle List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: d23c4b1a558f14c89022498e5ef82618bf671e94 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=d23c4b1a558f14c89022498e5ef82618bf671e94 commit d23c4b1a558f14c89022498e5ef82618bf671e94 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:09:37 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:51 +0000 LinuxKPI: Add acpi_dev_get_first_match_dev and acpi_device_handle acpi_dev_get_first_match_dev returns the first match of ACPI device and acpi_device_handle returns its ACPI handle. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45847 (cherry picked from commit 3e90716331cdbdee7465213d389a33f90dad11cf) --- sys/compat/linuxkpi/common/include/acpi/acpi_bus.h | 7 +++++ sys/compat/linuxkpi/common/include/linux/acpi.h | 4 +++ sys/compat/linuxkpi/common/src/linux_acpi.c | 32 ++++++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h index f107902a26ad..65bcbe7f1bdd 100644 --- a/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h +++ b/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h @@ -29,6 +29,9 @@ #ifndef _LINUXKPI_ACPI_ACPI_BUS_H_ #define _LINUXKPI_ACPI_ACPI_BUS_H_ +/* Aliase struct acpi_device to device_t */ +#define acpi_device _device + typedef char acpi_device_class[20]; struct acpi_bus_event { @@ -38,6 +41,8 @@ struct acpi_bus_event { }; #define acpi_dev_present(...) lkpi_acpi_dev_present(__VA_ARGS__) +#define acpi_dev_get_first_match_dev(...) \ + lkpi_acpi_dev_get_first_match_dev(__VA_ARGS__) ACPI_HANDLE bsd_acpi_get_handle(device_t bsddev); bool acpi_check_dsm(ACPI_HANDLE handle, const char *uuid, int rev, @@ -50,5 +55,7 @@ int unregister_acpi_notifier(struct notifier_block *nb); uint32_t acpi_target_system_state(void); bool lkpi_acpi_dev_present(const char *hid, const char *uid, int64_t hrv); +struct acpi_device *lkpi_acpi_dev_get_first_match_dev(const char *hid, + const char *uid, int64_t hrv); #endif /* _LINUXKPI_ACPI_ACPI_BUS_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/acpi.h b/sys/compat/linuxkpi/common/include/linux/acpi.h index 610aa0784cb9..3e1ec1b20626 100644 --- a/sys/compat/linuxkpi/common/include/linux/acpi.h +++ b/sys/compat/linuxkpi/common/include/linux/acpi.h @@ -39,6 +39,10 @@ #define ACPI_HANDLE(dev) \ ((dev)->bsddev != NULL ? bsd_acpi_get_handle((dev)->bsddev) : NULL) +#define acpi_device_handle(dev) \ + ((dev) != NULL ? bsd_acpi_get_handle(dev) : NULL) +static inline void acpi_dev_put(struct acpi_device *adev) {} +#define acpi_handle_debug(handle, fmt, ...) #endif diff --git a/sys/compat/linuxkpi/common/src/linux_acpi.c b/sys/compat/linuxkpi/common/src/linux_acpi.c index 60ec838e9da7..6a9afb3ddff0 100644 --- a/sys/compat/linuxkpi/common/src/linux_acpi.c +++ b/sys/compat/linuxkpi/common/src/linux_acpi.c @@ -180,6 +180,7 @@ struct acpi_dev_present_ctx { const char *hid; const char *uid; int64_t hrv; + struct acpi_device *dev; }; static ACPI_STATUS @@ -187,6 +188,7 @@ acpi_dev_present_cb(ACPI_HANDLE handle, UINT32 level, void *context, void **result) { ACPI_DEVICE_INFO *devinfo; + struct acpi_device *dev; struct acpi_dev_present_ctx *match = context; bool present = false; UINT32 sta, hrv; @@ -230,6 +232,11 @@ acpi_dev_present_cb(ACPI_HANDLE handle, UINT32 level, void *context, return (AE_OK); } + dev = acpi_get_device(handle); + if (dev == NULL) + return (AE_OK); + match->dev = dev; + return (AE_ERROR); } @@ -249,6 +256,24 @@ lkpi_acpi_dev_present(const char *hid, const char *uid, int64_t hrv) return (rv == AE_ERROR); } +struct acpi_device * +lkpi_acpi_dev_get_first_match_dev(const char *hid, const char *uid, + int64_t hrv) +{ + struct acpi_dev_present_ctx match; + int rv; + + match.hid = hid; + match.uid = uid; + match.hrv = hrv; + match.dev = NULL; + + rv = AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, acpi_dev_present_cb, NULL, &match, NULL); + + return (rv == AE_ERROR ? match.dev : NULL); +} + static void linux_register_acpi_event_handlers(void *arg __unused) { @@ -322,4 +347,11 @@ lkpi_acpi_dev_present(const char *hid, const char *uid, int64_t hrv) return (false); } +struct acpi_device * +lkpi_acpi_dev_get_first_match_dev(const char *hid, const char *uid, + int64_t hrv) +{ + return (NULL); +} + #endif /* !DEV_ACPI */ From nobody Thu Aug 1 22:28:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkB937rVz5RZwk; Thu, 01 Aug 2024 22:28:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkB85FZcz4ZXq; Thu, 1 Aug 2024 22:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l+Kwd+aT5en4Jbusr92ABQLaBx3zpAhjyjOHtm/++Ro=; b=KbHhRPf6wDzzPb2Q5fhmOrEbO5n6yqRCn4mtBOhs05YXasKfBF6LVkdDppPxR6RttB6ReJ NTrwdmtvVGcIpt3P9uo5WQblmWc1wZf6Yy+5ty3odEmGz3JgbBYoCzZ4etphtAt8BX4a6V R/CGsyLy7B96vXahEs6Tf89f2KGf3cXs0sJeKBz3BZr1BmZ7lcP/OCVgYIRqYZNo+Om6Zi eJxu1zd6grJMCBJC45fTNX6ziIslTqmzCQ4ctXGQHT59wbY2WcLWRHixqwgzWSkMGdeEV9 c9PD60t0o7OpcL7MsyLAfhFtf8dU2nQmckDbQZD8fWu3I3VTBNYfl+zCKjkgPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551280; a=rsa-sha256; cv=none; b=oV/+pfwoQmhtmoy21zrjtF0OFGM31ur+Q3Y1kP5WnTksGsDmo8YW0PdtEZxekVEi9sQ/Xt HvNYOeLjI4awMfo18nQTwUnVpV3vSyb0vITZv7bPyVlK2OGuXe1Jebil0mk9nniZjtxqsC MutmPdy6RqxfGCtPmWc7Ddzg5oCMpTp1uV2oAk6jnOTo+mJ8Fs1L3yhdR+Hi9kSkwIoVpy LS0kTb17gSN172n2UDIGgPKbIrj6nmCcAJryMC7kY9iOgxWaNp700XCIa0QlIARcS/eBvK 8x2kh5E9LPZAb2ppjPQbMTPZsz76GFwwr3RvI+GdWj/rsgIRhyxZbUAfkw5Hhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551280; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l+Kwd+aT5en4Jbusr92ABQLaBx3zpAhjyjOHtm/++Ro=; b=MCIm8QeYCfeCoRKk/3xluW8LuOlZCdNztVmiwyHoxcjpXpu6CjrkZXGftKTZv2MCHpWhzM 0WouMq0zrJr7/I8Y8oOeQtwWH3PGVf33wZ11UbjLg5S0pp96b1hkIkiACPiYT8JoXgdEA9 mJBIL1BbVWtO3dfq2VQYc6UoZUL/Iwb4I2WPaB0Cm5cE3hLg1XO4/3AIco0Mx2W1Yoi0IQ plddqErXCsYGhIdG/D71wQpDkl5ottvBGRTKSm2UQv6RLCgzQCRC07vxX6uYc0AlAbWmDb rllmbFCROqd0n1QoFznehoC51VT2p1sHiJnDbJmgONgJ+2PGRKfYmOCLWEhx9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkB84sYzz12Jp; Thu, 1 Aug 2024 22:28: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 471MS0lH028507; Thu, 1 Aug 2024 22:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS0BF028504; Thu, 1 Aug 2024 22:28:00 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:00 GMT Message-Id: <202408012228.471MS0BF028504@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: 5a9734412375 - stable/14 - LinuxKPI: Add page_to_virt function List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: 5a97344123756e7d9c09064c27eff56c7bc9ea61 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5a97344123756e7d9c09064c27eff56c7bc9ea61 commit 5a97344123756e7d9c09064c27eff56c7bc9ea61 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:09:01 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:22 +0000 LinuxKPI: Add page_to_virt function Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45843 (cherry picked from commit 80aa295a5272d01b7f21eff6719dcd45e14e8e09) --- sys/compat/linuxkpi/common/include/linux/page.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/compat/linuxkpi/common/include/linux/page.h b/sys/compat/linuxkpi/common/include/linux/page.h index aa5acac4f5fe..37ab593a64e9 100644 --- a/sys/compat/linuxkpi/common/include/linux/page.h +++ b/sys/compat/linuxkpi/common/include/linux/page.h @@ -72,6 +72,7 @@ pgprot2cachemode(pgprot_t prot) return (VM_MEMATTR_DEFAULT); } +#define page_to_virt(page) linux_page_address(page) #define virt_to_page(x) PHYS_TO_VM_PAGE(vtophys(x)) #define page_to_pfn(pp) (VM_PAGE_TO_PHYS(pp) >> PAGE_SHIFT) #define pfn_to_page(pfn) (PHYS_TO_VM_PAGE((pfn) << PAGE_SHIFT)) From nobody Thu Aug 1 22:28:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBJ4SJwz5RZnG; Thu, 01 Aug 2024 22:28:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBH5x2Bz4Zt5; Thu, 1 Aug 2024 22:28:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6zs9nIHMx9n3PYSvAvV23IVttq7XmRuFKHXCd2HpeA=; b=esdf9oxcUf0M3Fi/s5I3LXEGPm58dGstWcBe5W9gdldGsgsYjLoHeWOTjQWyJblH/GXddM yF7EZ98YPYgeLuanvnl1XZ87AGF+yErdtEAY8rp9caFOJGOGpcXGC8/zmkWLMiJXqyTd38 yEpbG6hONmxz6jYWz5ik4JUw4FjqG7GiPWp8UjxRoC1Uw71ZBVq4ysZQP+bvNWdgMg9P/w rqyUFZM/6IJJebTU5taVx7pYAFYJE46CCgBRZtBVguoaXtVPBvdMfhXJ0ZOlT/fLRNNzY7 ZFW7axhlFtiqGwtLvNdKA8EKzJWeZATeCqajBP5oelD5kf36Jib9o25WFEFeiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551287; a=rsa-sha256; cv=none; b=mBfc3efY9vRtCPuUPJ4DoiCDggNBpfKR2Wj2E6PIAUZF6FtquEhOdF+RNGkao73J+UcpuR B4MLO53PixhYUrULbqP4aFOW+7zcsUtrwIAfZKl+4C2GqHUzT2/5JfH6cdZd+fcH9p48KG m5Yc5QkoE8kvC0SILdR8SWJCrTkbk8jNPEk4iskCyrOut78yB44SyTjA9fnKyFAYbx8k0o X8YGa/GOqwXf4LKKOz5Wg16tByojL3cMHsnDkHEgoT0O1ed0+q/MvSGW3bNDKig0FXNn3W DwoCA8PlCzA/qLzqIebn2Eukzz5tznq/RicqXCBLCYjYriNn7Bm8gmPP/FfAdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6zs9nIHMx9n3PYSvAvV23IVttq7XmRuFKHXCd2HpeA=; b=XcwCDTBfFBqwq+fRbNh6Yt9sZSMni3QpkeI3C8tnedR2LxQgmeXeRRKvscTjYoNnkV6tVU v6P8bslIGCtSYcZAdcJc9eeL0VeYfwKweUMm/6RT21zrHHCoOh4PvePsEmGRBLjs3Cvovn 0LC11CLLscGcJRoMXBj8Q8h5LnlEUOYkqUvFhITodeZB6VvJes2YvdRdTS5pds/XqSOrUU M0MjR19Y2KCm6NnLI6rh5UV7AC03HIVaFff3hm8G9SJZDtbD3eJQ8NeX47AsGdsrk4H1IX MUN8sz89LocHdehznp0glslzBuMf2yPLmzYSXEffYl9ilYr4ciftCQBzbbtukQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBH5VlTz12lC; Thu, 1 Aug 2024 22:28: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 471MS7li028782; Thu, 1 Aug 2024 22:28:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS7p0028779; Thu, 1 Aug 2024 22:28:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:07 GMT Message-Id: <202408012228.471MS7p0028779@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: a9a364864ebb - stable/14 - LinuxKPI: Fix resource leak on pci_iounmap-ing of PCI BAR List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: a9a364864ebbb3f92cf55583affbea311f29afa1 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=a9a364864ebbb3f92cf55583affbea311f29afa1 commit a9a364864ebbb3f92cf55583affbea311f29afa1 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:10:44 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:16:33 +0000 LinuxKPI: Fix resource leak on pci_iounmap-ing of PCI BAR If the resource was allocated with want_iomap_res flag set. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45905 (cherry picked from commit 14fc33ea3a0571ca70e609b6f9e67db39f7c6140) --- sys/compat/linuxkpi/common/src/linux_pci.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index c41a55fc9f87..59775629e247 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -781,12 +781,18 @@ void linuxkpi_pci_iounmap(struct pci_dev *pdev, void *res) { struct pci_mmio_region *mmio, *p; + bus_space_handle_t bh = (bus_space_handle_t)res; TAILQ_FOREACH_SAFE(mmio, &pdev->mmio, next, p) { - if ((bus_space_handle_t)res < rman_get_bushandle(mmio->res) || - (bus_space_handle_t)res >= rman_get_bushandle(mmio->res) + - rman_get_size(mmio->res)) - continue; + if (pdev->want_iomap_res) { + if (res != mmio->res) + continue; + } else { + if (bh < rman_get_bushandle(mmio->res) || + bh >= rman_get_bushandle(mmio->res) + + rman_get_size(mmio->res)) + continue; + } bus_release_resource(pdev->dev.bsddev, mmio->type, mmio->rid, mmio->res); TAILQ_REMOVE(&pdev->mmio, mmio, next); From nobody Thu Aug 1 22:28:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBC2jdSz5RZYb; Thu, 01 Aug 2024 22:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBC0zDcz4Zk3; Thu, 1 Aug 2024 22:28:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4wXSnxW9L7mLYRQ1bSWhK1Um1xUccqIa1oDTtNmYWPE=; b=ssA2UCd23ewvOrvZ5HALrnkTcFBD6RKzzsU+xE3z+M5lYSrmbHs77jGQ0RcrvWC+SGPl/1 qOw4FEhTa4PzGQCx0v72x8loypZls4cnFYFTNXK9ktqtFoE5Qp1fxwFSNI+M7S+BluISjH qN3kKw9qhA24nMbjldZsegKdFeRONxtEQ2H/OCqeAOeSUli2cPMqgyew+F0fXYurBOpOqK umerL+1v8O/XY1Gb1/DsdiiDEpZlisB2tHh9r3hu/6UDEcLznNjT93ot/U1qZj/bYGs0EV 5w8d8N3kn4T4y/ewzBWDbUPTIFThN9YKYAJncPAUQLRW1t5EoAFCc75haGQzuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551283; a=rsa-sha256; cv=none; b=lYY5UIWnaUrHZlN5esA5woHSHnq9+/ukqo8uMPRNxLQHGGTGfLZZXKl+rBCX6Wift1ppFI QRg799UCbH6xkQsLBf0sMwFeVJ/Co7FD8ODcxa0/FHicvi8ztoi9K+lpL9uj9vNUwgdlWp NypmnqxvvuTF3iF6ayGU7Gq/NC/p334KRANjwUxYEUoRQYI6+thDPUS6SD7yNCv+IypMGV xPUmBxwvwsV3a4HF/tb7vmHvLHni9coQJQK1trDYPPGcOovB8YmoSyGlNbPAYI6ksxRrfd 5I4mh8h88DU6lNLEllDUoppAyj2TgIFyFJuzuMaWomdoDzD5M+j5Ma91XnRptQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4wXSnxW9L7mLYRQ1bSWhK1Um1xUccqIa1oDTtNmYWPE=; b=QzfrBp8JHFu9I+zsb0Ihg6gefZYZvOxU7qD5hDduPAnqZM1ir+nTjH+VI4krJM+kd4RMC1 A2dQXLcB1mxvjaFd+uXyJvktOdWYBT/YTgzwYgJIHkiws9SqRTObX4JchyuxFAaBA8jF2h Ma+REWZJrxXMIqeYWKdBceNrjE2gfQpldtXD/FwyIt4pP2SgQ6Oo27CVSGUrfrG4bDwKO4 3zRCHqxGQrCSmXm+ThqWJb5jZahddvdNq2f2yYNV4E32ugeh4qa3hLEtJe+K0P9Q4fJCzd GN2mUGQxyuMexTWTk5EAeRJ+KozQcZyrjxeEiyfFLRAtQzr/rsIs+S/wGwL20g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBC0bSBz12nv; Thu, 1 Aug 2024 22:28: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 471MS2Eq028593; Thu, 1 Aug 2024 22:28:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471MS2M3028590; Thu, 1 Aug 2024 22:28:02 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:02 GMT Message-Id: <202408012228.471MS2M3028590@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: ce2d721b9fab - stable/14 - LinuxKPI: Add pci_match_id to linux/pci.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: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ce2d721b9fab172a7a3484155461076b026f0179 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=ce2d721b9fab172a7a3484155461076b026f0179 commit ce2d721b9fab172a7a3484155461076b026f0179 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:09:27 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 21:15:44 +0000 LinuxKPI: Add pci_match_id to linux/pci.h It finds out if a given PCI device matches a given pci_id table. Sponsored by: Serenity Cyber Security, LLC MFC after: 1 week Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D45846 (cherry picked from commit 5b1171a0b75fc88bffb5a67b0b02d8d59eb8d5c4) --- sys/compat/linuxkpi/common/include/linux/pci.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index f8ee6c5600da..027dc0dfca0b 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -1268,6 +1268,29 @@ pci_dev_present(const struct pci_device_id *cur) return (0); } +static inline const struct pci_device_id * +pci_match_id(const struct pci_device_id *ids, struct pci_dev *pdev) +{ + if (ids == NULL) + return (NULL); + + for (; + ids->vendor != 0 || ids->subvendor != 0 || ids->class_mask != 0; + ids++) + if ((ids->vendor == PCI_ANY_ID || + ids->vendor == pdev->vendor) && + (ids->device == PCI_ANY_ID || + ids->device == pdev->device) && + (ids->subvendor == PCI_ANY_ID || + ids->subvendor == pdev->subsystem_vendor) && + (ids->subdevice == PCI_ANY_ID || + ids->subdevice == pdev->subsystem_device) && + ((ids->class ^ pdev->class) & ids->class_mask) == 0) + return (ids); + + return (NULL); +} + struct pci_dev *lkpi_pci_get_domain_bus_and_slot(int domain, unsigned int bus, unsigned int devfn); #define pci_get_domain_bus_and_slot(domain, bus, devfn) \ From nobody Thu Aug 1 22:28:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkBK2kbwz5RZYj; Thu, 01 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkBK0slcz4ZtP; Thu, 1 Aug 2024 22:28:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbbi2XocbhoT3eTmrIgeZ8kf7O60wqvFoS0LU8G7RG0=; b=QipMiYv8RhtDqOGmVG47wcUveix2ye+aYUk28LjA/pGIwlHTHcTqKn6aXxuyyZjA4ehddQ wN1hkycs4+3xYqz6k+vqCW8dN6ls31F+xjP3mvMErOQ697xjcr2S55QquRX8gSyc2y8/Pf vkpEk4lbWdFjWQlsx0NNXMN3EF+P0NZDp8CESJhQnXnRuTIZseQH6X5uMOmzCeVkxFSouX RO2nqfK1F3b84DcinOa9WZibLFE5zdC1Zf8XQb8J5BW5rngbw0Wq08v7+IWM4DkIbe+qnF ee+nfe0XlEEr0xTaRRyT8GF8oRAobKom+ho1udrUI6EFsne2gH8nw/lNPL09QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551289; a=rsa-sha256; cv=none; b=o+fmhcrUOycIAq/e4tIfpm1U7ijquGQ/1p6VoE0jVWHdVaibJzPxsGajuTYHIWN6TEwfdE FGlwMrxUFrBTDN9AWgPJgTBcSI23yDoIY+qCj8EuFsKjAlU6umrSSoaHKS722RiODloA1R aUnIlcBnb511bRFLoYgSmvXlVdjoBePdcgQrdYJIiP+BfnSxAYhk8A91tTeRW0Zc83QEP6 Ru0lClLPuIzc5dJNMm8ED7ql2Zz/pJ7np4Dip8rmebLbt2cBE5JkgDVNcpSSJoEiESgsaA E8oRCOiTockcL7gW/MEFpYeE9EvOSQgEgfs1Bi1FYmqB0DKOrIOcWSJPf0uWDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pbbi2XocbhoT3eTmrIgeZ8kf7O60wqvFoS0LU8G7RG0=; b=a2/3+DY9PlCzg9X6DJU0MZhBYT7FibZjp8NReozsjo1iYKq7M9QrEDyIL5o+C2VONlthwU oSQ7FxMgtJCZM8j41ix/FNJC9nmyvPGy8B9xK0P+2E21O29cFdUxqP1sdub0NRDJs1IoJc +LmWzNJc8dPnJzG/yfPxQuiCPwJTXMbIM04HjAhUeBlLKuZ3tPWzHPcMqsmoxjHQX3Ehio 0g/bMgpxddQlcX6Bs2TlUB9kRsXhx8M5cPwBjFZ7rlwPQQAN6KTMPEuZBiBg/oPTvvtQJP 2JPo9cs9GKwAqpHqmFva1siXU4hNHrrNPS7d76AZy+OyJhdI8WVp55lcLoaTOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkBJ743xz12tQ; Thu, 1 Aug 2024 22: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 471MS8ei028828; Thu, 1 Aug 2024 22: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 471MS8NJ028825; Thu, 1 Aug 2024 22:28:08 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:28:08 GMT Message-Id: <202408012228.471MS8NJ028825@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: b37a6d41a046 - stable/14 - Bump __FreeBSD_version after LinuxKPI changes. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: b37a6d41a046dbb46ee1d6bf00c710c03c944a24 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=b37a6d41a046dbb46ee1d6bf00c710c03c944a24 commit b37a6d41a046dbb46ee1d6bf00c710c03c944a24 Author: Vladimir Kondratyev AuthorDate: 2024-08-01 22:22:32 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 22:25:24 +0000 Bump __FreeBSD_version after LinuxKPI changes. Sponsored by: Serenity Cyber Security, LLC --- sys/sys/param.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index cd77156ab17d..697a96cca916 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -75,7 +75,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1401501 +#define __FreeBSD_version 1401502 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Thu Aug 1 22:32:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZkGy6gbtz5RbFP; Thu, 01 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZkGw13nJz4l1W; Thu, 1 Aug 2024 22: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=1722551528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GbgW7R0q8ySbQRqX0hCPRJEdW8FVUKjWZBtXEKgs6l4=; b=pvhqNd6vIaUCJHRtHxhrvgLkcNMB8eYfj/Uo3/tO0HFVjR9k4rdYHBT4tC13YFy2FbDSne /TXXavch8bXNxTWmMP8xbM3BWq3QbOqu4ns914RlY/zwHwraL91xbOquPPzVeQq9/8+XfY D4H/CSAH9VGsl5i1kUCtXv6hqa/Rp9XUcrmGasSnNV7kM4DnzMutWdm9thD4edzJTuBp1M EnpOyovXgl0qJ6pkeKXPEEg2nSRKxIcPgK5Xk//2ypu4+Nrz16uL7xVAReeZ0Q522dIye/ JOV/69GphcgyypbDEBrkwybGg8Vjl/vsUvuhdG02vuNz63tm7kdY9uLjkAVqhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722551528; a=rsa-sha256; cv=none; b=RZ7KlbZ7CaBMa3ABm4uR7Bqoa1jhrOP2TM+Vt6/pvSYl42+XFADrABzdLm9IuG5ynKK+zq QX+kgjGXg3IcBfd08RO110cQ+kJCO5CBwDXLiWy1OTE+A6yGugA9LJmlnnUdTO+JkCwmLE qDM4EQfON9wMDTBxzgENrhy7hBWyqWJXZlN1qDDU62T3yLGUAV3SLdfo7AhKnZ/0Xhr3D+ I5HlqUzWB7bb8F8UqLlcjI6melAnYXx57YBpthdeX0oahLbEla4C56IDiSMMHeva7lSlIY LAC88cDd+e+UqOUMnhIZNRiJYt4NcB0KhyJrrWnCFPGM3q/8UHYX9NMfa89rRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722551528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GbgW7R0q8ySbQRqX0hCPRJEdW8FVUKjWZBtXEKgs6l4=; b=u0jZJCj9FaZRAAn5eE0kMSPmyikdgOIikCtwxfVwrtBMZGhAmtMJdslj088H4JpUgrFlSL 6I9jn4yr/gv7rM09auoAQcDcKlh/K/RXIEsjBOfwDnWmIIeSRsmJ7YyMwryPfgLzK+z72M TbJn9KD42wOvAeUhLqwbxMSdZO6myKHDkOCMC+iMuFPKo0IiOEx9FrWwCXogVaR97PFGRX 9Rt84JVtghGZ2CIfHGpXqa19OEBKfs8P97YF7NV0OE1kAnSqF2KPDPSuNdnfkSacC8Offt h0tHW+nVIQfSX+9WWW833olON1+H72RP5deUnMoGJjMofiGH0yLSDbY4LSTrpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZkGw0FjKz12pc; Thu, 1 Aug 2024 22: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 471MW7Nc041094; Thu, 1 Aug 2024 22: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 471MW7Hv041091; Thu, 1 Aug 2024 22:32:07 GMT (envelope-from git) Date: Thu, 1 Aug 2024 22:32:07 GMT Message-Id: <202408012232.471MW7Hv041091@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: 85da0abada24 - stable/13 - LinuxKPI: Automatically enable drm support for devices named "drmn" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 85da0abada244f90dc6e9ce36c75492f0aa9bf02 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=85da0abada244f90dc6e9ce36c75492f0aa9bf02 commit 85da0abada244f90dc6e9ce36c75492f0aa9bf02 Author: Vladimir Kondratyev AuthorDate: 2024-07-21 13:02:08 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 22:31:06 +0000 LinuxKPI: Automatically enable drm support for devices named "drmn" This allows replace linux_pci_(un)register_drm_driver calls with driver renaming to FreeBSD name. Sponsored by: Serenity CyberSecurity, LLC MFC after: 1 week Reviewed by: manu, bz Differential Revision: https://reviews.freebsd.org/D45906 (cherry picked from commit 5d20075f8b9f7107aa0a246e5165d9816e816a44) --- sys/compat/linuxkpi/common/src/linux_pci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 5f7296d66ee9..459f03f7e2a4 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -752,7 +752,8 @@ linux_pci_register_driver(struct pci_driver *pdrv) { devclass_t dc; - dc = devclass_find("pci"); + pdrv->isdrm = strcmp(pdrv->name, "drmn") == 0; + dc = pdrv->isdrm ? devclass_create("vgapci") : devclass_find("pci"); if (dc == NULL) return (-ENXIO); return (_linux_pci_register_driver(pdrv, dc)); @@ -907,7 +908,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) { devclass_t bus; - bus = devclass_find("pci"); + bus = devclass_find(pdrv->isdrm ? "vgapci" : "pci"); spin_lock(&pci_lock); list_del(&pdrv->node); From nobody Thu Aug 1 23:18:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZlHy0qLdz5RfXW; Thu, 01 Aug 2024 23:18:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZlHx5bg8z4rJM; Thu, 1 Aug 2024 23:18:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722554285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNs1nxoMqfxdlTK2QwMo/IP/Iz6OTLV/tpdyTjvh28g=; b=sOsTd79duve6tFYzQCsveSpRSarlAP5g2BKhhZk3L+Whyhs3SBLceVYYAJV6l3+QD254Qx QNXA5Xr6vZvtk8dtyXSpP/Ac4WAGO1k5KgZ0wRNDBqP0ta33QP35rVufaOUWGA/Mdzoezb P41PwoM4YOBD3FhLGZCaS0MIqnPf7aK8GT5HfVMDjAK5XBySisasX7T1m2Ew4SJal/xYwN JMe4YcVgV7+rucXK625h3Kv0QzGv4Sjzxs0Sl232JHx0mtaS5fPOV/WQhqg+yt+49X81Zn SmWttdrsv6HBt8bkvlQC+WM+mT7sQZeaqQzP3e0f4MjSOq37xWj74kO/7+5WlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722554285; a=rsa-sha256; cv=none; b=eblMvlw9Dcp5yfc9mmkozxW59VLZfPubInyrPQPp5ZmBTkclnn3wpIhymLyy8+oxvYiu4G x3YjfYR1I7qsY50PkpgrKctf806/pENX4DV4MddX65imo84eSWdDX5oS+JCyb2RTfqEGHR tMc6wOD9GOUrNzF0GU7vL+n9kXrJk6AJE5D5XjKQ0MsBXE8yh3UJPXGQR/WMm0oX1PFTGX aYgs+P8lb+OcvaTmg2D+riW6nedzAPGEhyMZ8TlwmhB44nKkZ0qP8K93z0F3oi4UXRkj6r B+/0VsBIFHekQacxtpWKbzTL/xWAusr57DAiLlZAB692kT5dWmzk/3AzMWqNyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722554285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wNs1nxoMqfxdlTK2QwMo/IP/Iz6OTLV/tpdyTjvh28g=; b=XNA8tGKfBwu7idxSvgqDnY3hNFnm8fSucctLphXyD980DgzGANmThtjWXlp6Nj1iF4SA8y EQXzoXX0cdUKdzurMXI9GkfU6Cl3Xm7DSHpFAGLhxJKZ8sCo9gQhxKGVcqH7Mblg7d2Gja h3AwPydmVx5L8eC7qKJjU7bWvnynUhG5d/el9ZMeXT8kZekAV/C/0npDH2whT/oiD6c5G+ xCF7udcCZSXC0w7LoocHIZacCI2GnvMo0tBDYQdW0AmkcYDmga6sFjnAH0QEgP0BdzadxP YyRFxvJi3XFuniSrjSLnLPSLn3hUU0HUd9ulZxWS6/KR7/FDpTMwYWsiEUN1lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZlHx54Lwz14Cg; Thu, 1 Aug 2024 23:18: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 471NI5g0014110; Thu, 1 Aug 2024 23:18:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 471NI5rT014107; Thu, 1 Aug 2024 23:18:05 GMT (envelope-from git) Date: Thu, 1 Aug 2024 23:18:05 GMT Message-Id: <202408012318.471NI5rT014107@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: 5eb1ab19a359 - stable/13 - Revert "LinuxKPI: Automatically enable drm support for devices named "drmn"" List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 5eb1ab19a359a9639627686ba6af6c02d6ce1cf8 Auto-Submitted: auto-generated The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=5eb1ab19a359a9639627686ba6af6c02d6ce1cf8 commit 5eb1ab19a359a9639627686ba6af6c02d6ce1cf8 Author: Vladimir Kondratyev AuthorDate: 2024-08-01 23:12:32 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-08-01 23:12:32 +0000 Revert "LinuxKPI: Automatically enable drm support for devices named "drmn"" This reverts commit 85da0abada244f90dc6e9ce36c75492f0aa9bf02. It is based on other not MFC-ed commit. --- sys/compat/linuxkpi/common/src/linux_pci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 459f03f7e2a4..5f7296d66ee9 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -752,8 +752,7 @@ linux_pci_register_driver(struct pci_driver *pdrv) { devclass_t dc; - pdrv->isdrm = strcmp(pdrv->name, "drmn") == 0; - dc = pdrv->isdrm ? devclass_create("vgapci") : devclass_find("pci"); + dc = devclass_find("pci"); if (dc == NULL) return (-ENXIO); return (_linux_pci_register_driver(pdrv, dc)); @@ -908,7 +907,7 @@ linux_pci_unregister_driver(struct pci_driver *pdrv) { devclass_t bus; - bus = devclass_find(pdrv->isdrm ? "vgapci" : "pci"); + bus = devclass_find("pci"); spin_lock(&pci_lock); list_del(&pdrv->node); From nobody Fri Aug 2 00:08:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZmPw0TDcz5Rkxh; Fri, 02 Aug 2024 00:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZmPv6phCz4vpk; Fri, 2 Aug 2024 00:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722557300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdv+NBXnsSSSC99UALrvJUEba6Ew4X+r1ys/oS623hs=; b=ZQX5noV1FX4wL9JCQlOFjLzhnAt/DMHnL057PVVv3sm/WDtj0p6/irCOrZ51oBKPIDW+rp EKFyDyR0Q3/1uMkCMqt+kyjb/iTTcDcBcUqATMNRi6ZThixmHtP5hVL4RwG9XDo1pEJHht EV0AIyNm3l5nrAe7szzygztJx91LKbfQ4d7B9XlCOKCBCfsb5lijPBH5BTEV4W6mwFSKR0 VV+cI+4xBGJJdNbtZxyUd1QZQQzXgger8hkvDBwU7yHsmwHi40zSGH/J/hwg+4nE9rslBj JxeprJ+JEBv4iZCjgYZTGCc2OPfB3tO/mGBtAixOUaI9RUCVriwBy52hs9xhZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722557300; a=rsa-sha256; cv=none; b=XhYc80p45AfKSxAvD+tDcbFScswZhhb9a0FJABTdBH+3zRKDPz/jX9VW9Aj5WUjraTx2ul F+mMqM6PRX7sd//gLwtm8ltU9KJz5OOIBbLEBIzCtXttniwVFvUNdMkCkDDrBiSaai/CRU /r18XGimoH7nfXFPmM7+RsloDhuus6y0wBpLC8KgcUZcdQHIRS8d6mxkLxlfRsVsCzSoXO LVZnYWeqnsNYqhb+/Un6pwOufr8mzBAdGKdLvaMHYKTSzOZ7/ICzmA2c8q2f5ORfUyvRuT UCijuL65kCsKg3cx+qHFplq/oIMiimSVgD5ggEN/RkI1H/neBhn+8/m0QetS7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722557300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qdv+NBXnsSSSC99UALrvJUEba6Ew4X+r1ys/oS623hs=; b=JRZQENB1DSUYM4PO0iNgLRrhHRLU7e5lUf+/pD2fsOgXzAUoNMRXeeaFBQVxJibbZQ7qGn hLGsaLKuzftmnnNJgF4YaPEm5rBq6DB3AYkE8M7ruOaSXH1tdy9gh9xFv5m4cIhDNB1WzA 0PMsObQade+uCizzQaWVjJZ2Gf3WITqaz7hd2IwfDEHSXwYns+GmkyaDV5Tn0R1YTSdoN9 xg5jw1Ij6NNZnHPbelko09PyucLZX9g8C/6O18egSz/Tmkm7Z1q2sRfi4I2DKdib8ub6sU +bC/LBxsyZKw8PnqP+Y9Q1x6TZz5nEmKhyCtM6nhq0LeOIhkDTZqcNpFaxP/Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZmPv6Pmzz15VS; Fri, 2 Aug 2024 00:08:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47208JhY099230; Fri, 2 Aug 2024 00:08:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47208Jgm099227; Fri, 2 Aug 2024 00:08:19 GMT (envelope-from git) Date: Fri, 2 Aug 2024 00:08:19 GMT Message-Id: <202408020008.47208Jgm099227@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: 77064cddb948 - stable/13 - Post-13.4-branch updates List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 77064cddb94875dc8d9693a93ac25019b7f62c59 Auto-Submitted: auto-generated The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=77064cddb94875dc8d9693a93ac25019b7f62c59 commit 77064cddb94875dc8d9693a93ac25019b7f62c59 Author: Colin Percival AuthorDate: 2024-08-02 00:07:12 +0000 Commit: Colin Percival CommitDate: 2024-08-02 00:07:12 +0000 Post-13.4-branch updates Rename stable/X to 13.4-STABLE Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon --- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index cb4422125aea..b4872c14722a 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index 155f04070ff1..cba49f3e9b9b 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1303503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1304500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Aug 2 00:08:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WZmPx1F4fz5Rkxl; Fri, 02 Aug 2024 00:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WZmPx0mP4z4vs9; Fri, 2 Aug 2024 00:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722557301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=srJ9sJlKHmwRklQGYAEOe/qypL54WPCbmUN16qFeu5w=; b=gEAOboWY+XAUy24s7KtWxDwqjlL/KkzZUsjyjHo6mKYDouJ6PgnBf0Q1/2RAtBRPyMj5aU h6FXL6CmD0sIcTpL2FxWK3g7sSrDAdIltNruqVLgbDqnX3CGLUGLJNGNRdwRbwk3ck/tWA c5J5d+ovs+9t6up2HTdViU6N+n0SlHrD0D5v9Rip1b8r1q+cD0KFybyu/9O7RKwaIY25JG 1hHVujAUOdrnNJEoQpu9/87ZEowYD4AnoGRBFw358RUavff1qUeOIq4Qo24NYSEHUZLqp8 patsuLik/G0jbiqfVEIrlGQGAXLZKoiEyLG9UCPzGxyMYzPxABc1Gns4FR+9hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722557301; a=rsa-sha256; cv=none; b=HyakGiTrv+2SYkSL1CiSdP+iitOGWiVhnHph87uxF3JDEXn+LzDV5sGHVj+AU0uP1HG571 Pg2l4fTmHnJKqPAKr+9LjBtCQAC74BSyMQBUX6Ck5Nw40c7C08ga8m5rD9fZEkgh/NjqHU JmNevaXjx8TmpIC99bj3OC3GIMvaDtd6FY7gp6ktQLZFgHEzP6j+tr46vEYi+Ywy5jx40t SlSQXQBksUe+P4dBe1r2GfvPcOhK3SqIeyNOZ7oX+5j2u5osHXA6Svi8THz9wew/H5c0YG bSihdPM2gRKcv1gp/kXnhmik7gLhLoftlrZKg00VDrIBxAVp9Ejds4VGQBFcXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722557301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=srJ9sJlKHmwRklQGYAEOe/qypL54WPCbmUN16qFeu5w=; b=xRnx8DVncxzCWI4YzLAP5TpJ6RKmHfESA10Ore3fl+uZENwnU9qMcBEqxpiita4cVXR4nF yw4KXUdCfG4ihGs5KMBXaic2Rb65oX+I7xPVmbyH2ClRkpVRsRybMxEkh6/4suLFo6qNc8 IV5qKl9SckwNiDh8yTEf7V+csDhVzJJy3AapsWnQC3Fhu6UFgGNpYI17RRVVfosR5Qyc6N p0dlr7fABPNwQY2W5hBu+Ei/w1PmyfP9I4LWsl4gEiTe8vsyfgewtLWRnBxG2HqheDCICH GbdAVa6I1VGYNbXQ+S6G0bRMHjk0r7CS2/eheXLTwG82Gf2dRSJgDCoteBx5Gg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WZmPx0N05z15T1; Fri, 2 Aug 2024 00:08: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 47208KOk099280; Fri, 2 Aug 2024 00:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47208KfQ099277; Fri, 2 Aug 2024 00:08:20 GMT (envelope-from git) Date: Fri, 2 Aug 2024 00:08:20 GMT Message-Id: <202408020008.47208KfQ099277@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: Colin Percival Subject: git: e192230d0de8 - releng/13.4 - 13.4: create releng/13.4 branch List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/releng/13.4 X-Git-Reftype: branch X-Git-Commit: e192230d0de85bd47ede1f46ac8a00ded0269f3c Auto-Submitted: auto-generated The branch releng/13.4 has been created by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=e192230d0de85bd47ede1f46ac8a00ded0269f3c commit e192230d0de85bd47ede1f46ac8a00ded0269f3c Author: Colin Percival AuthorDate: 2024-08-02 00:05:49 +0000 Commit: Colin Percival CommitDate: 2024-08-02 00:05:49 +0000 13.4: create releng/13.4 branch Update from PRERELEASE to BETA1 Switch pkg(8) configuration to use the quarterly repository Bump __FreeBSD_version Approved by: re (implicit) Sponsored by: Amazon --- release/pkg_repos/release-dvd.conf | 2 +- sys/conf/newvers.sh | 2 +- sys/sys/param.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/pkg_repos/release-dvd.conf b/release/pkg_repos/release-dvd.conf index c2e64c43a56f..600c309d5979 100644 --- a/release/pkg_repos/release-dvd.conf +++ b/release/pkg_repos/release-dvd.conf @@ -1,5 +1,5 @@ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index cb4422125aea..5a0f6c2f3498 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -53,7 +53,7 @@ TYPE="FreeBSD" REVISION="13.4" -BRANCH="PRERELEASE" +BRANCH="BETA1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi diff --git a/sys/sys/param.h b/sys/sys/param.h index 155f04070ff1..108851a776c5 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -59,7 +59,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1303503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1304000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Fri Aug 2 15:56:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wb9SL5XDKz5Rx45; Fri, 02 Aug 2024 15:56:50 +0000 (UTC) (envelope-from joe.marcus@gmail.com) Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-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 4Wb9SK6JJsz58Tm; Fri, 2 Aug 2024 15:56:49 +0000 (UTC) (envelope-from joe.marcus@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=marcuscom.com (policy=none); spf=pass (mx1.freebsd.org: domain of joe.marcus@gmail.com designates 209.85.160.176 as permitted sender) smtp.mailfrom=joe.marcus@gmail.com Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-44fe188d25cso29684021cf.3; Fri, 02 Aug 2024 08:56:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722614208; x=1723219008; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CDRxDCwvqwmQ6lgr5nniqpccUdhdyyazf9dTMsUiTpM=; b=hVxe6J8zF01L1/3e87aR/KF53zI5QN5RTzhfC3wdD/TYhvEUzlnCwsnfyhJIsXjxHo HeDAOZwCUvr0NDb+WnX4lPl0Q1pSbepRNpHGlNeeHpzRok2JpCN+NRUelUdJi5XoAqta y+GubuUYLSAO9tCL5iGSMqPoiYjHUAJAeFdLNr21Gn6oU8J0q/PsKxE+csx0nAbLTxE5 5YwEyi6GNeIS0oUDkqVcyiZuuUnpZ84AjfThpFmAy93xapjuWE83KMSbMJDrCvXQCPO6 UGm6JG1qkVL8AM3baGbH0fO563sYU7vD2hfsjrvJo9MyhIeItGEEM5RlnKz6vmqH0+p1 NhdQ== X-Forwarded-Encrypted: i=1; AJvYcCVfWeYpALcBbVpNiYDg2XW43pqGypkibg9xI2Kvyum7BCAlZe5SQlk7/QbRHzSz6sHgINYvooXu7OeAHXSvMrfvO7dxK37ANmrD@freebsd.org, AJvYcCWtGULg9VHuBfFmBgnj3AT3LYyCqS+pHs/t7Iob4hV2E67ThShdoMdHs8Jdl4T5WgwE7l+IxfCRIhDm6qtoN3umiTHH@freebsd.org, AJvYcCXS6A5O2uNdAPQkK4AJg05jmzRo+T3aJ+Tg3P7sE1+fs/sIsx3QtGCg+TGwZ0hOvHOFntx/wxXcj4I8sC1VpQE=@freebsd.org X-Gm-Message-State: AOJu0YzY8Dd7h3YBxbcATLmDQVbvIweryqhHJgKy+y+PZ9JIxqBUF61R Uu1vn8Fr0q9VT/+w161d2IF1hWLJ/KKrVhw77/mrhcJtloD3FV0ke9gO X-Google-Smtp-Source: AGHT+IENrBRw1Z7DcTAFDvvTPagSnWz/gtJsaWef6mbpZT6lPPugqipVVvbSogulOk8UuzoBVU0+ZA== X-Received: by 2002:a05:622a:255:b0:44f:f1c7:ed2e with SMTP id d75a77b69052e-451892079f1mr44281721cf.7.1722614208560; Fri, 02 Aug 2024 08:56:48 -0700 (PDT) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com. [2607:fc50:1:f300::2]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4518a755579sm8293471cf.59.2024.08.02.08.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Aug 2024 08:56:48 -0700 (PDT) Received: from [10.10.103.118] (wsip-24-234-111-66.lv.lv.cox.net [24.234.111.66]) (authenticated bits=0) by creme-brulee.marcuscom.com (8.18.1/8.18.1) with ESMTPSA id 472FujF0055638 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Fri, 2 Aug 2024 11:56:46 -0400 (EDT) (envelope-from jclarke@marcuscom.com) X-Authentication-Warning: creme-brulee.marcuscom.com: Host wsip-24-234-111-66.lv.lv.cox.net [24.234.111.66] claimed to be [10.10.103.118] Message-ID: <4d8fcff6-92c4-4044-94f9-cf91af06a415@marcuscom.com> Date: Fri, 2 Aug 2024 11:56:40 -0400 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: 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: 6b0a2b19c845 - stable/13 - stand: Print a warning of the loader is too old To: Warner Losh Cc: Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org References: <202408011457.471Evboq057700@gitrepo.freebsd.org> Content-Language: en-US From: Joe Clarke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.4 required=5.0 tests=KHOP_HELO_FCRDNS,RDNS_DYNAMIC autolearn=disabled version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on creme-brulee.marcuscom.com X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.71 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.82)[-0.824]; FORGED_SENDER(0.30)[jclarke@marcuscom.com,joemarcus@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[marcuscom.com : SPF not aligned (relaxed), No valid DKIM,none]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_LAST(0.00)[]; HAS_XAW(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jclarke@marcuscom.com,joemarcus@gmail.com]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.160.176:from]; MLMMJ_DEST(0.00)[dev-commits-src-branches@freebsd.org,dev-commits-src-all@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.160.176:from]; RCPT_COUNT_FIVE(0.00)[5] X-Rspamd-Queue-Id: 4Wb9SK6JJsz58Tm On 8/1/24 11:43, Warner Losh wrote: > > > On Thu, Aug 1, 2024, 9:39 AM Joe Clarke > wrote: > > On 8/1/24 10:57, Warner Losh wrote: > > > +if core.loaderTooOld() then > > + >  print("**********************************************************************") > > + >  print("**********************************************************************") > > +     print("***** >             *****") > > +     print("*****           BOOT LOADER IS TOO OLD. PLEASE > UPGRADE.          *****") > > +     print("***** >             *****") > > + >  print("**********************************************************************") > > + >  print("**********************************************************************") > > +end > > + > > Hey, Warner.  I know this is an MFC, but could the message be updated > with a pointer on _how_ to do that upgrade?  I always find myself > re-learning the process as FreeBSD has evolved, and a current man > pointer would always help. > > > We have a man page for this already, but it's not very good. I'd hoped > to do something with release notes for this release. I was racing the > freeze deadline with the actual change and was going to chase it with > the new / improved docs. Thanks. Improved docs and release notes definitely help. Just thinking beyond 13.4. If people hit this message pointing them to, "(see loader.8)" (or somesuch) would help those find the right answer quickly. Joe From nobody Fri Aug 2 16:39:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbBPs6wgkz5S1lG; Fri, 02 Aug 2024 16:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbBPs6PC0z41sS; Fri, 2 Aug 2024 16:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722616785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YrbFPHb/aGdXXH5hXpbzpxIGn6OS2lV8/g8dFeM8WXY=; b=nswLc6nt0olyQyHiFUy3ftaD1D/6R+Yr5Kydj1V4cchDvVB5z6vp5tf4XlAJnCyr2P9OfK EHNniqyUmwyH45OD0n+tjs8QoZpvKoAurVyLjl0C9TVJle1XcPGkYGebjfAPlnsjuIDfU9 OBr/9RejiGlOW/E7c4/8qUvh+e6czBD1bzYlatvKSIHMvnXGcuk4Pm6rm51TggJrQi3uOf xUGJyv1AzMz95/dltJ3oUo0lu8aXJae0TBbsgBKLtsn0zE4D7LykcRDMnXrD6YHVxm/xkf fSC61rEmY8y8xF8E7bPbtqLnKYmW7kfUyRMVrm04EW5mYoQEyq5SFEo0A0N6eA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722616785; a=rsa-sha256; cv=none; b=DO0aQbdzzuJcT86jlvEBs91sfPDp6gIV+GHxhs4elVZmVnV/iXyfDgW/5cfTiuxTr0/OTq LHQxEbeFWQp0diliTKGIaS0QWDooJg62jLZPE2NMJZSzXLqT9jI5yJSeQTSKoPXIUaMI4P KvMZNPBjAJNdLTBSxfH4RANO7Az1q89r2Or1Hgl7TL6XszGoxCPJWwWvgEEqk7il7JReIn CQ6+XgFWPfb73trIN/PUefVHwF5h/d1svwO/M0Ag9aAsW3UGK1IozA+VG/fxRLPL4iMUA7 vDpE/+dV9eyjRJbFIqkNlKKpFy+HXXcOjbpKprd+2Wd5WOKPuotREFD79GHq6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722616785; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YrbFPHb/aGdXXH5hXpbzpxIGn6OS2lV8/g8dFeM8WXY=; b=EcZm0GYh+kNo7HgYVcZ6ThHohW5ITxjHHqFRwfhyl1WBm1IgGKkck48a3SFwj0CysUuyH/ mHt0p5PtMqlXIDQk8uUP8m8ot+4oP1/vLTkGs58PUHiSg47ykW0VoqH47g3Wq3iMP4r3dE QgOVdRMpT1We/9SLWCINx2SpjZetqapNvfyFiDGhi2jru6PS+q8h7raG118IuY4/3rIg7C Bt74FfCfgiy/cjXOZh6rnLYOOUmeFMvnCR6FgugbzM7oILuByEae2o2oTigq3CsBxlXjhr 9f9JpYlx1Ho5h/aWtwEk+8Dy6rDrlmyHcA+n5nToRzEWorH6oD8dm+BkSHIkAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbBPs5ZbhzbjY; Fri, 2 Aug 2024 16:39: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 472GdjEK071866; Fri, 2 Aug 2024 16:39:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 472Gdjns071863; Fri, 2 Aug 2024 16:39:45 GMT (envelope-from git) Date: Fri, 2 Aug 2024 16:39:45 GMT Message-Id: <202408021639.472Gdjns071863@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: c1f711fd359f - stable/14 - siftr: remove the shutdown_pre_sync event handler on unload List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/14 X-Git-Reftype: branch X-Git-Commit: c1f711fd359f41f9cdb18dd7a02d1fb0ce8866a2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c1f711fd359f41f9cdb18dd7a02d1fb0ce8866a2 commit c1f711fd359f41f9cdb18dd7a02d1fb0ce8866a2 Author: Kristof Provost AuthorDate: 2024-07-19 06:08:14 +0000 Commit: Kristof Provost CommitDate: 2024-08-02 07:30:38 +0000 siftr: remove the shutdown_pre_sync event handler on unload PR: 280351 MFC after: 2 weeks (cherry picked from commit fb05f761ac0b28b03eb057e36fe118f007d43d73) --- sys/netinet/siftr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 52e2b8838b0f..255714cec0b1 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -273,6 +273,7 @@ static struct mtx siftr_pkt_queue_mtx; static struct mtx siftr_pkt_mgr_mtx; static struct thread *siftr_pkt_manager_thr = NULL; static char direction[2] = {'i','o'}; +static eventhandler_tag siftr_shutdown_tag; /* Required function prototypes. */ static int siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS); @@ -1281,6 +1282,7 @@ static int deinit_siftr(void) { /* Cleanup. */ + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, siftr_shutdown_tag); siftr_manage_ops(SIFTR_DISABLE); hashdestroy(counter_hash, M_SIFTR, siftr_hashmask); mtx_destroy(&siftr_pkt_queue_mtx); @@ -1295,8 +1297,8 @@ deinit_siftr(void) static int init_siftr(void) { - EVENTHANDLER_REGISTER(shutdown_pre_sync, siftr_shutdown_handler, NULL, - SHUTDOWN_PRI_FIRST); + siftr_shutdown_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync, + siftr_shutdown_handler, NULL, SHUTDOWN_PRI_FIRST); /* Initialise our flow counter hash table. */ counter_hash = hashinit(SIFTR_EXPECTED_MAX_TCP_FLOWS, M_SIFTR, From nobody Fri Aug 2 16:39:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbBPt1qTHz5S1yf; Fri, 02 Aug 2024 16:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbBPs6tQ0z41xX; Fri, 2 Aug 2024 16:39:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722616786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3vS6oerBj+G5J8QVAsCXtsDD5pRdY60m4+AJlkeYORE=; b=KNxm0chrpcLijFfdUjJIZzFD0hmBb+1I4wzJSt1+RkvEcmLFb6M+pVtYTBkiWCDHGJwyNa MtGHytyPfIyIkyEhYHgF2TxvTnArnlFfT+XPQbpmnITv+J73BZfxMaHOq55dlt/3y8vKpl Xi777ggtnPrrZ8lpExDJzBYm2HT5CB8BNufMZWIkmhsYYFUXSC6VgXjENUDaybbz36teQU dDD6VdZl3dx4n6fVGcK5b95VBGQDuNEKeoFiIV/MBHF9DKGZdMhnLhNZVYShH3wQQl15io lt8qT+j/myzqv3E3O4ZWZGjS2fBGLWjaOsYyZ3mtBId/USBZPPzoTpMfG4jDYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722616786; a=rsa-sha256; cv=none; b=vXlNp30EFtJ7XsUn8SBmqLTYBcQoaKC9WqQFxsG5THEJhcm4elAsbYvEPaiQ1oNdzCUQjv Km3RblvCLWIYwtjDJU+hgES4+mnz2uEop30eC+YqyQ2eHZ81/uaS5mJa82u/WITFEFhatR Al1BimG/e0mP+bgGYnTfIV3cLWa+Cii1TSJDu6gELl7M32SBlXCMAM5AAmoodbf4z3fsZd sazTdP6Nm++eDV5A3TUddYdTA3faUNAhbT8RdhcORGHKc/aonMAihUpYUs1UhrXdnMUwIn DYITAP4F72/AQRovI6esZ1/WwDjpRvFb8YkHqnQGk0UBRNswfg48P2sgpQITkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722616786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3vS6oerBj+G5J8QVAsCXtsDD5pRdY60m4+AJlkeYORE=; b=YftZcJkjX52vAroZ6MLIcMwFuS5wLRmnRkaoyxmbeRImUwsr6JJrRDmWfCnRPeM3NXn8d/ GeA+MVvcyy0lmrkulr6G4m6Wzb1hLEYZtUA92drDgGUb06k+UkxWI3jRlv5sT1vavgTrXc jEyVdBDtzgWZJ9RMzQY9csdoY/lkRDAlVvZCCiCjERkMbiH9kJHQDSfwTP7oEjqsxFcpuc pvnTBYsQavH4avsOEe2OevnXZ7Vm0oVD0kTZsuL0bk7U7Kza5gu+Q7U53N6IESeh2RabeU 8tfXHpZq/oxhQiBLJXC4SJcWTv0ZmKXUZbCg+TJFrwFCEFnY71JTWV4iI5D4Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbBPs6NG1zbnV; Fri, 2 Aug 2024 16:39: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 472GdjFj071955; Fri, 2 Aug 2024 16:39:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 472Gdjej071952; Fri, 2 Aug 2024 16:39:45 GMT (envelope-from git) Date: Fri, 2 Aug 2024 16:39:45 GMT Message-Id: <202408021639.472Gdjej071952@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: 8448df88fdb4 - stable/13 - siftr: remove the shutdown_pre_sync event handler on unload List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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/13 X-Git-Reftype: branch X-Git-Commit: 8448df88fdb4ed880b43e3fe91691d37b3940fe8 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8448df88fdb4ed880b43e3fe91691d37b3940fe8 commit 8448df88fdb4ed880b43e3fe91691d37b3940fe8 Author: Kristof Provost AuthorDate: 2024-07-19 06:08:14 +0000 Commit: Kristof Provost CommitDate: 2024-08-02 07:30:41 +0000 siftr: remove the shutdown_pre_sync event handler on unload PR: 280351 MFC after: 2 weeks (cherry picked from commit fb05f761ac0b28b03eb057e36fe118f007d43d73) --- sys/netinet/siftr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 7ec19ecc875a..c6c47eb9da83 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -288,6 +288,7 @@ static struct mtx siftr_pkt_queue_mtx; static struct mtx siftr_pkt_mgr_mtx; static struct thread *siftr_pkt_manager_thr = NULL; static char direction[2] = {'i','o'}; +static eventhandler_tag siftr_shutdown_tag; /* Required function prototypes. */ static int siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS); @@ -1507,6 +1508,7 @@ static int deinit_siftr(void) { /* Cleanup. */ + EVENTHANDLER_DEREGISTER(shutdown_pre_sync, siftr_shutdown_tag); siftr_manage_ops(SIFTR_DISABLE); hashdestroy(counter_hash, M_SIFTR, siftr_hashmask); mtx_destroy(&siftr_pkt_queue_mtx); @@ -1521,8 +1523,8 @@ deinit_siftr(void) static int init_siftr(void) { - EVENTHANDLER_REGISTER(shutdown_pre_sync, siftr_shutdown_handler, NULL, - SHUTDOWN_PRI_FIRST); + siftr_shutdown_tag = EVENTHANDLER_REGISTER(shutdown_pre_sync, + siftr_shutdown_handler, NULL, SHUTDOWN_PRI_FIRST); /* Initialise our flow counter hash table. */ counter_hash = hashinit(SIFTR_EXPECTED_MAX_TCP_FLOWS, M_SIFTR, From nobody Sat Aug 3 22:16:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbxr26kF9z5RR64; Sat, 03 Aug 2024 22:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbxr2664yz4D7h; Sat, 3 Aug 2024 22:16:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NKNLAeGZryRYaFN9kFH/4BI3Xa7o8fd/WXn7W2wq4Pw=; b=qgXtmiYzMWLLFkz62LTjx5xWYKYZ5wE/suEdquFjOoWNA6F2xLoZsas9RRgLJASIQqjmkh Zd7WZhS1liJspDJWYNK1kiadG9s4SfNfHKrmbSHuFkifO2+AyLE1bHCPrmHWfoGNrI35S9 mSdMWPO+mzVteSog5B/zPcP0eQo+pWOUktupMCT1QZd7UvfsPfCXtfiUuxluLgpDu5XCY4 pHZBhze1hMwWXARJOhpTNj2jfLLXg4IWtEpvvgW6UnazgAsb9bsoRNSMKHRkLzH1PI9Kov ZAf9ME5QiPCUl6jiNW8brkB1tHiOHZzDLMQ+hjYg1JFASEXAEIj3UBz8BrHWQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723394; a=rsa-sha256; cv=none; b=T55q5LQpkIh63DqLcQYkrLKmDceZFkchuUprVj+tZnavmH7oM0BakRG0mY8dZEUPQhrn+2 /Ss//8kTzjxcfy58z7OvsCWbgIZsdbffTJOYWYaxaI1tYCJ0gs5RUTwEGYG72R1RWaL8x4 5GL3w9plDC7KLVkjvUxRUAExg3XkpgwIQu4AZshYPyRQX+H3iejjs7GXS4cuIcqUy6JM5R 6x9alSTg9d5606EFDMMBG2yXxfYObQD+peMAU+SBsUhEp9HepoHYODT1OMiV1Fxfq2yTFm Q6HbbYEowFCae+/LDvlO2GMJ0BUwmQZfiLGCq8+SywqCUjay8S7fBRkPW98KCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NKNLAeGZryRYaFN9kFH/4BI3Xa7o8fd/WXn7W2wq4Pw=; b=km2L5ppzrbbzLH22uWLWsmULMN+4ZVM33/mwlB72E3BXgYJiHn0kK8MepMtBjgFOR9tIsQ TBu2TwVLtMxQImrzrZEdZcTBCPHsErQnTrpKGGd8z9CY2ZDupm5yQ54ZyKF3ybmcL2De8C bw/J3XgMO21snyPOvoqfPZ1XeM2CwbObNc72nbjpnHMPUFGLzOKZuUPjHDeZupI00sB0Vg L/Y+xZ/MTb7W4C6tbQU59103B90eSyQrDK+NNDFJ5oEfBkQ9l2kY9HLt6Z8xHYl4ANx5Ia kldnLir8PrUql/ezcfvyugmyhiyUJWtXnwDkDsJnjdRAf9eelMTrkqwvWf5bOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbxr25hX5zV7L; Sat, 3 Aug 2024 22:16: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 473MGYeV008387; Sat, 3 Aug 2024 22:16:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MGYbW008384; Sat, 3 Aug 2024 22:16:34 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:16:34 GMT Message-Id: <202408032216.473MGYbW008384@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: af2702c997f8 - stable/14 - tcp: drop data received after a FIN has been processed List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: af2702c997f85e9517b1538b5b645537bc2a0efc Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=af2702c997f85e9517b1538b5b645537bc2a0efc commit af2702c997f85e9517b1538b5b645537bc2a0efc Author: Michael Tuexen AuthorDate: 2024-04-18 19:50:31 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:15:51 +0000 tcp: drop data received after a FIN has been processed RFC 9293 describes the handling of data in the CLOSE-WAIT, CLOSING, LAST-ACK, and TIME-WAIT states: This should not occur since a FIN has been received from the remote side. Ignore the segment text. Therefore, implement this handling. Reviewed by: rrs, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D44746 (cherry picked from commit c9cd686bd4a039c652ed5d11019bae10828329df) --- sys/netinet/tcp_input.c | 6 ++++-- sys/netinet/tcp_stacks/bbr.c | 18 ------------------ sys/netinet/tcp_stacks/rack.c | 14 -------------- 3 files changed, 4 insertions(+), 34 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index dbc2de17785f..2894b6fcf658 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2323,9 +2323,11 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, /* * If new data are received on a connection after the - * user processes are gone, then RST the other end. + * user processes are gone, then RST the other end if + * no FIN has been processed. */ - if ((tp->t_flags & TF_CLOSED) && tlen) { + if ((tp->t_flags & TF_CLOSED) && tlen > 0 && + TCPS_HAVERCVDFIN(tp->t_state) == 0) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: %s: Received %d bytes of data " "after socket was closed, " diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index f06a35022b25..7803865af818 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -9555,15 +9555,6 @@ bbr_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { return (ret_val); } - /* - * If new data are received on a connection after the user processes - * are gone, then RST the other end. - * We call a new function now so we might continue and setup - * to reset at all data being ack'd. - */ - if ((tp->t_flags & TF_CLOSED) && tlen && - bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) - return (1); /* * If last ACK falls within this segment's sequence numbers, record * its timestamp. NOTE: 1) That the test incorporates suggestions @@ -9666,15 +9657,6 @@ bbr_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { return (ret_val); } - /* - * If new data are received on a connection after the user processes - * are gone, then RST the other end. - * We call a new function now so we might continue and setup - * to reset at all data being ack'd. - */ - if ((tp->t_flags & TF_CLOSED) && tlen && - bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) - return (1); /* * If last ACK falls within this segment's sequence numbers, record * its timestamp. NOTE: 1) That the test incorporates suggestions diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 0bc3b5588b7b..d918d9385446 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -14041,13 +14041,6 @@ rack_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, &rack->r_ctl.challenge_ack_cnt)) { return (ret_val); } - /* - * If new data are received on a connection after the user processes - * are gone, then RST the other end. - */ - if ((tp->t_flags & TF_CLOSED) && tlen && - rack_check_data_after_close(m, tp, &tlen, th, so)) - return (1); /* * If last ACK falls within this segment's sequence numbers, record * its timestamp. NOTE: 1) That the test incorporates suggestions @@ -14154,13 +14147,6 @@ rack_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, &rack->r_ctl.challenge_ack_cnt)) { return (ret_val); } - /* - * If new data are received on a connection after the user processes - * are gone, then RST the other end. - */ - if ((tp->t_flags & TF_CLOSED) && tlen && - rack_check_data_after_close(m, tp, &tlen, th, so)) - return (1); /* * If last ACK falls within this segment's sequence numbers, record * its timestamp. NOTE: 1) That the test incorporates suggestions From nobody Sat Aug 3 22:20:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbxwN03hcz5RRD6; Sat, 03 Aug 2024 22:20:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbxwM6dTGz4DWK; Sat, 3 Aug 2024 22:20:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMpOUz3VWxo1eiXIHGlg6rEuPAq2NHYirO35O/yNvaA=; b=tGaB5o4wCenEswNvlQHDzaQTKhZJCnbNEcV5v2g3tlFm1rsoGf2/cgQBuu3wvEDabb9ddV RIZtayMCFkoK8uWtOzG+jMe3Ux+Fk4JbhwflsF08WevNMu2eOdLmebkhY+noTLMSBIcg2E TVcAmDYFMaEdO1yrQ7XMnf0ZiKiDa5DMI9ERNj/NaSrDtt5jNtACgJZHT2JbbJDMB0hPMo 4N/X2xSsl1A1H1Ts1esL4589WwPhV2cRmCHf7O6R/bXu5Sxhxwg8DqKLpQx/h3znBY2Uj9 Kig+UefPf6CP3ps3PegB+/+qjndgZb/bKafTgtYd/kou1P9SKTM6NcEqsrmb2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723619; a=rsa-sha256; cv=none; b=auTpbp070GXHYOKjLGmJfjJ3B/gmF0QaBVV7+69aJKQ5gcibva1xhkkdKhUHUDBy4v26xn RnQRGLCUrpArYtm8X8SPUunWMjwGXHOyQ8MwhkyOh2KPZtrLk2c0fwePO7ywrwsqCb9gbJ N+RmVQb8d68AsI0SUy76hGBj4+qgssdRv6L+GDKFZ62stYCc1bshAfiRPOK7uiNRKT6mw4 IudAPo9HXJT7ozY1n6O7t+Exot8CiST9zjzSTossIn9VK4Ps+rmxU6OwCdjgLImg3PeORL lPRTNGb0ImrUNNtxP8G6aLeaev66JeOyCiAt/cOmiBNcdyDOlPZxlf7eX7GV4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qMpOUz3VWxo1eiXIHGlg6rEuPAq2NHYirO35O/yNvaA=; b=o19pL5CIAfZOIEEV1vEho9Y58yTdXpDcRAYsU75MCalrfdsAd63qDL3Z5WQ2cMzX73em30 GS/ksgKF/YxjHRsXEnTLQlqugMY86BlDwkEFcgW5ni0/UoG9p0qpo49pLkmE8Va4b0onzt 09t4yj+ePRKQujiDAa3QRUOkSuC7OAvTZYa1BRgb031PqtCemYE62POIryuZpG9/rf7Hc7 z1GFBy6Iq0rBy3gfNV8NolsxCp35y2rSK+9K2x1YOi+HYeL0EnU9bQ8uAlEhNso3kUMzqh mxl6UNKh5i6muPhGd2zkA0DnsdPARlJ4XNd0Qh05TyhWhVwubMD7YMlczKwhFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbxwM68lfzTcW; Sat, 3 Aug 2024 22:20: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 473MKJeH017668; Sat, 3 Aug 2024 22:20:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MKJ2I017665; Sat, 3 Aug 2024 22:20:19 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:20:19 GMT Message-Id: <202408032220.473MKJ2I017665@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: 37c9f79561c0 - stable/14 - sctp: document sctp_recvmsg as implemented List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 37c9f79561c0b83e2ad87939fad27167ae7f11db Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=37c9f79561c0b83e2ad87939fad27167ae7f11db commit 37c9f79561c0b83e2ad87939fad27167ae7f11db Author: Michael Tuexen AuthorDate: 2024-05-02 13:17:43 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:19:33 +0000 sctp: document sctp_recvmsg as implemented PR: 275990 (cherry picked from commit eee88ef45f78d7f9996a740c2a554bc6e8496114) --- lib/libc/net/sctp_recvmsg.3 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/net/sctp_recvmsg.3 b/lib/libc/net/sctp_recvmsg.3 index a5f794743f53..a529fc29110a 100644 --- a/lib/libc/net/sctp_recvmsg.3 +++ b/lib/libc/net/sctp_recvmsg.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 23, 2015 +.Dd May 2, 2024 .Dt SCTP_RECVMSG 3 .Os .Sh NAME @@ -39,8 +39,8 @@ .In netinet/sctp.h .Ft ssize_t .Fo sctp_recvmsg -.Fa "int s" "void *msg" "size_t len" "struct sockaddr * restrict from" -.Fa "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" +.Fa "int s" "void *msg" "size_t len" "struct sockaddr *from" +.Fa "socklen_t *fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" .Fc .Sh DESCRIPTION The From nobody Sat Aug 3 22:23:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbxzg4B3gz5RRhn; Sat, 03 Aug 2024 22:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbxzg3PGnz4Dj7; Sat, 3 Aug 2024 22:23:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epEoYWr75qzlJNTCBezmrz7wcFZ5DLruYsvLnqnZtEk=; b=OOGcNAEYMJO2TRDQpHpSE8t3dsYmU2H3rkiPckMSf44irjrI2Pogaai3dJELYz+M4QgVqu BBPzt67wXukZr8ckkcoEC8GChnBuyTkSoDET4GpFKps7PdqCGwtUqzfdPIqsM1EWy8EyzY YmJ/v2wfwHQ3F8VPO16zcKhNoZDHva5EN++56oY7y10rjuHpDMNGZHuZgFFC6em+WA7yUF 9QWTSmpXgyGKNl4H2YZwcOJr+fByocD2oQHvkRXZuY2sltpVm5Eo+KozOpdeIB1WlRIeYe ekNgxYlfUb8F33RmjBM+DnGX3YXmR3LQX+c4siQJnMogbjQdwIsF6gsqfHiFsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723791; a=rsa-sha256; cv=none; b=G8vS6GEP0TdzfquJiiti+BQECYDy+QU7YQ0mkvr4DKBl17cLfVOAbH2sWKoaL+YeuXHH9f rRZ+bhi3PzWFBfLeev2Y6+dnqdyEx3IGqbSqp0WfXZBmJlnJbnZVTwRguyn954nbD7tiRr QZKPLWYfcEq2Mj5PvIzVgv/ShVGRgX5rdLZdzyalVQUajZfmqqgl1XKhnO6ORyjC5+0EnH VkqqmeMYEhB0tUhAS6sJVoAh0T6a3NN8Q+MZd/MeaLXCdxN4zuWKw2RvJb7pIDHnvRusug QENLOy1ciIYRzK7LY6w5uP9yXnHCP7mHb6768RkXcsUQt23W/DVLNyoSHVdAjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=epEoYWr75qzlJNTCBezmrz7wcFZ5DLruYsvLnqnZtEk=; b=fMVKKnhQg4utM5DD1qE/eaX34iQq2hFI2VfsCY/lZ0qRyvc4NBqJWLaFR99GhL5wYIWdhV RnWdxXlr8OiljMA8ymzQn6Dex+bJF3pizQ+i8SgEQNXwKzSUtnmt7/CX7ZwLx8bo2LLqik AdtFGeyZKWOfPIwVgbDzBrgFkojSGTesDy/TZlVoMd2RM+3Z4uGEIJxe6K+yGGvhVfVACB ZUHWWEkYzx/wqo3tF0nZgL05WusfeEzsZKuJ92FoHjwsCOkj5XGVzmGoApz/VLKUPhzCxP T+pWbsLkYSYW34qLCEr0Wyjszw8+NnNEd6izn12FPcYiTLSg7elifc5K66upMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbxzg3136zSyg; Sat, 3 Aug 2024 22:23: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 473MNBhj025417; Sat, 3 Aug 2024 22:23:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MNBRs025414; Sat, 3 Aug 2024 22:23:11 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:23:11 GMT Message-Id: <202408032223.473MNBRs025414@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: 7663542fd713 - stable/14 - sctp: add missing check List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 7663542fd71312e2648d212bf74c77fff310862e Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7663542fd71312e2648d212bf74c77fff310862e commit 7663542fd71312e2648d212bf74c77fff310862e Author: Michael Tuexen AuthorDate: 2024-05-08 21:01:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:21:39 +0000 sctp: add missing check If memory allocation fails, m is NULL. Since this is possible, check for it. Reported by: Coverity Scan CID: 1086866 (cherry picked from commit 3d40cc7ab888a37a3ba085f377a057396a7d2476) --- sys/netinet/sctp_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index a8facff6b917..e0106831f06a 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6705,7 +6705,9 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, } else { m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); - SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + if (m != NULL) { + SCTP_BUF_LEN(m) = sizeof(struct sctp_paramhdr); + } } if (m != NULL) { struct sctp_paramhdr *ph; From nobody Sat Aug 3 22:23:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbxzh4tMPz5RRnM; Sat, 03 Aug 2024 22:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbxzh49RWz4F31; Sat, 3 Aug 2024 22:23:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NoEWmg0BHvrDCo5r7YeorqYLXkcC4U+lmpXAK0xegQY=; b=lCa3wwtpkZS7Rd2ZR06Gw58YDFc3x8JdJdEtBgcEUB/0gqY2cXohPumMpMGhLLLepwnV6w 8szs9ncJ6U9R2jIQh9KgYfDhqirFmQxrbg9OMzTL2qqEGpO1SFixL82JEirTXZB1Ua3qcz CyBm9eJBYFvq7SCOGLvBAJ/Kr8jlVJ8v5AXEZhFRkxiHzIPhSWbivdJmGmDwy849y5SqxQ QrnN1mdjhbcblKER1B/UUIcJ+h4tEXMWZGUxYD0YfxWfIXgFnVQGIXjgRjzK5TN237T+pK wTQblgneadMe6eXnYpqQsaPlAJzp61FXD9nAwvKA6adICzyrkwhm0qgQwPhCcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723792; a=rsa-sha256; cv=none; b=n668C/QwmULVHJ2hduojJ3Il+D75qQHOeH1hyYyHU6HeSvvU5DhmbwkZa/3cqk3zoFnJwX YOPOJ9upq/cmGHFWFIO9woW1FNbQbkMPkRaS/BOpnM/Oyk+W2iZPjOryA4frOGLhVOJren 33oj9M2h/w5G7633oA7cI1eW7/CBwk8WneB9MpuSKe3a3li/VHr6l0EKBK3lR5HU3yAegj COiER1eOXRgUGXxpXs3DVfiGLAfqE2FyFOrJQfKMHKwz6odlYoJltolv2stf4Xf4eQYJhi lwes3VLmmvLAqfItGV1dcSu3fY2zfnScIqokcbVbFJ41AD9D5r38gmqKIVfgkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NoEWmg0BHvrDCo5r7YeorqYLXkcC4U+lmpXAK0xegQY=; b=IOAG7d5kccKTpxVF7EfEr13WGwDpvZey7uF3WI2ohZUNNvnTUNtFEJcUneK4LBIOybwcM9 YgqQ2Iv6eZ2G3HYsQAfy13X+mjcjx8IY7ncah/fG24XXZGsKE/yBzNuZzeQ1yN+dK6E696 uAX0S/qK19SPNodfG1cP1/iU91aa3YxwFTdsxfA2i8VpFCa8W3Z8eUaZBrWB0rx8x+K54y wGvmClbt/2SccQ9lDjRQrXbZ965y38BIvVbsz/NB5031oxW0q003DVANwfF8s9nGwmaUz1 CmJGMwmgffQ3ORQivU1rpKBnHWU5DKnGa4b/qC+4wkqIFqMf4BNb0yPacZxFMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbxzh3mw5zV87; Sat, 3 Aug 2024 22:23: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 473MNCe6025471; Sat, 3 Aug 2024 22:23:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MNC0h025468; Sat, 3 Aug 2024 22:23:12 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:23:12 GMT Message-Id: <202408032223.473MNC0h025468@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: 1776db67c3d1 - stable/14 - sctp: fix sctp_sendall() when an mbuf chain is provided List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1776db67c3d1f7e207ac06956af2a9983b67f201 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1776db67c3d1f7e207ac06956af2a9983b67f201 commit 1776db67c3d1f7e207ac06956af2a9983b67f201 Author: Michael Tuexen AuthorDate: 2024-05-08 21:41:17 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:22:43 +0000 sctp: fix sctp_sendall() when an mbuf chain is provided In this case uio is NULL, which needs to be checked and m must be copied into the sctp_copy_all structure. Reported by: Coverity Scan CID: 1400449 (cherry picked from commit e187fa56904712cb4dac9e14c81c88821582aeb4) --- sys/netinet/sctp_output.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index e0106831f06a..c146bda95c7c 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6911,10 +6911,20 @@ static int sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, struct sctp_nonpad_sndrcvinfo *srcv) { - int ret; struct sctp_copy_all *ca; + struct mbuf *mat; + ssize_t sndlen; + int ret; - if (uio->uio_resid > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { + if (uio != NULL) { + sndlen = uio->uio_resid; + } else { + sndlen = 0; + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + sndlen += SCTP_BUF_LEN(mat); + } + } + if (sndlen > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { /* You must not be larger than the limit! */ return (EMSGSIZE); } @@ -6926,12 +6936,10 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, return (ENOMEM); } memset(ca, 0, sizeof(struct sctp_copy_all)); - ca->inp = inp; if (srcv != NULL) { memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); } - /* Serialize. */ SCTP_INP_WLOCK(inp); if ((inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) != 0) { @@ -6942,15 +6950,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, } inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; SCTP_INP_WUNLOCK(inp); - /* * take off the sendall flag, it would be bad if we failed to do * this :-0 */ ca->sndrcv.sinfo_flags &= ~SCTP_SENDALL; /* get length and mbuf chain */ - if (uio) { - ca->sndlen = uio->uio_resid; + ca->sndlen = sndlen; + if (uio != NULL) { ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); @@ -6962,20 +6969,14 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, return (ENOMEM); } } else { - /* Gather the length of the send */ - struct mbuf *mat; - - ca->sndlen = 0; - for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { - ca->sndlen += SCTP_BUF_LEN(mat); - } + ca->m = m; } ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, (void *)ca, 0, sctp_sendall_completes, inp, 1); - if (ret) { + if (ret != 0) { SCTP_INP_WLOCK(inp); inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; SCTP_INP_WUNLOCK(inp); From nobody Sat Aug 3 22:24:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby0j2q0Xz5RRg6; Sat, 03 Aug 2024 22:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby0j2BWCz4FWL; Sat, 3 Aug 2024 22:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5ntVjPeD+F/kkFuYXn/WjDSWJF7ijyDwPPLiozVvxI=; b=kxUEXwePDeYbQSxAGkM4QGJUgLqLW9RawcvAChF0cahRbalWpfFLnFxAtDZTi79KrZe+/a MEKr5ajhAhQYNCGp157ILBxFWnLfwaQcH8pPB4u6gxUJ5fe/1qI7UApSh/KLHqljpLpC84 3uka4faxdf9ka2qLDQtyQ4JjiUPSrmWBT2YuJw0jKgpHUAjfJ+lnZRHBCL+5OT/McG3EG2 3HQfcoOXWITgd4J9uKva1n124jmGQjK5NYctcwusgqtm8dV170xaXgdgvBh+LgOqIxSXsH 25YJe00AbvJMYVunY4eF/lXG846F++J9dyfHP5ixE6nIHmkH5xWdX1avamCfQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723845; a=rsa-sha256; cv=none; b=LU9O/PWuilDPMbVHk7z+wbSFt77rsmKy2ahKiynrtejKHFon0OjeAB+0W+EbB5MFZqEE2D +sqOyTvSFyiMdF2T/4xa1yLMA2GIifj/V1xHSspILY60CcholJt1bFWMIhKiN0V7yXD0g3 WYtLVX8+WUsFH6Pz8wqwyEOlX68n7w2x3Z0HSYDanyZJO7UKpzZhrVr8Yde/Gj7WCSlzhs WSZUpCp/f/ptuFUzv++l1nLE+hO5MKNdQVvU6iEht0F5COfbomLf04PwJg6VCYhIrlTbWH KVIST6wI8bbHGZwKoO/m2Jtqq4KSuHWyYyjb4680mE2XXYd4xM8sTh+z+IZvMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5ntVjPeD+F/kkFuYXn/WjDSWJF7ijyDwPPLiozVvxI=; b=wyzYT0KQXkoBDbxYCZEzHCobbiAnMxl2SzlP70oVPMNX6zAXgXZ7FR+hqfUPy6fJeWehX5 8Cy+rOU1mmmGx+H43tinrIkeqgeOmUifCTWnmTy5CinEz+s3nkHN1qAPDc9Fa/EsTrRLAn MUiOP+urcvsbzfvnED0P6aiYX/fyrr/3mtCzTiDBLAaYWf87+7KBSC1TenRSXTtBpB65dH eED1rDyDnr3RTo+20T2jOdu1FX3uoOFx/p49qRVowh8mp/HvUsFQnRbmuwbRo7GHSpTg/i X9y01Jvc1f9msbM/Ikg4yfJyfD7kWbOe1eT+tKH1F67Ro3Uz4o7/xm+EwtQ9qQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby0j1pDFzV88; Sat, 3 Aug 2024 22:24: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 473MO5rJ025729; Sat, 3 Aug 2024 22:24:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MO5VB025726; Sat, 3 Aug 2024 22:24:05 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:24:05 GMT Message-Id: <202408032224.473MO5VB025726@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: 5678f3b366c2 - stable/14 - sctp: don't provide uninitialized memory to process_chunk_drop() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 5678f3b366c28c6828d32bd758fda4d6b965aebf Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5678f3b366c28c6828d32bd758fda4d6b965aebf commit 5678f3b366c28c6828d32bd758fda4d6b965aebf Author: Michael Tuexen AuthorDate: 2024-05-08 22:17:13 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:23:37 +0000 sctp: don't provide uninitialized memory to process_chunk_drop() Right now, the code in process_chunk_drop() does not look the the corresponding fields. Therefore, no functional change intended. Reported by: Coverity Scan CID: 1472476 (cherry picked from commit 83dcc7790b11e605c32ec9a091c6bba3bc921083) --- sys/netinet/sctp_input.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index a55ef5ac1eab..0a8372a07362 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -4231,6 +4231,8 @@ sctp_handle_packet_dropped(struct sctp_pktdrop_chunk *cp, SCTP_STAT_INCR(sctps_pdrpmbda); } } else { + desc.tsn_ifany = htonl(0); + memset(desc.data_bytes, 0, SCTP_NUM_DB_TO_VERIFY); if (pktdrp_flags & SCTP_FROM_MIDDLE_BOX) { SCTP_STAT_INCR(sctps_pdrpmbct); } From nobody Sat Aug 3 22:25:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby1x0lT9z5RRwM; Sat, 03 Aug 2024 22:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby1w6r5rz4FrJ; Sat, 3 Aug 2024 22:25:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3G0aF+WucEAqPYKQYIUl9wiKh9NN1o9lw7kHIh7fyO4=; b=Fog3xMeEgTJ77ZSHQIyu2i8rFg4vvpZh5vBivCcXf/QvUJ3lUdMXkdKEbcv4vSW77RToCT n5veBL+FDHILiKix1qnvoxSH70EbT47XtJHaHw9ovkrcs1SxIiabWPafxIRWpDLiJ5Ts58 HWrbDZt3JhQpfChDyxJfCcIQTUL5xvBd3IZKPVnTxDQ1NaAMTS7/89+E1MTh6bqpzQm3nR KhkVZVdly+4JLrTN4HOjx2sf3NInsVpgZTYLU13XnI9zAHkX5/coRk/eyf4Oae0xtNOldh nnMaEPGRfSlTGqGnMQnLsOz4JhA6tWxZFopZ4oU8aK3rbql7otjWrgB5butOpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723909; a=rsa-sha256; cv=none; b=oNwoDoA5ddtPvrX2py4SSF2Cg9rWbGWd3zszXynNriv5yLz8en+yfvwkIQ0+v2oVQ0Z/OR 4g0qSpfnGk1Y3IezsL4sVGbTru+JpnrnflxjTjQcRr0DVLyS7NI/rn/MNwxHNAJ3hru+a8 ducASdwUVFPiEQJxz6S2kv6au0tOJAkwaJi3F75jLwoz7g3MCJXPSqwqXwjaGx8slwqoQG DbkX6DOfMGz38dghn5GtbPKzQ3eLRvCuoMRc9j23gweS3vHc7lGjSekmORP2Zh3xUQFw87 ro7A7gVAO/76QyuFctRSo1+GxW1TixBqk3bxm19ibUWm4CDJEgovHxQ0RtXnxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3G0aF+WucEAqPYKQYIUl9wiKh9NN1o9lw7kHIh7fyO4=; b=pOpoqt1MF8kkZsXa6PPKdt4V78bTVpkSBcugdTtiqHAy9w7W5lCYLaIsQqe5AbX/r3qYlU MEfATyVlkA/pz+N+02OMtp0XnVdgPDrB3ZXtMy4VKmG3IkWJm8ghN7FWaoBB9iUCPYYSqM P91wohPfn4J2Egxi8DEexk7XkjdjPbs2484TA8ih3r2DJL39GzXiG9OAyWrrNuh/y/73XJ Tg6lFr4QOIswyme7jnwH4nATYkhK59UiB6fPnOYkcYiguo8THkbRDSrRPBSto6DB5zRlMq J95suKer5RBA+wo0MIQb4zG4yJTpixOoVJ5EZ9kk219yzto9LPb2ZY7oRNkGdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby1w5vmkzSyh; Sat, 3 Aug 2024 22:25: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 473MP8o0026025; Sat, 3 Aug 2024 22:25:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MP8Y4026022; Sat, 3 Aug 2024 22:25:08 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:25:08 GMT Message-Id: <202408032225.473MP8Y4026022@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: df07f0ce9195 - stable/14 - sctp: minor cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: df07f0ce9195ed044374e48dcfe7a21b875ed742 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=df07f0ce9195ed044374e48dcfe7a21b875ed742 commit df07f0ce9195ed044374e48dcfe7a21b875ed742 Author: Michael Tuexen AuthorDate: 2024-05-08 22:51:09 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:24:54 +0000 sctp: minor cleanup No functional chnage intended. (cherry picked from commit 0d15140d6d3470db45d823e4f3a5ec05693b097d) --- sys/netinet/sctp_indata.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index a30fd95fef30..4c40e0de4326 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -5241,6 +5241,10 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, uint32_t mid; int need_reasm_check = 0; + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + asoc = &stcb->asoc; mid = strmin->last_mid_delivered; /* @@ -5278,11 +5282,9 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, /* deliver it to at least the delivery-q */ if (stcb->sctp_socket) { sctp_mark_non_revokable(asoc, control->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, - &stcb->sctp_socket->so_rcv, - 1, SCTP_READ_LOCK_HELD, - SCTP_SO_NOT_LOCKED); + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, 1, + SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } } else { /* Its a fragmented message */ @@ -5352,8 +5354,7 @@ sctp_kick_prsctp_reorder_queue(struct sctp_tcb *stcb, strmin->last_mid_delivered = control->mid; if (stcb->sctp_socket) { sctp_mark_non_revokable(asoc, control->sinfo_tsn); - sctp_add_to_readq(stcb->sctp_ep, stcb, - control, + sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_HELD, SCTP_SO_NOT_LOCKED); } @@ -5394,6 +5395,11 @@ sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, * it can be delivered... But for now we just dump everything on the * queue. */ + + KASSERT(stcb != NULL, ("stcb == NULL")); + SCTP_TCB_LOCK_ASSERT(stcb); + SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep); + if (!asoc->idata_supported && !ordered && control->first_frag_seen && SCTP_TSN_GT(control->fsn_included, cumtsn)) { From nobody Sat Aug 3 22:25:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby2n66chz5RRgg; Sat, 03 Aug 2024 22:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby2n5MM1z4G8B; Sat, 3 Aug 2024 22:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieLrD8SeRRuoACRPct9L5ciPwYylI8MXoSZcn32TrPk=; b=Wrm2Wpm+OXr4wa2Uf4E/Zm7wr/vF0nH2XX/s2euNvPMWXndaix4DS6RR/DvmvO5oKH8lOb GZy3pTEeCJsMrG3SUDR3wi80jpbRYMhXt2DCZIvBQMT0Dl/+S4xqTxd1Lv12RwiBkya+6d YIk6r3myigQGfBMroksE9DAVxyPCv1zyHfkpqZXH7vQF5/pMUUNBIU8Qxg1I/kw2gAzade KygtYO/tUQexLSzp3H63/stQmmUa+LPQWZqT8Ybu6QbHSRFg4EZKt/KKYZJvu7ptFOvc35 ljNt85xANnXyjoNoo9X4wGeTtFWw3OUcIKjMLoCEZB7GEnawI0JgXWtWkBeYEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722723953; a=rsa-sha256; cv=none; b=pCwZrnm8tIikqg0ptRmctqwm+ef+0LadKyYwjQ8EorR91Oxxxzt3QS0oUNnqMbxnKCkTTt JRpHHzNYXW13c+m2XtYGNKY0/Dh0GIbLrcy1h98fO4RHwMf2/ja+H0XDvkOmfXAb5j3CZx 4yGZFUhWQXRIpzZLPSwSY43qiAnRUwyPjNuZEf/tS5eBfE8BIqzpXOp0aCv/PdzTHBtPIz WmzsymA101OGApURhO2uhLzn/+L/rP0/M8agZRpbEBNwZCnu+u4bzmCUEP9h0uiHx4hAaQ 7KCxzT1V6kEm8LFBA3BQFHyeF4QIGCddTO/eU1pI4NX4CTkx2D/RRzDDsDK7qA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722723953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieLrD8SeRRuoACRPct9L5ciPwYylI8MXoSZcn32TrPk=; b=tt5mgBJE3e/1+nHN2fOXVWMJITGpCymbOsNqpHvwg6Pzz9p9O6sS2eKufgyEh7hs4+pCTy AGelwmOl/uNxTDAxdJMP4XCI35qie3YxiAPpiK8MJYK/8q1HR4Dr3HgnLgY7vuwy1HUgA7 WGHdQAGb6oYJjvZwKLAmj4dR8BoDSbSSAlWBWePIYR/PGDqBr7HK8Z96Y65xVmtxYyVgpC jDpJ8QxCmRrDLZ9fNj++IMNsl/YThbs47xPe+1M0DUy/Uktk+vKxTPchaniQPJDntVMLrU 7J0o7Xpm56KS60xQ2SGw73mPLXMAZDpZdAUj+m4BE1SheZ2xI8wsiGHAeWfi8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby2n4jB7zSyj; Sat, 3 Aug 2024 22:25:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 473MPrE5026250; Sat, 3 Aug 2024 22:25:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MPrFx026247; Sat, 3 Aug 2024 22:25:53 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:25:53 GMT Message-Id: <202408032225.473MPrFx026247@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: 53da1bf035be - stable/14 - sctp: store cookie secret change time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 53da1bf035beef155fdb5d6e93215e01dc3090fd Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=53da1bf035beef155fdb5d6e93215e01dc3090fd commit 53da1bf035beef155fdb5d6e93215e01dc3090fd Author: Michael Tuexen AuthorDate: 2024-05-10 18:09:06 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:25:22 +0000 sctp: store cookie secret change time as time_t Reported by: Coverity Scan CID: 1492349 CID: 1493281 (cherry picked from commit 9d8a3718e24c9ec1ffca6efba64aba3e308aee96) --- sys/netinet/sctp_input.c | 4 ++-- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/sctp_pcb.h | 4 ++-- sys/netinet/sctputil.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 0a8372a07362..dc31ffbc2161 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2329,7 +2329,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, } ep = &(*inp_p)->sctp_ep; /* which cookie is it? */ - if ((cookie->time_entered.tv_sec < (long)ep->time_of_secret_change) && + if ((cookie->time_entered.tv_sec < ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* it's the old cookie */ (void)sctp_hmac_m(SCTP_HMAC, @@ -2352,7 +2352,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, /* compare the received digest with the computed digest */ if (timingsafe_bcmp(calc_sig, sig, SCTP_SIGNATURE_SIZE) != 0) { /* try the old cookie? */ - if ((cookie->time_entered.tv_sec == (long)ep->time_of_secret_change) && + if ((cookie->time_entered.tv_sec == ep->time_of_secret_change) && (ep->current_secret_number != ep->last_secret_number)) { /* compute digest with old */ (void)sctp_hmac_m(SCTP_HMAC, diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index a1742b2fffca..69c492bc58df 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -2570,7 +2570,7 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id) /* Setup the initial secret */ (void)SCTP_GETTIME_TIMEVAL(&time); - m->time_of_secret_change = (unsigned int)time.tv_sec; + m->time_of_secret_change = time.tv_sec; for (i = 0; i < SCTP_NUMBER_OF_SECRETS; i++) { m->secret_key[0][i] = sctp_select_initial_TSN(m); diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index e57e13654073..5c6ead92bf9b 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -263,8 +263,8 @@ struct sctp_base_info { * access /dev/random. */ struct sctp_pcb { - unsigned int time_of_secret_change; /* number of seconds from - * timeval.tv_sec */ + time_t time_of_secret_change; /* number of seconds from + * timeval.tv_sec */ uint32_t secret_key[SCTP_HOW_MANY_SECRETS][SCTP_NUMBER_OF_SECRETS]; unsigned int size_of_a_cookie; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 19180b3cf725..e963c5cb466e 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -1944,7 +1944,7 @@ sctp_timeout_handler(void *t) type, inp, stcb, net)); SCTP_STAT_INCR(sctps_timosecret); (void)SCTP_GETTIME_TIMEVAL(&tv); - inp->sctp_ep.time_of_secret_change = (unsigned int)tv.tv_sec; + inp->sctp_ep.time_of_secret_change = tv.tv_sec; inp->sctp_ep.last_secret_number = inp->sctp_ep.current_secret_number; inp->sctp_ep.current_secret_number++; From nobody Sat Aug 3 22:26:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby3j1Qx3z5RRj9; Sat, 03 Aug 2024 22:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby3j0xl1z4GD8; Sat, 3 Aug 2024 22:26:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BtTLgtEU5hWeuJSZeHKaJ95qdZ6ihFkbMUCS2H96SY=; b=sah3MN78KhH7SnhlcYcXIbjEtWhLkmqogKKx6Z69FMYdAAiTu7t5/Vw9SNvs5cGSDEApQe 1egQSixB4kUDh78RIscuLGXi5KPnsK/S+mDYdO+vbkiXhf7C8Y+vMVURDaTnKeEn8JlZ29 NsgYkN3K9kJMYdrcgkqFz4z74kGcp0WF1fxydh0zjlOuLypvVkm/RWnu6lgRk4p9mwG4ny /9Zq3Y4n+yePz7WKN/xIG5X57UJpIp0YdC/d0GCOZsVnwwWUDf8B5IWOiSpfRqP7xo+vNi yoFsqlIXdMgRnP9W+v3YFq1JubGttGCJDtQYTpYOrndByy119Mdl2k8YUf75PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724001; a=rsa-sha256; cv=none; b=xGdyjXdYv54/Nyom1Y4dtnf/ICFirkAMYhNSg1Y8/2r1i6JjVJ7yAJ0xMd6Xx5Cwfu/8L1 yQqKovCK7QwES565tTp/DEIZbwWq7eutAfBm6tep0OgVR8gJb+FotnMyXp2lkGWHIndhrR HoPhMN5a2XIzh8Z1sJw90S2UNB18bDsrIeBDMHgC6emztZMqkf6UZPOMzVjePXIszgSzXQ FvTHEQ+f55igiB9eqSdzFX49LQdeKldKTI6WwfJN0bijyJMfNYmLHbcPp+/VpW8RYfzatX HHSnlTAwE3eZ65FGfAVUZvSPSERIqnXiQ81d6zSjmK84H7PdQvw9wp4dwnYy5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0BtTLgtEU5hWeuJSZeHKaJ95qdZ6ihFkbMUCS2H96SY=; b=R85Nholy4pYurGfhG3eVMCpaxXALSb00FcrmrPo3N/G2GG1bDIA06P9ePYOHMhyxuehBnE JLPFtrlKifQdnpg9GnEm6dJCxnzxxmQU2s9fRNlq9EeYamHy1LyMHKXnir1BaMAjrlhKZh ChU+GgheitrSlzvqDmq3vomB3tm2EUCPXXc2rZlyGXmravfGaffQkpV0zkdj9PUjGlQjHH +qmPUn7Z6/3ifvLJfH067kB6Iki16JyK45MXdwwZDw4TSH7Qz+wMWb7KTqEwSw/hoi3r8r JXBEL8Gco9WPQTEHwOEPT9jxL9jyVRTse8pxErgKuxreIiwTdHmsigs5kIRWbg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby3j0S1XzSyk; Sat, 3 Aug 2024 22:26: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 473MQeTw026473; Sat, 3 Aug 2024 22:26:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MQeZA026470; Sat, 3 Aug 2024 22:26:40 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:26:40 GMT Message-Id: <202408032226.473MQeZA026470@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: 1593585b5ab0 - stable/14 - sctp: store vtag expire time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1593585b5ab020dcca655cfbf2208e681a4bf4b6 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1593585b5ab020dcca655cfbf2208e681a4bf4b6 commit 1593585b5ab020dcca655cfbf2208e681a4bf4b6 Author: Michael Tuexen AuthorDate: 2024-05-10 18:25:04 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:26:10 +0000 sctp: store vtag expire time as time_t Reported by: Coverity Scan CID: 1492525 CID: 1493239 (cherry picked from commit 42aeb8d490fb7e8f4c9d27b3797179b861bd85e3) --- sys/netinet/sctp_pcb.c | 12 ++++++------ sys/netinet/sctp_pcb.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 69c492bc58df..b2cafdc2f81e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4541,7 +4541,7 @@ sctp_del_remote_addr(struct sctp_tcb *stcb, struct sockaddr *remaddr) } static bool -sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) +sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, time_t now) { struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; @@ -4563,7 +4563,7 @@ sctp_is_in_timewait(uint32_t tag, uint16_t lport, uint16_t rport, uint32_t now) } static void -sctp_set_vtag_block(struct sctp_timewait *vtag_block, uint32_t time, +sctp_set_vtag_block(struct sctp_timewait *vtag_block, time_t time, uint32_t tag, uint16_t lport, uint16_t rport) { vtag_block->tv_sec_at_expire = time; @@ -4578,13 +4578,13 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) struct sctpvtaghead *chain; struct sctp_tagblock *twait_block; struct timeval now; - uint32_t time; + time_t time; int i; bool set; SCTP_INP_INFO_WLOCK_ASSERT(); (void)SCTP_GETTIME_TIMEVAL(&now); - time = (uint32_t)now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); + time = now.tv_sec + SCTP_BASE_SYSCTL(sctp_vtag_time_wait); chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; set = false; LIST_FOREACH(twait_block, chain, sctp_nxt_tagblock) { @@ -4596,7 +4596,7 @@ sctp_add_vtag_to_timewait(uint32_t tag, uint16_t lport, uint16_t rport) continue; } if ((twait_block->vtag_block[i].v_tag != 0) && - (twait_block->vtag_block[i].tv_sec_at_expire < (uint32_t)now.tv_sec)) { + (twait_block->vtag_block[i].tv_sec_at_expire < now.tv_sec)) { if (set) { /* Audit expires this guy */ sctp_set_vtag_block(twait_block->vtag_block + i, 0, 0, 0, 0); @@ -6746,7 +6746,7 @@ sctp_is_vtag_good(uint32_t tag, uint16_t lport, uint16_t rport, struct timeval * return (false); } } - return (!sctp_is_in_timewait(tag, lport, rport, (uint32_t)now->tv_sec)); + return (!sctp_is_in_timewait(tag, lport, rport, now->tv_sec)); } static void diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index 5c6ead92bf9b..ade29fb3544d 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -130,7 +130,7 @@ struct sctp_block_entry { }; struct sctp_timewait { - uint32_t tv_sec_at_expire; /* the seconds from boot to expire */ + time_t tv_sec_at_expire; /* the seconds from boot to expire */ uint32_t v_tag; /* the vtag that can not be reused */ uint16_t lport; /* the local port used in vtag */ uint16_t rport; /* the remote port used in vtag */ From nobody Sat Aug 3 22:27:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby4g6Zrpz5RS3c; Sat, 03 Aug 2024 22:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby4g62Tdz4GSY; Sat, 3 Aug 2024 22:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6mxVyVv2yJx9zmkROf45fquch+pOAuTWOWlmQMm3os=; b=YpbV5mksarcrgSqOf0/d4c7ddiAYAOdRT4SjAnB/bFSgu40mNoCMqAvO4ALrLJOT8TYt4T SZb9ADEQcHVQ48uzPEq9GK2uoaZ2Oi4nlwz1CpyllFf2Rzx4yt+BUALvdZdKak3AmrHGMS 3bmoGhv3HO0Ene4ShpOlzuv4CupZafgrWyYMh/H1W5oJWDJfyHq9fuGOsDI1FuOcYl26MS WZ1yI4MjgWJ6q31374NgYdZDQO9e6ny5iM1eEcoyJZ/jrjCrIut5Drydw7Hov5xwBVi4nd fH285isVxOfXETtPYUIzJ08pDAgYAEV4sN6fwXqwYiAGXGQYVxIsh5T8fEKpYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724051; a=rsa-sha256; cv=none; b=t/JfU2xHY/ckPXMNeypVdKTfw2q1nUy5S6dcbfhWKuXhC0hkP/UnXuP5EzDoZIXH273iBV UT25DRFQsVgXTkTA6Q30wxEbiafxURyYds+Qu2rn6+zIfuSrd90Zh1ywVzHgI8Ht2PPWnA 0p1fpT7lkL+MHokkevp7dSGKBKLxB0RhbRf35g49wP8oGcgoGXVqzgP4Lw8RDpOO2p6yIB 9RR7crNvwSOsE9MIZiPzvSKpxuGgQ3khsfQ1lJSmlqD4dqfzFgUmdwcBWHirO9Oq5Q5IKR g56nFaHnFQjMWRWxXWcOcB+YrQeINuE/1FsR/b4YNKV1ZiK3vVZgnIivh0w8xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J6mxVyVv2yJx9zmkROf45fquch+pOAuTWOWlmQMm3os=; b=XNpBlr8hZEYOSTEFAMB5vNf6zY52WguDJG4tdH+DYyCNtdIeKLxQsNemk5kp/MZMk9bBCd Q8Lxp0TxTTiXB/0OHqseWxHzup6zAHC3lfBG7Z3Sbffh4eELSM5S2D3KR6EK5stcvs28fv 390nmwhuvURfy4FOvhUKLanckaWUxAbuZbwEWI2q8udVRx00T23PVzMbzPPzPpPh4/xOcV MYVR45y/ZJ4eqTgLmSTCaxUFqF9l0GCWKAAnYICTRux89NdJcG7MC7tTMS2PKVKZmvLSiy rVRSJ1BMd+DLVTBSmzG4Pq7VRoZ+4fP3xzc9TtGMeMFCtY9GYT4HVC0uf1y8Lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby4g5MZ9zVQM; Sat, 3 Aug 2024 22:27: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 473MRViP026712; Sat, 3 Aug 2024 22:27:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MRVfu026709; Sat, 3 Aug 2024 22:27:31 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:27:31 GMT Message-Id: <202408032227.473MRVfu026709@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: e1fb799d7d1a - stable/14 - sctp: store heartbeat creation time as time_t List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e1fb799d7d1a9e5122c7f55e21ae271341a63602 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e1fb799d7d1a9e5122c7f55e21ae271341a63602 commit e1fb799d7d1a9e5122c7f55e21ae271341a63602 Author: Michael Tuexen AuthorDate: 2024-05-10 18:40:15 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:27:00 +0000 sctp: store heartbeat creation time as time_t Reported by: Coverity Scan CID: 1493087 (cherry picked from commit b67716dd58b93f373523cf35373c56fcfad44b12) --- sys/netinet/sctp_header.h | 2 +- sys/netinet/sctp_output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/sctp_header.h b/sys/netinet/sctp_header.h index 9696c4e954ba..c9fd0341f83a 100644 --- a/sys/netinet/sctp_header.h +++ b/sys/netinet/sctp_header.h @@ -83,7 +83,7 @@ struct sctp_supported_addr_param { /* heartbeat info parameter */ struct sctp_heartbeat_info_param { struct sctp_paramhdr ph; - uint32_t time_value_1; + time_t time_value_1; uint32_t time_value_2; uint32_t random_value1; uint32_t random_value2; diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index c146bda95c7c..cc8d017aba16 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -11427,7 +11427,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked) /* Fill out hb parameter */ hb->heartbeat.hb_info.ph.param_type = htons(SCTP_HEARTBEAT_INFO); hb->heartbeat.hb_info.ph.param_length = htons(sizeof(struct sctp_heartbeat_info_param)); - hb->heartbeat.hb_info.time_value_1 = (uint32_t)now.tv_sec; + hb->heartbeat.hb_info.time_value_1 = now.tv_sec; hb->heartbeat.hb_info.time_value_2 = now.tv_usec; /* Did our user request this one, put it in */ hb->heartbeat.hb_info.addr_family = (uint8_t)net->ro._l_addr.sa.sa_family; From nobody Sat Aug 3 22:28:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wby5c4mcKz5RRsf; Sat, 03 Aug 2024 22:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wby5c49lcz4GtM; Sat, 3 Aug 2024 22:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dUleuJXGCt9zKFLW9rVHaquyMDXIXoNj3QhT8LL8oZo=; b=GCMDlimvQn81Leo6K0xiuADZq+9yluQEFm1MPF4x4qISUVKgGYPfCFYdgrc3ZwcVyCt0zY /psMFtMQSrs242ZEwNUmUWd+70EhTqOrcVPBo41U8d5EzS0JR6qwTcgNgb/gIyiGmOThGB qH4psREVo6/5XXxbjzsvIXgWrvd1oYRjywkzsfdnoTXiyuqHdG/pqXKKhlpErNKmfd+ws9 UrEz5EiGkuuvoIMt+8Tc8Quq99kke5OZz7elPXhSSiw/9FTHNbXHY4/rOnrcE7omAJKZU6 KKA+75rdIApX6KV7O0cBXc6SWaTfzzu+FLM4FNfYExXrOOWP9H3GL91HAjMEvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724100; a=rsa-sha256; cv=none; b=prXNkSAbbJC0f7tClcq+6XO/kZKVwMXwBi5OAyhreeN1y+64kPZV/3PnVkRL0s49fwwTpo HoiWTEopbWRyr3se4k6XkThIBP7ZB9foH24ZoO1MMRLjRCBtzczMqQsNrr4acGRhO/cZHY 1JO23qCKqDMZ1yMYkrhBPQLFvwMiOqmFhpXEAuM6G4EGg433K+PuHUWNIkHwzhv9XwfiXF 2kAqlq/3VD0fUMYexRUVy7ZLAl4+RyyfcP24Fvk4lzBSgmGn13C5nKb1K9JkUb77ef/AOU S9mgzuH25YjTy46/Iy/WfFmSdmtyNq333jBhks6rBn9oAhp4TqcbcAWyOrfazQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dUleuJXGCt9zKFLW9rVHaquyMDXIXoNj3QhT8LL8oZo=; b=xdjmxMCWRKRcp6Idr1ZjDEOfPqmMO0i3erFH/glGO8Afvu/TJ9UAjwpQJJX4TPn+KvaplF H4tmE7v6SXPwN3DmTREiLiUeGi7zkg52416DWjQnXtE1mPaVa4qTYqRB3tiiUCCf2Gd1Au jhRPPIh8k50fUQJGecP2xk1K3D6y0Ps9Uv7TOgRxfuntew1Ut7Gg1PslZPEibaTXmwSCQ0 qJ1b0RwiqMN2AMJF7vre7nvkEP0uMfTTgDi9laE1sMhl0XN5hRo5PoMYcBZqiEJtxVH2tV yiNDF+YxRrVghH6fi7pYqspjYdTeAKchjGL+eJvfv2K5BOnOd36YqgxG8w9tRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wby5c3dskzV5y; Sat, 3 Aug 2024 22:28: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 473MSK3F026937; Sat, 3 Aug 2024 22:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MSKBx026934; Sat, 3 Aug 2024 22:28:20 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:28:20 GMT Message-Id: <202408032228.473MSKBx026934@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: fc40509e72ef - stable/14 - sctp: improve heartbeat timer computation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: fc40509e72efe4f9249f48bbe48098690a709fb3 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=fc40509e72efe4f9249f48bbe48098690a709fb3 commit fc40509e72efe4f9249f48bbe48098690a709fb3 Author: Michael Tuexen AuthorDate: 2024-05-10 18:58:01 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:27:53 +0000 sctp: improve heartbeat timer computation PR: 278666 Reviewed by: Albin Hellqvist Pull Request: https://reviews.freebsd.org/D45107 (cherry picked from commit 5120ea0d8871fd5d56a8fb70117b727b9d8a4e62) --- sys/netinet/sctputil.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index e963c5cb466e..fd11a7ece5b7 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2289,19 +2289,19 @@ sctp_timer_start(int t_type, struct sctp_inpcb *inp, struct sctp_tcb *stcb, } else { to_ticks = net->RTO; } - rndval = sctp_select_initial_TSN(&inp->sctp_ep); - jitter = rndval % to_ticks; - if (to_ticks > 1) { - to_ticks >>= 1; - } - if (jitter < (UINT32_MAX - to_ticks)) { - to_ticks += jitter; - } else { - to_ticks = UINT32_MAX; - } if (!((net->dest_state & SCTP_ADDR_UNCONFIRMED) && (net->dest_state & SCTP_ADDR_REACHABLE)) && ((net->dest_state & SCTP_ADDR_PF) == 0)) { + if (to_ticks > 1) { + rndval = sctp_select_initial_TSN(&inp->sctp_ep); + jitter = rndval % to_ticks; + to_ticks >>= 1; + if (jitter < (UINT32_MAX - to_ticks)) { + to_ticks += jitter; + } else { + to_ticks = UINT32_MAX; + } + } if (net->heart_beat_delay < (UINT32_MAX - to_ticks)) { to_ticks += net->heart_beat_delay; } else { From nobody Sat Aug 3 22:32:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyB935Flz5RSdH; Sat, 03 Aug 2024 22:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyB92f7kz4HCt; Sat, 3 Aug 2024 22:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOXkTCY6HIKMaMEd+QSvXN1CMoo3XGGXAVoS+R0qSek=; b=S5BUoKQdiqOFiO8k479MyAbZ/nTRZex5piNeOFUUxCxGSHrpTB80yHZlC8NYMT4v+EBZgV 3tcfcMs3XcCexBL71QXHf5KY+BYN5Caj+q40qsepbcwCGFgE4HzllCSNGhXlWJTAQVIg+1 p7OEkeJ3OT6K+8oxQvsLiOT7soSxm90fbERlkjceqpIeMdXd25veF7yeEchimhuT+fJaCt kvibx6kOHuIfQGKPIZ3eBMPfdZEwBkYqcXumP5Ayw/H8WhU3HbXMoSx5GGiXltnB2KkFWq KiwXWckMmmIJUp4wSXaKKDMpUXFSccDa9emuuAN28TzcWFn+WSKJ8rFyoGp+RQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724337; a=rsa-sha256; cv=none; b=Y23O8rINf8VBUw/cV/8DExZmfAKwSGkdH5PGqLG9g7N69bgyHbRMFlZOWRVvPdzCOfs+e+ imwkOX0+k16vKYEQ0nU17XMQTSh7soGTLMQyM02FFRn6B+W6YI/8Qz74HHOnKaDKtPIRRw FG7OvGwFCUW+by13DC4qXeOCSbT+vyYHZU7xDYrdTwZUxAUt2LdyOtD+mp1GcHjl1zOVLn sX/w8OJ0gR1eh1QG0gYZlg0qjT1yzPLCkaBvROCqHJQwUjRO07YZDpQrfYcED8Sg2t8F5e N7fk5XHVIC6P+QDJTQsuvPYUwR5kzkFJ37B3rKAq6D838lqpW1MF17xAcSKDHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jOXkTCY6HIKMaMEd+QSvXN1CMoo3XGGXAVoS+R0qSek=; b=wRxJEtY9iaOsTSKa6ltrZf8Mc7rOJOTnIkL8tGAfK5Gkkig6B01a+sMY2BiS8CdgFFTd3n w30RDzs0+YNOxXh8+uzJIm1D5W4G9h6Ni1ADAPki4rOZMM46LcG6qtnsiccFcKrjLQ0sWl dAUJWsb4FFNwhnW+MPysHrr/UAPPN6IRBG7tyOSNbobduHVe+WWYtXlwPZkzRBGRAZb7K1 qxgaSkx565Lcm2UW+o7ou43aTcAnIUs1lG7nXvnu7HW5HnpqOXZMZqy2YfrN1aiRf+TIrJ cn62I6v88RHETy+cx1H/UpyfSZSmC6p0v3aP1eH62YI21H3VOc0nNtXAOt6OaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyB92FgCzW8j; Sat, 3 Aug 2024 22:32: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 473MWHwe041581; Sat, 3 Aug 2024 22:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MWHim041578; Sat, 3 Aug 2024 22:32:17 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:32:17 GMT Message-Id: <202408032232.473MWHim041578@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: e4a4ca83df2c - stable/14 - blackhole.4: improve man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: e4a4ca83df2c46407086fbc0cf695b4f18088f7c Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e4a4ca83df2c46407086fbc0cf695b4f18088f7c commit e4a4ca83df2c46407086fbc0cf695b4f18088f7c Author: Michael Tuexen AuthorDate: 2024-05-22 18:36:24 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:31:59 +0000 blackhole.4: improve man page Not the connection is dropped, but the incoming SYN segment. Reviewed by: concussious.bugzilla_runbox.com Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45296 (cherry picked from commit a45a9e61b498393b05f3e1e2e3e6131c7b484dc4) --- share/man/man4/blackhole.4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/blackhole.4 b/share/man/man4/blackhole.4 index 00c8e3d7a2b6..090f330a6ed8 100644 --- a/share/man/man4/blackhole.4 +++ b/share/man/man4/blackhole.4 @@ -10,7 +10,7 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.Dd November 3, 2021 +.Dd May 22, 2024 .Dt BLACKHOLE 4 .Os .Sh NAME @@ -51,7 +51,7 @@ when unexpected packets are received. .Ss TCP Normal behaviour, when a TCP SYN segment is received on a port where there is no socket accepting connections, is for the system to return -a RST segment, and drop the connection. +a RST segment, and drop the incoming SYN segment. The connecting system will see this as a .Dq Connection refused . From nobody Sat Aug 3 22:33:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyCQ1Wm3z5RSc1; Sat, 03 Aug 2024 22:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyCQ0x3Jz4Hpp; Sat, 3 Aug 2024 22:33:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zmwQW6nOClf/X4gD6MXpL+h2D5NUIQgEJ4XXMw316Eo=; b=ZtdkPpev7I4tt5GdVweKSaJfNV6mk5illUiu98WVcDRGI9yxhtJcQPC2vdwTWsf1AZ8Vxs OymWpeDKsCcV8ugGG4jl9QUKvfKo67x6VR3VzQI26ZrwDsTw7mUX4ZT3YW2dDmMBmzsgSh iXMPXP0DxO7P9K+Gxj6mHH8HFZYgzVSPVc7ptBqjHMbrAzJud4AVQIuSy27OaHitME2qwu HkdmCfz8DAp+sI7B90y+sTUcvOq6hRPc24iJgQfj9k7Fv86SdEeDPpqReOimU1B/uDvVGj nWWfo27inEEeRiJ/hQRnLYE6yQ5QNhFcoeizJTFF7zRzIhQBA8WfhYJyGrsBmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724402; a=rsa-sha256; cv=none; b=VSod3XArhuVynQAksgKbP4cKR9F272327Qgs3qu2Quv4YKrRiIL05146rxWDN2YAhPVGqn KiTs7XIWDzJYI37GQhWxdJ3Bcb1KvqylIzL+lTusXvu/dsaywiXwpty8id79CvyRDDwbRo 6zWykfAG+ciYBqmdnV3MYg4INZ+FAMTwWjFkrI8YGMTQcGinLxJ7N4MK4Iz8iZI35eJV7W Q3NgaLBpiOJWyStATg3dgG5mt/hDUY8BOHVvENoizLV9/lqrwVdMTG/Umx3SElA5q6K6Z/ BPLIXFQW3EgSxsBvft13VqiHka5IRQb4dabaGNryceBLs2ORw1K4wt7gXRpw5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zmwQW6nOClf/X4gD6MXpL+h2D5NUIQgEJ4XXMw316Eo=; b=Knq1puVgUmzfb4FmDd6vsZy3bmUS4iEGYC68v2yvKMLyErqpIURsL9OsBeK0Mteths0GAC ZpJEbOu6s5BU2Spel+biWNeigqS8xRG0W3HS+mXn01AmnNHJl7R/JtHzM1b8ZzfUpmBioP ihPGz3P1fMbEJ9wycnHVSCC3BLgP+LEQNAboSaNGLjEp4NsZVrxKeRTQYiUP6+S+6zDeP9 30NMhTFmv6RuLP7D15Tumu42unI0RL24TdwgTXPq4YujNuNP/1jjpZlhNB2KRC1r5tBKym NAEm83H47Oy1owOBDNJwgkwhKqDO+IJ9Wc3cGC9bNTguyFNu0ATQPtjtWh0//g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyCQ0QD9zWFk; Sat, 3 Aug 2024 22:33: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 473MXLIv042763; Sat, 3 Aug 2024 22:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MXL6C042760; Sat, 3 Aug 2024 22:33:21 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:33:21 GMT Message-Id: <202408032233.473MXL6C042760@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: d48fcf99c450 - stable/14 - tcp: improve inp locking in setsockopt List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: d48fcf99c4504b52f8ade5f7d47bfe67920f6e35 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d48fcf99c4504b52f8ade5f7d47bfe67920f6e35 commit d48fcf99c4504b52f8ade5f7d47bfe67920f6e35 Author: Michael Tuexen AuthorDate: 2024-05-23 20:14:27 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:32:45 +0000 tcp: improve inp locking in setsockopt Ensure that the inp is not dropped when starting a stack switch. While there, clean-up the code by using INP_WLOCK_RECHECK, which also re-assigns tp. Reviewed by: glebius Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45241 (cherry picked from commit fe136aecc2a0ae9d9cc5f78b2d1430cd33b6b7c4) --- sys/netinet/tcp_usrreq.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index f65b09f17a5f..a76a185474df 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1696,11 +1696,7 @@ tcp_ctloutput_set(struct inpcb *inp, struct sockopt *sopt) default: return (error); } - INP_WLOCK(inp); - if (inp->inp_flags & INP_DROPPED) { - INP_WUNLOCK(inp); - return (ECONNRESET); - } + INP_WLOCK_RECHECK(inp); } else if (sopt->sopt_name == TCP_FUNCTION_BLK) { /* * Protect the TCP option TCP_FUNCTION_BLK so @@ -1715,8 +1711,7 @@ tcp_ctloutput_set(struct inpcb *inp, struct sockopt *sopt) if (error) return (error); - INP_WLOCK(inp); - tp = intotcpcb(inp); + INP_WLOCK_RECHECK(inp); blk = find_and_ref_tcp_functions(&fsn); if (blk == NULL) { From nobody Sat Aug 3 22:34:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyDd4nDpz5RSmh; Sat, 03 Aug 2024 22:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyDd4Dv3z4Hp0; Sat, 3 Aug 2024 22:34:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9w41sC7p7FcWq6myO8jS9/8LdMADZ49Sd6IJq9HgPtw=; b=Lg0l/YdmUm/IddAtfZcWzIEvVtQrMUE1F7LEbJYkCKZqimAn5Q7JWDuESi6+AxUTPrLSZ0 7ooOJGJK57tfQM+giA2vg5fFfzunLxISh18Q8jSBUANo25efX9FYhIQuDRkRGQrR79zFOP 3/p2DbbvHw1aeuMIZPGpu8D5EuHMmX7tdySM7kLO1agzTThdDHJbik+tBW9Lwl/wkN8tei XNmlxvzeBjwFb8lDRhleojUFe60re0wV2SD7L/mDqqnU2Sr16ogjKrpxe1uzRiegtiCihW e5Hrg9kmZ7ErAy5TItkb7A3L8At6jfWIl/jE2uR1Oa2hW18prdd4LZ692sseQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724465; a=rsa-sha256; cv=none; b=h+2vBTGskLeog7rFDtZ8vbuy5/WmqTB91IxKFMQMwAU9ASsCvZwcV7RLW6loHcTa4diauJ 5V3r7Q8hKumq8FA1HQTpemepQ2EUQCOpqE6hUrz4B5HrxFIecyfKlK53JulKjIBzSXGVkH 5Hb4TgNWdIg4SytyEy/p6mKG/yXfyCEhtEG6/EMpXX7BmwKhkYz6l66BYsLh9VIp5cRl92 2ekDJNGs+LhZNv8p40UZqeK+NWFC9TO8874tx8x10YwGIy9DmBBr4AxUPzO8Ab2hYaleFz AXsk4AKbdkT/96L6pYFnTbCr08rcUe3hAlFkB28EsgV+uMKPSxjUeE88AdLL/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9w41sC7p7FcWq6myO8jS9/8LdMADZ49Sd6IJq9HgPtw=; b=Z54wj6NoUEd9R0J1h47uSyun9+dtu3TzJncEnYPCrMgcTidm1VB9+1fARdpC4Pxr+l4sGO uJqRbievvjWbTebmbJIDLyUhQJvomG2NDuYQlX+zfPTklbriBs+/0e5vPVrPKJDf2TDsFs 22ssC5YFMTWo1oZXx2XSM5tRCjEVj+lPD67QbUINbWO8rR5yt9P9CvMXZCQAdg+1UCauPu umnYVCpHMaz4YaQnvegyRIIowA5DN+d8o0M7IzfXcInNiVrnGkOHKVeuY0ACnyKONknwX4 UbN1ZIDKifJ+wdD9s+szkwtKeyVmDqclswyQOEv8K2PkEeM5md+5TxyCzGwB6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyDd3ljxzTD8; Sat, 3 Aug 2024 22:34: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 473MYPY0043028; Sat, 3 Aug 2024 22:34:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MYPNa043025; Sat, 3 Aug 2024 22:34:25 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:34:25 GMT Message-Id: <202408032234.473MYPNa043025@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: f0697703dd79 - stable/14 - tcp: improve blackhole 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f0697703dd7987158c0b98f89ba7d32a6a089a04 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f0697703dd7987158c0b98f89ba7d32a6a089a04 commit f0697703dd7987158c0b98f89ba7d32a6a089a04 Author: Michael Tuexen AuthorDate: 2024-05-24 04:59:13 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:33:43 +0000 tcp: improve blackhole support There are two improvements to the TCP blackhole support: (1) If net.inet.tcp.blackhole is set to 2, also sent no RST whenever a segment is received on an existing closed socket or if there is a port mismatch when using UDP encapsulation. (2) If net.inet.tcp.blackhole is set to 3, no RST segment is sent in response to incoming segments on closed sockets or in response to unexpected segments on listening sockets. Thanks to gallatin@ for suggesting such an improvement. Reviewed by: gallatin Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45304 (cherry picked from commit 02d15215cef2a28f1865e6ad5b19f18af1398b8b) --- share/man/man4/blackhole.4 | 10 +++++++--- sys/netinet/tcp_input.c | 43 +++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/share/man/man4/blackhole.4 b/share/man/man4/blackhole.4 index 090f330a6ed8..bb955fd4497d 100644 --- a/share/man/man4/blackhole.4 +++ b/share/man/man4/blackhole.4 @@ -10,7 +10,7 @@ .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" -.Dd May 22, 2024 +.Dd May 25, 2024 .Dt BLACKHOLE 4 .Os .Sh NAME @@ -21,7 +21,7 @@ MIB for manipulating behaviour in respect of refused SCTP, TCP, or UDP connectio attempts .Sh SYNOPSIS .Cd sysctl net.inet.sctp.blackhole Ns Op = Ns Brq "0 | 1 | 2" -.Cd sysctl net.inet.tcp.blackhole Ns Op = Ns Brq "0 | 1 | 2" +.Cd sysctl net.inet.tcp.blackhole Ns Op = Ns Brq "0 | 1 | 2 | 3" .Cd sysctl net.inet.tcp.blackhole_local Ns Op = Ns Brq "0 | 1" .Cd sysctl net.inet.udp.blackhole Ns Op = Ns Brq "0 | 1" .Cd sysctl net.inet.udp.blackhole_local Ns Op = Ns Brq "0 | 1" @@ -30,7 +30,8 @@ The .Nm .Xr sysctl 8 MIB is used to control system behaviour when connection requests -are received on SCTP, TCP, or UDP ports where there is no socket listening. +are received on SCTP, TCP, or UDP ports where there is no socket listening +or unexpected packets are received on listening sockets. .Pp The blackhole behaviour is useful to slow down an attacker who is port-scanning a system in an attempt to detect vulnerable services. @@ -61,6 +62,9 @@ is merely dropped, and no RST is sent, making the system appear as a blackhole. By setting the MIB value to two, any segment arriving on a closed port is dropped without returning a RST. +Setting the MIB value to three, any segment arriving on a closed port +or an unexpected segment on a listening port is dropped without sending a +RST in reply. This provides some degree of protection against stealth port scans. .Ss UDP Enabling blackhole behaviour turns off the sending diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2894b6fcf658..a45eb3201f7e 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -911,23 +911,6 @@ findpcb: log(LOG_INFO, "%s; %s: Connection attempt " "to closed port\n", s, __func__); } - /* - * When blackholing do not respond with a RST but - * completely ignore the segment and drop it. - */ - if (((V_blackhole == 1 && (thflags & TH_SYN)) || - V_blackhole == 2) && (V_blackhole_local || ( -#ifdef INET6 - isipv6 ? !in6_localaddr(&ip6->ip6_src) : -#endif -#ifdef INET - !in_localip(ip->ip_src) -#else - true -#endif - ))) - goto dropunlock; - rstreason = BANDLIM_RST_CLOSEDPORT; goto dropwithreset; } @@ -1406,15 +1389,27 @@ tfo_socket_result: return (IPPROTO_DONE); dropwithreset: + /* + * When blackholing do not respond with a RST but + * completely ignore the segment and drop it. + */ + if (((rstreason == BANDLIM_RST_OPENPORT && V_blackhole == 3) || + (rstreason == BANDLIM_RST_CLOSEDPORT && + ((V_blackhole == 1 && (thflags & TH_SYN)) || V_blackhole > 1))) && + (V_blackhole_local || ( +#ifdef INET6 + isipv6 ? !in6_localaddr(&ip6->ip6_src) : +#endif +#ifdef INET + !in_localip(ip->ip_src) +#else + true +#endif + ))) + goto dropunlock; TCP_PROBE5(receive, NULL, tp, m, tp, th); - - if (inp != NULL) { - tcp_dropwithreset(m, th, tp, tlen, rstreason); - INP_UNLOCK(inp); - } else - tcp_dropwithreset(m, th, NULL, tlen, rstreason); + tcp_dropwithreset(m, th, tp, tlen, rstreason); m = NULL; /* mbuf chain got consumed. */ - goto drop; dropunlock: if (m != NULL) From nobody Sat Aug 3 22:35:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyFT5VXBz5RScJ; Sat, 03 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyFT4nRTz4JB6; Sat, 3 Aug 2024 22: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=1722724509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MCwL4gjCLjbewp1ZZwEOO1KdEkl7CpU1v0pE717T4YY=; b=Z58/7esG0/UBgSMag1ZqmVa/kMSDz/fxcKGA7Vcsk6lPUDRlbNx6kGvjLuV3kadr8GXSuw 760SoE6Kuy0YHOItBDPhyO0OHpWnhJUoNtLnqBqA4/1jXzj+MxIfZi7FGFP5XJTvgMOdBX ALoLMxEt8NxeyYpDawdWs0nahbOxYsiUiZmztwhXHPuaqC3fN12gnU9STJjEqUEirtju5T KPDzMxRryyncSXWVGLpigDgBpW1hDYBwdA7pz6LkkFPNqIEyN5jigMs4h10WxGTEt/8Nzp 79sqxshlMPObvX9k5eQGWzpznA3k+w/WmFRC+XWBkmWHC5q7GqwW/D7IFfMOOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722724509; a=rsa-sha256; cv=none; b=AniPbe+KkcpJ4YdUWcBYvi860ukAoA/LQY87q/rK8gBe4emr16x//yXclrdWESX8Dh0S1w rRCC8SW77YuPeJtGua7qTifeR/Lzm9wdxyTW4WOLDQ/IVzLVMgnctAIRCWpb4XEvywbTfZ nwI4tX05lBWk3NJ4gKcje0fy8563i16yvbDCVvQ9wuDWvzAZj7u35Sl7zC/POMurVgc5Cx 0g16dxc6luJ+CTGp5V9TssspB0VE5bgB9jbu22GVBIQocZikXFN/T5zyZpgeMvGmuNmyIA WIZ/zyCoawJyU0lFCkG+oFg35JLVQgmgFBcdPjqQELutV0Gp1TuSwDIbF4vzQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722724509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MCwL4gjCLjbewp1ZZwEOO1KdEkl7CpU1v0pE717T4YY=; b=ZJhBxwxYROTvnUR05jmtKTu+EWnNnxtnmrtBqQknXC1H1GcwScQMe96c7ZAMeuXMBrAxdP 64TZ46PEl3JV4i1CqUnd0rpTQiwmz+TL8nDOvO4NTyAviZ+hi1N67bKR0mehqN8xFJ9rVR xLlv5/N8ZY/b50SGE1TaayIcO9jT20QQqr4VI0I3zqZA7K1l33x74ASs63DDvz23RJl4sB ZH+229bOFEN1JriezWTzVnAKLQ/EFtBlQ0nIGuVZ778wHWliOlO6UE/ldRoy/OKJT6I3RO ckrb7YIfLAHX7gXq3ZRp7zdxBi8fr837UuNk6tSnSdEIj3U5eGiI35qd27FASw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyFT4DVMzWCF; Sat, 3 Aug 2024 22: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 473MZ987043299; Sat, 3 Aug 2024 22: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 473MZ9lG043296; Sat, 3 Aug 2024 22:35:09 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:35:09 GMT Message-Id: <202408032235.473MZ9lG043296@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: 205157fafc25 - stable/14 - tcp: fix sending RST after second inp lookup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 205157fafc25f6711ef3670255f9ea328c344758 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=205157fafc25f6711ef3670255f9ea328c344758 commit 205157fafc25f6711ef3670255f9ea328c344758 Author: Michael Tuexen AuthorDate: 2024-05-25 17:46:33 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:34:38 +0000 tcp: fix sending RST after second inp lookup When we first find an inp, we set also the tp. If then a second lookup is necessary, the inp is recomputed. If this fails, the tp is not cleared, which resulted in failing KASSERT. Therefore, clear the tp when staring the inp lookup procedure. Reported by: Jenkins Fixes: 02d15215cef2 ("tcp: improve blackhole support") Sponsored by: Netflix, Inc. (cherry picked from commit df9de82f54d13aa077889349e15d9bf7794a1e6f) --- sys/netinet/tcp_input.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index a45eb3201f7e..133818b73a1d 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -829,6 +829,7 @@ tcp_input_with_port(struct mbuf **mp, int *offp, int proto, uint16_t port) ((thflags & (TH_ACK|TH_SYN)) == TH_SYN ? INPLOOKUP_RLOCKPCB : INPLOOKUP_WLOCKPCB); findpcb: + tp = NULL; #ifdef INET6 if (isipv6 && fwd_tag != NULL) { struct sockaddr_in6 *next_hop6; From nobody Sat Aug 3 22:47:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyWR4sdPz5RTNj; Sat, 03 Aug 2024 22:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyWR3z91z4Jkl; Sat, 3 Aug 2024 22:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Evwz4XfSh6Jexlg8AxIImyIJMmdNdgNO2XtQmWivWpM=; b=rG1ZHz7QK/vd6TjB7Rk/zsjLqZ9R8aIAM+3/E2fhankOIZW6okYAordo9uiQ+9rHhEAOO7 waobbeerBsaEBdDFyhQsMoB2raQOgUtWOUULRQMepkA2dW+rolLcD5VM/VYhhrgDPiFagt vEyXAg3663Os6YinVHGN7/0UaSeYmP496GV4mbeVhRvk7fhOxqdKBE6AdGNoCvsPtvzeb8 G9+9o272PE7CHT0FnFWBZatCvOAgYZlc+FVcfjm778CTJErxUVTsl/A37zCAd9aCdCkyxr 3nAB/MX3kXtd19T+brRicmZg/4P7nZVMjFG/X6aDUSiNV4HdwIVa60Y5fx0v/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725235; a=rsa-sha256; cv=none; b=IwJOFEs/XLVxXyZjqEg+AHvVG9AegDl7mLn8HqFreqk3bxJQM0Psl3DaETmFtqhsAfOY3H 32evT4a8Jf0Cr6ixeLyoeNjVhpFEKuPsUDW+wrl/LMrEG5iw3RQ6TQtu7T2UwR9AYN23fp Xc2yRlvKkE7gVr07XA091yy2hHAtSlpIa8x29KdJ3ESsVaunsjLkwmV9nTayclusFf5p6g Qnky29KeAw30wHP2GMvAlWLIZEZWTkL8JTjIvNcxyJBO6i7dVoFS3S58OEnzuLCsZAZYri nFoiYOSVql5+Xa+X1aTjMeuUGl9bPmbkLQHlxOhFIxLH1C871Lb0k2UlrkXx7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Evwz4XfSh6Jexlg8AxIImyIJMmdNdgNO2XtQmWivWpM=; b=VwrPr/uV37DCYmY63GflUwAli00OTJsW0mnaoDiZeXmsrFg6uN1FZOVQP/BLfe+qxWJT9+ K5+kRLhlx7vewWG5BBxd0bwipjquAm4Sd8CDBJnN5mgcYIB9CFRFkaFcUJWPGeaGb5a21S X6542RFICEVtDDWzw60WSl6HDFLpjJIAu9sk6jUtansKMPApjtf6LrxruvaNdZCmK8eKgr xlhvoBfvPT+e10EAGW2VP+2XmZIYeid4XgdCOWJ5xFj2hkA4SaY4CyqO/kjnQhqqil6YQo ezsPkcKMNw7Vd5bbr6tXqhKfvWwSMmZXcT4yriDEjP+jbh8PFOkN9wjBa6BbkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyWR3YXNzWCl; Sat, 3 Aug 2024 22:47: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 473MlFc4060351; Sat, 3 Aug 2024 22: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 473MlFpX060348; Sat, 3 Aug 2024 22:47:15 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:47:15 GMT Message-Id: <202408032247.473MlFpX060348@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: 808fb2711f0c - stable/14 - tcp: simplify stack switching 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: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 808fb2711f0cad41decf5b18419cb9294c5ac062 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=808fb2711f0cad41decf5b18419cb9294c5ac062 commit 808fb2711f0cad41decf5b18419cb9294c5ac062 Author: Michael Tuexen AuthorDate: 2024-06-06 06:29:05 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:45:32 +0000 tcp: simplify stack switching protocol Before this patch, a stack (tfb) accepts a tcpcb (tp), if the tp->t_state is TCPS_CLOSED or tfb->tfb_tcp_handoff_ok is not NULL and tfb->tfb_tcp_handoff_ok(tp) returns 0. After this patch, the only check is tfb->tfb_tcp_handoff_ok(tp) returns 0. tfb->tfb_tcp_handoff_ok must always be provided. For existing TCP stacks (FreeBSD, RACK and BBR) there is no functional change. However, the logic is simpler. Reviewed by: lstewart, peter_lei_ieee_.org, rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45253 (cherry picked from commit 86c9325d341fc3f39543bcfaf7c3bb3ceeacbe5d) --- share/man/man9/tcp_functions.9 | 45 ++++++++++++++---------------------------- sys/netinet/tcp_subr.c | 12 +++++------ sys/netinet/tcp_usrreq.c | 27 ++++++------------------- sys/netinet/tcp_var.h | 11 ++++------- 4 files changed, 30 insertions(+), 65 deletions(-) diff --git a/share/man/man9/tcp_functions.9 b/share/man/man9/tcp_functions.9 index eb9b299eae9e..1e0616e03a9f 100644 --- a/share/man/man9/tcp_functions.9 +++ b/share/man/man9/tcp_functions.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 10, 2017 +.Dd June 6, 2024 .Dt TCP_FUNCTIONS 9 .Os .Sh NAME @@ -176,9 +176,10 @@ struct tcp_function_block { uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); - /* Optional functions */ + /* Optional function */ void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); - void (*tfb_tcp_handoff_ok)(struct tcpcb *); + /* Mandatory function */ + int (*tfb_tcp_handoff_ok)(struct tcpcb *); /* System use */ volatile uint32_t tfb_refcnt; uint32_t tfb_flags; @@ -261,37 +262,21 @@ However, care must be taken to ensure the retransmit timer leaves the TCP control block in a valid state for the remainder of the retransmit timer logic. .Pp -A user may select a new TCP stack before calling -.Xr connect 2 -or -.Xr listen 2 . -Optionally, a TCP stack may also allow a user to begin using the TCP stack for -a connection that is in a later state by setting a non-NULL function pointer in -the +A user may select a new TCP stack before calling at any time. +Therefore, the function pointer .Va tfb_tcp_handoff_ok -field. -If this field is non-NULL and a user attempts to select that TCP stack after -calling -.Xr connect 2 -or -.Xr listen 2 -for that socket, the kernel will call the function pointed to by the +field must be non-NULL. +If a user attempts to select that TCP stack, the kernel will call the function +pointed to by the .Va tfb_tcp_handoff_ok field. The function should return 0 if the user is allowed to switch the socket to use -the TCP stack. -Otherwise, the function should return an error code, which will be returned to -the user. -If the -.Va tfb_tcp_handoff_ok -field is -.Dv NULL -and a user attempts to select the TCP stack after calling -.Xr connect 2 -or -.Xr listen 2 -for that socket, the operation will fail and the kernel will return -.Er EINVAL . +the TCP stack. In this case, the kernel will call the function pointed to by +.Va tfb_tcp_fb_init +if this function pointer is non-NULL and finally perform the stack switch. +If the user is not allowed to switch the socket, the function should undo any +changes it made to the connection state configuration and return an error code, +which will be returned to the user. .Pp The .Va tfb_refcnt diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 0ba35ea13130..afa2dc2a3a95 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -559,8 +559,7 @@ tcp_switch_back_to_default(struct tcpcb *tp) tfb = NULL; } /* Does the stack accept this connection? */ - if (tfb != NULL && tfb->tfb_tcp_handoff_ok != NULL && - (*tfb->tfb_tcp_handoff_ok)(tp)) { + if (tfb != NULL && (*tfb->tfb_tcp_handoff_ok)(tp)) { refcount_release(&tfb->tfb_refcnt); tfb = NULL; } @@ -594,11 +593,9 @@ tcp_switch_back_to_default(struct tcpcb *tp) /* there always should be a default */ panic("Can't refer to tcp_def_funcblk"); } - if (tfb->tfb_tcp_handoff_ok != NULL) { - if ((*tfb->tfb_tcp_handoff_ok) (tp)) { - /* The default stack cannot say no */ - panic("Default stack rejects a new session?"); - } + if ((*tfb->tfb_tcp_handoff_ok)(tp)) { + /* The default stack cannot say no */ + panic("Default stack rejects a new session?"); } if (tfb->tfb_tcp_fb_init != NULL && (*tfb->tfb_tcp_fb_init)(tp, &ptr)) { @@ -1229,6 +1226,7 @@ register_tcp_functions_as_names(struct tcp_function_block *blk, int wait, if ((blk->tfb_tcp_output == NULL) || (blk->tfb_tcp_do_segment == NULL) || (blk->tfb_tcp_ctloutput == NULL) || + (blk->tfb_tcp_handoff_ok == NULL) || (strlen(blk->tfb_tcp_block_name) == 0)) { /* * These functions are required and you diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index a76a185474df..4e754965487b 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1724,32 +1724,17 @@ tcp_ctloutput_set(struct inpcb *inp, struct sockopt *sopt) INP_WUNLOCK(inp); return (0); } - if (tp->t_state != TCPS_CLOSED) { - /* - * The user has advanced the state - * past the initial point, we may not - * be able to switch. - */ - if (blk->tfb_tcp_handoff_ok != NULL) { - /* - * Does the stack provide a - * query mechanism, if so it may - * still be possible? - */ - error = (*blk->tfb_tcp_handoff_ok)(tp); - } else - error = EINVAL; - if (error) { - refcount_release(&blk->tfb_refcnt); - INP_WUNLOCK(inp); - return(error); - } - } if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { refcount_release(&blk->tfb_refcnt); INP_WUNLOCK(inp); return (ENOENT); } + error = (*blk->tfb_tcp_handoff_ok)(tp); + if (error) { + refcount_release(&blk->tfb_refcnt); + INP_WUNLOCK(inp); + return (error); + } /* * Ensure the new stack takes ownership with a * clean slate on peak rate threshold. diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 1dc40c790b3e..b8278bbf2644 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -548,13 +548,10 @@ typedef enum { * stop_all function that loops through and calls * tcp_timer_stop() with each of your defined timers. * - * Adding a tfb_tcp_handoff_ok function allows the socket - * option to change stacks to query you even if the - * connection is in a later stage. You return 0 to - * say you can take over and run your stack, you return - * non-zero (an error number) to say no you can't. - * If the function is undefined you can only change - * in the early states (before connect or listen). + * tfb_tcp_handoff_ok is a mandatory function allowing + * to query a stack, if it can take over a tcpcb. + * You return 0 to say you can take over and run your stack, + * you return non-zero (an error number) to say no you can't. * * tfb_tcp_fb_init is used to allow the new stack to * setup its control block. Among the things it must From nobody Sat Aug 3 22:49:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyYh3PTQz5RTtp; Sat, 03 Aug 2024 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyYh2svCz4KGr; Sat, 3 Aug 2024 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c+HQKXqMU4JP4RuEz//xs7x/CqgKvSGSqC2hgyA1KgE=; b=mH+o7ymRK08CENNqvDeRC/lYO16tiPEzgme+5SXoO/bzIPEGYpFUSChqvwgkp0q9FinH6s e1Yix0ye5s/0LDkk6gxhtmakjqBwFlkGVp0COmCAKtQlizSOVpXTTL2y7dkJ8cvqmryIsZ Oi8VAf7z8/Xp/g3celcCdJPHw5expvyqR7gtMxlA1L4Wno3KQoNFfpNUJklM2/NV84wR/M ADT7U6vqBZL5nyd3DhKWYQUPSyrTtgizq1VOzuXf6T5sxhFPHbh4aMcR3aCmHrUKGD0cgV bljYAD7VQ+EFhOpFjnEYkDh21vfUbt47/lrWNFTe/nLWJ7BPZauEWjhRHPm+zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725352; a=rsa-sha256; cv=none; b=O3n+vJzrAUR8QQIVmTgsVLwAnqlR9HgkRhkQ5QGGYjiE0jWYgZUqMZXIgUlL5+nln8rxqX l3kQ6KG5a59X92q2lwpy35zNqrVE4z7hTcpl8n170l1KHgEz3Epyp8080MmxZoi4MwlOyW soiYoTu/bJXtRo/GCUlJRL4yEskoRMKryyqctPaMstaucdpYG1P7qWNOyzAY8sYVW/BHrE 3fuQZ/zhF5VgOonr58au0PKbxQOSOQPgZO8YMXRWoSLBHPke97xe6FImhIm9B36+0qzEi2 Mrs7y7QeeL65yNiMsly05ahzF/7QEJJt0qAuE8b08CPrU8KDoQj69lXPJjBv9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=c+HQKXqMU4JP4RuEz//xs7x/CqgKvSGSqC2hgyA1KgE=; b=qnzrsNee0baDkKf0ctfsvrNziolQXG0KRZD7wjXO4niea0TuUbfmqG86C0fDfBm4BR9sZH vxa6CCtsa4gwp4AWIIAH1wc6bBgoEtjc/16VyAZEV2FBrVgB1PLlEpAbysA1pVXSxYKx78 iug6KQR368P2Fp7pzW0pcgkVPsaCoLhqKM4o0sPqLACtHFL/oAetjjFoG1KC/cjJRpac3s WnygSCS5B4nXCMUD7E+YVkgv7bjDcZLSDYV8MP9qtkksM7me88Tq8tf/B62NmjYkRDjcTp 29ZscGMKVCEkGNAhpcOO/LvfZGAy3RfDIzAYMFZn5Lr49IL9nn2C9iYcDxhMGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyYh2LXLzWJb; Sat, 3 Aug 2024 22:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 473MnCpD060761; Sat, 3 Aug 2024 22:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MnCGx060758; Sat, 3 Aug 2024 22:49:12 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:49:12 GMT Message-Id: <202408032249.473MnCGx060758@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: 90ddea70e0b4 - stable/14 - lo: update man page since SCTP checksum offloading is supported List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 90ddea70e0b493300181dc0f6190ff0497cc7b77 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=90ddea70e0b493300181dc0f6190ff0497cc7b77 commit 90ddea70e0b493300181dc0f6190ff0497cc7b77 Author: Michael Tuexen AuthorDate: 2024-06-23 11:27:54 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:48:53 +0000 lo: update man page since SCTP checksum offloading is supported The loopback interface supports SCTP checksum offloading in addition to TCP and UDP. Reviewed by: gbe Differential Revision: https://reviews.freebsd.org/D45698 (cherry picked from commit 60117f9ee58e202be55a8af5bb6b6c768e7a940e) --- share/man/man4/lo.4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man4/lo.4 b/share/man/man4/lo.4 index 7bc806e5a005..f1ac67c7d7db 100644 --- a/share/man/man4/lo.4 +++ b/share/man/man4/lo.4 @@ -29,7 +29,7 @@ .\" .\" @(#)lo.4 8.1 (Berkeley) 6/5/93 .\" -.Dd January 25, 2012 +.Dd June 23, 2024 .Dt LO 4 .Os .Sh NAME @@ -57,11 +57,11 @@ be configured first unless no hardware interfaces exist. .Pp If the transmit checksum offload capability flag is enabled on a loopback -interface, checksums will not be generated by IP, UDP, or TCP for packets +interface, checksums will not be generated by IP, UDP, TCP, or SCTP for packets sent on the interface. .Pp If the receive checksum offload capability flag is enabled on a loopback -interface, checksums will not be validated by IP, UDP, or TCP for packets +interface, checksums will not be validated by IP, UDP, TCP, or SCTP for packets received on the interface. .Pp By default, both receive and transmit checksum flags will be enabled, in From nobody Sat Aug 3 22:50:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyZl0dNvz5RTmD; Sat, 03 Aug 2024 22:50:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyZk5Sctz4KTY; Sat, 3 Aug 2024 22:50:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGsoPWdhimxm2UKJsVvegJL094s+4mknsCjPfqblGs0=; b=RkH/yfuHdQit3gqeEY42XHyOKijiWk9G1RzdiDHfVgDSYjQmi+HD9dCehhomTZUJeGz3ey iQJ9B7+9kV3AduxRE0pCS3XmXLsegTVFr7NPSXx8oZdFRJ65wA6ZN5EALVXO5pGxCsc3hC 61n/shasvIfLARlicvi9ywyC0pVgaLGwDArfywkKUuwAkuz7CtSL1u/31/ciS2ptG78snL lX0OBnqWVslv6kX6f52Dd3NEUmtYhrJWim+fjmo15NHedXrDy3gOt6Reow+j7fWgGNlPvQ EDVgdz7PNOlFdiU6tM4TN4jtpS8qBcbd2WzyE51JGyrlK+W19M329TDpWXVdJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725406; a=rsa-sha256; cv=none; b=dZE2dBkcnSWSAz9Jslc7Y7xo7YzsPK/onHSkZC+pfcHgi78Crga7GkXmZD7ShQEx3r4A8N REr++2gkHo4cMjBIdN+VauAE8WYdVGZXlzGoiypWjA8+pQLGayd8yV/QezTcgWP9eugXqR rdnpUAKmMdmxNCau5SoYGkxVI834/P3uhQlL7RIub64i8JTMm6RL1R/RulmC8PFznSTzmR CUjP2Z973ZOIfUsuzPQkNtpwBKUn1VYXhBZZuFt8algNIegwf7IwroQLxPDASmMzEznp8J jqu4I/K+/QgT2EwkGDgbJIo9URtnomtRG+K0s98dKGS65e4ni8CQWwZUoBijQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YGsoPWdhimxm2UKJsVvegJL094s+4mknsCjPfqblGs0=; b=e9IcUhvDDT+kbJAgWKzBJLapn+QlVln0iunAfne4w651hiBVFb6sts8IPe4629GYx5ip5J +XmYoJDCS+s1DCHHSsXwjmkQa+5YWV9zC3nx9oZIyxH/435qcg/pm+S3ibnv36CM98Fslf A2A6shaoHuVJiazwtqYIXpTBdFYwwdBlEcW/D6qy703N7mtnq8g8gkDwQu2IXnc9pL3FGm kNK8uT0MCwH18Ae5Z38w5AGOEntG/5pvWcrkX/i4Xgzd6JofUxATM5yPkMfXSZAXTRcDji J+6sagyMyvRI9XLymyoom+KPw4KKsAsq8E25K7mX+EbVbxV1Z6B37/kPRCVZNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyZk43YFzWPV; Sat, 3 Aug 2024 22:50: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 473Mo6XB064061; Sat, 3 Aug 2024 22:50:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473Mo6Oa064056; Sat, 3 Aug 2024 22:50:06 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:50:06 GMT Message-Id: <202408032250.473Mo6Oa064056@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: 5632dd45cc10 - stable/14 - tcp: improve error handling in syncache_socket() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 5632dd45cc10ec75f9ba679b9b985c82b7a40267 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=5632dd45cc10ec75f9ba679b9b985c82b7a40267 commit 5632dd45cc10ec75f9ba679b9b985c82b7a40267 Author: Michael Tuexen AuthorDate: 2024-06-27 05:25:15 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:49:33 +0000 tcp: improve error handling in syncache_socket() If syncache_socket() fails after calling tcp_newtcpcb(), the resources allocated in tcp_newtcpcb() needs to be freed. Just call tcp_discardcb() to do this. Thanks to jtl for making me aware of the issue and proposing a fix. Reviewed by: glebius, jtl, rscheff MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45749 (cherry picked from commit 3703e1a73e0e0367c04f47f793e46495e46e647b) --- sys/netinet/tcp_syncache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 20c77930556e..21dfe8dd123e 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1050,6 +1050,7 @@ allocfail: return (NULL); abort: + tcp_discardcb(tp); in_pcbfree(inp); sodealloc(so); if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { From nobody Sat Aug 3 22:50:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbybY1ghJz5RTxh; Sat, 03 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbybY1CJFz4KvS; Sat, 3 Aug 2024 22:50:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yxTrU+jkr3zp7dknNBEAsMMvna86MLO2Pm7lJ26xQwk=; b=BBN3MS3hOHnlM0ygx0fGL/KCagueMbWOCAFsNHTOx7RTyfCO1YEUDoxA2JxyLh/vvVVOR+ hEf8egzLeJcnNiGfq+KP86K6e3DIrbKWAmVy6ViApjqiAwam+Sl5jEAMi4eZ/F6W2qhWku J5bRHSuQsY5MxZPHnM2w8SoPKRdFjrXhdg/LuEG5d8PT5kArDyP78O6fd1R0h0gYcv8GH3 fgqWFUdkI68jmZUEKQFGKJG+8jJGqHFEtMZMZj8mPWY3O4DPuOtCd5OZmiVoItrfN22Iju FC/X/XZwSxv3i/aKWikQlp8h64/tI9nGnf7JFxUG+83J69KO6T9UUs75Qmmx+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725449; a=rsa-sha256; cv=none; b=ytrWa6XDD2J2c1j1r0sA7lFksAx48nEgaSBAER1ZXnSSdLN6q0k7VM65Kplj4rGSdl63Dq kWMFf0E2CYnnMzM1Xk/WhhvyHnoJFkJzszZtDiA9r4oXjt246qsv8KFQE1ZDVQDGVGw+26 au2J6fyF7AADCdCA6+bJpE5pA9aZisVPag9EgUGlmbhuji/80f/GJxTOvKtsh7E9gOU6fB wiyHCe6ZOMNkZlJeUFmXazPiFhPU63uMG0vPyp0T/rZDq37TmwiXFzX5vDL9i0cfelc0o0 2MCTN3yMf17VcRqEG9DgOdNGo3aTwsmD9AsmNt2JZqsxiNb0B9nq+yaguNG8iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yxTrU+jkr3zp7dknNBEAsMMvna86MLO2Pm7lJ26xQwk=; b=S9YtmS8dfbSXpxM5G1okggCdTKQ3udUxAtcnOkTtBb3l+AFdRcfC4FMriFTdHHF4gXFWNv VNqxT7ALIDDIoHCXcKekA1zIQk78Y7esLeAjydfWOjUA1Upod1svlB/2GG45Z3n68UsSNZ V1d2HoCA1QYwJe+Uhz5b8MwohtrsB4JmWm8SV/rKEWldR84BNhLzIaftm3GnyJ0a47qYsx bTawWwsNyra+UTzCwzANkB9XApsMnwe7zWF9l2B9qM6bjG0Ijw++BSE0zcbzv3MlawJcS7 a9rJowuLerWVtZ8Z3nnCFlJ4C7FO2Ax6X5OMadG0N/aCqebUwZ67XG3oVVmW1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbybY0qKyzWM5; Sat, 3 Aug 2024 22:50: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 473MonLq072132; Sat, 3 Aug 2024 22:50:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MonQo072129; Sat, 3 Aug 2024 22:50:49 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:50:49 GMT Message-Id: <202408032250.473MonQo072129@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: d02a9ef1f03a - stable/14 - tcp: improve failure handling in tcp_newtcpcb() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: d02a9ef1f03aaa5fd6cc7c27ba1facdf997f0a67 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=d02a9ef1f03aaa5fd6cc7c27ba1facdf997f0a67 commit d02a9ef1f03aaa5fd6cc7c27ba1facdf997f0a67 Author: Michael Tuexen AuthorDate: 2024-06-27 06:26:34 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:50:22 +0000 tcp: improve failure handling in tcp_newtcpcb() In case of a failure of tcp_newtcpcb, where NULL is returned, * call CC_ALGO(tp)->cb_destroy, after CC_ALGO(tp)->cb_init was called. * call khelp_destroy_osd(), after khelp_init_osd() was called. Reviewed by: glebius, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45753 (cherry picked from commit 14fee5324a9b76fff6e8aad266600eefab3ef335) --- sys/netinet/tcp_subr.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index afa2dc2a3a95..8785963cc7d0 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2256,6 +2256,10 @@ tcp_newtcpcb(struct inpcb *inp) #ifdef TCP_HHOOK if (khelp_init_osd(HELPER_CLASS_TCP, &tp->t_osd)) { + if (CC_ALGO(tp)->cb_destroy != NULL) + CC_ALGO(tp)->cb_destroy(&tp->t_ccv); + CC_DATA(tp) = NULL; + cc_detach(tp); if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); @@ -2332,6 +2336,13 @@ tcp_newtcpcb(struct inpcb *inp) tp->t_pacing_rate = -1; if (tp->t_fb->tfb_tcp_fb_init) { if ((*tp->t_fb->tfb_tcp_fb_init)(tp, &tp->t_fb_ptr)) { + if (CC_ALGO(tp)->cb_destroy != NULL) + CC_ALGO(tp)->cb_destroy(&tp->t_ccv); + CC_DATA(tp) = NULL; + cc_detach(tp); +#ifdef TCP_HHOOK + khelp_destroy_osd(&tp->t_osd); +#endif refcount_release(&tp->t_fb->tfb_refcnt); return (NULL); } From nobody Sat Aug 3 22:51:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbych0xGjz5RTr1; Sat, 03 Aug 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbycg5ZyTz4L49; Sat, 3 Aug 2024 22: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=1722725507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsfX2SKPBOez9pcjN6CnowrUTufRkkpt6goTuko2/oU=; b=ZbK2kPwGERsz0McmJLBBv6D+1utc5yPX7wDJnWnt8V8fpvu0ySOLs2Ug1RyFaC/HFYGRrs yTbB434FudFURrTi533pWE26lAPPsds5sbjdTYo54X4eP2ettr2KWIDILV6NTuPgpj8qbH Rs3GJAyMNx1MpBKp3xs0Dr90AAuLw8iUhAIx3nxtSn5JlltXKCfxCjBVhmyi1roaGqYfH2 4czeCyxPtoGer5nnIJNPf0pFvDSrZodZwklQvCWGivEWM/rprk4FAkVv7sl4afo09fWCXY 9PtERMroYGUkaPc0ZmyyNp4vbonAuM5lldSCLOXc5d3rxa6P3b6dfF0UUexUgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725507; a=rsa-sha256; cv=none; b=RTMouPkNuJampds8HqleA6bMpRQJ0XimaWnblolc5BIcOJ25gGvhvbAEQP0Tcmp1XPdfjQ YO3dLDIQp9dM+Fsgg98KmMRL0EdnIZPNnqao6cBTaHJAo2e0PZMEQlR7evlvWO44T30Add UwKxn1JJ1W75cktUjCTNN762XXTNjlDiy1FMorPP5o25zHMWUFMagrcBaa/qwlSlkfiY+o gGZcKBLwWDckR0zO3aNgyzE68BUkK+GVoLhTXeq7pTlr7wMCigLKhU7E/hpbEkqRqlV4Iv 7/PFwNB+WE50VocE1Plq4byIX7vQzUAMj673NMCoZ3HByB0tLfiy5FljDYGdlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsfX2SKPBOez9pcjN6CnowrUTufRkkpt6goTuko2/oU=; b=bLIOdRfsQrIspJC0Ws7wDjExjXffDOXozgmggnlvsWBW6p+DtuPPuXY0WpzqNO8HMvt2lv L9sQMVfLQzvilkeBdb4gGu+MJijeUQJT1eHvs+djQ2my1fE0C9DbnqKBPcYEfCAyBLKiHl HVbapQ6DP8lUtltfEgvubpMEWdloh6WCZZssOCOBrMzmiuOnNGxFhOtCJWvY4dGfIglQLb Bcsxy09iTwPeoBe72/zMazYDFqRt96JhOVUH17yBSqVZEUZZ84IqF4IEaf7n2ofspFi37B ErIDegavLAWh/oiXY2NagK1LR/Bl4wYCXF0cLdIgBiB7SiuvPVk9xSAfPI6Dcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbycg4KZVzWkd; Sat, 3 Aug 2024 22: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 473Mpl7a073399; Sat, 3 Aug 2024 22: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 473Mpl2F073396; Sat, 3 Aug 2024 22:51:47 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:51:47 GMT Message-Id: <202408032251.473Mpl2F073396@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: 94508d2fe471 - stable/14 - tcp: minor cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 94508d2fe471bb30520799843e47309f08cd90f9 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=94508d2fe471bb30520799843e47309f08cd90f9 commit 94508d2fe471bb30520799843e47309f08cd90f9 Author: Michael Tuexen AuthorDate: 2024-06-29 09:06:35 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:51:19 +0000 tcp: minor cleanup Fix two KASSERTs to catch the condition they are intended to, add two asserts to ensure that the appropriate locking is in place and fix some things related to style. No functional change intended. Sponsored by: Netflix, Inc. (cherry picked from commit 811d831050d172a39c714a3f676722cf9a496a6f) --- sys/netinet/tcp_subr.c | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8785963cc7d0..8ae9018f1e5d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -437,23 +437,25 @@ static struct tcp_function_block * find_tcp_functions_locked(struct tcp_function_set *fs) { struct tcp_function *f; - struct tcp_function_block *blk=NULL; + struct tcp_function_block *blk = NULL; + rw_assert(&tcp_function_lock, RA_LOCKED); TAILQ_FOREACH(f, &t_functions, tf_next) { if (strcmp(f->tf_name, fs->function_set_name) == 0) { blk = f->tf_fb; break; } } - return(blk); + return (blk); } static struct tcp_function_block * find_tcp_fb_locked(struct tcp_function_block *blk, struct tcp_function **s) { - struct tcp_function_block *rblk=NULL; + struct tcp_function_block *rblk = NULL; struct tcp_function *f; + rw_assert(&tcp_function_lock, RA_LOCKED); TAILQ_FOREACH(f, &t_functions, tf_next) { if (f->tf_fb == blk) { rblk = blk; @@ -476,7 +478,7 @@ find_and_ref_tcp_functions(struct tcp_function_set *fs) if (blk) refcount_acquire(&blk->tfb_refcnt); rw_runlock(&tcp_function_lock); - return(blk); + return (blk); } struct tcp_function_block * @@ -489,7 +491,7 @@ find_and_ref_tcp_fb(struct tcp_function_block *blk) if (rblk) refcount_acquire(&rblk->tfb_refcnt); rw_runlock(&tcp_function_lock); - return(rblk); + return (rblk); } /* Find a matching alias for the given tcp_function_block. */ @@ -690,7 +692,7 @@ out: static int sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) { - int error=ENOENT; + int error = ENOENT; struct tcp_function_set fs; struct tcp_function_block *blk; @@ -708,7 +710,7 @@ sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) /* Check for error or no change */ if (error != 0 || req->newptr == NULL) - return(error); + return (error); rw_wlock(&tcp_function_lock); blk = find_tcp_functions_locked(&fs); @@ -1217,9 +1219,9 @@ register_tcp_functions_as_names(struct tcp_function_block *blk, int wait, struct tcp_function_set fs; int error, i; - KASSERT(names != NULL && *num_names > 0, - ("%s: Called with 0-length name list", __func__)); KASSERT(names != NULL, ("%s: Called with NULL name list", __func__)); + KASSERT(*num_names > 0, + ("%s: Called with non-positive length of name list", __func__)); KASSERT(rw_initialized(&tcp_function_lock), ("%s: called too early", __func__)); @@ -1266,7 +1268,7 @@ register_tcp_functions_as_names(struct tcp_function_block *blk, int wait, tcp_fb_cnt++; rw_wunlock(&tcp_function_lock); } - return(0); + return (0); cleanup: /* @@ -4378,7 +4380,7 @@ tcp_req_check_for_stale_entries(struct tcpcb *tp, uint64_t ts, int rm_oldest) uint64_t time_delta, oldest_delta; int i, oldest, oldest_set = 0, cnt_rm = 0; - for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0; i < MAX_TCP_TRK_REQ; i++) { ent = &tp->t_tcpreq_info[i]; if (ent->flags != TCP_TRK_TRACK_FLG_USED) { /* @@ -4421,15 +4423,15 @@ tcp_req_check_for_stale_entries(struct tcpcb *tp, uint64_t ts, int rm_oldest) int tcp_req_check_for_comp(struct tcpcb *tp, tcp_seq ack_point) { - int i, ret=0; + int i, ret = 0; struct tcp_sendfile_track *ent; /* Clean up any old closed end requests that are now completed */ if (tp->t_tcpreq_req == 0) - return(0); + return (0); if (tp->t_tcpreq_closed == 0) - return(0); - for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + return (0); + for (i = 0; i < MAX_TCP_TRK_REQ; i++) { ent = &tp->t_tcpreq_info[i]; /* Skip empty ones */ if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) @@ -4452,11 +4454,11 @@ int tcp_req_is_entry_comp(struct tcpcb *tp, struct tcp_sendfile_track *ent, tcp_seq ack_point) { if (tp->t_tcpreq_req == 0) - return(-1); + return (-1); if (tp->t_tcpreq_closed == 0) - return(-1); + return (-1); if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) - return(-1); + return (-1); if (SEQ_GEQ(ack_point, ent->end_seq)) { return (1); } @@ -4478,7 +4480,7 @@ tcp_req_find_a_req_that_is_completed_by(struct tcpcb *tp, tcp_seq th_ack, int *i /* none open */ return (NULL); } - for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0; i < MAX_TCP_TRK_REQ; i++) { ent = &tp->t_tcpreq_info[i]; if (ent->flags == TCP_TRK_TRACK_FLG_EMPTY) continue; @@ -4502,7 +4504,7 @@ tcp_req_find_req_for_seq(struct tcpcb *tp, tcp_seq seq) /* none open */ return (NULL); } - for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0; i < MAX_TCP_TRK_REQ; i++) { ent = &tp->t_tcpreq_info[i]; tcp_req_log_req_info(tp, ent, i, TCP_TRK_REQ_LOG_SEARCH, (uint64_t)seq, 0); @@ -4550,7 +4552,7 @@ tcp_req_alloc_req_full(struct tcpcb *tp, struct tcp_snd_req *req, uint64_t ts, i (tp->t_tcpreq_req >= MAX_TCP_TRK_REQ)); /* Check to see if this is a duplicate of one not started */ if (tp->t_tcpreq_req) { - for(i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { fil = &tp->t_tcpreq_info[i]; if (fil->flags != TCP_TRK_TRACK_FLG_USED) continue; @@ -4565,20 +4567,20 @@ tcp_req_alloc_req_full(struct tcpcb *tp, struct tcp_snd_req *req, uint64_t ts, i * a 4xx of some sort and its going to age * out, lets not duplicate it. */ - return(fil); + return (fil); } } } /* Ok if there is no room at the inn we are in trouble */ if (tp->t_tcpreq_req >= MAX_TCP_TRK_REQ) { tcp_trace_point(tp, TCP_TP_REQ_LOG_FAIL); - for(i = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0; i < MAX_TCP_TRK_REQ; i++) { tcp_req_log_req_info(tp, &tp->t_tcpreq_info[i], i, TCP_TRK_REQ_LOG_ALLOCFAIL, 0, 0); } return (NULL); } - for(i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { + for (i = 0, allocated = 0; i < MAX_TCP_TRK_REQ; i++) { fil = &tp->t_tcpreq_info[i]; if (fil->flags == TCP_TRK_TRACK_FLG_EMPTY) { allocated = 1; From nobody Sat Aug 3 22:54:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbygj2Qyzz5RVRq; Sat, 03 Aug 2024 22:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbygj1zJzz4Mhw; Sat, 3 Aug 2024 22:54:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ooaMF/hhkBey+H8fad8EvgIP6RfHU+1E8Ufjzd5M3o=; b=I84NBykAdjPJBg2P06FkxjLhPcQcTt8NTxiJzfJvqTqobIr6KerqziF38p2t8bbUqauEOb JgUKBvSK+A+ahdObLV9GEIHGkD/Vl895STTG8QCEfp7/5xN71SXf5lZv4a0qAgS+iM/Ck4 090TNznOcNOIFLf7zYouiMPuxxXWYbv514jvYqi+rpKXRuwnbfZDpgszopI4BCYr3y3Riu 7uksRPcm/QPR5FgxkZ6IppLm998+ce401qweAzpYoCipzNjA/2S7GcXNVza6yq0F0R68Lo xo53JXrK0MP+p+4kFFY92Hs187Xqxh+jKEFmXdzXoT9gaEIFbWtt1xObIwwF9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725665; a=rsa-sha256; cv=none; b=N5hDtOfwdFjKgJJqhVelZaUHtBo6HJFmALnSaQPHsVqIwbRc7rYnAsA1H9pvZSwAhOrz7y D4K9HXXj6eFRsL7gCRVI4XCbBuqF40sBuN8xon48rAiUPoM/E58Zvg0C9R+hVYN9ujgUQW Vdmij5MPA8P7OatN26DHL3VV83bOOlOLZp+izaqWXomDazg1B5KahU5jUb+89C8hR80khp jX7MQPR2HznsxrdT68QeD6R4mGFHrtk6rhAuTF/KLOQj/aSTulQZZKdkLvRMM6kaToUrZ2 66y9P8xKWs9lObqj2ktiARxXEDivAtNgcjdd4oYpgBFTalUjWEWBfeh423VFhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ooaMF/hhkBey+H8fad8EvgIP6RfHU+1E8Ufjzd5M3o=; b=kvKftu8ENX4mtpT3eMBFcnl1vjfasl5hD83I6I2YqBfPSMjEwswjT22OBHDXYj3/PDPg9d fSsHtzi6snauDhpMwR30jJZTP9kz5rpqgO1bIAZfaxGtFqEuRLNYMU1noEaYtcKo60hNKk U6VBxnEjCvI1nwgYoNSpNb5wWh+dZNorfCck+hdMKcl3Ds8pIe8HwKf0J+3J8aIPDDp1Ep x8Oi+ue94I7REf+CMyAouy29Psl2n35aV1kW/yAWUzNpfm/gd+IdsLB4OCSCXWHWjo+T1I 2rUQZbPIJE5bt1GbdUSVMxuO8GfbWCBFSAv8WbWNvnvNrqO4FVjObA+fVqXyyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbygj1b6bzX0X; Sat, 3 Aug 2024 22:54: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 473MsPQZ077959; Sat, 3 Aug 2024 22:54:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MsPsH077956; Sat, 3 Aug 2024 22:54:25 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:54:25 GMT Message-Id: <202408032254.473MsPsH077956@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: 85a9a388799d - stable/14 - tcp: whitespace cleanup of enum tcp_log_events List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 85a9a388799d1c3972fae27ddd44ab98bb1694be Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=85a9a388799d1c3972fae27ddd44ab98bb1694be commit 85a9a388799d1c3972fae27ddd44ab98bb1694be Author: Michael Tuexen AuthorDate: 2024-07-11 09:38:11 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:53:41 +0000 tcp: whitespace cleanup of enum tcp_log_events No functional change intended. Sponsored by: Netflix, Inc. (cherry picked from commit af84665261ff0aa4c930456f79ba89a73613a63f) --- sys/netinet/tcp_log_buf.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/netinet/tcp_log_buf.h b/sys/netinet/tcp_log_buf.h index 79f96bab1345..3c72ed49005c 100644 --- a/sys/netinet/tcp_log_buf.h +++ b/sys/netinet/tcp_log_buf.h @@ -219,18 +219,18 @@ enum tcp_log_events { BBR_LOG_BBRRTT, /* BBR RTT is updated 20 */ BBR_LOG_JUSTRET, /* We just returned out of output 21 */ BBR_LOG_STATE, /* A BBR state change occurred 22 */ - BBR_LOG_PKT_EPOCH, /* A BBR packet epoch occurred 23 */ - BBR_LOG_PERSIST, /* BBR changed to/from a persists 24 */ - TCP_LOG_FLOWEND, /* End of a flow 25 */ - BBR_LOG_RTO, /* BBR's timeout includes BBR info 26 */ - BBR_LOG_DOSEG_DONE, /* hpts do_segment completes 27 */ - BBR_LOG_EXIT_GAIN, /* hpts do_segment completes 28 */ - BBR_LOG_THRESH_CALC, /* Doing threshold calculation 29 */ + BBR_LOG_PKT_EPOCH, /* A BBR packet epoch occurred 23 */ + BBR_LOG_PERSIST, /* BBR changed to/from a persists 24 */ + TCP_LOG_FLOWEND, /* End of a flow 25 */ + BBR_LOG_RTO, /* BBR's timeout includes BBR info 26 */ + BBR_LOG_DOSEG_DONE, /* hpts do_segment completes 27 */ + BBR_LOG_EXIT_GAIN, /* hpts do_segment completes 28 */ + BBR_LOG_THRESH_CALC, /* Doing threshold calculation 29 */ TCP_LOG_MAPCHG, /* Map Changes to the sendmap 30 */ - TCP_LOG_USERSEND, /* User level sends data 31 */ + TCP_LOG_USERSEND, /* User level sends data 31 */ BBR_RSM_CLEARED, /* RSM cleared of ACK flags 32 */ - BBR_LOG_STATE_TARGET, /* Log of target at state 33 */ - BBR_LOG_TIME_EPOCH, /* A timed based Epoch occurred 34 */ + BBR_LOG_STATE_TARGET, /* Log of target at state 33 */ + BBR_LOG_TIME_EPOCH, /* A timed based Epoch occurred 34 */ BBR_LOG_TO_PROCESS, /* A to was processed 35 */ BBR_LOG_BBRTSO, /* TSO update 36 */ BBR_LOG_HPTSDIAG, /* Hpts diag insert 37 */ @@ -257,15 +257,15 @@ enum tcp_log_events { TCP_TIMELY_WORK, /* Logs regarding Timely CC tweaks 58 */ TCP_LOG_USER_EVENT, /* User space event data 59 */ TCP_LOG_SENDFILE, /* sendfile() logging for TCP connections 60 */ - TCP_LOG_REQ_T, /* logging of request tracking 61 */ - TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ - TCP_LOG_FSB, /* FSB information 63 */ + TCP_LOG_REQ_T, /* logging of request tracking 61 */ + TCP_LOG_ACCOUNTING, /* Log of TCP Accounting data 62 */ + TCP_LOG_FSB, /* FSB information 63 */ RACK_DSACK_HANDLING, /* Handling of DSACK in rack for reordering window 64 */ - TCP_HYSTART, /* TCP Hystart logging 65 */ - TCP_CHG_QUERY, /* Change query during fnc_init() 66 */ - TCP_RACK_LOG_COLLAPSE, /* Window collapse by peer 67 */ - TCP_RACK_TP_TRIGGERED, /* A rack tracepoint is triggered 68 */ - TCP_HYBRID_PACING_LOG, /* Hybrid pacing log 69 */ + TCP_HYSTART, /* TCP Hystart logging 65 */ + TCP_CHG_QUERY, /* Change query during fnc_init() 66 */ + TCP_RACK_LOG_COLLAPSE, /* Window collapse by peer 67 */ + TCP_RACK_TP_TRIGGERED, /* A rack tracepoint is triggered 68 */ + TCP_HYBRID_PACING_LOG, /* Hybrid pacing log 69 */ TCP_LOG_PRU, /* TCP protocol user request 70 */ TCP_LOG_END /* End (keep at end) 71 */ }; From nobody Sat Aug 3 22:55:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbyhq27QVz5RVXr; Sat, 03 Aug 2024 22:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbyhq1MMZz4N5s; Sat, 3 Aug 2024 22:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FFLo18a8we/nPxyLOWy5M2/fZHGBS4xdDwHr3t7Rx8=; b=A7SLpmy7QRvpOHafR4i93Op+0PmaGgOUWuIEtSg6scQuvSFbrwqMLAs5DEHkwYvi6SKEBN B3V4rfd466geh3XvKb+8oxZUWqRC3/APF27dsQ85PaKYM3SpMTnzgTIf/cUh5qM6A+qGBs rWydlXKBXpjUTZTEhvchbTy1C7CuYKdeWgpO/p2SqjkPdfQA6+IzAKmSMyrt+8EZSeUNpq yRasWR9nLAQq/QSbFc0JoA7dPCZYEBNAn/oBcDL/BPeWn1jcs5E3UAa0Hga6X9qN5itKVc Idfy92GwOScyHMUFS+3gIYAg9uw2NbA6j6xVo7u4r/67vATWBIz3lyCf8/OdWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722725723; a=rsa-sha256; cv=none; b=RtM0oke+r92BgBiiXPTtshjc6QhysodgAkaCQ9UsAs8DRX7EkxdcC0PHD4247luUKLiSNA 0AqENXcM6x0720MKH2YPaS0K6uGrWh+4HHWEkSIhoIPDCs9JB2FxQybLtMzTZmnQxrw29N 2yfwAM07bkSPWJAmGCPn+1wtIxnmeKnqSYUhUrmNAVzcDUva7ac9EiW8Lev923xK0L/F9z buqOQ3Qd0fxAdVeRu7xaHZvB+yl5M40mrTypn+pi6P1PlnIMJO0A3njpdEW+J10EvtO29b J9Rt3qEDG4EDt5vdI0r9Jx15x/mzMRX1DRB0uXbhoSJp89PaS6rOcqGsxJVEjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722725723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7FFLo18a8we/nPxyLOWy5M2/fZHGBS4xdDwHr3t7Rx8=; b=MAN9zps4M8IiA1KJuOjvd4SDvXkpZfp6kkQCKOvUWY5rfAuRfstQzcWrjyqecVvyX9WpUH SkzGxmyqTB3mMYJzPRU41gqubmEC+zabE8NPkGwJXUYH1+ahh1hA2y2iJ+p42pt19BHbKH qlyDePbysksgvUniklJL5LOf2LBYSw/2h42JOIyqyrbffyPliRR2+CA8d7gXUD0zuyI+sg lO0WmHA85nXY/ET7jF1obYRWfCXAqD3jHieSixh+LfcGjPZoQh3BtCFq05UeJqSkoSSK7e zJYcm8irYjpT9k0VN/lIOIhkkIvP4FNu+C+0g3qSJbibzNp1dyfVAzoBbMJIog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbyhq0yjvzWS9; Sat, 3 Aug 2024 22:55: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 473MtNSZ078265; Sat, 3 Aug 2024 22:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473MtNsW078262; Sat, 3 Aug 2024 22:55:23 GMT (envelope-from git) Date: Sat, 3 Aug 2024 22:55:23 GMT Message-Id: <202408032255.473MtNsW078262@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: f87aebe64c96 - stable/14 - tcp: refactor register_tcp_functions_as_names() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f87aebe64c9678916b4c22edb99793adbfd6fcea Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f87aebe64c9678916b4c22edb99793adbfd6fcea commit f87aebe64c9678916b4c22edb99793adbfd6fcea Author: Michael Tuexen AuthorDate: 2024-07-13 10:22:25 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 22:54:44 +0000 tcp: refactor register_tcp_functions_as_names() Refactor register_tcp_functions_as_names() such that either all or no (in error cases) registrations happen atomically (while holding the tcp_function_lock write lock). Also ensure that the TCP function block is not already registered. This avoids situations, where some registrations were performed and then they were removed without holding a lock in between or checking ref counts. Reviewed by: cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45947 (cherry picked from commit 859f0f0d6bf753c16caa0103a541c69fb6bd5e37) --- share/man/man9/tcp_functions.9 | 25 +++++++++++--- sys/netinet/tcp_subr.c | 78 ++++++++++++++++++++++-------------------- sys/netinet/tcp_var.h | 3 ++ 3 files changed, 64 insertions(+), 42 deletions(-) diff --git a/share/man/man9/tcp_functions.9 b/share/man/man9/tcp_functions.9 index 1e0616e03a9f..8ba7f21c978c 100644 --- a/share/man/man9/tcp_functions.9 +++ b/share/man/man9/tcp_functions.9 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 6, 2024 +.Dd July 13, 2024 .Dt TCP_FUNCTIONS 9 .Os .Sh NAME @@ -37,6 +37,7 @@ .Ft int .Fn register_tcp_functions_as_name "struct tcp_function_block *blk" \ "const char *name" "int wait" +.Ft int .Fn register_tcp_functions_as_names "struct tcp_function_block *blk" \ "int wait" "const char *names[]" "int *num_names" .Ft int @@ -112,6 +113,7 @@ argument. The .Fa num_names argument provides a pointer to the number of names. +This number must not exceed TCP_FUNCTION_NAME_NUM_MAX. This function will either succeed in registering all of the names in the array, or none of the names in the array. On failure, the @@ -328,8 +330,11 @@ must be prepared to wait until all connections have stopped using the specified TCP stack. .Sh ERRORS The -.Fn register_tcp_functions -function will fail if: +.Fn register_tcp_functions , +.Fn register_tcp_functions_as_name , +and +.Fn register_tcp_functions_as_names +functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL Any of the members of the @@ -338,7 +343,19 @@ argument are set incorrectly. .It Bq Er ENOMEM The function could not allocate memory for its internal data. .It Bq Er EALREADY -A function block is already registered with the same name. +The +.Fa blk +is already registered or a function block is already registered with the same +name. +.El +Additionally, +.Fn register_tcp_functions_as_names +will fail if: +.Bl -tag -width Er +.It Bq Er E2BIG +The number of names pointed to by the +.Fa num_names +argument is larger than TCP_FUNCTION_NAME_NUM_MAX. .El The .Fn deregister_tcp_functions diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8ae9018f1e5d..6feb1916bb35 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1215,9 +1215,9 @@ int register_tcp_functions_as_names(struct tcp_function_block *blk, int wait, const char *names[], int *num_names) { - struct tcp_function *n; + struct tcp_function *f[TCP_FUNCTION_NAME_NUM_MAX]; struct tcp_function_set fs; - int error, i; + int error, i, num_registered; KASSERT(names != NULL, ("%s: Called with NULL name list", __func__)); KASSERT(*num_names > 0, @@ -1225,71 +1225,73 @@ register_tcp_functions_as_names(struct tcp_function_block *blk, int wait, KASSERT(rw_initialized(&tcp_function_lock), ("%s: called too early", __func__)); + if (*num_names > TCP_FUNCTION_NAME_NUM_MAX) { + /* Too many names. */ + *num_names = 0; + return (E2BIG); + } if ((blk->tfb_tcp_output == NULL) || (blk->tfb_tcp_do_segment == NULL) || (blk->tfb_tcp_ctloutput == NULL) || (blk->tfb_tcp_handoff_ok == NULL) || (strlen(blk->tfb_tcp_block_name) == 0)) { - /* - * These functions are required and you - * need a name. - */ + /* These functions are required and a name is needed. */ *num_names = 0; return (EINVAL); } - if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { - *num_names = 0; - return (EINVAL); + for (i = 0; i < *num_names; i++) { + f[i] = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait); + if (f[i] == NULL) { + while (--i >= 0) + free(f[i], M_TCPFUNCTIONS); + *num_names = 0; + return (ENOMEM); + } } + num_registered = 0; + rw_wlock(&tcp_function_lock); + if (find_tcp_fb_locked(blk, NULL) != NULL) { + /* A TCP function block can only be registered once. */ + error = EALREADY; + goto cleanup; + } + if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + error = EINVAL; + goto cleanup; + } refcount_init(&blk->tfb_refcnt, 0); blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1); for (i = 0; i < *num_names; i++) { - n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait); - if (n == NULL) { - error = ENOMEM; - goto cleanup; - } - n->tf_fb = blk; - (void)strlcpy(fs.function_set_name, names[i], sizeof(fs.function_set_name)); - rw_wlock(&tcp_function_lock); if (find_tcp_functions_locked(&fs) != NULL) { /* Duplicate name space not allowed */ - rw_wunlock(&tcp_function_lock); - free(n, M_TCPFUNCTIONS); error = EALREADY; goto cleanup; } - (void)strlcpy(n->tf_name, names[i], sizeof(n->tf_name)); - TAILQ_INSERT_TAIL(&t_functions, n, tf_next); + f[i]->tf_fb = blk; + (void)strlcpy(f[i]->tf_name, names[i], sizeof(f[i]->tf_name)); + TAILQ_INSERT_TAIL(&t_functions, f[i], tf_next); tcp_fb_cnt++; - rw_wunlock(&tcp_function_lock); + num_registered++; } + rw_wunlock(&tcp_function_lock); return (0); cleanup: - /* - * Deregister the names we just added. Because registration failed - * for names[i], we don't need to deregister that name. - */ - *num_names = i; - rw_wlock(&tcp_function_lock); - while (--i >= 0) { - TAILQ_FOREACH(n, &t_functions, tf_next) { - if (!strncmp(n->tf_name, names[i], - TCP_FUNCTION_NAME_LEN_MAX)) { - TAILQ_REMOVE(&t_functions, n, tf_next); - tcp_fb_cnt--; - n->tf_fb = NULL; - free(n, M_TCPFUNCTIONS); - break; - } + /* Remove the entries just added. */ + for (i = 0; i < *num_names; i++) { + if (i < num_registered) { + TAILQ_REMOVE(&t_functions, f[i], tf_next); + tcp_fb_cnt--; } + f[i]->tf_fb = NULL; + free(f[i], M_TCPFUNCTIONS); } rw_wunlock(&tcp_function_lock); + *num_names = num_registered; return (error); } diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index b8278bbf2644..a8621563e190 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -638,6 +638,9 @@ struct tcp_function_block { uint8_t tfb_id; }; +/* Maximum number of names each TCP function block can be registered with. */ +#define TCP_FUNCTION_NAME_NUM_MAX 8 + struct tcp_function { TAILQ_ENTRY(tcp_function) tf_next; char tf_name[TCP_FUNCTION_NAME_LEN_MAX]; From nobody Sat Aug 3 23:06:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbyxD5Gh3z5RWTQ; Sat, 03 Aug 2024 23:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbyxD4pXfz4NmM; Sat, 3 Aug 2024 23:06:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bCC3w/JUKVgQvWO9cBMHp/dKQMCCbxld5r0SHPmpL2c=; b=Qt0yXOMS4rM+ihhPRr8WVe3VdPXO/xBDcoT2xdv6DHfSpkpKa/1U5f+M6i398qaiHMh1IH K/yMtHSsBc2iFO4xi+Wa6RUAxFKVwWi42J4bTkqA3eOmJWTAVZCNaGSxEYs6pzjbWp1lv8 ElnBrHbJPWBvC1NnzJIZiKip8HA3LSGyG3pPNapwo6NrKHk1CjMIRaMKSWrl8crQrmvHxV 8MuukK7onN6LRfMnt7VAS/9IXRNlHVLePA7qDO6oKplFUUar/fIxjVCgl2Vd8VHnDwJQmP z8sl91PMKNTZv4IsuCBNHLybp8F2A7pdK7CmUdZSq9v+8yJxhb4jQVSz2McDwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722726368; a=rsa-sha256; cv=none; b=YUJBpIUfMGnLPbB3YB1BzoMrfQTd5GD6Yz+jSfdHVpdQRT6t/qeKopjMJrZOIX1gvHRydW yM/rQCo4iwHI8tOaLBAAr+yPOSjmpT3wqMHYO4iDvxVynuwguo5liM9NmmCGR1GdtLca76 Ft2hGTl2W2KSNoquE6MZYeRFb0pu/oPQk22e7Emp+OauNcyBGLHo/jWejUM/oOcIR9eH/2 r7FNTCnHnyB1Y3I3ntPLkjRCD0nA0KNIMLAQlSJSkukaqniDsGB4zMipNNkNFExQ82vGWb ePOzqtwEcKtwzqUGa0YF3RjSXKuJ5lHJ89IyL38ye2KRirIEMZDIk+RXMPaDXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bCC3w/JUKVgQvWO9cBMHp/dKQMCCbxld5r0SHPmpL2c=; b=gvK983VqhFj5L/xzapfLJ99lXwWZKY9Xnx6tJ3mMru9pBQtnBCOUvjg0f+6lMoGfpvam1u vtD4zu2AX6PEKD2BQya0paiFZmJrDNuhSVageKgqIncA2lTkcZ910wxRnt8p3wzY3qNsQQ 8NhaS3aVn+k1NjgxyfIAXaByp0YqSFLjrBkOaMP3O46eVx9yaA/ZPZ/bwYoqRBoHasXxjm i9tqqubiFV8R2fnr8t/MdsiRBAyen+jomJDhPuaosRfXmEw45DLlUM5mfYScbVCa9uRc27 b4AkN6BhmHIBfocbpXoZ6sst/OiQotCqXpFLzoyC3LY9q0tWPTPjM91H6i1e9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbyxD4J0pzXK5; Sat, 3 Aug 2024 23:06: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 473N680L096229; Sat, 3 Aug 2024 23:06:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473N687E096226; Sat, 3 Aug 2024 23:06:08 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:06:08 GMT Message-Id: <202408032306.473N687E096226@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: 1ce8cf6f7bdf - stable/14 - tcp: improve SEG.ACK validation List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 1ce8cf6f7bdf5e9f8e497be5e3c54767fa0a7cf8 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=1ce8cf6f7bdf5e9f8e497be5e3c54767fa0a7cf8 commit 1ce8cf6f7bdf5e9f8e497be5e3c54767fa0a7cf8 Author: Michael Tuexen AuthorDate: 2024-07-21 09:37:35 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:05:13 +0000 tcp: improve SEG.ACK validation Implement the improved SEG.ACK validation described in RFC 5961. In addition to that, also detect ghost ACKs, which are ACKs for data that has never been sent. The additional checks are enabled by default, but can be disabled by setting the sysctl-variable net.inet.tcp.insecure_ack to a non-zero value. PR: 250357 Reviewed by: Peter Lei, rscheff (older version) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45894 (cherry picked from commit 646c28ea80cb0f9258386626297495b5a0e56db5) --- share/man/man4/tcp.4 | 5 ++++- sys/netinet/tcp_input.c | 44 +++++++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_stacks/bbr.c | 37 ++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_stacks/rack.c | 39 ++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 8 +++++++- usr.bin/netstat/inet.c | 8 ++++++-- 6 files changed, 137 insertions(+), 4 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 16c9e0ce84df..1f5cc7734bbf 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -33,7 +33,7 @@ .\" .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" -.Dd November 17, 2023 +.Dd July 21, 2024 .Dt TCP 4 .Os .Sh NAME @@ -708,6 +708,9 @@ Default is false. .It Va insecure_syn Use criteria defined in RFC793 instead of RFC5961 for accepting SYN segments. Default is false. +.It Va insecure_ack +Use criteria defined in RFC793 for validating SEG.ACK. +Default is false. .It Va isn_reseed_interval The interval (in seconds) specifying how often the secret data used in RFC 1948 initial sequence number calculations should be reseeded. diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 133818b73a1d..21f4d046d6c9 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -209,6 +209,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow RFC793 instead of RFC5961 criteria for accepting RST packets"); +VNET_DEFINE(int, tcp_insecure_ack) = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_ack, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_insecure_ack), 0, + "Follow RFC793 criteria for validating SEG.ACK"); + VNET_DEFINE(int, tcp_recvspace) = 1024*64; #define V_tcp_recvspace VNET(tcp_recvspace) SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_VNET | CTLFLAG_RW, @@ -2417,6 +2422,45 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, /* * Ack processing. */ + if (SEQ_GEQ(tp->snd_una, tp->iss + (65535 << tp->snd_scale))) { + /* Checking SEG.ACK against ISS is definitely redundant. */ + tp->t_flags2 |= TF2_NO_ISS_CHECK; + } + if (!V_tcp_insecure_ack) { + tcp_seq seq_min; + bool ghost_ack_check; + + if (tp->t_flags2 & TF2_NO_ISS_CHECK) { + /* Check for too old ACKs (RFC 5961, Section 5.2). */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } else { + if (SEQ_GT(tp->iss + 1, tp->snd_una - tp->max_sndwnd)) { + /* Checking for ghost ACKs is stricter. */ + seq_min = tp->iss + 1; + ghost_ack_check = true; + } else { + /* + * Checking for too old ACKs (RFC 5961, + * Section 5.2) is stricter. + */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } + } + if (SEQ_LT(th->th_ack, seq_min)) { + if (ghost_ack_check) + TCPSTAT_INC(tcps_rcvghostack); + else + TCPSTAT_INC(tcps_rcvacktooold); + /* Send a challenge ACK. */ + tcp_respond(tp, mtod(m, void *), th, m, + tp->rcv_nxt, tp->snd_nxt, TH_ACK); + tp->last_ack_sent = tp->rcv_nxt; + m = NULL; + goto drop; + } + } switch (tp->t_state) { /* * In SYN_RECEIVED state, the ack ACKs our SYN, so enter diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 7803865af818..2bdab744e0d9 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -7700,6 +7700,43 @@ bbr_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, bbr = (struct tcp_bbr *)tp->t_fb_ptr; lost = bbr->r_ctl.rc_lost; nsegs = max(1, m->m_pkthdr.lro_nsegs); + if (SEQ_GEQ(tp->snd_una, tp->iss + (65535 << tp->snd_scale))) { + /* Checking SEG.ACK against ISS is definitely redundant. */ + tp->t_flags2 |= TF2_NO_ISS_CHECK; + } + if (!V_tcp_insecure_ack) { + tcp_seq seq_min; + bool ghost_ack_check; + + if (tp->t_flags2 & TF2_NO_ISS_CHECK) { + /* Check for too old ACKs (RFC 5961, Section 5.2). */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } else { + if (SEQ_GT(tp->iss + 1, tp->snd_una - tp->max_sndwnd)) { + /* Checking for ghost ACKs is stricter. */ + seq_min = tp->iss + 1; + ghost_ack_check = true; + } else { + /* + * Checking for too old ACKs (RFC 5961, + * Section 5.2) is stricter. + */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } + } + if (SEQ_LT(th->th_ack, seq_min)) { + if (ghost_ack_check) + TCPSTAT_INC(tcps_rcvghostack); + else + TCPSTAT_INC(tcps_rcvacktooold); + /* Send challenge ACK. */ + ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val); + bbr->r_wanted_output = 1; + return (1); + } + } if (SEQ_GT(th->th_ack, tp->snd_max)) { ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val); bbr->r_wanted_output = 1; diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index d918d9385446..c27f745ade62 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -12149,6 +12149,45 @@ rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so, INP_WLOCK_ASSERT(tptoinpcb(tp)); rack = (struct tcp_rack *)tp->t_fb_ptr; + if (SEQ_GEQ(tp->snd_una, tp->iss + (65535 << tp->snd_scale))) { + /* Checking SEG.ACK against ISS is definitely redundant. */ + tp->t_flags2 |= TF2_NO_ISS_CHECK; + } + if (!V_tcp_insecure_ack) { + tcp_seq seq_min; + bool ghost_ack_check; + + if (tp->t_flags2 & TF2_NO_ISS_CHECK) { + /* Check for too old ACKs (RFC 5961, Section 5.2). */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } else { + if (SEQ_GT(tp->iss + 1, tp->snd_una - tp->max_sndwnd)) { + /* Checking for ghost ACKs is stricter. */ + seq_min = tp->iss + 1; + ghost_ack_check = true; + } else { + /* + * Checking for too old ACKs (RFC 5961, + * Section 5.2) is stricter. + */ + seq_min = tp->snd_una - tp->max_sndwnd; + ghost_ack_check = false; + } + } + if (SEQ_LT(th->th_ack, seq_min)) { + if (ghost_ack_check) + TCPSTAT_INC(tcps_rcvghostack); + else + TCPSTAT_INC(tcps_rcvacktooold); + /* Send challenge ACK. */ + __ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val, + &rack->r_ctl.challenge_ack_ts, + &rack->r_ctl.challenge_ack_cnt); + rack->r_wanted_output = 1; + return (1); + } + } if (SEQ_GT(th->th_ack, tp->snd_max)) { __ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val, &rack->r_ctl.challenge_ack_ts, diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index a8621563e190..010ad748260a 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -858,6 +858,7 @@ tcp_packets_this_ack(struct tcpcb *tp, tcp_seq ack) #define TF2_MBUF_QUEUE_READY 0x00020000 /* Inputs can be queued */ #define TF2_DONT_SACK_QUEUE 0x00040000 /* Don't wake on sack */ #define TF2_CANNOT_DO_ECN 0x00080000 /* The stack does not do ECN */ +#define TF2_NO_ISS_CHECK 0x00200000 /* Don't check SEG.ACK against ISS */ /* * Structure to hold TCP options that are only used during segment @@ -1109,8 +1110,11 @@ struct tcpstat { uint64_t tcps_tlpresends; /* number of tlp resends */ uint64_t tcps_tlpresend_bytes; /* number of bytes resent by tlp */ + /* SEG.ACK validation failures */ + uint64_t tcps_rcvghostack; /* received ACK for data never sent */ + uint64_t tcps_rcvacktooold; /* received ACK for data too long ago */ - uint64_t _pad[4]; /* 4 TBD placeholder for STABLE */ + uint64_t _pad[2]; /* 2 TBD placeholder for STABLE */ }; #define tcps_rcvmemdrop tcps_rcvreassfull /* compat */ @@ -1291,6 +1295,7 @@ VNET_DECLARE(int, tcp_ecn_maxretries); VNET_DECLARE(int, tcp_initcwnd_segments); VNET_DECLARE(int, tcp_insecure_rst); VNET_DECLARE(int, tcp_insecure_syn); +VNET_DECLARE(int, tcp_insecure_ack); VNET_DECLARE(uint32_t, tcp_map_entries_limit); VNET_DECLARE(uint32_t, tcp_map_split_limit); VNET_DECLARE(int, tcp_minmss); @@ -1337,6 +1342,7 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) #define V_tcp_insecure_rst VNET(tcp_insecure_rst) #define V_tcp_insecure_syn VNET(tcp_insecure_syn) +#define V_tcp_insecure_ack VNET(tcp_insecure_ack) #define V_tcp_map_entries_limit VNET(tcp_map_entries_limit) #define V_tcp_map_split_limit VNET(tcp_map_split_limit) #define V_tcp_minmss VNET(tcp_minmss) diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 19f7ba1490c4..3442666ce0bd 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -649,8 +649,12 @@ tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) "{N:/UDP tunneled pkt%s}\n"); p(tcps_tunneled_errs, "\t\t{:received-bad-udp-tunneled-pkts/%ju} " "{N:/UDP tunneled pkt cnt with error%s}\n"); - p(tcps_rcvacktoomuch, "\t\t{:received-acks-for-unsent-data/%ju} " - "{N:/ack%s for unsent data}\n"); + p(tcps_rcvacktoomuch, "\t\t{:received-acks-for-data-not-yet-sent/%ju} " + "{N:/ack%s for data not yet sent}\n"); + p(tcps_rcvghostack, "\t\t{:received-acks-for-data-never-been-sent/%ju} " + "{N:/ack%s for data never been sent (ghost acks)}\n"); + p(tcps_rcvacktooold, "\t\t{:received-acks-for-data-being-too-old/%ju} " + "{N:/ack%s for data being too old}\n"); p2(tcps_rcvpack, tcps_rcvbyte, "\t\t" "{:received-in-sequence-packets/%ju} {N:/packet%s} " "({:received-in-sequence-bytes/%ju} {N:/byte%s}) " From nobody Sat Aug 3 23:07:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbyys4PMZz5RWKC; Sat, 03 Aug 2024 23:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbyys3hz0z4PYb; Sat, 3 Aug 2024 23:07:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTMAL/y7xB6DD53GY/nQw9d1m87+C1bwM9ogtd5t7pc=; b=jY7heYHUdPtM0nJ7EQ+4GzvtMof1EM9WeK4XvNr9QMRQFimNNpquggwLRyNN+jEKgoG8fQ wsgWCYjNxsrYu2iI4dnKaG0jdB2DRw6jGX70KfFid5GcZs3BK0EDWv2Hk/V5NaiJNU5LCR PWRhaK9M/nVZ2wvgLJGs7mK8uLjSP6P1bRSjWZICEtu43HuEXIfqtDkiBpa4mJyM9+9D2s I8Oj0fVrjJf1kfg9lFJNlLX8wXHAYe0ZoL2O7FvTMMUmjL0hQl2f19EnE6ku69CJWUmvc3 vTxGgGfR2/07hPFl4blblCH/ZkWL3BQhzhSmVQXYGmu9WI2+6p6vDrMnK2xlPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722726453; a=rsa-sha256; cv=none; b=wf4eFVnA6+exgAt8jaJ8aJnvly7UehMB0M8KgIzn1lqM2kcfxAVPFEFBJbAc2uEGyipQ6V 5HeEnjqHTYf1ViBtQ1oN/FlKN9llpgqyC3BFYzLBL2tjceA8rsxmoyC4f+Fj8XLD5CsYnK XNuZ4/yFbldy3ODZWWSzp9dzZ458tZd7F8M74XKzzHemYMlAZc19MS4rbo1OXegJ+aYBQr gJ70I/jXzfEv24oWuLdxtrtM6W3jdr3TwwiLSelq+XZHveMORJRPY9ubYznOdQuM9J2ZSs Lw6TPkFt3JxL1/LSkz5Z2ZE1RmzN2Pz96J6+h4feh4f3+YjjiMG7kFF+z1dDVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oTMAL/y7xB6DD53GY/nQw9d1m87+C1bwM9ogtd5t7pc=; b=P9E8uaBRGvlVUKs8SqsTo07g7nXArMBavR/GkRF60Lxt94uQh77bCjUEhgGlqyF1uIFdn5 7XWSTIULnZHlJrBeIO0P6biSn0KrljEpvCgp2EPZokcjn0mMtM6+C2tUB10IY4E1z824rn HEJTi9y/V9iZ7I+PVV3BhqsmLgDcGobPDM56baiZiKpJDKVHnbzEXL3H6H1fAc+jKm7WG6 qA16uaY9L/TXjCUx5l+iHt9n72Ax2iW4auMcjEr2gRIyXzZRiNXpvmD6PCk9PhA3QasatZ dszHy343GP/00dHw/QvKfBNKumMU+3nVWTkT4Rcht0Ed991kv/2Y9X8W7LVJ3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbyys3G2nzWNZ; Sat, 3 Aug 2024 23:07: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 473N7X6J096522; Sat, 3 Aug 2024 23:07:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473N7Xkb096519; Sat, 3 Aug 2024 23:07:33 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:07:33 GMT Message-Id: <202408032307.473N7Xkb096519@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: ac56d68b1b71 - stable/14 - tcp: simplify endpoint creation at the passive side List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: ac56d68b1b71031370e94577adc5fbc12a0353d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=ac56d68b1b71031370e94577adc5fbc12a0353d2 commit ac56d68b1b71031370e94577adc5fbc12a0353d2 Author: Michael Tuexen AuthorDate: 2024-07-21 09:49:37 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:06:50 +0000 tcp: simplify endpoint creation at the passive side Use the intended TCP stack when creating a TCP endpoint instead of creating it the endpoint the default stack first and after that switching it to use the intended TCP stack. Reviewed by: Peter Lei, rrs and jtl (older version) Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45411 (cherry picked from commit baee801c92d26f4b7d1b2a9edd755c1b07b84167) --- sys/netinet/tcp_subr.c | 19 +++++++++++++++++-- sys/netinet/tcp_syncache.c | 39 ++++++--------------------------------- sys/netinet/tcp_usrreq.c | 2 +- sys/netinet/tcp_var.h | 2 +- 4 files changed, 25 insertions(+), 37 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 6feb1916bb35..5d87d0327148 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2221,9 +2221,11 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, * Create a new TCP control block, making an empty reassembly queue and hooking * it to the argument protocol control block. The `inp' parameter must have * come from the zone allocator set up by tcpcbstor declaration. + * The caller can provide a pointer to a tcpcb of the listener to inherit the + * TCP function block from the listener. */ struct tcpcb * -tcp_newtcpcb(struct inpcb *inp) +tcp_newtcpcb(struct inpcb *inp, struct tcpcb *listening_tcb) { struct tcpcb *tp = intotcpcb(inp); #ifdef INET6 @@ -2241,8 +2243,21 @@ tcp_newtcpcb(struct inpcb *inp) tp->t_ccv.type = IPPROTO_TCP; tp->t_ccv.ccvc.tcp = tp; rw_rlock(&tcp_function_lock); - tp->t_fb = V_tcp_func_set_ptr; + if (listening_tcb != NULL) { + INP_LOCK_ASSERT(tptoinpcb(listening_tcb)); + KASSERT(listening_tcb->t_fb != NULL, + ("tcp_newtcpcb: listening_tcb->t_fb is NULL")); + if (listening_tcb->t_fb->tfb_flags & TCP_FUNC_BEING_REMOVED) { + rw_runlock(&tcp_function_lock); + return (NULL); + } + tp->t_fb = listening_tcb->t_fb; + } else { + tp->t_fb = V_tcp_func_set_ptr; + } refcount_acquire(&tp->t_fb->tfb_refcnt); + KASSERT((tp->t_fb->tfb_flags & TCP_FUNC_BEING_REMOVED) == 0, + ("tcp_newtcpcb: using TFB being removed")); rw_runlock(&tcp_function_lock); /* * Use the current system default CC algorithm. diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 21dfe8dd123e..052e257a3cb5 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -777,7 +777,7 @@ done: static struct socket * syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) { - struct tcp_function_block *blk; + struct tcpcb *listening_tcb; struct inpcb *inp = NULL; struct socket *so; struct tcpcb *tp; @@ -802,7 +802,11 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) goto allocfail; } inp = sotoinpcb(so); - if ((tp = tcp_newtcpcb(inp)) == NULL) { + if (V_functions_inherit_listen_socket_stack) + listening_tcb = sototcpcb(lso); + else + listening_tcb = NULL; + if ((tp = tcp_newtcpcb(inp, listening_tcb)) == NULL) { in_pcbfree(inp); sodealloc(so); goto allocfail; @@ -912,37 +916,6 @@ syncache_socket(struct syncache *sc, struct socket *lso, struct mbuf *m) tp->t_port = sc->sc_port; tcp_rcvseqinit(tp); tcp_sendseqinit(tp); - blk = sototcpcb(lso)->t_fb; - if (V_functions_inherit_listen_socket_stack && blk != tp->t_fb) { - /* - * Our parents t_fb was not the default, - * we need to release our ref on tp->t_fb and - * pickup one on the new entry. - */ - struct tcp_function_block *rblk; - void *ptr = NULL; - - rblk = find_and_ref_tcp_fb(blk); - KASSERT(rblk != NULL, - ("cannot find blk %p out of syncache?", blk)); - - if (rblk->tfb_tcp_fb_init == NULL || - (*rblk->tfb_tcp_fb_init)(tp, &ptr) == 0) { - /* Release the old stack */ - if (tp->t_fb->tfb_tcp_fb_fini != NULL) - (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); - refcount_release(&tp->t_fb->tfb_refcnt); - /* Now set in all the pointers */ - tp->t_fb = rblk; - tp->t_fb_ptr = ptr; - } else { - /* - * Initialization failed. Release the reference count on - * the looked up default stack. - */ - refcount_release(&rblk->tfb_refcnt); - } - } tp->snd_wl1 = sc->sc_irs; tp->snd_max = tp->iss + 1; tp->snd_nxt = tp->iss + 1; diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 4e754965487b..384c27b3a6cd 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -174,7 +174,7 @@ tcp_usr_attach(struct socket *so, int proto, struct thread *td) if (error) goto out; inp = sotoinpcb(so); - tp = tcp_newtcpcb(inp); + tp = tcp_newtcpcb(inp, NULL); if (tp == NULL) { error = ENOBUFS; in_pcbfree(inp); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 010ad748260a..4632474c1d11 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1463,7 +1463,7 @@ void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct tcpcb * - tcp_newtcpcb(struct inpcb *); + tcp_newtcpcb(struct inpcb *, struct tcpcb *); int tcp_default_output(struct tcpcb *); void tcp_state_change(struct tcpcb *, int); void tcp_respond(struct tcpcb *, void *, From nobody Sat Aug 3 23:10:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbz1p6KXgz5RWpc; Sat, 03 Aug 2024 23:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbz1p4Qvqz4PtX; Sat, 3 Aug 2024 23:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ctrE+W0OhDx4JEuiHCdh+uQgzj2PHUtNXdAryQIh+I=; b=YRvBhJwai7w9RdgNz1fYOTO9x5323HvKopU0QNDd+5R+adP8gXHg8UYmRO/vf9QYfL0SFU 5lPPDq59rbUkuwZnkf4AXe1uzqmz1Y/6VGWQirweqqh+L+4HBZkh5o+P/ZCrkrUBovy0Hj xnYgW/i5sLMo2OosDH5uYVutEoqD9UaHzFDhjUNSwnE9Hv0ry93JuKr6Qi0CzIilMqdXDs ehj+t7BpSiFBd4rxCTxOG+SBBXLO7K/wLFCX7cioJm6rquo5Z+je6A7G2NGYRTdrqZeKT1 iG5QpMDf5vJbUQdVlrv+l07kPpIWIh0EEtSyBaQZ+XsNOavjebiokq8c7Y5wsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722726606; a=rsa-sha256; cv=none; b=omj+NqdrABG3V1/VbclWC4jFH6JzDpy0xBGX5mAvl8Vq/1wxO4UN1dYuRFgRYxQ4K243O1 EbjvvF93Qx9dYzpM/W9lbuD4pdNUEyR8LyfQNWxrwRA4G+KBGGf6T7HEc0bcEMHu15wrGY 2/+xOLs24eJ8tUkhA3eN6RRVfZhEBvozypG5wp/z9CullKUUmBD2uWbiMDkW9qbrDl1fv5 r8OEx1New/c1kI79vCSeHg2zcErdwdRmMxGVjNyj7dLicxPNc62Ca3SXvbEz6ceQS+7gU9 EM6qcxBiT9wiWyC1A606A7OwQKP9+ORcGVg/FQ4P++bJHtY+jTHUIJy9UgczbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ctrE+W0OhDx4JEuiHCdh+uQgzj2PHUtNXdAryQIh+I=; b=XJhq8qCnGNyElXPy0NRx3TWNHV8IeBq9sfUW3SIfIlDMpUGj40j92gFb0uPMR4EUkfgMCZ 6Aj4zLnjJ9XmTn/j9NAepIuS/hBuzVzPuBNIj/ROw67n6qHQNovpDIY4891cpj4xcOD6CY RUKaqxEofW6Lm1kXlSogf08uQvTsb1rK4ozcX4jWfutfEbAOYwu62ZqeqDOtWXef63My+6 XeOr4EA9IqyAyRrgBJ1O7GINjfayuD3D5WtPliH+bxwbxC65y58QG2Bq2d2rpSBtg5sfke MLCPqsVOi3Urdt/+XRxdVIjea2VMosTqczHoVRLOOlqIApdSo65AaQ+ued1E2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbz1p3h68zX3t; Sat, 3 Aug 2024 23:10: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 473NA6An099918; Sat, 3 Aug 2024 23:10:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473NA6AC099905; Sat, 3 Aug 2024 23:10:06 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:10:06 GMT Message-Id: <202408032310.473NA6AC099905@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: 9ea13f8547a9 - stable/14 - tcp: mark TCP stacks which can serve as a default stack List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 9ea13f8547a98d4467d2095c4e97447309a2dd10 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=9ea13f8547a98d4467d2095c4e97447309a2dd10 commit 9ea13f8547a98d4467d2095c4e97447309a2dd10 Author: Michael Tuexen AuthorDate: 2024-07-21 13:06:10 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:09:27 +0000 tcp: mark TCP stacks which can serve as a default stack Allow a TCP function block (tfb) to become the default stack only if tfb->tfb_flags has the TCP_FUNC_DEFAULT_OK flags set. This allows a TCP function block, that is not suitable as a default function block to ensure that it is not set as the default via sysctl. In this case sysctl would return EINVAL. Reviewed by: gallatin, Peter Lei Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D45419 (cherry picked from commit e0b080f850cc0418353cc196cbfe81075cf76661) --- sys/netinet/tcp_stacks/bbr.c | 2 +- sys/netinet/tcp_stacks/rack.c | 2 +- sys/netinet/tcp_subr.c | 5 +++++ sys/netinet/tcp_var.h | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c index 2bdab744e0d9..c1bbec3800fd 100644 --- a/sys/netinet/tcp_stacks/bbr.c +++ b/sys/netinet/tcp_stacks/bbr.c @@ -14151,7 +14151,7 @@ struct tcp_function_block __tcp_bbr = { .tfb_tcp_mtu_chg = bbr_mtu_chg, .tfb_pru_options = bbr_pru_options, .tfb_switch_failed = bbr_switch_failed, - .tfb_flags = TCP_FUNC_OUTPUT_CANDROP, + .tfb_flags = TCP_FUNC_OUTPUT_CANDROP | TCP_FUNC_DEFAULT_OK, }; /* diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index c27f745ade62..35ae371a082e 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -23800,7 +23800,7 @@ static struct tcp_function_block __tcp_rack = { .tfb_switch_failed = rack_switch_failed, .tfb_early_wake_check = rack_wake_check, .tfb_compute_pipe = rack_compute_pipe, - .tfb_flags = TCP_FUNC_OUTPUT_CANDROP, + .tfb_flags = TCP_FUNC_OUTPUT_CANDROP | TCP_FUNC_DEFAULT_OK, }; /* diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 5d87d0327148..9fc744c42e0c 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -402,6 +402,7 @@ static struct tcp_function_block tcp_def_funcblk = { .tfb_tcp_fb_init = tcp_default_fb_init, .tfb_tcp_fb_fini = tcp_default_fb_fini, .tfb_switch_failed = tcp_default_switch_failed, + .tfb_flags = TCP_FUNC_DEFAULT_OK, }; static int tcp_fb_cnt = 0; @@ -719,6 +720,10 @@ sysctl_net_inet_default_tcp_functions(SYSCTL_HANDLER_ARGS) error = ENOENT; goto done; } + if ((blk->tfb_flags & TCP_FUNC_DEFAULT_OK) == 0) { + error = EINVAL; + goto done; + } V_tcp_func_set_ptr = blk; done: rw_wunlock(&tcp_function_lock); diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 4632474c1d11..e7cccd60a95e 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -536,6 +536,7 @@ typedef enum { /* Flags for tcp functions */ #define TCP_FUNC_BEING_REMOVED 0x01 /* Can no longer be referenced */ #define TCP_FUNC_OUTPUT_CANDROP 0x02 /* tfb_tcp_output may ask tcp_drop */ +#define TCP_FUNC_DEFAULT_OK 0x04 /* Can be used as default */ /** * If defining the optional tcp_timers, in the From nobody Sat Aug 3 23:10:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbz2h09XCz5RWpn; Sat, 03 Aug 2024 23: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbz2g6VX9z4Q6K; Sat, 3 Aug 2024 23: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=1722726651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBWtKk//eSCPDNwiMJ4GhSlO94YeLsZJqwHvwOUi1kw=; b=ytR53pG/8/pLUoixtaWg5rF/7bgTJyFz1v8u69pmI51BcQDvfbLMM2Zo5ezqDdlzRL/XQG +yBrnWy5szWpUUPEdskKc6JGs9a8jr7VRc8oyfTn9RaNp2ieacCldaPYwTznFrQRmuVBw8 svttJhaqsjaI3GSwMtQSJy1v8TTVLoI1FBDhMd0NRHP+s24zfzx0Oa6c2EMFfTtw1xw3LE kflzZ/VX+dBRYsGQnSL4ajMka4PFdCsjp3032NOUc6qSH9qNqalq2ktolpUp/ZU5mK4j30 CNQGHTdw65MuQboZK4nCTmcX8daOvdAASRvHVJHnU01ajxrLtIG/AjFx1Z9gyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722726651; a=rsa-sha256; cv=none; b=NcuLOAZXhBENTMnkCmWzAnRe0jbKQdqJ9A1KOSzEbe7m/V9vDiiQku61xndX+71THq/XvA UGXp9OJuTRjSUPcsm+ZvJIPpAA0dudXIXCS2mNX6Q1WZqoiZeaWBEiUAovySbRJVpIKtA/ CeEIw0NF4nMkPu/KI5/YfGfptnC+pQJWXSZZKoVpAnQNcggc4gpdj6HKmLngmJtp48jJ/H i93XYS3f4YWwhi6N22IfLGAvSBQzYDHRntyMPX6SkTWOILkpkI927o+gau/uz20obuFs5R o+vzoeUdk1Cut8x7p9aeZUFMT4id0LV2hci2sx9FZBUM2r8S0xAMsid6wAHyBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726651; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FBWtKk//eSCPDNwiMJ4GhSlO94YeLsZJqwHvwOUi1kw=; b=jNhQ7AbhV0INwz1P0KPjVzudOGQszTmkD9Ra2d98AKRBNDzgwf3kiOSLoudMnV400XqT8b iL/HMd/x5nWAeCXXVzKnPe2JLrnd9b8qUlrXxjIo9EOq8VQg2w6Aoc4AkjXjOn/zdSmxGf RKCcC2431xW2ONB/+L/9jav2sp+hPmKXGFkwKYFjjHGa/SqIO4vatYeyjKw85ZP7j72QNr fLlpQ4W1YSsorTvCYwXa6Ub4wcPfkm22PEST4Fcll+d2E8s+xYRgD7nwYegtzPSdmEW/68 K3yyFjWDqyjaJ773ubPo9XhPffsLNYI598BGyLv+zPzrBrLx06EyEkwrVuJQrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbz2g5Hm7zW0F; Sat, 3 Aug 2024 23: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 473NApkA006903; Sat, 3 Aug 2024 23: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 473NApda006900; Sat, 3 Aug 2024 23:10:51 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:10:51 GMT Message-Id: <202408032310.473NApda006900@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: f0b0eefe581f - stable/14 - tcp: use TCP_MAXWIN instead of 65535 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f0b0eefe581f5b476d7692fa06334e4c658ef737 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=f0b0eefe581f5b476d7692fa06334e4c658ef737 commit f0b0eefe581f5b476d7692fa06334e4c658ef737 Author: Michael Tuexen AuthorDate: 2024-07-22 06:52:12 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:10:28 +0000 tcp: use TCP_MAXWIN instead of 65535 This is suggested by cc@. No functional change. Sponsored by: Netflix, Inc. (cherry picked from commit 37b3e6a660f551ceda412e2115748f3b97b2e615) --- sys/netinet/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 21f4d046d6c9..cb72ddbef947 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2422,7 +2422,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, /* * Ack processing. */ - if (SEQ_GEQ(tp->snd_una, tp->iss + (65535 << tp->snd_scale))) { + if (SEQ_GEQ(tp->snd_una, tp->iss + (TCP_MAXWIN << tp->snd_scale))) { /* Checking SEG.ACK against ISS is definitely redundant. */ tp->t_flags2 |= TF2_NO_ISS_CHECK; } From nobody Sat Aug 3 23:13:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wbz5G38xjz5RWp9; Sat, 03 Aug 2024 23:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wbz5G1X0Sz4QqW; Sat, 3 Aug 2024 23:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yswoB8My7ipqjBDVnfx8sdDQJlQ8mCV+HEu+HSl57OY=; b=uwLZq3ndgM8xjVOAEgq8Ha03AnSkOA4gN8F6HfjHHDBNN1BJd6TrUvTLp5O2qG/cZa22ZM 04r97fxAsnezrV/2JbypigU+ijJi+fhorR/MKz81HhQooSy+G7RUXU7F1j9KCmNHsVUtAt P9/coGc40HLk/lUHeojOq9wdZz22OJ+7lRPS3CJ+pQ2M3v1VzF9XwjA3KbDvtpFAwGIuoG /MTJK7cwNnNvcNVa4ZrRjhwf5lSB+Upw337LKPgqkXkr9tR7t4P7Jb5OsmZ3+U2wQHHsHA aLeuHW14o0+ObJicagYfpI+rFsF/nHqy1FMEX47839gcdUQk3FPgLDjnAcfNSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722726786; a=rsa-sha256; cv=none; b=BXv1cgRjyAZDH3uVxH17IGrjoubguvGgORJ07EOHG1+5UhKkihAyaGWEsYlM3qO6GYB+hb v0fcgdlp2KOTEJp2nsu+m/kcHMycwGGn9w7b4tyHN71S4VTP++rJCntHwPMm8KtoeGKygi 1gYWL55PYYXzMtP0eRZjInFiBgm6lBhMnBa/i7mTz1lNNDUliMCo+ARlkiXulDvAKh2OS6 OCVwgIKMgWliOhJd3OvRsjlWgySD2RNh0lGsVYsoxg3Qj9xQxXN7KCi9Q2aRb0RKwS3+7R hDxeukKYmjHHtgs8678Pclmlj7efSRsXJV0KgVefl442zJmBsHRnAZGywChu6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722726786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yswoB8My7ipqjBDVnfx8sdDQJlQ8mCV+HEu+HSl57OY=; b=Y34Y87yk6U3smSUvYcRb6FaWQgF//DY8iZULz1WE9zRPVT2ZUVACv2b9O8ks9/SiI2/G1H Mf7eppIyxzdvyzQ6Xv9xm1i46QgLmIIDAo1l512CT6DFjaW3L/KZqbBF//UD/zHv+gfzvB aagMk7zJ3AngqHZvlaLY/F7pVpO3xXskV2+IV/EBfgAXK4iGva2mk3kbBjwWkGMWFaAc8w G8GHOXSh0P9vlvrlz6p2jToH7u4/A0HJq9QMC//UB1Pt292mZU2AuDqDwdNUm5JV0rTYiT jJqj6lPfyzm+6vadOhOnNGGnjC78ULqLnJ/hxgc2bmP7/WiF85GwD7KriidUjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wbz5G0SLYzX4j; Sat, 3 Aug 2024 23:13: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 473ND549012621; Sat, 3 Aug 2024 23:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473ND5f6012618; Sat, 3 Aug 2024 23:13:05 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:13:05 GMT Message-Id: <202408032313.473ND5f6012618@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: 25d9ade9aa50 - stable/14 - tcp: implement challenge ACK throttling for the base stack List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 25d9ade9aa50b22eb5fb0b6aaabbc808fb076c18 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=25d9ade9aa50b22eb5fb0b6aaabbc808fb076c18 commit 25d9ade9aa50b22eb5fb0b6aaabbc808fb076c18 Author: Michael Tuexen AuthorDate: 2024-07-25 11:54:52 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:12:28 +0000 tcp: implement challenge ACK throttling for the base stack Implement ACK throttling of challenge ACKs as described in RFC 5961. Reviewed by: Peter Lei, rscheff, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46066 (cherry picked from commit 40299c55a05ff008102e24269d5f2d7fa7b6842d) --- sys/netinet/tcp_input.c | 15 +++------------ sys/netinet/tcp_subr.c | 39 +++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 6 ++++++ 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index cb72ddbef947..500d208b7756 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2187,10 +2187,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, } } else { TCPSTAT_INC(tcps_badrst); - /* Send challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, - tp->rcv_nxt, tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; } } @@ -2212,10 +2209,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, rstreason = BANDLIM_UNLIMITED; } else { tcp_ecn_input_syn_sent(tp, thflags, iptos); - /* Send challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, - tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; } goto drop; @@ -2453,10 +2447,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, TCPSTAT_INC(tcps_rcvghostack); else TCPSTAT_INC(tcps_rcvacktooold); - /* Send a challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, - tp->rcv_nxt, tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; goto drop; } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 9fc744c42e0c..e2b120223bc0 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2222,6 +2222,45 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, lgb->tlb_errno = output_ret; } +/* + * Send a challenge ack (no data, no SACK option), but not more than + * tcp_ack_war_cnt per tcp_ack_war_time_window (per TCP connection). + */ +void +tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) +{ + sbintime_t now; + bool send_challenge_ack; + + if (tcp_ack_war_time_window == 0 || tcp_ack_war_cnt == 0) { + /* ACK war protection is disabled. */ + send_challenge_ack = true; + } else { + /* Start new epoch, if the previous one is already over. */ + now = getsbinuptime(); + if (tp->t_challenge_ack_end < now) { + tp->t_challenge_ack_cnt = 0; + tp->t_challenge_ack_end = now + + tcp_ack_war_time_window * SBT_1MS; + } + /* + * Send a challenge ACK, if less than tcp_ack_war_cnt have been + * sent in the current epoch. + */ + if (tp->t_challenge_ack_cnt < tcp_ack_war_cnt) { + send_challenge_ack = true; + tp->t_challenge_ack_cnt++; + } else { + send_challenge_ack = false; + } + } + if (send_challenge_ack) { + tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, + tp->snd_nxt, TH_ACK); + tp->last_ack_sent = tp->rcv_nxt; + } +} + /* * Create a new TCP control block, making an empty reassembly queue and hooking * it to the argument protocol control block. The `inp' parameter must have diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index e7cccd60a95e..f41fdaca13ac 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -461,6 +461,11 @@ struct tcpcb { /* TCP Fast Open */ uint8_t t_tfo_client_cookie_len; /* TFO client cookie length */ uint32_t t_end_info_status; /* Status flag of end info */ + sbintime_t t_challenge_ack_end; /* End of the challenge ack epoch */ + uint32_t t_challenge_ack_cnt; /* Number of challenge ACKs sent in + * current epoch + */ + unsigned int *t_tfo_pending; /* TFO server pending counter */ union { uint8_t client[TCP_FASTOPEN_MAX_COOKIE_LEN]; @@ -1469,6 +1474,7 @@ int tcp_default_output(struct tcpcb *); void tcp_state_change(struct tcpcb *, int); void tcp_respond(struct tcpcb *, void *, struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, uint16_t); +void tcp_send_challenge_ack(struct tcpcb *, struct tcphdr *, struct mbuf *); bool tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); void tcp_setpersist(struct tcpcb *); From nobody Sat Aug 3 23:21:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WbzGq5VVzz5RXSn; Sat, 03 Aug 2024 23:21:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WbzGq4n5Bz4R7l; Sat, 3 Aug 2024 23:21:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722727283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aUK3K5t8g1wnc/cE8rj9KXrHsvzKcASjhdtlwYTy95E=; b=JWqpwPN7WLaFwbSYDlmIFuHAhdWz9cQJguDTfTpyPjJ0aOVt/3Wnphk76wX/sDRDrpoCJj un+GU4a5LRGx5jEzN41nGNq6HTNCV3TO41+iXQBl0NIsAh7IF98Qkg9yAeMJCTk80P5y14 90NijU+6ffX4wavzHjppZffJYnkLORRZWFGGpO5JuvoPhgHm7iBppDnTyNUwqqntKb2Y/n bivRGWHicLCAF42BWwHNlhn3HJhEe/5JNd32KNqS/8dq7Q/tZnJU4UeXhj62MPYew8bNRc Uem68a9WTMlXHl5vkRIrU75Zi6x7vmojFAU8cx8/LeNTZaCwJF91bXdnPSGlxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722727283; a=rsa-sha256; cv=none; b=kroI3426vxHR2h0u3XZt1HOiNOyBxe1TXwJzeIq2dwMxlM8epkhbU3c0uxzfTgiGkPw3HV IMezFIDzlSvZEnp7pNIPZdgTecYfC+U9//kcEB0RU9wisfQoLrVJjesHu/+w+tKNSn3FPB /k8wcVV2WnzQFdrGDDAgJkx6K5oY4Qso7BR8CV4Vb52VTWVNg6im4MP4hUd2FZxkv6/YH1 DopGljWW1h2szjKG6SfLDF6czBgsh2FFoBNjjAXhVc0nUEMHKYwWRTAJ0HKnrQIIRPpm/W Vq3X0u25YaVcfNGe5x1kMI7yD1WdFjg2EdxCTPy2yDRah68qMgODqyvMoj8RTg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722727283; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aUK3K5t8g1wnc/cE8rj9KXrHsvzKcASjhdtlwYTy95E=; b=R39oNke+8tj7+axZUlJNXkNrnF2WEylQ96zNm/G9PHxaPUTNil3leEnYMbKCAKaHxgCCfl oKlZ0kxmVFrbqRIAHSfSK2TTxuezEWYVWp3MK6b+PBNr1DyXzBoudrFnsp7p2kT3bVAU9X xJj4y0VmNivGXtJjru0Jp3y59ndVLtbpPLyWjGfZI5QunaVXuUbizGJb84LnTAUoKVCrdu BvRvk92QY4k1wCIF/dIakBfK3/07aBDSmocxI78mrkuSxePpaMBmSRQ3X3WoMRkxGSMi8A RBzQ0wxc4pgCjX63o3JU3X+9r0koAzXKs7sn0mb83iGu1Ot5zY++UgJr9bt95Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WbzGq4LyqzXZP; Sat, 3 Aug 2024 23:21: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 473NLNkM024406; Sat, 3 Aug 2024 23:21:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 473NLNbp024403; Sat, 3 Aug 2024 23:21:23 GMT (envelope-from git) Date: Sat, 3 Aug 2024 23:21:23 GMT Message-Id: <202408032321.473NLNbp024403@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: 4401d7b362b1 - stable/14 - tcp: vnetify sysctl variables ack_war_timewindow and ack_war_cnt List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: 4401d7b362b18d867b50eefe1b6258760c8c9870 Auto-Submitted: auto-generated The branch stable/14 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4401d7b362b18d867b50eefe1b6258760c8c9870 commit 4401d7b362b18d867b50eefe1b6258760c8c9870 Author: Michael Tuexen AuthorDate: 2024-07-28 20:36:34 +0000 Commit: Michael Tuexen CommitDate: 2024-08-03 23:19:29 +0000 tcp: vnetify sysctl variables ack_war_timewindow and ack_war_cnt As suggested by glebius@. While there, improve the documentation. Reviewed by: Peter Lei, cc Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D46140 (cherry picked from commit 4036380e029708f5d6ad7aa599ce1bba9d7c067b) --- share/man/man4/tcp.4 | 20 +++++++++++++++++++- sys/netinet/tcp_stacks/rack_bbr_common.c | 16 ++++++++-------- sys/netinet/tcp_subr.c | 24 +++++++++++------------- sys/netinet/tcp_var.h | 4 ++++ 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 1f5cc7734bbf..da88a30bf86a 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -33,7 +33,7 @@ .\" .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" -.Dd July 21, 2024 +.Dd July 28, 2024 .Dt TCP 4 .Os .Sh NAME @@ -434,6 +434,17 @@ branch of the MIB, which can also be read or modified with .Xr sysctl 8 . .Bl -tag -width ".Va v6pmtud_blackhole_mss" +.It Va ack_war_timewindow , ack_war_cnt +The challenge ACK throttling algorithm defined in RFC 5961 limits +the number of challenge ACKs sent per TCP connection to +.Va ack_war_cnt +during the time interval specified in milliseconds by +.Va ack_war_timewindow . +Setting +.Va ack_war_timewindow +or +.Va ack_war_cnt +to zero disables challenge ACK throttling. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE @@ -1080,6 +1091,13 @@ when trying to use a TCP function block that is not available; .%T "The Addition of Explicit Congestion Notification (ECN) to IP" .%O "RFC 3168" .Re +.Rs +.%A "A. Ramaiah" +.%A "R. Stewart" +.%A "M. Dalal" +.%T "Improving TCP's Robustness to Blind In-Window Attacks" +.%O "RFC 5961" +.Re .Sh HISTORY The .Tn TCP diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 4a4a8af2bd78..b218f449475f 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -535,8 +535,8 @@ void ctf_ack_war_checks(struct tcpcb *tp, uint32_t *ts, uint32_t *cnt) { if ((ts != NULL) && (cnt != NULL) && - (tcp_ack_war_time_window > 0) && - (tcp_ack_war_cnt > 0)) { + (V_tcp_ack_war_time_window > 0) && + (V_tcp_ack_war_cnt > 0)) { /* We are possibly doing ack war prevention */ uint32_t cts; @@ -550,9 +550,9 @@ ctf_ack_war_checks(struct tcpcb *tp, uint32_t *ts, uint32_t *cnt) if (TSTMP_LT((*ts), cts)) { /* Timestamp is in the past */ *cnt = 0; - *ts = (cts + tcp_ack_war_time_window); + *ts = (cts + V_tcp_ack_war_time_window); } - if (*cnt < tcp_ack_war_cnt) { + if (*cnt < V_tcp_ack_war_cnt) { *cnt = (*cnt + 1); tp->t_flags |= TF_ACKNOW; } else @@ -772,8 +772,8 @@ __ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, KMOD_TCPSTAT_INC(tcps_badrst); if ((ts != NULL) && (cnt != NULL) && - (tcp_ack_war_time_window > 0) && - (tcp_ack_war_cnt > 0)) { + (V_tcp_ack_war_time_window > 0) && + (V_tcp_ack_war_cnt > 0)) { /* We are possibly preventing an ack-rst war prevention */ uint32_t cts; @@ -787,9 +787,9 @@ __ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, if (TSTMP_LT((*ts), cts)) { /* Timestamp is in the past */ *cnt = 0; - *ts = (cts + tcp_ack_war_time_window); + *ts = (cts + V_tcp_ack_war_time_window); } - if (*cnt < tcp_ack_war_cnt) { + if (*cnt < V_tcp_ack_war_cnt) { *cnt = (*cnt + 1); send_challenge = 1; } else diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index e2b120223bc0..a2424f2ab4d6 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -193,16 +193,14 @@ SYSCTL_INT(_net_inet_tcp_sack_attack, OID_AUTO, sad_low_pps, &tcp_sad_low_pps, 100, "What is the input pps that below which we do not decay?"); #endif -uint32_t tcp_ack_war_time_window = 1000; +VNET_DEFINE(uint32_t, tcp_ack_war_time_window) = 1000; SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_timewindow, - CTLFLAG_RW, - &tcp_ack_war_time_window, 1000, - "If the tcp_stack does ack-war prevention how many milliseconds are in its time window?"); -uint32_t tcp_ack_war_cnt = 5; -SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_cnt, - CTLFLAG_RW, - &tcp_ack_war_cnt, 5, - "If the tcp_stack does ack-war prevention how many acks can be sent in its time window?"); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_ack_war_time_window), 0, + "Time interval in ms used to limit the number (ack_war_cnt) of challenge ACKs sent per TCP connection"); +VNET_DEFINE(uint32_t, tcp_ack_war_cnt) = 5; +SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_cnt, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_ack_war_cnt), 0, + "Maximum number of challenge ACKs sent per TCP connection during the time interval (ack_war_timewindow)"); struct rwlock tcp_function_lock; @@ -2224,7 +2222,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, /* * Send a challenge ack (no data, no SACK option), but not more than - * tcp_ack_war_cnt per tcp_ack_war_time_window (per TCP connection). + * V_tcp_ack_war_cnt per V_tcp_ack_war_time_window (per TCP connection). */ void tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) @@ -2232,7 +2230,7 @@ tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) sbintime_t now; bool send_challenge_ack; - if (tcp_ack_war_time_window == 0 || tcp_ack_war_cnt == 0) { + if (V_tcp_ack_war_time_window == 0 || V_tcp_ack_war_cnt == 0) { /* ACK war protection is disabled. */ send_challenge_ack = true; } else { @@ -2241,13 +2239,13 @@ tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) if (tp->t_challenge_ack_end < now) { tp->t_challenge_ack_cnt = 0; tp->t_challenge_ack_end = now + - tcp_ack_war_time_window * SBT_1MS; + V_tcp_ack_war_time_window * SBT_1MS; } /* * Send a challenge ACK, if less than tcp_ack_war_cnt have been * sent in the current epoch. */ - if (tp->t_challenge_ack_cnt < tcp_ack_war_cnt) { + if (tp->t_challenge_ack_cnt < V_tcp_ack_war_cnt) { send_challenge_ack = true; tp->t_challenge_ack_cnt++; } else { diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index f41fdaca13ac..9ba13b779616 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1278,6 +1278,8 @@ VNET_DECLARE(int, tcp_log_in_vain); VNET_DECLARE(int, drop_synfin); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(uint32_t, tcp_ack_war_cnt); +VNET_DECLARE(uint32_t, tcp_ack_war_time_window); VNET_DECLARE(int, tcp_autorcvbuf_max); VNET_DECLARE(int, tcp_autosndbuf_inc); VNET_DECLARE(int, tcp_autosndbuf_max); @@ -1328,6 +1330,8 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcbinfo VNET(tcbinfo) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_ack_war_cnt VNET(tcp_ack_war_cnt) +#define V_tcp_ack_war_time_window VNET(tcp_ack_war_time_window) #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) #define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) From nobody Sun Aug 4 10:23:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyc46Xmz5SXyr; Sun, 04 Aug 2024 10:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyc2ynGz4CB1; Sun, 4 Aug 2024 10:23:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jm8E8UBN+mirj/qfY8hWzz7XblUgDoq/MUw6qB+Oag=; b=UxMHdTECTxy6WtgI0Ic6srkkXBG+Ad568nrGiEkzyYFY0RpgFGO8+ro9ULtkVobpHAH82j 7ziJRHwEHaAT2tSToQMivRZxr0Fwxl8MWL5HGqcVJpVteWVCOFuXinsXoCBjyPo4YXe2EN ZXi+foi2JtaC1bLtz5tCSTimSby4R+Wvm/6ygc40RBUhbpcgzALrveGcg8sbm5Ja18Ly9Q zVuSI1h/3DFbclM8Un8dVDPS0FGE5MCsxgoRVS/XoVUgtZVD8bl6rA2+0DUjD7MBWkp3Yr LgIMnpt7UyWdmMPn5s1zbGezk2WcpBTfL0SqUnzmBwirsbyTlgZMxVhT8hTcIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767000; a=rsa-sha256; cv=none; b=wmAuKEBdDBpHFOVj32CcZV8dKmXcooyqrnWSVX1qTg1lNjC6Cl5Cjl2AHFvhEaCGNELc+I KE2pzyRDAAionObW4W8Fiske+oGqF79a6C0ZqYhvUKvsRVcL3Ca59atiPbJ3xf6YFNb1Vt QV9aIiuBm/ETb+uJlY1CeGgbMejnPBbUjPZvn+s/oR31+FL1RfqEiCCXhCGfJgKqX34fid njdSwBslhsksuF9r+QnOPV0dyy1YXomnduGbFyQJ8O5RrEqw/64F+ykdWIq7SifsTAJZsE yisqzoCIWRRaANpfkgkRhuTAogfO7iC6mOAW++fM8pSuabRgkShPFFejSoT4qQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8jm8E8UBN+mirj/qfY8hWzz7XblUgDoq/MUw6qB+Oag=; b=phJAlkR/2CXWS7QqsvccCX2NWXRI1V/hjPSsS3uoZX3t0NIdyK3CVaaWgettIMjpEet1eJ jxCBIeW52hDV+2sPFIDNcGiyIU9J1ydxlqYAr8C834spwO7JOrsX+Gb5ff/2faZKguh1V6 NzArnq28uzkmdcOYoZ0VLY7Wqa1BV5PNbRQJqR2o/GnF0Q/r6zDmZRByiiZP6fsS/Y4O7T WSx3mdNhhcza3ME1v5baQRcRTU2j8I2d+ryQDfO0EipmIxLdjvXOfaoPqWOEFSS3IZz0/4 xmjUJQ65q2I9cB6XPbQMhHSBU9bxw5oUOToU04nErDavcy8dRKiaYa4AseD39Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyc2ZB7zrdr; Sun, 4 Aug 2024 10:23: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 474ANKip045607; Sun, 4 Aug 2024 10:23:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANKDP045604; Sun, 4 Aug 2024 10:23:20 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:20 GMT Message-Id: <202408041023.474ANKDP045604@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: e656c69b8d50 - stable/14 - Fix enum warning in heimdal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e656c69b8d50ab13a08d315d49f289287b97f83a Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=e656c69b8d50ab13a08d315d49f289287b97f83a commit e656c69b8d50ab13a08d315d49f289287b97f83a Author: Dimitry Andric AuthorDate: 2024-07-30 18:31:47 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:02 +0000 Fix enum warning in heimdal This fixes a clang 19 warning: crypto/heimdal/lib/krb5/deprecated.c:75:17: error: comparison of different enumeration types ('krb5_keytype' (aka 'enum ENCTYPE') and 'enum krb5_keytype_old') [-Werror,-Wenum-compare] 75 | if (keytype != KEYTYPE_DES || context->etypes_des == NULL) | ~~~~~~~ ^ ~~~~~~~~~~~ In https://github.com/heimdal/heimdal/commit/3bebbe5323 this was solved by adding a cast. That commit is rather large, so I'm only applying the one-liner here. MFC after: 3 days (cherry picked from commit 6f25b46721a18cf4f036d041e7e5d275800a00b3) --- crypto/heimdal/lib/krb5/deprecated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/krb5/deprecated.c b/crypto/heimdal/lib/krb5/deprecated.c index e7c0105ebf7f..02cf7614f932 100644 --- a/crypto/heimdal/lib/krb5/deprecated.c +++ b/crypto/heimdal/lib/krb5/deprecated.c @@ -72,7 +72,7 @@ krb5_keytype_to_enctypes_default (krb5_context context, unsigned int i, n; krb5_enctype *ret; - if (keytype != KEYTYPE_DES || context->etypes_des == NULL) + if (keytype != (krb5_keytype)KEYTYPE_DES || context->etypes_des == NULL) return krb5_keytype_to_enctypes (context, keytype, len, val); for (n = 0; context->etypes_des[n]; ++n) From nobody Sun Aug 4 10:23:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyd5G65z5SYTB; Sun, 04 Aug 2024 10:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyd4FvDz4BrB; Sun, 4 Aug 2024 10:23:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jGQ1IGcFQyeg4vxc5SVTPgK2u/5ZJvT2DQEBWUXEZdU=; b=Yh7CzeSFBWieb+fWQEs01aycqSYvL04XXIyyWIaccV9t+6eQi3J+ufaVkYSRy/6QfpCy85 JfjqO3VGRxnsGABP0wyiVn2VfiXz1TuJrZrSZQxxzIDoZTu0TIPEk4ofLjFqQQjixTTmb+ 4fYOywobUQgo7gRrtC6kBPNBEDRsYj4KS6sbwVkCYEL2hsPwC006jq0/5Lt9GDyzV4R0ON xZc0woYBAb8it6ZoW5mp0bb7uOfcnnsz2T7nK1p/3pasLS4pMtmkJe9hrJknjnjq+eKKE2 NNVkRd3T8RAl8uFOd8IMvu2Cl3BDDrytInA9Ouhwvey+s6MX58qG56VLkmTCSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767001; a=rsa-sha256; cv=none; b=BQrAE+Dr3UOaJ0FmQ+VcfiPrJE9LjudgNWfYs1qnW7e0LSBZzottfd8H6B1P5CBXzNVtjy rPlADOi3cvXLpZIVn/hfAZEpPxqP+swocARDurPCNXWMGFuQrMNpXXB2I/XJaGgAQf0Fv1 eTr/qaKEPsCa74FUV6F7sU9RuwzWl+9Qjjy1j9vJYEz/VY1VNr6hfitBGB1ZZLUYVwdnsq 5ytVgD1g5+B/h5LkkAm/Q2ut3wt+k80VeP07Zh+8lSWq6WkhxBj4MFvMRO42ziN7gEL0D1 HBmTyyiDcCH7mGtNaTVBWsdShOcXK0+f+0tydvmS+MumwMI/iCEUWI6CsgI0rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jGQ1IGcFQyeg4vxc5SVTPgK2u/5ZJvT2DQEBWUXEZdU=; b=lWIlcNbhu28CG6zIfkNO8kyV2ABZZbQEf8G7ulpLMjShZZ+0T4MkxHyoFRUxCXUHe20rkd JgEkUI9Bq9C026yHg44K5HyURPwa/qBgKqImg5G1mnTgtEjVUkaSjeipx3ipGo4T9TIGrB mPNoKEu/9OKUIM3F63xxfx/3eXk1sr2UEbgEOdrKk+rJQM/AH+1q9fgwH69an5cC/bE5zA FmyoJJ7ttAwi2jUN1d1eg8YEkXwQT0UvTEXao0pObZrGnTunHAk4kYkWratNBB18uL6PcZ LDU87U1PAGluSNn6lBiHcy4oeMIcPLGwP05Y6Hwv0M0wkqr/+MJSTHzV1xalBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyd3sN1zs9J; Sun, 4 Aug 2024 10:23: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 474ANLlJ045652; Sun, 4 Aug 2024 10:23:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANLeU045649; Sun, 4 Aug 2024 10:23:21 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:21 GMT Message-Id: <202408041023.474ANLeU045649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2b05d46dc32f - stable/14 - Fix incorrect -I option in sys/conf/Makefile.arm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b05d46dc32f89f915ed3f75b988925b43ebcd7a Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2b05d46dc32f89f915ed3f75b988925b43ebcd7a commit 2b05d46dc32f89f915ed3f75b988925b43ebcd7a Author: Dimitry Andric AuthorDate: 2024-07-31 19:23:41 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:10 +0000 Fix incorrect -I option in sys/conf/Makefile.arm In commit 8e53cd7099436 the intent was to add sys/dts/include to the compiler include path, but this was spelled incorrectly, leading to an error with clang 19: cc: error: no such include directory: '$/dts/include' [-Werror,-Wmissing-include-dirs] Use the spelling -I$S/dts/include instead. MFC after: 3 days (cherry picked from commit 8ce3e489a5eec1b41bc5e08f43c5e95aa8115b93) --- sys/conf/Makefile.arm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/Makefile.arm b/sys/conf/Makefile.arm index af6ce7136636..5195191e0156 100644 --- a/sys/conf/Makefile.arm +++ b/sys/conf/Makefile.arm @@ -29,7 +29,7 @@ S= ../../.. .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$$/dts/include +INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$S/dts/include LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" From nobody Sun Aug 4 10:23:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyf70rfz5SYTD; Sun, 04 Aug 2024 10:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyf5Jwsz4BPB; Sun, 4 Aug 2024 10:23:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cV/jcPWc9fxh+89lHvK5doB6h/Qeexzrg8IV36yVvBE=; b=EHewHolY44e4nCen8tOjd2My4cJJuIFpy9sXJPUEKLoNSxDdVEI8X6RlbRnAtF/Fe4iQy0 R47xNlZ8uFhcacXGxhcYoaGYf8a5i5A33F1sztsxcmcahwVa/fUAiGZFwgna5loEjFwgGX zByuDN9TaiWNPJr69BKRTbSZ9PJB9ErJdS+NxYwX7m0IXXBQTPPRgi539bOFXvV3ThsULm 3AlyOpn7EbQDNKCsFTh6YlAqcLDoCeDzN/zBY58bGXb2CjhCesrH9ZWz3tT1zcY4770N5P 3e7RCmERVa5BuOqHiCWjZxhrVPe6ug+geJtHuNnpOqiU6l9O4tDtU3lY2akcnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767002; a=rsa-sha256; cv=none; b=m/latpn31urYiQ8AuUXy5Uh/I95RA8SmRQH2mhm+KTdR8ed/NmunxHjxGPZGC4U6kH2z5f nrMWcFk0js8iUIZbpxXMHrWPr18XVhrvEqYn2Vr/OK2hw8vG9AVqM3SMhA2YEKWHnhJ7i+ LT1S2eoS0fM0I9HhjqRtIdNX/U3oGBHmNgsdixAqTQQ/8qfZkMdErzCkv+QmDq5UExqxaJ 3m/Pk/ChE+0MLgNTDVTC9aX1jb/g1z7Gs2BBY2KWLVResjGJNeuwNOkwR5ltj447Sek7HL u1GZSKp8MEssaEviKmhfvxjCzoKdyvPvxRfpYzMLytmVz68bEr++D36tninUIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cV/jcPWc9fxh+89lHvK5doB6h/Qeexzrg8IV36yVvBE=; b=rrXk+sxRvlvni3By83+5yv1fkvmDCrPVms+zo6YxB6S4TMHbdHG0laNnI0vwkCk9Ht0umZ 5it3pCNsBAIBoUriL5/DWJm5BUDNwVgUGOMb/hBamlfdG6zSKMxropFGMqMqxK4af4MeXh /Y1ppqkxn3QFbePFPsmkY9zFI0+NHmLqpRE5Q/X+2/qx3PCmKWh9H2v5S5tP4TelwyzsWb HiIdIG1ms/Obwyx96ssNbK/d4fnllNXOc6anFoQKMr6Aay2KRswIc05zAdhdaujwqdCBM4 hfRtWCnhsYvWBNbgy2MNFOyQXvxa7d7KuqXl6WojULFstizRAu/SM/TasXxxSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyf4vWCzsCn; Sun, 4 Aug 2024 10:23: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 474ANMVX045694; Sun, 4 Aug 2024 10:23:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANM0e045691; Sun, 4 Aug 2024 10:23:22 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:22 GMT Message-Id: <202408041023.474ANM0e045691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 7ffa2d91fbdf - stable/14 - Fix enum warning in isci List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ffa2d91fbdf2cc9984c1cfdcb475c783308b7ad Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=7ffa2d91fbdf2cc9984c1cfdcb475c783308b7ad commit 7ffa2d91fbdf2cc9984c1cfdcb475c783308b7ad Author: Dimitry Andric AuthorDate: 2024-07-31 11:14:17 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:16 +0000 Fix enum warning in isci This fixes a clang 19 warning: sys/dev/isci/scil/scif_sas_smp_remote_device.c:197:26: error: comparison of different enumeration types ('SCI_IO_STATUS' (aka 'enum _SCI_IO_STATUS') and 'enum _SCI_STATUS') [-Werror,-Wenum-compare] 197 | if (completion_status == SCI_FAILURE_RETRY_REQUIRED) | ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ The `completion_status` variable is of type `SCI_IO_STATUS`, not `SCI_STATUS`. In this case, we can seamlessly replace the value with `SCI_IO_FAILURE_RETRY_REQUIRED`, which is numerically equal to `SCI_FAILURE_RETRY_REQUIRED`. MFC after: 3 days (cherry picked from commit 1bd66fac35ec27fa64d6158f82fdcbdc26098679) --- sys/dev/isci/scil/scif_sas_smp_remote_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/isci/scil/scif_sas_smp_remote_device.c b/sys/dev/isci/scil/scif_sas_smp_remote_device.c index d6055adc13f9..c72402f66889 100644 --- a/sys/dev/isci/scil/scif_sas_smp_remote_device.c +++ b/sys/dev/isci/scil/scif_sas_smp_remote_device.c @@ -194,7 +194,7 @@ SCI_STATUS scif_sas_smp_remote_device_decode_smp_response( //if Core set the status of this io to be RETRY_REQUIRED, we should //retry the IO without even decode the response. - if (completion_status == SCI_FAILURE_RETRY_REQUIRED) + if (completion_status == SCI_IO_FAILURE_RETRY_REQUIRED) { scif_sas_smp_remote_device_continue_current_activity( fw_device, fw_request, SCI_FAILURE_RETRY_REQUIRED From nobody Sun Aug 4 10:23:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyh48KYz5SY4D; Sun, 04 Aug 2024 10:23:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyg6SBgz4CMP; Sun, 4 Aug 2024 10:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DuLtkTJgQvVYr7Kle/Th88Ah+aDSC1jQ/OuvTxCgRv8=; b=N+LMKJ09RBi03uDJMzB/oSxD3BnkBHIkbtdFEN9JED4zPe7wRhpOD6TbMLGvv+vX9124SV /eyPSO7hQn4cO3QOQnF0aa2te4cy6h+ZU9ddFnxwFPawWnlQGm/slUABWsYI9cvMb965VX wSiLI3o/vS9OgNhCRSWyEF9TAIET9LRZo4pddMJ8s/iYapqIqKayL1G/Eg/3ljocFClByI R7Kndpzq9C3q64x2UP67ak3H5AgzvuVMeBFIPOxMgmk3qzIRNZD+eOjT+Dz6WJiwgyfLct YIfMYAWnY23pXrENkuwJtT7KnN+6E7fEdXfdhOJQ9Q15Xs+lgSXNOUndAGwj3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767003; a=rsa-sha256; cv=none; b=DCPyBIu7Vldv+CO6anrKIkRF5uhRohkQUe5bYqLtWnUnfR3wOsztur0Og9NgzL1W5KqwQK Kaa/wSttdMEW+N83zbuJ2x4rqF6rGHMuQGsnkUjNv+nhdR3O+IT42PN8g9ndeO2s+r6bCa SQ0YSJsGkagutc5umHIbIggq8U4+j9ADMDB5OGd3MYmAxW8E4F/thgS8tUkGF6qn/+FK/F 0V7MWTOzWXJGOGOgeyY+lzPV71iFzT+CuFX1B/e+u3p0kghdob6cq0u3mNeSSrg1RMszgT Al5qShzcuSf0k6RnC/q65qt8/cb5StShvI3vtvTYmQ+OzLXu4oSi+YPdQXmxLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DuLtkTJgQvVYr7Kle/Th88Ah+aDSC1jQ/OuvTxCgRv8=; b=m66axotdsLY33L7B7oir+bWTgRdb2HQuXnma2gcBEXGWiTBA7ERCOSZlE/DUzsqnWLl7Yv ema/nNZyagD0PpFhdcIOqFTHFGPJ0Wg3tyw1aVdxWpRz8Ov5yXIRWeTJqEdK9jkAXa+sFw EfuTVKCMSHqPNfoPjQrH31NKn+6aq+F3gRB0wBIC+4u4iRTwoagHLjRra4dvS+da3h00yQ lLfaDAERkxDkbvThf+Nb9UEV49bPmtwfX4T4W3yBMUHYDyQT7wK2UJBvi/4POc7oFrFrqY HS7pddA+esqXsTvvhVXuq/COvLKQufNmorRp7iTSAyPGx9/WscN1XTXfvX2rMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyg5x7rzs8h; Sun, 4 Aug 2024 10:23: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 474ANNEo045736; Sun, 4 Aug 2024 10:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANNpK045733; Sun, 4 Aug 2024 10:23:23 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:23 GMT Message-Id: <202408041023.474ANNpK045733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: fa59de726fa2 - stable/14 - Fix enum warning in keyserv List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fa59de726fa2ed25c79ca8400b38f9feab905f85 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=fa59de726fa2ed25c79ca8400b38f9feab905f85 commit fa59de726fa2ed25c79ca8400b38f9feab905f85 Author: Dimitry Andric AuthorDate: 2024-07-30 22:35:03 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:22 +0000 Fix enum warning in keyserv This fixes a clang 19 warning: usr.sbin/keyserv/crypt_server.c:237:53: error: comparison of different enumeration types ('des_mode' (aka 'enum des_mode') and 'enum desmode') [-Werror,-Wenum-compare] 237 | if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { | ~~~~~~~~~~~~~~ ^ ~~~ The type of `argp->des_mode` (aka `desargs::des_mode`) is `enum des_mode` from `/usr/include/rpcsvc/crypt.h`, not `enum desmode` from `/usr/include/rpc/des.h` (which is used in `struct desparams`). Luckily the integer values of `enum desmode`'s `CBC` and `ECB` are identical to those of `enum des_mode`'s `CBC_DES` and `ECB_DES`, so replace both values. MFC after: 3 days (cherry picked from commit 1d5a5500ad4b1f5187f40baaf58ab6868b18fc08) --- usr.sbin/keyserv/crypt_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/keyserv/crypt_server.c b/usr.sbin/keyserv/crypt_server.c index 04290326cf3b..ccd593fe4e97 100644 --- a/usr.sbin/keyserv/crypt_server.c +++ b/usr.sbin/keyserv/crypt_server.c @@ -236,9 +236,9 @@ des_crypt_1_svc(desargs *argp, struct svc_req *rqstp) * getting ECB mode. */ #ifdef BROKEN_DES - if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC_DES) { #else - if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB_DES) { #endif int i; char *dptr; From nobody Sun Aug 4 10:23:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyj3b9cz5SY6W; Sun, 04 Aug 2024 10:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyj0BqXz4CQC; Sun, 4 Aug 2024 10:23:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXmG8vf36rLS0jeCmaLW58shyaHIBaIVH4XbP2/lcoU=; b=bVU2dkWTJPBpihqG0Fp7L8Z+P+GCJVXMsWQS7lRndBJKtMKtCe2svSi3LkjwJqWzeVcoq0 1FmkbrIpTHZUm2nQdtxRNnVlSAMnz4VjIx09T/h3gK9whe2GORtKMyoVDSJTkosy+jD+It YuHvdZw0Jclif5skIIpUKhy0RH0YWw/CxnXdh5c+J4DeJY7D7rSQA4HqFHWquBM9SAFO2D bDIXMfj3wjukmgyYJ/pcI6MCTFlob0W0Rgk/5mIcKdBTdbl2BdLGSo+RKA8LQAbxWhZ+h2 4O8JpM1cKskay0RwKKE9TFiXeSpJusUMLaGfP5rO2WJtydHXoWf0DbWv+TjzNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767005; a=rsa-sha256; cv=none; b=umF7U5YGJBdFBTst9XlbOdXnl7cZqmOlZy9sVkzBWXfMc5i03FjJom7l4ezuIr9TO2xctU +oCh2pVU54G/D0+nFEg0CO5oD2VWxT+RusiUc29PigwjHMmdLXQuDZq++dH1FaSTFUJtP0 a5N9QZni/1faN1IfWWngAopxqPz1PlE9I2yw/jWdRP1TuCWJXoLyl+pnrjha/deNocHtNg IWNo07DzFMBP0Djzmj6KbRFnXTisOFUp9yi1w9rXCRt9IG8AFQS1I5kvl9EtWYXC6nFZE2 8Fm1Z2xxhY/daL4uedAG5dTQ7gi1crJ0YCZkOSmA9g2B2ENGv+o7d8gfPWA/cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXmG8vf36rLS0jeCmaLW58shyaHIBaIVH4XbP2/lcoU=; b=TU/PK37Cqm6AXpDDImyFUzWTqhT6jkWW9pYfLF7b+8OJedVHOkDrHIGav3bgQAC36rHNUt yRIm3ju36ufQ2PXImS4nGe/qIK5VqstPMWZaie1iJVErkm06ii0C67X4dOQj+iKCWsVWui gLXt26PzRP7yhOuwzCXaUuykSoiUye3Fdv3OeCqFr/wrvmuOSWgYrnV+tg2vOFpTJU0SWi j1RqXshKh20Rc9LA+bvJnPBITn8JmU2tUy5zks1IxoKtoU4rAi2McTm8tItsxTtG4rA6Tn VaylyrusBAM7o3isw7igo0n92A9nTz1F6EJK5vf74u+he/OZT88KPFvuNsv5uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyh6v9Wzs0y; Sun, 4 Aug 2024 10:23: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 474ANOrW045778; Sun, 4 Aug 2024 10:23:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANOXv045775; Sun, 4 Aug 2024 10:23:24 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:24 GMT Message-Id: <202408041023.474ANOXv045775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 4b521ea870c7 - stable/14 - Fix enum warnings in qat List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4b521ea870c733276811b2473a6648cbb0bea9f0 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=4b521ea870c733276811b2473a6648cbb0bea9f0 commit 4b521ea870c733276811b2473a6648cbb0bea9f0 Author: Dimitry Andric AuthorDate: 2024-07-31 12:21:25 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:28 +0000 Fix enum warnings in qat This fixes a number of clang 19 warnings: sys/dev/qat/qat_api/common/compression/dc_session.c:154:15: error: comparison of different enumeration types ('enum _CpaBoolean' and 'icp_qat_hw_compression_delayed_match_t') [-Werror,-Wenum-compare] 154 | if (CPA_TRUE == pService->comp_device_data.enableDmm) { | ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sys/dev/qat/qat_api/common/compression/dc_session.c:285:17: error: comparison of different enumeration types ('enum _CpaBoolean' and 'icp_qat_hw_compression_delayed_match_t') [-Werror,-Wenum-compare] 285 | (CPA_TRUE == pService->comp_device_data.enableDmm) ? | ~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `enableDmm` field of variable `comp_device_data` is of type `icp_qat_hw_compression_delayed_match_t`, not `CpaBoolean`. In this case, we can seamlessly replace the value with `ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED`, which is numerically equal to `CPA_TRUE`. MFC after: 3 days (cherry picked from commit 357378bbdedf24ce2b90e9bd831af4a9db3ec70a) --- sys/dev/qat/qat_api/common/compression/dc_session.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/qat/qat_api/common/compression/dc_session.c b/sys/dev/qat/qat_api/common/compression/dc_session.c index c92d6eebdc47..60f4410dac32 100644 --- a/sys/dev/qat/qat_api/common/compression/dc_session.c +++ b/sys/dev/qat/qat_api/common/compression/dc_session.c @@ -151,7 +151,8 @@ dcCompHwBlockPopulate(sal_compression_service_t *pService, } /* Set delay match mode */ - if (CPA_TRUE == pService->comp_device_data.enableDmm) { + if (ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED == + pService->comp_device_data.enableDmm) { dmm = ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; } else { dmm = ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_DISABLED; @@ -282,7 +283,8 @@ dcCompHwBlockPopulateGen4(sal_compression_service_t *pService, hw_comp_lower_csr.hash_update = ICP_QAT_HW_COMP_20_SKIP_HASH_UPDATE_DONT_ALLOW; hw_comp_lower_csr.edmm = - (CPA_TRUE == pService->comp_device_data.enableDmm) ? + (ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED == + pService->comp_device_data.enableDmm) ? ICP_QAT_HW_COMP_20_EXTENDED_DELAY_MATCH_MODE_EDMM_ENABLED : ICP_QAT_HW_COMP_20_EXTENDED_DELAY_MATCH_MODE_EDMM_DISABLED; From nobody Sun Aug 4 10:23:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFyk5mn5z5SYTK; Sun, 04 Aug 2024 10:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFyk19d4z4CSJ; Sun, 4 Aug 2024 10:23:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iX5mmIMl3MlgRYg2rTzG5NgzZFbGZY0f/3DFc0r7J/M=; b=OwrG3d8KULO60saqTrL75nWrdONtrBJ9ihRpsamJ995Vmz9emUQLeRbtsZXZpD9Dpiq6Yy 395iRO4XFMP185GteMojMN1MQDhzFjaJ1UTeTXErb7wn35ADj+BMhyfuQ4uoTUBfVkJzrd NgwGcP5QdgQ9LNKUuI/+EKMSZz/j9kmLi3CF/w1ylukD0VXUIhIkDMW+T3lAFUInJadOi1 UrDpq6sNP/lS+FrsR4HFh7QpfYtpEApHx21LE0JxtGDDofLIoB0ymZd9e5Ccilg8WVD1C7 uQTmUfP0G3r2EAdnXMXfbE4Zj70UWjp1VuajRpuI1MivLiLhsPXb3v+S6PmBBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767006; a=rsa-sha256; cv=none; b=t4sollsSwBCwsdtGy9NokTipAsmU8r58RNO5BXy1ePRA0o95pJxOjI7UBoO1hSz+wFkS/p QgcjoNPBJQQ/GIUSRcy1jztntG8SGdrEfqAc4/lTVxRTlPMHFYzc4ZsGpMg37JZR82ogEQ hiYHGEIz7YaJL1LJLNG6V4vqQM6WOms3z27MWx48d+uhQH0eOv0scmzGkanpPSyBacRmjZ Baze1k9r0kLDpNHSwDx5yWlCRe7wp+Cpknncjuz853M+NjZSguzAvnkT3HhL7QgOzagdDI obq7VTFt1hnuDh7mt0AX0A89ITkCqDA3jth+i/eW99f1Ebb3D6FSnHG5VmuvAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767006; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iX5mmIMl3MlgRYg2rTzG5NgzZFbGZY0f/3DFc0r7J/M=; b=YUGkS2Ia7yOeowAD+75dZ4GvMVLJ5bw/1OgCUwPw/sD7opNzsSVwLZ1dd6Tg6JwokkLTjV BfqoBuQHRJ5sk3H6XA2aMF8K7kZSAxEWSFSEmdd2N3+On69OZkmqW91USHJfomxf9/t5tO 022+gN4JUSIBvBF++oZA6L5LdNR1Ma8JcXCZ+OX+kvJXGz6vinZiiYxxLiFsvtwrBo0YaX CHKHl/rBHQ9o5hD21sKx9bx+tWVcX7TixpOm9psjn6zOUmMA6Brkn2bak2d0RVKtAJuyfq tD2JKGaag0yPXO+pOkN1bQm5PaWYOw7G0NV9jsRu+qZbidyF1x22dnPUHvZoBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFyk0nW3zs8j; Sun, 4 Aug 2024 10:23: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 474ANQ2f045827; Sun, 4 Aug 2024 10:23:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474ANPGg045824; Sun, 4 Aug 2024 10:23:25 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:23:25 GMT Message-Id: <202408041023.474ANPGg045824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 646d5b96b41d - stable/14 - Fix enum warning in iavf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 646d5b96b41db9296a64569a58f83a7af11cd9ca Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=646d5b96b41db9296a64569a58f83a7af11cd9ca commit 646d5b96b41db9296a64569a58f83a7af11cd9ca Author: Dimitry Andric AuthorDate: 2024-07-31 11:01:20 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:33 +0000 Fix enum warning in iavf This fixes a clang 19 warning: sys/dev/iavf/iavf_lib.c:514:39: error: comparison of different enumeration types ('enum virtchnl_vsi_type' and 'enum iavf_vsi_type') [-Werror,-Wenum-compare] 514 | if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ The `vsi_type` field of `struct virtchnl_vsi_resource` is of type `enum virtchnl_vsi_type`, not `enum iavf_vsi_type`. In this case, we can seamlessly replace the value with `VIRTCHNL_VSI_SRIOV`, which is numerically equal to `IAVF_VSI_SRIOV`. MFC after: 3 days (cherry picked from commit 67be1e195acfaec99ce4fffeb17111ce085755f7) --- sys/dev/iavf/iavf_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index 883a722b3a03..f80e3765448f 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -511,7 +511,7 @@ iavf_get_vsi_res_from_vf_res(struct iavf_sc *sc) for (int i = 0; i < sc->vf_res->num_vsis; i++) { /* XXX: We only use the first VSI we find */ - if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) + if (sc->vf_res->vsi_res[i].vsi_type == VIRTCHNL_VSI_SRIOV) sc->vsi_res = &sc->vf_res->vsi_res[i]; } if (!sc->vsi_res) { From nobody Sun Aug 4 10:24:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFzW6gJcz5SY4V; Sun, 04 Aug 2024 10:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFzW6Cdgz4Djq; Sun, 4 Aug 2024 10:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hNHrXTxTEmdoqwNjPkN0zaiIrD9oAxL8FXz/f5HNWy4=; b=pWDtdFRoBij1BVvFID9t5cUASLgsMuRxoz7whABQZ5BQnMyntemsj0f+sN7ouilfzfsgEh jR2HpKbuGHxjJqN8jDUFLi+dyv4427wSuUYlCmSa0Ja+QbeA3Fx9F3cyrxrb0SGGYhIWsG tzZm37VHoKZ38hAC1uqrUcxpSUchhpvxmuij+/4tXjkNGPpqoui4+AHslCSwBn5TRaX/bB nwvzqmbRKXPohZD+SUvIms5UZuU5NUkLogPRWz/E9agnBrbAuRult8ZiV8slgovpGh9Pvr yxwxWnMZhAj7obBrHjP9saRtuuU0yxFk+hxE0MOrWHqr+T709WITdxv0HE7ZqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767047; a=rsa-sha256; cv=none; b=kvcn8U2+GCRE/Xqr0eh0uG67CRdeYiLg0PzQFrRna4iUYRn4Q2LEzLupcXBfZUhN/6sLuf RDN1WD8Zw/S0vn7JophQY019PMYABargHIfWKPtqU+UDfceucDbpgluJxbRx35X2Pu5+wr Ogod8NckHAf+0GXJgHq4mkd6g+UHIALhC1TQRlMpbMDbQU94bHgAI3Mt6FmuUpoQr4/MT6 wvsj4tEc2/6qOIMUNFeR7Z7utfgZciGvDgsQtnzGbHm0/cMHk6RT/9zuK/Z50knhKGo4AR +ReNYeUsgDrxICt2l0yez4mi0hpQ0x1CVy4KqWWvfIjAqYlC/IKFV4ugRafkbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767047; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hNHrXTxTEmdoqwNjPkN0zaiIrD9oAxL8FXz/f5HNWy4=; b=KZ+PPNPSpdHM65VbWA2M38XcMmYhHLsAJKVZyqK4SaLLB/fFfLT/YxMD0VUXe5+anm5kw/ 5zfjW4FNaciKgyDh48Yc2VcLer/LfHpSrd8tWexpjffFQF/fqJstSi+UCRJoZcH8m/5XEz QP/0PvejznEsgaqKu6D0kGhxWUdVPBNK5xtT0KUPei2c2f8x0XfiY57jvtFA4eUVcQcFra 8yMmJfqfPC20PpA0gDh4JZtOmbqvQKz0HRrlwfYg5EVvXFKqBkH/5PQcKCUontXEnJQ8rM wv7SQbgwMHezjTnmxDTu5rShRRVXTrWv0Cpd1+TQnKWqZrP8qonhqeVdZziuNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFzW5qSSzs9K; Sun, 4 Aug 2024 10:24: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 474AO7YR046089; Sun, 4 Aug 2024 10:24:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474AO7aY046086; Sun, 4 Aug 2024 10:24:07 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:24:07 GMT Message-Id: <202408041024.474AO7aY046086@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 86e5bb86772c - stable/13 - Fix enum warning in heimdal List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 86e5bb86772cd61197b7b964c1c008223bfbbb32 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=86e5bb86772cd61197b7b964c1c008223bfbbb32 commit 86e5bb86772cd61197b7b964c1c008223bfbbb32 Author: Dimitry Andric AuthorDate: 2024-07-30 18:31:47 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:21:47 +0000 Fix enum warning in heimdal This fixes a clang 19 warning: crypto/heimdal/lib/krb5/deprecated.c:75:17: error: comparison of different enumeration types ('krb5_keytype' (aka 'enum ENCTYPE') and 'enum krb5_keytype_old') [-Werror,-Wenum-compare] 75 | if (keytype != KEYTYPE_DES || context->etypes_des == NULL) | ~~~~~~~ ^ ~~~~~~~~~~~ In https://github.com/heimdal/heimdal/commit/3bebbe5323 this was solved by adding a cast. That commit is rather large, so I'm only applying the one-liner here. MFC after: 3 days (cherry picked from commit 6f25b46721a18cf4f036d041e7e5d275800a00b3) --- crypto/heimdal/lib/krb5/deprecated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/heimdal/lib/krb5/deprecated.c b/crypto/heimdal/lib/krb5/deprecated.c index e7c0105ebf7f..02cf7614f932 100644 --- a/crypto/heimdal/lib/krb5/deprecated.c +++ b/crypto/heimdal/lib/krb5/deprecated.c @@ -72,7 +72,7 @@ krb5_keytype_to_enctypes_default (krb5_context context, unsigned int i, n; krb5_enctype *ret; - if (keytype != KEYTYPE_DES || context->etypes_des == NULL) + if (keytype != (krb5_keytype)KEYTYPE_DES || context->etypes_des == NULL) return krb5_keytype_to_enctypes (context, keytype, len, val); for (n = 0; context->etypes_des[n]; ++n) From nobody Sun Aug 4 10:24:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFzY2N3Fz5SYWy; Sun, 04 Aug 2024 10:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFzY0K0Zz4DfF; Sun, 4 Aug 2024 10:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXjkhAkHpAMTOtCvQQOlWY6RemW1v3xj22NCtY5abak=; b=rKDVBBWRTTDVkzUiQxhyTJupHG0Cg3OadYVBsUH3FZd5k3Pm0E+ws3YRnjj5HNnxYGlu2n 7xwiZkxyQqMUg35Y2AYHx3pW3dH0lSruX7hmj3T39BYtxFjx+GDKgAlUTf0efAT8PUtbsB geOdQrqZN5tBA9JyGipgzHfHrd58G6cvUENiytPd3/wAg3vEnV7RpFpLruwLKeDuK9jaD8 6NRYSk2heydpfpX7BquVtWntES0s88BVthqpaEtryq3mI3f3zn1WtNfgBOTgfutvqc5PhU x8JsSaJ/x5Mjj/v4YaXbQRsqQ54Fw1ySdceMJCztaefI5vsKi4y/iGlpXcuWgg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767049; a=rsa-sha256; cv=none; b=v+GG25ADVeGN0XV5xI4x5Taz6OH4GrXCASn7yyrBW8Lxz+fDCSMNe4KhUX0ci8hdYFnBqn dWqPRfVVrW+T5cXMNzZnyzL2kQAGT4z7tBnccHePfi6DTMfhEI32PF06z/EU7EuFcP6qie CE0Yy36/fYaAeOOFWYfbDbtZNK0TiYGUmq+XrYVCCE95Zai91OXMM/wtKempLKJ/rViUIz /KROQ1qfNwSL08/vIbJ/aMKtU4Q/7BTIT7ivfxS346k6IW4miTlxN2ZkkAl53xT3oGJyJW W9YiAZmpggqEj0NSbryZ7gHYdFEAmwHiS+g+dzPfljde9a5XCd4FNRvSIIakQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXjkhAkHpAMTOtCvQQOlWY6RemW1v3xj22NCtY5abak=; b=Y16p/1ywCBV19fApcPJbFyJYvmwSI1Oj3vcnQsaO2ZbhwXDoEWuKsrxShqwjMFtBKenUrC Fp4/rc8V7qnWALJZaReOk+d796AUxohF20qei+ctvVGeinGg3ZqpDb2+DSUjhLp2d5Zfyk 5LHZ5cASlsl6QAddAIVWZ1NElrygEuIBJe1rsjsD2mzdiFyXETkAxedcUZLux3hGq29EWI P3QZq5XqEG/pUp7JBebzLp9E5SNUheDlYIZNzrMeoXNYwnVl5aBOxf++6niOxd7NyOIpfc W8FaVclYDDzcf/xO6hgqiKHgIrexo38gTTUg8P1dlF1MTiHFoFiWgVzP/zwTYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFzX72pczrhj; Sun, 4 Aug 2024 10:24: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 474AO8qV046131; Sun, 4 Aug 2024 10:24:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474AO8YD046128; Sun, 4 Aug 2024 10:24:08 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:24:08 GMT Message-Id: <202408041024.474AO8YD046128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 1a00a88a379c - stable/13 - Fix enum warning in isci List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a00a88a379c23825c5f91ff4d0a87a7ed72ca48 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1a00a88a379c23825c5f91ff4d0a87a7ed72ca48 commit 1a00a88a379c23825c5f91ff4d0a87a7ed72ca48 Author: Dimitry Andric AuthorDate: 2024-07-31 11:14:17 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:22:41 +0000 Fix enum warning in isci This fixes a clang 19 warning: sys/dev/isci/scil/scif_sas_smp_remote_device.c:197:26: error: comparison of different enumeration types ('SCI_IO_STATUS' (aka 'enum _SCI_IO_STATUS') and 'enum _SCI_STATUS') [-Werror,-Wenum-compare] 197 | if (completion_status == SCI_FAILURE_RETRY_REQUIRED) | ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ The `completion_status` variable is of type `SCI_IO_STATUS`, not `SCI_STATUS`. In this case, we can seamlessly replace the value with `SCI_IO_FAILURE_RETRY_REQUIRED`, which is numerically equal to `SCI_FAILURE_RETRY_REQUIRED`. MFC after: 3 days (cherry picked from commit 1bd66fac35ec27fa64d6158f82fdcbdc26098679) --- sys/dev/isci/scil/scif_sas_smp_remote_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/isci/scil/scif_sas_smp_remote_device.c b/sys/dev/isci/scil/scif_sas_smp_remote_device.c index d6055adc13f9..c72402f66889 100644 --- a/sys/dev/isci/scil/scif_sas_smp_remote_device.c +++ b/sys/dev/isci/scil/scif_sas_smp_remote_device.c @@ -194,7 +194,7 @@ SCI_STATUS scif_sas_smp_remote_device_decode_smp_response( //if Core set the status of this io to be RETRY_REQUIRED, we should //retry the IO without even decode the response. - if (completion_status == SCI_FAILURE_RETRY_REQUIRED) + if (completion_status == SCI_IO_FAILURE_RETRY_REQUIRED) { scif_sas_smp_remote_device_continue_current_activity( fw_device, fw_request, SCI_FAILURE_RETRY_REQUIRED From nobody Sun Aug 4 10:24:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFzZ2F5Rz5SY8c; Sun, 04 Aug 2024 10:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFzZ16NDz4DmW; Sun, 4 Aug 2024 10:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H63CVMUsJbK5uQXxaNvsVOCZFZ13tR0GRx4C/41TXfg=; b=kx2C/DkSAyAvwTeoj7um0pnCBC7v7Mf+6Scz7MLV5TKM4FY5DHA8vatBBVCcsZVM0OKjvs JD7xNATDCVtmakjK1DmdKjl/jf6J1doyr5Lcz/Le/pt9FCASydFYTdMlcjDTVBw5Pmflk0 fTlFKjHXn/C+N0HARHl/+kIP/na6L6q820ZHzru4AKgmfL6QqBrGtM+A5kn4+yee/fXLoY pVow9hP0P1Tot9smGfuvbfQVKLKG1GI5nShOjaS0yKRxN6eRK492UFp6qudclyMDYDmWHW ORYmDRe4EtIYHNgfAr0EPEgFWmk6Bd/Dant7nLEFd9cO6+2DqhZiIaQcLUZZCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767050; a=rsa-sha256; cv=none; b=qKJiiFFcWgBFByZzi14V8BPXRTuyfeyVtQlarnJpIvFSPAkvjxRQ2cm+ko+HDc37YDWXDB yq1+UGDURBgDS34MvFK3afjdYuLztLOewABQ7/ITZaxjyZU5Z2GD7NJoi7cDhnH8jQUeeY MDm9D92AizxevWlMOzJPTF72XQv2nmwNMxM3PC1u/d6+nFH74NEyT1iGv/Iop8IqClrONC q0TjrUlcMCwOVm2wRYEcH/Low8PgbB2PdjxHKYAxJqFLevHUBKrIRDxDLmjyiZjdFrnuN4 KJIG3dVsdvcQ87/skOeyWgq46aH8TPeYnElr+rqqQx8ltonnXAsalcK10/jINw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H63CVMUsJbK5uQXxaNvsVOCZFZ13tR0GRx4C/41TXfg=; b=nTE/LwPxT86C1nh0HKf3wMHUgxaQRHkItoOXFNDaY5bzMtpTdIk4knYrZBkYJrYAsrHSq0 +f4EWKPu2Mk7EqE6Fgz1DDXZK0RJw/bdpfEdcKKHFk4vDwNU2mp+FQra1+qOl1b7Wu9OWC U4p3bcMh6ebmSLgZqg6wirOWnxZVZUHo8dg8lXhCqa/3AAkESpJ1XQxRNcP5Qd6/3E2kJE vAEfwO16+CRhIumxHif/0WlMJ8dQQ0VL61XmSJ20ZK0GPK7UgaLEJXbZc8Bzr2sgcRaBuA kMYf6a51ith3yx28e2cJ4pSbwo42b48uSag6+AxBGoK7QcgMNxVc+0F2s+trxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFzZ0kbTzrhk; Sun, 4 Aug 2024 10:24: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 474AOADS046175; Sun, 4 Aug 2024 10:24:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474AO9PE046172; Sun, 4 Aug 2024 10:24:09 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:24:09 GMT Message-Id: <202408041024.474AO9PE046172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2b740ae7dad0 - stable/13 - Fix enum warning in keyserv List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b740ae7dad00a1118542f5cc617e22f1e65b645 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2b740ae7dad00a1118542f5cc617e22f1e65b645 commit 2b740ae7dad00a1118542f5cc617e22f1e65b645 Author: Dimitry Andric AuthorDate: 2024-07-30 22:35:03 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:22:45 +0000 Fix enum warning in keyserv This fixes a clang 19 warning: usr.sbin/keyserv/crypt_server.c:237:53: error: comparison of different enumeration types ('des_mode' (aka 'enum des_mode') and 'enum desmode') [-Werror,-Wenum-compare] 237 | if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { | ~~~~~~~~~~~~~~ ^ ~~~ The type of `argp->des_mode` (aka `desargs::des_mode`) is `enum des_mode` from `/usr/include/rpcsvc/crypt.h`, not `enum desmode` from `/usr/include/rpc/des.h` (which is used in `struct desparams`). Luckily the integer values of `enum desmode`'s `CBC` and `ECB` are identical to those of `enum des_mode`'s `CBC_DES` and `ECB_DES`, so replace both values. MFC after: 3 days (cherry picked from commit 1d5a5500ad4b1f5187f40baaf58ab6868b18fc08) --- usr.sbin/keyserv/crypt_server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/keyserv/crypt_server.c b/usr.sbin/keyserv/crypt_server.c index 34ca454d42a6..ac14c90642ba 100644 --- a/usr.sbin/keyserv/crypt_server.c +++ b/usr.sbin/keyserv/crypt_server.c @@ -241,9 +241,9 @@ des_crypt_1_svc(desargs *argp, struct svc_req *rqstp) * getting ECB mode. */ #ifdef BROKEN_DES - if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == CBC_DES) { #else - if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB) { + if (_my_crypt != &_arcfour_crypt && argp->des_mode == ECB_DES) { #endif int i; char *dptr; From nobody Sun Aug 4 10:24:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcFzb3H0dz5SYTk; Sun, 04 Aug 2024 10:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcFzb1jhDz4Dpm; Sun, 4 Aug 2024 10:24:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcV50mpxXRC653rJYHbjjcjB9PlZi9SEx6fW4kQuS1k=; b=CpmfhKwwJ53OVIshAFD6nREO4GEAmEkvzsBywBXWL0Wc4e1gdrKjgL+Syx2zkoJSE/Onqi f/S9LN7Ht3EZrsk0HLb283tbP+jZR1JQUmo/KTPBkZLntzwYfY7Nb7TTO1VxMPSabeXTi4 kHjBhqO3bfwG0zoul1oc1+GyYJJFCnenv7IKlsKXx6vrd6ma8NvLxUqpZppUTDNKxVvPMZ VqUl8Jsp7kTQn9VhWQoNqEWZzA4asfFjBuN4IiUTaV7u+l+ls0+1yxg63mh6VlR8EhJG7s y5yJI2Fsdzy0agMc5r57j7lD8x5Kxh6kAzs61OXMFAx9TZhMluGda/3m6niv9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722767051; a=rsa-sha256; cv=none; b=QXKOXrgnhOHriZHWeh6ToEfLrOu5Dzd13GEWeLer4ZLNdfQP0zoDXK+pfELQPhK8N/+BuO 5eWGf++vdb8ccsRj4PT0ojxnG83UltbsLniak+83P1hQ8Iel46CCrTyLyjLuPduEKK8fMB BfeVRqtTt80KFh108lQ8S60JeL3symHqajAN8DpvCcmaiya5xt8GMGfUaeP85N7shTERmL kCXq2TN9gwv6DZVNY6C0TfYtcXCxWMm0EhcGR5ZhzOH+Njy8F3sz+zNgx/vHA3OqUdydGQ CFO6cin+xdO1wNkoZYc4k4wpjPeklfDw6BmxBGw8znCxPG4tjunr/TSCjvyNqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722767051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dcV50mpxXRC653rJYHbjjcjB9PlZi9SEx6fW4kQuS1k=; b=w68hcUMjDr7OQKjQwep/AxgklxQg8m/t2K7djnkt5D/ptaosVs4k2LnD28K51QpbBaZSyd 12LHx71jlqWa9lntiX4W75qBHfUizdO718TWHGcNYsZi+Tqv5llV4acwxw5Bedu0Jnh9HB X1MNMfxfeK6OT4rO1Tb1PkRMwJaimQ0k5MinwcftfuJ1VRW5FnNbwpFNUOquWZP6oLEStA y9Pv79aGaVAJgKFnEIkkUvKfe+Z+pDBpPr6pgZnRIUNxLAUJ43PkcS4SEi6yFBrkekE9rT 5Xs93auV7te851dFrEy88RqQRHrv1bgnSC39VBkWaAasKdThDqnxFhVYEU3YiA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcFzb1KYtzrds; Sun, 4 Aug 2024 10:24: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 474AOB2j046217; Sun, 4 Aug 2024 10:24:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474AOBRF046214; Sun, 4 Aug 2024 10:24:11 GMT (envelope-from git) Date: Sun, 4 Aug 2024 10:24:11 GMT Message-Id: <202408041024.474AOBRF046214@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8356d8ff63a3 - stable/13 - Fix enum warning in iavf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8356d8ff63a3ffab8b1ff91c922ca7865de9dfc3 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8356d8ff63a3ffab8b1ff91c922ca7865de9dfc3 commit 8356d8ff63a3ffab8b1ff91c922ca7865de9dfc3 Author: Dimitry Andric AuthorDate: 2024-07-31 11:01:20 +0000 Commit: Dimitry Andric CommitDate: 2024-08-04 10:23:02 +0000 Fix enum warning in iavf This fixes a clang 19 warning: sys/dev/iavf/iavf_lib.c:514:39: error: comparison of different enumeration types ('enum virtchnl_vsi_type' and 'enum iavf_vsi_type') [-Werror,-Wenum-compare] 514 | if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ The `vsi_type` field of `struct virtchnl_vsi_resource` is of type `enum virtchnl_vsi_type`, not `enum iavf_vsi_type`. In this case, we can seamlessly replace the value with `VIRTCHNL_VSI_SRIOV`, which is numerically equal to `IAVF_VSI_SRIOV`. MFC after: 3 days (cherry picked from commit 67be1e195acfaec99ce4fffeb17111ce085755f7) --- sys/dev/iavf/iavf_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index 15e9a334c7fe..bac6d0948c32 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -511,7 +511,7 @@ iavf_get_vsi_res_from_vf_res(struct iavf_sc *sc) for (int i = 0; i < sc->vf_res->num_vsis; i++) { /* XXX: We only use the first VSI we find */ - if (sc->vf_res->vsi_res[i].vsi_type == IAVF_VSI_SRIOV) + if (sc->vf_res->vsi_res[i].vsi_type == VIRTCHNL_VSI_SRIOV) sc->vsi_res = &sc->vf_res->vsi_res[i]; } if (!sc->vsi_res) { From nobody Sun Aug 4 12:09:40 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcJKK2zV9z5SD2K; Sun, 04 Aug 2024 12:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcJKK0pcKz4SDs; Sun, 4 Aug 2024 12:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722773381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BgQl4OKk2fLrS84OkpX0EzExsotHOVouWxckIOUruU=; b=yKfdrDPiflkg9mdxoVE6OfrwFXb+j/13KacpVBKrvTY8TdAtSF6eMiIr0heRs/VYh3Wpt8 SFeWHqrC4efJRzLXempzoSr6Klm7EPZuHqEJD+ccdGJRzKY5TvZ9dhTdjPejab9pTeB5q4 TDw5DvaOVRTrcaDX56OHYEXP8BkpktN2eaiPrBbfP1ox+b95Mjelw5tzHHIwAuR1Zr8915 6R/UIltWmMS1bdE4tIIY9vyHr7/Q+JJacUgv9SEPkWmWUggidN/+ed3LKmshM+SxupIwJb nu2TLhuPdmtlN5e+48Qq2tjdM+FoxD/DR6VqBcO869o2D0BSvEWfw7LAwCfmaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722773381; a=rsa-sha256; cv=none; b=OnU6+D2sUohD+M32I06Aitg4PS4JW0jcg+fFSBF7mn8Q0prxW71ITMIrpCnQl/9v0ywvMv vgDZ+COLZ0GCR7ps0NPOFzgEZYFMb6Wl6GkaIow+pT/BBrO1mGKnToB2akDyQ2EXW+iJIr GJlxOCBFoG6R/KB3M6XvxGY80kxG4iyM1SYlxdvVROW5HNjqIB63W6e7WoFvhDbmeSUiu1 8lq/HLc06INblIYRWrfBAlyqjdLS88fq+oBREsSRlwpqNJrIcoTJ1tA/iUfy17xN8ShrRm G4HnOioZgY5uLE/sXAUpbgm3I3nxQzF0UeO/H9chcUUOo/JcSlAKzVtc4EZ0SA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722773381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8BgQl4OKk2fLrS84OkpX0EzExsotHOVouWxckIOUruU=; b=Rty6HZ94jHojxee2ySOdF6wCD8UI6y3ahdFfbLwqLRalpee6nydQ9ptda4RYDrEP/rkxF8 n9NZTcZoCcoWXS00uLkkV5NJfdmQMLCMJz9p3yMf5P6l9JLov/MhPbSguOyIhgivAUUcA3 V9PEoFgdFj6oOn8aRhsnn7YliiVr1AjZrPBAcLEwfsSIZKMt+nxVhOnsBvlu385hhXMUGU q0btn25xq4kgCEXKlNROTBNdnxR+SzyqB5GdoVYit6pBj8GzfnR9/qxdl22/bDFH5jZ4hK xMGUW8RFtaVykT2/xJ7a05fBBcs3BpBfq7hF90H5d93o0WSyAuTMQ2GA+cXagg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WcJKK0PwBzv21; Sun, 4 Aug 2024 12:09: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 474C9e1M018401; Sun, 4 Aug 2024 12:09:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 474C9erB018398; Sun, 4 Aug 2024 12:09:40 GMT (envelope-from git) Date: Sun, 4 Aug 2024 12:09:40 GMT Message-Id: <202408041209.474C9erB018398@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: f2372d936d7f - stable/14 - sound: Fix VCHANs' starting and ending points in feeder chain List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-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: f2372d936d7f57b52af85dde10c977fd49cbd52d Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f2372d936d7f57b52af85dde10c977fd49cbd52d commit f2372d936d7f57b52af85dde10c977fd49cbd52d Author: Christos Margiolis AuthorDate: 2024-08-02 12:53:16 +0000 Commit: Christos Margiolis CommitDate: 2024-08-04 12:09:35 +0000 sound: Fix VCHANs' starting and ending points in feeder chain sndstat(4) falsely reports "hardware" as the starting point of recording, and ending point of playback VCHANs. Recording VCHANs get their input from the primary recording channel, and playback VCHANs send their input to the primary playback channel. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D46177 (cherry picked from commit b58d9db4d77a6f42ac7cf3cdb2af2443666033e2) --- sys/dev/sound/pcm/sndstat.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index f09fa7139884..4fac6a97a3f0 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -517,8 +517,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_SWBUF_READY, sndbuf_getready(c->bufsoft)); - sbuf_printf(&sb, "[%s", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(&sb, "[%s", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(&sb, " -> "); f = c->feeder; while (f->source != NULL) @@ -550,8 +555,13 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) sbuf_printf(&sb, " -> "); f = f->parent; } - sbuf_printf(&sb, "%s]", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); @@ -1306,8 +1316,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, "channel flags=0x%b", c->flags, CHN_F_BITS); sbuf_printf(s, "\n\t"); - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "hardware" : "userland"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + c->parentchannel->name : "userland"); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "hardware" : "userland"); + } sbuf_printf(s, " -> "); f = c->feeder; while (f->source != NULL) @@ -1339,8 +1354,13 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) sbuf_printf(s, " -> "); f = f->parent; } - sbuf_printf(s, "{%s}", - (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + if (c->parentchannel != NULL) { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : c->parentchannel->name); + } else { + sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? + "userland" : "hardware"); + } CHN_UNLOCK(c); }