From nobody Mon Feb 17 00:03:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yx2t15mHyz5p826; Mon, 17 Feb 2025 00:03: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 4Yx2t116S2z3wD7; Mon, 17 Feb 2025 00:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739750585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IKpTo5qnVyV6aOpB1hWp/WPSW6RujcY7K3rY3wpi9mA=; b=vwYOYFEzlnGqxpTXHRRg1CLoNhRuFKWaiBFnYN6feF60YLZH2Y0nMK7d+RkhuZam8yak6V g2DJ/iL+0NrMfqG55iS+zohNm4jDkwRFpBirfvCissQm/87K+bIqw2VpsAONI3pnw1MOgF EIku7cTA2OhirgoKqwXe0FkHPuYTGs6I+Ih2K/ObTm1sCXoVWYFwQ3qybjW8h/rZZ5V5fi FJbwX4gc1mwj6LQHWmlSjNfTfC15tKmX/QjrnNZFDiuPPUddoNumnIuyOHyzlL+55N8IvK iqWr+C4BFkX3UHi3Oe38jP44ywiJEfVtKPQjJMbzS3R684qVg8oe+PZAmvvsvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739750585; a=rsa-sha256; cv=none; b=dtLsXvUZBlXpI5qN6WbkyNQSEgwJpSXI0041THWGxeAVGd/9X4lzFdD40VwmqDZiVoTDiV 6fiAzJJoM9qctfibRDPW9D5vmSUNQb5AlTJrwFO/jYeoh+QsiMB6rtAy5he7DNqhJoCj1/ e8w2cXu6QQ2Q9ToUdllDXb+4lZYJeG3kzErLHSWJ1z8GIt5T3ON4ncmI9T3C7in4qAmhcD V/gIQm1NYYdODCCj5+QVDUDKvKI5Jwp+ebmAI+TQ+r5HDx829FWfD4uy/3efy9hLfZmZEj NTRhI0kVb1wDFWDUgewplMOZ24LO+Bn2919R6zuz8hX87ljiEzI+322cuinrhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739750585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IKpTo5qnVyV6aOpB1hWp/WPSW6RujcY7K3rY3wpi9mA=; b=Rv0OsPUSqKnWTx/qVaDx6uTZfueTRAjpIgEINckk4Q5ZtzveINXPGNfAWA/rOUa2DcF95L /pE2RMkFvoCrtRdvlCt+JRMdY3JLdqQ6Ql2V24eIMnvgjZppd965oNI7yceCiJcldrVpyh gYy+Ud/81qIfZSY2hci7CCt/qGyBHGbDEWb1Ji5U2+4ymqCw+t4JwjXbD48tUMTJUrjJ82 Fsg2ctR37aZEwITJ+tB/WELvqz3xYYtyw+ioQAobMXmH1bjhkUJw6HFw3vftEDDfSsDI3g kuMTPvOsvE+9WFbXjMFkt7wMgv80kd+n1xAQn8PVRzh6K7Mob2f96chbj6wwYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yx2t10b4Gz17v9; Mon, 17 Feb 2025 00:03: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 51H034w5096844; Mon, 17 Feb 2025 00:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51H034lY096841; Mon, 17 Feb 2025 00:03:04 GMT (envelope-from git) Date: Mon, 17 Feb 2025 00:03:04 GMT Message-Id: <202502170003.51H034lY096841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: f5aff1871d32 - main - nfscl: Move delegation high water variables into clientID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5aff1871d3273b3cd3621ea5d3e37cdd807e66f Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f5aff1871d3273b3cd3621ea5d3e37cdd807e66f commit f5aff1871d3273b3cd3621ea5d3e37cdd807e66f Author: Rick Macklem AuthorDate: 2025-02-17 00:01:54 +0000 Commit: Rick Macklem CommitDate: 2025-02-17 00:01:54 +0000 nfscl: Move delegation high water variables into clientID Without this patch, the variables used to maintain a high water limit for delegations are global and apply to all mounts. This patch moves them into the clientID structure, which makes them per mount. This is needed to add support for the CB_RECALL_ANY callback in a future commit. The only effect of this patch is an increase in the total number of delegations held if there are multiple NFSv4 mounts to NFSv4 servers with delegations enabled. Since the default of NFSCLDELEGHIGHWATER is fairly small, this should not have a significant impact. MFC after: 2 weeks --- sys/fs/nfs/nfsclstate.h | 2 ++ sys/fs/nfsclient/nfs_clstate.c | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index d9f5ed13b54f..84088a2a4fd2 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -116,6 +116,8 @@ struct nfsclclient { struct proc *nfsc_renewthread; struct nfsmount *nfsc_nmp; time_t nfsc_expire; + int nfsc_delegcnt; + int nfsc_deleghighwater; u_int32_t nfsc_clientidrev; u_int32_t nfsc_rev; u_int32_t nfsc_renew; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index f5621fd0a758..86b51a7b3343 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -94,8 +94,6 @@ NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -static int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; -static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, @@ -462,7 +460,7 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, nfsdl_hash); dp->nfsdl_timestamp = NFSD_MONOSEC + 120; nfsstatsv1.cldelegates++; - nfscl_delegcnt++; + clp->nfsc_delegcnt++; } else { /* * A delegation already exists. If the new one is a Write @@ -919,6 +917,8 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, for (i = 0; i < NFSCLLAYOUTHASHSIZE; i++) LIST_INIT(&clp->nfsc_layouthash[i]); clp->nfsc_flags = NFSCLFLAGS_INITED; + clp->nfsc_delegcnt = 0; + clp->nfsc_deleghighwater = NFSCLDELEGHIGHWATER; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); nfscl_fillclid(nmp->nm_clval, uuid, clp->nfsc_id, @@ -1751,10 +1751,10 @@ nfscl_freedeleg(struct nfscldeleghead *hdp, struct nfscldeleg *dp, bool freeit) TAILQ_REMOVE(hdp, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); + dp->nfsdl_clp->nfsc_delegcnt--; if (freeit) free(dp, M_NFSCLDELEG); nfsstatsv1.cldelegates--; - nfscl_delegcnt--; } /* @@ -2864,7 +2864,7 @@ tryagain: nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); - nfscl_delegcnt--; + clp->nfsc_delegcnt--; nfsstatsv1.cldelegates--; } NFSLOCKCLSTATE(); @@ -2894,7 +2894,8 @@ tryagain: * The tailq list is in LRU order. */ dp = TAILQ_LAST(&clp->nfsc_deleg, nfscldeleghead); - while (nfscl_delegcnt > nfscl_deleghighwater && dp != NULL) { + while (clp->nfsc_delegcnt > clp->nfsc_deleghighwater && + dp != NULL) { ndp = TAILQ_PREV(dp, nfscldeleghead, nfsdl_list); if (dp->nfsdl_rwlock.nfslock_usecnt == 0 && dp->nfsdl_rwlock.nfslock_lock == 0 && @@ -2921,7 +2922,7 @@ tryagain: TAILQ_REMOVE(&clp->nfsc_deleg, dp, nfsdl_list); LIST_REMOVE(dp, nfsdl_hash); TAILQ_INSERT_HEAD(&dh, dp, nfsdl_list); - nfscl_delegcnt--; + clp->nfsc_delegcnt--; nfsstatsv1.cldelegates--; } } From nobody Mon Feb 17 01:51:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yx5Gp2rFBz5pFcs; Mon, 17 Feb 2025 01:51: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 4Yx5Gp2fQyz427k; Mon, 17 Feb 2025 01:51:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739757074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kdIibCLg+42lsn8/8ItZj8wMnoR4Q7F2KBkVyhNc7pc=; b=Ux9FT7SnsIS2mnHjbTK0XNP1R8YJ4COlHw435X+mVbUmNUMvx4BlPex8V69ZZuDTUlhmIn PpDJ4uJbiugxV+uHGmR9w0zUPt+nWAGScVvBeuEF5R7Et1ll986KtekGkqeMnX3UyxayZX L9dwObuKct1bIIaonlBP6bCEMMb0RTBkGjjVf9y6EZhDSQAaW67c8emKrNowMMHMCx8qyZ i11EyZMerGwnzZtT3NsLESvaE8w7m2ALCFM8Wh3KXvo6m7qSKpUpaHBVUmCCAtGwmekVy7 ZLgMYkMG52qLrLiUh4O7FAzXmD9cMrO0qA9gJ+Ibpn2cC7GiYWLlk4xw/jMWmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739757074; a=rsa-sha256; cv=none; b=iLczoaPcAidgyBBVb/TEPvKwCjdmOEdXxMyeAgnZwq541lKngMdOqrIktpz+b+jSWkemgJ 9bAxgBZcUaUjHB3F+1RgDDBzuiEmahcMl1D+IKDLwXHMnX2WXMo6B/W5vKvpSIcLProov5 6M6gJsnrM2yyzprWJbrjhT6OXrTP9yaFeRlfGyslMBXLDZNvKxfb+PDKnJkcdOhqWIYsyg pmEOFvYtopXXEQzlT1lZzgnAne9WvMTNUmKHPfvueSCMhlo8DYGoscb1UrZyUQKn7HdfRz IZpLtRhopqxOxm6vtV7NzwAM24x6WOeCjC2laEIi258aUou4Hd0emUY2yxMctA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739757074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kdIibCLg+42lsn8/8ItZj8wMnoR4Q7F2KBkVyhNc7pc=; b=lWtFrVLla2w3Kt/E3FBVR3msxPzIHpqoiDqDXEJ9DBr7rp++T5dBdrqiD4rMNy7GChhAAq dNnh8z4rFeTt7SeYenMIS4B4dFpS2bhwQXLDXoj1fFQIpunBZtZGUZDTJTW+FGoJJ6b44a I+yYUC4JGe3ClRc74IbOhcCcL8kZ0mPUSTykfYebGNwE8LGzfxyWnHIZeE3BBxERUHxnCX VnDSQawF1iZhmpijrhumbHo3hSIFyeDEXVg3012GLXjmz2i+MRfARHpojGHeW9Y46UAxcV 5Q1qG9dnPLs2TtwFGorYwz9VBz4LCZkqDwtZ7XnDqXSPU4VZ58pcjcX0qt8XcA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yx5Gp21hYz1Bcc; Mon, 17 Feb 2025 01:51: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 51H1pE85096264; Mon, 17 Feb 2025 01:51:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51H1pEdn096261; Mon, 17 Feb 2025 01:51:14 GMT (envelope-from git) Date: Mon, 17 Feb 2025 01:51:14 GMT Message-Id: <202502170151.51H1pEdn096261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 408394185fe9 - main - LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 408394185fe9be0c158189b7671bde316ac14ac9 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=408394185fe9be0c158189b7671bde316ac14ac9 commit 408394185fe9be0c158189b7671bde316ac14ac9 Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-17 01:37:30 +0000 LinuxKPI: 802.11: dump station_info using (*sta_statistics)() as sysctl Implement the mac80211 (*sta_statistics) to obtain station statistics. Fix up struct station_info for that. Add supporting funtions to decode station_info and rate_info_bw fields to make the output more usable to human beings. Add a per-VIF (VAP) sysctl to export that information. This is mostly used for now to see what the driver/fw thinks about its TX rate. We should later gather this information in different ways and pass it to net80211 to export it to user space so we can finally have nice station information (also for the non-AP side). Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 1 + sys/compat/linuxkpi/common/include/net/cfg80211.h | 38 +++- sys/compat/linuxkpi/common/src/linux_80211.c | 221 ++++++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 5 +- .../linuxkpi/common/src/linux_80211_macops.c | 30 +++ 5 files changed, 283 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 1babd23d65fe..80546e56f0c1 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -247,6 +247,7 @@ enum nl80211_ext_feature { NUM_NL80211_EXT_FEATURES }; +/* Keep in order with lkpi_nl80211_sta_info_to_str() */ enum nl80211_sta_info { /* XXX TODO */ NL80211_STA_INFO_BEACON_RX, diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index cf1e05dde7ea..338ffb82bd83 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -81,6 +81,9 @@ enum cfg80211_rate_info_flags { /* Max 8 bits as used in struct rate_info. */ }; +#define CFG80211_RATE_INFO_FLAGS_BITS \ + "\20\1MCS\2VHT_MCS\3SGI\5HE_MCS\10EHT_MCS" + extern const uint8_t rfc1042_header[6]; extern const uint8_t bridge_tunnel_header[6]; @@ -164,7 +167,7 @@ enum rate_info_bw { struct rate_info { uint8_t flags; /* enum cfg80211_rate_info_flags */ - uint8_t bw; + uint8_t bw; /* enum rate_info_bw */ uint16_t legacy; uint8_t mcs; uint8_t nss; @@ -546,18 +549,39 @@ struct station_del_parameters { }; struct station_info { - /* TODO FIXME */ - int assoc_req_ies_len, connected_time; - int generation, inactive_time, rx_bytes, rx_dropped_misc, rx_packets, signal, tx_bytes, tx_packets; - int filled, rx_beacon, rx_beacon_signal_avg, signal_avg; - int rx_duration, tx_duration, tx_failed, tx_retries; - int ack_signal, avg_ack_signal; + uint64_t filled; /* enum nl80211_sta_info */ + uint32_t connected_time; + uint32_t inactive_time; + + uint64_t rx_bytes; + uint32_t rx_packets; + uint32_t rx_dropped_misc; + + uint64_t rx_duration; + uint32_t rx_beacon; + uint8_t rx_beacon_signal_avg; + + int8_t signal; + int8_t signal_avg; + int8_t ack_signal; + int8_t avg_ack_signal; + + /* gap */ + int generation; + + uint64_t tx_bytes; + uint32_t tx_packets; + uint32_t tx_failed; + uint64_t tx_duration; + uint32_t tx_retries; int chains; uint8_t chain_signal[IEEE80211_MAX_CHAINS]; uint8_t chain_signal_avg[IEEE80211_MAX_CHAINS]; uint8_t *assoc_req_ies; + size_t assoc_req_ies_len; + struct rate_info rxrate; struct rate_info txrate; struct cfg80211_ibss_params bss_param; diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index f695aa4cfc7d..9ba0e2da99d6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -87,14 +88,14 @@ static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); /* -------------------------------------------------------------------------- */ -/* Keep public for as long as header files are using it too. */ -int linuxkpi_debug_80211; - -#ifdef LINUXKPI_DEBUG_80211 SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +/* Keep public for as long as header files are using it too. */ +int linuxkpi_debug_80211; + +#ifdef LINUXKPI_DEBUG_80211 SYSCTL_INT(_compat_linuxkpi_80211, OID_AUTO, debug, CTLFLAG_RWTUN, &linuxkpi_debug_80211, 0, "LinuxKPI 802.11 debug level"); @@ -153,6 +154,200 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +static const char * +lkpi_rate_info_bw_to_str(enum rate_info_bw bw) +{ + + switch (bw) { + + case RATE_INFO_BW_20: + return ("20"); + break; + case RATE_INFO_BW_5: + return ("5"); + break; + case RATE_INFO_BW_10: + return ("10"); + break; + case RATE_INFO_BW_40: + return ("40"); + break; + case RATE_INFO_BW_80: + return ("80"); + break; + case RATE_INFO_BW_160: + return ("160"); + break; + case RATE_INFO_BW_HE_RU: + IMPROVE("nl80211_he_ru_alloc"); + return ("HE_RU"); + break; + case RATE_INFO_BW_320: + return ("320"); + break; + case RATE_INFO_BW_EHT_RU: + IMPROVE("nl80211_eht_ru_alloc"); + return ("EHT_RU"); + break; + default: + return ("?"); + break; + } +} + +static void +lkpi_nl80211_sta_info_to_str(struct sbuf *s, const char *prefix, + const uint64_t flags) +{ + int bit, i; + + sbuf_printf(s, "%s %#010jx", prefix, flags); + + i = 0; + for (bit = 0; bit < BITS_PER_TYPE(flags); bit++) { + + if ((flags & BIT_ULL(bit)) == 0) + continue; + +#define EXPAND_CASE(_flag) \ + case NL80211_STA_INFO_ ## _flag: \ + sbuf_printf(s, "%c%s", (i == 0) ? '<' : ',', #_flag); \ + i++; \ + break; + + switch (bit) { + EXPAND_CASE(BEACON_RX) + EXPAND_CASE(BEACON_SIGNAL_AVG) + EXPAND_CASE(BSS_PARAM) + EXPAND_CASE(CHAIN_SIGNAL) + EXPAND_CASE(CHAIN_SIGNAL_AVG) + EXPAND_CASE(CONNECTED_TIME) + EXPAND_CASE(INACTIVE_TIME) + EXPAND_CASE(SIGNAL) + EXPAND_CASE(SIGNAL_AVG) + EXPAND_CASE(STA_FLAGS) + EXPAND_CASE(RX_BITRATE) + EXPAND_CASE(RX_PACKETS) + EXPAND_CASE(RX_BYTES) + EXPAND_CASE(RX_DROP_MISC) + EXPAND_CASE(TX_BITRATE) + EXPAND_CASE(TX_PACKETS) + EXPAND_CASE(TX_BYTES) + EXPAND_CASE(TX_BYTES64) + EXPAND_CASE(RX_BYTES64) + EXPAND_CASE(TX_FAILED) + EXPAND_CASE(TX_RETRIES) + EXPAND_CASE(RX_DURATION) + EXPAND_CASE(TX_DURATION) + EXPAND_CASE(ACK_SIGNAL) + EXPAND_CASE(ACK_SIGNAL_AVG) + default: + sbuf_printf(s, "%c?%d", (i == 0) ? '<' : ',', bit); + break; + } + } +#undef EXPAND_CASE + if (i > 0) + sbuf_printf(s, ">"); + sbuf_printf(s, "\n"); +} + +static int +lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) +{ + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + struct lkpi_sta *lsta; + struct ieee80211_sta *sta; + struct station_info sinfo; + struct sbuf s; + int error; + + if (req->newptr) + return (EPERM); + + lvif = (struct lkpi_vif *)arg1; + vif = LVIF_TO_VIF(lvif); + vap = LVIF_TO_VAP(lvif); + lhw = vap->iv_ic->ic_softc; + hw = LHW_TO_HW(lhw); + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + + wiphy_lock(hw->wiphy); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + sta = LSTA_TO_STA(lsta); + + sbuf_putc(&s, '\n'); + sbuf_printf(&s, "lsta %p sta %p added_to_drv %d\n", lsta, sta, lsta->added_to_drv); + + memset(&sinfo, 0, sizeof(sinfo)); + error = lkpi_80211_mo_sta_statistics(hw, vif, sta, &sinfo); + if (error == EEXIST) /* Not added to driver. */ + continue; + if (error == ENOTSUPP) { + sbuf_printf(&s, " sta_statistics not supported\n"); + continue; + } + if (error != 0) { + sbuf_printf(&s, " sta_statistics failed: %d\n", error); + continue; + } + + lkpi_nl80211_sta_info_to_str(&s, " nl80211_sta_info (valid fields)", sinfo.filled); + sbuf_printf(&s, " connected_time %u inactive_time %u\n", + sinfo.connected_time, sinfo.inactive_time); + sbuf_printf(&s, " rx_bytes %ju rx_packets %u rx_dropped_misc %u\n", + (uintmax_t)sinfo.rx_bytes, sinfo.rx_packets, sinfo.rx_dropped_misc); + sbuf_printf(&s, " rx_duration %ju rx_beacon %u rx_beacon_signal_avg %d\n", + (uintmax_t)sinfo.rx_duration, sinfo.rx_beacon, (int8_t)sinfo.rx_beacon_signal_avg); + + sbuf_printf(&s, " tx_bytes %ju tx_packets %u tx_failed %u\n", + (uintmax_t)sinfo.tx_bytes, sinfo.tx_packets, sinfo.tx_failed); + sbuf_printf(&s, " tx_duration %ju tx_retries %u\n", + (uintmax_t)sinfo.tx_duration, sinfo.tx_retries); + + sbuf_printf(&s, " signal %d signal_avg %d ack_signal %d avg_ack_signal %d\n", + sinfo.signal, sinfo.signal_avg, sinfo.ack_signal, sinfo.avg_ack_signal); + + sbuf_printf(&s, " generation %d assoc_req_ies_len %zu chains %d\n", + sinfo.generation, sinfo.assoc_req_ies_len, sinfo.chains); + + for (int i = 0; i < sinfo.chains && i < IEEE80211_MAX_CHAINS; i++) { + sbuf_printf(&s, " chain[%d] signal %d signal_avg %d\n", + i, (int8_t)sinfo.chain_signal[i], (int8_t)sinfo.chain_signal_avg[i]); + } + + /* assoc_req_ies, bss_param, sta_flags */ + + sbuf_printf(&s, " rxrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.rxrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.rxrate.bw, lkpi_rate_info_bw_to_str(sinfo.rxrate.bw), + sinfo.rxrate.legacy * 100, + sinfo.rxrate.mcs, sinfo.rxrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.rxrate.he_dcm, sinfo.rxrate.he_gi, sinfo.rxrate.he_ru_alloc, + sinfo.rxrate.eht_gi); + sbuf_printf(&s, " txrate: flags %b bw %u(%s) legacy %u kbit/s mcs %u nss %u\n", + sinfo.txrate.flags, CFG80211_RATE_INFO_FLAGS_BITS, + sinfo.txrate.bw, lkpi_rate_info_bw_to_str(sinfo.txrate.bw), + sinfo.txrate.legacy * 100, + sinfo.txrate.mcs, sinfo.txrate.nss); + sbuf_printf(&s, " he_dcm %u he_gi %u he_ru_alloc %u eht_gi %u\n", + sinfo.txrate.he_dcm, sinfo.txrate.he_gi, sinfo.txrate.he_ru_alloc, + sinfo.txrate.eht_gi); + } + wiphy_unlock(hw->wiphy); + + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); +} + #if defined(LKPI_80211_HT) static void lkpi_sta_sync_ht_from_ni(struct ieee80211_sta *sta, struct ieee80211_node *ni, int *ht_rx_nss) @@ -2802,6 +2997,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], struct ieee80211_vif *vif; struct ieee80211_tx_queue_params txqp; enum ieee80211_bss_changed changed; + struct sysctl_oid *node; size_t len; int error, i; uint16_t ac; @@ -2975,6 +3171,20 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], hw->wiphy->rts_threshold = vap->iv_rtsthreshold; lkpi_80211_mo_set_rts_threshold(hw, vap->iv_rtsthreshold); /* any others? */ + + /* Add per-VIF/VAP sysctls. */ + sysctl_ctx_init(&lvif->sysctl_ctx); + + node = SYSCTL_ADD_NODE(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(&sysctl___compat_linuxkpi_80211), + OID_AUTO, if_name(vap->iv_ifp), + CTLFLAG_RD | CTLFLAG_SKIP | CTLFLAG_MPSAFE, NULL, "VIF Information"); + + SYSCTL_ADD_PROC(&lvif->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, "dump_stas", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, lvif, 0, + lkpi_80211_dump_stas, "A", "Dump sta statistics of this vif"); + IMPROVE(); return (vap); @@ -3014,6 +3224,9 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap) EVENTHANDLER_DEREGISTER(iflladdr_event, lvif->lvif_ifllevent); + /* Clear up per-VIF/VAP sysctls. */ + sysctl_ctx_free(&lvif->sysctl_ctx); + LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_REMOVE(&lhw->lvif_head, lvif, lvif_entry); LKPI_80211_LHW_LVIF_UNLOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 0c4c615d82e5..bb1ecb45636f 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -168,6 +168,8 @@ struct lkpi_vif { struct ieee80211vap iv_vap; eventhandler_tag lvif_ifllevent; + struct sysctl_ctx_list sysctl_ctx; + struct mtx mtx; struct wireless_dev wdev; @@ -442,6 +444,7 @@ int lkpi_80211_mo_set_key(struct ieee80211_hw *, enum set_key_cmd, struct ieee80211_key_conf *); int lkpi_80211_mo_ampdu_action(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_ampdu_params *); - +int lkpi_80211_mo_sta_statistics(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct station_info *); #endif /* _LKPI_SRC_LINUX_80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 246a0c84dfa8..68b5bbefe938 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -717,3 +717,33 @@ lkpi_80211_mo_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, out: return (error); } + +int +lkpi_80211_mo_sta_statistics(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_sta *sta, struct station_info *sinfo) +{ + struct lkpi_hw *lhw; + struct lkpi_sta *lsta; + int error; + + lhw = HW_TO_LHW(hw); + if (lhw->ops->sta_statistics == NULL) { + error = EOPNOTSUPP; + goto out; + } + + lsta = STA_TO_LSTA(sta); + if (!lsta->added_to_drv) { + error = EEXIST; + goto out; + } + + lockdep_assert_wiphy(hw->wiphy); + + LKPI_80211_TRACE_MO("hw %p vif %p sta %p sinfo %p", hw, vif, sta, sinfo); + lhw->ops->sta_statistics(hw, vif, sta, sinfo); + error = 0; + +out: + return (error); +} From nobody Mon Feb 17 15:24:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxRKX66Q1z5nn45; Mon, 17 Feb 2025 15:24:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxRKX0dNFz3Tw2; Mon, 17 Feb 2025 15:24:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739805888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH0RgaGUSQslpBA5S89CoV4lBfy+DDBOtVEHbFklYlA=; b=nvVVj1EcWqA3UfcxSq1M9A7vbBtlpYrz/WUdSMjXA29cFc/KZmeCsm8vbrbC3LaxA6xET6 p35tjnbFwJxu0Z0vJUDU+nbFSfRGYij08K3ilapBG9007BQ27457ZyIbtJWznGt/TlAcXL BclQfm5MS/pO17o1b0ix8FdwhR84M4gP5L608XsFQjQmEtEQL6lmyxyo3wB7v0jLZ+z1cE R4sOggomLtKszx8z78UehATo6Rv3cS6xgsE1kThPQSt7peSTxUFtAoyMoe0bw5MzN5gQOk Z5DRufwThUtakSik3/FEyChQn5WVdPJzdJXjrKhwLDzeYMnTPbxCKKem5IVeeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739805888; a=rsa-sha256; cv=none; b=Ixy23tiTXzApW6tMroFIjweLWLW0G0T1RZwZM2JX81yQc6TbMsEoUq/PqfuMyZC6lSGQvt XdNV3jsuDdGhbCuFNjTgsSZpxM9ut+LEZWxTrky/ZqxarYHP0AMi5FjF1gBH/Fv+hNJr44 Sks0SLM7n+0sPwFTbc6RqZwMT3CMYTjNXFmm6G4WZvb4Y/S24YwPtPwkJrwI0p+tvPmCsl lZxulChKuFv7k1PCanyGeE68S9s1OJaHHRMguHZOzuaC1OS0rTTWEuOrfIhISU93VSlea9 BpGEchDJO/nh51bips5ZuW2gkHUWNstJbagPNW0PRge7RmQgkcl2Zg35/xz1nQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739805888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UH0RgaGUSQslpBA5S89CoV4lBfy+DDBOtVEHbFklYlA=; b=qn+0rT+8oZsRtw7NjjiPY6qCtiZQz8Qjq8EjFIwYgmUbiTat+iYvKrSXk6ChcYGhEoGo0P up+qHYtx5Y8NkpgnTrS9ZYvDduiuliALeenTCGrz7qfDzHLrrkyAZpkL1skXscUOdSEGlT OgEhNM0yB1przymzhaqGQvtNFbBYixgQeMYzACCnLyAOiZLKa1N/6ph8Fq34tleWRBi08M AMK/ErbRK8wTRNkTa0Vn7xSeO/8vkgW0bsINfq6UbH6ncb35ACaD0t7Wna2zBoDe/xsppr GRsRcebTgW/JxUSwXuZCoxCXKwIm0T5xse9osRO6ZNQomAv97k/ExZNBotp0jA== Received: from [IPV6:2601:5c0:4200:b830:88ac:d422:574d:64aa] (unknown [IPv6:2601:5c0:4200:b830:88ac:d422:574d:64aa]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YxRKW4V8sz4Hl; Mon, 17 Feb 2025 15:24:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> Date: Mon, 17 Feb 2025 10:24:46 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values To: Kristof Provost , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> Content-Language: en-US From: John Baldwin In-Reply-To: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/14/25 12:50, Kristof Provost wrote: > The branch main has been updated by kp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7e7f88001d7dfec83cd7568369be6a587d4a51ff > > commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff > Author: Kristof Provost > AuthorDate: 2025-02-07 10:29:26 +0000 > Commit: Kristof Provost > CommitDate: 2025-02-14 17:47:52 +0000 > > pf: use time_t for storing time_t values > > No change to the underlying type, so no ABI change. > > We define __time_t as uint64_t if __LP64__, otherwise uint32_t, > and only define __LP64__ if long is 64 bits. > In other words: __time_t == long. > > ok henning@ deraadt@ > > Obtained from: OpenBSD, guenther , 6c1b69a0ff > Sponsored by: Rubicon Communications, LLC ("Netgate") > Differential Revision: https://reviews.freebsd.org/D48963 This is an ABI change on non-i386 32-bit platforms in FreeBSD since they all use a 64-bit type for time_t that is not the same size as long. Not sure if the ABI change matters on FreeBSD though? -- John Baldwin From nobody Mon Feb 17 15:39:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxRf5620Gz5nnfJ; Mon, 17 Feb 2025 15:39: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 4YxRf559KTz3ZcW; Mon, 17 Feb 2025 15:39:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739806749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4nZ/5MmCZ8bshr1lZqRlNBQd2TTNZ7H5FL7Ko0iUEo0=; b=j2AC4MZCyu9Sa6hz7px5JGEboV/llfJPL7NkjbtcZIRr7fc8bf43TTEbpVMxTDaSVKC/bg v9Utd8KEUc+8ixJQOF6/EsdzTqDNskJlsbQhpjm0acDzKWeDixkofCUxwSv7OaDckyWMmc IbYc7ecvewoJUw9850hLmQyTtNbLpAzvooJbiSxP0js4xyxbOVoUYWAp4ACCyfhgk39f1F pFxcB0RzLtv/pE2iuL+cAoK795GO6jraVXOZSi/26W4VIyhrwXAKAgyHdmVSUXSo0AtCTN MnshYUXGn3UL4pWl7RobWffolykeFLWqfFo/IzF0EaHYbqEoCS0mHD1XeCuiIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739806749; a=rsa-sha256; cv=none; b=WS5wQ1RoI9RGmTC2CbnjODriAk0tq16tO9sCZd+SA2hPzeUjL41XffllyLT67yp3D9noOA aMyTEf29QzXsfXNT7GDS6xmZ2idUw+pevLx/+eYsVKoqURqhq30RY1Ze8I/Svhw/M7mexf 0vpMrdNbQF/V8ax9MFUHMtB9vbWrW2i1TNDIlo+CHKJC0zgTG3Yx0pmUKj5T10A01wPLaq gTL2bU2EO8SWlHAAxjGT13Q21CMLpgNgLGo3YUBXGehJ/yVBAkU40xNG/UhaAx2DsSI9eN mMdthPFPStSF3KLxsd98a4S/+a5+JQ9vTD/XHy+M2O4kn9YEjifvV+eGUqDd5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739806749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4nZ/5MmCZ8bshr1lZqRlNBQd2TTNZ7H5FL7Ko0iUEo0=; b=A7LaFAoBVB6WeiKYSorDpOPLJY+rbri8RMTNOxEMVFUsFVd4U3i9XZpaxC1OGbIfub7MaR AqnWbOIsGm06Y3USfzPQOB8WWBkmvCx00g2up39Xmv6Krnrms4iuBaqoNW6xVdp1bVFL48 hU9B88sKeabvkhzv/HnIoopx4nDbow+aziXDkS3EqaiF7fzaAs5MJgbZ9LPuPaM2L1mH9R DgOWpRYXWcyqdg773Z5fozpg1WdCL6c6GgfSDnsoX532BnDMuiuKzrRLBAjYq3YSmd0YvS 3v2yRBAPr7oHE3ayVHzmUc/dZmGEX81ff657cKTxolM+8LcgaX8X9Ov0lxiOig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxRf54GjlzfjX; Mon, 17 Feb 2025 15:39: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 51HFd9cn070311; Mon, 17 Feb 2025 15:39:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HFd9wT070308; Mon, 17 Feb 2025 15:39:09 GMT (envelope-from git) Date: Mon, 17 Feb 2025 15:39:09 GMT Message-Id: <202502171539.51HFd9wT070308@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 90a3b6a7a4e4 - main - libkern: strdup.c, strndup.c: Prefer memcpy() over bcopy() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90a3b6a7a4e4c8201ba1bb90fb8e2b088f3a5788 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=90a3b6a7a4e4c8201ba1bb90fb8e2b088f3a5788 commit 90a3b6a7a4e4c8201ba1bb90fb8e2b088f3a5788 Author: Zhenlei Huang AuthorDate: 2025-02-17 15:37:59 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-17 15:37:59 +0000 libkern: strdup.c, strndup.c: Prefer memcpy() over bcopy() The newly allocated memory can not overlap with the string if the string is properly null-terminated or the maxlen is a valid lengh, i.e no out of bounds reads. Prefer memcpy() over memmove(), aka bcopy(), for slight performance gain. No functional change intended. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49026 --- sys/libkern/strdup.c | 2 +- sys/libkern/strndup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/libkern/strdup.c b/sys/libkern/strdup.c index 4f7b62a3941d..de56ce67db72 100644 --- a/sys/libkern/strdup.c +++ b/sys/libkern/strdup.c @@ -46,7 +46,7 @@ strdup_flags(const char *string, struct malloc_type *type, int flags) copy = malloc(len, type, flags); if (copy == NULL) return (NULL); - bcopy(string, copy, len); + memcpy(copy, string, len); return (copy); } diff --git a/sys/libkern/strndup.c b/sys/libkern/strndup.c index 2d71f2463242..75b33339e1c7 100644 --- a/sys/libkern/strndup.c +++ b/sys/libkern/strndup.c @@ -42,7 +42,7 @@ strndup(const char *string, size_t maxlen, struct malloc_type *type) len = strnlen(string, maxlen) + 1; copy = malloc(len, type, M_WAITOK); - bcopy(string, copy, len); + memcpy(copy, string, len); copy[len - 1] = '\0'; return (copy); } From nobody Mon Feb 17 16:36:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxSwm3MMHz5ns11; Mon, 17 Feb 2025 16:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxSwm2fS3z42Xq; Mon, 17 Feb 2025 16:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M7sRBQ8BD9JSPj/MoihQr4F8JSr6tH8RYlNQ8IlR1L4=; b=a2sWoZMkOLtuldo3TzcAG+sGIlI1lEzepu6tm4bE64cCozEWTLKiUVEgEFxamw4686o1gK jk3e0UHHwnnbtLYC80NwsrQsDRLbRLq0XMglwxof6pvyiaLMQmhEm9sJoHo0+vyq3whVxl BY5VOrc+Sh5jiCk7wEKcnY9EqUHCjkN+u0yDWABvpIhQWp3MfueA9iH1hwUs7c8AAtsj1h l8DVOAuplrNMDntlwGQg0Me5WWitYzB70l8yt7SVMpknKPn8r73YsMnOCAuOY5pASv2Rnw H7dfeVEw1GjNFgR7dh4BwkDUocRQ9Qt87cwrXDmh+1awqBhGUV8Jxyip5I7zJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810216; a=rsa-sha256; cv=none; b=WUKmyoL0dukzUII6L7hAvjlDzGeRZQVhRtARxaK1n7R+9+35aG/K/5EWs5znuayk4B3es2 ba7KoBe0x2F/ijpGSedOB+ZJGcc4usexc46Vn+CNImxjaSYNfviGocx+kKULatSaR3bMnc xx6j0Eq62CRi5OUZATXQsM9JzPVkHVjD46f9HnPaGuQinCW2QgjXIQJg/bDjylk7YtXTWM 43/A5AkVhgOgGjbNh6GXdtJPO4J1s30H5oTkDSHkLuyF7FKZ4L4Tt7dWXAzZErAl7gENyz h0nDzUBdq14u8zzzgffKPieE+cZqt5Qwqom0Jtrr7XjTSLElc1hO5UeNCLEX4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=M7sRBQ8BD9JSPj/MoihQr4F8JSr6tH8RYlNQ8IlR1L4=; b=WMW9C/4o4IO5rzBH+pWLH5G6QH0qHCYglEefIhTiqXCoMMTh70UlPBOv3VgtqfDAqJJ8ml Zza597+O8h8fRPVAkO4Wb8MUg72ZgQqJcs8MfCSawETNLluO3Fig/EY8s0wyo+riEvmOFx TM/c+cJY1HYovEaUjQfHMQK+fKvcQnBPmbjbxAFHJqfXwQZ+65E9/mqu7M69VaYgeQ57CU 2ufGj3pA3eCB746YYnLEovFZ0x+nMHEe5a+EdbGIIsCln8djbKnElyibcheQTMDrahzBWu ZgzJR/fpMVKGEde1EiPw8rzrQg4Ppp8+U3biP6gTX9Ex3ZYxc2hv87VDdegULQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxSwm1xFJzghw; Mon, 17 Feb 2025 16:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51HGauuM082750; Mon, 17 Feb 2025 16:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HGauOM082747; Mon, 17 Feb 2025 16:36:56 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:36:56 GMT Message-Id: <202502171636.51HGauOM082747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 05f6f65c3bda - main - arm64: add CHECK_CPU_FEAT() for checking feature support in assembly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05f6f65c3bdaf241ec819babda666445bf8e9909 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=05f6f65c3bdaf241ec819babda666445bf8e9909 commit 05f6f65c3bdaf241ec819babda666445bf8e9909 Author: Harry Moulton AuthorDate: 2025-02-17 15:58:39 +0000 Commit: Andrew Turner CommitDate: 2025-02-17 16:07:35 +0000 arm64: add CHECK_CPU_FEAT() for checking feature support in assembly Add a new macro under asm.h to check whether a given CPU feature is supported. There are a number of existing places where an ID register is checked, and these have been updated in this change. These are for GIC special registers, HAFDBS and HCX. When calling, pass a temporary registers who's value is not important, the name of the ID register (minus the exception level), the name of the feature, and a label to jump to should the feature not be present. The feature name should match with the macros defined in armreg.h or hypervisor.h. Any feature-specific instructions can then be placed between the macro and the label. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48813 Signed-off-by: Harry Moulton --- sys/arm64/arm64/locore.S | 17 ++++------------- sys/arm64/include/asm.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index f3b846eee412..88193b6c93f7 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -403,10 +403,7 @@ LENTRY(enter_kernel_el) * Configure the Extended Hypervisor register. This is only valid if * FEAT_HCX is enabled. */ - mrs x2, id_aa64mmfr1_el1 - ubfx x2, x2, #ID_AA64MMFR1_HCX_SHIFT, #ID_AA64MMFR1_HCX_WIDTH - cbz x2, 2f - + CHECK_CPU_FEAT(x2, ID_AA64MMFR1, HCX, 2f) /* Extended Hypervisor Configuration */ mov x2, xzr msr HCRX_EL2_REG, x2 @@ -422,12 +419,8 @@ LENTRY(enter_kernel_el) /* Zero vttbr_el2 so a hypervisor can tell the host and guest apart */ msr vttbr_el2, xzr - /* Configure GICv3 CPU interface */ - mrs x2, id_aa64pfr0_el1 - /* Extract GIC bits from the register */ - ubfx x2, x2, #ID_AA64PFR0_GIC_SHIFT, #ID_AA64PFR0_GIC_BITS - /* GIC[3:0] != 0000 - GIC CPU interface via special regs. supported */ - cbz x2, 3f + /* Check the CPU supports GIC, and configure the CPU interface */ + CHECK_CPU_FEAT(x2, ID_AA64PFR0, GIC, 3f) mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ @@ -958,9 +951,7 @@ LENTRY(start_mmu) * HW management of dirty state is set in C code as it may * need to be disabled because of CPU errata. */ - mrs x3, id_aa64mmfr1_el1 - and x3, x3, #(ID_AA64MMFR1_HAFDBS_MASK) - cbz x3, 1f + CHECK_CPU_FEAT(x3, ID_AA64MMFR1, HAFDBS, 1f) orr x2, x2, #(TCR_HA) 1: diff --git a/sys/arm64/include/asm.h b/sys/arm64/include/asm.h index cc0a7d8293c9..4f373dc4b7e1 100644 --- a/sys/arm64/include/asm.h +++ b/sys/arm64/include/asm.h @@ -72,6 +72,16 @@ /* Alias for link register x30 */ #define lr x30 +/* + * Check whether a given cpu feature is present, in the case it is not we jump + * to the given label. The tmp register should be a register able to hold the + * temporary data. + */ +#define CHECK_CPU_FEAT(tmp, feat_reg, feat, label) \ + mrs tmp, ##feat_reg##_el1; \ + ubfx tmp, tmp, ##feat_reg##_##feat##_SHIFT, ##feat_reg##_##feat##_WIDTH; \ + cbz tmp, label + /* * Sets the trap fault handler. The exception handler will return to the * address in the handler register on a data abort or the xzr register to From nobody Mon Feb 17 16:36:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxSwn3h8sz5nrgr; Mon, 17 Feb 2025 16:36: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 4YxSwn2y12z42VX; Mon, 17 Feb 2025 16:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNpP+G2iQkd4GLIjcqQpobnY/SaO6mZpTBbdyuTL+38=; b=HCqOyGICdKO2s+0sOvt+/aXhGeneDiSoCrlxPPOerwAtvJgRmjN4kV9IJ924hM5/xjIR/H UCS9+M80UQQ64og8+QSi80SqQPGrZP5zFvFITbFnASohsycI+m3r5xxjjF6vszaaUEkta3 SCTDwGSDSa7ftjdeLbtVVvmUGh3Skk8UMRzJGXKhWSBls8PCgNoXaUpzwZiqR+HSnItVFy r72XpVuzmhMpIXrehgsp8JrspauV4EX7ZCHdW1FMHv23FWAJAHykKTYXoid4y9Fx2Iykx0 yjvcRxH3B31FwjL+oloiI3iu50uXQ/Nub4BAXNQejaQI3ouUFfPVwx/h52XGBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810217; a=rsa-sha256; cv=none; b=KO3Kl1SqvLp0+7g6aQFegBiwp22nKw1QbnXi69pqqpLnVyLmoZg7gfJKREUrlzHj/qMXAa yIrsgtfsx130aZPHwL2OKjhd0+NjtkLBy0YHXSMoz5UOtnKkjplBJer4d16CLV/znEFnYw ptn7iQqvxdmC6b7mzm7eYSJCURa+kg4z8zrLahet9SmYsbDFAploh5Bz+QfRV8WTxsRBqN DiZipleYz29qJRxUIPa/KKhk8gS9evJlkDI0ZHB2coj8YwBhIwXQvgOnNqGH6Qze/CbQGh Mi/Y9pI7TZ+wXVPkZ7p1GVsYjuoL3ciRKqwCyRxahEMlA3uje0zUTFEq0So7Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810217; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fNpP+G2iQkd4GLIjcqQpobnY/SaO6mZpTBbdyuTL+38=; b=twUt/ppVq6voHZe0j2YCrkUk7dh659Cn4GCw92oYDN2wbu0q+iyjLEKDKIlEK8vjrpMFal t9y2S0KqRIPED3Q0zLDtCkmoSmgxtkDfGFV7TLXD1U1z3u5SvSeqsUh0GcRyp3sxKSYPB6 X33O2/UoNzz1dlxkSXpaXRIMAqVY9h2JvqDJZOfCagIji9FbbPQKExfuN2MmHTxAonkXnB /qRjj+ZWxJvO1AELB49JTcjxxWyOrEul4kQHmSQx8usxHMnxVShK8QngTQVsLLdD8n4pYW 97EAjR1Kka73cX7plb5OVWmqXT9uyBreV1qZH+MNgfQCpI740TflwXoBCd2GqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxSwn2G43zhtF; Mon, 17 Feb 2025 16:36: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 51HGavYX082785; Mon, 17 Feb 2025 16:36:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HGavae082782; Mon, 17 Feb 2025 16:36:57 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:36:57 GMT Message-Id: <202502171636.51HGavae082782@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 94686b081fdb - main - arm64: add missing HWCAP and HWCAP2 values List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94686b081fdb0c1bb0fc1dfeda14bd53f26ce7c5 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=94686b081fdb0c1bb0fc1dfeda14bd53f26ce7c5 commit 94686b081fdb0c1bb0fc1dfeda14bd53f26ce7c5 Author: Harry Moulton AuthorDate: 2025-02-17 16:00:03 +0000 Commit: Andrew Turner CommitDate: 2025-02-17 16:07:35 +0000 arm64: add missing HWCAP and HWCAP2 values Update the HWCAP and HWCAP2 values to align with Linux v6.13 Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48814 Signed-off-by: Harry Moulton --- sys/arm64/include/elf.h | 174 +++++++++++++++++++++++++++--------------------- 1 file changed, 97 insertions(+), 77 deletions(-) diff --git a/sys/arm64/include/elf.h b/sys/arm64/include/elf.h index 9f9cd44ac9f7..d6328c143585 100644 --- a/sys/arm64/include/elf.h +++ b/sys/arm64/include/elf.h @@ -94,90 +94,110 @@ __ElfType(Auxinfo); #endif /* HWCAP */ -#define HWCAP_FP 0x00000001 -#define HWCAP_ASIMD 0x00000002 -#define HWCAP_EVTSTRM 0x00000004 -#define HWCAP_AES 0x00000008 -#define HWCAP_PMULL 0x00000010 -#define HWCAP_SHA1 0x00000020 -#define HWCAP_SHA2 0x00000040 -#define HWCAP_CRC32 0x00000080 -#define HWCAP_ATOMICS 0x00000100 -#define HWCAP_FPHP 0x00000200 -#define HWCAP_ASIMDHP 0x00000400 +#define HWCAP_FP (1 << 0) +#define HWCAP_ASIMD (1 << 1) +#define HWCAP_EVTSTRM (1 << 2) +#define HWCAP_AES (1 << 3) +#define HWCAP_PMULL (1 << 4) +#define HWCAP_SHA1 (1 << 5) +#define HWCAP_SHA2 (1 << 6) +#define HWCAP_CRC32 (1 << 7) +#define HWCAP_ATOMICS (1 << 8) +#define HWCAP_FPHP (1 << 9) +#define HWCAP_ASIMDHP (1 << 10) /* * XXX: The following bits (from CPUID to FLAGM) were originally incorrect, * but later changed to match the Linux definitions. No compatibility code is * provided, as the fix was expected to result in near-zero fallout. */ -#define HWCAP_CPUID 0x00000800 -#define HWCAP_ASIMDRDM 0x00001000 -#define HWCAP_JSCVT 0x00002000 -#define HWCAP_FCMA 0x00004000 -#define HWCAP_LRCPC 0x00008000 -#define HWCAP_DCPOP 0x00010000 -#define HWCAP_SHA3 0x00020000 -#define HWCAP_SM3 0x00040000 -#define HWCAP_SM4 0x00080000 -#define HWCAP_ASIMDDP 0x00100000 -#define HWCAP_SHA512 0x00200000 -#define HWCAP_SVE 0x00400000 -#define HWCAP_ASIMDFHM 0x00800000 -#define HWCAP_DIT 0x01000000 -#define HWCAP_USCAT 0x02000000 -#define HWCAP_ILRCPC 0x04000000 -#define HWCAP_FLAGM 0x08000000 -#define HWCAP_SSBS 0x10000000 -#define HWCAP_SB 0x20000000 -#define HWCAP_PACA 0x40000000 -#define HWCAP_PACG 0x80000000 +#define HWCAP_CPUID (1 << 11) +#define HWCAP_ASIMDRDM (1 << 12) +#define HWCAP_JSCVT (1 << 13) +#define HWCAP_FCMA (1 << 14) +#define HWCAP_LRCPC (1 << 15) +#define HWCAP_DCPOP (1 << 16) +#define HWCAP_SHA3 (1 << 17) +#define HWCAP_SM3 (1 << 18) +#define HWCAP_SM4 (1 << 19) +#define HWCAP_ASIMDDP (1 << 20) +#define HWCAP_SHA512 (1 << 21) +#define HWCAP_SVE (1 << 22) +#define HWCAP_ASIMDFHM (1 << 23) +#define HWCAP_DIT (1 << 24) +#define HWCAP_USCAT (1 << 25) +#define HWCAP_ILRCPC (1 << 26) +#define HWCAP_FLAGM (1 << 27) +#define HWCAP_SSBS (1 << 28) +#define HWCAP_SB (1 << 29) +#define HWCAP_PACA (1 << 30) +#define HWCAP_PACG (1UL << 31) +#define HWCAP_GCS (1UL << 32) /* HWCAP2 */ -#define HWCAP2_DCPODP 0x0000000000000001ul -#define HWCAP2_SVE2 0x0000000000000002ul -#define HWCAP2_SVEAES 0x0000000000000004ul -#define HWCAP2_SVEPMULL 0x0000000000000008ul -#define HWCAP2_SVEBITPERM 0x0000000000000010ul -#define HWCAP2_SVESHA3 0x0000000000000020ul -#define HWCAP2_SVESM4 0x0000000000000040ul -#define HWCAP2_FLAGM2 0x0000000000000080ul -#define HWCAP2_FRINT 0x0000000000000100ul -#define HWCAP2_SVEI8MM 0x0000000000000200ul -#define HWCAP2_SVEF32MM 0x0000000000000400ul -#define HWCAP2_SVEF64MM 0x0000000000000800ul -#define HWCAP2_SVEBF16 0x0000000000001000ul -#define HWCAP2_I8MM 0x0000000000002000ul -#define HWCAP2_BF16 0x0000000000004000ul -#define HWCAP2_DGH 0x0000000000008000ul -#define HWCAP2_RNG 0x0000000000010000ul -#define HWCAP2_BTI 0x0000000000020000ul -#define HWCAP2_MTE 0x0000000000040000ul -#define HWCAP2_ECV 0x0000000000080000ul -#define HWCAP2_AFP 0x0000000000100000ul -#define HWCAP2_RPRES 0x0000000000200000ul -#define HWCAP2_MTE3 0x0000000000400000ul -#define HWCAP2_SME 0x0000000000800000ul -#define HWCAP2_SME_I16I64 0x0000000001000000ul -#define HWCAP2_SME_F64F64 0x0000000002000000ul -#define HWCAP2_SME_I8I32 0x0000000004000000ul -#define HWCAP2_SME_F16F32 0x0000000008000000ul -#define HWCAP2_SME_B16F32 0x0000000010000000ul -#define HWCAP2_SME_F32F32 0x0000000020000000ul -#define HWCAP2_SME_FA64 0x0000000040000000ul -#define HWCAP2_WFXT 0x0000000080000000ul -#define HWCAP2_EBF16 0x0000000100000000ul -#define HWCAP2_SVE_EBF16 0x0000000200000000ul -#define HWCAP2_CSSC 0x0000000400000000ul -#define HWCAP2_RPRFM 0x0000000800000000ul -#define HWCAP2_SVE2P1 0x0000001000000000ul -#define HWCAP2_SME2 0x0000002000000000ul -#define HWCAP2_SME2P1 0x0000004000000000ul -#define HWCAP2_SME_I16I32 0x0000008000000000ul -#define HWCAP2_SME_BI32I32 0x0000010000000000ul -#define HWCAP2_SME_B16B16 0x0000020000000000ul -#define HWCAP2_SME_F16F16 0x0000040000000000ul -#define HWCAP2_MOPS 0x0000080000000000ul -#define HWCAP2_HBC 0x0000100000000000ul +#define HWCAP2_DCPODP (1 << 0) +#define HWCAP2_SVE2 (1 << 1) +#define HWCAP2_SVEAES (1 << 2) +#define HWCAP2_SVEPMULL (1 << 3) +#define HWCAP2_SVEBITPERM (1 << 4) +#define HWCAP2_SVESHA3 (1 << 5) +#define HWCAP2_SVESM4 (1 << 6) +#define HWCAP2_FLAGM2 (1 << 7) +#define HWCAP2_FRINT (1 << 8) +#define HWCAP2_SVEI8MM (1 << 9) +#define HWCAP2_SVEF32MM (1 << 10) +#define HWCAP2_SVEF64MM (1 << 11) +#define HWCAP2_SVEBF16 (1 << 12) +#define HWCAP2_I8MM (1 << 13) +#define HWCAP2_BF16 (1 << 14) +#define HWCAP2_DGH (1 << 15) +#define HWCAP2_RNG (1 << 16) +#define HWCAP2_BTI (1 << 17) +#define HWCAP2_MTE (1 << 18) +#define HWCAP2_ECV (1 << 19) +#define HWCAP2_AFP (1 << 20) +#define HWCAP2_RPRES (1 << 21) +#define HWCAP2_MTE3 (1 << 22) +#define HWCAP2_SME (1 << 23) +#define HWCAP2_SME_I16I64 (1 << 24) +#define HWCAP2_SME_F64F64 (1 << 25) +#define HWCAP2_SME_I8I32 (1 << 26) +#define HWCAP2_SME_F16F32 (1 << 27) +#define HWCAP2_SME_B16F32 (1 << 28) +#define HWCAP2_SME_F32F32 (1 << 29) +#define HWCAP2_SME_FA64 (1 << 30) +#define HWCAP2_WFXT (1UL << 31) +#define HWCAP2_EBF16 (1UL << 32) +#define HWCAP2_SVE_EBF16 (1UL << 33) +#define HWCAP2_CSSC (1UL << 34) +#define HWCAP2_RPRFM (1UL << 35) +#define HWCAP2_SVE2P1 (1UL << 36) +#define HWCAP2_SME2 (1UL << 37) +#define HWCAP2_SME2P1 (1UL << 38) +#define HWCAP2_SME_I16I32 (1UL << 39) +#define HWCAP2_SME_BI32I32 (1UL << 40) +#define HWCAP2_SME_B16B16 (1UL << 41) +#define HWCAP2_SME_F16F16 (1UL << 42) +#define HWCAP2_MOPS (1UL << 43) +#define HWCAP2_HBC (1UL << 44) +#define HWCAP2_SVE_B16B16 (1UL << 45) +#define HWCAP2_LRCPC3 (1UL << 46) +#define HWCAP2_LSE128 (1UL << 47) +#define HWCAP2_FPMR (1UL << 48) +#define HWCAP2_LUT (1UL << 49) +#define HWCAP2_FAMINMAX (1UL << 50) +#define HWCAP2_F8CVT (1UL << 51) +#define HWCAP2_F8FMA (1UL << 52) +#define HWCAP2_F8DP4 (1UL << 53) +#define HWCAP2_F8DP2 (1UL << 54) +#define HWCAP2_F8E4M3 (1UL << 55) +#define HWCAP2_F8E5M2 (1UL << 56) +#define HWCAP2_SME_LUTV2 (1UL << 57) +#define HWCAP2_SME_F8F16 (1UL << 58) +#define HWCAP2_SME_F8F32 (1UL << 59) +#define HWCAP2_SME_SF8FMA (1UL << 60) +#define HWCAP2_SME_SF8DP4 (1UL << 61) +#define HWCAP2_SME_SF8DP2 (1UL << 62) +#define HWCAP2_POE (1UL << 63) #ifdef COMPAT_FREEBSD32 /* ARM HWCAP */ From nobody Mon Feb 17 16:36:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxSwq1Fnrz5nrlq; Mon, 17 Feb 2025 16: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 4YxSwp3TS9z42Vb; Mon, 17 Feb 2025 16:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmbDknmPyIJvy263lye+ltt/x9VxwRTwblt7+aZ53es=; b=JhwV1OvhNf3u2PDloXKEgy1p9RIw7BLBp3QqJTcUjMZdkvb3OsXY6Kh/D7JZMqqxFID2JK DGOMGjZXYwI9AuiIt49wtlVdkrYY/gF5hQQJEyXo3JVyN4saUEs6E6TaWKW8olCKg4m5QR TnpJV6BbTxVRmoki61eFhA0QQBBbX3c0/pD2TkIwHgvXmINWNP3bJHcRR5DjZdbhZNDREP mt0SrCjxo1F6ciIzl9Fju7+O7qIJ9W0cUW4uy+bQGDUzA0v0uo69ela+X1aZFz+uAOPnhM 1aPY/YpuoizKNzce4XhzlOp02hHB6D1s4HqCfYTqMlSE7Y8YXCLGk0CSjKXIKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810218; a=rsa-sha256; cv=none; b=NCxV4Td6xEVc3fYbgmXLwq3/6+FtHzpEoYaOzTuteBFrPlZi9M+8JZytt8lnjWZFs6pMgy rMNlY5e2KDkGHKBnCjOPvOoo7/3x3k0/zn3cp4oA5VbjD29E74R6BHb6ukO2PqBWIwM5wN 5qmBkyoqtLjbQd+fV2j21t52t0bm+8AweiZd5nWLDvD/q1hHjQh4O7fIzLb0gmUL7LrJxI 8BsnqjMRV0dB9Wz2fiVOeskaf8Xe5I/Oj5U24em7HhF7VvA+JJLujBX7OAVknuzZY+4fcP X2szbfwechvTkwBSk8vfypMwddsFk3HaMgEmGsyTIM3TI2XMyXGT6Xv+2VNzkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmbDknmPyIJvy263lye+ltt/x9VxwRTwblt7+aZ53es=; b=H/Ig3rEfLN1t57uGEhABmL+RbEsVjEmTeI65ZcT+yLT1JT3+ImHEodO7vZbVaKKCu8Izf7 NWs4G15elKy0YWAYLCUa1XJ2nh11k1ktcubAxTsAMnvuaS/L8P+cAcvRJMGYU7QKkP3fFC AbqgOaku44YTgrKToZ/j721UwTgUoYigcPmv9eKBjRGTvUW6FPDyIuMv1zdqxqSSCAjO8A hPqsa7p/DpjJbXy+To8gl+Gn8SBOqbGvnEuDd/TS3SNM+XW0v3yvv5RoRgOjydfaI7R2uj XL5So2BCQQocAuG2fC7VnMyNpvwhqOlskqebyFUO56do2zDn4PEVy0Uid32BbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxSwp2yRrzhtG; Mon, 17 Feb 2025 16:36: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 51HGaw9T082819; Mon, 17 Feb 2025 16:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HGawkx082816; Mon, 17 Feb 2025 16:36:58 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:36:58 GMT Message-Id: <202502171636.51HGawkx082816@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 4daaee441311 - main - arm64: update and align armreg.h with ARMv8.9 features List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4daaee441311833ca2bef8ddae0089f66a900844 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=4daaee441311833ca2bef8ddae0089f66a900844 commit 4daaee441311833ca2bef8ddae0089f66a900844 Author: Harry Moulton AuthorDate: 2025-02-17 16:00:19 +0000 Commit: Andrew Turner CommitDate: 2025-02-17 16:07:36 +0000 arm64: update and align armreg.h with ARMv8.9 features Update armreg.h to contain feature bit definitions for all architecture versions up to and including ARMv8.9. This includes a number of corrections for PAC_frac, PAN and ETS definitions. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48815 Signed-off-by: Harry Moulton --- sys/arm64/include/armreg.h | 215 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 180 insertions(+), 35 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 2a2c8b23e0a4..a72e1ea99793 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -795,6 +795,7 @@ #define ID_AA64DFR0_DebugVer_8_2 (UL(0x8) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer_8_4 (UL(0x9) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_DebugVer_8_8 (UL(0xa) << ID_AA64DFR0_DebugVer_SHIFT) +#define ID_AA64DFR0_DebugVer_8_9 (UL(0xb) << ID_AA64DFR0_DebugVer_SHIFT) #define ID_AA64DFR0_TraceVer_SHIFT 4 #define ID_AA64DFR0_TraceVer_WIDTH 4 #define ID_AA64DFR0_TraceVer_MASK (UL(0xf) << ID_AA64DFR0_TraceVer_SHIFT) @@ -812,6 +813,7 @@ #define ID_AA64DFR0_PMUVer_3_5 (UL(0x6) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_3_7 (UL(0x7) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_3_8 (UL(0x8) << ID_AA64DFR0_PMUVer_SHIFT) +#define ID_AA64DFR0_PMUVer_3_9 (UL(0x9) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_PMUVer_IMPL (UL(0xf) << ID_AA64DFR0_PMUVer_SHIFT) #define ID_AA64DFR0_BRPs_SHIFT 12 #define ID_AA64DFR0_BRPs_WIDTH 4 @@ -843,6 +845,7 @@ #define ID_AA64DFR0_PMSVer_SPE_1_1 (UL(0x2) << ID_AA64DFR0_PMSVer_SHIFT) #define ID_AA64DFR0_PMSVer_SPE_1_2 (UL(0x3) << ID_AA64DFR0_PMSVer_SHIFT) #define ID_AA64DFR0_PMSVer_SPE_1_3 (UL(0x4) << ID_AA64DFR0_PMSVer_SHIFT) +#define ID_AA64DFR0_PMSVer_SPE_1_4 (UL(0x5) << ID_AA64DFR0_PMSVer_SHIFT) #define ID_AA64DFR0_DoubleLock_SHIFT 36 #define ID_AA64DFR0_DoubleLock_WIDTH 4 #define ID_AA64DFR0_DoubleLock_MASK (UL(0xf) << ID_AA64DFR0_DoubleLock_SHIFT) @@ -890,6 +893,24 @@ #define ID_AA64DFR1_EL1_CRn 0 #define ID_AA64DFR1_EL1_CRm 5 #define ID_AA64DFR1_EL1_op2 1 +#define ID_AA64DFR1_SPMU_SHIFT 32 +#define ID_AA64DFR1_SPMU_WIDTH 4 +#define ID_AA64DFR1_SPMU_MASK (UL(0xf) << ID_AA64DFR1_SPMU_SHIFT) +#define ID_AA64DFR1_SPMU_VAL(x) ((x) & ID_AA64DFR1_SPMU_MASK) +#define ID_AA64DFR1_SPMU_NONE (UL(0x0) << ID_AA64DFR1_SPMU_SHIFT) +#define ID_AA64DFR1_SPMU_IMPL (UL(0x1) << ID_AA64DFR1_SPMU_SHIFT) +#define ID_AA64DFR1_PMICNTR_SHIFT 36 +#define ID_AA64DFR1_PMICNTR_WIDTH 4 +#define ID_AA64DFR1_PMICNTR_MASK (UL(0xf) << ID_AA64DFR1_PMICNTR_SHIFT) +#define ID_AA64DFR1_PMICNTR_VAL(x) ((x) & ID_AA64DFR1_PMICNTR_MASK) +#define ID_AA64DFR1_PMICNTR_NONE (UL(0x0) << ID_AA64DFR1_PMICNTR_SHIFT) +#define ID_AA64DFR1_PMICNTR_IMPL (UL(0x1) << ID_AA64DFR1_PMICNTR_SHIFT) +#define ID_AA64DFR1_DPFZS_SHIFT 52 +#define ID_AA64DFR1_DPFZS_WIDTH 4 +#define ID_AA64DFR1_DPFZS_MASK (UL(0xf) << ID_AA64DFR1_DPFZS_SHIFT) +#define ID_AA64DFR1_DPFZS_VAL(x) ((x) & ID_AA64DFR1_DPFZS_MASK) +#define ID_AA64DFR1_DPFZS_NONE (UL(0x0) << ID_AA64DFR1_DPFZS_SHIFT) +#define ID_AA64DFR1_DPFZS_IMPL (UL(0x1) << ID_AA64DFR1_DPFZS_SHIFT) /* ID_AA64ISAR0_EL1 */ #define ID_AA64ISAR0_EL1 MRS_REG(ID_AA64ISAR0_EL1) @@ -1076,7 +1097,8 @@ #define ID_AA64ISAR1_SPECRES_MASK (UL(0xf) << ID_AA64ISAR1_SPECRES_SHIFT) #define ID_AA64ISAR1_SPECRES_VAL(x) ((x) & ID_AA64ISAR1_SPECRES_MASK) #define ID_AA64ISAR1_SPECRES_NONE (UL(0x0) << ID_AA64ISAR1_SPECRES_SHIFT) -#define ID_AA64ISAR1_SPECRES_IMPL (UL(0x1) << ID_AA64ISAR1_SPECRES_SHIFT) +#define ID_AA64ISAR1_SPECRES_8_5 (UL(0x1) << ID_AA64ISAR1_SPECRES_SHIFT) +#define ID_AA64ISAR1_SPECRES_8_9 (UL(0x2) << ID_AA64ISAR1_SPECRES_SHIFT) #define ID_AA64ISAR1_BF16_SHIFT 44 #define ID_AA64ISAR1_BF16_WIDTH 4 #define ID_AA64ISAR1_BF16_MASK (UL(0xf) << ID_AA64ISAR1_BF16_SHIFT) @@ -1159,12 +1181,42 @@ #define ID_AA64ISAR2_BC_VAL(x) ((x) & ID_AA64ISAR2_BC_MASK) #define ID_AA64ISAR2_BC_NONE (UL(0x0) << ID_AA64ISAR2_BC_SHIFT) #define ID_AA64ISAR2_BC_IMPL (UL(0x1) << ID_AA64ISAR2_BC_SHIFT) -#define ID_AA64ISAR2_PAC_frac_SHIFT 28 +#define ID_AA64ISAR2_PAC_frac_SHIFT 24 #define ID_AA64ISAR2_PAC_frac_WIDTH 4 #define ID_AA64ISAR2_PAC_frac_MASK (UL(0xf) << ID_AA64ISAR2_PAC_frac_SHIFT) #define ID_AA64ISAR2_PAC_frac_VAL(x) ((x) & ID_AA64ISAR2_PAC_frac_MASK) #define ID_AA64ISAR2_PAC_frac_NONE (UL(0x0) << ID_AA64ISAR2_PAC_frac_SHIFT) #define ID_AA64ISAR2_PAC_frac_IMPL (UL(0x1) << ID_AA64ISAR2_PAC_frac_SHIFT) +#define ID_AA64ISAR2_CLRBHB_SHIFT 28 +#define ID_AA64ISAR2_CLRBHB_WIDTH 4 +#define ID_AA64ISAR2_CLRBHB_MASK (UL(0xf) << ID_AA64ISAR2_CLRBHB_SHIFT) +#define ID_AA64ISAR2_CLRBHB_VAL(x) ((x) & ID_AA64ISAR2_CLRBHB_MASK) +#define ID_AA64ISAR2_CLRBHB_NONE (UL(0x0) << ID_AA64ISAR2_CLRBHB_SHIFT) +#define ID_AA64ISAR2_CLRBHB_IMPL (UL(0x1) << ID_AA64ISAR2_CLRBHB_SHIFT) +#define ID_AA64ISAR2_PRFMSLC_SHIFT 40 +#define ID_AA64ISAR2_PRFMSLC_WIDTH 4 +#define ID_AA64ISAR2_PRFMSLC_MASK (UL(0xf) << ID_AA64ISAR2_PRFMSLC_SHIFT) +#define ID_AA64ISAR2_PRFMSLC_VAL(x) ((x) & ID_AA64ISAR2_PRFMSLC_MASK) +#define ID_AA64ISAR2_PRFMSLC_NONE (UL(0x0) << ID_AA64ISAR2_PRFMSLC_SHIFT) +#define ID_AA64ISAR2_PRFMSLC_IMPL (UL(0x1) << ID_AA64ISAR2_PRFMSLC_SHIFT) +#define ID_AA64ISAR2_RPRFM_SHIFT 48 +#define ID_AA64ISAR2_RPRFM_WIDTH 4 +#define ID_AA64ISAR2_RPRFM_MASK (UL(0xf) << ID_AA64ISAR2_RPRFM_SHIFT) +#define ID_AA64ISAR2_RPRFM_VAL(x) ((x) & ID_AA64ISAR2_RPRFM_MASK) +#define ID_AA64ISAR2_RPRFM_NONE (UL(0x0) << ID_AA64ISAR2_RPRFM_SHIFT) +#define ID_AA64ISAR2_RPRFM_IMPL (UL(0x1) << ID_AA64ISAR2_RPRFM_SHIFT) +#define ID_AA64ISAR2_CSSC_SHIFT 52 +#define ID_AA64ISAR2_CSSC_WIDTH 4 +#define ID_AA64ISAR2_CSSC_MASK (UL(0xf) << ID_AA64ISAR2_CSSC_SHIFT) +#define ID_AA64ISAR2_CSSC_VAL(x) ((x) & ID_AA64ISAR2_CSSC_MASK) +#define ID_AA64ISAR2_CSSC_NONE (UL(0x0) << ID_AA64ISAR2_CSSC_SHIFT) +#define ID_AA64ISAR2_CSSC_IMPL (UL(0x1) << ID_AA64ISAR2_CSSC_SHIFT) +#define ID_AA64ISAR2_ATS1A_SHIFT 60 +#define ID_AA64ISAR2_ATS1A_WIDTH 4 +#define ID_AA64ISAR2_ATS1A_MASK (UL(0xf) << ID_AA64ISAR2_ATS1A_SHIFT) +#define ID_AA64ISAR2_ATS1A_VAL(x) ((x) & ID_AA64ISAR2_ATS1A_MASK) +#define ID_AA64ISAR2_ATS1A_NONE (UL(0x0) << ID_AA64ISAR2_ATS1A_SHIFT) +#define ID_AA64ISAR2_ATS1A_IMPL (UL(0x1) << ID_AA64ISAR2_ATS1A_SHIFT) /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_EL1 MRS_REG(ID_AA64MMFR0_EL1) @@ -1263,7 +1315,8 @@ #define ID_AA64MMFR0_FGT_MASK (UL(0xf) << ID_AA64MMFR0_FGT_SHIFT) #define ID_AA64MMFR0_FGT_VAL(x) ((x) & ID_AA64MMFR0_FGT_MASK) #define ID_AA64MMFR0_FGT_NONE (UL(0x0) << ID_AA64MMFR0_FGT_SHIFT) -#define ID_AA64MMFR0_FGT_IMPL (UL(0x1) << ID_AA64MMFR0_FGT_SHIFT) +#define ID_AA64MMFR0_FGT_8_6 (UL(0x1) << ID_AA64MMFR0_FGT_SHIFT) +#define ID_AA64MMFR0_FGT_8_9 (UL(0x2) << ID_AA64MMFR0_FGT_SHIFT) #define ID_AA64MMFR0_ECV_SHIFT 60 #define ID_AA64MMFR0_ECV_WIDTH 4 #define ID_AA64MMFR0_ECV_MASK (UL(0xf) << ID_AA64MMFR0_ECV_SHIFT) @@ -1319,7 +1372,7 @@ #define ID_AA64MMFR1_PAN_NONE (UL(0x0) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_IMPL (UL(0x1) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_PAN_ATS1E1 (UL(0x2) << ID_AA64MMFR1_PAN_SHIFT) -#define ID_AA64MMFR1_PAN_EPAN (UL(0x2) << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_EPAN (UL(0x3) << ID_AA64MMFR1_PAN_SHIFT) #define ID_AA64MMFR1_SpecSEI_SHIFT 24 #define ID_AA64MMFR1_SpecSEI_WIDTH 4 #define ID_AA64MMFR1_SpecSEI_MASK (UL(0xf) << ID_AA64MMFR1_SpecSEI_SHIFT) @@ -1343,7 +1396,8 @@ #define ID_AA64MMFR1_ETS_MASK (UL(0xf) << ID_AA64MMFR1_ETS_SHIFT) #define ID_AA64MMFR1_ETS_VAL(x) ((x) & ID_AA64MMFR1_ETS_MASK) #define ID_AA64MMFR1_ETS_NONE (UL(0x0) << ID_AA64MMFR1_ETS_SHIFT) -#define ID_AA64MMFR1_ETS_IMPL (UL(0x1) << ID_AA64MMFR1_ETS_SHIFT) +#define ID_AA64MMFR1_ETS_NONE2 (UL(0x1) << ID_AA64MMFR1_ETS_SHIFT) +#define ID_AA64MMFR1_ETS_IMPL (UL(0x2) << ID_AA64MMFR1_ETS_SHIFT) #define ID_AA64MMFR1_HCX_SHIFT 40 #define ID_AA64MMFR1_HCX_WIDTH 4 #define ID_AA64MMFR1_HCX_MASK (UL(0xf) << ID_AA64MMFR1_HCX_SHIFT) @@ -1374,6 +1428,12 @@ #define ID_AA64MMFR1_CMOVW_VAL(x) ((x) & ID_AA64MMFR1_CMOVW_MASK) #define ID_AA64MMFR1_CMOVW_NONE (UL(0x0) << ID_AA64MMFR1_CMOVW_SHIFT) #define ID_AA64MMFR1_CMOVW_IMPL (UL(0x1) << ID_AA64MMFR1_CMOVW_SHIFT) +#define ID_AA64MMFR1_ECBHB_SHIFT 60 +#define ID_AA64MMFR1_ECBHB_WIDTH 4 +#define ID_AA64MMFR1_ECBHB_MASK (UL(0xf) << ID_AA64MMFR1_ECBHB_SHIFT) +#define ID_AA64MMFR1_ECBHB_VAL(x) ((x) & ID_AA64MMFR1_ECBHB_MASK) +#define ID_AA64MMFR1_ECBHB_NONE (UL(0x0) << ID_AA64MMFR1_ECBHB_SHIFT) +#define ID_AA64MMFR1_ECBHB_IMPL (UL(0x1) << ID_AA64MMFR1_ECBHB_SHIFT) /* ID_AA64MMFR2_EL1 */ #define ID_AA64MMFR2_EL1 MRS_REG(ID_AA64MMFR2_EL1) @@ -1497,12 +1557,66 @@ #define ID_AA64MMFR3_SCTLRX_VAL(x) ((x) & ID_AA64MMFR3_SCTLRX_MASK) #define ID_AA64MMFR3_SCTLRX_NONE (UL(0x0) << ID_AA64MMFR3_SCTLRX_SHIFT) #define ID_AA64MMFR3_SCTLRX_IMPL (UL(0x1) << ID_AA64MMFR3_SCTLRX_SHIFT) +#define ID_AA64MMFR3_S1PIE_SHIFT 8 +#define ID_AA64MMFR3_S1PIE_WIDTH 4 +#define ID_AA64MMFR3_S1PIE_MASK (UL(0xf) << ID_AA64MMFR3_S1PIE_SHIFT) +#define ID_AA64MMFR3_S1PIE_VAL(x) ((x) & ID_AA64MMFR3_S1PIE_MASK) +#define ID_AA64MMFR3_S1PIE_NONE (UL(0x0) << ID_AA64MMFR3_S1PIE_SHIFT) +#define ID_AA64MMFR3_S1PIE_IMPL (UL(0x1) << ID_AA64MMFR3_S1PIE_SHIFT) +#define ID_AA64MMFR3_S2PIE_SHIFT 12 +#define ID_AA64MMFR3_S2PIE_WIDTH 4 +#define ID_AA64MMFR3_S2PIE_MASK (UL(0xf) << ID_AA64MMFR3_S2PIE_SHIFT) +#define ID_AA64MMFR3_S2PIE_VAL(x) ((x) & ID_AA64MMFR3_S2PIE_MASK) +#define ID_AA64MMFR3_S2PIE_NONE (UL(0x0) << ID_AA64MMFR3_S2PIE_SHIFT) +#define ID_AA64MMFR3_S2PIE_IMPL (UL(0x1) << ID_AA64MMFR3_S2PIE_SHIFT) +#define ID_AA64MMFR3_S1POE_SHIFT 16 +#define ID_AA64MMFR3_S1POE_WIDTH 4 +#define ID_AA64MMFR3_S1POE_MASK (UL(0xf) << ID_AA64MMFR3_S1POE_SHIFT) +#define ID_AA64MMFR3_S1POE_VAL(x) ((x) & ID_AA64MMFR3_S1POE_MASK) +#define ID_AA64MMFR3_S1POE_NONE (UL(0x0) << ID_AA64MMFR3_S1POE_SHIFT) +#define ID_AA64MMFR3_S1POE_IMPL (UL(0x1) << ID_AA64MMFR3_S1POE_SHIFT) +#define ID_AA64MMFR3_S2POE_SHIFT 20 +#define ID_AA64MMFR3_S2POE_WIDTH 4 +#define ID_AA64MMFR3_S2POE_MASK (UL(0xf) << ID_AA64MMFR3_S2POE_SHIFT) +#define ID_AA64MMFR3_S2POE_VAL(x) ((x) & ID_AA64MMFR3_S2POE_MASK) +#define ID_AA64MMFR3_S2POE_NONE (UL(0x0) << ID_AA64MMFR3_S2POE_SHIFT) +#define ID_AA64MMFR3_S2POE_IMPL (UL(0x1) << ID_AA64MMFR3_S2POE_SHIFT) +#define ID_AA64MMFR3_AIE_SHIFT 24 +#define ID_AA64MMFR3_AIE_WIDTH 4 +#define ID_AA64MMFR3_AIE_MASK (UL(0xf) << ID_AA64MMFR3_AIE_SHIFT) +#define ID_AA64MMFR3_AIE_VAL(x) ((x) & ID_AA64MMFR3_AIE_MASK) +#define ID_AA64MMFR3_AIE_NONE (UL(0x0) << ID_AA64MMFR3_AIE_SHIFT) +#define ID_AA64MMFR3_AIE_IMPL (UL(0x1) << ID_AA64MMFR3_AIE_SHIFT) #define ID_AA64MMFR3_MEC_SHIFT 28 #define ID_AA64MMFR3_MEC_WIDTH 4 #define ID_AA64MMFR3_MEC_MASK (UL(0xf) << ID_AA64MMFR3_MEC_SHIFT) #define ID_AA64MMFR3_MEC_VAL(x) ((x) & ID_AA64MMFR3_MEC_MASK) #define ID_AA64MMFR3_MEC_NONE (UL(0x0) << ID_AA64MMFR3_MEC_SHIFT) #define ID_AA64MMFR3_MEC_IMPL (UL(0x1) << ID_AA64MMFR3_MEC_SHIFT) +#define ID_AA64MMFR3_SNERR_SHIFT 40 +#define ID_AA64MMFR3_SNERR_WIDTH 4 +#define ID_AA64MMFR3_SNERR_MASK (UL(0xf) << ID_AA64MMFR3_SNERR_SHIFT) +#define ID_AA64MMFR3_SNERR_VAL(x) ((x) & ID_AA64MMFR3_SNERR_MASK) +#define ID_AA64MMFR3_SNERR_NONE (UL(0x0) << ID_AA64MMFR3_SNERR_SHIFT) +#define ID_AA64MMFR3_SNERR_ALL (UL(0x1) << ID_AA64MMFR3_SNERR_SHIFT) +#define ID_AA64MMFR3_ANERR_SHIFT 44 +#define ID_AA64MMFR3_ANERR_WIDTH 4 +#define ID_AA64MMFR3_ANERR_MASK (UL(0xf) << ID_AA64MMFR3_ANERR_SHIFT) +#define ID_AA64MMFR3_ANERR_VAL(x) ((x) & ID_AA64MMFR3_ANERR_MASK) +#define ID_AA64MMFR3_ANERR_NONE (UL(0x0) << ID_AA64MMFR3_ANERR_SHIFT) +#define ID_AA64MMFR3_ANERR_SOME (UL(0x1) << ID_AA64MMFR3_ANERR_SHIFT) +#define ID_AA64MMFR3_SDERR_SHIFT 52 +#define ID_AA64MMFR3_SDERR_WIDTH 4 +#define ID_AA64MMFR3_SDERR_MASK (UL(0xf) << ID_AA64MMFR3_SDERR_SHIFT) +#define ID_AA64MMFR3_SDERR_VAL(x) ((x) & ID_AA64MMFR3_SDERR_MASK) +#define ID_AA64MMFR3_SDERR_NONE (UL(0x0) << ID_AA64MMFR3_SDERR_SHIFT) +#define ID_AA64MMFR3_SDERR_ALL (UL(0x1) << ID_AA64MMFR3_SDERR_SHIFT) +#define ID_AA64MMFR3_ADERR_SHIFT 56 +#define ID_AA64MMFR3_ADERR_WIDTH 4 +#define ID_AA64MMFR3_ADERR_MASK (UL(0xf) << ID_AA64MMFR3_ADERR_SHIFT) +#define ID_AA64MMFR3_ADERR_VAL(x) ((x) & ID_AA64MMFR3_ADERR_MASK) +#define ID_AA64MMFR3_ADERR_NONE (UL(0x0) << ID_AA64MMFR3_ADERR_SHIFT) +#define ID_AA64MMFR3_ADERR_SOME (UL(0x1) << ID_AA64MMFR3_ADERR_SHIFT) #define ID_AA64MMFR3_Spec_FPACC_SHIFT 60 #define ID_AA64MMFR3_Spec_FPACC_WIDTH 4 #define ID_AA64MMFR3_Spec_FPACC_MASK (UL(0xf) << ID_AA64MMFR3_Spec_FPACC_SHIFT) @@ -1582,6 +1696,7 @@ #define ID_AA64PFR0_RAS_NONE (UL(0x0) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_RAS_IMPL (UL(0x1) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_RAS_8_4 (UL(0x2) << ID_AA64PFR0_RAS_SHIFT) +#define ID_AA64PFR0_RAS_8_9 (UL(0x3) << ID_AA64PFR0_RAS_SHIFT) #define ID_AA64PFR0_SVE_SHIFT 32 #define ID_AA64PFR0_SVE_WIDTH 4 #define ID_AA64PFR0_SVE_MASK (UL(0xf) << ID_AA64PFR0_SVE_SHIFT) @@ -1701,6 +1816,36 @@ #define ID_AA64PFR1_NMI_VAL(x) ((x) & ID_AA64PFR1_NMI_MASK) #define ID_AA64PFR1_NMI_NONE (UL(0x0) << ID_AA64PFR1_NMI_SHIFT) #define ID_AA64PFR1_NMI_IMPL (UL(0x1) << ID_AA64PFR1_NMI_SHIFT) +#define ID_AA64PFR1_MTE_frac_SHIFT 40 +#define ID_AA64PFR1_MTE_frac_WIDTH 4 +#define ID_AA64PFR1_MTE_frac_MASK (UL(0xf) << ID_AA64PFR1_MTE_frac_SHIFT) +#define ID_AA64PFR1_MTE_frac_VAL(x) ((x) & ID_AA64PFR1_MTE_frac_MASK) +#define ID_AA64PFR1_MTE_frac_IMPL (UL(0x0) << ID_AA64PFR1_MTE_frac_SHIFT) +#define ID_AA64PFR1_MTE_frac_NONE (UL(0xf) << ID_AA64PFR1_MTE_frac_SHIFT) +#define ID_AA64PFR1_THE_SHIFT 48 +#define ID_AA64PFR1_THE_WIDTH 4 +#define ID_AA64PFR1_THE_MASK (UL(0xf) << ID_AA64PFR1_THE_SHIFT) +#define ID_AA64PFR1_THE_VAL(x) ((x) & ID_AA64PFR1_THE_MASK) +#define ID_AA64PFR1_THE_NONE (UL(0x0) << ID_AA64PFR1_THE_SHIFT) +#define ID_AA64PFR1_THE_IMPL (UL(0x1) << ID_AA64PFR1_THE_SHIFT) +#define ID_AA64PFR1_MTEX_SHIFT 52 +#define ID_AA64PFR1_MTEX_WIDTH 4 +#define ID_AA64PFR1_MTEX_MASK (UL(0xf) << ID_AA64PFR1_MTEX_SHIFT) +#define ID_AA64PFR1_MTEX_VAL(x) ((x) & ID_AA64PFR1_MTEX_MASK) +#define ID_AA64PFR1_MTEX_NONE (UL(0x0) << ID_AA64PFR1_MTEX_SHIFT) +#define ID_AA64PFR1_MTEX_IMPL (UL(0x1) << ID_AA64PFR1_MTEX_SHIFT) +#define ID_AA64PFR1_DF2_SHIFT 56 +#define ID_AA64PFR1_DF2_WIDTH 4 +#define ID_AA64PFR1_DF2_MASK (UL(0xf) << ID_AA64PFR1_DF2_SHIFT) +#define ID_AA64PFR1_DF2_VAL(x) ((x) & ID_AA64PFR1_DF2_MASK) +#define ID_AA64PFR1_DF2_NONE (UL(0x0) << ID_AA64PFR1_DF2_SHIFT) +#define ID_AA64PFR1_DF2_IMPL (UL(0x1) << ID_AA64PFR1_DF2_SHIFT) +#define ID_AA64PFR1_PFAR_SHIFT 60 +#define ID_AA64PFR1_PFAR_WIDTH 4 +#define ID_AA64PFR1_PFAR_MASK (UL(0xf) << ID_AA64PFR1_PFAR_SHIFT) +#define ID_AA64PFR1_PFAR_VAL(x) ((x) & ID_AA64PFR1_PFAR_MASK) +#define ID_AA64PFR1_PFAR_NONE (UL(0x0) << ID_AA64PFR1_PFAR_SHIFT) +#define ID_AA64PFR1_PFAR_IMPL (UL(0x1) << ID_AA64PFR1_PFAR_SHIFT) /* ID_AA64PFR2_EL1 */ #define ID_AA64PFR2_EL1 MRS_REG(ID_AA64PFR2_EL1) @@ -1722,60 +1867,60 @@ #define ID_AA64ZFR0_SVEver_SHIFT 0 #define ID_AA64ZFR0_SVEver_WIDTH 4 #define ID_AA64ZFR0_SVEver_MASK (UL(0xf) << ID_AA64ZFR0_SVEver_SHIFT) -#define ID_AA64ZFR0_SVEver_VAL(x) ((x) & ID_AA64ZFR0_SVEver_MASK -#define ID_AA64ZFR0_SVEver_SVE1 (UL(0x0) << ID_AA64ZFR0_SVEver_SHIFT) -#define ID_AA64ZFR0_SVEver_SVE2 (UL(0x1) << ID_AA64ZFR0_SVEver_SHIFT) -#define ID_AA64ZFR0_SVEver_SVE2P1 (UL(0x2) << ID_AA64ZFR0_SVEver_SHIFT) +#define ID_AA64ZFR0_SVEver_VAL(x) ((x) & ID_AA64ZFR0_SVEver_MASK) +#define ID_AA64ZFR0_SVEver_SVE1 (UL(0x0) << ID_AA64ZFR0_SVEver_SHIFT) +#define ID_AA64ZFR0_SVEver_SVE2 (UL(0x1) << ID_AA64ZFR0_SVEver_SHIFT) +#define ID_AA64ZFR0_SVEver_SVE2P1 (UL(0x2) << ID_AA64ZFR0_SVEver_SHIFT) #define ID_AA64ZFR0_AES_SHIFT 4 #define ID_AA64ZFR0_AES_WIDTH 4 #define ID_AA64ZFR0_AES_MASK (UL(0xf) << ID_AA64ZFR0_AES_SHIFT) -#define ID_AA64ZFR0_AES_VAL(x) ((x) & ID_AA64ZFR0_AES_MASK -#define ID_AA64ZFR0_AES_NONE (UL(0x0) << ID_AA64ZFR0_AES_SHIFT) -#define ID_AA64ZFR0_AES_BASE (UL(0x1) << ID_AA64ZFR0_AES_SHIFT) -#define ID_AA64ZFR0_AES_PMULL (UL(0x2) << ID_AA64ZFR0_AES_SHIFT) +#define ID_AA64ZFR0_AES_VAL(x) ((x) & ID_AA64ZFR0_AES_MASK) +#define ID_AA64ZFR0_AES_NONE (UL(0x0) << ID_AA64ZFR0_AES_SHIFT) +#define ID_AA64ZFR0_AES_BASE (UL(0x1) << ID_AA64ZFR0_AES_SHIFT) +#define ID_AA64ZFR0_AES_PMULL (UL(0x2) << ID_AA64ZFR0_AES_SHIFT) #define ID_AA64ZFR0_BitPerm_SHIFT 16 #define ID_AA64ZFR0_BitPerm_WIDTH 4 #define ID_AA64ZFR0_BitPerm_MASK (UL(0xf) << ID_AA64ZFR0_BitPerm_SHIFT) -#define ID_AA64ZFR0_BitPerm_VAL(x) ((x) & ID_AA64ZFR0_BitPerm_MASK -#define ID_AA64ZFR0_BitPerm_NONE (UL(0x0) << ID_AA64ZFR0_BitPerm_SHIFT) -#define ID_AA64ZFR0_BitPerm_IMPL (UL(0x1) << ID_AA64ZFR0_BitPerm_SHIFT) +#define ID_AA64ZFR0_BitPerm_VAL(x) ((x) & ID_AA64ZFR0_BitPerm_MASK) +#define ID_AA64ZFR0_BitPerm_NONE (UL(0x0) << ID_AA64ZFR0_BitPerm_SHIFT) +#define ID_AA64ZFR0_BitPerm_IMPL (UL(0x1) << ID_AA64ZFR0_BitPerm_SHIFT) #define ID_AA64ZFR0_BF16_SHIFT 20 #define ID_AA64ZFR0_BF16_WIDTH 4 #define ID_AA64ZFR0_BF16_MASK (UL(0xf) << ID_AA64ZFR0_BF16_SHIFT) -#define ID_AA64ZFR0_BF16_VAL(x) ((x) & ID_AA64ZFR0_BF16_MASK -#define ID_AA64ZFR0_BF16_NONE (UL(0x0) << ID_AA64ZFR0_BF16_SHIFT) -#define ID_AA64ZFR0_BF16_BASE (UL(0x1) << ID_AA64ZFR0_BF16_SHIFT) -#define ID_AA64ZFR0_BF16_EBF (UL(0x1) << ID_AA64ZFR0_BF16_SHIFT) +#define ID_AA64ZFR0_BF16_VAL(x) ((x) & ID_AA64ZFR0_BF16_MASK) +#define ID_AA64ZFR0_BF16_NONE (UL(0x0) << ID_AA64ZFR0_BF16_SHIFT) +#define ID_AA64ZFR0_BF16_BASE (UL(0x1) << ID_AA64ZFR0_BF16_SHIFT) +#define ID_AA64ZFR0_BF16_EBF (UL(0x1) << ID_AA64ZFR0_BF16_SHIFT) #define ID_AA64ZFR0_SHA3_SHIFT 32 #define ID_AA64ZFR0_SHA3_WIDTH 4 #define ID_AA64ZFR0_SHA3_MASK (UL(0xf) << ID_AA64ZFR0_SHA3_SHIFT) -#define ID_AA64ZFR0_SHA3_VAL(x) ((x) & ID_AA64ZFR0_SHA3_MASK -#define ID_AA64ZFR0_SHA3_NONE (UL(0x0) << ID_AA64ZFR0_SHA3_SHIFT) -#define ID_AA64ZFR0_SHA3_IMPL (UL(0x1) << ID_AA64ZFR0_SHA3_SHIFT) +#define ID_AA64ZFR0_SHA3_VAL(x) ((x) & ID_AA64ZFR0_SHA3_MASK) +#define ID_AA64ZFR0_SHA3_NONE (UL(0x0) << ID_AA64ZFR0_SHA3_SHIFT) +#define ID_AA64ZFR0_SHA3_IMPL (UL(0x1) << ID_AA64ZFR0_SHA3_SHIFT) #define ID_AA64ZFR0_SM4_SHIFT 40 #define ID_AA64ZFR0_SM4_WIDTH 4 #define ID_AA64ZFR0_SM4_MASK (UL(0xf) << ID_AA64ZFR0_SM4_SHIFT) -#define ID_AA64ZFR0_SM4_VAL(x) ((x) & ID_AA64ZFR0_SM4_MASK -#define ID_AA64ZFR0_SM4_NONE (UL(0x0) << ID_AA64ZFR0_SM4_SHIFT) -#define ID_AA64ZFR0_SM4_IMPL (UL(0x1) << ID_AA64ZFR0_SM4_SHIFT) +#define ID_AA64ZFR0_SM4_VAL(x) ((x) & ID_AA64ZFR0_SM4_MASK) +#define ID_AA64ZFR0_SM4_NONE (UL(0x0) << ID_AA64ZFR0_SM4_SHIFT) +#define ID_AA64ZFR0_SM4_IMPL (UL(0x1) << ID_AA64ZFR0_SM4_SHIFT) #define ID_AA64ZFR0_I8MM_SHIFT 44 #define ID_AA64ZFR0_I8MM_WIDTH 4 #define ID_AA64ZFR0_I8MM_MASK (UL(0xf) << ID_AA64ZFR0_I8MM_SHIFT) -#define ID_AA64ZFR0_I8MM_VAL(x) ((x) & ID_AA64ZFR0_I8MM_MASK -#define ID_AA64ZFR0_I8MM_NONE (UL(0x0) << ID_AA64ZFR0_I8MM_SHIFT) -#define ID_AA64ZFR0_I8MM_IMPL (UL(0x1) << ID_AA64ZFR0_I8MM_SHIFT) +#define ID_AA64ZFR0_I8MM_VAL(x) ((x) & ID_AA64ZFR0_I8MM_MASK) +#define ID_AA64ZFR0_I8MM_NONE (UL(0x0) << ID_AA64ZFR0_I8MM_SHIFT) +#define ID_AA64ZFR0_I8MM_IMPL (UL(0x1) << ID_AA64ZFR0_I8MM_SHIFT) #define ID_AA64ZFR0_F32MM_SHIFT 52 #define ID_AA64ZFR0_F32MM_WIDTH 4 #define ID_AA64ZFR0_F32MM_MASK (UL(0xf) << ID_AA64ZFR0_F32MM_SHIFT) -#define ID_AA64ZFR0_F32MM_VAL(x) ((x) & ID_AA64ZFR0_F32MM_MASK -#define ID_AA64ZFR0_F32MM_NONE (UL(0x0) << ID_AA64ZFR0_F32MM_SHIFT) -#define ID_AA64ZFR0_F32MM_IMPL (UL(0x1) << ID_AA64ZFR0_F32MM_SHIFT) +#define ID_AA64ZFR0_F32MM_VAL(x) ((x) & ID_AA64ZFR0_F32MM_MASK) +#define ID_AA64ZFR0_F32MM_NONE (UL(0x0) << ID_AA64ZFR0_F32MM_SHIFT) +#define ID_AA64ZFR0_F32MM_IMPL (UL(0x1) << ID_AA64ZFR0_F32MM_SHIFT) #define ID_AA64ZFR0_F64MM_SHIFT 56 #define ID_AA64ZFR0_F64MM_WIDTH 4 #define ID_AA64ZFR0_F64MM_MASK (UL(0xf) << ID_AA64ZFR0_F64MM_SHIFT) -#define ID_AA64ZFR0_F64MM_VAL(x) ((x) & ID_AA64ZFR0_F64MM_MASK -#define ID_AA64ZFR0_F64MM_NONE (UL(0x0) << ID_AA64ZFR0_F64MM_SHIFT) -#define ID_AA64ZFR0_F64MM_IMPL (UL(0x1) << ID_AA64ZFR0_F64MM_SHIFT) +#define ID_AA64ZFR0_F64MM_VAL(x) ((x) & ID_AA64ZFR0_F64MM_MASK) +#define ID_AA64ZFR0_F64MM_NONE (UL(0x0) << ID_AA64ZFR0_F64MM_SHIFT) +#define ID_AA64ZFR0_F64MM_IMPL (UL(0x1) << ID_AA64ZFR0_F64MM_SHIFT) /* ID_ISAR5_EL1 */ #define ID_ISAR5_EL1 MRS_REG(ID_ISAR5_EL1) From nobody Mon Feb 17 16:36:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxSwq6xCKz5nrls; Mon, 17 Feb 2025 16: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 4YxSwq4nPNz42bV; Mon, 17 Feb 2025 16: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=1739810219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbIo7iNeFsMd6ZchzGLhqyzAupnxR2TfF9v5rxoh35o=; b=gq+nxxM69HuDjopRY1DjVCRP9gkNbwSU3eyeRBFHwsv895df3JWpSUUcD6lYIRGI8mgDVt rBxzgnJteB3kghVEcMAR+StDqJyK+piF1u/LVehmw+aR/1Bs/CiS/cL/OGVa/hMw0pOJEg QvkW7tGwtqIm+IzCARPsO653EbWsu06BE8JU6oomwnrNYegEx+lp2jkST+BrH0nnOK2c25 n8XjL5kSibd+Cyhm5lblfdftCWdiidHKTo5NIV8IrlV4zahdNP1A+cvExFMjid3QJ4TWsB kxTf4S5h6eb6mrCSknJmBL+LQd4mo3TJhpkYvL/kiSA9AUVtMvKbM9uBrqm/UA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810219; a=rsa-sha256; cv=none; b=oFdDhR0u1nHC+XEJ/5CIYI8U0BjWmXgJrxd2C7j2U72BgQbWNO8A0VMIpPeXKIIxcQTA3C cOxhE118IlPsWwftJp5XZtixLIORT7kVY7ttZUX2ifTUQL2wJAPTlK5QDG0D+K8LASuXou RDs9PiKdo3CZvo8rx5xZWeT6rNVTQ7E2PW1DzetamjQyKn6i/tMCqaTvEGBm1D+HNOggJb TiK0N8nYyiOnRYdmhliL+CG/0vHGAtN2yP807OouQuIO0i4aaz9C3AmJRgLq+B2Yf7advN LEMnrTa0Tu5HwaFTTK2QkbKh/w8vi2EeMvpvlYcL+pfePUpzO+U9Arw44991gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hbIo7iNeFsMd6ZchzGLhqyzAupnxR2TfF9v5rxoh35o=; b=sSdWgw5q9HVcXsptnnD3AonaBpdSM15J2CGtQpnAr3fK37i0yQl/0LQdd6RHyJRZWYuPK6 //jgUzsHONnkUBUV8RF/Q0QTwQ0ujblq0RFouFL3XznSsy2tnFHbdLIdnsSqOPTdJ8gWyk jKH7yd4EkvXD0u5Ne4YlSaJ6wjpZj9ydnseN/IjP5ouo8A5CyAiZa7v+pTpJYcogbcWRLm yhCqJXWPlIHcY0M3i1BHtzejJSciaJxi8ljX4PgJyOSTmuEF0gjFZUMRecSgOitBMOEJUN GBAppBRAJWMonQUAlLBJvzmMPFOPoknfmuf8TDOIC0z/LK4pAn08l2LOAdxUJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxSwq3wTZzhd4; Mon, 17 Feb 2025 16: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 51HGax8a082861; Mon, 17 Feb 2025 16: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 51HGaxpB082858; Mon, 17 Feb 2025 16:36:59 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:36:59 GMT Message-Id: <202502171636.51HGaxpB082858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 76c38c2f2e02 - main - arm64: add missing feature identification to align with ARMv8.9 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 76c38c2f2e026c5a019a759b2996745a42d10176 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=76c38c2f2e026c5a019a759b2996745a42d10176 commit 76c38c2f2e026c5a019a759b2996745a42d10176 Author: Harry Moulton AuthorDate: 2025-02-17 16:00:31 +0000 Commit: Andrew Turner CommitDate: 2025-02-17 16:07:36 +0000 arm64: add missing feature identification to align with ARMv8.9 Feature bit definitions in armreg.h have been updated to align with ARMv8.9. This change implements those updates in identcpu.c. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48816 Signed-off-by: Harry Moulton --- sys/arm64/arm64/identcpu.c | 159 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index a481661ff782..654a1b63d165 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -530,6 +530,7 @@ static const struct mrs_field_value id_aa64dfr0_pmsver[] = { MRS_FIELD_VALUE(ID_AA64DFR0_PMSVer_SPE_1_1, "SPEv1p1"), MRS_FIELD_VALUE(ID_AA64DFR0_PMSVer_SPE_1_2, "SPEv1p2"), MRS_FIELD_VALUE(ID_AA64DFR0_PMSVer_SPE_1_3, "SPEv1p3"), + MRS_FIELD_VALUE(ID_AA64DFR0_PMSVer_SPE_1_4, "SPEv1p4"), MRS_FIELD_VALUE_END, }; @@ -543,6 +544,11 @@ static const struct mrs_field_value id_aa64dfr0_wrps[] = { MRS_FIELD_VALUE_END, }; +static const struct mrs_field_value id_aa64dfr0_pmss[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64DFR0, PMSS, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64dfr0_brps[] = { MRS_FIELD_VALUE_COUNT(ID_AA64DFR0, BRPs, "Breakpoint"), MRS_FIELD_VALUE_END, @@ -556,6 +562,7 @@ static const struct mrs_field_value id_aa64dfr0_pmuver[] = { MRS_FIELD_VALUE(ID_AA64DFR0_PMUVer_3_5, "PMUv3p5"), MRS_FIELD_VALUE(ID_AA64DFR0_PMUVer_3_7, "PMUv3p7"), MRS_FIELD_VALUE(ID_AA64DFR0_PMUVer_3_8, "PMUv3p8"), + MRS_FIELD_VALUE(ID_AA64DFR0_PMUVer_3_9, "PMUv3p9"), MRS_FIELD_VALUE(ID_AA64DFR0_PMUVer_IMPL, "IMPL PMU"), MRS_FIELD_VALUE_END, }; @@ -572,6 +579,7 @@ static const struct mrs_field_value id_aa64dfr0_debugver[] = { MRS_FIELD_VALUE(ID_AA64DFR0_DebugVer_8_2, "Debugv8p2"), MRS_FIELD_VALUE(ID_AA64DFR0_DebugVer_8_4, "Debugv8p4"), MRS_FIELD_VALUE(ID_AA64DFR0_DebugVer_8_8, "Debugv8p8"), + MRS_FIELD_VALUE(ID_AA64DFR0_DebugVer_8_9, "Debugv8p9"), MRS_FIELD_VALUE_END, }; @@ -590,6 +598,7 @@ static const struct mrs_field id_aa64dfr0_fields[] = { id_aa64dfr0_ctx_cmps), MRS_FIELD(ID_AA64DFR0, WRPs, false, MRS_LOWER, MRS_USERSPACE, id_aa64dfr0_wrps), + MRS_FIELD(ID_AA64DFR0, PMSS, false, MRS_LOWER, 0, id_aa64dfr0_pmss), MRS_FIELD(ID_AA64DFR0, BRPs, false, MRS_LOWER, MRS_USERSPACE, id_aa64dfr0_brps), MRS_FIELD(ID_AA64DFR0, PMUVer, false, MRS_LOWER, 0, id_aa64dfr0_pmuver), @@ -602,7 +611,25 @@ static const struct mrs_field id_aa64dfr0_fields[] = { /* ID_AA64DFR1_EL1 */ +static const struct mrs_field_value id_aa64dfr1_dpfzs[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64DFR1, DPFZS, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64dfr1_pmicntr[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64DFR1, PMICNTR, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64dfr1_spmu[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64DFR1, SPMU, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field id_aa64dfr1_fields[] = { + MRS_FIELD(ID_AA64DFR1, DPFZS, false, MRS_LOWER, 0, id_aa64dfr1_dpfzs), + MRS_FIELD(ID_AA64DFR1, PMICNTR, false, MRS_LOWER, 0, id_aa64dfr1_pmicntr), + MRS_FIELD(ID_AA64DFR1, SPMU, false, MRS_LOWER, 0, id_aa64dfr1_spmu), MRS_FIELD_END, }; @@ -837,7 +864,8 @@ static const struct mrs_field_hwcap id_aa64isar1_bf16_caps[] = { static const struct mrs_field_value id_aa64isar1_specres[] = { MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_NONE, ""), - MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_IMPL, "PredInv"), + MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_8_5, "PredInv v8.5"), + MRS_FIELD_VALUE(ID_AA64ISAR1_SPECRES_8_9, "PredInv v8.9"), MRS_FIELD_VALUE_END, }; @@ -995,6 +1023,31 @@ static const struct mrs_field id_aa64isar1_fields[] = { /* ID_AA64ISAR2_EL1 */ +static const struct mrs_field_value id_aa64isar2_ats1a[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, ATS1A, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64isar2_cssc[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, CSSC, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64isar2_rprfm[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, RPRFM, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64isar2_prfmslc[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, PRFMSLC, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64isar2_clrbhb[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, CLRBHB, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64isar2_pac_frac[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64ISAR2, PAC_frac, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -1057,6 +1110,11 @@ static const struct mrs_field_hwcap id_aa64isar2_wfxt_caps[] = { }; static const struct mrs_field id_aa64isar2_fields[] = { + MRS_FIELD(ID_AA64ISAR2, ATS1A, false, MRS_LOWER, 0, id_aa64isar2_ats1a), + MRS_FIELD(ID_AA64ISAR2, CSSC, false, MRS_LOWER, 0, id_aa64isar2_cssc), + MRS_FIELD(ID_AA64ISAR2, RPRFM, false, MRS_LOWER, 0, id_aa64isar2_rprfm), + MRS_FIELD(ID_AA64ISAR2, PRFMSLC, false, MRS_LOWER, 0, id_aa64isar2_prfmslc), + MRS_FIELD(ID_AA64ISAR2, CLRBHB, false, MRS_LOWER, 0, id_aa64isar2_clrbhb), MRS_FIELD(ID_AA64ISAR2, PAC_frac, false, MRS_LOWER, 0, id_aa64isar2_pac_frac), MRS_FIELD(ID_AA64ISAR2, BC, false, MRS_LOWER, 0, id_aa64isar2_bc), @@ -1081,7 +1139,9 @@ static const struct mrs_field_value id_aa64mmfr0_ecv[] = { }; static const struct mrs_field_value id_aa64mmfr0_fgt[] = { - MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR0, FGT, NONE, IMPL), + MRS_FIELD_VALUE(ID_AA64MMFR0_FGT_NONE, ""), + MRS_FIELD_VALUE(ID_AA64MMFR0_FGT_8_6, "FGT v8.6"), + MRS_FIELD_VALUE(ID_AA64MMFR0_FGT_8_9, "FGT v8.9"), MRS_FIELD_VALUE_END, }; @@ -1193,6 +1253,11 @@ static const struct mrs_field id_aa64mmfr0_fields[] = { /* ID_AA64MMFR1_EL1 */ +static const struct mrs_field_value id_aa64mmfr1_ecbhb[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR1, ECBHB, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64mmfr1_cmovw[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR1, CMOVW, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -1224,7 +1289,9 @@ static const struct mrs_field_value id_aa64mmfr1_hcx[] = { }; static const struct mrs_field_value id_aa64mmfr1_ets[] = { - MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR1, ETS, NONE, IMPL), + MRS_FIELD_VALUE(ID_AA64MMFR1_ETS_NONE, ""), + MRS_FIELD_VALUE(ID_AA64MMFR1_ETS_NONE2, ""), + MRS_FIELD_VALUE(ID_AA64MMFR1_ETS_IMPL, "ETS2"), MRS_FIELD_VALUE_END, }; @@ -1281,6 +1348,7 @@ static const struct mrs_field_value id_aa64mmfr1_hafdbs[] = { }; static const struct mrs_field id_aa64mmfr1_fields[] = { + MRS_FIELD(ID_AA64MMFR1, ECBHB, false, MRS_LOWER, 0, id_aa64mmfr1_ecbhb), MRS_FIELD(ID_AA64MMFR1, CMOVW, false, MRS_LOWER, 0, id_aa64mmfr1_cmovw), MRS_FIELD(ID_AA64MMFR1, TIDCP1, false, MRS_LOWER, 0, id_aa64mmfr1_tidcp1), @@ -1428,11 +1496,56 @@ static const struct mrs_field_value id_aa64mmfr3_spec_fpacc[] = { MRS_FIELD_VALUE_END, }; +static const struct mrs_field_value id_aa64mmfr3_aderr[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, ADERR, NONE, SOME), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_sderr[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, SDERR, NONE, ALL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_anerr[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, ANERR, NONE, SOME), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_snerr[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, SNERR, NONE, ALL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64mmfr3_mec[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, MEC, NONE, IMPL), MRS_FIELD_VALUE_END, }; +static const struct mrs_field_value id_aa64mmfr3_aie[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, AIE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_s2poe[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, S2POE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_s1poe[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, S1POE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_s2pie[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, S2PIE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64mmfr3_s1pie[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, S1PIE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64mmfr3_sctlrx[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64MMFR3, SCTLRX, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -1446,7 +1559,16 @@ static const struct mrs_field_value id_aa64mmfr3_tcrx[] = { static const struct mrs_field id_aa64mmfr3_fields[] = { MRS_FIELD(ID_AA64MMFR3, Spec_FPACC, false, MRS_LOWER, 0, id_aa64mmfr3_spec_fpacc), + MRS_FIELD(ID_AA64MMFR3, ADERR, false, MRS_LOWER, 0, id_aa64mmfr3_aderr), + MRS_FIELD(ID_AA64MMFR3, SDERR, false, MRS_LOWER, 0, id_aa64mmfr3_sderr), + MRS_FIELD(ID_AA64MMFR3, ANERR, false, MRS_LOWER, 0, id_aa64mmfr3_anerr), + MRS_FIELD(ID_AA64MMFR3, SNERR, false, MRS_LOWER, 0, id_aa64mmfr3_snerr), MRS_FIELD(ID_AA64MMFR3, MEC, false, MRS_LOWER, 0, id_aa64mmfr3_mec), + MRS_FIELD(ID_AA64MMFR3, AIE, false, MRS_LOWER, 0, id_aa64mmfr3_aie), + MRS_FIELD(ID_AA64MMFR3, S2POE, false, MRS_LOWER, 0, id_aa64mmfr3_s2poe), + MRS_FIELD(ID_AA64MMFR3, S1POE, false, MRS_LOWER, 0, id_aa64mmfr3_s1poe), + MRS_FIELD(ID_AA64MMFR3, S2PIE, false, MRS_LOWER, 0, id_aa64mmfr3_s2pie), + MRS_FIELD(ID_AA64MMFR3, S1PIE, false, MRS_LOWER, 0, id_aa64mmfr3_s1pie), MRS_FIELD(ID_AA64MMFR3, SCTLRX, false, MRS_LOWER, 0, id_aa64mmfr3_sctlrx), MRS_FIELD(ID_AA64MMFR3, TCRX, false, MRS_LOWER, 0, id_aa64mmfr3_tcrx), @@ -1522,6 +1644,7 @@ static const struct mrs_field_value id_aa64pfr0_ras[] = { MRS_FIELD_VALUE(ID_AA64PFR0_RAS_NONE, ""), MRS_FIELD_VALUE(ID_AA64PFR0_RAS_IMPL, "RAS"), MRS_FIELD_VALUE(ID_AA64PFR0_RAS_8_4, "RAS v8.4"), + MRS_FIELD_VALUE(ID_AA64PFR0_RAS_8_9, "RAS v8.9"), MRS_FIELD_VALUE_END, }; @@ -1609,6 +1732,31 @@ static const struct mrs_field id_aa64pfr0_fields[] = { /* ID_AA64PFR1_EL1 */ +static const struct mrs_field_value id_aa64pfr1_pfar[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, PFAR, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64pfr1_df2[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, DF2, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64pfr1_mtex[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, MTEX, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64pfr1_the[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, THE, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + +static const struct mrs_field_value id_aa64pfr1_mtefrac[] = { + MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, MTE_frac, NONE, IMPL), + MRS_FIELD_VALUE_END, +}; + static const struct mrs_field_value id_aa64pfr1_nmi[] = { MRS_FIELD_VALUE_NONE_IMPL(ID_AA64PFR1, NMI, NONE, IMPL), MRS_FIELD_VALUE_END, @@ -1677,6 +1825,11 @@ static const struct mrs_field_hwcap id_aa64pfr1_bt_caps[] = { }; static const struct mrs_field id_aa64pfr1_fields[] = { + MRS_FIELD(ID_AA64PFR1, PFAR, false, MRS_LOWER, 0, id_aa64pfr1_pfar), + MRS_FIELD(ID_AA64PFR1, DF2, false, MRS_LOWER, 0, id_aa64pfr1_df2), + MRS_FIELD(ID_AA64PFR1, MTEX, false, MRS_LOWER, 0, id_aa64pfr1_mtex), + MRS_FIELD(ID_AA64PFR1, THE, false, MRS_LOWER, 0, id_aa64pfr1_the), + MRS_FIELD(ID_AA64PFR1, MTE_frac, false, MRS_LOWER, 0, id_aa64pfr1_mtefrac), MRS_FIELD(ID_AA64PFR1, NMI, false, MRS_LOWER, 0, id_aa64pfr1_nmi), MRS_FIELD(ID_AA64PFR1, CSV2_frac, false, MRS_LOWER, 0, id_aa64pfr1_csv2_frac), From nobody Mon Feb 17 16:37:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxSws52qyz5nrgy; Mon, 17 Feb 2025 16:37: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 4YxSws10N5z42Y5; Mon, 17 Feb 2025 16:37:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4MvsKNFpVQZ/XBp4TZsfiBLSzm65EDkdIo5LuLoJQjg=; b=cGjk89pjY1F5P4/1PAI+1iL3GWMMSXXtFHPUyedotBnPcv1qr/Zh10g3G6KvPzz43u0wpu Z4iIxwJqcURobPmFzLFSNYw+iYJSAEHpXWg5Z5eCDog3T4DMjoudViHz0idRw97yV27Y1+ k8Ms06lN9+S9CIg1LwKS6ktkG9fBaamcKDzFZNd/5MNl+W9LX7a2iH3Ril/Cgwpg8WO+0r jE3DExsn9GpDFLWgjfPNqr1agQ688jYSiT4bBKpnZVZzH6JIiPu5SRYMfFW+TjHj3e/LuW RM82GfRX4Zm7a0fRKJ3c1opX2/QLTorxWMzUYyMZGj7ILOajbULuvR85tf6OFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810221; a=rsa-sha256; cv=none; b=HUlzwjfqQq52unpYj4KQwr3jsw9MtTZJTx9bYcm+oy376v9nCZG0DZZX80cO8A+tLh2/vL eYpQYjou051xmE6tdmZdX4e0SRvWqtHDD2HlxXiAAxd2AE7tl8MgEL3nJmtYF9g5sIpgZa ejJDhzmS83pTMb4G5X4XtYD0Qk2dK9T3N/V0Rk2FxUXfbvR2t0f6bSFPxE5AQe/VOmO3Wi heZ0WwH0PhDLnc7YAvrIqwR/1Lk37G4qRe3AKaZxjR4zoJP20TuWV0eD+Wfs8pQBde3lxn ALc57UT/rP3zBunYx0vdm8PwjFNAYKJzUkFrJfQH9cQv82uSnxF/BgWeltgPbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810221; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4MvsKNFpVQZ/XBp4TZsfiBLSzm65EDkdIo5LuLoJQjg=; b=o8Id+KzlftJYoGDT0W7bpjqcEpLMEQoZr2GA1JvZvBkggKkwoLM+9OaF0PDp7lamo+eQO3 M8PGYub0C5RC+oQbdFWRPFBs80Nfrr7wHJV7SlXTBPvKPtBRfG1HGTL79TbFB2mCRgSz6n QllQMb89yWoXp1wJ9fMG006pw1EXMGcQmfSF3+kwCBX6TsyRaxhenoUKlgOs3uLnRMQPOT 1nEkLO6yJWIpOxT/VTkhYARQ0QMzUyMMnRWx7L0w796s+ZV+JHDeeYDkk8B/T1Jelj+yCV zhd+QpJJvBsqnnsm0KwHjBtJFX3ASgwgK13fC4H0HInraXCuKDI6do3JgP49zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxSwr4svhzhtH; Mon, 17 Feb 2025 16: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 51HGb0lb082901; Mon, 17 Feb 2025 16: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 51HGb0kT082898; Mon, 17 Feb 2025 16:37:00 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:37:00 GMT Message-Id: <202502171637.51HGb0kT082898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 43b3e755d075 - main - arm64: use FEAT_WFxT for DELAY() when available List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43b3e755d07576da8a169a2d000d0f4b4ce33f19 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=43b3e755d07576da8a169a2d000d0f4b4ce33f19 commit 43b3e755d07576da8a169a2d000d0f4b4ce33f19 Author: Harry Moulton AuthorDate: 2025-02-17 16:01:48 +0000 Commit: Andrew Turner CommitDate: 2025-02-17 16:07:36 +0000 arm64: use FEAT_WFxT for DELAY() when available Use a wfet, rather than a busy wait, in DELAY() when the FEAT_WFxT extension is available. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D48580 Signed-off-by: Harry Moulton --- sys/arm/arm/generic_timer.c | 86 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 67 insertions(+), 19 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index 775290960ebd..685398117396 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -60,6 +60,8 @@ #if defined(__aarch64__) #include +#include +#include #endif #ifdef FDT @@ -94,6 +96,10 @@ #define GT_CNTKCTL_PL0VCTEN (1 << 1) /* PL0 CNTVCT and CNTFRQ access */ #define GT_CNTKCTL_PL0PCTEN (1 << 0) /* PL0 CNTPCT and CNTFRQ access */ +#if defined(__aarch64__) +static bool __read_mostly enable_wfxt = false; +#endif + struct arm_tmr_softc; struct arm_tmr_irq { @@ -805,12 +811,10 @@ EARLY_DRIVER_MODULE(timer, acpi, arm_tmr_acpi_driver, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); #endif -static void -arm_tmr_do_delay(int usec, void *arg) +static int64_t +arm_tmr_get_counts(int usec) { - struct arm_tmr_softc *sc = arg; - int32_t counts, counts_per_usec; - uint32_t first, last; + int64_t counts, counts_per_usec; /* Get the number of times to count */ counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); @@ -826,12 +830,30 @@ arm_tmr_do_delay(int usec, void *arg) else counts = usec * counts_per_usec; + return counts; +} + +static void +arm_tmr_do_delay(int usec, void *arg) +{ + struct arm_tmr_softc *sc = arg; + int64_t counts; + uint64_t first; +#if defined(__aarch64__) + int64_t end; +#endif + + counts = arm_tmr_get_counts(usec); first = sc->get_cntxct(sc->physical_sys); +#if defined(__aarch64__) + end = first + counts; +#endif - while (counts > 0) { - last = sc->get_cntxct(sc->physical_sys); - counts -= (int32_t)(last - first); - first = last; + while ((sc->get_cntxct(sc->physical_sys) - first) < counts) { +#if defined(__aarch64__) + if (enable_wfxt) + wfet(end); +#endif } } @@ -843,21 +865,47 @@ DELAY(int usec) TSENTER(); /* - * Check the timers are setup, if not just - * use a for loop for the meantime - */ - if (arm_tmr_sc == NULL) { + * We have two options for a delay: using the timer, or using the wfet + * instruction. However, both of these are dependent on timers being + * setup, and if they're not just use a loop for the meantime. + */ + if (arm_tmr_sc != NULL) { + arm_tmr_do_delay(usec, arm_tmr_sc); + } else { for (; usec > 0; usec--) for (counts = 200; counts > 0; counts--) - /* - * Prevent the compiler from optimizing - * out the loop - */ + /* Prevent the compiler from optimizing out the loop */ cpufunc_nullop(); - } else - arm_tmr_do_delay(usec, arm_tmr_sc); + } TSEXIT(); } + +static bool +wfxt_check(const struct cpu_feat *feat __unused, u_int midr __unused) +{ + uint64_t id_aa64isar2; + + if (!get_kernel_reg(ID_AA64ISAR2_EL1, &id_aa64isar2)) + return (false); + return (ID_AA64ISAR2_WFxT_VAL(id_aa64isar2) != ID_AA64ISAR2_WFxT_NONE); +} + +static void +wfxt_enable(const struct cpu_feat *feat __unused, + cpu_feat_errata errata_status __unused, u_int *errata_list __unused, + u_int errata_count __unused) +{ + /* will be called if wfxt_check returns true */ + enable_wfxt = true; +} + +static struct cpu_feat feat_wfxt = { + .feat_name = "FEAT_WFXT", + .feat_check = wfxt_check, + .feat_enable = wfxt_enable, + .feat_flags = CPU_FEAT_AFTER_DEV | CPU_FEAT_SYSTEM, +}; +DATA_SET(cpu_feat_set, feat_wfxt); #endif static uint32_t From nobody Mon Feb 17 16:41:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxT1b4zjZz5ns4T; Mon, 17 Feb 2025 16:41: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 4YxT1b4L4vz45c0; Mon, 17 Feb 2025 16:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7v66nxGJ68aFj4+2XSHCJDDl23HOwK76y43VBmUHmr8=; b=VMf6JBtghFiKd7SfNFqJAxvSrOEAzP0w4IP6d3530wRWAIHr8AV7rD2qo0eOG2bQ/aONCx cXEt5TeU/XXg2ptnOoH6C/eMx0NCYj9jPtkQNvOWzlOK8EEfwFJW04187r/2JI7ZTNLYIs r3KI4OrsET6J3Lcnkmumr7vCKAenKpgy+rtAyeyCfmGnypcmSUb/qtCcGLP9oo/rNQCQ1K kusHXtCsxhD+mzKWBBcIjq86GZLqFuGZaGOy03o0yk6cG4WH7O/cXlWUhUZxFupC66pEtM 2G12M8eFJ0xTKDKSx6HknbQdR18ySbt4e7olyzbgkTjL6PBf8mtOXL9DLPGwEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739810467; a=rsa-sha256; cv=none; b=lscKU0Y67Uof7+JzqYdao9U8dIt558Anx5WMrTyqiz+2Qzb/qBQdzOWgIvRkZxuVoZQFEk +09cKThTbJl+jBzqRo0DoRjC+lsbKXVtll/sF0YG9bKUNP+Zar5lcermulNOgEBQjGkLLx hpED0+R/bBNlD90569zHbq0/bh+RpvUffGGzf7k8U5XyxRFuTu42Eq2VQxwsafKn/gxffk kgZSATaYXBEyqVFekUclB2MpaVc32OnTnacjlhrzF0QrVSGOIjzLE4iaE4s7nf174lcwWg hrOky/c9b99atARmQFMQE0/ksKoyCSwAVZxk4/Emuj4V5zWRsm6ysay9D0vThg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739810467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7v66nxGJ68aFj4+2XSHCJDDl23HOwK76y43VBmUHmr8=; b=AI+aqSU/vlAIBLfPHh3BHlU0aOBjqhi/1I5LQ8siYBsAiQMnZen37xHzJ6vvu0E3fiFvRc OvOdIW6yzjpIyo1QrAysthsFQt4Dhvq4RU6rLXbpgRUXipwSpjteae8v1o4IiUZ+zLPcIe CNdo5QPd6DiJ+pJ+zKYfQrZduJM/rU0uXDM3k0vCbFroKvfLp9KMiTzcMIWMltdQ7PMbCZ p8Z2FPoZV1MDkaB/OYymW4cgP2sHB+i3TBmneXgAYNr1u5dIzQnFEs/aFVAuFh2whavsF9 V8x0LUbalDnBw5gKg7aO5eM4t1eTSzlpeSEU0vUF3/srIbh/R494cxigu+34hw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxT1b3qbfzj7t; Mon, 17 Feb 2025 16:41: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 51HGf7EO094257; Mon, 17 Feb 2025 16:41:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HGf7d3094254; Mon, 17 Feb 2025 16:41:07 GMT (envelope-from git) Date: Mon, 17 Feb 2025 16:41:07 GMT Message-Id: <202502171641.51HGf7d3094254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: df436036e82b - main - umtx: Don't sleep after casueword32 failure in do_sem2_wake List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df436036e82b895a6233d803bc8bf14d2cfe90d7 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=df436036e82b895a6233d803bc8bf14d2cfe90d7 commit df436036e82b895a6233d803bc8bf14d2cfe90d7 Author: Bojan Novković AuthorDate: 2025-01-30 15:10:04 +0000 Commit: Bojan Novković CommitDate: 2025-02-17 16:40:34 +0000 umtx: Don't sleep after casueword32 failure in do_sem2_wake When a casueword32 operation fails, 'do_sem2_wake' will call 'thread_check_susp' to avoid a potential livelock. However, it instructs 'thread_check_susp' to sleep while holding a previously busied umtxq key. This is explicitly discouraged by the comments in 'thread_check_susp' which state that a thread shouldn't sleep if it owns a kernel resource. Fix this by passing 'false' to 'thread_check_susp'. Reviewed by: kib PR: 282713 Differential Revision: https://reviews.freebsd.org/D48728 Sponsored by: Klara Inc. --- sys/kern/kern_umtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index a9294c324cb4..938dcf2ff1cb 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -3789,7 +3789,7 @@ do_sem2_wake(struct thread *td, struct _usem2 *sem) rv = casueword32(&sem->_count, count, &count, count & ~USEM_HAS_WAITERS); if (rv == 1) { - rv = thread_check_susp(td, true); + rv = thread_check_susp(td, false); if (rv != 0) break; } From nobody Mon Feb 17 17:08:18 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxTd24Z3Cz5ntVb; Mon, 17 Feb 2025 17:08:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxTd242Mwz3Kht; Mon, 17 Feb 2025 17:08:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739812102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zcVVUQI3kJKz3pWxsP7RCtUtuZHTB08Z1jNFE0/SD1k=; b=CiwqcMW25XbHZuLzK4uv5mm4Aq+bLZ+jN9hCg/tTmyHYuf5ubZC05F7AQkYCgkXlWAV0TN 4jCN7l1wfztSL1w3cuM04m88yLI3iwmZsd7fd9h+jSrbps3p2zdFbkZLe/aPpzWApMSzMb Ck+V1MBhYRXLqa/rBkZ72romM63WNZwq5NnFLbNi6KLbz3O1XWs6w0a3pz3nRWGDWc4J8l AKuITivcrya4vD8SmfoQkZ/YSnb2tHOd8e/LMVrOtVTEXWJR7dXRcINVIt27N+M2CQ1RYV MZGyTD7Iq40V1SeaM+evwIcODlddIhhBcG1k3/OozdgZy3ibe7EkRLtuJJ0D2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739812102; a=rsa-sha256; cv=none; b=cE4Jpwn4GHobWjo3IlbdDAFT4esrhhCa6rExwxxtNUEg+dyNVhdqfBx1S3en0JxWd2o/Ho hpXrTyzZkMw46VNkQGw2FJqpYF+EGxadQWI/vzb9dhP2k14RPGaH/K0qGCPs41lodCVwv3 x4vQ3cBBJpwMWl11o3vCvtqXKuThKe5WNiCZrsreVidmG6CDqkkFisvrkqfwIhOFhlRCei bIh30ZTwlOeH5CSaW5ulDpN3HllF9N9mH2hi/xbksTH0K0DyJShkPzMxuPk7etexxsSOT2 ck5bgXKnhOw/Ua8XNn3VQqtMD5Cly5i8IpzpqZ5XyfjvI9Tie4aoDtQpQS5BPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739812102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zcVVUQI3kJKz3pWxsP7RCtUtuZHTB08Z1jNFE0/SD1k=; b=p8t/tnpPShNYqF2vEaXe0/X9BQ+BsUdJw7ZCJzfM/t3kWg8z0KMS3a5SOBBMDkxXgCBoDE 99zw7YubsqXBg6OG5nQ7ymXFFH+vk8fMJk8Bkn3GjDtHxLsMA//IO/YGsl3uEHCEbWa3nM xD9Ijo5/ErsNPW44EQIjdIl3e4R0jgJn8B8dyZoLfxVM4y/0uHp94R4m/FqrPd8c0kFC1L MEqehQUUG9cQ1vE1sEWbwb17xaWPTnZI3pRyDfzOErqu0T7QF98c4wPTjW5mkFnk9FbH+4 Bc9P6fiqbziN+vEHimhTZGZnHPEkNGvk+RZvlNbQiyj9m6jlj+8F9FW1bx8uKw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YxTd2258Rz6Ww; Mon, 17 Feb 2025 17:08:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id EEDAE1F37C; Mon, 17 Feb 2025 18:08:19 +0100 (CET) From: Kristof Provost To: John Baldwin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values Date: Mon, 17 Feb 2025 18:08:18 +0100 X-Mailer: MailMate (2.0r6222) Message-ID: <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> In-Reply-To: <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_5AB2A4F1-D112-4BA4-A462-4755E187AB4C_=" --=_MailMate_5AB2A4F1-D112-4BA4-A462-4755E187AB4C_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 17 Feb 2025, at 16:24, John Baldwin wrote: > On 2/14/25 12:50, Kristof Provost wrote: >> The branch main has been updated by kp: >> >> URL: = >> https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd7568369be= 6a587d4a51ff >> >> commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff >> Author: Kristof Provost >> AuthorDate: 2025-02-07 10:29:26 +0000 >> Commit: Kristof Provost >> CommitDate: 2025-02-14 17:47:52 +0000 >> >> pf: use time_t for storing time_t values >> No change to the underlying type, so no ABI change. >> We define __time_t as uint64_t if __LP64__, otherwise = >> uint32_t, >> and only define __LP64__ if long is 64 bits. >> In other words: __time_t =3D=3D long. >> ok henning@ deraadt@ >> Obtained from: OpenBSD, guenther , = >> 6c1b69a0ff >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> Differential Revision: https://reviews.freebsd.org/D48963 > > This is an ABI change on non-i386 32-bit platforms in FreeBSD since = > they > all use a 64-bit type for time_t that is not the same size as long. = > Not > sure if the ABI change matters on FreeBSD though? > It wasn=E2=80=99t intended to be an ABI change, hence the commit message.= It = appears that=E2=80=99s only correct for x86 though. So we=E2=80=99re only talking about armv7 and ppc32, if I=E2=80=99m not f= orgetting = anything. The former is on the removal list already, and the latter .. = well, I don=E2=80=99t know how many users there are. Both are likely to b= e = embedded platforms where the ABI change is going to be even less = relevant (because it really only matters if the kernel and userspace are = not updated together, and these are going to be embedded devices that = are far more likely to have everything updated simultaneously). So I=E2=80=99m unsure about what to do. I can revert this and we can just= = carry this (trivial) diff to OpenBSD forever, or we can ignore the ABI = breakage given the above. I=E2=80=99m not inclined to do anything more = involved though. Do you have any thoughts? Best regards, Kristof --=_MailMate_5AB2A4F1-D112-4BA4-A462-4755E187AB4C_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 17 Feb 2025, at 16:24, John Baldwin wrote:

On 2/14/25 12:50, Kristof Provost wrote:

The branch main has been updated by kp:

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

commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff
Author: Kristof Provost kp@FreeBSD.= org
AuthorDate: 2025-02-07 10:29:26 +0000
Commit: Kristof Provost kp@FreeBSD.= org
CommitDate: 2025-02-14 17:47:52 +0000

 p=
f: use time_t for storing time_t values
     No change to the underlying type, so no ABI change.
     We define __time_t as uint64_t if __LP64__, otherwise uint32_t,
 and only define __LP64__ if long is 64 bits.
 In other words: __time_t =3D=3D long.
     ok henning@ deraadt@
     Obtained from:  OpenBSD, guenther <guenther@openbsd.org>, 6c1b=
69a0ff
 Sponsored by:   Rubicon Communications, LLC ("Netgate")
 Differential Revision:  https://reviews.freebsd.org/D48963

This is an ABI change on non-i386 32-bit platforms in Fre= eBSD since they
all use a 64-bit type for time_t that is not the same size as long. Not<= br> sure if the ABI change matters on FreeBSD though?

It wasn=E2=80=99t intended to be an ABI change, hence the= commit message. It appears that=E2=80=99s only correct for x86 though.

So we=E2=80=99re only talking about armv7 and ppc32, if I= =E2=80=99m not forgetting anything. The former is on the removal list alr= eady, and the latter .. well, I don=E2=80=99t know how many users there a= re. Both are likely to be embedded platforms where the ABI change is goin= g to be even less relevant (because it really only matters if the kernel = and userspace are not updated together, and these are going to be embedde= d devices that are far more likely to have everything updated simultaneou= sly).

So I=E2=80=99m unsure about what to do. I can revert this= and we can just carry this (trivial) diff to OpenBSD forever, or we can = ignore the ABI breakage given the above. I=E2=80=99m not inclined to do a= nything more involved though.

Do you have any thoughts?

Best regards,
Kristof

--=_MailMate_5AB2A4F1-D112-4BA4-A462-4755E187AB4C_=-- From nobody Mon Feb 17 18:02:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxVql056Fz5nxmm; Mon, 17 Feb 2025 18:02:43 +0000 (UTC) (envelope-from chmeee@has.gonegalt.net) Received: from mail.gonegalt.net (mail.gonegalt.net [208.167.253.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxVqk4JC4z3hRc; Mon, 17 Feb 2025 18:02:42 +0000 (UTC) (envelope-from chmeee@has.gonegalt.net) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gonegalt.net; s=dkim; t=1739815355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KkUZTPXqaGiKYCzOkhyEKggeiXson4HAHMcmm+4Ezs0=; b=ujsGEOMsQOSdMtXM1LPay1J03N75kcC4GeXtn9OTcDl/tjmxbrulD6YPAENLIKbBYqM9in 6u2QUj8JdgodSYNyPnZ9ydwhBbnqa4xeWJDF9MG8ROP89aCU/PVAoiTAeMof+vHV0r37Xx UCeCxiZpF+0lOLLa67E8BDvGy5zkvL0= Received: by localhost (OpenSMTPD) with ESMTP id 6aa03838; Mon, 17 Feb 2025 13:02:35 -0500 (EST) Received: from ralga.knownspace ([192.168.1.17]) by mail.gonegalt.net with ESMTPSA id hQLJNrp5s2dGfwAA0J78UA (envelope-from ); Mon, 17 Feb 2025 13:02:34 -0500 Date: Mon, 17 Feb 2025 13:02:34 -0500 From: Justin Hibbits To: Kristof Provost Cc: John Baldwin , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values Message-ID: <20250217130234.03d9d25f@ralga.knownspace> In-Reply-To: <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.48; powerpc64le-unknown-linux-gnu) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-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:20473, ipnet:208.167.224.0/19, country:US] X-Rspamd-Queue-Id: 4YxVqk4JC4z3hRc X-Spamd-Bar: ---- On Mon, 17 Feb 2025 18:08:18 +0100 Kristof Provost wrote: > On 17 Feb 2025, at 16:24, John Baldwin wrote: > > On 2/14/25 12:50, Kristof Provost wrote: =20 > >> The branch main has been updated by kp: > >> > >> URL:=20 > >> https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd7568369be= 6a587d4a51ff > >> > >> commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff > >> Author: Kristof Provost > >> AuthorDate: 2025-02-07 10:29:26 +0000 > >> Commit: Kristof Provost > >> CommitDate: 2025-02-14 17:47:52 +0000 > >> > >> pf: use time_t for storing time_t values > >> No change to the underlying type, so no ABI change. > >> We define __time_t as uint64_t if __LP64__, otherwise=20 > >> uint32_t, > >> and only define __LP64__ if long is 64 bits. > >> In other words: __time_t =3D=3D long. > >> ok henning@ deraadt@ > >> Obtained from: OpenBSD, guenther ,=20 > >> 6c1b69a0ff > >> Sponsored by: Rubicon Communications, LLC ("Netgate") > >> Differential Revision: https://reviews.freebsd.org/D48963 =20 > > > > This is an ABI change on non-i386 32-bit platforms in FreeBSD since=20 > > they > > all use a 64-bit type for time_t that is not the same size as long. > > Not > > sure if the ABI change matters on FreeBSD though? > > =20 > It wasn=E2=80=99t intended to be an ABI change, hence the commit message.= It=20 > appears that=E2=80=99s only correct for x86 though. >=20 > So we=E2=80=99re only talking about armv7 and ppc32, if I=E2=80=99m not f= orgetting=20 > anything. The former is on the removal list already, and the latter > .. well, I don=E2=80=99t know how many users there are. Both are likely t= o be=20 > embedded platforms where the ABI change is going to be even less=20 > relevant (because it really only matters if the kernel and userspace > are not updated together, and these are going to be embedded devices > that are far more likely to have everything updated simultaneously). >=20 > So I=E2=80=99m unsure about what to do. I can revert this and we can just= =20 > carry this (trivial) diff to OpenBSD forever, or we can ignore the > ABI breakage given the above. I=E2=80=99m not inclined to do anything mor= e=20 > involved though. >=20 > Do you have any thoughts? >=20 > Best regards, > Kristof Being the powerpc maintainer, I don't have any issue with this (after all, I'm the one who changed powerpc to 64-bit time_t back in 201x), but it should probably be publicly mentioned that anything that uses these APIs need rebuilt. If it's purely kernel, no user export, then I don't see a problem at all. It's not MFC-able, though. - Justin From nobody Mon Feb 17 19:16:13 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxXSZ1Wz0z5p36S; Mon, 17 Feb 2025 19:16: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 4YxXSZ0wN4z3JFn; Mon, 17 Feb 2025 19:16:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739819774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gkiSBDbOmYCabq93Ya/SU40/gK411AlHZA9+LNIlcQ=; b=KHEw39JfEZX7bQJPTP+PS2Kvf+GKaw02SdDRm1VNsdsLB3fI1bC9BKBRxwKB17FBk3g7yz e4WXyOJYig+4dDEv3/bSmz46DVdGrXBcEb8jzISahr0T1oHSgaDPtCxRTiC5+0j+2/BMeX rQplhIN+B+YNavkQfjmQP7W1WJuZZGHyNjduxxY8bCAzr9IUbpplqBcIF22uN+qeri0WLf CaYuzS1Z4sk3YhHlrOk0Bu43mmr2q1L+l5kuh136QPNR0B97GkcD93tdPXFyr8rP5NCwsn tWhdzJenFL92ftBRpuaEdffgi6JApqMY7eSgvj9cWFRq2Fc+dyz/oUMT7zhaPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739819774; a=rsa-sha256; cv=none; b=eKN/TGl8v0nsSI4nwgPZKIUfndoBHwcneHI2Q712WBGyar0S+XJrK5vZK8i7nSR/wiZfZj QAQMFgKh5GXzybVSpfu2K4/VC7tkhIUpN3jvQbSgUz02Jws9zbVVUQ+27CvyjVfMMw7rzU Uxq2KMKNoi+UUPPah7z+vxV1pJkG4qb4xVKkE8LxkaVBrvu5LNhDvlnuy3cyz3ST/YmoZq EdVb7yXIoDdL/PiULzVgMpIDFaDAmtGAk1Lwps9drkG8dlLZnogp4xKAexx7ZeQpZKcOQz roA5XaIx13DHm3jn6MKMsFF0pxPIiJcL1ga0k6Lft/VEfp0hLcvSz3lueB0TyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739819774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3gkiSBDbOmYCabq93Ya/SU40/gK411AlHZA9+LNIlcQ=; b=SNPxSum2INeZ8APDwKxuNwcqZsE3OtU7NrMD3u1nfjJIk0NoWPSccTQf09r7jeHPVdldyg PkZlA5xPJ1UsWd4GXEM5v1Pm+ZGl5Pc8mZUWC8R+Zz5kTvvTJGb0JPc0Qjnd46x44kVuo4 iua3LdIUgl/oy+9wZsB8NlJw2pNyZ/bmu6eewgAno78VXhjB+0CZMB2/nOOw0cbQ7vxNHH mxd0MMY6CWPJ+x+ZDcasshH/fRwm268VrW8ho/AhId4jqETLgktYEvCzqnbI1uUkIfTWp1 8faGjIpAnI54cwZgWzsKksdRzo4whFEtIPzGU8n9EEEeOQ5VHW7YQ7U7JJYl+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 4YxXSZ0SKVzmqN; Mon, 17 Feb 2025 19:16: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 51HJGDZ0083892; Mon, 17 Feb 2025 19:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HJGD6W083889; Mon, 17 Feb 2025 19:16:13 GMT (envelope-from git) Date: Mon, 17 Feb 2025 19:16:13 GMT Message-Id: <202502171916.51HJGD6W083889@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7077a20868b0 - main - pf: Fix prototype of pf_insert_src_node prototype to match its definition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7077a20868b0e88fccabacd329f3cd666f159677 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7077a20868b0e88fccabacd329f3cd666f159677 commit 7077a20868b0e88fccabacd329f3cd666f159677 Author: John Baldwin AuthorDate: 2025-02-17 19:14:05 +0000 Commit: John Baldwin CommitDate: 2025-02-17 19:14:05 +0000 pf: Fix prototype of pf_insert_src_node prototype to match its definition Reported by: GCC -Warray-parameter Fixes: 07e070ef0869 ("pf: Add support for multiple source node types") --- sys/netpfil/pf/pf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 236e68457e81..5e5bd744343c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -386,8 +386,8 @@ static void pf_counters_inc(int, struct pf_pdesc *, struct pf_kstate *, struct pf_krule *, struct pf_krule *); static void pf_overload_task(void *v, int pending); -static u_short pf_insert_src_node(struct pf_ksrc_node **, - struct pf_srchash **, struct pf_krule *, +static u_short pf_insert_src_node(struct pf_ksrc_node *[PF_SN_MAX], + struct pf_srchash *[PF_SN_MAX], struct pf_krule *, struct pf_addr *, sa_family_t, struct pf_addr *, struct pfi_kkif *, pf_sn_types_t); static u_int pf_purge_expired_states(u_int, int); From nobody Mon Feb 17 19:58:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxYPK3rWvz5p5hk; Mon, 17 Feb 2025 19:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxYPK2QBjz3j7C; Mon, 17 Feb 2025 19:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kN806tJs29Yj4r3NLA0kUEM7QUh2Xe9tJhyCsHpWGKc=; b=xOFtrzTEqyVBIl4WL4kh02Br/j3r/oF1XxS7fkNIHoZtaeXHA3x1ohO8AAsUvWSs7OMtBz kvwHdUyEBZmWsKsbMmCipAvxpygd9o2WM9Y3JRdYnm58yT3wduXfkJ3VGPi61qE52Pa4Uf 3LDfG0ScQJWGBlFjBmYtpCgcrcfB5cazT6P3BZVF66jDc/XqouyzMZmmsmr1wFPwGTgIdT nwJDHy56m4wtYAjyuiM5A4MGITxXuPHQ0clH71jVJ4UPkB8jjps835TzoZakYk3H08waEs OMVz7iwwjhMH3avaScRGjZ8f8YUX5ZNLHO7l+KM6SUKQBsssDw7FxH/X3NB96A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739822309; a=rsa-sha256; cv=none; b=RQtiV7zlEGiVdnBMvyEUGtleVSsWDnWo0Iowx4SKUQCR2YbI007eOEOzNXu9c7UyCZVeqM xGyH093C9IcVIh6n2aZooYOasS2AangClPyk+95iK6GJ25vFuAii0N1pau3J/6BM5zM+IN lip8AiS7W29r8rm9JAJxwMxHxgBahG7ZCr6iUrHUUIP0zQmib3tiMVnI55bLcXyJWWDfuT KXN0flJrrDz2T/xs8lMLU2Wgfc8GeedFak+bCKahNXM7yAQy8r1LrHD4A6xNkh3wsDpYw2 AI2FMhAkS9M7sxIX2VqGVRy5ktXKyloIF7AmzhSXbchrh0sGgZwZ/LJ5iCGQHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kN806tJs29Yj4r3NLA0kUEM7QUh2Xe9tJhyCsHpWGKc=; b=CfnPY59HgO9aDI5uIhQRkstb3Xov0n5gkofpqnU2gc+RSe4YDgj6WPVAyo9rRnezUFa4wS /nafOrMMJdkhMEfqczDenNANK9h5egP7NRsF1KdvAwfa/tGs6a96oG/UP4hg/nvS5wxxcz eJKFNJyb4R/etRyWLLv4yALdnLEjEsITuz+mEkvDn/1yadFxkQCcmWfgn86J9yGVXsY+fH FEumUtfRXPR3LgIGtKj+I+jA0Wx6OpMMK+5D0F7NfFbTZza6MBYCQ+g8MGd3dccrIg4gfW y6e7GBXRRHbTlIjsMDmUjkUON+yQmj4TJux9bvqKSDE/e/rzFc5H4fhevA16LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxYPK1mh5znf6; Mon, 17 Feb 2025 19:58:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51HJwTIW059887; Mon, 17 Feb 2025 19:58:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HJwTYI059884; Mon, 17 Feb 2025 19:58:29 GMT (envelope-from git) Date: Mon, 17 Feb 2025 19:58:29 GMT Message-Id: <202502171958.51HJwTYI059884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: cf4a4e4fab6b - main - pf tests: Add Scapy as a required program List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf4a4e4fab6b3b1197f5ebf9e168935b0919f3ef Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=cf4a4e4fab6b3b1197f5ebf9e168935b0919f3ef commit cf4a4e4fab6b3b1197f5ebf9e168935b0919f3ef Author: Jose Luis Duran AuthorDate: 2025-02-17 19:50:03 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-17 19:56:47 +0000 pf tests: Add Scapy as a required program The utils.subr file includes a couple of subroutines (ping_dummy_check_request and ping_server_check_reply) that require Scapy. Add this requirement in the header of each test that makes use of them. Reported by: Jenkins Reviewed by: kp Approved by: emaste (mentor) Fixes: 07e070ef0869 ("pf: Add support for multiple source node types") Differential Revision: https://reviews.freebsd.org/D49004 --- tests/sys/netpfil/pf/src_track.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/sys/netpfil/pf/src_track.sh b/tests/sys/netpfil/pf/src_track.sh index e79183fd9f72..a9d723bb68a5 100755 --- a/tests/sys/netpfil/pf/src_track.sh +++ b/tests/sys/netpfil/pf/src_track.sh @@ -261,6 +261,7 @@ max_src_states_global_head() { atf_set descr 'Max states per source global' atf_set require.user root + atf_set require.progs scapy } max_src_states_global_body() @@ -310,6 +311,7 @@ route_to_head() { atf_set descr 'Max states per source per rule with route-to' atf_set require.user root + atf_set require.progs scapy } route_to_body() From nobody Mon Feb 17 19:58:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxYPM6HNYz5p5Tj; Mon, 17 Feb 2025 19:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxYPM3fG4z3jFf; Mon, 17 Feb 2025 19:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atJUn7kglZoBYvczRuT5I7ZRA3NBh2ymD8KsdNMNfaQ=; b=i1qRyLbRRGeVHHLZFYV9uulsEgdpX5ho9EEfwm4SWykqSkKX6WaS/evgmbXd5gGj76b+Kq pQUWHPQT2fpq0TQTpqIwxdWtSaqXGLDoHItirCzp7OiIZ1u13/SWkfu72XlVKeRn8Gtqf/ j/0nf4mGPqoKcC5KTXI3vDBZfP14z7pBZDdgb/4kQU7xX6SzYHZUU37NIsVRA6VE5lpuv5 qB7upi/g5d5r5iIjWLoJM/gIWG7Rm1nPshWY8+hOepcNdwiAKAAN9UcdyirRRiKHYTYgak GtZ6WyEWl0WheJgWyp39bnun9KNhZMiJqqkA/VCC7NoTM6vRs/RF4U8/z6EtTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739822311; a=rsa-sha256; cv=none; b=CJGdzkU8rNL51h37d8iC8cFovtfWscd6nMX9z6rbxbrCimlSFrm94ehsv50lGlPAszFfAj hSvGoGotcYovAhObHLcJU94MZHjP8H/wrnOiiMD1d7eO7uhQJcvqVsvdY0Hs1DFGWGTP2S 4AWapiWUdlisFzUunVoz33mgPfmQnCUJm+t9pP2msP+KhOj26nhYZ9vlN3eQyePW5n2+dX kheuuln4/QAWX4h6Tspi2E0d18FvqVzYn4xg+UuiRKdsfJqZusEC94cnP3M3R9Ws2zkD2W 6PV+em8LONwWiQhnzojGPkAo8pBdDCSXEb7iAdQPEJZjUBc51Cus2H8oI9LGfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atJUn7kglZoBYvczRuT5I7ZRA3NBh2ymD8KsdNMNfaQ=; b=dZ+mxAbCQfK23XorQs9lKev1ReTg9RGbbtm6setQPlimHtoT6GIEXXuqJ0yR4UDhbUECFx monckZ+FHPAITGMGp25jkELowMv/ZP3LydaZCa2laZ5qeIQ0I3H7XZTddjSEdK7NEAoauv nXMgg27lFzlphA6SanntBnqi4MC1ZPqdxcKwglmcqDaeaM2cKDq3FpkeBfwSF0EyzgCnJr McQfe7k1GS3VWAR45shV0xyDVnr1np6WIyTo2+uAGfr4UXiC49BsAVPneg7c6LjkZJtUph RX1+CXZ3rqMxThqbHkTgwwzBMImHdI4zyZEOfjCLx6vnnJ8p4pROsALv2H68+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 4YxYPM3Db1znTX; Mon, 17 Feb 2025 19:58: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 51HJwVVQ059970; Mon, 17 Feb 2025 19:58:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HJwVx0059967; Mon, 17 Feb 2025 19:58:31 GMT (envelope-from git) Date: Mon, 17 Feb 2025 19:58:31 GMT Message-Id: <202502171958.51HJwVx0059967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 1f1963bd32d6 - main - pf tests: Remove Scapy as a required program List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f1963bd32d669f89ea3b044636de0cb7a33134b Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=1f1963bd32d669f89ea3b044636de0cb7a33134b commit 1f1963bd32d669f89ea3b044636de0cb7a33134b Author: Jose Luis Duran AuthorDate: 2025-02-17 19:52:46 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-17 19:57:00 +0000 pf tests: Remove Scapy as a required program Scapy is not needed to run this test. Remove it from the required programs list. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49006 --- tests/sys/netpfil/pf/rdr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 135bfd42c1f4..a7a8c77c0515 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -32,7 +32,7 @@ tcp_v6_head() { atf_set descr 'TCP rdr with IPv6' atf_set require.user root - atf_set require.progs scapy python3 + atf_set require.progs python3 } # From nobody Mon Feb 17 19:58:30 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxYPM3HmQz5p53V; Mon, 17 Feb 2025 19:58:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxYPL4bVYz3jHv; Mon, 17 Feb 2025 19:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wCv5WE4TxLaV/t7qZhUgy4jwINi3aF3OO6E+43ajSds=; b=W7cNyV4YB6UCNRGXXQ3kpHF2ZRSuQXq+4SVgKUZqCtcPfswASYPZ8iXc/DnD73iUk6/X0L AsUEflY0i/HdAAouvoN9jC/zT5v8H5RBE9RetZi/BBPxzZzbXdiNYJvjyTsxZvDIpviceJ e1yI8GZKJTKZcM6BBQEG8CWVtUh/GUW+lO8NK5BNHUSl+96vrv5i+CYOxkslz+09pbMHxz x/kW1UEAj0V63x7ze8tqWNjcuAJr53VY8mSUD2aUkjYfJI9lUcGeLsKrihmAeJ4VIfEVO7 4i85g+MO4CbhezE4MwWEEWnSHdALvBAJ5KeSLfO2PAognl2wsho1mRm2NfGi3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739822310; a=rsa-sha256; cv=none; b=WXBGSzvNJ9y1VaISVD7pMMqLAzqje6Lf8JWfKLPC9zsYVYV08v6Lo4u1dvsruBQLldLtwq NjmAPQaowe9uhvIUgqEP91edR6b4qf2rzcPDsH2E/Viyarmvrxlp9DozEGPKykS9D/yCTz vCggsaRWeUk0muLL8t8fY+QOQtDlvN8MkbkPwBHu2xq/IGTvks0NRlWbHY4flvbUNUVFkH 8Yg36d7d6DBiAjbZ0Wxctx9rzXXtP0/OFSkK61ngBGv/M/+tA4yfIvSZmY6+wA/+mnpDA/ hC9meC1rAtJ0nDoKV4Kh7u5j79+0Bc6dzOIFbo8+HnZNo9yq78tQdenDuOAvwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739822310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wCv5WE4TxLaV/t7qZhUgy4jwINi3aF3OO6E+43ajSds=; b=PTSA2rzDTLIJFvSY5Y3Z6aC8UFHPabTiis8puEOckUjkpH5vm7PY9LyhFPx2ynPS1gDeg6 H4MEH8FQMLXw47PCpENCbY/tmMMojIvb9JcqfuzVahLB0TrbP8S1pcQJjdrh/OMCbVdC/V KYdV4G+DfGRv0aUbxGCm2VIBaEbFNvTOn7Ygyy4Aaa3Wc2tI/E3j/uftAdg4yjd1Pseifv urZ+hJusWgTy+BZoQE+AHJnQY/uHileN6K5Ojo1U8WC1+nilzmP+51AUbrueo4CtIUOyNR 073MXegv/hBZYMmQ/7cMFW3JlnlHqhJ0UOEzps6TSVQHb48+6+yJ+IN8gIsjoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxYPL2kHMzntB; Mon, 17 Feb 2025 19:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51HJwUcn059924; Mon, 17 Feb 2025 19:58:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HJwUvo059920; Mon, 17 Feb 2025 19:58:30 GMT (envelope-from git) Date: Mon, 17 Feb 2025 19:58:30 GMT Message-Id: <202502171958.51HJwUvo059920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: ec60176e7d29 - main - netinet6 tests: Add Scapy as a required program List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec60176e7d29d1e9f11121146603ce5b6b5f40b8 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=ec60176e7d29d1e9f11121146603ce5b6b5f40b8 commit ec60176e7d29d1e9f11121146603ce5b6b5f40b8 Author: Jose Luis Duran AuthorDate: 2025-02-17 19:50:24 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-17 19:56:59 +0000 netinet6 tests: Add Scapy as a required program The ra.py script requires Scapy. Invoke it using the python3 symlink. While technically, at the moment, python points to python3, and python3 points to the current version of python, it is recommended to use python3. No functional change intended. Add the Scapy requirement in the header of each test that makes use of it. Reviewed by: kp Approved by: emaste (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49005 --- tests/sys/netinet6/ndp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 038a640f331e..378759eb9ba4 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -134,7 +134,7 @@ atf_test_case "ndp_slaac_default_route" "cleanup" ndp_slaac_default_route_head() { atf_set descr 'Test default route installation via SLAAC' atf_set require.user root - atf_set require.progs "python" + atf_set require.progs scapy } ndp_slaac_default_route_body() { @@ -153,7 +153,7 @@ ndp_slaac_default_route_body() { atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv # Send an RA advertising a prefix. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ @@ -172,7 +172,7 @@ ndp_slaac_default_route_body() { jexec ${jname} netstat -rn -6 # Send another RA, make sure that the default route is installed again. - atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ --sendif ${epair0}b \ --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ --src $(ndp_if_lladdr ${epair0}b) \ From nobody Mon Feb 17 20:15:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxYmn6kTdz5p5r9; Mon, 17 Feb 2025 20:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxYmn6FWgz3r8B; Mon, 17 Feb 2025 20:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739823321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pLPUUJ1jfatlydSh9zHmRTdhF4/IISaT8a/VyKbxNxQ=; b=s7oOJOxzbfMnTWDNzvtTaN3gewsgW8LU/YmZ1O2ViRacsOdE2Vu/p0C8TUpB9aJV2FnU2m 2OsOogE+3T3rGxYWnYCfKOGt3hDBdjhmc97TBnNGPVaT0TX8bpZqCjLBJ1YImPLjXb9ezY eMostKg6XIsfUFHHclbcaAZ/SycOLLlEQ9BHdoZV3Jl399fo1PtrScGDCuBQpfH1VAofWL V3YH5sUh36+hIk4lLwqfXTshq/9c+BxIhigZyMaPteFU+Ygh6jWGlxB2Vd4YQEI6GNEcue j9Nb0DlT5zlVp5CZVJO24LbiU5KrlHWjtNG4GMk4ef3sue7BuWxTt+6qszStSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739823321; a=rsa-sha256; cv=none; b=CKdpuiEFUjnaI7sS6CrJzWpf/p8nYB1fAq/ZV+pfO7YnRfSLpnpnLrDIi825DvLe8c1VvU cTp4kcNqNPKgc59cF+hah8QoXhmn5EnkD7f2GwClDBkhu7Ju6GAy4VHb7KPvwTKUT/2LSL IYlcccuB4EOTWl5IMvlemNQik4buIpglnAgXQYHSbtW/lQ9kMF6BKW2uvIRmRf7aoX6cJz 7Ls7czDAwq5Ihyy7dCt5wzwlsPYilWV1QNEUINJrWxVkJ+Y6AlYfgwFJ5z1uzH9u3zptWE YiXIz6axaQcqFZN09LW1UMR1VzxbnrMZz1xl1EN9dbF0+fK2dyQU+QS1mwR0XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739823321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pLPUUJ1jfatlydSh9zHmRTdhF4/IISaT8a/VyKbxNxQ=; b=SwmDm1+Q09Yj5VjmLdDGPtT9ndRAAoMdA7p5w+0ANPtD0oSOTAxY3ZjBdwEcVYCzcPmB9H yc/j2jMITJzT2m7qwfqPP0153YOpWAo6Fp21jrSxEb68Gthh3iS2ZUJ69xQ4Nm65ILbtMi ejnvPuiwwkUl9buUylDrBDF09sU9jDMyinmp5/6sKidvXsmDDxEvoa4za1QU5snJw5fjvu FZY/ha/bb7pzxbfgxj46ZrGO2CbyNpeq95JOvxa23ZPd6VjNOi8io/3Zi+fyUjl0E/LFyf awo3lGv32Vk/MaCl8HzQQryswqDyUFd0ig7u2HhMy2jWiI6vvQu+xYyIBdZ4ww== Received: from [IPV6:2601:5c0:4200:b830:88ac:d422:574d:64aa] (unknown [IPv6:2601:5c0:4200:b830:88ac:d422:574d:64aa]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YxYmn3mL5z98Y; Mon, 17 Feb 2025 20:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <65e016fa-6379-434f-a507-6d28ed74d3b7@FreeBSD.org> Date: Mon, 17 Feb 2025 15:15:20 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 94686b081fdb - main - arm64: add missing HWCAP and HWCAP2 values Content-Language: en-US To: Andrew Turner , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502171636.51HGavae082782@gitrepo.freebsd.org> From: John Baldwin Cc: harry.moulton@arm.com In-Reply-To: <202502171636.51HGavae082782@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2/17/25 11:36, Andrew Turner wrote: > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=94686b081fdb0c1bb0fc1dfeda14bd53f26ce7c5 > > commit 94686b081fdb0c1bb0fc1dfeda14bd53f26ce7c5 > Author: Harry Moulton > AuthorDate: 2025-02-17 16:00:03 +0000 > Commit: Andrew Turner > CommitDate: 2025-02-17 16:07:35 +0000 > > arm64: add missing HWCAP and HWCAP2 values > > Update the HWCAP and HWCAP2 values to align with Linux v6.13 > > Reviewed by: andrew > Sponsored by: Arm Ltd > Differential Revision: https://reviews.freebsd.org/D48814 > Signed-off-by: Harry Moulton Hmm, for future reference, it would have been nice to separate the conversion to shifts instead of bare constants as a separate commit so it was more obvious which missing values were added. -- John Baldwin From nobody Mon Feb 17 20:22:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxYwc5bcrz5p6d5; Mon, 17 Feb 2025 20:22:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxYwc4xQdz3vjb; Mon, 17 Feb 2025 20:22:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739823728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0TaHSB4T7zLgGQoFV/80VZYZQ6Abb5D9zLq7Aya4P8=; b=fUTQZb/UTjIkFRHAisQSh/CIde99cvCcZ4hNzpgxCIonq/kOQHagRm9yCWXLrylkbd/wD6 zCVzR38o+mu9TXR59zUbtOBqlsi9Paa0QZhWtym+cuIEEkR6IOcaq+KgSw4yQo366K9P0L ggMkGT+g73HwiK0ygwKYkwHSnuVR4XXmTe9PCYMBLdTmupJsawGZEmGgQsh0LcHKAG4I3D e1oM7REs47C5LmBI4/owRb+yBykNWwAGl6dc+kOZY4cLUfh8roTFqjex+Pbyvvs2Ez8YiT NJ34OOnlPbu70w537acH2DxKdMrjMgkrNb5QoTUCQaBDhh9pufoLUR25n6l/DA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739823728; a=rsa-sha256; cv=none; b=roiUl/YrAm22WHxy+yMVSRwTHPcybZqNMVbO6nJjMVuMpBouFDVx/Yz8ou5JO3Q5EFbVe/ i4Eq//53NO6SPrUH/5qvPDw2YE3LH8kcllgMdbA1W4tWvvz390blAvv5/W+x/O65aAuMFb zMdRm3vGuoyC663GxddLJHGcKbR+sBsLOBDxb1WjFZIRLXMg5qdxbOyM1BxXRY/hC4moIS 71iDial/rw8wCmv4Iejsze/zAp/onjIp1J8d29DjF2uIEhgVar0P2ArU5JZ1BfOUXwsFVy WmHjE9+zPcQrZqk9sMb2cNVgWP6fZNJw6mwm+aTyxIDhGSV8hSnYcrFkmWNbSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739823728; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=K0TaHSB4T7zLgGQoFV/80VZYZQ6Abb5D9zLq7Aya4P8=; b=eav7KUULDKxK8rtQ3AOqlCuHwM3QKApKOBHtPw9u5sHkSV8r4WR8YRshK04WLTKwGCZ/vD 1dQkCuawZC8AwlOsUXWMWQJIBtH7yMkKon6o+aTbPsdA4h14Qmg+1iLhyNe6ZWT0gduzmM h2PoJNucqA85mRZW8uBFuUlPUQYL2dcIXDDtw3aNwsiDtYm27xwF2xxXUz9W60uMqXudNY kgTStpV6lrGIUj+7TnPGSlUsIyQr9DsRilgAXys5jU9T2nwSwibrQNF5AO1RRaskM2oKpR qErWIeuh3ntMv9oa5J4s8l/XLsFTDaXlraj4eC9iVyIEerurssilhdfdfFEeEg== Received: from [IPV6:2601:5c0:4200:b830:88ac:d422:574d:64aa] (unknown [IPv6:2601:5c0:4200:b830:88ac:d422:574d:64aa]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YxYwc341Cz9pq; Mon, 17 Feb 2025 20:22:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <06849674-d51f-4a20-9ddb-687e29ece68e@FreeBSD.org> Date: Mon, 17 Feb 2025 15:22:07 -0500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values Content-Language: en-US To: Kristof Provost Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> From: John Baldwin In-Reply-To: <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/17/25 12:08, Kristof Provost wrote: > On 17 Feb 2025, at 16:24, John Baldwin wrote: >> On 2/14/25 12:50, Kristof Provost wrote: >>> The branch main has been updated by kp: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=7e7f88001d7dfec83cd7568369be6a587d4a51ff >>> >>> commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff >>> Author: Kristof Provost >>> AuthorDate: 2025-02-07 10:29:26 +0000 >>> Commit: Kristof Provost >>> CommitDate: 2025-02-14 17:47:52 +0000 >>> >>> pf: use time_t for storing time_t values >>> No change to the underlying type, so no ABI change. >>> We define __time_t as uint64_t if __LP64__, otherwise >>> uint32_t, >>> and only define __LP64__ if long is 64 bits. >>> In other words: __time_t == long. >>> ok henning@ deraadt@ >>> Obtained from: OpenBSD, guenther , >>> 6c1b69a0ff >>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>> Differential Revision: https://reviews.freebsd.org/D48963 >> >> This is an ABI change on non-i386 32-bit platforms in FreeBSD since >> they >> all use a 64-bit type for time_t that is not the same size as long. >> Not >> sure if the ABI change matters on FreeBSD though? >> > It wasn’t intended to be an ABI change, hence the commit message. It > appears that’s only correct for x86 though. I assumed the commit message was from OpenBSD as the comments about defining time_t conditional on __LP64__ are not correct on FreeBSD (each arch defines a __time_t in , though amd64 and i386 share x86/include/_types.h which does use an #ifdef that perhaps is the source of confusion?) > So we’re only talking about armv7 and ppc32, if I’m not forgetting > anything. The former is on the removal list already, and the latter .. > well, I don’t know how many users there are. Both are likely to be > embedded platforms where the ABI change is going to be even less > relevant (because it really only matters if the kernel and userspace are > not updated together, and these are going to be embedded devices that > are far more likely to have everything updated simultaneously).> > So I’m unsure about what to do. I can revert this and we can just > carry this (trivial) diff to OpenBSD forever, or we can ignore the ABI > breakage given the above. I’m not inclined to do anything more > involved though. > > Do you have any thoughts? To be clear, armv7 is planned to be around a bit longer than other 32-bit platforms. That said, 32-bit plaforms are all Tier 2, so an ABI breakage in main is not necessarily the end of the world. Presumably these structures aren't used much in ports but only in base system tools anyway? (That is what my question about the ABI change mattering was trying to allude to) I agree with Justin that this is not something to MFC. -- John Baldwin From nobody Mon Feb 17 21:02:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxZqH161jz5nQRp; Mon, 17 Feb 2025 21:02:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxZqG57Jdz3Dtl; Mon, 17 Feb 2025 21:02:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739826154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pmSJw35qFM2oiyrHrKRekvr6w+AwS6KfU+bFu+IC2U=; b=Lpx0/BKpC+962lbg4AFA37ex77CH8iL0+eEdHpcLT9lh4uCbEg5CuM64S2f7S5AYJkGDeE SWJV7hmPallM5c78r6fREoq6bu3q48pN1nDLX1lMx5bt9+Ce7rZIZp9DvdqyzvqG5tS2wv 1Mbvd+OfHUHc/HdOGRvfGdPBUqYuX0WxC6Uie+Hap6O1TrRmLLFFBIJH4s+pbRpgUfzeaQ xHY0CZ95St6gr9TAddD9ZffAu0WkQRt1QCUDcYr6vn3FLksn6/fv/k7odcgiVhCC2NGQ1k g+sujNZRQwC+KK0OvwiUuaLpBCRcSA54lrswlvs/YHJ5N1H0Fvzotse73HYbHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739826154; a=rsa-sha256; cv=none; b=NEp5vUxtMjhigH3SBPG+LDc+9DlSVfUfIS6fVEzCcBFyXsscz8Kn3gTsvDoISNso+sIlQM PaoO8C1lzxSdN+ki9oC/R7ukWunbGRp8JpRITbUlTCUrwO6bBFM/NnlaITPY3ZTfQa6TC+ aVwQH7aoVgZbxFg7h8Lr9Czxio1vJjg4UBYveXHSD0nI8KoGXGxJRlSa9WDho90Cexheba ILwgz9FQhDQnvAZxbGw+S7HR5MO9H/s8sTsoPdpQfLzI2LOjs2PP9CWKYQkaiy7See0iw5 A6CeZ41Ug1Km0jEclgV0KD1ytXIHnopTLICqEqQGdjkUl7XrdYOXLk7s0Cm3aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739826154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8pmSJw35qFM2oiyrHrKRekvr6w+AwS6KfU+bFu+IC2U=; b=FOBRTFnzf3HMkM/T9rHOJxP3O6SWlnrpssDXkmIPCp5dhMR5UCd7BTvbu+GyGHl4dC8zDg FyQxDVEozSUszZLt4iHQJ3ygUz17Jgs+M29HXp0lZWvNLfA6odF02yblmuPr4JK7lPrSn/ hbI6m8nb1b5AxlkVEJ43r1hhWdIiWsJzdDPSuz14oCg27uM6dGBkdKGQ6WR+N8NxnqJLi6 IgZ5NwHsHP68Re+nwQFX+Kxsh81fwr+26vz2TLrrYAY+JSg9q1OxazClYEp6pveZynryJl 9+rDlVVYm/cNBi08k0BJruRX5T+gLKq2v/yY+7p00uz1hkNLZh8z9yHsqbEjfg== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YxZqG3TBkzBgg; Mon, 17 Feb 2025 21:02:34 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 30F051F96E; Mon, 17 Feb 2025 22:02:32 +0100 (CET) From: Kristof Provost To: John Baldwin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values Date: Mon, 17 Feb 2025 22:02:31 +0100 X-Mailer: MailMate (2.0r6222) Message-ID: In-Reply-To: <06849674-d51f-4a20-9ddb-687e29ece68e@FreeBSD.org> References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> <06849674-d51f-4a20-9ddb-687e29ece68e@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_5CA74BE6-CED5-4A7E-8982-9DB900BE9221_=" --=_MailMate_5CA74BE6-CED5-4A7E-8982-9DB900BE9221_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 17 Feb 2025, at 21:22, John Baldwin wrote: > On 2/17/25 12:08, Kristof Provost wrote: >> On 17 Feb 2025, at 16:24, John Baldwin wrote: >>> On 2/14/25 12:50, Kristof Provost wrote: >>>> The branch main has been updated by kp: >>>> >>>> URL: >>>> https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd7568369= be6a587d4a51ff >>>> >>>> commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff >>>> Author: Kristof Provost >>>> AuthorDate: 2025-02-07 10:29:26 +0000 >>>> Commit: Kristof Provost >>>> CommitDate: 2025-02-14 17:47:52 +0000 >>>> >>>> pf: use time_t for storing time_t values >>>> No change to the underlying type, so no ABI change. >>>> We define __time_t as uint64_t if __LP64__, otherwise >>>> uint32_t, >>>> and only define __LP64__ if long is 64 bits. >>>> In other words: __time_t =3D=3D long. >>>> ok henning@ deraadt@ >>>> Obtained from: OpenBSD, guenther , >>>> 6c1b69a0ff >>>> Sponsored by: Rubicon Communications, LLC ("Netgate") >>>> Differential Revision: https://reviews.freebsd.org/D48963 >>> >>> This is an ABI change on non-i386 32-bit platforms in FreeBSD since >>> they >>> all use a 64-bit type for time_t that is not the same size as long. >>> Not >>> sure if the ABI change matters on FreeBSD though? >>> >> It wasn=E2=80=99t intended to be an ABI change, hence the commit messa= ge. = >> It >> appears that=E2=80=99s only correct for x86 though. > > I assumed the commit message was from OpenBSD as the comments about > defining time_t conditional on __LP64__ are not correct on FreeBSD > (each arch defines a __time_t in , though amd64 > and i386 share x86/include/_types.h which does use an #ifdef that > perhaps is the source of confusion?) > Partially. The =E2=80=9CWe define __time_t as uint64_t if __LP64__, other= wise = uint32_t, and only define __LP64__ if long is 64 bits. In other words: __time_t =3D=3D long.=E2=80=9D bit was me, and that was c= orrect = for x86, but not for other machines. That=E2=80=99s what I got wrong. >> So we=E2=80=99re only talking about armv7 and ppc32, if I=E2=80=99m no= t = >> forgetting >> anything. The former is on the removal list already, and the latter = >> .. >> well, I don=E2=80=99t know how many users there are. Both are likely t= o be >> embedded platforms where the ABI change is going to be even less >> relevant (because it really only matters if the kernel and userspace = >> are >> not updated together, and these are going to be embedded devices that >> are far more likely to have everything updated simultaneously).> So = >> I=E2=80=99m unsure about what to do. I can revert this and we can just= >> carry this (trivial) diff to OpenBSD forever, or we can ignore the = >> ABI >> breakage given the above. I=E2=80=99m not inclined to do anything more= >> involved though. >> >> Do you have any thoughts? > > To be clear, armv7 is planned to be around a bit longer than other = > 32-bit > platforms. That said, 32-bit plaforms are all Tier 2, so an ABI = > breakage > in main is not necessarily the end of the world. Presumably these = > structures > aren't used much in ports but only in base system tools anyway? (That > is what my question about the ABI change mattering was trying to = > allude to) > This affects ioctl calls, so it can and probably does affect ports. = There aren=E2=80=99t many but still a few that use the ioctl interface (t= hings = like pftop and snort). I don=E2=80=99t know offhand if they actually use any of the affected cal= ls = though. I could also revert this now and deal with it when I get around to = converting the relevant ioctl calls to netlink. That=E2=80=99s ongoing an= d = still aspirationally (but getting less likely) to be completed before we = branch 15. That may be a better point to make this change, because once = the netlink conversion is complete the next major release will remove = the entire ioctl interface, and that=E2=80=99s a breaking change anyway. > I agree with Justin that this is not something to MFC. > There=E2=80=99s no plan to MFC this (or any of the other recent pf work, = for = that matter). Best regards, Kristof --=_MailMate_5CA74BE6-CED5-4A7E-8982-9DB900BE9221_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 17 Feb 2025, at 21:22, John Baldwin wrote:

On 2/17/25 12:08, Kristof Provost wrote:

On 17 Feb 2025, at 16:24, John Baldwin wrote:

On 2/14/25 12:50, Kristof Provost wrote:

The branch main has been updated by kp:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001= d7dfec83cd7568369be6a587d4a51ff

commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff
Author: Kristof Provost kp@FreeBSD.= org
AuthorDate: 2025-02-07 10:29:26 +0000
Commit: Kristof Provost kp@FreeBSD.= org
CommitDate: 2025-02-14 17:47:52 +0000

  =
pf: use time_t for storing time_t values
      No change to the underlying type, so no ABI change.
      We define __time_t as uint64_t if __LP64__, otherwise

uint32_t,
and only define LP64 if long is 64 bits.
In other words: __time_t =3D=3D long.
ok henning@ deraadt@
Obtained from: OpenBSD, guenther guenther@openbsd.org,
6c1b69a0ff
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: ht= tps://reviews.freebsd.org/D48963

This is an ABI change on non-i386 32-bit platforms in Fre= eBSD since
they
all use a 64-bit type for time_t that is not the same size as long.
Not
sure if the ABI change matters on FreeBSD though?

It wasn=E2=80=99t intended to be an ABI change, hence the= commit message. It
appears that=E2=80=99s only correct for x86 though.

I assumed the commit message was from OpenBSD as the comm= ents about
defining time_t conditional on LP64 are not correct on F= reeBSD
(each arch defines a __time_t in <machine/_types.h>, though amd64 and i386 share x86/include/_types.h which does use an #ifdef that
perhaps is the source of confusion?)

Partially. The =E2=80=9CWe define __time_t as uint64_t if= LP64, otherwise uint32_t,
and only define LP64 if long is 64 bits.
In other words: __time_t =3D=3D long.=E2=80=9D bit was me, and that was c= orrect for x86, but not for other machines.

That=E2=80=99s what I got wrong.

So we=E2=80=99re only talking about armv7 and ppc32, if I= =E2=80=99m not forgetting
anything. The former is on the removal list already, and the latter .. well, I don=E2=80=99t know how many users there are. Both are likely to b= e
embedded platforms where the ABI change is going to be even less
relevant (because it really only matters if the kernel and userspace are<= br> not updated together, and these are going to be embedded devices that
= are far more likely to have everything updated simultaneously).> So I=E2= =80=99m unsure about what to do. I can revert this and we can just
carry this (trivial) diff to OpenBSD forever, or we can ignore the ABI breakage given the above. I=E2=80=99m not inclined to do anything more involved though.

Do you have any thoughts?

To be clear, armv7 is planned to be around a bit longer t= han other 32-bit
platforms. That said, 32-bit plaforms are all Tier 2, so an ABI breakage=
in main is not necessarily the end of the world. Presumably these struct= ures
aren't used much in ports but only in base system tools anyway? (That is what my question about the ABI change mattering was trying to allude t= o)

This affects ioctl calls, so it can and probably does aff= ect ports. There aren=E2=80=99t many but still a few that use the ioctl i= nterface (things like pftop and snort).
I don=E2=80=99t know offhand if they actually use any of the affected cal= ls though.

I could also revert this now and deal with it when I get = around to converting the relevant ioctl calls to netlink. That=E2=80=99s = ongoing and still aspirationally (but getting less likely) to be complete= d before we branch 15. That may be a better point to make this change, be= cause once the netlink conversion is complete the next major release will= remove the entire ioctl interface, and that=E2=80=99s a breaking change = anyway.

I agree with Justin that this is not something to MFC.

There=E2=80=99s no plan to MFC this (or any of the other = recent pf work, for that matter).

Best regards,
Kristof

--=_MailMate_5CA74BE6-CED5-4A7E-8982-9DB900BE9221_=-- From nobody Mon Feb 17 21:03:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxZs15f3Bz5nQc4 for ; Mon, 17 Feb 2025 21:04:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YxZs13bwDz3FyS for ; Mon, 17 Feb 2025 21:04:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2fbf77b2b64so8828839a91.2 for ; Mon, 17 Feb 2025 13:04:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1739826244; x=1740431044; 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=kimMyCBko/ey+FTT4BZu01X/K9zj9xv1MayU8IRS16g=; b=K/bP8EBpIguVxoFdTg8PFXelzjThDIUeHIVgj6lm0stiBcdhPO2nezkrpILpiG6DjR mrSFC62Q4gKz51pSLp/MlivSj2vLAs8uh85neegJOpnA1E9q00t+daUyAA1OVd4WteMS 3CcSjRzdyupG3l7XUNY2pzxHqxF2WX1AnAQK8K4GPr6qiXI2l7ysrMLxzDSZ+U6cE6Ih R6T0wvvHkHOk2yDGabFdJCshZJwU8bsWcVS/gXGUY99qRnbmeKkWIfXia3f7P4FaWIX3 1liBg3VOhhv56XOU1P/lRwsfyTS02HaEuvtv3jTzpPeiR2OrjcJqVDDGHqyUR0wMJY46 qOPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739826244; x=1740431044; 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=kimMyCBko/ey+FTT4BZu01X/K9zj9xv1MayU8IRS16g=; b=H+uukE1BBfy981muU/hHSQiSpE+4R6/Ei/fONlrTkN4s5ul7KaXgsoJFv2DJTX6Z3Y eO+NMbqa246X/81XYqKMw4FggDEtwsf02mxP4XOmADERKA/DcOxS4I8SxgdELCYiIQly uEt7zTv3mlyXwqrc+nWQJDFoJuju04f10kU4vU3ijSW2rQedYDGTrZeG/1YCqOPfRcfI PvDRDmiqxy6lshfAOdGnNVQCg+I4hJ5nrNQcWpzBriM6mdmckaCzDjfOwWToAxK9JFmc 9v2SA7jD1LY9Bzmki8HmV3itLS7Px92iIENLD0bm/zezTHXDby7HxejogwtAqPhxhG6z 34jQ== X-Forwarded-Encrypted: i=1; AJvYcCURExBmlqxGRM1+543coQ2PvTj0Bz8VomT7Z9+lmyQtMaHtZTSN/luOMOdcnzU8p1kuC2iDdECcisLFye9hxwZdqIxdMw==@freebsd.org X-Gm-Message-State: AOJu0YzHx+/2G+ygLAv6RNjSKcBJLkFXGfLpp1NGIUp6aOihYoLtx8gT W7aptnPL8CLNXTpllgtNbkGPYsxef1TX8lHXB10XGiLg8nrip5dW8AZgp+Y03PECDkFjEyl0OYJ TahTjtmDbjuWM2R4Xjb/82lxX37Hzc/pfNUQchg== X-Gm-Gg: ASbGncv3LnxCpdgwO0opuctiLX78Qofoz0lD2CHcAuSDvjKF0x5aYi2a+NiADcct9hI PCkpGpTxqQkMVq5hPh1JsSBIF18f06NDmzz4e8avYL5pdrr8RjCNWeiPlrOwND0x6x2d8J2UigA kN9OhwyVuwCls9q8JCDLW1JA4ools= X-Google-Smtp-Source: AGHT+IFFummUt8lH/PmTilO2TA89cHIv5UordWdk70PoGWtvTf39r5tVVNV10Iqy3JrgXs8HHQ8+jFp9gsEcgqRoAdE= X-Received: by 2002:a17:90b:510c:b0:2ee:53b3:3f1c with SMTP id 98e67ed59e1d1-2fc40d14c1emr16685474a91.5.1739826243781; Mon, 17 Feb 2025 13:04:03 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> In-Reply-To: <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> From: Warner Losh Date: Mon, 17 Feb 2025 14:03:52 -0700 X-Gm-Features: AWEUYZmFBIIxCAb02CHVwzViYiRoESZhQ9ves6lBHvrpeN2fRHRA2fkE385I3pw Message-ID: Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values To: Kristof Provost Cc: John Baldwin , src-committers , "" , "" Content-Type: multipart/alternative; boundary="0000000000003b5f32062e5cdd81" 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: 4YxZs13bwDz3FyS X-Spamd-Bar: ---- --0000000000003b5f32062e5cdd81 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Feb 17, 2025, 10:08=E2=80=AFAM Kristof Provost wro= te: > On 17 Feb 2025, at 16:24, John Baldwin wrote: > > On 2/14/25 12:50, Kristof Provost wrote: > > The branch main has been updated by kp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd7568369be6a5= 87d4a51ff > > commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff > Author: Kristof Provost kp@FreeBSD.org > AuthorDate: 2025-02-07 10:29:26 +0000 > Commit: Kristof Provost kp@FreeBSD.org > CommitDate: 2025-02-14 17:47:52 +0000 > > pf: use time_t for storing time_t values > No change to the underlying type, so no ABI change. > We define __time_t as uint64_t if __LP64__, otherwise uint32_t, > and only define __LP64__ if long is 64 bits. > In other words: __time_t =3D=3D long. > ok henning@ deraadt@ > Obtained from: OpenBSD, guenther , 6c1b69a0ff > Sponsored by: Rubicon Communications, LLC ("Netgate") > Differential Revision: https://reviews.freebsd.org/D48963 > > This is an ABI change on non-i386 32-bit platforms in FreeBSD since they > all use a 64-bit type for time_t that is not the same size as long. Not > sure if the ABI change matters on FreeBSD though? > > It wasn=E2=80=99t intended to be an ABI change, hence the commit message.= It > appears that=E2=80=99s only correct for x86 though. > Yes. It may have been true in openbsd land, but not FreeBSD. > So we=E2=80=99re only talking about armv7 and ppc32, if I=E2=80=99m not f= orgetting > anything. The former is on the removal list already, and the latter .. > well, I don=E2=80=99t know how many users there are. Both are likely to b= e embedded > platforms where the ABI change is going to be even less relevant (because > it really only matters if the kernel and userspace are not updated > together, and these are going to be embedded devices that are far more > likely to have everything updated simultaneously). > Armv7 will be around in 15. Ppc32 is likely going away. > So I=E2=80=99m unsure about what to do. I can revert this and we can just= carry > this (trivial) diff to OpenBSD forever, or we can ignore the ABI breakage > given the above. I=E2=80=99m not inclined to do anything more involved th= ough. > > Do you have any thoughts? > I think the diffs to OpenBSD are most undesirable of the alternatives. Major os breakage is fine. Tier2 platforms get a weaker version of compatibility. Armv7 is on the cusp of the abi needing to work. Sonce this is a private abi, and only a few programs are affected and they already need an update for 15 due to other changes (right?) And since providing backwards compatible ABI shims looks to be kinda nontrivial, I agree with the others: document in release notes and don't MFC and we're likrly good. If it is really important to someone AND everything works except for thos one detail between 14 and 15, then the project=E2=80=99s custom would be to integrate that patch, but not require the originator to do it. Tl;dr: mfc no. Relnotes yes. Warner Warner Best regards, > Kristof > --0000000000003b5f32062e5cdd81 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Feb 17, 2025, 10:08=E2=80=AFAM Kristof Provost= <kp@freebsd.org> wrote:
<= /u>

On 17 Feb 2025, at 16:24, John Baldwin wrote:

On 2/14/25 12:50, Kristof Provost wrote:

The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd= 7568369be6a587d4a51ff

commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff
Author: Kristof Provost kp@FreeBSD.org
AuthorDate: 2025-02-07 10:29:26 +0000
Commit: Kristof Provost kp@FreeBSD.org
CommitDate: 2025-02-14 17:47:52 +0000

 pf: use time_t for storin=
g time_t values
     No change to the underlying type, so no ABI change.
     We define __time_t as uint64_t if __LP64__, otherwise uint32_t,
 and only define __LP64__ if long is 64 bits.
 In other words: __time_t =3D=3D long.
     ok henning@ deraadt@
     Obtained from:  OpenBSD, guenther <guenther@openbsd.or=
g>, 6c1b69a0ff
 Sponsored by:   Rubicon Communications, LLC ("Netgate")
 Differential Revision:  https://reviews.freebsd.org/D4=
8963

This is an ABI change on non-i386 32-bit platforms in FreeB= SD since they
all use a 64-bit type for time_t that is not the same size as long. Not sure if the ABI change matters on FreeBSD though?

It wasn=E2=80=99t intended to be an ABI change, hence the c= ommit message. It appears that=E2=80=99s only correct for x86 though.


Yes. It may have been true in openbsd land, but not FreeBSD.=C2= =A0

So we=E2=80=99re only talking about armv7 and ppc32, if I= =E2=80=99m not forgetting anything. The former is on the removal list alrea= dy, and the latter .. well, I don=E2=80=99t know how many users there are. = Both are likely to be embedded platforms where the ABI change is going to b= e even less relevant (because it really only matters if the kernel and user= space are not updated together, and these are going to be embedded devices = that are far more likely to have everything updated simultaneously).


Armv7 will be around in 15. Ppc32 is likely going away.

So I=E2=80=99m unsure about what to do. I can revert this a= nd we can just carry this (trivial) diff to OpenBSD forever, or we can igno= re the ABI breakage given the above. I=E2=80=99m not inclined to do anythin= g more involved though.

Do you have any thoughts?

I think the diffs to OpenBSD are most undesi= rable of the alternatives.

Major os breakage is fine. Tier2 platforms get a weaker version of compa= tibility.

Armv7 is on th= e cusp of the abi needing to work. Sonce this is a private abi, and only a = few programs are affected and they already need an update for 15 due to oth= er changes (right?) And since providing backwards compatible ABI shims look= s to be kinda nontrivial, I agree with the others: document in release note= s and don't MFC and we're likrly good.

<= /div>
If it is really important to someone AND everything = works except for thos one detail between 14 and 15, then the project=E2=80= =99s custom would be to integrate that patch, but not require the originato= r to do it.

Tl;dr: mfc n= o. Relnotes yes.

Warner= =C2=A0

Warner

Best regards,
Kristof

--0000000000003b5f32062e5cdd81-- From nobody Mon Feb 17 23:31:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6Z10KRz5nbp6; Mon, 17 Feb 2025 23:31: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 4Yxf6Z0Bdvz41gm; Mon, 17 Feb 2025 23:31:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kj2uhqTfVxSFIkZclTfoC79x7tm0Ts9EBj4vw8oj4SU=; b=iAzAhrh2ZVpM+nMxvUoUSnzfP3ziqAQ5QBbXLEDmuggt/jsgeX67znIE5guutaP+op+kI1 d48ayU9kYjai8BpHkYvpsATHeCsK0EQTURsqwaFJB+GXcUHt/u0LXC++3NAtoF+NpLdPoF /hIE/YGpKIDgEVptB2zEDBoojFEmE8uwIwlZgQSoyKpgQ4ESbnMZ5aKXNrw1O+4XWt6gHG hqhgQE/QBWsAp8pZXHVqkye5UoSRuQp7oBDTUIGg0M5tfHTKmbRLKvmFjrI4bzQ+AhoOxC RaAYbtwYp7xwItNHOaS570RxYS7BJFnhGrMgvYiet8zoOLAcRB9EX67SWK/WxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835062; a=rsa-sha256; cv=none; b=yhVTH4KkR8VrsmGQrY34vwoGy4gXKj+nL956IH48qchIrU4/0y0idA7FqSJUhJroXDD6Hy HMa3Btv19znVwOdp3MPDfsZSq0jOsSHiscBNNSYdFFLx8BsyW4VZFrxVTA7oN9YP1o4iYB 8ZaOuIsuhxOaTTkSMJz99uGvKr4ys5H1aOUcvv5Te/woD/YpUDfH19HJOp0dMVQt0esEAX 2Nr5TuNtDiKQn5D2QHC54BC8PJcx8buFQ2qPukHCAZ5YFUMCA+Gea446BIQTnNwbbxTKtG U00yki1hzu5OvbqWtmYAw7idP+NAXFMpJIWyacWUZRCdhMSZnpyJ9bk4fL2afQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kj2uhqTfVxSFIkZclTfoC79x7tm0Ts9EBj4vw8oj4SU=; b=iuVf9A+5UHOut+dpByepmHrjcmc4RV2QXs4rUH53Oa2qmzDCYCU3BmYIciesE7GwSmV0LD mo3/T8N4Pw2jkcCHK3kelve93FCQnFw0OImDQftcHeAecxb9IU5iOUZMFPcvjjd0X3MkT5 MPrt0dSKRYVgUMJXez83xIhlTv4yJoJQ625xwqcaM6FBV7qVUZJgMUkIQuM0Ltu6Ro50ra n6VT4R0hEBHBjggCq5oOkWKQO3F2YHjxdWq42JbuiqqC5koDdIXLCMnpXqyiapdEw6BTJI AhAObY/M1VFF0fT/Jsl2obwyCIj0lrJPUcouFLstXHMihSHxSyM8ZFPhR9Y+CQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6Y6rZkzvDD; Mon, 17 Feb 2025 23:31: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 51HNV1Lq067135; Mon, 17 Feb 2025 23:31:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV1sg067132; Mon, 17 Feb 2025 23:31:01 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:01 GMT Message-Id: <202502172331.51HNV1sg067132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 4f274f849be9 - main - tests/netinet: add few tests for unconnected UDP socket List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f274f849be9d5c0e2733dd3fe8e1196fa36b751 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=4f274f849be9d5c0e2733dd3fe8e1196fa36b751 commit 4f274f849be9d5c0e2733dd3fe8e1196fa36b751 Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:51 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:51 +0000 tests/netinet: add few tests for unconnected UDP socket 1) Test that getsockname() on a socket that experienced a sendto(2) returns allocated port. 2) Same as 1), but jailed. Make sure IP address was also selected. 3) Test that IP_SENDSRCADDR/IP_RECVDSTADDR work. 4) Regression test for bug 274009. --- tests/sys/netinet/Makefile | 2 + tests/sys/netinet/udp_bindings.c | 249 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+) diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index 279a58985816..905fbb06cd48 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -13,6 +13,7 @@ ATF_TESTS_C= fibs_multibind_test \ tcp_connect_port_test \ tcp_implied_connect \ tcp_md5_getsockopt \ + udp_bindings \ udp_io ATF_TESTS_SH= arp \ @@ -29,6 +30,7 @@ ATF_TESTS_PYTEST+= carp.py ATF_TESTS_PYTEST+= igmp.py LIBADD.so_reuseport_lb_test= pthread +LIBADD.udp_bindings= pthread # Some of the arp tests look for log messages in the dmesg buffer, so run them # serially to avoid problems with interleaved output. diff --git a/tests/sys/netinet/udp_bindings.c b/tests/sys/netinet/udp_bindings.c new file mode 100644 index 000000000000..b05967d4b080 --- /dev/null +++ b/tests/sys/netinet/udp_bindings.c @@ -0,0 +1,249 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Gleb Smirnoff + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const char buf[] = "Hello"; + +static void +sendtolocalhost(int s) +{ + struct sockaddr_in dst = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + .sin_addr = { htonl(INADDR_LOOPBACK) }, + .sin_port = htons(1638), + }; + + ATF_REQUIRE(sendto(s, buf, sizeof(buf), 0, (struct sockaddr *)&dst, + sizeof(dst)) == sizeof(buf)); +} + +/* + * Echo back to the sender its own address in payload. + */ +static void * +echo(void *arg) +{ + int s = *(int *)arg; + struct sockaddr_in sin; + socklen_t slen = sizeof(sin); + char rbuf[sizeof(buf)]; + + ATF_REQUIRE(recvfrom(s, &rbuf, sizeof(rbuf), 0, (struct sockaddr *)&sin, + &slen) == sizeof(rbuf)); + printf("Echo to %s:%u\n", inet_ntoa(sin.sin_addr), ntohs(sin.sin_port)); + ATF_REQUIRE(sendto(s, &sin, sizeof(sin), 0, (struct sockaddr *)&sin, + sizeof(sin)) == sizeof(sin)); + return (NULL); +} + +/* + * Cycle through local addresses (normally there should be at least two + * different IPv4 ones), and communicate to the echo server checking both + * IP_SENDSRCADDR and IP_RECVDSTADDR. Use same cmsg buffer for both send + * and receive operation, this is a suggested in manual, given that + * IP_RECVDSTADDR == IP_SENDSRCADDR. + * At the setup phase check that IP_SENDSRCADDR doesn't work on unbound socket. + */ +ATF_TC_WITHOUT_HEAD(IP_SENDSRCADDR); +ATF_TC_BODY(IP_SENDSRCADDR, tc) +{ + struct sockaddr_in srv = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + }, dst; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct iovec iov = { + .iov_base = __DECONST(char *, buf), + .iov_len = sizeof(buf), + }; + struct iovec riov = { + .iov_base = &dst, + .iov_len = sizeof(dst), + }; + struct msghdr msg = { + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_name = &srv, + .msg_namelen = sizeof(srv), + .msg_control = cbuf, + .msg_controllen = sizeof(cbuf), + }; + struct msghdr rmsg = { + .msg_iov = &riov, + .msg_iovlen = 1, + .msg_control = cbuf, + .msg_controllen = sizeof(cbuf), + }; + struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); + *cmsg = (struct cmsghdr) { + .cmsg_level = IPPROTO_IP, + .cmsg_type = IP_SENDSRCADDR, + .cmsg_len = CMSG_LEN(sizeof(struct in_addr)), + }; + socklen_t slen = sizeof(struct sockaddr_in); + struct ifaddrs *ifa0, *ifa; + pthread_t tid; + int s, e; + + /* First check that IP_SENDSRCADDR doesn't work on an unbound socket. */ + ATF_REQUIRE((s = socket(PF_INET, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE_MSG(sendmsg(s, &msg, 0) == -1 && errno == EINVAL, + "sendmsg(.cmsg_type = IP_SENDSRCADDR), errno %d", errno); + + /* Bind to random ports both sender and echo server. */ + ATF_REQUIRE(bind(s, (struct sockaddr *)&srv, sizeof(srv)) == 0); + ATF_REQUIRE((e = socket(PF_INET, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(bind(e, (struct sockaddr *)&srv, sizeof(srv)) == 0); + ATF_REQUIRE(getsockname(e, (struct sockaddr *)&srv, &slen) == 0); + srv.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + + ATF_REQUIRE(getifaddrs(&ifa0) == 0); + for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) { + struct sockaddr_in src; + struct in_addr vrf; + + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + memcpy(&src, ifa->ifa_addr, sizeof(src)); + printf("Sending from %s\n", inet_ntoa(src.sin_addr)); + ATF_REQUIRE(pthread_create(&tid, NULL, echo, &e) == 0); + memcpy(CMSG_DATA(cmsg), &src.sin_addr, sizeof(src.sin_addr)); + ATF_REQUIRE(sendmsg(s, &msg, 0) == sizeof(buf)); + ATF_REQUIRE(recvmsg(s, &rmsg, 0) == sizeof(struct sockaddr_in)); + memcpy(&vrf, CMSG_DATA(cmsg), sizeof(vrf)); + ATF_REQUIRE_MSG(dst.sin_addr.s_addr == src.sin_addr.s_addr, + "Sent from %s, but echo server reports %s", + inet_ntoa(src.sin_addr), inet_ntoa(dst.sin_addr)); + ATF_REQUIRE_MSG(vrf.s_addr == src.sin_addr.s_addr, + "Sent from %s, but IP_RECVDSTADDR reports %s", + inet_ntoa(src.sin_addr), inet_ntoa(vrf)); + ATF_REQUIRE(pthread_join(tid, NULL) == 0); + } + + freeifaddrs(ifa0); + close(s); + close(e); +} + +/* + * Check gethostname(2) on a newborn socket, and then on an unconnected, but + * used socket. The first shall return all-zeroes, and second one should + * return us our assigned port. + */ +ATF_TC_WITHOUT_HEAD(gethostname); +ATF_TC_BODY(gethostname, tc) +{ + struct sockaddr_in sin; + socklen_t slen = sizeof(sin); + int s; + + ATF_REQUIRE((s = socket(PF_INET, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(getsockname(s, (struct sockaddr *)&sin, &slen) == 0); + ATF_REQUIRE_MSG(sin.sin_addr.s_addr == INADDR_ANY && sin.sin_port == 0, + "newborn socket name %s:%u", inet_ntoa(sin.sin_addr), + ntohs(sin.sin_port)); + sendtolocalhost(s); + ATF_REQUIRE(getsockname(s, (struct sockaddr *)&sin, &slen) == 0); + ATF_REQUIRE_MSG(sin.sin_addr.s_addr == INADDR_ANY && sin.sin_port != 0, + "used unconnected socket name %s:%u", inet_ntoa(sin.sin_addr), + ntohs(sin.sin_port)); + close(s); +} + +ATF_TC_WITHOUT_HEAD(gethostname_jailed); +ATF_TC_BODY(gethostname_jailed, tc) +{ + struct in_addr laddr = { htonl(INADDR_LOOPBACK) }; + struct jail jconf = { + .version = JAIL_API_VERSION, + .path = __DECONST(char *, "/"), + .hostname = __DECONST(char *,"test"), + .ip4s = 1, + .ip4 = &laddr, + }; + struct sockaddr_in sin; + socklen_t slen = sizeof(sin); + int s; + + ATF_REQUIRE(jail(&jconf) > 0); + ATF_REQUIRE((s = socket(PF_INET, SOCK_DGRAM, 0)) > 0); + sendtolocalhost(s); + ATF_REQUIRE(getsockname(s, (struct sockaddr *)&sin, &slen) == 0); + ATF_REQUIRE_MSG(sin.sin_addr.s_addr == laddr.s_addr && + sin.sin_port != 0, + "jailed unconnected socket name %s:%u", inet_ntoa(sin.sin_addr), + ntohs(sin.sin_port)); + close(s); +} + +/* + * See bug 274009. + */ +ATF_TC_WITHOUT_HEAD(v4mapped); +ATF_TC_BODY(v4mapped, tc) +{ + struct sockaddr_in6 sa6 = { + .sin6_family = AF_INET6, + .sin6_len = sizeof(struct sockaddr_in6), + .sin6_port = htons(1), + }; + int s; + + ATF_REQUIRE((s = socket(PF_INET6, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &(int){0}, + sizeof(int)) == 0); + ATF_REQUIRE(inet_pton(AF_INET6, "::ffff:127.0.0.1", &(sa6.sin6_addr)) + == 1); + ATF_REQUIRE(sendto(s, buf, sizeof(buf), 0, (struct sockaddr *)&sa6, + sizeof(sa6)) == sizeof(buf)); + close(s); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, v4mapped); + ATF_TP_ADD_TC(tp, gethostname); + ATF_TP_ADD_TC(tp, gethostname_jailed); + ATF_TP_ADD_TC(tp, IP_SENDSRCADDR); + + return (atf_no_error()); +} From nobody Mon Feb 17 23:31:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6c5hXHz5nbhD; Mon, 17 Feb 2025 23:31: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 4Yxf6c3GW0z420t; Mon, 17 Feb 2025 23:31:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=grVQukQ1FsGQelV/N+HFSM/OXV1i2taNwK3LhBo+RQ8=; b=ln8KX9ZFhyDnZyFnd8qWCJc9zDjHfMQdbd9oTQz2G/6mKd/wK66dr4SnckZp73fnmdMrSA EY9jMUgqoPAeHn3N11WQkkJukIh0rNI/7O6/lJrYeqdD3oLJ+ZPZrlPKndttXKldP+vZ+S vTVOnXdtugAhbTxZy12+g0xExvIl7P2sKisMVVnlWG5rEV6mnBt9US61zp5DGF1oCfFOX4 3DuftYxabgig5XDyWRoLAjebNl2Weh0RB6iBkM0NgjDDNvp0mO5xp0TZ07RyR8GKNgu4oS MKsHHJxrjfNXYXfyhoVz8HKlMjhK46er+8+SGmNicR2n/TndJugz6d8FjowKbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835064; a=rsa-sha256; cv=none; b=IqkfDYof1ggYHZcN1b9/Vio+JSlsMINk7OwWOpLWinBiqDKH7vMRg0F5P05TqvB1UG/HrP G7lsLEbjE7eIMKTW/bdjCNrocvXT6rM/cT+IqkIaiRdkDpKxhPLJhh7PqHtYPE5X8UxXMN P6arhCs2F8t1jR3FhTmM2jpuywA/iWK+LuMCNxeGEUN8MdzeW8D9xPtETlApgoDYgd4ATo NUDzwSvSsSsZX/X0wXb60oCAIqK4iUY3VszKnjs/1/sz+3C8IwU9qP9OMn5e8jKDzVTW5R YMdhauqypR/+yLWX5wXnoWHBccX+p8KI5sGqGiCXL2Gf9gQ/2H4hRRmSS2l8Jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=grVQukQ1FsGQelV/N+HFSM/OXV1i2taNwK3LhBo+RQ8=; b=J7pUhAfNYwXhJZHSecQbAv0F3EROwH59ZYook+CrVr7nr3ALrUwYPyjg+jbgD4v68JMqHz DqDoBqk4SqxekkKhsjflUZRZgrkmn27c1BR7Hy6Br7pvCxNYEOLVkUHrfBfhgep4jODYtV usRXfOlYwHDbJNt6t4L3Oljd14TgtQe7WoJCb3opLQsMP7VFSUQ2saZ5LvYwQ7g4bhfqMQ I9KlGCI/jE+E90vLoiuJCEZPPp1OeH4l0etcCmBSQKJYWsmbxaJttHPJCJoXML5CPRZ2O4 BuZX3oTulIogAnaGkzA6Vyv/x9Hy1rjkn5UN+J8pwGwLS2qgYbnq/t4wyof6Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6c21K8zvDF; Mon, 17 Feb 2025 23:31: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 51HNV4Pe067208; Mon, 17 Feb 2025 23:31:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV45E067205; Mon, 17 Feb 2025 23:31:04 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:04 GMT Message-Id: <202502172331.51HNV45E067205@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: bafe022b1f31 - main - inpcb: add const qualifiers on functions that select address/port List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bafe022b1f31c6b61aedc1a36a416270038bd971 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=bafe022b1f31c6b61aedc1a36a416270038bd971 commit bafe022b1f31c6b61aedc1a36a416270038bd971 Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:52 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:52 +0000 inpcb: add const qualifiers on functions that select address/port There are several functions that keep database locked and do address and port selection before a caller commits the changes to the inpcb. Mark the inpcb argument with a good documenting const. --- sys/netinet/in_pcb.c | 11 ++++++----- sys/netinet/in_pcb.h | 6 +++--- sys/netinet/in_pcb_var.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index c34b4594c9b9..9d174dce9024 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -754,8 +754,9 @@ in_pcbbind(struct inpcb *inp, struct sockaddr_in *sin, int flags, * lsa can be NULL for IPv6. */ int -in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, - struct sockaddr *fsa, u_short fport, struct ucred *cred, int lookupflags) +in_pcb_lport_dest(const struct inpcb *inp, struct sockaddr *lsa, + u_short *lportp, struct sockaddr *fsa, u_short fport, struct ucred *cred, + int lookupflags) { struct inpcbinfo *pcbinfo; struct inpcb *tmpinp; @@ -1143,8 +1144,8 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) * of connect. Take jails into account as well. */ int -in_pcbladdr(struct inpcb *inp, struct in_addr *faddr, struct in_addr *laddr, - struct ucred *cred) +in_pcbladdr(const struct inpcb *inp, struct in_addr *faddr, + struct in_addr *laddr, struct ucred *cred) { struct ifaddr *ifa; struct sockaddr *sa; @@ -1360,7 +1361,7 @@ done: * and port. These are not updated in the error case. */ int -in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, +in_pcbconnect_setup(const struct inpcb *inp, struct sockaddr_in *sin, in_addr_t *laddrp, u_short *lportp, in_addr_t *faddrp, u_short *fportp, struct ucred *cred) { diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index dae34e94d6f9..b0c64cfbd7ea 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -645,13 +645,13 @@ int in_pcbbind(struct inpcb *, struct sockaddr_in *, int, struct ucred *); int in_pcbbind_setup(struct inpcb *, struct sockaddr_in *, in_addr_t *, u_short *, int, struct ucred *); int in_pcbconnect(struct inpcb *, struct sockaddr_in *, struct ucred *); -int in_pcbconnect_setup(struct inpcb *, struct sockaddr_in *, in_addr_t *, - u_short *, in_addr_t *, u_short *, struct ucred *); +int in_pcbconnect_setup(const struct inpcb *, struct sockaddr_in *, + in_addr_t *, u_short *, in_addr_t *, u_short *, struct ucred *); void in_pcbdisconnect(struct inpcb *); void in_pcbdrop(struct inpcb *); void in_pcbfree(struct inpcb *); int in_pcbinshash(struct inpcb *); -int in_pcbladdr(struct inpcb *, struct in_addr *, struct in_addr *, +int in_pcbladdr(const struct inpcb *, struct in_addr *, struct in_addr *, struct ucred *); int in_pcblbgroup_numa(struct inpcb *, int arg); void in_pcblisten(struct inpcb *); diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h index 1101199f6b64..e2b0ca386e7f 100644 --- a/sys/netinet/in_pcb_var.h +++ b/sys/netinet/in_pcb_var.h @@ -50,7 +50,7 @@ int inp_trylock(struct inpcb *inp, const inp_lookup_t lock); bool inp_smr_lock(struct inpcb *, const inp_lookup_t); int in_pcb_lport(struct inpcb *, struct in_addr *, u_short *, struct ucred *, int); -int in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, +int in_pcb_lport_dest(const struct inpcb *inp, struct sockaddr *lsa, u_short *lportp, struct sockaddr *fsa, u_short fport, struct ucred *cred, int lookupflags); struct inpcb *in_pcblookup_local(struct inpcbinfo *, struct in_addr, u_short, From nobody Mon Feb 17 23:31:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6c2tG2z5nbh9; Mon, 17 Feb 2025 23:31: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 4Yxf6b1hdYz420m; Mon, 17 Feb 2025 23:31:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvXUAAQ40aCV8SX/YLIufGWhu0qzX5gTJVED2tEI+Fo=; b=J7RkucT80ImDgp2b8qjzZxoh44UeEmjs6EJ2X4pHUolP7DzQvoauWb9Fe6DT9O67yEVk9J +XK0pOpqTcHLKjy79yUzag88tmPVXQ8JAmDVQssTVBrzPkFYcfpBZlwnbRnDr7kkZkV8bx bOQi9MofPPaRXN2wSzQ0y+fsMdVl/7fgVsv+tydg019M9pYIuVr9EoUtsBKDG9bTx8B1rR h6TxujC0B6H+kiADCDOL9Gggr+fPTlAzhGGvpzsoppFEiMKnUj0EtTuOJRgD/Yf+xoEmnv lUGTXe+arg30eGyxEkubTD1GOYHLW0iz7TbIbtdleH5YDoA+K2puLBz/nt9VEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835063; a=rsa-sha256; cv=none; b=hCCIUrjgj2FhR1t63Y/kbwrDJ+9qf8z4BzQ74PxxKgs2zaAE4qZLpaha1r1YOXMoEF4XNU r/h3A6MTPH4OjkhN5uihJhZmr4VS8SEV+IGn5iNp3xm3kiNOTF0DMUR9gVSdV2MDK1DVAg OZZSuUFDuqx96POsbr/vxjMvK9KbdRjkF7V59mPvrjAJ7in4vDB+va+uNnkEA58xhqNcXg IXSuV2iVChgREJXn7byOJY+n1Sh4lTSTwBkpBMkoWz93pFV9k32fk/sMQr/nmUWy5111l+ 9dIlFkSEMkOC4fKvhhtlQznp54vSSUT3FPSMy8mauHLiPUUMTUfNq6it94ACJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HvXUAAQ40aCV8SX/YLIufGWhu0qzX5gTJVED2tEI+Fo=; b=eLoHkHYZbiCQ/nePbOgqPmcFn2np5De5Dn5yVQkoMLUmD9FaOXZ0ZMBDaUHz+8g2St691k aAb6odJuaZHZdlALGfJSfxVosTPL+TUZuJ8q3vhAB2njlAg/6QxITX4EReXRFWNLwRuZ9d fK/Y4bFwNP4kWlItHKYGQyxZy8Nj/pSCoFjIQLF1Gxb1LrSLvYTW4ZXofBbdHLVyAC5duA pgBvPwBcuSWMAOvIf3xwDnjgYgWtFP4W/RxwFsxvlMZeOeiU4P3R+2eybbvezhNPOkcsOz z3119mWIu2e5qkDHPGNeCwHiQvYGYOsIh7CnQA+BK7y5CnVEAAKsblmAbdWr3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6b0yTTztpN; Mon, 17 Feb 2025 23:31: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 51HNV3Z0067173; Mon, 17 Feb 2025 23:31:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV30h067170; Mon, 17 Feb 2025 23:31:03 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:03 GMT Message-Id: <202502172331.51HNV30h067170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 24e5c2ee2a18 - main - inpcb: update inpcb multipath routing information only on success List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 24e5c2ee2a185bb0e6e69c0e55341eed5d23c141 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=24e5c2ee2a185bb0e6e69c0e55341eed5d23c141 commit 24e5c2ee2a185bb0e6e69c0e55341eed5d23c141 Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:52 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:52 +0000 inpcb: update inpcb multipath routing information only on success The in_pcbconnect_setup() function is not supposed to modify inpcb. It may be entered with read-only lock via UDP path. Also at this point we aren't yet sure that the binding is going to be successful. Thus, update the multipath routing information only at the end of a succesful in_pcbconnect(). Fixes: 0c325f53f16731f608919a4489f96fbbe28d2344 --- sys/netinet/in_pcb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 18f92cdffc53..c34b4594c9b9 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1121,7 +1121,18 @@ in_pcbconnect(struct inpcb *inp, struct sockaddr_in *sin, struct ucred *cred) else in_pcbinshash(inp); } +#ifdef ROUTE_MPATH + if (CALC_FLOWID_OUTBOUND) { + uint32_t hash_val, hash_type; + + hash_val = fib4_calc_software_hash(inp->inp_laddr, + inp->inp_faddr, 0, fport, + inp->inp_socket->so_proto->pr_protocol, &hash_type); + inp->inp_flowid = hash_val; + inp->inp_flowtype = hash_type; + } +#endif if (anonport) inp->inp_flags |= INP_ANONPORT; return (0); @@ -1377,17 +1388,6 @@ in_pcbconnect_setup(struct inpcb *inp, struct sockaddr_in *sin, lport = *lportp; faddr = sin->sin_addr; fport = sin->sin_port; -#ifdef ROUTE_MPATH - if (CALC_FLOWID_OUTBOUND) { - uint32_t hash_val, hash_type; - - hash_val = fib4_calc_software_hash(laddr, faddr, 0, fport, - inp->inp_socket->so_proto->pr_protocol, &hash_type); - - inp->inp_flowid = hash_val; - inp->inp_flowtype = hash_type; - } -#endif if (V_connect_inaddr_wild && !CK_STAILQ_EMPTY(&V_in_ifaddrhead)) { /* * If the destination address is INADDR_ANY, From nobody Mon Feb 17 23:31:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6g0sMZz5nbp9; Mon, 17 Feb 2025 23:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yxf6f4tZjz41sy; Mon, 17 Feb 2025 23:31:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g66w6uCF38Vj812YzkHREwS1HWOGL5cIio8DC9puOKg=; b=YMsrssXiQdlMJfDbmthPoUk4XGMxsGyZPzTGleHMd8kXL67uCVMSm51Q5yafH/QZUpEu9n WZnKh2Ig4NNFiUMtgZRd4DYGolAkxPhOrF5P0wMnmigFshGIBKjbCEjpZGWhZd8zyfs9n1 8wPVfntvWuDpBJKxb+ioHyx1ggGR5OtGKWRXLZWmHG0bBctvoEkhyPxd7h6C3bBmENvUjk Z3zpGWQLLhqeNfnnCd8/H+LAFCsneQz/zUefBxZlw7IOSix1vLWVTSTIZEs75cpP9wkTkO +GsiWySpsbJom50aRGzemdZLIk9iF1jUJ+AUPjkkEJIdZgV7lu63VSMIN1xfTg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835066; a=rsa-sha256; cv=none; b=nzdjk9RD9wrvXJPlTEM0cMRwedgE4SqkbZk2+8ahCAvOC+ie5010kUOwu6VRFAUo0UGwiJ nRoPgGO7DQVHUYYKu0V2Zl9Np50L5N5hWglB3ltdtyxkPcW1bHHfEH8E9aFL9THiLxP3Tu ci1P4sR0VtkCSmP97ui2oEPXLse2Bl7e0BmLkxVYkzc/Lqsq5TLnmOcgbBxvhhirfwjvoN yYoA8HcVmAKOvNwQYpz+fWENcu0PFh3H2GAuujNZ+nlUYD2g8A8CmlGWAZxzDT9weVs3eA UCChoadC1CpuyyZCjXKGm5KZDQDSg477EJD0JNfe9yhmFvKtqjHeLRxdZuDv5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g66w6uCF38Vj812YzkHREwS1HWOGL5cIio8DC9puOKg=; b=rhmLHbWeOq638zCE2EyoEuqxJwt44VzuySS0ebtbDPiPO5aaRohp3CJMpTvrqKB21hUr18 PTHLCQZhfLvUutcF+liBkIvjeHMA69u5Kd838ldlRY7y0eO9A6/hxkwx9ZMA4zHeNKdbkO hIJ5JZGP9jxUT83ct7fJWetf1JpkRjEHfi2r9XJXQms7wWAmWEEcKe8SMwrxzJ1lHdbrWs l/7yPK/8pqms0qpbWm56LdnpH85Y+KnELSvdsCffhdlBTpEb735b8w/0+t9kmxkl8UKeBA N7cRWrJRbAZ+AghBgHOZlClQ4RpKoL7oGmeoRkjoRe2lES8FXCbVaEJfOQOzbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6f3cBFzvJH; Mon, 17 Feb 2025 23:31: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 51HNV6TM067285; Mon, 17 Feb 2025 23:31:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV6Ue067282; Mon, 17 Feb 2025 23:31:06 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:06 GMT Message-Id: <202502172331.51HNV6Ue067282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 8f1d5cf5b56a - main - ip_output: use bool for isbroadcast List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f1d5cf5b56a83d3fd39e1feaa88b8f913b13c9e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=8f1d5cf5b56a83d3fd39e1feaa88b8f913b13c9e commit 8f1d5cf5b56a83d3fd39e1feaa88b8f913b13c9e Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:52 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:52 +0000 ip_output: use bool for isbroadcast --- sys/netinet/ip_output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index a83400e90c35..1811becbf387 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -329,7 +329,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, const struct sockaddr *gw; struct in_ifaddr *ia = NULL; struct in_addr src; - int isbroadcast; + bool isbroadcast; uint16_t ip_len, ip_off; struct route iproute; uint32_t fibnum; @@ -434,7 +434,7 @@ again: ifp = ia->ia_ifp; mtu = ifp->if_mtu; ip->ip_ttl = 1; - isbroadcast = 1; + isbroadcast = true; src = IA_SIN(ia)->sin_addr; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst), @@ -460,7 +460,7 @@ again: ifp = imo->imo_multicast_ifp; mtu = ifp->if_mtu; IFP_TO_IA(ifp, ia); - isbroadcast = 0; /* fool gcc */ + isbroadcast = false; /* Interface may have no addresses. */ if (ia != NULL) src = IA_SIN(ia)->sin_addr; @@ -505,7 +505,7 @@ again: else if ((ifp->if_flags & IFF_BROADCAST) && (gw->sa_family == AF_INET)) isbroadcast = in_ifaddr_broadcast(((const struct sockaddr_in *)gw)->sin_addr, ia); else - isbroadcast = 0; + isbroadcast = false; mtu = nh->nh_mtu; src = IA_SIN(ia)->sin_addr; } else { From nobody Mon Feb 17 23:31:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6f04ktz5nbrp; Mon, 17 Feb 2025 23:31: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 4Yxf6d3scbz423H; Mon, 17 Feb 2025 23:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Peubqchxjhk+U/B5CCNX/NOZMLNwxm41pAbVqwwlNc=; b=gNm9XCgq/8HP1a3kwEFA3oWNTxsMAHDn+dd1J2ySllMk3OfDQhxgbIBooOMqKtyC+cy3vp o/DhXuJGRgFE5pxmcQP95k8Yv11jUathlCC6T0jlmSIDY+D076zIk2qK2OBfEtJvjHg2JE rPs2F/LtFgg5EBbfPY/HdE2N3a63K6foB1NBrqR6k3KHFyWKdBZ3G9RyZSRnsm9tAMezWs jZ6bzgsFXTJpJFaHqmOSKibdNC9zlMXYeKIqRA4axTw1NkqJaFaA1lbMcfP8FTLF+RY5Jt Fn5YV5lO/Nt90Nw2tjwN1r0O2BE0EsryXA2/Vl/Et4Lp2IETnAJS9Ymz82MBIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835065; a=rsa-sha256; cv=none; b=iOZZFrDZYpKbQDdxH8aYECjJEWmpq0inGAtju8sC76b7P0h7lvASeP6f8HTIhGE3X+Xuv9 4qCd+8AlSa69GIACb26DuzFsYrQqh4VfrV1+iEdFs4+64Lwj1E+BrrGQKH86LjhZ+99LJM NvaUv5bGkg+S4X0lQlPptX6zF3IKUL1ICpvrPXcRkA67DiPhOI5VeKZI7LAED0UKO3OryW gzDLJgLPZDz68P75F4FdR13kX8W6w7skRC8jFKvQa+aIC4MR1F2qTHbYZ7cDgDC07t0bqe JLZ7sR9yjFxA76EWf9WHUbLbrxfYR/TjCIQdCsChOHNuTMJkJL894oXWMix1lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Peubqchxjhk+U/B5CCNX/NOZMLNwxm41pAbVqwwlNc=; b=ZWKA5OP+UbXedZA985HoIiKpwlF8Ww0SmR+fI1j0iR307tvPGp8LLrIx27sAS4D1RTM6U5 xE2Z9D1OPtz+3sn3Gq6JBJbCyKpzZmcmYdZauDBnuSYFjHKxaE8VWVq8p/z52QnvYC5KSs RxzcwqRvJC6bfyyQ9LkMRx9KtOcIcLo/sdRgswP+trhQzcLIWORqffDO9Cuk8VMt25rOcs ae94xRuNOfUOKM3x1FoIo+7Nbcek1PUh+5mgue3I7mcmoMy5g58z7g8bqq7mg+HcK1n56Q UkngeFjwAZItpjGS2ctPYbqnZUN2VSieE87EklmqGquTBTDyv2t3rUq+Yede6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6d31d8zvSq; Mon, 17 Feb 2025 23:31: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 51HNV5mU067243; Mon, 17 Feb 2025 23:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV5OK067240; Mon, 17 Feb 2025 23:31:05 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:05 GMT Message-Id: <202502172331.51HNV5OK067240@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: e71fff28550b - main - tools/ipbroadcast: make it compilable with modern compiler List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e71fff28550bb0256851835b271acfac4bae59f1 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=e71fff28550bb0256851835b271acfac4bae59f1 commit e71fff28550bb0256851835b271acfac4bae59f1 Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:52 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:52 +0000 tools/ipbroadcast: make it compilable with modern compiler --- tools/regression/netinet/ipbroadcast/ipbroadcast.c | 29 +++++++--------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/tools/regression/netinet/ipbroadcast/ipbroadcast.c b/tools/regression/netinet/ipbroadcast/ipbroadcast.c index 6177ce964749..9315ebe2b6ad 100644 --- a/tools/regression/netinet/ipbroadcast/ipbroadcast.c +++ b/tools/regression/netinet/ipbroadcast/ipbroadcast.c @@ -91,9 +91,6 @@ usage(void) fprintf(stderr, "-p: Set local and remote port (default: %d)\n", DEFAULT_PORT); fprintf(stderr, "-R: Use raw IP (protocol %d)\n", IPPROTO_ZEROHOP); -#if 0 - fprintf(stderr, "-r: Fill datagram with random bytes\n"); -#endif fprintf(stderr, "-s: Set IP_SENDSRCADDR to \n"); fprintf(stderr, "-t: Set IP_TTL to \n"); @@ -109,10 +106,8 @@ main(int argc, char *argv[]) struct msghdr msg; struct sockaddr_in dsin; struct sockaddr_in laddr; - struct sockaddr_dl *sdl; struct cmsghdr *cmsgp; struct in_addr dstaddr; - struct in_addr *srcaddrp; char *ifname; char *laddr_s; char *srcaddr_s; @@ -121,7 +116,6 @@ main(int argc, char *argv[]) int dobroadcast; int dontroute; int doonesbcast; - int dorandom; int dorawip; size_t buflen; ssize_t nbytes; @@ -136,7 +130,6 @@ main(int argc, char *argv[]) dobroadcast = 0; dontroute = 0; doonesbcast = 0; - dorandom = 0; dorawip = 0; ifname = NULL; @@ -150,7 +143,7 @@ main(int argc, char *argv[]) buflen = DEFAULT_PAYLOAD_SIZE; progname = basename(argv[0]); - while ((ch = getopt(argc, argv, "1A:bBdi:l:p:Rrs:t:")) != -1) { + while ((ch = getopt(argc, argv, "1A:bBdi:l:p:Rs:t:")) != -1) { switch (ch) { case '1': doonesbcast = 1; @@ -179,9 +172,6 @@ main(int argc, char *argv[]) case 'R': dorawip = 1; break; - case 'r': - dorandom = 1; - break; case 's': srcaddr_s = optarg; break; @@ -311,8 +301,9 @@ main(int argc, char *argv[]) cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); cmsgp->cmsg_level = IPPROTO_IP; cmsgp->cmsg_type = IP_SENDSRCADDR; - srcaddrp = (struct in_addr *)CMSG_DATA(cmsgp); - srcaddrp->s_addr = inet_addr(srcaddr_s); + memcpy(CMSG_DATA(cmsgp), + &(struct in_addr){ inet_addr(srcaddr_s) }, + sizeof(struct in_addr)); } if (ifname != NULL) { @@ -327,13 +318,11 @@ main(int argc, char *argv[]) fprintf(stderr, "DEBUG: cmsgp->cmsg_len is %d\n", cmsgp->cmsg_len); #endif - - sdl = (struct sockaddr_dl *)CMSG_DATA(cmsgp); - memset(sdl, 0, sizeof(struct sockaddr_dl)); - sdl->sdl_family = AF_LINK; - sdl->sdl_len = sizeof(struct sockaddr_dl); - sdl->sdl_index = if_nametoindex(ifname); - + memcpy(CMSG_DATA(cmsgp), &(struct sockaddr_dl){ + .sdl_family = AF_LINK, + .sdl_len = sizeof(struct sockaddr_dl), + .sdl_index = if_nametoindex(ifname) }, + sizeof(struct sockaddr_dl)); #ifdef DIAGNOSTIC fprintf(stderr, "DEBUG: sdl->sdl_family is %d\n", sdl->sdl_family); From nobody Mon Feb 17 23:31:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxf6h75FSz5nbhL; Mon, 17 Feb 2025 23:31:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yxf6g4sFrz41y7; Mon, 17 Feb 2025 23:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wk7Bi0OHoapgXx5mz7fGn7ybY/8o9MTcB/1TXq9z7Y4=; b=s5B+fsV93RiKAM10HLq9NX6i2N6Pn8+L2LrOzglaAg5/jC8SDoUp1q4RZlJsRSZD2cJIHg PHmBACszhkGmgmJvnzmVcHeKTQqk1nKiM6kxVKu4iOgQVlKCTArguNgStyeg8VpPy2YzEO SgnsZcjsxpUcSFZ0542UyWjxZX52JzhuqSLZfj7qzRHTlhnHNmkidd/Clt1cnyowqmIGpT RXM0itGD9nZQrEvyFViDEsPdgbrOsj6aKfL1LBKN4HyXEqkjeXYywPtVJbGuUOr0Q1NArK 5PUGgAKUu5r0KGRC6/0IgY3GrrFtr9exBkTZBkj5Q9GxlkQ1hlZzJzzWvEiGPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835067; a=rsa-sha256; cv=none; b=JJAXlcA3ayX5dDanG1NAnavVRgMom7mpA74NreIjkK0Lz6CKZSco8fmWLKySZZurrVS9hD AYhVjoKg7bMD7nIdYlZxeEkg3e6aQ3S+NCslJzU6S7pkm0oHutVcfPU4+9T5bekTZa3PCs gka+TKIQ3iHFMLZV6l38jMWOVJJFaA9vB8lPtm5q/mF/wBoQyjSms1wqr/ZEJ7H6Ju8SYN G8BFu9NNRxdzt4Igq5NCF2B87chTO0l/omwxktLNU/4seVrYr+x1ju6VfNxgVHDFGyst7i xk1117f+K/EO6/H+XaqLE2dHY4/WKrIewKBe9KqBuVu8bfODeoqzvtqf8RbbTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wk7Bi0OHoapgXx5mz7fGn7ybY/8o9MTcB/1TXq9z7Y4=; b=BslOH8v9ccs9+uO/Jb1RZU3Iy23cmAIFYsPKrv+KNBiFM5mnrzcv61Uh3VHHdqJz1Z2Io3 5M438nooSUJ8kdneYIrsrdAfQ7VHjhCbeKbQK+4DR3TgzeA+Z6UVlUxdIznV3/Xme1WDGP NrxBtuOtgvwF+aIt+OoO2Tjos5rxOpY/OJkaEOkVHdqgAanilCV7FXHGa13IdlGg72Ww9v BMpK2hp55t8G00cYKYDfLtzAeDHQzR4AE6b9nFYV41xAC4s63LhHX611L9Em7O8O6NqGTN 97cOwWxuQ1E/G+PjiR8BcttJGBUVIOMe9YtYJ48gVaMDAk8sOsdUZBtwyZRFoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxf6g4JKhzv8X; Mon, 17 Feb 2025 23:31:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51HNV7BH067320; Mon, 17 Feb 2025 23:31:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNV7Np067317; Mon, 17 Feb 2025 23:31:07 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:31:07 GMT Message-Id: <202502172331.51HNV7Np067317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: dc9db1f6b331 - main - netinet: make in_broadcast() and in_ifaddr_broadcast return bool List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc9db1f6b33168c0d02dd1b95f18086d3ec7a7ec Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=dc9db1f6b33168c0d02dd1b95f18086d3ec7a7ec commit dc9db1f6b33168c0d02dd1b95f18086d3ec7a7ec Author: Gleb Smirnoff AuthorDate: 2025-02-17 23:28:52 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-17 23:28:52 +0000 netinet: make in_broadcast() and in_ifaddr_broadcast return bool While here annotate deprecated condition with __predict_false() and slightly refactor in_broadcast() removing leftovers from old address list locking. Should be no functional change. --- sys/netinet/in.c | 26 +++++++++++--------------- sys/netinet/in.h | 4 ++-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 28d3e2093c61..0cf148c38575 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1269,7 +1269,7 @@ in_ifscrub_all(void) IFNET_RUNLOCK(); } -int +bool in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) { @@ -1278,7 +1278,8 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) * Optionally check for old-style (host 0) broadcast, but * taking into account that RFC 3021 obsoletes it. */ - (V_broadcast_lowest && ia->ia_subnetmask != IN_RFC3021_MASK && + __predict_false(V_broadcast_lowest && + ia->ia_subnetmask != IN_RFC3021_MASK && ntohl(in.s_addr) == ia->ia_subnet)) && /* * Check for an all one subnetmask. These @@ -1289,33 +1290,28 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) } /* - * Return 1 if the address might be a local broadcast address. + * Return true if the address might be a local broadcast address. */ -int +bool in_broadcast(struct in_addr in, struct ifnet *ifp) { struct ifaddr *ifa; - int found; NET_EPOCH_ASSERT(); - if (in.s_addr == INADDR_BROADCAST || - in.s_addr == INADDR_ANY) - return (1); + if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) + return (true); if ((ifp->if_flags & IFF_BROADCAST) == 0) - return (0); - found = 0; + return (false); /* * Look through the list of addresses for a match * with a broadcast address. */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && - in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) { - found = 1; - break; - } - return (found); + in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) + return (true); + return (false); } /* diff --git a/sys/netinet/in.h b/sys/netinet/in.h index f4fc41178399..e03fe3391388 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -672,8 +672,8 @@ int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, struct ifnet; struct mbuf; /* forward declarations for Standard C */ struct in_ifaddr; -int in_broadcast(struct in_addr, struct ifnet *); -int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); +bool in_broadcast(struct in_addr, struct ifnet *); +bool in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); bool in_localip(struct in_addr); From nobody Mon Feb 17 23:42:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YxfMn1LBQz5ncYN; Mon, 17 Feb 2025 23:42: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 4YxfMn0v9Mz3CgC; Mon, 17 Feb 2025 23:42:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMQqafUlLVOWuV4eMSbazygx9Z1zfqgeVRGw8DpjPAs=; b=vqRjKMKoggK5PzOMvx7JEF27ayqdzU62dkuBwIVRghOmvP2fWA26aqw26MXCXSk+4Nae1k t58h1CbLknGEvrYThXcGpSxGjFgpCQUmuW1kJLAzWuzIa4dcM1b6xJry6JHvI+1IxCjuLL NaFv6eE3URvAKw1s8YIGhO43sM0l2vAnZA24VCnX242IPgPyyCc9wbn/HUxNjFol9euQgc NrEpACspCwn/5zw5u9WGE/NYzqce5S6Wj7zS7ONDLD8L49Mn+71/vffG/3OQI0Yrg5w5O7 fQdmLkp7O7GgYZdN6XrbNzBbI9JE6GPRfk3Htalp6a5RlB4YUQNOT+OmRZk8qA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739835749; a=rsa-sha256; cv=none; b=VNg8olhILO3Fe+2Ad2rcfbPC0KTEVR6CG7M/QZZJGkfWAHcGjhEVp1nu5OPLUyuSzZ92Dl zCKOq0ZmdXihHggemNcL3m2fhiQ/4ChsuGnHRYtkOvotkLXljXLbbkuclKOnpvJElFVi1Z MWqfK/zdo3dZMTXCVL8SobyLIl2NR5McPtNHRM1ueXjBvDZADrHpE8gKjshTukDXaIC2Sq 0HbTxQ7sQfEZ6rkeka5xXi98kehKWYcEbGAaHnqixtJPJsw7TsqSI92/0Bhn+3rHBiDw2e 1jvVot+yaYzcTeULqnVFI5bpFdFn4d3BGmxnuF/cgm4bbf4CHZh85wUvo8O8uQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739835749; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NMQqafUlLVOWuV4eMSbazygx9Z1zfqgeVRGw8DpjPAs=; b=l0CJld3nNgL6/+Uzlc6/w2tpp02IdddPlL5QwSLB97/naDUvpiyYL15j9LlYKH0tYSdrUn +0ynmp9UGAVFlHenPVZlANx5sBQhTH1aRrakqr9ImnVF18veW4flZG7TKKKbywLBEg51RL 7chp8w92MsqVTr3CJ8t+fSUYXYxYauafEw+I1NyTexoCIlMWn0p7fB/UDmEmLx/raQFfV9 WzKOX2mr93gBEiKYKkdn/I0We04WNUERSQTMgZD3KyP1k578jfdVTrU0/NKz1yTwKzWgHm IzdawLIl0Dy8RW+GFYT2ji6LkX5x7rt3f6dtX5/e/Mx7vj4y0+9MN38c7Owq6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YxfMn0GGRzvTt; Mon, 17 Feb 2025 23:42: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 51HNgSR1091809; Mon, 17 Feb 2025 23:42:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51HNgSgd091806; Mon, 17 Feb 2025 23:42:28 GMT (envelope-from git) Date: Mon, 17 Feb 2025 23:42:28 GMT Message-Id: <202502172342.51HNgSgd091806@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 7e26f1c21049 - main - nfscl: Move layout high water variables into clientID List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e26f1c21049b5a1a2f490d8ac1909ccb24f0db2 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=7e26f1c21049b5a1a2f490d8ac1909ccb24f0db2 commit 7e26f1c21049b5a1a2f490d8ac1909ccb24f0db2 Author: Rick Macklem AuthorDate: 2025-02-17 23:41:34 +0000 Commit: Rick Macklem CommitDate: 2025-02-17 23:41:34 +0000 nfscl: Move layout high water variables into clientID Commit f5aff1871d32 moved the delegation high water variables into the clientID structure, so that they are now per mount instead of global. This patch does the same for the layout highwater variables. It happens that the layout highwater variables are not actually used. This patch changes the code to use them. This is needed to add support for the CB_RECALL_ANY callback in a future commit. This patch only affects NFSv4.1/4.2 mounts with the "pnfs" mount option. The effect on these mounts will be minimal, since layouts are returned when they are stale and this normally ensures that the highwater mark is never hit. MFC after: 2 weeks --- sys/fs/nfs/nfsclstate.h | 2 ++ sys/fs/nfsclient/nfs_clstate.c | 12 +++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index 84088a2a4fd2..92669ff8d1aa 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -118,6 +118,8 @@ struct nfsclclient { time_t nfsc_expire; int nfsc_delegcnt; int nfsc_deleghighwater; + int nfsc_layoutcnt; + int nfsc_layouthighwater; u_int32_t nfsc_clientidrev; u_int32_t nfsc_rev; u_int32_t nfsc_renew; diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 86b51a7b3343..7e5baa453ad0 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -94,7 +94,6 @@ NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, u_int8_t *, int, u_int8_t *, u_int8_t *, u_int32_t, struct nfscllockowner **, struct nfsclopen **); @@ -919,6 +918,8 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, clp->nfsc_flags = NFSCLFLAGS_INITED; clp->nfsc_delegcnt = 0; clp->nfsc_deleghighwater = NFSCLDELEGHIGHWATER; + clp->nfsc_layoutcnt = 0; + clp->nfsc_layouthighwater = NFSCLLAYOUTHIGHWATER; clp->nfsc_clientidrev = 1; clp->nfsc_cbident = nfscl_nextcbident(); nfscl_fillclid(nmp->nm_clval, uuid, clp->nfsc_id, @@ -2978,13 +2979,14 @@ tryagain2: lyp = TAILQ_LAST(&clp->nfsc_layout, nfscllayouthead); while (lyp != NULL) { nlyp = TAILQ_PREV(lyp, nfscllayouthead, nfsly_list); - if (lyp->nfsly_timestamp < NFSD_MONOSEC && + if ((lyp->nfsly_timestamp < NFSD_MONOSEC || + clp->nfsc_layoutcnt > clp->nfsc_layouthighwater) && (lyp->nfsly_flags & (NFSLY_RECALL | NFSLY_RETONCLOSE)) == 0 && lyp->nfsly_lock.nfslock_usecnt == 0 && lyp->nfsly_lock.nfslock_lock == 0) { NFSCL_DEBUG(4, "ret stale lay=%d\n", - nfscl_layoutcnt); + clp->nfsc_layoutcnt); recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_NOWAIT); if (recallp == NULL) @@ -5286,7 +5288,7 @@ nfscl_layout(struct nfsmount *nmp, vnode_t vp, u_int8_t *fhp, int fhlen, LIST_INSERT_HEAD(NFSCLLAYOUTHASH(clp, fhp, fhlen), lyp, nfsly_hash); lyp->nfsly_timestamp = NFSD_MONOSEC + 120; - nfscl_layoutcnt++; + clp->nfsc_layoutcnt++; nfsstatsv1.cllayouts++; } else { if (retonclose != 0) @@ -5661,7 +5663,7 @@ nfscl_freelayout(struct nfscllayout *layp) LIST_REMOVE(rp, nfsrecly_list); free(rp, M_NFSLAYRECALL); } - nfscl_layoutcnt--; + layp->nfsly_clp->nfsc_layoutcnt--; nfsstatsv1.cllayouts--; free(layp, M_NFSLAYOUT); } From nobody Tue Feb 18 02:55:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yxkff1dKjz5nrwT; Tue, 18 Feb 2025 02:55: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 4Yxkfd1NQZz3FMR; Tue, 18 Feb 2025 02:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739847338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3zBUoNeyJ+CObjiRN91ubJgzbQzUZqLVQi0I5j5Ucbs=; b=l5ohWliLs5QA4wfZBLkOVFUgI9T7Ooz1xj69oVpOuLFsayijMEBfQuKsFi+jXoKsuCq8of thDEIdelbdlQTNuVLk+R0u645gEHwrB68BgphA5q8Jf3ACAkH8FCCiPYS3GrHY8hNKU3zv hjZ4SXM7G0sFn0FZRpfVite0BDfQiD4Phsl2oF/SADg+FM3/ezGUl3M2l6g0IVbKVSaYaF 2bDGNRKcwx8yZHdwxYUihdXCsmpnHSe0BRuk6m6QwABYU8jxgTVizq7EkkrHnnRmk8PuZL ZDO+3VEyaaAU0Ut8q8j6M9wxNhoxOEUpv/hCGCrsntSaWymKQesPEpqX0E1j1A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739847337; a=rsa-sha256; cv=none; b=dO4bvnLunnVRxD1aLUwDuhbJaczZEtJPWP3Y/ROt5/Lv9ieMJfJjaBWqkiZHhV5mxd2AFe NAzIilaTv2FlYXmARMJwSGrSRuQLwXTwjshEgcOU0GvwckITM5wznU9jeBMSVQXlYFsWPP OWJ+Cjc2HDK2sr+I1DEBOPbMdyHr6oltPGc27SM9e90Qen7IUhLkl+qF77qP5dch2CFZDG q5VsYxLd75di3jpr3Ab8RQkq2OKeboFKYf0ulbTMY+aPO9O1he7kfQn2G0qBWSlv7MKF5W WcQlVE8O+bY052F0QXBVUFiTFwcf+uyTkxENH2BKz+blYWobz/UXMAipDC2KOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739847337; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3zBUoNeyJ+CObjiRN91ubJgzbQzUZqLVQi0I5j5Ucbs=; b=NvoStGWhOpt3G9zzQVNC2JbL7QXFSnPhhmfuGZHM3o8RRDfWoXwQ0M8p1jymcaejDZFYeZ s9bqCPt6wYMlmv4GcWmE0AxER+wPz0gC0+YSw0mw7ccfScTw+5pRNOZKLMXwfUEA4ggfhE 8xqfBlB6830bvdkcy8Gzy6jRVsh3Qtpzx8gMaSbsGzGyvcu4gX3EPbR4Gsx2IXwT2wd7Rg q3ADLACZeBMmp5UMU9p//TYsZ97V7JUySxK2YKkyNeOPoOqd5g2GRlfdyz2kUHPcejyCPH sah04yQOFZBWDXb4L0mEVYk+0mUiHlPfElIFafSzjKRmpu2P94Jri+65iJ+2JA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yxkfd0blWz115V; Tue, 18 Feb 2025 02:55: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 51I2tabF049358; Tue, 18 Feb 2025 02:55:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51I2tau8049355; Tue, 18 Feb 2025 02:55:36 GMT (envelope-from git) Date: Tue, 18 Feb 2025 02:55:36 GMT Message-Id: <202502180255.51I2tau8049355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 11db70b6057e - main - LinuxKPI: 802.11: hardware crypto offload improvements List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11db70b6057e41b259dc2245cd893d5b19179fcc Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=11db70b6057e41b259dc2245cd893d5b19179fcc commit 11db70b6057e41b259dc2245cd893d5b19179fcc Author: Bjoern A. Zeeb AuthorDate: 2024-01-27 22:39:48 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-18 02:54:33 +0000 LinuxKPI: 802.11: hardware crypto offload improvements Implement mac80211 functions ieee80211_iter_keys[_rcu](), and ieee80211_get_key_rx_seq() (*). Implement an internal function lkpi_sta_del_keys() to delete keys when we are leaving RUN (AUTHORIZED) state. Improve and make work (*) the net80211 vap function pointers (*iv_key_set)(), (*iv_key_delete)() implementations. Correct the logic in lkpi_80211_txq_tx_one() and factor most crypto related bits out into lkpi_hw_crypto_prepare() (*). (*) We are currently supporting CCMP only. I would hope we will not have to do full WEP/TKIP support anymore given both are deprecated. The entire logic remains behind the LKPI_80211_HW_CRYPTO pre-processor condition and with this commit in addition behind a tunable. The code is compiled in by default now but the tunable remains off until wider testing has shown no problems. I have seen one net80211 triggered panic on shutdown related to deleting keys which I cannot reproduce anymore and could have been fixed by 9763fec11b83; otherwise we will have to investigate as it shows again. The dedicated hw crypto tracing option can help in that case with debug kernels. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: b35f6cd06612 --- sys/compat/linuxkpi/common/include/net/mac80211.h | 81 ++-- sys/compat/linuxkpi/common/src/linux_80211.c | 491 ++++++++++++++++++--- sys/compat/linuxkpi/common/src/linux_80211.h | 3 +- .../linuxkpi/common/src/linux_80211_macops.c | 2 + 4 files changed, 489 insertions(+), 88 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 8d6d690b2f57..69956c90042c 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -555,6 +555,9 @@ enum ieee802111_key_flag { }; struct ieee80211_key_conf { +#if defined(__FreeBSD__) + const struct ieee80211_key *_k; /* backpointer to net80211 */ +#endif atomic64_t tx_pn; uint32_t cipher; uint8_t icv_len; /* __unused nowadays? */ @@ -1154,7 +1157,7 @@ void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *, struct ieee80211_vif *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *); + void *, bool); void linuxkpi_ieee80211_iterate_chan_contexts(struct ieee80211_hw *, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_chanctx_conf *, void *), @@ -1520,25 +1523,22 @@ ieee80211_iterate_interfaces(struct ieee80211_hw *hw, linuxkpi_ieee80211_iterate_interfaces(hw, flags, iterfunc, arg); } -static __inline void +static inline void ieee80211_iter_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, false); } -static __inline void +static inline void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), void *arg) { - - IMPROVE(); /* "rcu" */ - linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg); + linuxkpi_ieee80211_iterate_keys(hw, vif, iterfunc, arg, true); } static __inline void @@ -2094,33 +2094,6 @@ ieee80211_sta_set_buffered(struct ieee80211_sta *sta, uint8_t tid, bool t) TODO(); } -static __inline void -ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, uint8_t tid, - struct ieee80211_key_seq *seq) -{ - - KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", - __func__, keyconf, seq)); - - TODO(); - switch (keyconf->cipher) { - case WLAN_CIPHER_SUITE_CCMP: - case WLAN_CIPHER_SUITE_CCMP_256: - memset(seq->ccmp.pn, 0xfa, sizeof(seq->ccmp.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_AES_CMAC: - memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ - break; - case WLAN_CIPHER_SUITE_TKIP: - seq->tkip.iv32 = 0xfa; /* XXX TODO */ - seq->tkip.iv16 = 0xfa; /* XXX TODO */ - break; - default: - pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); - break; - } -} - static __inline void ieee80211_sched_scan_results(struct ieee80211_hw *hw) { @@ -2466,6 +2439,44 @@ ieee80211_remove_key(struct ieee80211_key_conf *key) TODO(); } +static inline void +ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf, int8_t tid, + struct ieee80211_key_seq *seq) +{ + const struct ieee80211_key *k; + const uint8_t *p; + + KASSERT(keyconf != NULL && seq != NULL, ("%s: keyconf %p seq %p\n", + __func__, keyconf, seq)); + KASSERT(tid <= IEEE80211_NUM_TIDS, ("%s: tid out of bounds %d\n", + __func__, tid)); + k = keyconf->_k; + KASSERT(k != NULL, ("%s: keyconf %p ieee80211_key is NULL\n", __func__, keyconf)); + + switch (keyconf->cipher) { + case WLAN_CIPHER_SUITE_CCMP: + case WLAN_CIPHER_SUITE_CCMP_256: + if (tid < 0) + p = (const uint8_t *)&k->wk_keyrsc[IEEE80211_NUM_TIDS]; /* IEEE80211_NONQOS_TID */ + else + p = (const uint8_t *)&k->wk_keyrsc[tid]; + memcpy(seq->ccmp.pn, p, sizeof(seq->ccmp.pn)); + break; + case WLAN_CIPHER_SUITE_AES_CMAC: + TODO(); + memset(seq->aes_cmac.pn, 0xfa, sizeof(seq->aes_cmac.pn)); /* XXX TODO */ + break; + case WLAN_CIPHER_SUITE_TKIP: + TODO(); + seq->tkip.iv32 = 0xfa; /* XXX TODO */ + seq->tkip.iv16 = 0xfa; /* XXX TODO */ + break; + default: + pr_debug("%s: unsupported cipher suite %d\n", __func__, keyconf->cipher); + break; + } +} + static __inline void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *key, int tid, struct ieee80211_key_seq *seq) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 9ba0e2da99d6..36c6f92123ff 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -39,6 +39,12 @@ * We call the internal versions lxxx (e.g., hw -> lhw, sta -> lsta). */ +/* + * TODO: + * - lots :) + * - HW_CRYPTO: we need a "keystore" and an ordered list for suspend/resume. + */ + #include #include #include @@ -71,12 +77,16 @@ #include "linux_80211.h" #define LKPI_80211_WME -/* #define LKPI_80211_HW_CRYPTO */ -/* #define LKPI_80211_VHT */ +#define LKPI_80211_HW_CRYPTO /* #define LKPI_80211_HT */ +/* #define LKPI_80211_VHT */ + #if defined(LKPI_80211_VHT) && !defined(LKPI_80211_HT) #define LKPI_80211_HT #endif +#if defined(LKPI_80211_HT) && !defined(LKPI_80211_HW_CRYPTO) +#define LKPI_80211_HW_CRYPTO +#endif static MALLOC_DEFINE(M_LKPI80211, "lkpi80211", "LinuxKPI 80211 compat"); @@ -92,6 +102,12 @@ SYSCTL_DECL(_compat_linuxkpi); SYSCTL_NODE(_compat_linuxkpi, OID_AUTO, 80211, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "LinuxKPI 802.11 compatibility layer"); +#if defined(LKPI_80211_HW_CRYPTO) +static bool lkpi_hwcrypto = false; +SYSCTL_BOOL(_compat_linuxkpi_80211, OID_AUTO, hw_crypto, CTLFLAG_RDTUN, + &lkpi_hwcrypto, 0, "Enable LinuxKPI 802.11 hardware crypto offload"); +#endif + /* Keep public for as long as header files are using it too. */ int linuxkpi_debug_80211; @@ -438,7 +454,7 @@ lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, ieee80211_dump_node(NULL, ni); printf("\ttxq_task txq len %d mtx\n", mbufq_len(&lsta->txq)); printf("\tkc %p state %d added_to_drv %d in_mgd %d\n", - lsta->kc, lsta->state, lsta->added_to_drv, lsta->in_mgd); + &lsta->kc[0], lsta->state, lsta->added_to_drv, lsta->in_mgd); #endif } @@ -904,20 +920,173 @@ linuxkpi_ieee80211_get_channel(struct wiphy *wiphy, uint32_t freq) #ifdef LKPI_80211_HW_CRYPTO static int -_lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, - enum set_key_cmd cmd) +lkpi_sta_del_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct lkpi_sta *lsta) +{ + int error; + + if (!lkpi_hwcrypto) + return (0); + + lockdep_assert_wiphy(hw->wiphy); + ieee80211_ref_node(lsta->ni); + + error = 0; + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) { + struct ieee80211_key_conf *kc; + int err; + + if (lsta->kc[keyix] == NULL) + continue; + kc = lsta->kc[keyix]; + + err = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, + LSTA_TO_STA(lsta), kc); + if (err != 0) { + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D failed: %d\n", __func__, DISABLE_KEY, + "DISABLE", lsta->sta.addr, ":", err); + error++; + + /* + * If we free the key here we will never be able to get it + * removed from the driver/fw which will likely make us + * crash (firmware). + */ + continue; + } +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(lsta->ni->ni_ic, "%s: set_key cmd %d(%s) for " + "sta %6D succeeded: keyidx %u hw_key_idx %u flags %#10x\n", + __func__, DISABLE_KEY, "DISABLE", lsta->sta.addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + + lsta->kc[keyix] = NULL; + free(kc, M_LKPI80211); + } + ieee80211_free_node(lsta->ni); + return (error); +} + +static int +_lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct ieee80211com *ic; struct lkpi_hw *lhw; struct ieee80211_hw *hw; struct lkpi_vif *lvif; + struct lkpi_sta *lsta; struct ieee80211_vif *vif; struct ieee80211_sta *sta; struct ieee80211_node *ni; struct ieee80211_key_conf *kc; + struct ieee80211_node_table *nt; int error; + bool islocked; - /* XXX TODO Check (k->wk_flags & IEEE80211_KEY_SWENCRYPT) and don't upload to driver/hw? */ + ic = vap->iv_ic; + lhw = ic->ic_softc; + hw = LHW_TO_HW(lhw); + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + if (lsta->kc[k->wk_keyix] == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and no key information, " + "keyidx %u wk_macaddr %6D; returning success\n", + __func__, sta->addr, ":", + k->wk_keyix, k->wk_macaddr, ":"); +#endif + ieee80211_free_node(ni); + return (1); + } + + /* This is inconsistent net80211 locking to be fixed one day. */ + nt = &ic->ic_sta; + islocked = IEEE80211_NODE_IS_LOCKED(nt); + if (islocked) + IEEE80211_NODE_UNLOCK(nt); + + wiphy_lock(hw->wiphy); + kc = lsta->kc[k->wk_keyix]; + /* Re-check under lock. */ + if (kc == NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: sta %6D and key information vanished, " + "returning success\n", __func__, sta->addr, ":"); +#endif + error = 1; + goto out; + } + + error = lkpi_80211_mo_set_key(hw, DISABLE_KEY, vif, sta, kc); + if (error != 0) { + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, DISABLE_KEY, "DISABLE", sta->addr, ":", error); + error = 0; + goto out; + } + +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "keyidx %u hw_key_idx %u flags %#10x\n", __func__, + DISABLE_KEY, "DISABLE", sta->addr, ":", + kc->keyidx, kc->hw_key_idx, kc->flags); +#endif + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + error = 1; +out: + wiphy_unlock(hw->wiphy); + if (islocked) + IEEE80211_NODE_LOCK(nt); + ieee80211_free_node(ni); + return (error); +} + +static int +lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + + /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ + /* See also lkpi_sta_del_keys() these days. */ + return (_lkpi_iv_key_delete(vap, k)); +} + +static int +_lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + struct ieee80211com *ic; + struct lkpi_hw *lhw; + struct ieee80211_hw *hw; + struct lkpi_vif *lvif; + struct lkpi_sta *lsta; + struct ieee80211_vif *vif; + struct ieee80211_sta *sta; + struct ieee80211_node *ni; + struct ieee80211_key_conf *kc; + uint32_t lcipher; + int error; ic = vap->iv_ic; lhw = ic->ic_softc; @@ -925,10 +1094,50 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); - memset(&kc, 0, sizeof(kc)); - kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); - kc->cipher = lkpi_net80211_to_l80211_cipher_suite( + if (vap->iv_bss == NULL) { + ic_printf(ic, "%s: iv_bss %p for vap %p is NULL\n", + __func__, vap->iv_bss, vap); + return (0); + } + ni = ieee80211_ref_node(vap->iv_bss); + lsta = ni->ni_drv_data; + if (lsta == NULL) { + ic_printf(ic, "%s: ni %p (%6D) with lsta NULL\n", + __func__, ni, ni->ni_bssid, ":"); + ieee80211_free_node(ni); + return (0); + } + sta = LSTA_TO_STA(lsta); + + wiphy_lock(hw->wiphy); + if (lsta->kc[k->wk_keyix] != NULL) { + IMPROVE("Still in firmware? Del first. Can we assert this cannot happen?"); + ic_printf(ic, "%s: sta %6D found with key information\n", + __func__, sta->addr, ":"); + kc = lsta->kc[k->wk_keyix]; + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + kc = NULL; /* safeguard */ + } + + lcipher = lkpi_net80211_to_l80211_cipher_suite( k->wk_cipher->ic_cipher, k->wk_keylen); + switch (lcipher) { + case WLAN_CIPHER_SUITE_CCMP: + break; + case WLAN_CIPHER_SUITE_TKIP: + default: + ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + IMPROVE(); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (0); + } + + kc = malloc(sizeof(*kc) + k->wk_keylen, M_LKPI80211, M_WAITOK | M_ZERO); + kc->_k = k; /* Save the pointer to net80211. */ + atomic64_set(&kc->tx_pn, k->wk_keytsc); + kc->cipher = lcipher; kc->keyidx = k->wk_keyix; #if 0 kc->hw_key_idx = /* set by hw and needs to be passed for TX */; @@ -937,6 +1146,11 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, kc->keylen = k->wk_keylen; memcpy(kc->key, k->wk_key, k->wk_keylen); + if (k->wk_flags & (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV)) + kc->flags |= IEEE80211_KEY_FLAG_PAIRWISE; + if (k->wk_flags & IEEE80211_KEY_GROUP) + kc->flags &= ~IEEE80211_KEY_FLAG_PAIRWISE; + switch (kc->cipher) { case WLAN_CIPHER_SUITE_CCMP: kc->iv_len = k->wk_cipher->ic_header; @@ -944,44 +1158,41 @@ _lkpi_iv_key_set_delete(struct ieee80211vap *vap, const struct ieee80211_key *k, break; case WLAN_CIPHER_SUITE_TKIP: default: + /* currently UNREACH */ IMPROVE(); - return (0); + break; }; + lsta->kc[k->wk_keyix] = kc; - ni = vap->iv_bss; - sta = ieee80211_find_sta(vif, ni->ni_bssid); - if (sta != NULL) { - struct lkpi_sta *lsta; - - lsta = STA_TO_LSTA(sta); - lsta->kc = kc; - } - - error = lkpi_80211_mo_set_key(hw, cmd, vif, sta, kc); + error = lkpi_80211_mo_set_key(hw, SET_KEY, vif, sta, kc); if (error != 0) { - /* XXX-BZ leaking kc currently */ - ic_printf(ic, "%s: set_key failed: %d\n", __func__, error); + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D failed: %d\n", + __func__, SET_KEY, "SET", sta->addr, ":", error); + lsta->kc[k->wk_keyix] = NULL; + free(kc, M_LKPI80211); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); return (0); - } else { - ic_printf(ic, "%s: set_key succeeded: keyidx %u hw_key_idx %u " - "flags %#10x\n", __func__, - kc->keyidx, kc->hw_key_idx, kc->flags); - return (1); } -} -static int -lkpi_iv_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k) -{ +#ifdef LINUXKPI_DEBUG_80211 + if (linuxkpi_debug_80211 & D80211_TRACE_HW_CRYPTO) + ic_printf(ic, "%s: set_key cmd %d(%s) for sta %6D succeeded: " + "kc %p keyidx %u hw_key_idx %u flags %#010x\n", __func__, + SET_KEY, "SET", sta->addr, ":", + kc, kc->keyidx, kc->hw_key_idx, kc->flags); +#endif - /* XXX-BZ one day we should replace this iterating over VIFs, or node list? */ - return (_lkpi_iv_key_set_delete(vap, k, DISABLE_KEY)); + wiphy_unlock(hw->wiphy); + ieee80211_free_node(ni); + return (1); } + static int lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { - return (_lkpi_iv_key_set_delete(vap, k, SET_KEY)); + return (_lkpi_iv_key_set(vap, k)); } #endif @@ -2424,6 +2635,24 @@ lkpi_sta_run_to_assoc(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -2562,6 +2791,24 @@ lkpi_sta_run_to_init(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_lsta_dump(lsta, ni, __func__, __LINE__); +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + wiphy_lock(hw->wiphy); + error = lkpi_sta_del_keys(hw, vif, lsta); + wiphy_unlock(hw->wiphy); + if (error != 0) { + ic_printf(vap->iv_ic, "%s:%d: lkpi_sta_del_keys " + "failed: %d\n", __func__, __LINE__, error); + /* + * Either drv/fw will crash or cleanup itself, + * otherwise net80211 will delete the keys (at a + * less appropriate time). + */ + /* goto out; */ + } + } +#endif + /* Update sta_state (ASSOC to AUTH). */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); KASSERT(lsta->state == IEEE80211_STA_ASSOC, ("%s: lsta %p state not " @@ -3142,13 +3389,13 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif->iv_update_bss = vap->iv_update_bss; vap->iv_update_bss = lkpi_iv_update_bss; - /* Key management. */ - if (lhw->ops->set_key != NULL) { #ifdef LKPI_80211_HW_CRYPTO + /* Key management. */ + if (lkpi_hwcrypto && lhw->ops->set_key != NULL) { vap->iv_key_set = lkpi_iv_key_set; vap->iv_key_delete = lkpi_iv_key_delete; -#endif } +#endif #ifdef LKPI_80211_HT /* Stay with the iv_ampdu_rxmax,limit / iv_ampdu_density defaults until later. */ @@ -3160,6 +3407,15 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status, mac); +#ifdef LKPI_80211_HT + /* + * Modern chipset/fw/drv will do A-MPDU in drv/fw and fail + * to do so if they cannot do the crypto too. + */ + if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION)) + vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX; +#endif + if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); hw->conf.listen_interval = hw->max_listen_interval; @@ -3990,13 +4246,74 @@ lkpi_ic_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, return (0); } +#ifdef LKPI_80211_HW_CRYPTO +static int +lkpi_hw_crypto_prepare(struct lkpi_sta *lsta, struct ieee80211_key *k, + struct sk_buff *skb) +{ + struct ieee80211_tx_info *info; + struct ieee80211_key_conf *kc; + struct ieee80211_hdr *hdr; + uint32_t hlen, hdrlen; + uint8_t *p; + + KASSERT(lsta != NULL, ("%s: lsta is NULL", __func__)); + KASSERT(k != NULL, ("%s: key is NULL", __func__)); + KASSERT(skb != NULL, ("%s: skb is NULL", __func__)); + + kc = lsta->kc[k->wk_keyix]; + + info = IEEE80211_SKB_CB(skb); + info->control.hw_key = kc; + + /* MUST NOT happen. KASSERT? */ + if (kc == NULL) { + ic_printf(lsta->ni->ni_ic, "%s: lsta %p k %p skb %p, " + "kc is NULL on hw crypto offload\n", __func__, lsta, k, skb); + return (ENXIO); + } + + + IMPROVE("the following should be WLAN_CIPHER_SUITE specific"); + /* We currently only support CCMP so we hardcode things here. */ + + hdr = (void *)skb->data; + + /* + * Check if we have anythig to do as requested by driver + * or if we are done? + */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) == 0 && + (kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV) == 0 && + /* MFP */ + !((kc->flags & IEEE80211_KEY_FLAG_GENERATE_IV_MGMT) != 0 && + ieee80211_is_mgmt(hdr->frame_control))) + return (0); + + hlen = k->wk_cipher->ic_header; + if (skb_headroom(skb) < hlen) + return (ENOSPC); + + hdrlen = ieee80211_hdrlen(hdr->frame_control); + p = skb_push(skb, hlen); + memmove(p, p + hlen, hdrlen); + + /* If driver request space only we are done. */ + if ((kc->flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE) != 0) + return (0); + + p += hdrlen; + k->wk_cipher->ic_setiv(k, p); + + return (0); +} +#endif + static void lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) { struct ieee80211_node *ni; -#ifndef LKPI_80211_HW_CRYPTO struct ieee80211_frame *wh; -#endif struct ieee80211_key *k; struct sk_buff *skb; struct ieee80211com *ic; @@ -4011,6 +4328,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) struct ieee80211_hdr *hdr; struct lkpi_txq *ltxq; void *buf; + ieee80211_keyix keyix; uint8_t ac, tid; M_ASSERTPKTHDR(m); @@ -4021,20 +4339,30 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) ni = lsta->ni; k = NULL; -#ifndef LKPI_80211_HW_CRYPTO - /* Encrypt the frame if need be; XXX-BZ info->control.hw_key. */ + keyix = IEEE80211_KEYIX_NONE; wh = mtod(m, struct ieee80211_frame *); if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { - /* Retrieve key for TX && do software encryption. */ - k = ieee80211_crypto_encap(ni, m); - if (k == NULL) { - ieee80211_free_node(ni); - m_freem(m); - return; + +#ifdef LKPI_80211_HW_CRYPTO + if (lkpi_hwcrypto) { + k = ieee80211_crypto_get_txkey(ni, m); + if (k != NULL && lsta->kc[k->wk_keyix] != NULL) + keyix = k->wk_keyix; } - } #endif + /* Encrypt the frame if need be. */ + if (keyix == IEEE80211_KEYIX_NONE) { + /* Retrieve key for TX && do software encryption. */ + k = ieee80211_crypto_encap(ni, m); + if (k == NULL) { + ieee80211_free_node(ni); + m_freem(m); + return; + } + } + } + ic = ni->ni_ic; lhw = ic->ic_softc; hw = LHW_TO_HW(lhw); @@ -4145,7 +4473,19 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) sta = LSTA_TO_STA(lsta); #ifdef LKPI_80211_HW_CRYPTO - info->control.hw_key = lsta->kc; + if (lkpi_hwcrypto && keyix != IEEE80211_KEYIX_NONE) { + int error; + + error = lkpi_hw_crypto_prepare(lsta, k, skb); + if (error != 0) { + /* + * We only have to free the skb which will free the + * mbuf and release the reference on the ni. + */ + dev_kfree_skb(skb); + return; + } + } #endif IMPROVE(); @@ -5106,7 +5446,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) ic->ic_cryptocaps = 0; #ifdef LKPI_80211_HW_CRYPTO - if (hw->wiphy->n_cipher_suites > 0) { + if (lkpi_hwcrypto && hw->wiphy->n_cipher_suites > 0) { for (i = 0; i < hw->wiphy->n_cipher_suites; i++) ic->ic_cryptocaps |= lkpi_l80211_to_net80211_cyphers( hw->wiphy->cipher_suites[i]); @@ -5345,15 +5685,62 @@ linuxkpi_ieee80211_iterate_interfaces(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_UNLOCK(lhw); } +static void +lkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + ieee80211_keyix keyix, struct lkpi_sta *lsta, + void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, + struct ieee80211_sta *, struct ieee80211_key_conf *, void *), + void *arg) +{ + if (!lsta->added_to_drv) + return; + + if (lsta->kc[keyix] == NULL) + return; + + iterfunc(hw, vif, LSTA_TO_STA(lsta), lsta->kc[keyix], arg); +} + void linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void(*iterfunc)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct ieee80211_key_conf *, void *), - void *arg) + void *arg, bool rcu) { + struct lkpi_sta *lsta; + struct lkpi_vif *lvif; - UNIMPLEMENTED; + lvif = VIF_TO_LVIF(vif); + + if (rcu) { + if (vif == NULL) { + TODO(); + } else { + IMPROVE("We do not actually match the RCU code"); + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } else { + TODO("Used by suspend/resume; order of keys as installed to " + "firmware is important; we'll need to rewrite some code for that"); + lockdep_assert_wiphy(hw->wiphy); + + if (vif == NULL) { + TODO(); + } else { + TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); + keyix++) + lkpi_ieee80211_iterate_keys(hw, vif, + keyix, lsta, iterfunc, arg); + } + } + } } void diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index bb1ecb45636f..40b11ebfef13 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -67,6 +67,7 @@ #define D80211_TRACEX (D80211_TRACE_TX|D80211_TRACE_RX) #define D80211_TRACEX_DUMP (D80211_TRACE_TX_DUMP|D80211_TRACE_RX_DUMP) #define D80211_TRACE_STA 0x00010000 +#define D80211_TRACE_HW_CRYPTO 0x00020000 #define D80211_TRACE_MO 0x00100000 #define D80211_TRACE_MODE 0x0f000000 #define D80211_TRACE_MODE_HT 0x01000000 @@ -151,7 +152,7 @@ struct lkpi_sta { struct mbufq txq; struct mtx txq_mtx; - struct ieee80211_key_conf *kc; + struct ieee80211_key_conf *kc[IEEE80211_WEP_NKID]; enum ieee80211_sta_state state; bool txq_ready; /* Can we run the taskq? */ bool added_to_drv; /* Driver knows; i.e. we called ...(). */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211_macops.c b/sys/compat/linuxkpi/common/src/linux_80211_macops.c index 68b5bbefe938..fde23d02af5e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211_macops.c +++ b/sys/compat/linuxkpi/common/src/linux_80211_macops.c @@ -683,6 +683,8 @@ lkpi_80211_mo_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct lkpi_hw *lhw; int error; + lockdep_assert_wiphy(hw->wiphy); + lhw = HW_TO_LHW(hw); if (lhw->ops->set_key == NULL) { error = EOPNOTSUPP; From nobody Tue Feb 18 13:54:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy1HC4thWz5ndnt; Tue, 18 Feb 2025 13:54:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy1HC4JRwz3qm0; Tue, 18 Feb 2025 13:54:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739886887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Ta62n1TZCgwfETdL0sMIKX/FToLoiivDObHGMNjEiI=; b=MuTR/fQ4mnKmLQk95Il3izQi86x3fVBk/EaVTmYHJLi/QEGqcYOn3+uSOlpqnGjYq1nqoe XnVnsxeMuetugLFnPLQU1gO78NM33J5m1i6UxXil47nSQz4moM3itSj8UT4YTOqEYPAsQv 9znbQIRsyj5fcf4sLqJrBkLl/XKVe6VB9iJG0KK+29w9dQLzQKcPcSvHNPK+H9sey1ZHBD PJ5tl7JYC6MKZEo1QiKxfomPd3Zp8c4INQFo2Lf/9dUIad3PJeJdzrQovWd3fu1bEb/3dq lmvJGiI9HyqOVHvDpSJYqBbgikVhxO77NAzMwzPuwFJLpXERJjHfAkBERgzxpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739886887; a=rsa-sha256; cv=none; b=sHuVOhL6ZZeftJSZRAv2zUyEZH/PtORAIS+sTDV8cnS/SeDBB2RVzFT29NHYcaB4J3dMyu 0SUu+pypwgjwVw6knlypVBvlpuQFMBuXQFIGKJoTzzl8AvusfvT+yY3I306H+RA71Z+46A wDMmVZQk3jjdHHZ91f5zuexu74udVWjBekbmHWTp015Uz7fenu+vw3YYcltmlGEwKgQHPx HVcq2O+HwHbmmL5QG43N5LgwGIceLzFunrxOv6OWBITzOPBoqAntlQkQ3HmRMhMzYa3UJS 0hGj4uT5wvJd1Z12we0bYkDNJcoB14vTAZA9Al0mbQYtlBXG1Tmi7EdbF3nRiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739886887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Ta62n1TZCgwfETdL0sMIKX/FToLoiivDObHGMNjEiI=; b=XrKDnn2ExBJq6YX0QbnIC5GhTTFa6kZAMDZGsRKuQ56O60T3QPMF6Fp40ga1Qgtnosv+BR fcIRnQIwUC3VbWeuZT2OcgBkf8itLE+x6OjNy8VHXiAX4CTvjknDGhY3SgrerchUknjoKm i3srT5mFT7OOEYDJ8u+sRLnKqBHmbHIiM6lVkYHxgY9dvRsGJ3EjcAhV/UCNQRMwJM2PFp utxXjHilGkLPc6bm2DQdbSingoqfS3iE+yJJ9b+joJL8lcP+H43wdp2L5vhkEF9/75E6b/ XpQPmxM8IoY/qGOvUxs1OE9eaLuhfFS9kN2Vbf+pMTA8z3VTAoDq+Bt9x6bEuw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R10" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Yy1HC2zPbzq9C; Tue, 18 Feb 2025 13:54:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 4E61624E44; Tue, 18 Feb 2025 14:54:44 +0100 (CET) From: Kristof Provost To: Warner Losh Cc: John Baldwin , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 7e7f88001d7d - main - pf: use time_t for storing time_t values Date: Tue, 18 Feb 2025 14:54:43 +0100 X-Mailer: MailMate (2.0r6222) Message-ID: <5BE3DFA0-33A8-4E60-B4C7-677E1064F930@FreeBSD.org> In-Reply-To: References: <202502141750.51EHoOFm061342@gitrepo.freebsd.org> <5c019c51-949b-4255-bc44-926ac973a1af@FreeBSD.org> <1B3E8B07-037B-4DA9-A8D7-81F866078A39@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 17 Feb 2025, at 22:03, Warner Losh wrote: > On Mon, Feb 17, 2025, 10:08=E2=80=AFAM Kristof Provost = wrote: > >> On 17 Feb 2025, at 16:24, John Baldwin wrote: >> >> On 2/14/25 12:50, Kristof Provost wrote: >> >> The branch main has been updated by kp: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D7e7f88001d7dfec83cd7568369be= 6a587d4a51ff >> >> commit 7e7f88001d7dfec83cd7568369be6a587d4a51ff >> Author: Kristof Provost kp@FreeBSD.org >> AuthorDate: 2025-02-07 10:29:26 +0000 >> Commit: Kristof Provost kp@FreeBSD.org >> CommitDate: 2025-02-14 17:47:52 +0000 >> >> pf: use time_t for storing time_t values >> No change to the underlying type, so no ABI change. >> We define __time_t as uint64_t if __LP64__, otherwise uint32_t, >> and only define __LP64__ if long is 64 bits. >> In other words: __time_t =3D=3D long. >> ok henning@ deraadt@ >> Obtained from: OpenBSD, guenther , 6c1b69a= 0ff >> Sponsored by: Rubicon Communications, LLC ("Netgate") >> Differential Revision: https://reviews.freebsd.org/D48963 >> >> This is an ABI change on non-i386 32-bit platforms in FreeBSD since th= ey >> all use a 64-bit type for time_t that is not the same size as long. No= t >> sure if the ABI change matters on FreeBSD though? >> >> It wasn=E2=80=99t intended to be an ABI change, hence the commit messa= ge. It >> appears that=E2=80=99s only correct for x86 though. >> > > Yes. It may have been true in openbsd land, but not FreeBSD. > >> So we=E2=80=99re only talking about armv7 and ppc32, if I=E2=80=99m no= t forgetting >> anything. The former is on the removal list already, and the latter ..= >> well, I don=E2=80=99t know how many users there are. Both are likely t= o be embedded >> platforms where the ABI change is going to be even less relevant (beca= use >> it really only matters if the kernel and userspace are not updated >> together, and these are going to be embedded devices that are far more= >> likely to have everything updated simultaneously). >> > > Armv7 will be around in 15. Ppc32 is likely going away. > >> So I=E2=80=99m unsure about what to do. I can revert this and we can j= ust carry >> this (trivial) diff to OpenBSD forever, or we can ignore the ABI break= age >> given the above. I=E2=80=99m not inclined to do anything more involved= though. >> >> Do you have any thoughts? >> > I think the diffs to OpenBSD are most undesirable of the alternatives. > > Major os breakage is fine. Tier2 platforms get a weaker version of > compatibility. > > Armv7 is on the cusp of the abi needing to work. Sonce this is a privat= e > abi, and only a few programs are affected and they already need an upda= te > for 15 due to other changes (right?) And since providing backwards > compatible ABI shims looks to be kinda nontrivial, I agree with the oth= ers: > document in release notes and don't MFC and we're likrly good. > How does https://reviews.freebsd.org/D49046 look? This will not be MFC=E2=80=99d. There=E2=80=99s an entire series of OpenB= SD patches that this is part of that will not be MFCd. Best regards, Kristof From nobody Tue Feb 18 15:53:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy3wL50QLz5nnl6; Tue, 18 Feb 2025 15:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy3wL3WfGz3mnb; Tue, 18 Feb 2025 15:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739894018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gspB1kOMOlCxB97uWRxbYraPtAc5ipCmicjc5z+wzLw=; b=ixOCUB8glo3KtvfotxthVpbBYQNtJ4oru2/iLFKVxeDo7b8tLhqIrKCIeetpJbOJvKjGfP U7/QXuZhvfzKyUIdrQTD9BKs/cf1xhOWRxgHKDpRoS+egtkqwto6gVC90GB8+9sYS51lIe CqTDFHpm3W6jKg0ATNBT3FDzbk2yZCRZejZIcLfIy1ckonelvebSjCYqOPKU8daEifQu65 9y++6oiXmiArL9/h2JVKNG7SXklnqVGk6s+0WO/6f2CO4Bz8v4yB2NZHxINnu2sbGuVVRM g0DeJp1xjqTnd1Rj2999KQXvFB4gR+j4MFQRcvo6KCBn90pKWtVGvjpxYJvyvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739894018; a=rsa-sha256; cv=none; b=L0OnPqk/NAZWfzQ/S+Uvq+OYudHKReYdaZKQCmsVmKLp/hstnE7n2jbK9WBcpS66cm2Jcm KEtDg4KAeoa7teTkmOkB+7FloDPfWCovkdpuEgCFfwdZtO++8yTU1WfMzwDr0FdQpQlHpj auAhdUm8D5Fn77UoLeEsvnucj0627HSORRWagti8S2JJ74mgdY9yMFhLZPvnyJmOPaB4FM Xfd0xH8NCO3q7pFTG+wP9QHsxVMhGDcfK4re22uZmsSjE/knbtE1JHLRAkAGURJiLofh2k 682O4aYsgBwCDIJof9UF3f4alkZRajQWWUdcLkuZYjUQheSrC0n00tQV/JXRtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739894018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gspB1kOMOlCxB97uWRxbYraPtAc5ipCmicjc5z+wzLw=; b=bQ4ysKh/6F+CiHkXGfKYN7tyncyIb5/VoU420CZUsYwokflwJoLFwVke7vS0ltdgexr9ls eOfwALHdVRRSLs+dH4mpw2EurIxTOBl2+Bp2rAlFlUcw6Pfuj07ZfeAOx4Gr+Lae4JKvJr UXTCUx+AG+D3GckjxN+RASsjG+yYHYpgvqlG8KEilcJ0jtRyylBQvxmG9sIMIOwzB8EcFh OQ4b5/YuNU1TQiaOs+JdmG5PqRvi5Iqre+RyPr0x2Jv7eBK4NOuDzsJUqg+CHzghPI2uLn 6esDMgmbYELW4lG4T85v26yoSeVBcqQw5HREJJTRKCdV5m80f7wVwjHuMyNh1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy3wL2tgGz9H3; Tue, 18 Feb 2025 15:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51IFrcuo015045; Tue, 18 Feb 2025 15:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IFrcOW015042; Tue, 18 Feb 2025 15:53:38 GMT (envelope-from git) Date: Tue, 18 Feb 2025 15:53:38 GMT Message-Id: <202502181553.51IFrcOW015042@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 896f5be77beb - main - RELNOTES: document pf's ABI breakage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 896f5be77beb37ff35fa465f8ff2eea0d977a0bb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=896f5be77beb37ff35fa465f8ff2eea0d977a0bb commit 896f5be77beb37ff35fa465f8ff2eea0d977a0bb Author: Kristof Provost AuthorDate: 2025-02-18 13:51:58 +0000 Commit: Kristof Provost CommitDate: 2025-02-18 15:53:12 +0000 RELNOTES: document pf's ABI breakage See also: 7e7f88001d7d Reviewed by: imp (previous version), jhibbits Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D49046 --- RELNOTES | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELNOTES b/RELNOTES index 6cf100482a26..96e2d24bf833 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,12 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +7e7f88001d7d: + The definition of pf's struct pfr_tstats and struct pfr_astats has + changed, breaking ABI compatibility for 32-bit powerpc (including + powerpcspe) and armv7. Users of these platforms should ensure kernel + and userspace are updated together. + 5dc99e9bb985, 08e638c089a, 4009a98fe80: The net.inet.{tcp,udp,raw}.bind_all_fibs tunables have been added. They modify socket behavior such that packets not originating from the From nobody Tue Feb 18 16:00:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy4406h86z5nnZy; Tue, 18 Feb 2025 16:00: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 4Yy4406T38z3pqn; Tue, 18 Feb 2025 16:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739894416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1VLKMoGa0t9rFpfsbpoKWNG5pbV0lHdE1m7Wd6JsYM=; b=BrKkGaiTAPe8Ig63BfcZYnD0WeS8vrEWyZYQ8lIXHeVxyBafuSx8ZIqD/PqCPsyUE6sVHa m9EpOwzpMLm7p32teJsYeC9eOvTTrkFaz9rYnQT6tkUTyeOCwq+MOjqa7GBjgkoMsKbdV8 mVKuoohM65GYfpkfPYv5Tt9UpCxQzFZTA8zEaHxlAuiUjXol1erMiL/0mFPypH+vhfJoUx 6iYoxqMPXZ+1fO/qSwuUrjhcHr3zV5Ul+lcE7mHDrZSmFBPpYKHCwL9dkJwEaIK+wPA6g5 02pHf69PrQqW7J0EsdxAPW/4wXYkvqqEpa5oCNq5EnYVQVYgAHztxVnPiXvZIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739894416; a=rsa-sha256; cv=none; b=n9pZN1SVb2Z+exFNPSEQxdZg2sWHJDb9Z7UJ1TZJXh8nA1zb6d01mnL/feo/yvpdjjKqwr lb0YcF/GtcQp2xxqSRBZ2bG2tRX0F3hmK6FabnaooJYAMQ0tAk8dVHMJlsl4loGexvxzZ/ 1jIep+tylnJUeCmONfwxVc38TzbMyrvFGTez7CVm689qOULqPmXqiPE81iNYsaVFnsEm6n R0QAOJIRHHPm+lnCp1BXH97E6r5P7vrwkuBOqfHnG0Cltw+mzJ9AxxRUcCi4Ku4naWJxUD AXpsnj8uv/Kywy8FPfWV4HPVoYGxgGBAWN5QMksLQzrv85lGeM/KNeVqEGELfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739894416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1VLKMoGa0t9rFpfsbpoKWNG5pbV0lHdE1m7Wd6JsYM=; b=SKJtp7PJrpz1ZBq4Wp93jea2mirBuE5nAsYfSDRAqSx3tDMncn3KMn3JOvGrqWwlIwXWl8 MesE/oqKEa+GrZDPB4KI5O1ue1qYmOQjFyAyVV2wY8SY79NoUuKGE7QxKMBfwXQrOwx9ew KG+aoi+P+mywS3oegUog8TVjYvc3wCnt/RilvtDbYg+19MKlC05TZNgvNLHXx5p0rjZWN3 MoSC6IsXx6qp6wO4P22w3HOo99BWWjNjQqUQN1oUvZS+e2SnISj1fEGJFHBeLXIHpqavnZ 0Hm4i2sQjP/VpimHmZqFJWiLk7xhwhxFMKbYfaHMcsKLuZ5+Nzl8zCZy1nysWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy44063Vjz9nH; Tue, 18 Feb 2025 16:00: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 51IG0Glh025913; Tue, 18 Feb 2025 16:00:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IG0GY8025885; Tue, 18 Feb 2025 16:00:16 GMT (envelope-from git) Date: Tue, 18 Feb 2025 16:00:16 GMT Message-Id: <202502181600.51IG0GY8025885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c76c2a19ae37 - main - vmm: Consolidate code which manages guest memory regions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c76c2a19ae3763d17aa6a60a5831ed24cbc16e83 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c76c2a19ae3763d17aa6a60a5831ed24cbc16e83 commit c76c2a19ae3763d17aa6a60a5831ed24cbc16e83 Author: Mark Johnston AuthorDate: 2025-02-18 15:53:16 +0000 Commit: Mark Johnston CommitDate: 2025-02-18 16:00:07 +0000 vmm: Consolidate code which manages guest memory regions On all three platforms supported by vmm, we have mostly duplicated code to manage guest physical memory regions. Deduplicate much of this code and move it into sys/dev/vmm/vmm_mem.c. To avoid exporting struct vm outside of machdep vmm.c, add a new struct vm_mem to contain the memory segment descriptors, and add a vm_mem() accessor, akin to vm_vmspace(). This way vmm_mem.c can implement its routines without needing to see the layout of struct vm. The handling of the per-VM vmspace is also duplicated but will be moved to vmm_mem.c in a follow-up patch. On amd64, move the ppt_is_mmio() check out of vm_mem_allocated() to keep the code MI, as PPT is only implemented on amd64. There are only a couple of callers, so this is not unreasonable. No functional change intended. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D48270 --- sys/amd64/include/vmm.h | 30 +- sys/amd64/vmm/amd/svm.c | 5 +- sys/amd64/vmm/intel/vmx.c | 4 +- sys/amd64/vmm/vmm.c | 419 ++-------------------- sys/amd64/vmm/vmm_instruction_emul.c | 2 + sys/amd64/vmm/{vmm_mem.c => vmm_mem_machdep.c} | 0 sys/arm64/include/vmm.h | 34 +- sys/arm64/vmm/vmm.c | 412 ++-------------------- sys/arm64/vmm/vmm_arm64.c | 2 + sys/arm64/vmm/vmm_dev_machdep.c | 1 + sys/conf/files.arm64 | 1 + sys/conf/files.riscv | 1 + sys/dev/vmm/vmm_dev.c | 1 + sys/dev/vmm/vmm_mem.c | 459 +++++++++++++++++++++++++ sys/dev/vmm/vmm_mem.h | 84 +++++ sys/modules/vmm/Makefile | 3 +- sys/riscv/include/vmm.h | 34 +- sys/riscv/vmm/vmm.c | 418 ++-------------------- sys/riscv/vmm/vmm_dev_machdep.c | 1 + sys/riscv/vmm/vmm_riscv.c | 2 + 20 files changed, 636 insertions(+), 1277 deletions(-) diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index 6501baa455da..a9c73b75213b 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -150,6 +150,7 @@ CTASSERT(VM_MAX_NAMELEN >= VM_MIN_NAMELEN); struct vm; struct vm_exception; +struct vm_mem; struct seg_desc; struct vm_exit; struct vm_run; @@ -238,39 +239,11 @@ void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, int vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, uint16_t threads, uint16_t maxcpus); -/* - * APIs that modify the guest memory map require all vcpus to be frozen. - */ -void vm_slock_memsegs(struct vm *vm); -void vm_xlock_memsegs(struct vm *vm); -void vm_unlock_memsegs(struct vm *vm); -int vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t off, - size_t len, int prot, int flags); -int vm_munmap_memseg(struct vm *vm, vm_paddr_t gpa, size_t len); -int vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem); -void vm_free_memseg(struct vm *vm, int ident); int vm_map_mmio(struct vm *vm, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int vm_unmap_mmio(struct vm *vm, vm_paddr_t gpa, size_t len); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); -/* - * APIs that inspect the guest memory map require only a *single* vcpu to - * be frozen. This acts like a read lock on the guest memory map since any - * modification requires *all* vcpus to be frozen. - */ -int vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, int *segid, - vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); -int vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, - struct vm_object **objptr); -vm_paddr_t vmm_sysmem_maxaddr(struct vm *vm); -void *vm_gpa_hold(struct vcpu *vcpu, vm_paddr_t gpa, size_t len, - int prot, void **cookie); -void *vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, - int prot, void **cookie); -void vm_gpa_release(void *cookie); -bool vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa); - int vm_get_register(struct vcpu *vcpu, int reg, uint64_t *retval); int vm_set_register(struct vcpu *vcpu, int reg, uint64_t val); int vm_get_seg_desc(struct vcpu *vcpu, int reg, @@ -402,6 +375,7 @@ vcpu_should_yield(struct vcpu *vcpu) void *vcpu_stats(struct vcpu *vcpu); void vcpu_notify_event(struct vcpu *vcpu, bool lapic_intr); struct vmspace *vm_vmspace(struct vm *vm); +struct vm_mem *vm_mem(struct vm *vm); struct vatpic *vm_atpic(struct vm *vm); struct vatpit *vm_atpit(struct vm *vm); struct vpmtmr *vm_pmtmr(struct vm *vm); diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index ed37dd0c810e..6c16daaa47c2 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -55,6 +55,7 @@ #include #include +#include #include "vmm_lapic.h" #include "vmm_stat.h" @@ -69,6 +70,7 @@ #include "svm_softc.h" #include "svm_msr.h" #include "npt.h" +#include "io/ppt.h" SYSCTL_DECL(_hw_vmm); SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, @@ -1593,7 +1595,8 @@ svm_vmexit(struct svm_softc *svm_sc, struct svm_vcpu *vcpu, SVM_CTR2(vcpu, "nested page fault with " "reserved bits set: info1(%#lx) info2(%#lx)", info1, info2); - } else if (vm_mem_allocated(vcpu->vcpu, info2)) { + } else if (vm_mem_allocated(vcpu->vcpu, info2) || + ppt_is_mmio(svm_sc->vm, info2)) { vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->u.paging.gpa = info2; vmexit->u.paging.fault_type = npf_fault_type(info1); diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c index 13a53fa8eed6..957217ab2258 100644 --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -59,6 +59,7 @@ #include #include +#include #include "vmm_lapic.h" #include "vmm_host.h" @@ -74,6 +75,7 @@ #include "vmx_msr.h" #include "x86.h" #include "vmx_controls.h" +#include "io/ppt.h" #define PINBASED_CTLS_ONE_SETTING \ (PINBASED_EXTINT_EXITING | \ @@ -2756,7 +2758,7 @@ vmx_exit_process(struct vmx *vmx, struct vmx_vcpu *vcpu, struct vm_exit *vmexit) */ gpa = vmcs_gpa(); if (vm_mem_allocated(vcpu->vcpu, gpa) || - apic_access_fault(vcpu, gpa)) { + ppt_is_mmio(vmx->vm, gpa) || apic_access_fault(vcpu, gpa)) { vmexit->exitcode = VM_EXITCODE_PAGING; vmexit->inst_length = 0; vmexit->u.paging.gpa = gpa; diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index aa13d506ac6a..1d410835be88 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_bhyve_snapshot.h" #include @@ -72,6 +71,7 @@ #include #include +#include #include "vmm_ioport.h" #include "vmm_host.h" @@ -131,23 +131,6 @@ struct vcpu { #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) -struct mem_seg { - size_t len; - bool sysmem; - struct vm_object *object; -}; -#define VM_MAX_MEMSEGS 4 - -struct mem_map { - vm_paddr_t gpa; - size_t len; - vm_ooffset_t segoff; - int segid; - int prot; - int flags; -}; -#define VM_MAX_MEMMAPS 8 - /* * Initialization: * (o) initialized the first time the VM is created @@ -180,9 +163,8 @@ struct vm { void *rendezvous_arg; /* (x) [r] rendezvous func/arg */ vm_rendezvous_func_t rendezvous_func; struct mtx rendezvous_mtx; /* (o) rendezvous lock */ - struct mem_map mem_maps[VM_MAX_MEMMAPS]; /* (i) [m+v] guest address space */ - struct mem_seg mem_segs[VM_MAX_MEMSEGS]; /* (o) [m+v] guest memory regions */ struct vmspace *vmspace; /* (o) guest's address space */ + struct vm_mem mem; /* (i) [m+v] guest memory */ char name[VM_MAX_NAMELEN+1]; /* (o) virtual machine name */ struct vcpu **vcpu; /* (o) guest vcpus */ /* The following describe the vm cpu topology */ @@ -190,7 +172,6 @@ struct vm { uint16_t cores; /* (o) num of cores/socket */ uint16_t threads; /* (o) num of threads/core */ uint16_t maxcpus; /* (o) max pluggable cpus */ - struct sx mem_segs_lock; /* (o) */ struct sx vcpus_init_lock; /* (o) */ }; @@ -294,8 +275,6 @@ u_int vm_maxcpu; SYSCTL_UINT(_hw_vmm, OID_AUTO, maxcpu, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &vm_maxcpu, 0, "Maximum number of vCPUs"); -static void vm_free_memmap(struct vm *vm, int ident); -static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu, bool lapic_intr); /* global statistics */ @@ -625,8 +604,8 @@ vm_create(const char *name, struct vm **retvm) vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO); strcpy(vm->name, name); vm->vmspace = vmspace; + vm_mem_init(&vm->mem); mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF); - sx_init(&vm->mem_segs_lock, "vm mem_segs"); sx_init(&vm->vcpus_init_lock, "vm vcpus"); vm->vcpu = malloc(sizeof(*vm->vcpu) * vm_maxcpu, M_VM, M_WAITOK | M_ZERO); @@ -674,11 +653,10 @@ vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, static void vm_cleanup(struct vm *vm, bool destroy) { - struct mem_map *mm; - int i; - if (destroy) vm_xlock_memsegs(vm); + else + vm_assert_memseg_xlocked(vm); ppt_unassign_all(vm); @@ -695,38 +673,23 @@ vm_cleanup(struct vm *vm, bool destroy) vatpic_cleanup(vm->vatpic); vioapic_cleanup(vm->vioapic); - for (i = 0; i < vm->maxcpus; i++) { + for (int i = 0; i < vm->maxcpus; i++) { if (vm->vcpu[i] != NULL) vcpu_cleanup(vm->vcpu[i], destroy); } vmmops_cleanup(vm->cookie); - /* - * System memory is removed from the guest address space only when - * the VM is destroyed. This is because the mapping remains the same - * across VM reset. - * - * Device memory can be relocated by the guest (e.g. using PCI BARs) - * so those mappings are removed on a VM reset. - */ - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (destroy || !sysmem_mapping(vm, mm)) - vm_free_memmap(vm, i); - } + vm_mem_cleanup(vm); if (destroy) { - for (i = 0; i < VM_MAX_MEMSEGS; i++) - vm_free_memseg(vm, i); - vm_unlock_memsegs(vm); + vm_mem_destroy(vm); vmmops_vmspace_free(vm->vmspace); vm->vmspace = NULL; free(vm->vcpu, M_VM); sx_destroy(&vm->vcpus_init_lock); - sx_destroy(&vm->mem_segs_lock); mtx_destroy(&vm->rendezvous_mtx); } } @@ -763,24 +726,6 @@ vm_name(struct vm *vm) return (vm->name); } -void -vm_slock_memsegs(struct vm *vm) -{ - sx_slock(&vm->mem_segs_lock); -} - -void -vm_xlock_memsegs(struct vm *vm) -{ - sx_xlock(&vm->mem_segs_lock); -} - -void -vm_unlock_memsegs(struct vm *vm) -{ - sx_unlock(&vm->mem_segs_lock); -} - int vm_map_mmio(struct vm *vm, vm_paddr_t gpa, size_t len, vm_paddr_t hpa) { @@ -800,283 +745,20 @@ vm_unmap_mmio(struct vm *vm, vm_paddr_t gpa, size_t len) return (0); } -/* - * Return 'true' if 'gpa' is allocated in the guest address space. - * - * This function is called in the context of a running vcpu which acts as - * an implicit lock on 'vm->mem_maps[]'. - */ -bool -vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa) -{ - struct vm *vm = vcpu->vm; - struct mem_map *mm; - int i; - -#ifdef INVARIANTS - int hostcpu, state; - state = vcpu_get_state(vcpu, &hostcpu); - KASSERT(state == VCPU_RUNNING && hostcpu == curcpu, - ("%s: invalid vcpu state %d/%d", __func__, state, hostcpu)); -#endif - - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (mm->len != 0 && gpa >= mm->gpa && gpa < mm->gpa + mm->len) - return (true); /* 'gpa' is sysmem or devmem */ - } - - if (ppt_is_mmio(vm, gpa)) - return (true); /* 'gpa' is pci passthru mmio */ - - return (false); -} - -int -vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem) -{ - struct mem_seg *seg; - vm_object_t obj; - - sx_assert(&vm->mem_segs_lock, SX_XLOCKED); - - if (ident < 0 || ident >= VM_MAX_MEMSEGS) - return (EINVAL); - - if (len == 0 || (len & PAGE_MASK)) - return (EINVAL); - - seg = &vm->mem_segs[ident]; - if (seg->object != NULL) { - if (seg->len == len && seg->sysmem == sysmem) - return (EEXIST); - else - return (EINVAL); - } - - obj = vm_object_allocate(OBJT_SWAP, len >> PAGE_SHIFT); - if (obj == NULL) - return (ENOMEM); - - seg->len = len; - seg->object = obj; - seg->sysmem = sysmem; - return (0); -} - -int -vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, - vm_object_t *objptr) -{ - struct mem_seg *seg; - - sx_assert(&vm->mem_segs_lock, SX_LOCKED); - - if (ident < 0 || ident >= VM_MAX_MEMSEGS) - return (EINVAL); - - seg = &vm->mem_segs[ident]; - if (len) - *len = seg->len; - if (sysmem) - *sysmem = seg->sysmem; - if (objptr) - *objptr = seg->object; - return (0); -} - -void -vm_free_memseg(struct vm *vm, int ident) -{ - struct mem_seg *seg; - - KASSERT(ident >= 0 && ident < VM_MAX_MEMSEGS, - ("%s: invalid memseg ident %d", __func__, ident)); - - seg = &vm->mem_segs[ident]; - if (seg->object != NULL) { - vm_object_deallocate(seg->object); - bzero(seg, sizeof(struct mem_seg)); - } -} - -int -vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t first, - size_t len, int prot, int flags) -{ - struct mem_seg *seg; - struct mem_map *m, *map; - vm_ooffset_t last; - int i, error; - - if (prot == 0 || (prot & ~(VM_PROT_ALL)) != 0) - return (EINVAL); - - if (flags & ~VM_MEMMAP_F_WIRED) - return (EINVAL); - - if (segid < 0 || segid >= VM_MAX_MEMSEGS) - return (EINVAL); - - seg = &vm->mem_segs[segid]; - if (seg->object == NULL) - return (EINVAL); - - last = first + len; - if (first < 0 || first >= last || last > seg->len) - return (EINVAL); - - if ((gpa | first | last) & PAGE_MASK) - return (EINVAL); - - map = NULL; - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - m = &vm->mem_maps[i]; - if (m->len == 0) { - map = m; - break; - } - } - - if (map == NULL) - return (ENOSPC); - - error = vm_map_find(&vm->vmspace->vm_map, seg->object, first, &gpa, - len, 0, VMFS_NO_SPACE, prot, prot, 0); - if (error != KERN_SUCCESS) - return (EFAULT); - - vm_object_reference(seg->object); - - if (flags & VM_MEMMAP_F_WIRED) { - error = vm_map_wire(&vm->vmspace->vm_map, gpa, gpa + len, - VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); - if (error != KERN_SUCCESS) { - vm_map_remove(&vm->vmspace->vm_map, gpa, gpa + len); - return (error == KERN_RESOURCE_SHORTAGE ? ENOMEM : - EFAULT); - } - } - - map->gpa = gpa; - map->len = len; - map->segoff = first; - map->segid = segid; - map->prot = prot; - map->flags = flags; - return (0); -} - -int -vm_munmap_memseg(struct vm *vm, vm_paddr_t gpa, size_t len) -{ - struct mem_map *m; - int i; - - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - m = &vm->mem_maps[i]; - if (m->gpa == gpa && m->len == len && - (m->flags & VM_MEMMAP_F_IOMMU) == 0) { - vm_free_memmap(vm, i); - return (0); - } - } - - return (EINVAL); -} - -int -vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, int *segid, - vm_ooffset_t *segoff, size_t *len, int *prot, int *flags) -{ - struct mem_map *mm, *mmnext; - int i; - - mmnext = NULL; - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (mm->len == 0 || mm->gpa < *gpa) - continue; - if (mmnext == NULL || mm->gpa < mmnext->gpa) - mmnext = mm; - } - - if (mmnext != NULL) { - *gpa = mmnext->gpa; - if (segid) - *segid = mmnext->segid; - if (segoff) - *segoff = mmnext->segoff; - if (len) - *len = mmnext->len; - if (prot) - *prot = mmnext->prot; - if (flags) - *flags = mmnext->flags; - return (0); - } else { - return (ENOENT); - } -} - -static void -vm_free_memmap(struct vm *vm, int ident) -{ - struct mem_map *mm; - int error __diagused; - - mm = &vm->mem_maps[ident]; - if (mm->len) { - error = vm_map_remove(&vm->vmspace->vm_map, mm->gpa, - mm->gpa + mm->len); - KASSERT(error == KERN_SUCCESS, ("%s: vm_map_remove error %d", - __func__, error)); - bzero(mm, sizeof(struct mem_map)); - } -} - -static __inline bool -sysmem_mapping(struct vm *vm, struct mem_map *mm) -{ - - if (mm->len != 0 && vm->mem_segs[mm->segid].sysmem) - return (true); - else - return (false); -} - -vm_paddr_t -vmm_sysmem_maxaddr(struct vm *vm) -{ - struct mem_map *mm; - vm_paddr_t maxaddr; - int i; - - maxaddr = 0; - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (sysmem_mapping(vm, mm)) { - if (maxaddr < mm->gpa + mm->len) - maxaddr = mm->gpa + mm->len; - } - } - return (maxaddr); -} - static void vm_iommu_map(struct vm *vm) { vm_paddr_t gpa, hpa; - struct mem_map *mm; + struct vm_mem_map *mm; int i; - sx_assert(&vm->mem_segs_lock, SX_LOCKED); + sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (!sysmem_mapping(vm, mm)) + if (!vm_memseg_sysmem(vm, i)) continue; + mm = &vm->mem.mem_maps[i]; KASSERT((mm->flags & VM_MEMMAP_F_IOMMU) == 0, ("iommu map found invalid memmap %#lx/%#lx/%#x", mm->gpa, mm->len, mm->flags)); @@ -1114,16 +796,16 @@ static void vm_iommu_unmap(struct vm *vm) { vm_paddr_t gpa; - struct mem_map *mm; + struct vm_mem_map *mm; int i; - sx_assert(&vm->mem_segs_lock, SX_LOCKED); + sx_assert(&vm->mem.mem_segs_lock, SX_LOCKED); for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (!sysmem_mapping(vm, mm)) + if (!vm_memseg_sysmem(vm, i)) continue; + mm = &vm->mem.mem_maps[i]; if ((mm->flags & VM_MEMMAP_F_IOMMU) == 0) continue; mm->flags &= ~VM_MEMMAP_F_IOMMU; @@ -1183,69 +865,6 @@ vm_assign_pptdev(struct vm *vm, int bus, int slot, int func) return (error); } -static void * -_vm_gpa_hold(struct vm *vm, vm_paddr_t gpa, size_t len, int reqprot, - void **cookie) -{ - int i, count, pageoff; - struct mem_map *mm; - vm_page_t m; - - pageoff = gpa & PAGE_MASK; - if (len > PAGE_SIZE - pageoff) - panic("vm_gpa_hold: invalid gpa/len: 0x%016lx/%lu", gpa, len); - - count = 0; - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (gpa >= mm->gpa && gpa < mm->gpa + mm->len) { - count = vm_fault_quick_hold_pages(&vm->vmspace->vm_map, - trunc_page(gpa), PAGE_SIZE, reqprot, &m, 1); - break; - } - } - - if (count == 1) { - *cookie = m; - return ((void *)(PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)) + pageoff)); - } else { - *cookie = NULL; - return (NULL); - } -} - -void * -vm_gpa_hold(struct vcpu *vcpu, vm_paddr_t gpa, size_t len, int reqprot, - void **cookie) -{ -#ifdef INVARIANTS - /* - * The current vcpu should be frozen to ensure 'vm_memmap[]' - * stability. - */ - int state = vcpu_get_state(vcpu, NULL); - KASSERT(state == VCPU_FROZEN, ("%s: invalid vcpu state %d", - __func__, state)); -#endif - return (_vm_gpa_hold(vcpu->vm, gpa, len, reqprot, cookie)); -} - -void * -vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, int reqprot, - void **cookie) -{ - sx_assert(&vm->mem_segs_lock, SX_LOCKED); - return (_vm_gpa_hold(vm, gpa, len, reqprot, cookie)); -} - -void -vm_gpa_release(void *cookie) -{ - vm_page_t m = cookie; - - vm_page_unwire(m, PQ_ACTIVE); -} - int vm_get_register(struct vcpu *vcpu, int reg, uint64_t *retval) { @@ -2684,6 +2303,12 @@ vm_vmspace(struct vm *vm) return (vm->vmspace); } +struct vm_mem * +vm_mem(struct vm *vm) +{ + return (&vm->mem); +} + int vm_apicid2vcpuid(struct vm *vm, int apicid) { diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 6e1501493082..51769faf5893 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -39,6 +39,8 @@ #include #include + +#include #else /* !_KERNEL */ #include #include diff --git a/sys/amd64/vmm/vmm_mem.c b/sys/amd64/vmm/vmm_mem_machdep.c similarity index 100% rename from sys/amd64/vmm/vmm_mem.c rename to sys/amd64/vmm/vmm_mem_machdep.c diff --git a/sys/arm64/include/vmm.h b/sys/arm64/include/vmm.h index acbd8f5cbcb9..1d783cdacb0d 100644 --- a/sys/arm64/include/vmm.h +++ b/sys/arm64/include/vmm.h @@ -150,38 +150,6 @@ void vm_destroy(struct vm *vm); int vm_reinit(struct vm *vm); const char *vm_name(struct vm *vm); -/* - * APIs that modify the guest memory map require all vcpus to be frozen. - */ -void vm_slock_memsegs(struct vm *vm); -void vm_xlock_memsegs(struct vm *vm); -void vm_unlock_memsegs(struct vm *vm); -int vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t off, - size_t len, int prot, int flags); -int vm_munmap_memseg(struct vm *vm, vm_paddr_t gpa, size_t len); -int vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem); -void vm_free_memseg(struct vm *vm, int ident); - -/* - * APIs that inspect the guest memory map require only a *single* vcpu to - * be frozen. This acts like a read lock on the guest memory map since any - * modification requires *all* vcpus to be frozen. - */ -int vm_mmap_getnext(struct vm *vm, vm_paddr_t *gpa, int *segid, - vm_ooffset_t *segoff, size_t *len, int *prot, int *flags); -int vm_get_memseg(struct vm *vm, int ident, size_t *len, bool *sysmem, - struct vm_object **objptr); -vm_paddr_t vmm_sysmem_maxaddr(struct vm *vm); -void *vm_gpa_hold(struct vcpu *vcpu, vm_paddr_t gpa, size_t len, - int prot, void **cookie); -void *vm_gpa_hold_global(struct vm *vm, vm_paddr_t gpa, size_t len, - int prot, void **cookie); -void vm_gpa_release(void *cookie); -bool vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa); - -int vm_gla2gpa_nofault(struct vcpu *vcpu, struct vm_guest_paging *paging, - uint64_t gla, int prot, uint64_t *gpa, int *is_fault); - uint16_t vm_get_maxcpus(struct vm *vm); void vm_get_topology(struct vm *vm, uint16_t *sockets, uint16_t *cores, uint16_t *threads, uint16_t *maxcpus); @@ -262,6 +230,8 @@ vcpu_should_yield(struct vcpu *vcpu) void *vcpu_stats(struct vcpu *vcpu); void vcpu_notify_event(struct vcpu *vcpu); +struct vmspace *vm_vmspace(struct vm *vm); +struct vm_mem *vm_mem(struct vm *vm); enum vm_reg_name vm_segment_name(int seg_encoding); diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c index 77c565e37264..ad82e6dbd432 100644 --- a/sys/arm64/vmm/vmm.c +++ b/sys/arm64/vmm/vmm.c @@ -65,6 +65,7 @@ #include #include #include +#include #include #include "arm64.h" @@ -94,25 +95,6 @@ struct vcpu { #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) -struct mem_seg { - uint64_t gpa; - size_t len; - bool wired; - bool sysmem; - vm_object_t object; -}; -#define VM_MAX_MEMSEGS 3 - -struct mem_map { - vm_paddr_t gpa; - size_t len; - vm_ooffset_t segoff; - int segid; - int prot; - int flags; -}; -#define VM_MAX_MEMMAPS 4 - struct vmm_mmio_region { uint64_t start; uint64_t end; @@ -144,9 +126,8 @@ struct vm { bool dying; /* (o) is dying */ volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */ volatile cpuset_t halted_cpus; /* (x) cpus in a hard halt */ - struct mem_map mem_maps[VM_MAX_MEMMAPS]; /* (i) guest address space */ - struct mem_seg mem_segs[VM_MAX_MEMSEGS]; /* (o) guest memory regions */ struct vmspace *vmspace; /* (o) guest's address space */ + struct vm_mem mem; /* (i) guest memory */ char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */ struct vcpu **vcpu; /* (i) guest vcpus */ struct vmm_mmio_region mmio_region[VM_MAX_MMIO_REGIONS]; @@ -157,7 +138,6 @@ struct vm { uint16_t cores; /* (o) num of cores/socket */ uint16_t threads; /* (o) num of threads/core */ uint16_t maxcpus; /* (o) max pluggable cpus */ - struct sx mem_segs_lock; /* (o) */ struct sx vcpus_init_lock; /* (o) */ }; @@ -235,8 +215,6 @@ u_int vm_maxcpu; SYSCTL_UINT(_hw_vmm, OID_AUTO, maxcpu, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &vm_maxcpu, 0, "Maximum number of vCPUs"); -static void vm_free_memmap(struct vm *vm, int ident); -static bool sysmem_mapping(struct vm *vm, struct mem_map *mm); static void vcpu_notify_event_locked(struct vcpu *vcpu); /* global statistics */ @@ -508,7 +486,7 @@ vm_create(const char *name, struct vm **retvm) vm = malloc(sizeof(struct vm), M_VMM, M_WAITOK | M_ZERO); strcpy(vm->name, name); vm->vmspace = vmspace; - sx_init(&vm->mem_segs_lock, "vm mem_segs"); + vm_mem_init(&vm->mem); sx_init(&vm->vcpus_init_lock, "vm vcpus"); vm->sockets = 1; @@ -557,11 +535,11 @@ vm_set_topology(struct vm *vm, uint16_t sockets, uint16_t cores, static void vm_cleanup(struct vm *vm, bool destroy) { - struct mem_map *mm; pmap_t pmap __diagused; int i; if (destroy) { + vm_xlock_memsegs(vm); pmap = vmspace_pmap(vm->vmspace); sched_pin(); PCPU_SET(curvmpmap, NULL); @@ -569,7 +547,9 @@ vm_cleanup(struct vm *vm, bool destroy) CPU_FOREACH(i) { MPASS(cpuid_to_pcpu[i]->pc_curvmpmap != pmap); } - } + } else + vm_assert_memseg_xlocked(vm); + vgic_detach_from_vm(vm->cookie); @@ -580,25 +560,9 @@ vm_cleanup(struct vm *vm, bool destroy) vmmops_cleanup(vm->cookie); - /* - * System memory is removed from the guest address space only when - * the VM is destroyed. This is because the mapping remains the same - * across VM reset. - * - * Device memory can be relocated by the guest (e.g. using PCI BARs) - * so those mappings are removed on a VM reset. - */ - if (!destroy) { - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (destroy || !sysmem_mapping(vm, mm)) - vm_free_memmap(vm, i); - } - } - + vm_mem_cleanup(vm); if (destroy) { - for (i = 0; i < VM_MAX_MEMSEGS; i++) - vm_free_memseg(vm, i); + vm_mem_destroy(vm); vmmops_vmspace_free(vm->vmspace); vm->vmspace = NULL; @@ -607,7 +571,6 @@ vm_cleanup(struct vm *vm, bool destroy) free(vm->vcpu[i], M_VMM); free(vm->vcpu, M_VMM); sx_destroy(&vm->vcpus_init_lock); - sx_destroy(&vm->mem_segs_lock); } } @@ -643,290 +606,11 @@ vm_name(struct vm *vm) return (vm->name); } -void -vm_slock_memsegs(struct vm *vm) -{ - sx_slock(&vm->mem_segs_lock); -} - -void -vm_xlock_memsegs(struct vm *vm) -{ - sx_xlock(&vm->mem_segs_lock); -} - -void -vm_unlock_memsegs(struct vm *vm) -{ - sx_unlock(&vm->mem_segs_lock); -} - -/* - * Return 'true' if 'gpa' is allocated in the guest address space. - * - * This function is called in the context of a running vcpu which acts as - * an implicit lock on 'vm->mem_maps[]'. - */ -bool -vm_mem_allocated(struct vcpu *vcpu, vm_paddr_t gpa) -{ - struct vm *vm = vcpu->vm; - struct mem_map *mm; - int i; - -#ifdef INVARIANTS - int hostcpu, state; - state = vcpu_get_state(vcpu, &hostcpu); - KASSERT(state == VCPU_RUNNING && hostcpu == curcpu, - ("%s: invalid vcpu state %d/%d", __func__, state, hostcpu)); -#endif - - for (i = 0; i < VM_MAX_MEMMAPS; i++) { - mm = &vm->mem_maps[i]; - if (mm->len != 0 && gpa >= mm->gpa && gpa < mm->gpa + mm->len) - return (true); /* 'gpa' is sysmem or devmem */ - } - - return (false); -} - -int -vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem) *** 1557 LINES SKIPPED *** From nobody Tue Feb 18 17:12:01 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5fn2hd0z5ntjF; Tue, 18 Feb 2025 17:12: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 4Yy5fn1SHCz3Cdj; Tue, 18 Feb 2025 17:12:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1np2SfSGZhjHFsVtBi/v+4kx5y1UW4Bhh+0C8O0tPUU=; b=P8SvcQp5MMKoo/CGj3f78Y+nrfp1ZAlwsB1n0qkNMeURdyKpG3T8o+aU6iFrNm4Q+TQQ9g AE/vxmexLt6hrYH/2CGG1ldG9E0CM32vJiv6G8Hx56AcsTFYEk7mDyxl7mtk54g8Q4roIs KwOtJfAeLU6hiEtzRTN2mVURqu+f4xr86nbJEoI09cBiqfq1si+/2TTtYGFAo/sOKXY/HC lDolYL0yWJJFRqZgr6lBwBtmRU9SnWd6WONmooerPQJ1TnJRl1luKcra3iDnbsCO0vyVGM q9dWokGI+0jMpq/layiGlQ3xiQhA5SW0Z9PB4kofbSvbHBlUbU+gY1X2ONaDfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739898721; a=rsa-sha256; cv=none; b=LYjz+3efb3Q5Jlj0Nay45EHAf7p5YQpuy9sYi7r74+o54E3NzbCwmjb7h4AWB3Y4tUD6mP OVVPgbKrgBfyP1pe4/KoZ0D2aMXNU27lEn201UJOAzGWIV92Plf8MaxT8JcqI9z1i0JPuC MKuzWp5vkkLHA97UjWPsSA7b/jKwMjBDlX8qb3ir47TbbkGgNuzFdmX95LNA2AFDZoRx4g h0Nripw2yoyZ/kr11JxgO3EtOdFZaOl1itmTEimRNngfRa1Ghp68cyHZRxR3Rw718W4qQ9 MsMO7GLufO86EpOGrEr12hE24IfvJY7Tzp0XGaoggpLe3cLLSe0AYlUcHOWJSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1np2SfSGZhjHFsVtBi/v+4kx5y1UW4Bhh+0C8O0tPUU=; b=l3zZnQwYkF7l45CB0TouQwcOobNwsaxjKABoxzUAYL0M2dLMxOmF0eiXo2j2cFfNVWybmo CdEQbH+WRCv9pYwWZkOh+TysNvXHgiOVO6SPg0fNa6LtYcjh6R9+1529bG/g3s03WixA0/ kRqxPJNkp7gyj6vtV+43Qj4JWfxVpiSbcphV/j/SHdtPDO1XaNoEfYdJ2NaRh6qJIGEgbP KtFrAk/h3kxHMcYhbpB1Of0HWTGg0f2GrKrpF5/SdDNpahChL5JxPOceVpaVhLJNksIznW FMMB5BYifC1xVY8rnrxZnWU/YP8qll+yGujpM+G24ewYOeEQXfc1lxxFyMeTUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5fn0sCTzCgP; Tue, 18 Feb 2025 17:12: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 51IHC1lJ064634; Tue, 18 Feb 2025 17:12:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHC1b1064631; Tue, 18 Feb 2025 17:12:01 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:12:01 GMT Message-Id: <202502181712.51IHC1b1064631@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 521f66715afb - main - ntpd: Use the ntpd -u option in preference to the rc su plumbing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 521f66715afb312b356afafc68cbc044a436a753 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=521f66715afb312b356afafc68cbc044a436a753 commit 521f66715afb312b356afafc68cbc044a436a753 Author: Cy Schubert AuthorDate: 2024-12-12 20:03:09 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:11:38 +0000 ntpd: Use the ntpd -u option in preference to the rc su plumbing Using the rc plumbing to setuid(2) is preferred as it allows the user to use the -i option in ntpd_flags to chroot ntpd. Chrooting ntpd by default will be a 2025 project. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D48191 --- libexec/rc/rc.d/ntpd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index e7e42da8acc7..8babda09455c 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -101,7 +101,6 @@ ntpd_precmd() # by the admin, we don't add the option. If the file exists in the old # default location we use that, else we use the new default location. if can_run_nonroot; then - _user="ntpd" driftopt="-f ${_ntp_default_driftfile}" elif grep -q "^[ \t]*driftfile" "${ntpd_config}" || [ -n "${rc_flags}" ] && @@ -115,7 +114,13 @@ ntpd_precmd() fi # Set command_args based on the various config vars. - command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}" + command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}" + + # Unset ntpd_user because rc.subr uses $${name}_user to determine + # whether to invoke su(1) to setuid() to $ntpd_user for us. We want + # ntpd to do the setuid() itself through the -u argument, above. + unset ntpd_user + if checkyesno ntpd_sync_on_start; then command_args="${command_args} -g" fi From nobody Tue Feb 18 17:12:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5fp3rxhz5ntCl; Tue, 18 Feb 2025 17:12: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 4Yy5fp297hz3Crj; Tue, 18 Feb 2025 17:12:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Nh6w14V13dU0Yh3Mff5BibdDS/yJ4ffCrop/aO8d+8=; b=DmqXUxVO9/MrL+bFdU7HJl4oCMzkwcAxC8x8dDWD4Qw1OkOGDbAsTB/acmZThksypV7kqv 3C49MZOEHTJ6EIJTD17MulT6Dtx4eK0ImyJgPzOxyYji1e2HjZjQll+fWzIxKbvEM3yAqa L++gDjaPoy/h6+d3RvIkvUE5cPjxV+r59UVAle1la2Tue6QoL1EGfM9LjxtbviR5mnCxeJ birOyPVDeVAzfhC0SMS4/DzanUamreyjkc0u1R5nw0NMncKUanjf5k/CkEpiTf2mzDlcmS 5WzDaHZA+NQjqCjYMcQETHzZtKc7A8SzK1VJKD4DJc1b6BKEyMUvml/ldCgcbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739898722; a=rsa-sha256; cv=none; b=JTb4bNofG8zICRlgeNZUcmuzc+Q5bcqxp/+oBrTbnw0gd9IfQboLQkgJ9e7LpRAkMbb+Zp mwdIGMS3thLwsp8/2AWWtCJnY7tJ4L+qjwLFe9+2HZmbSrnVYR2LWH9qc+/BhQ7UENEd7x jaahEhVjyeDBqlDx2g+SK/ezDcYvOjBV7cexvYVgxmNSAtrzoDk199AQA1sGSLsDRZe3a4 stnG7q4UjTiO75lVAb0LMh6LKs8bofTt7HVMFKVjNqEev/bBhMbQgTe9pAT7QphjEqhdjR I0N9EM/9yQIRqlmdKv2dxnVQyVtkEghX1Nbibfq7ha57OhUr4qhXQMVtWyBsSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Nh6w14V13dU0Yh3Mff5BibdDS/yJ4ffCrop/aO8d+8=; b=ZLshDDQv2hB7/INfUGdikrgbcK5fm6EyoIGdhGM5lK8t5Q2IhH3PLxdAhY1twfZEadbh0/ l/EilyzIPo/5DSVssEv5QGbGgM8Drx9nTAFOULk4nLWF4bfbAHH5+GTzkgsA5dUrYeutsf f/fAWxrnf+gAThT0/jRjDhvhnYX07I5I2+03gJIGRPXHrAPZ05bbZ9ngA1/4QI5RKn2ATj nX0OzWMlQuHWpjSgxlsYurGKzN5jtYr8IIgdEN6TO/s/83yVMKmZAkNX5vmd5bi5wOr6N8 SvvlbHPCHJlo3LVsApizYHdfGhkiQk01J9CawUZsGF4OVw7FuwKq+R6g+8OJMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5fp1n5NzCd2; Tue, 18 Feb 2025 17:12: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 51IHC2hq064672; Tue, 18 Feb 2025 17:12:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHC2Jk064669; Tue, 18 Feb 2025 17:12:02 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:12:02 GMT Message-Id: <202502181712.51IHC2Jk064669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 381956e26756 - main - ntp: ntpd does not connect to NTP server with link local IPv6 address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 381956e267569031883a516e10446c29490ee41d Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=381956e267569031883a516e10446c29490ee41d commit 381956e267569031883a516e10446c29490ee41d Author: Cy Schubert AuthorDate: 2025-01-31 22:25:14 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:11:45 +0000 ntp: ntpd does not connect to NTP server with link local IPv6 address Upstream bug 3943 (https://bugs.ntp.org/show_bug.cgi?id=3943) discusses: Starting with 4.2.8p18 ntp does not synchronize or even connect to the configured NTP server any more. ntp stays in .INIT. state indefinitely and checking the network traffic shows that ntp does not attempt to contact the NTP server. This is regression introduced by the fix for upstream bug 3913. This is a similar bug I reported upstream (ntp bug 3841). MFC after: 1 month --- contrib/ntp/ntpd/ntp_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 9d79fe493d9b..0df543c5af04 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -3205,7 +3205,7 @@ sendpkt( } do { - if (INT_LL_OF_GLOB & src->flags) { + if (ismcast && INT_LL_OF_GLOB & src->flags) { /* avoid duplicate multicasts on same IPv6 net */ goto loop; } From nobody Tue Feb 18 17:12:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5fq75lZz5ntjH; Tue, 18 Feb 2025 17:12: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 4Yy5fq2rWwz3Cws; Tue, 18 Feb 2025 17:12:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O/gyU7b2oloQdrEDAn8x9kyEGKr3Wip6xxxdhjE5N0Q=; b=E4mjRGk9M4SYg5hfGAuauXZWAFvAMPqXJX7nhFagy2njZ8BgEnwxT85J+O+HIswXPsKAop 4aObMTCSK6NEcDWBpycqoDyLJGPC1gOJaU1zvKAzisCDxxEA8YedTFoLplcm8TFX/lkZ3I Qbr1HbdSJLgiI392g5GqhK5jzTgW2K6gEsU0QRzM0GYuTDVlXjtuTxkMdEwF6FBxLtpkHO Z2PL7/uisa0/C4EmGpPT9GQTKIVyKfw8ijN5H17CwOHFj9C6436otO+0q+lh/yaK4mcZXP HGvKzt4NdZfspuckqPbx6NRvTrvA0wm3Lkv4eeniKbCDMmHGYQj6sFKKgqBrjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739898723; a=rsa-sha256; cv=none; b=HPHCEuS7e4CMbecz5/AQMX+HQ+wmFFT+wintDcuYg58O8Lv6jfYod0DiDigKAbwS6sTuBB YN0l8ILu+c35T0w1my78sdu5ZEbl5BuUv87Hnfz9wG36qOwtZftC9YtcpZ1SLYyvQJZxJ/ Hw/J6Zizy+7E+2NZ0pR/6iR1TtZ3vsdjUy3NY2f2dnZUYTp+jsCH8gcNhPyLwuTOMFinEz 8KIG75dd4nQMGg4JViztNl6CJLsxS/ny9i6bHuyYAEi75PyTGYfChdVtfJXCPgTLh3bWSE Sozg38Ba0bk2touzLgTAv2fR+NAQ9r1IWAFTd9YJSXW33NqHNG3AaCn1sOTjrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O/gyU7b2oloQdrEDAn8x9kyEGKr3Wip6xxxdhjE5N0Q=; b=G9vejBZkbBbYM105CrLI/JieQzyZju13qzUhNIBS56bqpj3VZ5rEFZqHG7oBHBjECl3yiE 8W990nWDAWy6qBbippX6EkyiRwkl0ahGGeJd342nW2O40lJeKNgxOP82SiTgVvtV+GM5Na bjDByqfcO5rXmAdbfUmWLIjx5oi4izMIFIESmZlxptRyAocqbJBvbxs4a4oQNobWv6oUSy +8mzVmrBEUGQzTpVdX2++zia9849kOkKXXqZQ1xFNlXvawmmM7Ww7lLOaW1WJQY/Hp0poS 9u7DQlk4wjvqD5+H+5dNTWWnzusUQMswTMNZ0hKSN0CFDKakn1J1/C/fqBAVvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5fq2RmkzCq2; Tue, 18 Feb 2025 17:12: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 51IHC3Gw064709; Tue, 18 Feb 2025 17:12:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHC3UV064706; Tue, 18 Feb 2025 17:12:03 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:12:03 GMT Message-Id: <202502181712.51IHC3UV064706@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: bc02e6558720 - main - ntp: Replace the workaround from 98e34e8e2557 with a patch from upstream List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc02e655872021595c434850fbcbdb8dd11d4a46 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bc02e655872021595c434850fbcbdb8dd11d4a46 commit bc02e655872021595c434850fbcbdb8dd11d4a46 Author: Cy Schubert AuthorDate: 2025-01-31 23:36:59 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:11:45 +0000 ntp: Replace the workaround from 98e34e8e2557 with a patch from upstream 98e34e8e2557 circumvented an upstream patch which caused an IPv6 pool regresson. This patch removes the circumvention and replaces it with an upstream patch planned for the new release of ntp. MFC after: 1 month --- contrib/ntp/ntpd/ntp_io.c | 4 +--- contrib/ntp/ntpd/ntp_proto.c | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/contrib/ntp/ntpd/ntp_io.c b/contrib/ntp/ntpd/ntp_io.c index 0df543c5af04..6a796101b0e8 100644 --- a/contrib/ntp/ntpd/ntp_io.c +++ b/contrib/ntp/ntpd/ntp_io.c @@ -1486,9 +1486,7 @@ is_linklocal( if (IS_IPV6(psau)) { p6addr = &psau->sa6.sin6_addr; - if ( IN6_IS_ADDR_LINKLOCAL(p6addr) - || IN6_IS_ADDR_SITELOCAL(p6addr)) { - + if (IN6_IS_ADDR_LINKLOCAL(p6addr)) { return TRUE; } } else if (IS_IPV4(psau)) { diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c index f9605b8feacb..170294c68bb6 100644 --- a/contrib/ntp/ntpd/ntp_proto.c +++ b/contrib/ntp/ntpd/ntp_proto.c @@ -471,7 +471,6 @@ transmit( return; } -#if 0 /* [Bug 3851] drop pool servers which can no longer be reached. */ if (MDF_PCLNT & peer->cast_flags) { if ( (IS_IPV6(&peer->srcadr) && !nonlocal_v6_addr_up) @@ -480,7 +479,6 @@ transmit( return; } } -#endif /* * In unicast modes the dance is much more intricate. It is From nobody Tue Feb 18 17:12:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5fr6xw1z5ntMF; Tue, 18 Feb 2025 17:12: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 4Yy5fr3wZFz3CbD; Tue, 18 Feb 2025 17:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ZGQIV4FcU7l23wgtyWTJJwuPe+195DKOujd4B+X81Q=; b=Sff/Wqy9a5iNXufJ0mlr4TrsjgJQ8cVmmjra2s7bDtze88nzEPF3RYNu9Egb1w6NJTi2u/ 7vLFljCQeVtEn0SkzpAhs5yH5/YiG43U8c3tWaFwc6VNHBXmBu4ffdg7NkD63NyrSugTPF tMlETvzk6VQP69gO5DxjkSbEA932CV3JBEy4eaWJw5X3+/gnQF5UZDe0ROedGhuJlK9oPj 71Dz8MBIrEjA3gX9EzzCKs7RHen/5uAL/wYqxiq/iO2bZTZrE1lYMQvbrfvQtB/W4agIJM c5NPZ5WLJ8zNMBWaqlWPEwqa4T2BLpy/J6QqC/ZwbMIdCGjjyH0aY9M5eRYvpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739898724; a=rsa-sha256; cv=none; b=XdhPGy/RSyYbi3lW5/rNPwHMO01N7JT5CGklbHJBLufG8BfOuHipgvvTYBcfzqp10TteXG +UZihJfJ+J+OJxwZpW2Lm7EnUvwr5a3a1Roy84HxNBSDdOg7tggEiiCsNIg6hdnrXZLLFt ijt34uLq9uuTxnd/Rs5EgiIRZRYC0dxJ3QD9MnHjdRQgJnXuLF0ezQ1RBij+ze30K/fDvZ 2l9B+h6L75YCNmwm15k2vM990FoPnce8c6Sqyums+mZHLAU/zFNBu3Gy0bC286WeeHXTdo HBsFI9NteFdS8jOmithjp4neVQrGzbipGgRnEPiGYcQpU6UrN8gD1/kWXUi1ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739898724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ZGQIV4FcU7l23wgtyWTJJwuPe+195DKOujd4B+X81Q=; b=dpfngjbS/Zx/6C+B0FvL0NreP9jUwVCnXGMD0oLEEqu0pHLrZbccaGLXWQegbfw82A3gCP w0raHCWtKqatdBu+toewsIAMCdg3k3TuFcQHgEZWWS1uNClZKH5lZyth5tY+z04LgOg2qB lwGMoCh7fYh3xXMVgkt4H34fA6ZrDxgC/OmEEGTMq1fPVwUqzBqwbpoxhf5h6n3XMgJYPS b3tTxsTaQXOaXFUNvJk3rFCvKwSthhMMG4lC/WfUUE33lW3GuwqpSbdBjsNp4P2LR3p+Yj aJF2NlMM/BOUMgg5zGe+yloBOR4EzZDtAGEnxl5UVqpQeQ2TOmeM/YVJ1hDSMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5fr3QfvzCgR; Tue, 18 Feb 2025 17:12: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 51IHC47M064747; Tue, 18 Feb 2025 17:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHC4FY064742; Tue, 18 Feb 2025 17:12:04 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:12:04 GMT Message-Id: <202502181712.51IHC4FY064742@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c1767cf87cb6 - main - ntp: Another patch to address IPv6 pool regression List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1767cf87cb64c25426fd7fe119be283b134509a Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c1767cf87cb64c25426fd7fe119be283b134509a commit c1767cf87cb64c25426fd7fe119be283b134509a Author: Cy Schubert AuthorDate: 2025-02-03 23:16:08 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:11:45 +0000 ntp: Another patch to address IPv6 pool regression 98e34e8e2557 circumvented an upstream patch which caused an IPv6 pool regression. This patch, discussed in https://bugs.ntp.org/show_bug.cgi?id=3958, addresses another unworkable combination of link-local local address with non-link-local server. MFC after: 1 month --- contrib/ntp/ntpd/ntp_proto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/ntp/ntpd/ntp_proto.c b/contrib/ntp/ntpd/ntp_proto.c index 170294c68bb6..2e0d221c8472 100644 --- a/contrib/ntp/ntpd/ntp_proto.c +++ b/contrib/ntp/ntpd/ntp_proto.c @@ -474,7 +474,7 @@ transmit( /* [Bug 3851] drop pool servers which can no longer be reached. */ if (MDF_PCLNT & peer->cast_flags) { if ( (IS_IPV6(&peer->srcadr) && !nonlocal_v6_addr_up) - || !nonlocal_v4_addr_up) { + || (IS_IPV4(&peer->srcadr) && !nonlocal_v4_addr_up)) { unpeer(peer); return; } From nobody Tue Feb 18 17:17:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5mw1yLpz5nttF; Tue, 18 Feb 2025 17:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy5mv4scGz3Hrl; Tue, 18 Feb 2025 17:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739899039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MzSLDZw8DCJQBN5JDope1FSPhc1sNOnyhkqL3slCAJI=; b=NJJqLbActvPVp3wUxzSJohjFM0tiqUwdr6KZ3S0oKyzwU41N07H8YuPbwsyTLdQEfJMqj7 7LF+OvhKe4BlV3qj5z0b/CVAq9Yq8I+AO1+IY92ISwbWvZ7Fx1ByADyhRtA/blXOu8fFPf QaFVI9knhEhQq6uK+b6hKDkawXfnsQXPqvqzPqkOxij+G4Iq+fTnxgxnlvEEtNXQd4mQP7 3/7wb8xwQOGi0MEJPFkrB53UKFKTZAoafLarH58LhpVB7rUpvdzqtax4SUuYUV5suxV6Ro mZA+pAw06OyQSJqIdLad5SRskzhf+JjOrQjVsszU9x2PZ+e+Et6m06ELq1PiWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739899039; a=rsa-sha256; cv=none; b=HEtcSnVm5q5/11K1hP3RHczi0Ctn9dXPsBBJkXveTJ5m8tsAyEqOUIHmhDVrGcft3lZs2Y U/CK6Tf1HxVXyDQj77iEDMeIAxe3mXt3StvCbUeCUcr9w2D7oEOpX7NYES6I1BxKBrUAgF snbWrhBbvDo02WbZ0DJ+mZwngvCFk+JEozIbInxloKAj4VV4dcaY4rcluSuU60r/BInThR oJZMkd1UhiX7ghEfYKVrKWeF/gwOFy1osSUpDlN2aO9TT4uC2bKst6xGqfR3x7WsW0PYhM n2D+vElHl9FfiQ7KbJIaxZqT4MSuqk4Vs1oroHS6jFoTgZbir04B3wdWD3/eSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739899039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MzSLDZw8DCJQBN5JDope1FSPhc1sNOnyhkqL3slCAJI=; b=AC6sZrNcK/0XJ8561cIgv1/DZSpQ1btPK4CSZvw8dulfTP8w97x5yrfKRIv4WmRYlk6psJ r3PO2pxkRoRCfIz8DMM4gVGnzj3s8SX9lU/kOCUX+eIQovOG9TGYK4w7rVW2MljTkG0qxI VTfLVGwMzZGTOhr2hALhlnDkdMguOd3WfeaZSb+zGFBU6+K56I0pNywd2kYqzSjPKPwvZt CqCsLAeweDPvEd3C2fcgiUSWMlNOQ6y+guCubTTUSEq3HqYfbGPRELeqhxu5pbHD4CIiWe asqG+u8AT66emm5maN2t3530rwZBYEEAB8524gWxz6F2uvFmUDf4IApRl/tc5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5mv3yVbzCgW; Tue, 18 Feb 2025 17:17: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 51IHHJMc066358; Tue, 18 Feb 2025 17:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHHJhH066355; Tue, 18 Feb 2025 17:17:19 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:17:19 GMT Message-Id: <202502181717.51IHHJhH066355@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 1080f5315427 - main - shar: Handle special characters or white space in file names fed to shar List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1080f5315427b382221651b342227b4923106f83 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=1080f5315427b382221651b342227b4923106f83 commit 1080f5315427b382221651b342227b4923106f83 Author: Cy Schubert AuthorDate: 2025-01-02 03:35:31 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:16:48 +0000 shar: Handle special characters or white space in file names fed to shar Obtained from: NetBSD hg commit 365370:124268924386 MFC after: 1 week --- usr.bin/shar/shar.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 13147c3bf4ed..3a7bf2db41e5 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -61,14 +61,14 @@ echo "#" for i do - if [ -d $i ]; then - echo "echo c - $i" - echo "mkdir -p $i > /dev/null 2>&1" + if [ -d "$i" ]; then + echo "echo c - '$i'" + echo "mkdir -p '$i' > /dev/null 2>&1" else - md5sum=`echo -n $i | md5` - echo "echo x - $i" - echo "sed 's/^X//' >$i << '$md5sum'" - sed 's/^/X/' $i || exit + md5sum=`echo -n "$i" | md5` + echo "echo x - '$i'" + echo "sed 's/^X//' >'$i' << '$md5sum'" + sed 's/^/X/' "$i" || exit echo "$md5sum" fi done From nobody Tue Feb 18 17:17:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy5mw6KVWz5ntSQ; Tue, 18 Feb 2025 17:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy5mw4l0Nz3HpX; Tue, 18 Feb 2025 17:17:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739899040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ttguwk5opVHmmQS4xoqD4F/+4Kz/R7Snhm4fFbjM4u8=; b=U2p1xkPyLDze87JP3B3ancT/y9zhD+dNMh/iDp+1S+y/Ty0XCUs/hwUFlRj3FlDIh5qPUu JCuU3AwFGrubdjkTUGgbSxl9kyVsYpQBxFM6+PMFQ3Muy7i32oy0wiCJE5Rfoy2rjGz5lF Dm+VHcBZMe9Gb83/by/x1O9Ks41g1Kq0NoG3mlBuwP7V0Qylrn9oP/Yb+1Jtn2lSP0J65c V2a8CMgfbtMf1v6uUzr60LTC5lYNvYyovSwCCRDkopbZ4V8l3zGn+IPTqlMkJVB/5GIg52 EtJeZWyo5Bg9iuVyzPWMqLa10RnAgASQqGD/ZbJr9F9jTkJ0bsNISGfHK4GigA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739899040; a=rsa-sha256; cv=none; b=GjjeB8BJJVAjXLg505RLOFkDrnSHFuD/S6FBomIbZfzXm3VicC19u0bL4GtvbhLr/GaKxg 0JjapWnMWHtUznAfVHylo2JoTQ4Rww5Ny1iC8vn1EMXX7bpkA/QDCGzalVKplW4/7j1Aqs tqBqCe4EX3G1VjQke88GJv6kNFmB5Xn50VW7xYUnyh8nxCagho5jOldO+DKjXJKWjA4QdW YITw16wtYI/B9s+tRodnZ4+trPeorTtH1ADRGC4aL/mVIocqw+sS9ta4Kgm9AabN1InHbw 8SLhhGWMraXDTT5jVDN1eU+pg8t/s//TnzO/NWx/gHcTWGTT+Zc3cvlXYtGXvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739899040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ttguwk5opVHmmQS4xoqD4F/+4Kz/R7Snhm4fFbjM4u8=; b=iVv1IoE6bCJd2HQQRxi5X7QcySVQjl02q6RsketpFgfRGYW0maHlfBGrxlTgv7mn9DiHOm 8gObHrutXCRIyEJHzceNqdbVNcqI5fImuoWD4tgk2NmhRgARBqq97MeAkBRUHztPI5UHH9 wLwmecQqffYlkYYKkLduQbpIXjtK8jXzB7KLSp79ZFmhVf0BNoR7+HeLgaRctQ/PR1MiDV gXC2wX87M6IhpIIs2zXa2FGYNuA95bNUen3PuwA/8JGKkhvU6/AEd4nBgmAK9WgoFLJGjD vIOb9DszyTldwAzK59bZSU+fUp/srJZt2ZDGMnk4yWZNLdFWPxoV7JThV6r10Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy5mw47fLzDFY; Tue, 18 Feb 2025 17:17: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 51IHHKdq066391; Tue, 18 Feb 2025 17:17:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHHKxx066388; Tue, 18 Feb 2025 17:17:20 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:17:20 GMT Message-Id: <202502181717.51IHHKxx066388@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: f0c8d2cd622a - main - shar: Make sure a sed failure in the generated archive results in failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0c8d2cd622a47e06c08620a10e13ad7519e9102 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f0c8d2cd622a47e06c08620a10e13ad7519e9102 commit f0c8d2cd622a47e06c08620a10e13ad7519e9102 Author: Cy Schubert AuthorDate: 2025-01-02 03:44:18 +0000 Commit: Cy Schubert CommitDate: 2025-02-18 17:16:48 +0000 shar: Make sure a sed failure in the generated archive results in failure Obtained from: NetBSD hg commit 365369:21b92f0055b4 MFC after: 1 week --- usr.bin/shar/shar.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/shar/shar.sh b/usr.bin/shar/shar.sh index 3a7bf2db41e5..52c31b419fc4 100644 --- a/usr.bin/shar/shar.sh +++ b/usr.bin/shar/shar.sh @@ -68,7 +68,7 @@ do md5sum=`echo -n "$i" | md5` echo "echo x - '$i'" echo "sed 's/^X//' >'$i' << '$md5sum'" - sed 's/^/X/' "$i" || exit + sed 's/^/X/' "$i" || exit 1 echo "$md5sum" fi done From nobody Tue Feb 18 17:48:15 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy6Sb6KVqz5nx31; Tue, 18 Feb 2025 17:48: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 4Yy6Sb5V9Tz3cRZ; Tue, 18 Feb 2025 17:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739900895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ViuegrhgtRbEmzrT4P0T9Px5mWD1x1GHhSsbOCH+R50=; b=sRS1q2NSpt83iW8BxpUzp8rAgW8DWSl0VoozlKc9anojKz4UxwTWwPRg36Tghg2T2u2YSM tFQq+Pw2+0EX4+0bAS4q5ybZ0ooNle/ocjsSrl1R2H1kJQ/YryxitrAKIt9Y5uj/d+K+rI 6MxBGkKfTe4DPpQtH2iftpOZB5HHr5RHwR08O9ola+OmfSdNo+0AYya24G3a5qkgdiAfEO lv7Uidzm8utb9BHxxms88k3x8C8PbY+Aj/pq6PnjFLlm3ph6V+P7kuGnsJnkyluWO95vls y0rhaE6S/XPOHDqfpomZuSjCFo+AO+Nx/JAfNbCAeS05RsEQYG/wLlDEkDFSvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739900895; a=rsa-sha256; cv=none; b=fMw3yVxQsw8essu4/uxt2t3H1S1SYCcWv5+OA6MM6f0/V6YmZN2bIRJUEfJ+iYqtFQ10s7 2lqxdAgEEwnMyT34x0qHT7w2RgyjVv2kEFFCeqwvE4mXboXbqgKqcSOMvjr0n/8qVV5475 p8ImX1YOAKcO1IKdbKV52IxXQ+2CX3eOz2Kc2FaLzHdcVDybpZu5PorWriX3FTpbz+wWjZ BQD/NJeOsGvGW7njIQXO+BJ9+V0jQdsqhfJt91x3XOosnic91vt/5x1FcGhyLQ9i6Izyt3 jIlEWZCMxYQMU7eootT5YZf88wdmXBtfl23sXx3y2FoKEHaMhRGhtocpq/m3dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739900895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ViuegrhgtRbEmzrT4P0T9Px5mWD1x1GHhSsbOCH+R50=; b=GujJ3vAN+c4xP3qYsQxqz9FHNLHdcWIHDUuRLP2N2gcPIIj9h+WKC6ZML9mf0AvfyVaGwn fttKwYqZDJNN7pqmG3DRF+aqjvZd77FNeTMJ9vOqzQ7NrAX4t7GcZm2KCS2QUPVSzsgWtv uhK3GzQXddg5+NFAcSNnayk+bRqiVzt7/kRa/3JK+qM2zWNG7yr71m/nIRZ/v4QtVXUGzt 3gRmjq8UPaarCllfAXcBBIZoY+7BUyxFNmqPk0dBjzPCGHiTYeEI4beQ6kx5enTdBXJlJv pnqMNMwrco8+Fpd7uutJudT7sNqn+8+QAY9Abw1YW6EkO68AnU5a91/sipsqdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy6Sb52GPzDWQ; Tue, 18 Feb 2025 17:48: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 51IHmF30023081; Tue, 18 Feb 2025 17:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHmFpb023078; Tue, 18 Feb 2025 17:48:15 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:48:15 GMT Message-Id: <202502181748.51IHmFpb023078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9f284aad585e - main - full-test.sh: Update to 14.2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f284aad585e4531d8f72b193f7b08fac0d29e21 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f284aad585e4531d8f72b193f7b08fac0d29e21 commit 9f284aad585e4531d8f72b193f7b08fac0d29e21 Author: Warner Losh AuthorDate: 2025-02-18 17:43:01 +0000 Commit: Warner Losh CommitDate: 2025-02-18 17:43:20 +0000 full-test.sh: Update to 14.2 Update the cached things we use to build the tests to 14.2. Also, reduce the nunber of architectures for now since there's problems with the other ones (do this by restricting the default list, rather than removing the code). Sponsored by: Netflix --- tools/boot/full-test.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/boot/full-test.sh b/tools/boot/full-test.sh index 89d2ac3b7277..bdb030361b1f 100644 --- a/tools/boot/full-test.sh +++ b/tools/boot/full-test.sh @@ -19,8 +19,8 @@ # What version of FreeBSD to we snag the ISOs from to extract the binaries # we are testing -FREEBSD_VERSION=13.1 -# eg https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-amd64-bootonly.iso.xz +FREEBSD_VERSION=14.2 +# eg https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-bootonly.iso.xz URLBASE="https://download.freebsd.org/releases" : ${STAND_ROOT:="${HOME}/stand-test-root"} CACHE=${STAND_ROOT}/cache @@ -40,7 +40,8 @@ fi # All the architectures under test # Note: we can't yet do armv7 because we don't have a good iso for it and would # need root to extract the files. -ARCHES="amd64:amd64 i386:i386 powerpc:powerpc powerpc:powerpc64 powerpc:powerpc64le powerpc:powerpcspe arm64:aarch64 riscv:riscv64" +#ARCHES="amd64:amd64 i386:i386 powerpc:powerpc powerpc:powerpc64 powerpc:powerpc64le powerpc:powerpcspe arm64:aarch64 riscv:riscv64" +ARCHES="amd64:amd64 arm64:aarch64" # The smallest FAT32 filesystem is 33292 KB espsize=33292 From nobody Tue Feb 18 17:48:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy6Sd5Bgnz5nxBK; Tue, 18 Feb 2025 17:48: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 4Yy6Sd2WBnz3cVV; Tue, 18 Feb 2025 17:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739900897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E55PdLEICWNxYiUHWC2eL+LBfeKKuOrnKkGgqkvc74I=; b=YOuoYfxc6fQDJFeJXUZepdp/9dEmFmyQ+0C+HERATJP8UbnHkdWs3dAcCXVeyju0DYFXMD AEetq9owruHQZpu7IySXZyOAmvMnJpvcFUz7q+u33ypDeoUMQdOdTGg9jKTL4tvMfYY0OH SWH+vMPWMECuQLtoUDUrVDZhniR82AzuoXVedrOylDpttYd7NmbhJ85bNq1rAGOZKQLSPu PPnVye2dWWovNbRAMkJ/PJFp22KK1vk6YA3XdnCKjyDMt2NPfcqWi8kSbtICZst7bH4qYe kkavZCJ0zN4BH6ejInTgkoi30KYx/yC8SjyAFd5q3tb9cIbFZe8vYbPmiQaK+Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739900897; a=rsa-sha256; cv=none; b=yfu05q2UtiBRI/L5VJnhLUtDE1LA9DmK461EmXTzW8IJgbiuHXSurQ88Zp3ZrJ7DWiv25J onVxJKV5dalH91jEywCXTNm/3goRQr7o3xipBBq52V5TacblX7Bs43C1duw0Oehj+R6DlQ Pw7JcNx17p0f2C3lnGCO8UDDp0hTFlrQGjjJnAAri0hwnIkqba76bRakVj/OQNz+VCvKdk qQNoQwcql7qd3L37lhrz+m86/0InmCAJ77R9Bn+zQkAX83POqdGlckgAJXnKyyaxDp6O9b COwsPKHGSldKjEw7SLRz5aOPM29HGwgw0ZNgCfX53eKb96uSlJCWjuIIFWB69g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739900897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E55PdLEICWNxYiUHWC2eL+LBfeKKuOrnKkGgqkvc74I=; b=H23FpN/cq+xxE7OIkliDowOUoyel8l7Jg3piKRnBssq6L2racQdhGFzNuleOerISq2rZMz Y7d2NMnJkeGvvhr7heKv1jlvLpq4yKZuN5Db4cGT+YdX0MMa/ODfYpa1tcR9Vc8001Xj40 JOGL04h20NW9+PMaIuVeWmSvg4oGC3+OyOnZI4hRJPnAxu2Iesn954KjZsJwRsuACfPoDC L2yBwknGzRCexR8tKDR+9y+iDMCwmzCCB5vlqvUA5OdseO1iPb7x4N+dvGTzAW2sZWY75A DyrIvhB957nowNoOvW26o+IVHYTkV2TUbVnsvyz0Je2wkXRb8mLapaDiyqDe2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy6Sc5ynczTZn; Tue, 18 Feb 2025 17:48: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 51IHmGmn023113; Tue, 18 Feb 2025 17:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IHmG8V023110; Tue, 18 Feb 2025 17:48:16 GMT (envelope-from git) Date: Tue, 18 Feb 2025 17:48:16 GMT Message-Id: <202502181748.51IHmG8V023110@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 006aaafd3552 - main - full-test.sh: Support running on macos List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 006aaafd3552fefcd615efc200a48d6fa864aa28 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=006aaafd3552fefcd615efc200a48d6fa864aa28 commit 006aaafd3552fefcd615efc200a48d6fa864aa28 Author: Warner Losh AuthorDate: 2025-02-18 17:43:06 +0000 Commit: Warner Losh CommitDate: 2025-02-18 17:43:20 +0000 full-test.sh: Support running on macos Sponsored by: Netflix --- tools/boot/full-test.sh | 80 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/tools/boot/full-test.sh b/tools/boot/full-test.sh index bdb030361b1f..370088f120bb 100644 --- a/tools/boot/full-test.sh +++ b/tools/boot/full-test.sh @@ -30,6 +30,47 @@ BIOS=${STAND_ROOT}/bios SCRIPTS=${STAND_ROOT}/scripts OVERRIDE=${STAND_ROOT}/override +# Find make +case $(uname) in + Darwin) + t=$(realpath $(dirname $0)/../..) + # Use the python wrapper to find make + if [ -f ${t}/tools/build/make.py ]; then + MAKE="${t}/tools/build/make.py" + case $(uname -m) in + arm64) + DEFARCH="TARGET_ARCH=aarch64 TARGET=arm64" + ;; + x86_64) + DEFARCH="TARGET_ARCH=amd64 TARGET=amd64" + ;; + *) + die "Do not know about $(uanme -p)" + ;; + esac + else + die "Can't find the make wrapper" + fi + ;; + FreeBSD) + MAKE=make + ;; + # linux) not yet + *) + die "Do not know about system $(uname)" + ;; +esac + +SRCTOP=$(${MAKE} ${DEFARCH} -v SRCTOP) +echo $SRCTOP + +# Find makefs and mkimg +MAKEFS=$(SHELL="which makefs" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No makefs try WITH_DISK_IMAGE_TOOLS_BOOTSTRAP=y" +MKIMG=$(SHELL="which mkimg" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No mkimg, try buildworld first" +MTREE=$(SHELL="which mtree" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No mtree, try buildworld first" + +# MAKE=$(SHELL="which make" ${MAKE} ${DEFARCH} buildenv | tail -1) || die "No make, try buildworld first" + # hack -- I have extra junk in my qemu, but it's not needed to recreate things if [ $(whoami) = imp ]; then qemu_bin=/home/imp/git/qemu/00-build @@ -46,8 +87,6 @@ ARCHES="amd64:amd64 arm64:aarch64" # The smallest FAT32 filesystem is 33292 KB espsize=33292 -SRCTOP=$(make -v SRCTOP) - mkdir -p ${CACHE} ${TREES} ${IMAGES} ${BIOS} die() @@ -197,14 +236,15 @@ make_freebsd_test_trees() [ "${m}" != "${ma}" ] && ma_combo="${m}-${ma}" dir=${TREES}/${ma_combo}/test-stand mkdir -p ${dir} - mtree -deUW -f ${SRCTOP}/etc/mtree/BSD.root.dist -p ${dir} + ${MTREE} -deUW -f ${SRCTOP}/etc/mtree/BSD.root.dist -p ${dir} echo "Creating tree for ${m}:${ma}" - cd ${SRCTOP}/stand + cd ${SRCTOP} # Indirection needed because our build system is too complex -# SHELL="make clean" make buildenv TARGET=${m} TARGET_ARCH=${ma} - SHELL="make -j 100 all" make buildenv TARGET=${m} TARGET_ARCH=${ma} - SHELL="make install DESTDIR=${dir} MK_MAN=no MK_INSTALL_AS_USER=yes WITHOUT_DEBUG_FILES=yes" \ - make buildenv TARGET=${m} TARGET_ARCH=${ma} + # Also, bare make for 'inside' the buildenv ${MAKE} for outside +# SHELL="make clean" ${MAKE} buildenv TARGET=${m} TARGET_ARCH=${ma} + SHELL="sh -c 'cd stand ; make -j 100 all'" ${MAKE} TARGET=${m} TARGET_ARCH=${ma} buildenv + DESTDIR=${dir} SHELL="sh -c 'cd stand ; make install MK_MAN=no MK_INSTALL_AS_USER=yes WITHOUT_DEBUG_FILES=yes'" \ + ${MAKE} buildenv TARGET=${m} TARGET_ARCH=${ma} rm -rf ${dir}/bin ${dir}/[ac-z]* # Don't care about anything here done } @@ -279,14 +319,14 @@ make_linuxboot_images() img2=${IMAGES}/${ma_combo}/linuxboot-${ma_combo}-zfs.img pool="linuxboot" mkdir -p ${IMAGES}/${ma_combo} - makefs -t msdos -o fat_type=32 -o sectors_per_cluster=1 \ + ${MAKEFS} -t msdos -o fat_type=32 -o sectors_per_cluster=1 \ -o volume_label=EFISYS -s80m ${esp} ${src} - makefs -t ffs -B little -s 200m -o label=root ${ufs} ${dir} ${dir2} - mkimg -s gpt -p efi:=${esp} -p freebsd-ufs:=${ufs} -o ${img} - makefs -t zfs -s 200m \ + ${MAKEFS} -t ffs -B little -s 200m -o label=root ${ufs} ${dir} ${dir2} + ${MKIMG} -s gpt -p efi:=${esp} -p freebsd-ufs:=${ufs} -o ${img} + ${MAKEFS} -t zfs -s 200m \ -o poolname=${pool} -o bootfs=${pool} -o rootpath=/ \ ${zfs} ${dir} ${dir2} - mkimg -s gpt \ + ${MKIMG} -s gpt \ -p efi:=${esp} \ -p freebsd-zfs:=${zfs} -o ${img2} rm -f ${esp} # Don't need to keep this around @@ -446,10 +486,10 @@ make_freebsd_images() cat > ${dir2}/etc/fstab < ${dir2}/etc/fstab < ${dir2}/etc/fstab < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 6672831bda88 - main - sound tests: Fix downshift calculation in pcm_read_write test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6672831bda883756d7f4598bb4b119f99eb1e7d2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6672831bda883756d7f4598bb4b119f99eb1e7d2 commit 6672831bda883756d7f4598bb4b119f99eb1e7d2 Author: Florian Walpen AuthorDate: 2025-02-18 19:35:54 +0000 Commit: Christos Margiolis CommitDate: 2025-02-18 19:37:17 +0000 sound tests: Fix downshift calculation in pcm_read_write test In some situations the feeders in the sound module lower the pcm sample resolution through a downshift of the sample value. The pcm_read_write test implements this operation with an arithmetic division to avoid implementation defined or architecture specific behavior. Due to different rounding, the test produced marginally different sample values, which made the test fail on 32 bit architectures. Correct this. Reported by: CI Fixes: 27ef5d48c729 ("sound: Unit test the pcm sample read and write macros") MFC after: 1 week Reviewed by: christos, markj Differential revision: https://reviews.freebsd.org/D48926 --- tests/sys/sound/pcm_read_write.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/sys/sound/pcm_read_write.c b/tests/sys/sound/pcm_read_write.c index 7ef310a35c25..cfd89eec7c19 100644 --- a/tests/sys/sound/pcm_read_write.c +++ b/tests/sys/sound/pcm_read_write.c @@ -81,13 +81,21 @@ static struct afmt_test_data { static intpcm_t local_normalize(intpcm_t value, int val_bits, int norm_bits) { + int32_t divisor; + intpcm_t remainder; + /* Avoid undefined or implementation defined behavior. */ if (val_bits < norm_bits) /* Multiply instead of left shift (value may be negative). */ return (value * (1 << (norm_bits - val_bits))); - else if (val_bits > norm_bits) + else if (val_bits > norm_bits) { + divisor = (1 << (val_bits - norm_bits)); + /* Positive remainder, to discard lowest bits from value. */ + remainder = value % divisor; + remainder = (remainder + divisor) % divisor; /* Divide instead of right shift (value may be negative). */ - return (value / (1 << (val_bits - norm_bits))); + return ((value - remainder) / divisor); + } return value; } @@ -103,8 +111,7 @@ local_calc_limit(intpcm_t value, int val_bits) * behavior here. */ if (sizeof(intpcm32_t) == (32 / 8) && val_bits == 32) - /* Divide instead of right shift (value may be negative). */ - return (value / (1 << 8)); + return (local_normalize(value, 32, 24)); return value; } From nobody Tue Feb 18 19:37:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy8tn655Yz5p4dn; Tue, 18 Feb 2025 19: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 4Yy8tn43WYz3ndY; Tue, 18 Feb 2025 19: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=1739907457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCVRYnMOKdoY0hkFsBqzHqBMGqB60gwg2uZoYOwGXpg=; b=loOK597PC/QCKgw41KcRoayQYKtrQIvn5atO+/ffNToBrpsxqtjzOZueoEZ9KDtImkieKC R6v0qFa6Nx8kWuEescRmni76WomHyZf7wO+97X57aDgtApCHMBBtlQPNlTbl7myG3Ue5jg sEYNgbjFx4zXXAg28VZ2LDdkpO/S6x9y84UWeqfPMWExVad8IssWa8IUpLA5N1KdIXeNf6 RMxSd8z4ocxQ6pvYFi29LkYFcC7xUdcgEbSaMrM/EldF4LRc8j8vlJyvePplH03jhZwfJH 2xQSv/fnGyPycyDCJdF84sy0OIbgLFYT1UbhSXEBgVFmq2v3RVXL9OoeM7R9HQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739907457; a=rsa-sha256; cv=none; b=jmJWfYAVuEsmANG9myPVFIL6c18EODywb5rGLTN4MZBwLrL7BnrJGPaGCux6ZL6jghijoV usXMdLLpe7Df0p9frlE3amc6Jrh2LOe89n+nUlb7d4gocaK6xxWd5GuzpBIXmQHU4RnBsn qzfukr3Hkgk1lpogYxcbLXqJyvYzsNCLi912qsZNPy32k4/uhtek9Q2T1Y5EShLqNWNUmZ Bt3ci+HoMEe9wrkvw0XrOUw3kYydLoYhfqUw/dxwcgO3/fuwEoAcz8NMue6bQ5xF+V9T8T uTVM4eeIXGYGsUF7yysorGl2QL/WExt7hU++0oRKPeYDPoeOWC8J1OGkxjSIEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739907457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GCVRYnMOKdoY0hkFsBqzHqBMGqB60gwg2uZoYOwGXpg=; b=jd1+019CFqc6Wne9SrDOZZMRhjFTdwMgU8RgYzw0XoCcqrhj/ODu/5quVGQwvyPZHutnQ0 gnhXGyPixdtnyIWGibWvi2ZaXkA7DVN870BSCGiDyacJdOIJeX3GmDDZlewXfcoVf1oT/0 JxCAhtq23pbX+zjirQXFhDVo8l/catgoBnAgPUoLujoVGeIn+aziSlCyJz7xv+VHRhtFIl O1vgbEsvuPgm88VzG3E1jxDFms80Vx0mmGrJ6QVdlEvGflcewqjSm6hHew/cZIZ4YtjguM kezl59fu1P/lG3chLfKrERqmoX7+k2Ql6Mx1gnrNTpSLSRxPmOCoGXvCWpFKmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy8tn3XzVzZqn; Tue, 18 Feb 2025 19: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 51IJbbMu029744; Tue, 18 Feb 2025 19: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 51IJbbIM029741; Tue, 18 Feb 2025 19:37:37 GMT (envelope-from git) Date: Tue, 18 Feb 2025 19:37:37 GMT Message-Id: <202502181937.51IJbbIM029741@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c23d53490eb3 - main - snd_hda: Define ALC898 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c23d53490eb3ac5568050ca9a58534ac04846281 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c23d53490eb3ac5568050ca9a58534ac04846281 commit c23d53490eb3ac5568050ca9a58534ac04846281 Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:42 +0000 Commit: Christos Margiolis CommitDate: 2025-02-18 19:37:21 +0000 snd_hda: Define ALC898 PR: 207996 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D48940 --- sys/dev/sound/pci/hda/hdac.h | 1 + sys/dev/sound/pci/hda/hdacc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.h b/sys/dev/sound/pci/hda/hdac.h index f0e72f091a85..40b697b05e78 100644 --- a/sys/dev/sound/pci/hda/hdac.h +++ b/sys/dev/sound/pci/hda/hdac.h @@ -608,6 +608,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC897 HDA_CODEC_CONSTRUCT(REALTEK, 0x0897) +#define HDA_CODEC_ALC898 HDA_CODEC_CONSTRUCT(REALTEK, 0x0898) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCS1200A HDA_CODEC_CONSTRUCT(REALTEK, 0x0b00) diff --git a/sys/dev/sound/pci/hda/hdacc.c b/sys/dev/sound/pci/hda/hdacc.c index 76aeaec757a5..b4321a5bf998 100644 --- a/sys/dev/sound/pci/hda/hdacc.c +++ b/sys/dev/sound/pci/hda/hdacc.c @@ -147,6 +147,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC897, 0, "Realtek ALC897" }, + { HDA_CODEC_ALC898, 0, "Realtek ALC898" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_ALCS1200A, 0, "Realtek ALCS1200A" }, From nobody Tue Feb 18 19:37:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy8tm2QrZz5p4dW; Tue, 18 Feb 2025 19:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy8tl3JdKz3nSh; Tue, 18 Feb 2025 19:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739907455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i5oU6mfZdk+JvC5nLkbcHX8UbUIdAOlHtIeiEUfIghw=; b=Cylyf/3TRywUa9igUJJjyZBSW2BZTnzgEXchnXXgvjMubpk1sScHe+LvnrtBqwDsNRd2al ruxToBEIhU2Jdc4NvbW081F3iILg3q2oC6/G66rELW7+BJ5cYz48QmET13yyj1RpZVwmHH pVtdYfFzU8kHqNVdjfo3xCGpB/Ovs7FUHcDg0fD6OI2+R7LxZ5vs+N0Rm+krMgAdjJ0+HL lmpT6mYwLk9ZuSuoB/kOF5KfwobtAIEc56gxRN9iF92iX1bfmxTciAgu5JNgSgHfoj0nT4 ZgYi5GN78VyVjDJXRnhfAExP730ZtXHDQDmgQastAEnvnDyAUNPwfJpSfNsUtA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739907455; a=rsa-sha256; cv=none; b=UpOoBPMe3e6pbfnsQGBzZWSUOpqOWqBnlCiwgjS0g1bMZESVr01hwV/lUc7nWF9ALJWY4M 5lQA9BZgVuFGeBeipeZm43kiItV7TPQs/6KZXWr5H7U3wWnBwHIy8U28/WIeeItW7nygUj xnEXW8iNCek5BdxkFPBIiUwlnFpOWgvpPp3Q01pKPjMOOE0ap/RC3w/QUZa3ULJBkhRrlH oC5opoX649yBtsXInPj7Kd9F/AHV+eYI0FoGpT0S0t4NQ737/ImCsNtog7fQJM4o3v8Lco Ixcy1QDHAQ0qQvmNPj77wq92KsPwjV4Ckghy4fqrUdBczU4JCI5RFjozAiSA5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739907455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i5oU6mfZdk+JvC5nLkbcHX8UbUIdAOlHtIeiEUfIghw=; b=nJuCXw9idwcziygBavxRFDeXxndfudWukWsB49+POUU5zZ5yBuJ4M+lhlrKMXfWrH7+fim xgKtZCYpA1ikSVABVqN0WaxGX+bP16gqjsyyfjDHlsMhQc+44JmqUj5m5frqcI4ILxVC2S uoyWUT2J/ejPp8utogRVbfhI7Y0Mi/IyomaxJJWCXm9cGmKxcaYGwCDMIFAOzoPqrA/XvP sYsIoYTOZ6qKOi3nhksVm7gokf0rVkQ7bqJy5sVpoWnK4F5cwhtPl0FZqrJTPrWHIQeXjZ 5Xcl/M7jQf6bn2dPh99NGmQTzGbjdi+5m9NYu6eY3CGRSRRNbCAXwKK2zqjswg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy8tl2tdhzZVY; Tue, 18 Feb 2025 19:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51IJbZPu029673; Tue, 18 Feb 2025 19:37:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IJbZDn029670; Tue, 18 Feb 2025 19:37:35 GMT (envelope-from git) Date: Tue, 18 Feb 2025 19:37:35 GMT Message-Id: <202502181937.51IJbZDn029670@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: d4176fdb1370 - main - snd_hda: Fix typo (s/owerflow/overflow) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d4176fdb1370f5dcf2c40c153e6bd1ad0c4a2f85 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d4176fdb1370f5dcf2c40c153e6bd1ad0c4a2f85 commit d4176fdb1370f5dcf2c40c153e6bd1ad0c4a2f85 Author: Christos Margiolis AuthorDate: 2025-02-18 19:35:52 +0000 Commit: Christos Margiolis CommitDate: 2025-02-18 19:35:52 +0000 snd_hda: Fix typo (s/owerflow/overflow) Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/sound/pci/hda/hdaa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c index 51d6e024225f..f53e93a2355b 100644 --- a/sys/dev/sound/pci/hda/hdaa.c +++ b/sys/dev/sound/pci/hda/hdaa.c @@ -3218,7 +3218,7 @@ hdaa_audio_as_parse(struct hdaa_devinfo *devinfo) continue; } KASSERT(cnt < max, - ("%s: Associations owerflow (%d of %d)", + ("%s: Associations overflow (%d of %d)", __func__, cnt, max)); type = w->wclass.pin.config & HDA_CONFIG_DEFAULTCONF_DEVICE_MASK; From nobody Tue Feb 18 19:37:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yy8tq1RB4z5p4qD; Tue, 18 Feb 2025 19:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yy8tp5Bczz3njT; Tue, 18 Feb 2025 19:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739907458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YjSMxNnUZm/g2EwWbHdTnggiFoKHkk3ZoiK6YvLOFY=; b=ve4BSd6flrMoyGr4bp7Y3ZTDPQxAXdapCKmbcJD2ObQCpbhRG1NFz1GcwOswfuCVca6oFu Tp0PGfrfVNK6gya8Kn8sYcR8agSDPIz7++DImsw/MWJizSZ8wKtLmiE5NRC2atJCeRk/Bi JbKKPYbbGCmlVVzoxY0WrKhWZdN02sCnA5EwDNLuendqQ5FPwSoRxVbi+cBUgYEyEW6UkV Egh/PEnVok7V8tVcuJJF6AES5krzFV341v50iCgbbrNUOjEWlPjSdA/dfkyVoVmoPqkzim 9Vmy60B9hOeHHAPDHSSEzKDWOIvClrub6hGVPxlSPnaoa2XZUG3r7LfsLc4rmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739907458; a=rsa-sha256; cv=none; b=Rn00rTQOWXeh5fNqEEVkmzCcwSP++qKH07EoFHF1VMoR7U2WLpA+IGckTzJDi9uX+MxEMR Ko8VDlIFCtSkl9oScXRJfDkTPYCXQRfrL9DjerYXDzpAN+1wkQzU3Q+wu1f6Mn7sogBTJ8 OTBRvVRhBFRhu0AGiUT5AfQ/ROWHCh4kuGLz+sUI9zHqlFJP5CDDTocfE4mlP1nFLdWR66 8Rcjhs7j9P3//YGfCkedLZJYv75PF0IjUTKlD4boJ/2buPDqXc+JouhcVn+o1wV/6hReEh ma6iLfVNWdBbthV/ADrbXnqAoySxSujS4kFRXzUMj6QQcmbLtFdEcRJCfAvfqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739907458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9YjSMxNnUZm/g2EwWbHdTnggiFoKHkk3ZoiK6YvLOFY=; b=P6YeqrQJAfx6rZV6PkzLEeUy/wHAMT7+axJSJI1cHzNgudcFQmFVPnMkLmUwrnCf7PntHZ r1oCxfHBsH3nmYHWaeWu6cUWIxAso1cGoR9ht71DXY17lLzbKRqQsxfwR6+aHPYZYEcJlz Ztt6rSk5WhwpIDS6UvVuIjozwU4qBe48RHfjhWnIToHwDZiRaEWn7bgdxOSoVzoErxoMbC LE6q7JAvez+g2LrRSccoMuaKskDJYHZIFg2ZwFuMx1ohzUaXKgVWUjDSiBtUpt1x7aB0Lz F4xL+xMkwgiJyluSNk6ZOSWHok7pSRXOYBq4Jb5HxQI2p/4B8n/VMQjrKF/ryw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yy8tp4W6MzZnB; Tue, 18 Feb 2025 19:37: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 51IJbcQL029778; Tue, 18 Feb 2025 19:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IJbcv5029775; Tue, 18 Feb 2025 19:37:38 GMT (envelope-from git) Date: Tue, 18 Feb 2025 19:37:38 GMT Message-Id: <202502181937.51IJbcv5029775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 18457e7e25c5 - main - sound: Bail out early if a format is not supported List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18457e7e25c55b8834e886fd925ec3b11b79d1b6 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=18457e7e25c55b8834e886fd925ec3b11b79d1b6 commit 18457e7e25c55b8834e886fd925ec3b11b79d1b6 Author: Christos Margiolis AuthorDate: 2025-02-18 19:36:48 +0000 Commit: Christos Margiolis CommitDate: 2025-02-18 19:37:22 +0000 sound: Bail out early if a format is not supported If a format is unsupported, the feeder_build_* functions will fail anyway, so bail out early to avoid unnecessary computation. This is also needed by a series of upcoming patches to the feeder framework. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48031 --- sys/dev/sound/pcm/feeder_chain.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 588bae2ff281..1c4ddca6cdd5 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -718,6 +718,17 @@ feeder_chain(struct pcm_channel *c) c->format = cdesc.target.afmt; c->speed = cdesc.target.rate; } else { + /* + * Bail out early if we do not support either of those formats. + */ + if ((cdesc.origin.afmt & AFMT_CONVERTIBLE) == 0 || + (cdesc.target.afmt & AFMT_CONVERTIBLE) == 0) { + device_printf(c->dev, + "%s(): unsupported formats: in=0x%08x, out=0x%08x\n", + __func__, cdesc.origin.afmt, cdesc.target.afmt); + return (ENODEV); + } + /* hwfmt is not convertible, so 'dummy' it. */ if (hwfmt & AFMT_PASSTHROUGH) cdesc.dummy = 1; From nobody Tue Feb 18 22:04:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyD8n1YDjz5pFQc; Tue, 18 Feb 2025 22:04: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 4YyD8m5Y3nz3TDd; Tue, 18 Feb 2025 22:04:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HGh3aaZs7SoseNCSbKmj0AZ7kw1JFYmLKv4HmJRT8Ik=; b=G/HBoTmqdD7y9exOJScUV39IH5RWZm+Ss77Y45aEXEv6GxIFbTYRrGYOIAKbwgHW7XU+XT DipeaE8w2ta3VNSGnBH7hRQKDrwGbOEMdxEdkGsBNNK93YVHYXiPUN162ARN9IjEOKuDCe YaT8UnH+ePM0VjsBO+Kzvxm6WX5m0gXe4Q5BOloQp1UVRr3oSqo1iNjezE0XKCTX/c63FE o4dXsX0IGOnl/K1kDkUuv2ajwPd3VBsFABduFESeZFTIp03icZ9yVu5YA4gReEOK9x8fHp WmAFHJxASiMNroTtrOLKMCsEEPBL6PSE723LALHGkVNIJ2zRPyPvit9Z3dJHrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739916296; a=rsa-sha256; cv=none; b=JhsiVuWggvPpp41Ftz7JpmOVdfTwxcj+aO6Y9jxM/RaF+nVGksIZjyBz5BfO5zT/whWQg1 BHf/sE46cur4c221uZEXnE3Qd4infdVS2sXthAEKNS1xc3HPpOQ91GtOZCYCQJgj/J/i3T qtrYN8Y9Ob9FtYdLN+IirLywvTK0HKz108cp20HlFrJhraYJoJMuUiyvVTIbv50UkaJbn/ dhxplTVYUI0WfA/yCUcA//nvn3ZaPvQVztPC+jsBBHz5cZvnogH61z1yWKCCe1EYgAjxlT nptd7EDQwSvL6S2lagyxbqEe3exHc6WBz4SL7VFSlATlxepw2nOpAob1pTMKfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HGh3aaZs7SoseNCSbKmj0AZ7kw1JFYmLKv4HmJRT8Ik=; b=Ns2l29Nore7bokpMxcnJVRoAA7QTcjPiHB5iYGHshcV+5PxMbwS2b91EpXMfyjShx/91JS k+b5Aaqcb/pP/dTKY/4l1AkgQaqNjJDumBdgcn6an0VyPa/NzJF4upT5hXszNPM6IJoBP0 er+tbTSV7iEKJlJi/BSzjuLhyFSpuqFq//dsA0yIMubJBdn8MWJ5PuAMMyiw3DLettc9xy PAevc4aa0zQZtd4y9Npluw5Ur4ptqeTiHTpTW4usfAJgfQvX20wNW0Az8yVqED/rK+96d4 qH56j62CFdBa3I7rwa9mHKMSAtfvKv8xqvQ01rAzHIOLhwPiTRuawBE0V0VyBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyD8m4zf7zfcT; Tue, 18 Feb 2025 22:04: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 51IM4ugo009416; Tue, 18 Feb 2025 22:04:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IM4uFM009413; Tue, 18 Feb 2025 22:04:56 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:04:56 GMT Message-Id: <202502182204.51IM4uFM009413@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: daca374bc48b - main - makesyscalls: reduce redundency in syscall.mk code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: daca374bc48b5f6975563ae9ecc227868039e807 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=daca374bc48b5f6975563ae9ecc227868039e807 commit daca374bc48b5f6975563ae9ecc227868039e807 Author: Brooks Davis AuthorDate: 2025-02-18 22:02:19 +0000 Commit: Brooks Davis CommitDate: 2025-02-18 22:03:06 +0000 makesyscalls: reduce redundency in syscall.mk code The two outer blocks had identical contents and the two inner blocks differed in a single location. Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575 --- sys/tools/syscalls/scripts/syscall_mk.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index 49d3f6f86c20..8f8755af31c0 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -43,24 +43,14 @@ function syscall_mk.generate(tbl, config, fh) gen:write("MIASM = \\\n") -- preamble for _, v in pairs(s) do local c = v:compatLevel() + local bs = " \\" idx = idx + 1 - if v:native() and not v.type.NODEF and not v.type.NOLIB then + if (v:native() or c >= 7) and not v.type.NODEF and not v.type.NOLIB then if idx >= size then -- At last system call, no backslash. - gen:write(string.format("\t%s.o\n", v:symbol())) - else - -- Normal behavior. - gen:write(string.format("\t%s.o \\\n", v:symbol())) - end - -- Handle compat (everything >= FREEBSD3): - elseif c >= 7 and not v.type.NODEF and not v.type.NOLIB then - if idx >= size then - -- At last system call, no backslash. - gen:write(string.format("\t%s.o\n", v:symbol())) - else - -- Normal behavior. - gen:write(string.format("\t%s.o \\\n", v:symbol())) + bs = "" end + gen:write(string.format("\t%s.o%s\n", v:symbol(), bs)) end end end From nobody Tue Feb 18 22:04:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyD8l5qQlz5pFsk; Tue, 18 Feb 2025 22:04: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 4YyD8l4Zrlz3T8G; Tue, 18 Feb 2025 22:04:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFfH4HoKRmtDBRXmlhK6pBFmuONwNdZwG/Ub7Vx0vzQ=; b=RFD4cIo65brdXGAzEKYVUinfpsP0DqrGc9SuciCCgbGNFuqeHx++o9wHoWQHHKjoFyOfYy gn9w3KTiPr2+sPGSo0z0ACfEF2WLe2wgC4IcTj1vA0/YpDnZOTea4nQUVL8JsMLTRbd8+Q 9+y46K4dbK345leeFb6aXn8c+9PkCRzjWz1YxAvfx6uJqq+nOQclxYktMEit+PY9Vxs5nc kCtSB3gVjSz6yh1KAqMxpEOg3uSzDHFvVVtM4xIVtVlJX5CBGOZ+Xf4Kj0weo9xX8+BGNp XMjfplji5PKM6Q/80KuAq9BCRolyLS/0IYtXUHriQkIDu9uf+SBpm3M/qDRFyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739916295; a=rsa-sha256; cv=none; b=l7avam22N0oOP2T9fhpv0FnqwHjrcfrkLydf8q3adj+HmlBN8rbPo9r80KJ070N+1UCoj3 20fWnM2ybSUgHPvRx3yFTIsY1oG/70nNCfc9+mz3PW+K5JdZ9/oAwH8QFKZpFTfZCQql5o UzfzqNpcUQau6eXtSbmVRf04SFOMgMEJueqL63L9/ITiAe3B/oPlq+znT6sUc9tfC16sz7 0FlMbpyrnQBwAUUVM9vFWT4UH/689lySqSQ+IcCcxtgw0ggh321WRJDzgs+IUMF9W5t3KK edw6HMpKGeNSEGIm5lQeZgwrzx4NQgAI1Fa7XBTYKdJNl6ZbtxDi0WYiqTQKAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CFfH4HoKRmtDBRXmlhK6pBFmuONwNdZwG/Ub7Vx0vzQ=; b=sgc2R/u6kp4iJDBm0eIT8ZX74fKNwJZaQ1NIG0cKlFddwQbGunI2+jE2FJ2EmylfCVwFgp +0+kzlQssinM9f6finew7meVUfrHg12VmmAHm9GIpqhJ2QHREQ8l8eQeWg1R/I41MC+CaW 2JElpjQO5yneC+KcmdYWsWYu3HvGgPlvX+EdL+Y68J1CyateXzFL6CIx0HIQ5kRsExD5KC w6q6m0zU9bgLFtH6Z0gEQhWajbQj2tnIaQjO1mcz6iBnuoEO5LpnZokZwtbmiJ18KUgPhh u0WdaqO/sIcuZ5ZWVOhXE/AE2TduCkK42u38if4hY4iwFbIgw3evShfIUVvXLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyD8l3rNyzfLH; Tue, 18 Feb 2025 22:04: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 51IM4tlQ009374; Tue, 18 Feb 2025 22:04:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IM4tZ0009371; Tue, 18 Feb 2025 22:04:55 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:04:55 GMT Message-Id: <202502182204.51IM4tZ0009371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 53fae788f229 - main - sys: syscalls: add a test syscall definition file List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53fae788f229903df04b2963399afb0dce03b78b Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=53fae788f229903df04b2963399afb0dce03b78b commit 53fae788f229903df04b2963399afb0dce03b78b Author: Kyle Evans AuthorDate: 2025-02-18 22:02:19 +0000 Commit: Brooks Davis CommitDate: 2025-02-18 22:02:19 +0000 sys: syscalls: add a test syscall definition file This exercises some subset of the preprocessor that would be nice to still support. Pull Request: https://github.com/freebsd/freebsd-src/pull/1575 --- Makefile.inc1 | 3 +- sys/tools/syscalls/examples/cpp/Makefile | 3 + sys/tools/syscalls/examples/cpp/syscalls.conf | 10 +++ sys/tools/syscalls/examples/cpp/syscalls.master | 26 +++++++ sys/tools/syscalls/examples/cpp/test_proto.h | 63 +++++++++++++++ sys/tools/syscalls/examples/cpp/test_syscall.h | 10 +++ sys/tools/syscalls/examples/cpp/test_syscalls.c | 19 +++++ sys/tools/syscalls/examples/cpp/test_sysent.c | 26 +++++++ .../syscalls/examples/cpp/test_systrace_args.c | 91 ++++++++++++++++++++++ 9 files changed, 250 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 4383b4bfe30a..c9a4fee236aa 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1604,7 +1604,8 @@ _sysent_dirs+= sys/compat/freebsd32 _sysent_dirs+= sys/amd64/linux \ sys/amd64/linux32 \ sys/arm64/linux \ - sys/i386/linux + sys/i386/linux \ + sys/tools/syscalls/examples/cpp sysent: .PHONY .for _dir in ${_sysent_dirs} diff --git a/sys/tools/syscalls/examples/cpp/Makefile b/sys/tools/syscalls/examples/cpp/Makefile new file mode 100644 index 000000000000..cc691a1e2f85 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/Makefile @@ -0,0 +1,3 @@ +GENERATED_PREFIX= test_ + +.include "../../../../conf/sysent.mk" diff --git a/sys/tools/syscalls/examples/cpp/syscalls.conf b/sys/tools/syscalls/examples/cpp/syscalls.conf new file mode 100644 index 000000000000..7fc15b6bb01f --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/syscalls.conf @@ -0,0 +1,10 @@ +sysnames="test_syscalls.c" +sysproto="test_proto.h" +sysproto_h=_TEST_SYSPROTO_H_ +syshdr="test_syscall.h" +syssw="test_sysent.c" +syscallprefix="TEST_SYS_" +switchname="test_sysent" +namesname="test_syscallnames" +systrace="test_systrace_args.c" +compat_set="" diff --git a/sys/tools/syscalls/examples/cpp/syscalls.master b/sys/tools/syscalls/examples/cpp/syscalls.master new file mode 100644 index 000000000000..4986ad41fc6a --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/syscalls.master @@ -0,0 +1,26 @@ +#include +#include +#include + +0 AUE_NULL UNIMPL unimpl_syscall0 + +; Scenario #1: Vendor uses a reserved slot on just a single platform +#ifdef PLATFORM_FOO +1 AUE_NULL STD { + int syscall1( + int arg1 + ); + } +#else +1 AUE_NULL RESERVED +#endif + +; Scenario #2: The other way around; vendor obsoletes a syscall on newer +; platforms +#ifdef PLATFORM_FOO +2 AUE_NULL OBSOL syscall2 +#else +2 AUE_NULL STD { + int syscall2(void); + } +#endif diff --git a/sys/tools/syscalls/examples/cpp/test_proto.h b/sys/tools/syscalls/examples/cpp/test_proto.h new file mode 100644 index 000000000000..db1f507b8be0 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_proto.h @@ -0,0 +1,63 @@ +/* + * System call prototypes. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +#ifndef _TEST_SYSPROTO_H_ +#define _TEST_SYSPROTO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct proc; + +struct thread; + +#define PAD_(t) (sizeof(syscallarg_t) <= sizeof(t) ? \ + 0 : sizeof(syscallarg_t) - sizeof(t)) + +#if BYTE_ORDER == LITTLE_ENDIAN +#define PADL_(t) 0 +#define PADR_(t) PAD_(t) +#else +#define PADL_(t) PAD_(t) +#define PADR_(t) 0 +#endif + +#ifdef PLATFORM_FOO +struct syscall1_args { + char arg1_l_[PADL_(int)]; int arg1; char arg1_r_[PADR_(int)]; +}; +#else +#endif +#ifdef PLATFORM_FOO +#else +struct syscall2_args { + syscallarg_t dummy; +}; +#endif +#ifdef PLATFORM_FOO +int sys_syscall1(struct thread *, struct syscall1_args *); +#else +#endif +#ifdef PLATFORM_FOO +#else +int sys_syscall2(struct thread *, struct syscall2_args *); +#endif +#define TEST_SYS_AUE_syscall1 AUE_NULL +#define TEST_SYS_AUE_syscall2 AUE_NULL + +#undef PAD_ +#undef PADL_ +#undef PADR_ + +#endif /* !_TEST_SYSPROTO_H_ */ diff --git a/sys/tools/syscalls/examples/cpp/test_syscall.h b/sys/tools/syscalls/examples/cpp/test_syscall.h new file mode 100644 index 000000000000..026e82d9ac62 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_syscall.h @@ -0,0 +1,10 @@ +/* + * System call numbers. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +#define TEST_SYS_syscall1 1 + /* 2 is obsolete syscall2 */ +#define TEST_SYS_syscall2 2 +#define TEST_SYS_MAXSYSCALL 3 diff --git a/sys/tools/syscalls/examples/cpp/test_syscalls.c b/sys/tools/syscalls/examples/cpp/test_syscalls.c new file mode 100644 index 000000000000..0e73c8223507 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_syscalls.c @@ -0,0 +1,19 @@ +/* + * System call names. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +const char *test_syscallnames[] = { + "#0", /* 0 = unimpl_syscall0 */ +#ifdef PLATFORM_FOO + "syscall1", /* 1 = syscall1 */ +#else + "#1", /* 1 = reserved for local use */ +#endif +#ifdef PLATFORM_FOO + "obs_syscall2", /* 2 = obsolete syscall2 */ +#else + "syscall2", /* 2 = syscall2 */ +#endif +}; diff --git a/sys/tools/syscalls/examples/cpp/test_sysent.c b/sys/tools/syscalls/examples/cpp/test_sysent.c new file mode 100644 index 000000000000..18d2b0fd9712 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_sysent.c @@ -0,0 +1,26 @@ +/* + * System call switch table. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +#include +#include +#include + +#define AS(name) (sizeof(struct name) / sizeof(syscallarg_t)) + +/* The casts are bogus but will do for now. */ +struct sysent test_sysent[] = { + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 0 = unimpl_syscall0 */ +#ifdef PLATFORM_FOO + { .sy_narg = AS(syscall1_args), .sy_call = (sy_call_t *)sys_syscall1, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 1 = syscall1 */ +#else + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 1 = reserved for local use */ +#endif +#ifdef PLATFORM_FOO + { .sy_narg = 0, .sy_call = (sy_call_t *)nosys, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_ABSENT }, /* 2 = obsolete syscall2 */ +#else + { .sy_narg = 0, .sy_call = (sy_call_t *)sys_syscall2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 2 = syscall2 */ +#endif +}; diff --git a/sys/tools/syscalls/examples/cpp/test_systrace_args.c b/sys/tools/syscalls/examples/cpp/test_systrace_args.c new file mode 100644 index 000000000000..74d0aa0ee862 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_systrace_args.c @@ -0,0 +1,91 @@ +/* + * System call argument to DTrace register array conversion. + * + * This file is part of the DTrace syscall provider. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +static void +systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +{ + int64_t *iarg = (int64_t *)uarg; + int a = 0; + switch (sysnum) { +#ifdef PLATFORM_FOO + /* syscall1 */ + case 1: { + struct syscall1_args *p = params; + iarg[a++] = p->arg1; /* int */ + *n_args = 1; + break; + } +#else +#endif +#ifdef PLATFORM_FOO +#else + /* syscall2 */ + case 2: { + *n_args = 0; + break; + } +#endif + default: + *n_args = 0; + break; + }; +} +static void +systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) +{ + const char *p = NULL; + switch (sysnum) { +#ifdef PLATFORM_FOO + /* syscall1 */ + case 1: + switch (ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; +#else +#endif +#ifdef PLATFORM_FOO +#else + /* syscall2 */ + case 2: + break; +#endif + default: + break; + }; + if (p != NULL) + strlcpy(desc, p, descsz); +} +static void +systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) +{ + const char *p = NULL; + switch (sysnum) { +#ifdef PLATFORM_FOO + /* syscall1 */ + case 1: + if (ndx == 0 || ndx == 1) + p = "int"; + break; +#else +#endif +#ifdef PLATFORM_FOO +#else + /* syscall2 */ + case 2: +#endif + default: + break; + }; + if (p != NULL) + strlcpy(desc, p, descsz); +} From nobody Tue Feb 18 22:04:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyD8p70yyz5pFqT; Tue, 18 Feb 2025 22:04: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 4YyD8n6qQPz3SwH; Tue, 18 Feb 2025 22:04:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=50dQR47jnrFxo7xqfK0qYy0TFBxEKVg2ofv9I30vxgQ=; b=PL0VDvSSCFzamxt0BA/TZS9RDfijD0gC2QpGkkDRoZTGsEXvLmGs3QInkcz9af07ThZ80y h6ycSWyEVgsbQljFKEBOPHDPuYG7EfajVTfcMAmzvzGEBqQ+uf4wM5tjgfGZ+FpsMaVGvE BueMowVYCbq/+WjcVV+hfR2wqdhG1pndp7pb7tDM5QLT10HyTrgCwf5Ld9ub8f34uS9lw1 vrHoFreyUNKnx9xUZcwzW1vtGPbrMqTJc/uejI50RdDgZGgz0GgpiXq2oE7GVmqskussOW Ayxm8XSPkxJi8xC+o2VgLJyvlG/LO7I1lHOte2MsAjhg9HcoWdN90WL8pf+PYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739916298; a=rsa-sha256; cv=none; b=eW8dcTRcn5vik/BqnVz/AIKGAq7ztzjX3mvfnSMVCS4X6IZYLdYPgxGV31EkGRyXMmRJHg HuwBmx2zFnspwZbMFDa4CTD/Mx5Y9n/eHq8jvjJHMMcTRAwGAjU0Dy4M8ZsMceQKZBOEW+ WUyZ2IgtccI38hfaGPNRdZo8wsPGNLx0wHwMUB1CRAMT/3j0ZQB1xyeK3PafN+ymF3Hv1T uWWjVFV+BTUudp7rksf6FTq5X7qaklhmb+ClkuWCZnyWllMaggV6As3BUJzwEOVW0RriFN FQF2Bqp2GAZXSMuKjgGFPXqcBiwikvPtULfTFkeIcEOLxX6//LbR/WbcvUvUpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=50dQR47jnrFxo7xqfK0qYy0TFBxEKVg2ofv9I30vxgQ=; b=Pji3LIfmmjiurc0fBTNElPfOXp3bxg+CXGfFmGzrsIxeGBe6L93hSi961TI7cs0AglGtww UDTJ8d0wWZLlii7tzXx5X05bKFNwqBQLV+V9c2hKtq/JBAnWPAXw/4TQRLYO+YgQ1pve8D QfnefT1AZvNIORcwKGsbNYtgjpfMDbv109iuG53PbFlp4t6zTkqhb/dvpEYtwqruwLEvEx DaW2Ut8ZDPMQz0mXdyLlAdnldB2YttrGQ05Y4J6izh1qioDjVCsshbp8aOZ9M1mNJSV7+d xKDkZr4eac5A828sBXhdHepcP81/pLqXIgr3dtsOE0RgiHvv1XYqxAZhC5kn1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyD8n5kJ8zf6l; Tue, 18 Feb 2025 22:04: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 51IM4vHg009450; Tue, 18 Feb 2025 22:04:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IM4vMH009447; Tue, 18 Feb 2025 22:04:57 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:04:57 GMT Message-Id: <202502182204.51IM4vMH009447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 42d075f4b7b7 - main - makesyscalls: Restore support for cpp in input List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42d075f4b7b74eb3c4f943d6bdcc2aeb56be6388 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=42d075f4b7b74eb3c4f943d6bdcc2aeb56be6388 commit 42d075f4b7b74eb3c4f943d6bdcc2aeb56be6388 Author: Brooks Davis AuthorDate: 2025-02-18 22:02:19 +0000 Commit: Brooks Davis CommitDate: 2025-02-18 22:03:13 +0000 makesyscalls: Restore support for cpp in input Allow patterns like this in syscalls.master: #if 0 91 AUE_NULL RESERVED #else 91 AUE_NULL STD|CAPENABLED { int newsyscall(void); } #endif makesyscalls.lua and it's predecessor makesyscalls.sh (really an awk script with a tiny shell prolog) used a single pass parsing model where lines beginning with `#` were emitted into most generated files as they were read. I belive this was initially there to allow includes to be listed in syscalls.master, but Hyrum's Law[0] applies and people are using it for things like architecture-specific syscall definitions. This use of CPP macro is unsound and there are a number of sharp edges in both the new and old implementations. The macros are unsound because not all the files were generate are run through CPP (or if they are not in the same context) and this will increasingly be true as we generate more things. Sharp edges include the fact that anything before the first syscall would be printed at a different scope (e.g., before an array is declared). In this patch I collect each non-#include CPP directive and attach them to the syscall table or individual entries. All entries before the first syscall and after the last are attached to the prolog and epilog members. Within the syscall table all entries are attached to the next system calls's prolog member. In generators, each prolog entry is printed regardless of the system call's visibiilty which replicates the naive single pass model's behavior (including lots of empty blocks of #if/#else/#endif in the output). Unlike makesyscalls.lua, I discard none #define entries at the top of the file and print a warning as their usefulness appears limited. [0] https://www.hyrumslaw.com Reported by: kevans Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575 --- sys/kern/syscalls.master | 7 ++++--- sys/tools/syscalls/core/freebsd-syscall.lua | 23 ++++++++++++++++++----- sys/tools/syscalls/scripts/init_sysent.lua | 3 +++ sys/tools/syscalls/scripts/syscalls.lua | 4 ++++ sys/tools/syscalls/scripts/sysproto_h.lua | 12 ++++++++++++ sys/tools/syscalls/scripts/systrace_args.lua | 9 +++++++++ sys/tools/syscalls/tools/util.lua | 5 +++++ 7 files changed, 55 insertions(+), 8 deletions(-) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 52502fc662be..fbd2ffb60cae 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -107,9 +107,10 @@ ; timet_ Object contains a time_t and varies between i386 and other ; ABIs. -; #include's, #defines's, etc. may be included, and are copied to the output -; files. However, #ifdef, etc will be copied, but any lines that don't start -; with # will not. Caveat Emptor. +; #include's, #defines's, etc. may be included, and are copied to a +; limited set of output files. Before the first syscalls, #include lines will +; be copied and %%ABI_HEADERS%% expanded. Between system call entries, +; all lines beginning with # will be copied. Caveat Emptor. #include #include diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua index 193b1e43563c..fdd3a9011b7a 100644 --- a/sys/tools/syscalls/core/freebsd-syscall.lua +++ b/sys/tools/syscalls/core/freebsd-syscall.lua @@ -48,7 +48,8 @@ function FreeBSDSyscall:parseSysfile() end local incs = "" - local defs = "" + local prolog = "" + local first = true local s for line in fh:lines() do line = line:gsub(commentExpr, "") -- Strip any comments. @@ -80,12 +81,18 @@ function FreeBSDSyscall:parseSysfile() if h ~= nil and h ~= "" then incs = incs .. h .. "\n" end - elseif line:match("^#%s*define") then - defs = defs .. line.. "\n" elseif line:match("^#") then - util.abort(1, "Unsupported cpp op " .. line) + prolog = prolog .. line .. "\n" else s = syscall:new() + if first then + self.prolog = prolog + s.prolog = "" + first = false + else + s.prolog = prolog + end + prolog = "" if s:add(line) then -- Append to system call list. for t in s:iter() do @@ -114,7 +121,13 @@ function FreeBSDSyscall:parseSysfile() assert(fh:close()) self.includes = incs - self.defines = defs + self.epilog = prolog + + if self.prolog ~= "" then + util.warn("non-include pre-processor directives in the " .. + "config prolog will not appear in generated output:\n" .. + self.prolog) + end end function FreeBSDSyscall:findStructs() diff --git a/sys/tools/syscalls/scripts/init_sysent.lua b/sys/tools/syscalls/scripts/init_sysent.lua index 66683250b482..a1f51b5f3152 100755 --- a/sys/tools/syscalls/scripts/init_sysent.lua +++ b/sys/tools/syscalls/scripts/init_sysent.lua @@ -66,6 +66,8 @@ struct sysent %s[] = { -- based on the type of system call. local comment = v.name + gen:write(v.prolog); + -- Handle non-compat: if v:native() then gen:write(string.format( @@ -163,6 +165,7 @@ struct sysent %s[] = { gen:write(string.format("\t/* %d = %s */\n", v.num, comment)) end + gen:write(tbl.epilog) -- End gen:write("};\n") diff --git a/sys/tools/syscalls/scripts/syscalls.lua b/sys/tools/syscalls/scripts/syscalls.lua index 38ed396a73ae..a40ebc137627 100755 --- a/sys/tools/syscalls/scripts/syscalls.lua +++ b/sys/tools/syscalls/scripts/syscalls.lua @@ -38,6 +38,9 @@ function syscalls.generate(tbl, config, fh) for _, v in pairs(s) do --print("num " .. v.num .. " name " .. v.name) local c = v:compatLevel() + + gen:write(v.prolog); + if v:native() then gen:write(string.format([[ "%s", /* %d = %s */ @@ -80,6 +83,7 @@ function syscalls.generate(tbl, config, fh) end end + gen:write(tbl.epilog) -- End gen:write("};\n") end diff --git a/sys/tools/syscalls/scripts/sysproto_h.lua b/sys/tools/syscalls/scripts/sysproto_h.lua index 6770e0548899..2b0b9293ea66 100755 --- a/sys/tools/syscalls/scripts/sysproto_h.lua +++ b/sys/tools/syscalls/scripts/sysproto_h.lua @@ -93,6 +93,12 @@ struct thread; -- intuitive). local audit_idx = 10000 -- this should do + gen:write(v.prolog) + gen:store(v.prolog, 1) + for _, w in pairs(config.compat_options) do + gen:store(v.prolog, w.compatlevel * 10) + end + -- Handle non-compat: if v:native() then -- All these negation conditions are because (in @@ -202,6 +208,12 @@ struct %s { end_idx) end + gen:write(tbl.epilog) + gen:store(tbl.epilog, 1) + for _, w in pairs(config.compat_options) do + gen:store(tbl.epilog, w.compatlevel * 10) + end + if gen.storage_levels ~= nil then gen:writeStorage() end diff --git a/sys/tools/syscalls/scripts/systrace_args.lua b/sys/tools/syscalls/scripts/systrace_args.lua index 88170b85e737..40dd072bc0c3 100755 --- a/sys/tools/syscalls/scripts/systrace_args.lua +++ b/sys/tools/syscalls/scripts/systrace_args.lua @@ -68,6 +68,10 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) for _, v in pairs(s) do + gen:write(v.prolog); + gen:store(v.prolog, 1); + gen:store(v.prolog, 2); + -- Handle non compat: if v:native() then gen:write(string.format([[ @@ -212,6 +216,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) end end + gen:write(tbl.epilog) gen:write([[ default: *n_args = 0; @@ -219,6 +224,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) }; } ]]) + + gen:store(tbl.epilog, 1) gen:store([[ default: break; @@ -227,6 +234,8 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) strlcpy(desc, p, descsz); } ]], 1) + + gen:store(tbl.epilog, 2) gen:store([[ default: break; diff --git a/sys/tools/syscalls/tools/util.lua b/sys/tools/syscalls/tools/util.lua index c9ff98dda786..41247e34a10e 100644 --- a/sys/tools/syscalls/tools/util.lua +++ b/sys/tools/syscalls/tools/util.lua @@ -35,6 +35,11 @@ function util.split(s, re) return t end +-- Prints a warning to stderr +function util.warn(msg) + assert(io.stderr:write("WARNING: " .. msg .. "\n")) +end + -- Aborts with a message and does a clean exit procedure. function util.abort(status, msg) assert(io.stderr:write(msg .. "\n")) From nobody Tue Feb 18 22:04:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyD8r5Rbwz5pFvs; Tue, 18 Feb 2025 22:05: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 4YyD8r3Fq1z3T1j; Tue, 18 Feb 2025 22:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6qhOs7U+WvXdc0iK9wV1Ypka6TQq4iAo5X+Rf6DU9FQ=; b=Cd6/fqN5MBVrdwq1zKKxH0pKYuj/MmYsX01YuP61cJn4nClPdbqouRRAzYJ9lOVeP5AIog cOv10ClrZcQbJC5KKRjahwUgArVCsz8cACTyr3mp+lun8lT4jFFMFxQ6Qlr+mj4ln5DFHW UNaMbj+KNxC2l7Tc/Vn7zAIjj52vmamGBNgXpCT5xbVEMaESkCLr6nnVKh5VLp1zzqYSlv xKYBQEcvUJLf8/g/QqM+hog7TyPBdQbc/GdHbqMi4nl44Vop9Vmf2USF5A1fiLiD6J1o/1 DAm+F56i2MOKxAsEER5i4WVU/HeBJV/vzS4OOyM9LmCiGdpDpqnJbe1vF4wM6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739916300; a=rsa-sha256; cv=none; b=DjlyF1nrqqIllvr9R8nnwbyUtwhBZC0QYAAmjOiXf6JKz5uFcmCX8PvAFjY2FUvij/szgJ cp2GZ84aV02XtWYgingGGiEHnyujmMDbCJrTBkFTmWVzv9Jz8p6lpXLVkKhTriHbdl3HFk RqOkdkXPZu86PRPGvq+IfZS/Jj6zQkTlx+9vjbfjsGPCtG8EoIwSgRAUYU6ocFcfOuvVYv n6Pch2EvQlP6i7sIgyUPaISXoHRsgmsqYjfu+ANpfe7twcPaV52ZE52lhdaT3pE89nzF5m Uy1+NLcK4OdRjvu46VWa+wFMCI06Gqy7h81Ocjy8p6B5IeImPLZ+0ndn+3BoPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916300; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6qhOs7U+WvXdc0iK9wV1Ypka6TQq4iAo5X+Rf6DU9FQ=; b=VAwOrA0fTfh2GobWp+xLz5WyUWn5V/eoiOfjQh70KjjIzi/qso0Fl0Yyu3xqqf6KZoWFbx HeDFJb5/jGCARxbvI1AXUhRbLeTMDc0IZIqCcBrPQMItvJQHYojpjgnNTL9cY2xaU2g52t D8WUIlzgHcWsiafPdOQA5o+jNvlk+OoK4TBOq8r2JGPNiUkdxbUpbRXa1eHuBOooqdY3HT cCZVa3Cvg++eByz7thVaI91Uf/paUhZzszyaxC3skFDwyc4Fma+H14QA93va5FQw5HKbal PNZlDVydUCS+hRF6163yMbj4u0PLEIOFIaMNBy7l4cdQP5jDY/OW/kJ0KfPeug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyD8r0H3szfRX; Tue, 18 Feb 2025 22:05: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 51IM4x29009519; Tue, 18 Feb 2025 22:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IM4xlG009516; Tue, 18 Feb 2025 22:04:59 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:04:59 GMT Message-Id: <202502182204.51IM4xlG009516@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 9355ad0b0bfa - main - makesyscalls: emit cpp in syscalls.map List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9355ad0b0bfaba9dc39972819185a7dc787a8950 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9355ad0b0bfaba9dc39972819185a7dc787a8950 commit 9355ad0b0bfaba9dc39972819185a7dc787a8950 Author: Brooks Davis AuthorDate: 2025-02-18 22:02:19 +0000 Commit: Brooks Davis CommitDate: 2025-02-18 22:03:33 +0000 makesyscalls: emit cpp in syscalls.map If there are per-platform differences in which syscalls are supported, we should only try to export implemented ones in libc. Fortunately, syscall maps are run though cpp. This is arguably incomplete as syscall.mk isn't (and can't practically be) supported. Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575 --- sys/tools/syscalls/examples/cpp/syscalls.conf | 1 + sys/tools/syscalls/examples/cpp/test_syscalls.map | 18 ++++++++++++++++++ sys/tools/syscalls/scripts/syscalls_map.lua | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/tools/syscalls/examples/cpp/syscalls.conf b/sys/tools/syscalls/examples/cpp/syscalls.conf index 7fc15b6bb01f..ffcfa8d4c6aa 100644 --- a/sys/tools/syscalls/examples/cpp/syscalls.conf +++ b/sys/tools/syscalls/examples/cpp/syscalls.conf @@ -7,4 +7,5 @@ syscallprefix="TEST_SYS_" switchname="test_sysent" namesname="test_syscallnames" systrace="test_systrace_args.c" +libsysmap="test_syscalls.map" compat_set="" diff --git a/sys/tools/syscalls/examples/cpp/test_syscalls.map b/sys/tools/syscalls/examples/cpp/test_syscalls.map new file mode 100644 index 000000000000..137496186402 --- /dev/null +++ b/sys/tools/syscalls/examples/cpp/test_syscalls.map @@ -0,0 +1,18 @@ +/* + * FreeBSD system call symbols. + * + * DO NOT EDIT-- this file is automatically @generated. + */ + +FBSDprivate_1.0 { +#ifdef PLATFORM_FOO + _syscall1; + __sys_syscall1; +#else +#endif +#ifdef PLATFORM_FOO +#else + _syscall2; + __sys_syscall2; +#endif +}; diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua index 023b43052921..52c3b294e338 100755 --- a/sys/tools/syscalls/scripts/syscalls_map.lua +++ b/sys/tools/syscalls/scripts/syscalls_map.lua @@ -37,7 +37,7 @@ function syscalls_map.generate(tbl, config, fh) gen:write(string.format("FBSDprivate_1.0 {\n")) for _, v in pairs(s) do - --print("num " .. v.num .. " name " .. v.name) + gen:write(v.prolog) if v:native() and not v.type.NODEF and not v.type.NOLIB then if v.name ~= "exit" and v.name ~= "vfork" then gen:write(string.format("\t_%s;\n", v.name)) @@ -45,6 +45,8 @@ function syscalls_map.generate(tbl, config, fh) gen:write(string.format("\t__sys_%s;\n", v.name)) end end + gen:write(tbl.epilog) + -- End gen:write("};\n") end From nobody Tue Feb 18 22:04:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyD8q6sLCz5pFsl; Tue, 18 Feb 2025 22:04: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 4YyD8q0Y13z3TDj; Tue, 18 Feb 2025 22:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKm6Ls+fIgTmhu1MF7G8vc0GnJS5cx6810M+JgTxS+8=; b=cE/p6Yr9QC5WlCkJtRc+o+v6MTWC2YTS4lTjg1ZV+oDXHsEEt6vf+MY4Tu6Lm/w4K7pBNm oj4ZTPBrXxTb2Fpqe2SMuIsxXxgiD6H9f6c6ukgPJgeJh5mJ7K0DYyELcQbdQo99feywiv OmHcOF3qIskVzOtrwvh+fp55LsDb7E4wroEWp9M5s99adRLYpGmQpKdrQ1IJb3mShinX+f +q1FX88fRYQY/PiyuQrbSrqKZC8k1R5zm4IirsB9Z4k8il5MJwAGdsg5B85VUVjiVzVOcH 467Psp3ZFoZdDVRomuhHNx48W9CB+gjYzq3bwYDJy3o9peY+ArOzUvM76udN5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739916299; a=rsa-sha256; cv=none; b=CePxuV4HUYKLm9LDZm9e5wnvNUTBPohqwIiAeXSZB5Dcw3F0U0G6/C7XGJR7ftI6tvGZwk XqMmvev0lVYRSQJ8NdQ4teaPccm7MrjiUxHJ/VagH9Peuy+eBqPveq2sZ2K6p1bbV/X80q V4bXFOjY9JCy2QQV59Rlg6kJqcgCkUqMFT1z1Z15nFyJ7adKfbQxRwn55QF8hxgJTE0Aes UXttf+sKWEP7wbGEQ/WRku3fQMj9hgUPERzFFdRW3wcnnt7T67Td1dCeA3Fm4gk5oCe+8k QBCCmU+VURxI/40ty+sR4mzJnxx63sCv7nax/x0AWQnixG0hBpmlwseYcftb3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739916299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KKm6Ls+fIgTmhu1MF7G8vc0GnJS5cx6810M+JgTxS+8=; b=dDGwGja4PfrT4UVT6q2mJyMN6ymyhN8KkjHoLeMhiPkVZ86ULTST2Onk08kB8pwsVuoLvz rnGEkJ5fbUvsS5wspvPfX2zXJbqDyJo1PrDlEKWFuy/ZEI3L9JTJtyOIEBHaTNrymnUETg WYPkJZr42Y5J7RkrvEZlY0oT9BjGnKFMqD9EgfhbDb1hPqIcd/siAKDSnIqjzbgJRMtk87 LD8o6UP5DtvjGiKjpdjvgvsgDHb3/zlXosoyZ0TMyFPC7x3K0d6uBGp7GD37kRQdWVMF2F JyVgpivHkiXUiMHPnmeDTglMBQZmFhpeC9m4xX9BWd8KCUhHHCHDc1/JF6bzcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyD8p6JpRzf6m; Tue, 18 Feb 2025 22:04: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 51IM4wvb009484; Tue, 18 Feb 2025 22:04:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IM4w3H009481; Tue, 18 Feb 2025 22:04:58 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:04:58 GMT Message-Id: <202502182204.51IM4w3H009481@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: f29905cab576 - main - makesyscalls: deprecate cpp other than includes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f29905cab576a0ccf454ee2e215f590e0e656d70 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=f29905cab576a0ccf454ee2e215f590e0e656d70 commit f29905cab576a0ccf454ee2e215f590e0e656d70 Author: Brooks Davis AuthorDate: 2025-02-18 22:02:19 +0000 Commit: Brooks Davis CommitDate: 2025-02-18 22:03:26 +0000 makesyscalls: deprecate cpp other than includes Warn that C preprocessor directives in the config file are deprecated. They are unsound and support has a number of potential pitfalls. They should be replaced by compile-time generation of files plus an overlay framework to allow things like per-arch variation. Reviewed by: kevans Sponsored by: DARPA, AFRL Pull Request: https://github.com/freebsd/freebsd-src/pull/1575 --- sys/kern/syscalls.master | 1 + sys/tools/syscalls/core/freebsd-syscall.lua | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index fbd2ffb60cae..67396a4cabc5 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -111,6 +111,7 @@ ; limited set of output files. Before the first syscalls, #include lines will ; be copied and %%ABI_HEADERS%% expanded. Between system call entries, ; all lines beginning with # will be copied. Caveat Emptor. +; WARNING: this functionality is deprecated. #include #include diff --git a/sys/tools/syscalls/core/freebsd-syscall.lua b/sys/tools/syscalls/core/freebsd-syscall.lua index fdd3a9011b7a..2ef0fdea6401 100644 --- a/sys/tools/syscalls/core/freebsd-syscall.lua +++ b/sys/tools/syscalls/core/freebsd-syscall.lua @@ -50,6 +50,7 @@ function FreeBSDSyscall:parseSysfile() local incs = "" local prolog = "" local first = true + local cpp_warned = false local s for line in fh:lines() do line = line:gsub(commentExpr, "") -- Strip any comments. @@ -82,6 +83,11 @@ function FreeBSDSyscall:parseSysfile() incs = incs .. h .. "\n" end elseif line:match("^#") then + if not cpp_warned then + util.warn("use of non-include cpp " .. + "directives is deprecated") + cpp_warned = true + end prolog = prolog .. line .. "\n" else s = syscall:new() From nobody Tue Feb 18 22:35:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyDrV6R7Jz5pHQT; Tue, 18 Feb 2025 22:35: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 4YyDrV49ZTz3mN4; Tue, 18 Feb 2025 22:35:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739918154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXFHCZEazhQw34KxpPqBCJgoki+zjeH1Z9XSbgb7GQQ=; b=qRnLJDLvlCrkRoe6aBSWhSSz66xLBo/uv4Xn6jmaqYwvhFp/xID7OXIWSJaNKAO5Xkp5cv fi6a6L7EF046b7Tp5W2u4eXss0e/klkqnApUBEWzxciKfcD/UIY2UZ0CacsWApcgbPo8tP ATh4DkCJeQvfm6hyoVzpvfjdcytb8TEBtnssx9Y3wuZ4G+Vez7b6VjJuIyOf0NcsIg/gJo 7BMYTRG6TorwnCP802si2u6JICbmMYbJMl0LmIlssvnaBORKE2frLzl7MMZOakLm87vceM X/MmzOTdREhBDWsMTzp4baVAqjW39lm1B7uGUQyUywbHWwzsmcoyFAbq5HWBLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739918154; a=rsa-sha256; cv=none; b=TDnj8CzxxJXksIn1Zk2Sprzp8w/Zq/CxUphG5aI9O5H0olpmDo3yWZOzlUZ7js5sZbA1S6 aI0ZcGm9+CvJHtQqOrDTE/bOVIbMkPJvpBV5tooVxqooMIVMz71ReYd7yVFMikk01/1/Ya 6MnDw4qgJNgEfgcYSEFolaSeWKBM4k8WRT9rJtr/r9gx56iC9sBIux2y3gn4ZxrlkghDkY Q6ieePjLxqyauDkGf91fFYu17W7sEVUOjQBuqnm/ndivzJw7B6p4MP4hxwM2N7Dq8p1kmW scckIgTCiDg2dFDJMitSpZoDR45u82OPNxl/+3EdE47l6J2A+KGi0jNFgQ8/+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=1739918154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GXFHCZEazhQw34KxpPqBCJgoki+zjeH1Z9XSbgb7GQQ=; b=fAFr3naopmGoypaf2WGaa2XoA7xh9CjvK62I+bNu19mrbfnMaMLJG9iL/WRDSG/V3vWCfJ djLzXQAds1Fn9qbOvCfyq3U4lgoCayRIqGaHEwuY3qK2ELRsMphy8EhZYFW8npv3iBDh3X CJ1U8jqlNlPpHvekpmOUmEP40H8PRE9Rsj/LPAMGQNhRsEHdmoggBeFydqbnr85eTgWXTW K/5ivkhB2WQ1kaFg2+NEfNnuoLEuaMr+iZuF2c24GbJT36wEYsY+zpPc8Ysg8ubAsoKoAC EyPc6Qs8XNYvACAD1dpmx6I5vvqO9JXEmKgjXiqeGLAS92DuuUtJSuPrOPcxuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyDrV3h1bzfs9; Tue, 18 Feb 2025 22:35: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 51IMZsa3065467; Tue, 18 Feb 2025 22:35:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51IMZsgm065464; Tue, 18 Feb 2025 22:35:54 GMT (envelope-from git) Date: Tue, 18 Feb 2025 22:35:54 GMT Message-Id: <202502182235.51IMZsgm065464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 8dc0889f56dd - main - nfscl: Add support for CB_RECALL_ANY to the NFSv4.1/4.2 client List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8dc0889f56dd6ac5c33ce79337a971af4b9ff127 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=8dc0889f56dd6ac5c33ce79337a971af4b9ff127 commit 8dc0889f56dd6ac5c33ce79337a971af4b9ff127 Author: Rick Macklem AuthorDate: 2025-02-18 22:34:12 +0000 Commit: Rick Macklem CommitDate: 2025-02-18 22:34:12 +0000 nfscl: Add support for CB_RECALL_ANY to the NFSv4.1/4.2 client Commit f5aff1871d32 and 7e26f1c21049 moved the delegation and layout high water variables into the clientID structure. This patch uses those variables to implement the CB_RECALL_ANY NFSv4.1/4.2 callback. This patch only affects NFSv4.1/4.2 mounts to non-FreeBSD NFS servers that use CB_RECALL_ANY. The Linux knfsd is one example of such a server. MFC after: 2 weeks --- sys/fs/nfs/nfsproto.h | 11 +++++++++++ sys/fs/nfsclient/nfs_clstate.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/sys/fs/nfs/nfsproto.h b/sys/fs/nfs/nfsproto.h index 323746ebbb6c..995754f42b15 100644 --- a/sys/fs/nfs/nfsproto.h +++ b/sys/fs/nfs/nfsproto.h @@ -744,6 +744,17 @@ #define NFSSECINFONONAME_CURFH 0 #define NFSSECINFONONAME_PARENT 1 +/* Bits for CB_RECALL_ANY. */ +#define NFSRCA4_RDATA_DLG 0x00000001 +#define NFSRCA4_WDATA_DLG 0x00000002 +#define NFSRCA4_DIR_DLG 0x00000004 +#define NFSRCA4_FILE_LAYOUT 0x00000008 +#define NFSRCA4_BLK_LAYOUT 0x00000010 +#define NFSRCA4_OBJ_LAYOUT_MIN 0x00000100 +#define NFSRCA4_OBJ_LAYOUT_MAX 0x00000200 +#define NFSRCA4_FF_LAYOUT_READ 0x00010000 +#define NFSRCA4_FF_LAYOUT_RW 0x00020000 + #if defined(_KERNEL) || defined(KERNEL) /* Conversion macros */ #define vtonfsv2_mode(t,m) \ diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 7e5baa453ad0..16d201d65b34 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3955,6 +3955,40 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) } NFSUNLOCKCLSTATE(); break; + case NFSV4OP_CBRECALLANY: + NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); + i = fxdr_unsigned(int, *tl++); + j = fxdr_unsigned(int, *tl); + if (i < 0 || j != 1) + error = NFSERR_BADXDR; + if (error == 0) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + j = fxdr_unsigned(int, *tl); + if (i < 100) + i = 100; + else if (i > 100000) + i = 100000; + NFSLOCKCLSTATE(); + clp = nfscl_getclntsess(sessionid); + if (clp == NULL) + error = NFSERR_SERVERFAULT; + if (((j & NFSRCA4_RDATA_DLG) != 0 || + (j & NFSRCA4_WDATA_DLG) != 0) && + error == 0 && i < + clp->nfsc_deleghighwater) + clp->nfsc_deleghighwater = i; + if (error == 0 && + ((!NFSHASFLEXFILE(clp->nfsc_nmp) && + (j & NFSRCA4_FILE_LAYOUT) != 0 && + i < clp->nfsc_layouthighwater) || + (NFSHASFLEXFILE(clp->nfsc_nmp) && + (j & (NFSRCA4_FF_LAYOUT_READ | + NFSRCA4_FF_LAYOUT_RW)) != 0 && + i < clp->nfsc_layouthighwater))) + clp->nfsc_layouthighwater = i; + NFSUNLOCKCLSTATE(); + } + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Wed Feb 19 02:45:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyLNX3F5Lz5nb2f; Wed, 19 Feb 2025 02:45: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 4YyLNX2YnKz49rT; Wed, 19 Feb 2025 02:45:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739933132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtSRsHsrzs3tcOCd8d+4EAGNryF5QtI+ohxF0OADrbc=; b=BQNubrc0F8+/GAMVMVoIn9dax2KMVALzKgoC97NYrxZIBf2AsUeCmGp8YPQZTv5J/FqPkW t3aZqMhFF8buL9nmBte6E0l4WNzzPSR2eGaqjviOKG9R9zMyYJ9Iyz+AqtHffeeidtr3qw ue5+D/VWgRX+aCaDFuXTlfLHt2dej/vbj6M9beQVq6B3IAAjKFxeCQ9aQWyXn1Fjn19Nvc O1A136SlBdrdm4C8IcSEGpQxQa9Np5Vj9O0MYkJjhPUXL5VLoR8DKfMhmvfa+eRVPPvH7j SrJe+xp3CMxkLgILRsX+xd0H2juM+fKWNX3re+EiFb+ji3l6wpPkqCI6G4NoRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739933132; a=rsa-sha256; cv=none; b=HvD8Yz6Mlcco1dEhRi1JBcWZet0/NH9fwS/fCrKag8b7yncqS0plydATnHgh+AOQo7T3cf 36iiP3xGT3ZP4BzlqRh+jDcg4o3FSWX8LambgCXBbDVRnWaMC6tXln6zkEM1jXpCl3Y5JN VcrSC3UIIotSwI+Nw2NuItObGAMvH10oVhDwW6gQDYmMcPsJ5pLTkGBqh6WsTh8PRWyF6c jeIaFpn5V31vMnGt5W3RZ/AO35++LZIH/vHNLqBcRRkanMaBYUIErl73DyVMdS6KCKXhgn SkPcha5bJu9AwtxB7wdTMy3aZwDy1shSrTvN/ovjR2/aFUmLHUFqGsNPyDE2Lw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739933132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtSRsHsrzs3tcOCd8d+4EAGNryF5QtI+ohxF0OADrbc=; b=n/S5iLrLJA4vz7pohW7dl68OCKsqbJlU1e/6Pp2J0wIvCgqT0ZuxMaM37NsE9kUAKnO3Lc QYeo8SF/aqJg7za5tIiSXhOTjsBrDXL2LoNKtQX/Q0mxxiRsw+cty3oyoBu4Y4J0Z3Jw37 J9NOPLSL+u7+i47shZLq4dHzTwWJI5OpvmepOD3bpJpMEynucdEjpCDY2gUyi2Sdnj7+cO GccHUlIiywCx8ybukXYYdPRl7mrOw+KjzPgfAaO60iRzyEoWza3efSAf3yslJAmXM8BWk2 hqCWeDQ3yJtiiXyL6vgxvpTlp4U6UBGBDjheGJ4CP9EHqXzgaO1pvQeyY80KQQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyLNX23h6znL5; Wed, 19 Feb 2025 02:45: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 51J2jWiK030609; Wed, 19 Feb 2025 02:45:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51J2jW9q030606; Wed, 19 Feb 2025 02:45:32 GMT (envelope-from git) Date: Wed, 19 Feb 2025 02:45:32 GMT Message-Id: <202502190245.51J2jW9q030606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: ed9712f89435 - main - var_run: Clean up style List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed9712f8943573136fa92a0e61c8e7c10952eeb0 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ed9712f8943573136fa92a0e61c8e7c10952eeb0 commit ed9712f8943573136fa92a0e61c8e7c10952eeb0 Author: Cy Schubert AuthorDate: 2024-11-26 15:16:22 +0000 Commit: Cy Schubert CommitDate: 2025-02-19 02:42:34 +0000 var_run: Clean up style Clean up style and make more consistent. Replace test with if-then-else to make the script more legible. Replace the call to dirname with the shell %/* operator avoiding a fork & exec. Reorder the test for $var_run_autosave before the test for /var/run on tmpfs. This avoids gratuitously scanning the mount table for a tmpfs /var/run. Initial concept by and in discussion with: Harry Schmalzbauer No functional change intended. MFC after: 2 weeks Differnential revision: https://reviews.freebsd.org/D47773 --- libexec/rc/rc.d/var_run | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libexec/rc/rc.d/var_run b/libexec/rc/rc.d/var_run index f76a06ab9f5a..9a3732f593b6 100755 --- a/libexec/rc/rc.d/var_run +++ b/libexec/rc/rc.d/var_run @@ -21,26 +21,30 @@ load_rc_config $name var_run_svcj="NO" _var_run_load() { - test -f ${var_run_mtree} && - mtree -U -i -q -f ${var_run_mtree} -p /var/run > /dev/null + if [ -f "${var_run_mtree}" ] ; then + mtree -U -i -q -f "${var_run_mtree}" -p /var/run > /dev/null + fi } _var_run_save() { - if [ ! -d $(dirname ${var_run_mtree}) ]; then - mkdir -p $(dirname ${var_run_mtree}) + if ! [ -d "${var_run_mtree%/*}" ]; then + mkdir -p "${var_run_mtree%/*}" fi - mtree -dcbj -p /var/run > ${var_run_mtree} + mtree -dcbj -p /var/run > "${var_run_mtree}" } _var_run_start() { - df -ttmpfs /var/run > /dev/null 2>&1 && + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_load + fi } _var_run_stop() { - df -ttmpfs /var/run > /dev/null 2>&1 && - checkyesno var_run_autosave && + if checkyesno var_run_autosave; then + if df -ttmpfs /var/run > /dev/null 2>&1; then _var_run_save + fi + fi } run_rc_command "$1" From nobody Wed Feb 19 02:57:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyLfJ5qFMz5nbbg; Wed, 19 Feb 2025 02:57: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 4YyLfJ10N8z3Jvx; Wed, 19 Feb 2025 02:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739933848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FD4qYU7QtqQ7NCBkbIiwmFE4IaUo8seOfNIpPzDuT98=; b=fDgDjMFsU/lrHJEjvxAft9GUxx1xclXLpNaqPXoVEUvPv6WR1N4rwQCkaX/CjXK9VgmbtS LpWF9oRu38WSztmAYSXLUGvDTA+N/kUP8+2O0oci+lGVl/5I7rbTBFL99lwm3FUerP86Uc q/gLe5RLsugCrmPaMgqm9yyVoanVfckkDukrgQjODpHDAvRmnNbJdf15cVjEOUx8iZefpd AZRsYOBKrRPy16oLBPEZQ8AXoMCvxGC5YltNNLqF5bv3JXl+Iwogah363cu6TNh3VZAq+s y3VA/0HD+T66LAVWPXX9BxNmTxR7YxRZbPRMHJOKzCWmLam5HgK4p1/Wl12zhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739933848; a=rsa-sha256; cv=none; b=kKA2a3WA79jrhZaLv6MlmZq0XZdnG5SAnB91EBDNiJFVpQQ/h0YjaCHXn/+fjflcGlfzL5 w60gjBYpSsR7tmjquASJBbB3sTPNdIsnBqTVzZn19bK3VxlMC6o6YglziKjfGUVwa/zYuc tKleZz2kA1sW3Efw+17jIqRkzJMzT2dTaquxo6m9QOPnpKTxSPDSreJrNpDQNCZ2mQtJzk K1JXiOx3pYTfZx7aECnPspaOZt8AfF9m5YpeluZpa5Jmj5brZSq+4rcROabeVlmXmZ1gPt syY17nHrQK/u7sWZkcv40T1ZQ6tH5Tb1P+m62NklpGRsT9yC5dxU9bDuMkoZIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739933848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FD4qYU7QtqQ7NCBkbIiwmFE4IaUo8seOfNIpPzDuT98=; b=VLpxcHMmqozq3tYVyMB56Paz7oUfJjgr1wiES2fUvZ1CQrsMw5dm616FOcX7ScGRw8XA9H Z1jWXC0K8z0lCYo1jHFnKlZsPICXUMD0IBAqXWSjSTi2A6gZECAzIc32B7dwpqGdKPQ8yP btTxU7axCAl4sOQUYB1x5VwX3ssw6pJylzzglzKXHgn11kMuAQIEQiixEY9pXSa4/g+idc aBIBFuaLEKqGlZDIRywiEzVLSo6EcPUVTZjy3zaQYlN7sErYpKbG+st4iJ2NyeNItknpCG llMqDz+cxdbrL+QLbYaAk/6mKPOcLV4UGHLQT/iqxMnHB/FknhKsFRWJNYRQqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyLfJ0bcczn9W; Wed, 19 Feb 2025 02:57: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 51J2vRi8049770; Wed, 19 Feb 2025 02:57:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51J2vRTI049767; Wed, 19 Feb 2025 02:57:27 GMT (envelope-from git) Date: Wed, 19 Feb 2025 02:57:27 GMT Message-Id: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61ce422531805307d413bf04c9ad1aabd7f3a879 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=61ce422531805307d413bf04c9ad1aabd7f3a879 commit 61ce422531805307d413bf04c9ad1aabd7f3a879 Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 02:50:11 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-19 02:56:59 +0000 wlanstats: move from tools to usr.sbin wlanstats is an incredible tool to get a quick overview of state of affairs of wireless by looking at the counters. And it makes it simple. Having landed the LinuxKPI HW_CRYPTO bits I was asked by users what to check and I realised the answer is in wlanstats. It is annoying even as a developer to manually build it for each installation but given it's also useful to users and support make it available with the general installation. Probably very long overdue. Adjust the Makefile and make build again on main. Hook it up to the build conditional on MK_WIRELESS. Discussed with: adrian Sponsored by: The FreeBSD Foundation TODO: man page MFC after: 3 days --- tools/tools/net80211/wlanstats/Makefile | 13 ------------- usr.sbin/Makefile | 1 + usr.sbin/wlanstats/Makefile | 14 ++++++++++++++ {tools/tools/net80211 => usr.sbin}/wlanstats/main.c | 0 {tools/tools/net80211 => usr.sbin}/wlanstats/wlanstats.c | 6 +++--- {tools/tools/net80211 => usr.sbin}/wlanstats/wlanstats.h | 0 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/tools/tools/net80211/wlanstats/Makefile b/tools/tools/net80211/wlanstats/Makefile deleted file mode 100644 index f3b6f718d44e..000000000000 --- a/tools/tools/net80211/wlanstats/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -.include - -PROG= wlanstats -BINDIR= /usr/local/bin -MAN= -LIBADD= bsdstat -CFLAGS+=-I${.CURDIR}/../../../../lib/libbsdstat/ - -SRCS= wlanstats.c main.c - -CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align - -.include diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 3904594bb2d9..a35c34ee23fc 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -207,6 +207,7 @@ SUBDIR.${MK_UTMPX}+= ac SUBDIR.${MK_UTMPX}+= lastlogin SUBDIR.${MK_UTMPX}+= utx SUBDIR.${MK_WIRELESS}+= wlandebug +SUBDIR.${MK_WIRELESS}+= wlanstats SUBDIR.${MK_WIRELESS}+= wpa SUBDIR.${MK_TESTS}+= tests diff --git a/usr.sbin/wlanstats/Makefile b/usr.sbin/wlanstats/Makefile new file mode 100644 index 000000000000..d6d29dcc57ad --- /dev/null +++ b/usr.sbin/wlanstats/Makefile @@ -0,0 +1,14 @@ +.include + +PROG= wlanstats +MAN= + +CFLAGS= -I${SRCTOP}/lib/libbsdstat +LIBADD= bsdstat + +SRCS= main.c \ + wlanstats.c + +CFLAGS.clang+= -fbracket-depth=512 + +.include diff --git a/tools/tools/net80211/wlanstats/main.c b/usr.sbin/wlanstats/main.c similarity index 100% rename from tools/tools/net80211/wlanstats/main.c rename to usr.sbin/wlanstats/main.c diff --git a/tools/tools/net80211/wlanstats/wlanstats.c b/usr.sbin/wlanstats/wlanstats.c similarity index 99% rename from tools/tools/net80211/wlanstats/wlanstats.c rename to usr.sbin/wlanstats/wlanstats.c index 74b1e7ffc989..8795333ccb17 100644 --- a/tools/tools/net80211/wlanstats/wlanstats.c +++ b/usr.sbin/wlanstats/wlanstats.c @@ -50,7 +50,7 @@ #include #include -#include "../../../../sys/net80211/ieee80211_ioctl.h" +#include "../../sys/net80211/ieee80211_ioctl.h" #include "wlanstats.h" @@ -460,8 +460,8 @@ getlladdr(struct wlanstatfoo_p *wf) if (p == NULL) errx(1, "did not find link layer address for interface %s", wf->ifr.ifr_name); - sdl = (const struct sockaddr_dl *) p->ifa_addr; - IEEE80211_ADDR_COPY(wf->mac, CLLADDR(sdl)); + sdl = (const struct sockaddr_dl *)(const void *)p->ifa_addr; + IEEE80211_ADDR_COPY(wf->mac, sdl->sdl_data + sdl->sdl_nlen); freeifaddrs(ifp); } diff --git a/tools/tools/net80211/wlanstats/wlanstats.h b/usr.sbin/wlanstats/wlanstats.h similarity index 100% rename from tools/tools/net80211/wlanstats/wlanstats.h rename to usr.sbin/wlanstats/wlanstats.h From nobody Wed Feb 19 09:16:35 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyW3m4BZvz5p4LR; Wed, 19 Feb 2025 09:16: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 4YyW3l75nRz3FBj; Wed, 19 Feb 2025 09:16:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739956596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1tPIbhmmVax8iKi8yBlfs2iCIUM3H8LOOFxg3woZ5w=; b=s9YNe/M7dWROzhk5KKVGs93QCDIazdoFpXWxilid3cCwCtHiY6UyNj/nj/CtXk0Kz3bolt 5esqdT8Zbr98TwLh2Y8qmWNoahyI4aIDCwc04LtYaegX1R0S+womHR7fDUy2QE2TMHJwXO HGw+5x8IDDoZkGe+GdBAukDi4Y0J7HZTAxTa1vAhVXns/Wg5rO5DRkPwaO+6c4LrkE5Gp1 6eBhsuL0HD+AkMnGFdL4+KEhqhRUzvS4HKp+rYZaPkQH5EN/qysuMRSyJQ7RxmHoRqPII/ g2zZl6rI0RbDjtsPM3vfc++0XpVsrBPPoWnx1+3+UwZ2Vlw/HUM8xQ5z8gkkfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739956596; a=rsa-sha256; cv=none; b=Rh1zKDC5M/Zx1RgSUGz6QLmCg3szk6Kht8zvl+/vHYR0LLtzodo7XjHO1Sp2InT3jHzNig CY6W/eA0SvbtP8KuUNCQW/APullefAj73vWf4BLTyo0YBn9mvTAr7Vroz1aaJCPgAEKp3m KBoe2V6nYClcg6Iis71r2FbHkD4YUHHHgRYrvuYAUFuRwmzkKSDXbJUMMs4O7jwqiZD1z5 9vFcRDsGLqDC0magL9opLdOjvx6WHwxD3Gs1B0BiBpj5ou0KG0cL6jE0gbOAt6QhH5MHZ8 dpTB8bPV5hiSaJ4z1PFMvKFkIAfoHZ7u5OKukVXvzYq/Y6bdaio0dC3rFv2lvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739956596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A1tPIbhmmVax8iKi8yBlfs2iCIUM3H8LOOFxg3woZ5w=; b=lQQ9RzrqiICwTBQePdUpodpSZ2TfkjkaN4oF68pC29Ta2rkOL/i0T/Ujka0XMoJ1FP3UuT 51Dpl2GNcJxuuIGUGqq5N+D8ig1tFby55FjX/F0BRERPp5TC3vXlQeUO0mNTW+FBg92qNe 0gdZ9N3pUqtWnTDK/MRGoEkzp8/3bUcKd4PMB3Ecivtb+JqJiKwpyqw9IkPiKuiBJxdXKY K7KsTjz7wsFau8umJBOpIYcVtQL7lI+degWlV69mYuyC6mTs1MHl4TNVZ5c8b93v7tEMNp 8Asw89CjquQcHpTNeoKO3wcm3uaye9Fg40o2Km6Y/dKn7402K/PpcEe0jj5kEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyW3l5S0Xz10bp; Wed, 19 Feb 2025 09:16: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 51J9GZBG063943; Wed, 19 Feb 2025 09:16:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51J9GZqJ063940; Wed, 19 Feb 2025 09:16:35 GMT (envelope-from git) Date: Wed, 19 Feb 2025 09:16:35 GMT Message-Id: <202502190916.51J9GZqJ063940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: c301c5841f9f - main - pctrie: unlock node store in remove List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c301c5841f9f5ca3a53a68019115b23ae0ef64a8 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=c301c5841f9f5ca3a53a68019115b23ae0ef64a8 commit c301c5841f9f5ca3a53a68019115b23ae0ef64a8 Author: Doug Moore AuthorDate: 2025-02-19 09:15:30 +0000 Commit: Doug Moore CommitDate: 2025-02-19 09:15:30 +0000 pctrie: unlock node store in remove In pctrie_remove(), if the removal of an item leaves an internal node with one child, then there are two calls to pctrie_node_store(). Only the second of these two needs to be stored with PCTRIE_LOCKED synchronization. Eliminate pointless synchronization for the first node_store in that case. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49033 --- sys/kern/subr_pctrie.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index a17c386a6e24..03cf3e1e5990 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -834,13 +834,14 @@ static void pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index, struct pctrie_node **freenode) { + smr_pctnode_t *parentp; struct pctrie_node *child; int slot; *freenode = NULL; + parentp = pctrie_child(ptree, node, index); if (node == NULL) { - pctrie_node_store(pctrie_root(ptree), - PCTRIE_NULL, PCTRIE_LOCKED); + pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_LOCKED); return; } slot = pctrie_slot(node, index); @@ -848,20 +849,22 @@ pctrie_remove(struct pctrie *ptree, struct pctrie_node *node, uint64_t index, ("%s: bad popmap slot %d in node %p", __func__, slot, node)); node->pn_popmap ^= 1 << slot; - pctrie_node_store(&node->pn_child[slot], PCTRIE_NULL, PCTRIE_LOCKED); - if (!powerof2(node->pn_popmap)) + if (!powerof2(node->pn_popmap)) { + pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_LOCKED); return; + } + pctrie_node_store(parentp, PCTRIE_NULL, PCTRIE_UNSERIALIZED); KASSERT(node->pn_popmap != 0, ("%s: bad popmap all zeroes", __func__)); slot = ffs(node->pn_popmap) - 1; + *freenode = node; child = pctrie_node_load(&node->pn_child[slot], NULL, PCTRIE_LOCKED); KASSERT(child != PCTRIE_NULL, ("%s: bad popmap slot %d in node %p", __func__, slot, node)); - *freenode = node; node = pctrie_parent(node); if (!pctrie_isleaf(child)) pctrie_setparent(child, node); - pctrie_node_store(pctrie_child(ptree, node, index), child, - PCTRIE_LOCKED); + parentp = pctrie_child(ptree, node, index); + pctrie_node_store(parentp, child, PCTRIE_LOCKED); } /* From nobody Wed Feb 19 10:41:36 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxr6qSNz5p9lM; Wed, 19 Feb 2025 10:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YyXxr1lXBz3ljB; Wed, 19 Feb 2025 10:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qtty+asDCdc5+RK7b6af4RamnvDLhBTPRwuwsUZMPek=; b=b4h1mBguFP9H4FC2G+Q4XshKppU3HGXCvmHNh3KPQky1c7n4FaL+KLlaOX+7QuX6xRnS8p M120tzm2FDNK8LThb4hfR3hfg6cP3yeOWtu2ceZCgOFQP/CYOoY3WfQA5sDmB3sfzy5ohn fVyeav5c7swFQ4RbNPhAUyaW4Z02VGd8WIHItyzojC+B11GYlp0hQ8+UWQ3mCEGFzA+sAZ F1TntYBegieLRuPZhIkRts8//+Y8iFZAD7VKvWZnU+A3eHrVICrUqM42kZMlpQJTVuR8QX HHAYnec3ni7mK0ANtXiUQ9fRZZsBrrSf+tYDgpMvOjTPhM51sldiTD01JcJa/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961696; a=rsa-sha256; cv=none; b=ejRC10mgm49JBWPwfKZzIuIsdXoTQEKWJlscO270eQS8txpRJjEAlve/8pMHJad9huZVs9 AJ5Ioc7WEkwzY5+albRCst2v6Vft8Tk08hJZAht/GHGwznCQPNiE0qp8pX7TykJGMAEO4x effCXk71M7O4GVNz3y9FmTzxxkbes5uoo/N8KxBYvWxFFpnMrq/KI18AQfO15kDT/hrQW/ fBYh20KC6BSPAvqYxrxsMt4uHmQ83n8Jpxvbnae3GfWXpQK7HNS2vjqI4FCsj1Ja8sZYiB wW7x1f2h22L999z+qDetta/fAP9wMXGX0T8eDIoE5z1hs9b9VB4V+mr3O7X9Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qtty+asDCdc5+RK7b6af4RamnvDLhBTPRwuwsUZMPek=; b=AZtbaDxawA2K7Tu8lsnNgSvLAQ385LVDJtUcgvBPKb+mhORMMjo3KXcZG3gX6FA9qD3uqk H09sOhZ6842F3uhMg/DmctwBosdDpyVTmB3Syirf3K/ZllhcPsLN+g+7fTV/r1IXRoTQyz XkIAq2RBYFTJbIwYSIi522gEmjFzVNjn8XJforittOVynCqkUfEuD2EZYrwQ0laezW0GFL 5It/0eoTRvjULpC9J4OHypepEX2onScVyHJihEDp4eHauE8v9wLp12ccQ9qGABTcbdh/IR lTbMM9h3UkSFikvLQelWGExLAVhOar7I2ZjzgVgvwkAXBJfCRDuYsXSzBWTUuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxr19S0z12gZ; Wed, 19 Feb 2025 10:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51JAfapw035263; Wed, 19 Feb 2025 10:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfahe035259; Wed, 19 Feb 2025 10:41:36 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:36 GMT Message-Id: <202502191041.51JAfahe035259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9a1b591a862d - main - pf: bcopy -> memcpy List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a1b591a862dbb65231f8c8a6900957e3f99b686 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9a1b591a862dbb65231f8c8a6900957e3f99b686 commit 9a1b591a862dbb65231f8c8a6900957e3f99b686 Author: Kristof Provost AuthorDate: 2025-02-11 13:20:46 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:08 +0000 pf: bcopy -> memcpy impossibility of overlaps verified. ok benno dlg Obtained from: OpenBSD, henning , 47d085d437 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 6 +++--- sys/netpfil/pf/pf_ioctl.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 5e5bd744343c..ea5687407881 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -4043,7 +4043,7 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, opt[0] = TCPOPT_MAXSEG; opt[1] = 4; HTONS(mss); - bcopy((caddr_t)&mss, (caddr_t)(opt + 2), 2); + memcpy((opt + 2), &mss, 2); } switch (af) { @@ -4998,7 +4998,7 @@ pf_get_mss(struct pf_pdesc *pd) --hlen; break; case TCPOPT_MAXSEG: - bcopy((caddr_t)(opt + 2), (caddr_t)&mss, 2); + memcpy(&mss, (opt + 2), 2); NTOHS(mss); /* FALLTHROUGH */ default: @@ -6061,7 +6061,7 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, s->rule = r; s->nat_rule = nr; s->anchor = a; - bcopy(match_rules, &s->match_rules, sizeof(s->match_rules)); + memcpy(&s->match_rules, match_rules, sizeof(s->match_rules)); memcpy(&s->act, &pd->act, sizeof(struct pf_rule_actions)); STATE_INC_COUNTERS(s); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 6553981a1059..c8447b4e64b8 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -5733,7 +5733,7 @@ pf_state_export(struct pf_state_export *sp, struct pf_kstate *st) strlcpy(sp->ifname, st->kif->pfik_name, sizeof(sp->ifname)); strlcpy(sp->orig_ifname, st->orig_kif->pfik_name, sizeof(sp->orig_ifname)); - bcopy(&st->act.rt_addr, &sp->rt_addr, sizeof(sp->rt_addr)); + memcpy(&sp->rt_addr, &st->act.rt_addr, sizeof(sp->rt_addr)); sp->creation = htonl(time_uptime - (st->creation / 1000)); sp->expire = pf_state_expires(st); if (sp->expire <= time_uptime) From nobody Wed Feb 19 10:41:37 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxs6gDdz5p9nx; Wed, 19 Feb 2025 10:41: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 4YyXxs2zdsz3lRC; Wed, 19 Feb 2025 10:41:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Mb7sW3tefkKNVP3b4/GWAW+ZH8voM8se467WNDymvc=; b=DPBtJmPvfQF5qgQR6z4Ho/fC48tWvIt5oOCX0RYXvBlhhK0Dum2Fk9NCTOhpD/9/xOP7AR SFqeoOH8mFDUPye9b2piNJHzO9RLzJCf4GX3xnfkhRVlXxNTjCfGtbxh1EIeYumPd4gXyb wit+HEO8acA0mMDDM7Dy2S0ZNqfDSUHSg2LzPDFAv0WIIYMyNGcs3K8KD8PA86nzimiAef srCz5xtUjcif4Xfmxme+ygpcXEpT0vptSGYI1DlPhS4yWpzRGR8++2dgJKPNUWbNb5dFSa wVLSqV8KJjl9Q6zqFq4q7gkUXTWC86uyFpvC3mLLa6aDY8JVvBl8mK0go5paRw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961697; a=rsa-sha256; cv=none; b=wFdMoSkAs0iH1uZLH5ouZdYwydEplh+7Buclksp0hEP+NMhJFBEbpzy+5QuxcMpktibOr/ q5lLK79g4HdEC/hf+J0ZDuBJ+6LhbwK35RXHoo18ICHybP4zaShmECibRgLOri9UgZCVjV YHfjbnPBgOEkpbilA7akLpm707nYGU4X/db5qcC2vk5ahV+ApR156NdE6/w5vMN5y4psPh EyByyvhK+Z1YU0WyU4RmaFCuWZ6/u/RN6EhO4mjPI7Q9XPuFLHNeW3nJpId16Wzfj80RgW pvPoh4rs7apeVwyBLUG0Re40jNntl9Js50Q8pkIR/x63m/hsB+PyibUefULQ/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=1739961697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0Mb7sW3tefkKNVP3b4/GWAW+ZH8voM8se467WNDymvc=; b=NvhUdVDMFjFXCGsi5Dg/RmuoQw1fgikiB+Z11YTqDPKV5pWhHRpovLiI2p4T4Vj2+LWfD2 z1TILDaCy7uakZiBRl7gTRdAa0RcjBymaO9AjE+X1i6l6jLT/ZSFWQA1de6iDmT0EHDdPB H1PDVHImDH0A7ChGXsLUUfBPm4/4WNTkasZygVk3hVf6A4LGCT4CqsncDcbK6a+yxQgzAz RBO5KwFvB1i+0xZW6KgimYvsTAx+whL+lR3p0r/ipJYbaLl3LF/FoIDM7mrGyFVt9t8X0R cZGZKWpgdfMhccwSkW7eIpHrj0hd+cgZQjkFbAEjmJSClVN733GscIRosk4qVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxs2N4Bz12mb; Wed, 19 Feb 2025 10:41: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 51JAfbfS035297; Wed, 19 Feb 2025 10:41:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfbCJ035294; Wed, 19 Feb 2025 10:41:37 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:37 GMT Message-Id: <202502191041.51JAfbCJ035294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b34f497b3e6e - main - pf: simplify pf_check_proto_cksum() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b34f497b3e6eff1c7b12f5700d897743073dfcff Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b34f497b3e6eff1c7b12f5700d897743073dfcff commit b34f497b3e6eff1c7b12f5700d897743073dfcff Author: Kristof Provost AuthorDate: 2025-02-11 13:24:56 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:09 +0000 pf: simplify pf_check_proto_cksum() Simplify and shorten the way ICMP checksums are verified in pf_check_proto_cksum() by letting it use the same in4_cksum() call that is used for TCP and UDP checksums. ok henning@ naddy@ Obtained from: OpenBSD, lteo , 3c23016fb7 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ea5687407881..da741364d372 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -9276,19 +9276,9 @@ pf_check_proto_cksum(struct mbuf *m, int off, int len, u_int8_t p, sa_family_t a if (!hw_assist) { switch (af) { case AF_INET: - if (p == IPPROTO_ICMP) { - if (m->m_len < off) - return (1); - m->m_data += off; - m->m_len -= off; - sum = in_cksum(m, len); - m->m_data -= off; - m->m_len += off; - } else { - if (m->m_len < sizeof(struct ip)) - return (1); - sum = in4_cksum(m, p, off, len); - } + if (m->m_len < sizeof(struct ip)) + return (1); + sum = in4_cksum(m, (p == IPPROTO_ICMP ? 0 : p), off, len); break; #ifdef INET6 case AF_INET6: From nobody Wed Feb 19 10:41:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxv0rbGz5p9gZ; Wed, 19 Feb 2025 10:41: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 4YyXxt3lSZz3lZH; Wed, 19 Feb 2025 10:41:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6XVWIQ6liotqQ+uKEW6R2W27ndPwzQgcW166DxtfbH8=; b=l/wyGtbCgCMbQFLoK9Q2fPi1ZaX4VhtKlei7a0HKknKIg2GDxhwz0REMGH/Np4O9fFA2zu RgIDlZJJArFcaWomKrleKRIYf6H9P9kMT9PtyUs9H+W6ZP8+vpXrAbLl57+j7E9TjYbba3 MI027z7BqE9JBSDUXIdppWmAVg/u4BUVMm3IbKjRxPDaf1bGcaszDd+7/kb9Pip0Ili6E3 PWH0FU4NmMlAkJMJ1MvdmaEUEhWBFBkIaY/6r6X/AINFpaJTL3/RcT0VJxzwX4t4wtA0Y5 U0Rs+Z3U6g+Vx2UuhXxsCCk4n0yzf/m0E1z0MAOfMPVjMjCYl31D1SsXvz983A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961698; a=rsa-sha256; cv=none; b=kWiVv4VO5abZL1HBTK7yFBuOIbfuhNFhRUanmmDbbuGQM5KKu9CoSEvxAXCaWcnO82JVHp 39gOdtA1TzBD/IjbYbzTbFRNSmqCPKnyJwcBcDD9lkAEoPn/PwhR2Cjs7uy8ZgMueKjsig S7IylRw+yq8A2OmgQ64P5tlXgYDfmSdaYeg0MsWzPftnCf0zdUtpEIxH5DoaJBG662BNZJ 8yCAg6p2+YukeIER5+dvJTt0FK2it8OKkHRGge4uGmuVp/IQgjdyIpKGOUudRAXkC43eyc GtF4Y9+yC8ATXlYu/IfBALPLBerKiCuFqHTo3jn5llZSCS5k+8OFU+bxh8gEyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6XVWIQ6liotqQ+uKEW6R2W27ndPwzQgcW166DxtfbH8=; b=hgzqfKqV70Uul0UR+Ty8419tX54KU2HCdkqtjNSS9HzmcSkOZgitkqD6CIjHUVS/3RFdwb UKKtXi+k/zNTszUcOeNZNqGJnVHvGvEo3itEkcdTi/xKi8oqa8OW/tgFtuIaiawgz13+nF vrQNrSn/akmGvrf6l8dm1q5FSj7RG25xfCoG0JuNGmFm+uDJWyVnpZmDtEkJwtkJ7cgaiY y1keSmnq6h0hFwkydd8XjPkQqdP4okJkHlOAaOGxCwIRx8MotoYPxJSJ6O2bEFjK8lCj9b lCgjFJg5v4ifqOMyYfLc6dlUGha/7AsEFte5ZN5wlICzi9J4EviFTuuTSWLryQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxt3LZbz12gb; Wed, 19 Feb 2025 10:41: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 51JAfch8035335; Wed, 19 Feb 2025 10:41:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfcCB035332; Wed, 19 Feb 2025 10:41:38 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:38 GMT Message-Id: <202502191041.51JAfcCB035332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8aa098b46914 - main - pf: pf_send_tcp: ask the stack to do the cksum instead of doing it manually List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8aa098b469144e56517b1e59302d918151cd04a1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8aa098b469144e56517b1e59302d918151cd04a1 commit 8aa098b469144e56517b1e59302d918151cd04a1 Author: Kristof Provost AuthorDate: 2025-02-11 15:09:53 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:09 +0000 pf: pf_send_tcp: ask the stack to do the cksum instead of doing it manually ok benno lteo naddy (back in january) Obtained from: OpenBSD, henning , 674c6722fd Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 55 ++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index da741364d372..2a1ee73b3aef 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2354,7 +2354,9 @@ pf_intr(void *v) pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; pfse->pfse_m->m_pkthdr.csum_flags |= - CSUM_IP_VALID | CSUM_IP_CHECKED; + CSUM_IP_VALID | CSUM_IP_CHECKED | + CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + pfse->pfse_m->m_pkthdr.csum_data = 0xffff; ip_input(pfse->pfse_m); } else { ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, @@ -2375,6 +2377,9 @@ pf_intr(void *v) pfse->pfse_m->m_flags |= M_SKIP_FIREWALL | M_LOOP; + pfse->pfse_m->m_pkthdr.csum_flags |= + CSUM_DATA_VALID | CSUM_PSEUDO_HDR; + pfse->pfse_m->m_pkthdr.csum_data = 0xffff; ip6_input(pfse->pfse_m); } else { ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, @@ -4003,28 +4008,46 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, switch (af) { #ifdef INET case AF_INET: + m->m_pkthdr.csum_flags |= CSUM_TCP; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + h = mtod(m, struct ip *); - /* IP header fields included in the TCP checksum */ h->ip_p = IPPROTO_TCP; h->ip_len = htons(tlen); + h->ip_v = 4; + h->ip_hl = sizeof(*h) >> 2; + h->ip_tos = IPTOS_LOWDELAY; + h->ip_len = htons(len); + h->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0); + h->ip_ttl = ttl ? ttl : V_ip_defttl; + h->ip_sum = 0; h->ip_src.s_addr = saddr->v4.s_addr; h->ip_dst.s_addr = daddr->v4.s_addr; th = (struct tcphdr *)((caddr_t)h + sizeof(struct ip)); + th->th_sum = in_pseudo(h->ip_src.s_addr, h->ip_dst.s_addr, + htons(len - sizeof(struct ip) + IPPROTO_TCP)); break; #endif /* INET */ #ifdef INET6 case AF_INET6: + m->m_pkthdr.csum_flags |= CSUM_TCP_IPV6; + m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + h6 = mtod(m, struct ip6_hdr *); /* IP header fields included in the TCP checksum */ h6->ip6_nxt = IPPROTO_TCP; h6->ip6_plen = htons(tlen); + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_hlim = V_ip6_defhlim; memcpy(&h6->ip6_src, &saddr->v6, sizeof(struct in6_addr)); memcpy(&h6->ip6_dst, &daddr->v6, sizeof(struct in6_addr)); th = (struct tcphdr *)((caddr_t)h6 + sizeof(struct ip6_hdr)); + th->th_sum = in6_cksum_pseudo(h6, len - sizeof(struct ip6_hdr), + IPPROTO_TCP, 0); break; #endif /* INET6 */ } @@ -4046,34 +4069,6 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, memcpy((opt + 2), &mss, 2); } - switch (af) { -#ifdef INET - case AF_INET: - /* TCP checksum */ - th->th_sum = in_cksum(m, len); - - /* Finish the IP header */ - h->ip_v = 4; - h->ip_hl = sizeof(*h) >> 2; - h->ip_tos = IPTOS_LOWDELAY; - h->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0); - h->ip_len = htons(len); - h->ip_ttl = ttl ? ttl : V_ip_defttl; - h->ip_sum = 0; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - /* TCP checksum */ - th->th_sum = in6_cksum(m, IPPROTO_TCP, - sizeof(struct ip6_hdr), tlen); - - h6->ip6_vfc |= IPV6_VERSION; - h6->ip6_hlim = IPV6_DEFHLIM; - break; -#endif /* INET6 */ - } - return (m); } From nobody Wed Feb 19 10:41:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxw1f9Vz5p9jP; Wed, 19 Feb 2025 10:41: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 4YyXxv4lRkz3ll6; Wed, 19 Feb 2025 10:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq1+FR4BDFF5dgM3nQsbtvAQL7xMkfGjjx7GkoOQju4=; b=ds3HQFzfK9Z5HgvFv/MgFmwuv1pNkgkInRHMQiWSYRnkQhOHbX/RDCuVPLjDrh+2PqGL/T bzwwna+Am4j6lpN3wpqyAOQPcmIX7qcmkXip0xPOBLS513fIDKd622uptIxJcY8YV0+mXq JTPaMXUZKHUNpEmmRlfIhJDG+njEFRU/SDPlgFmg5BjviYUrjJB6m6uGk0eNutHOmKeWcA AJZPsBUf5oOD6wzNI29i3GekR+/E80KiJXRlRosiU9rtL0HTDQ7IjFRd2wDhaYv3Y5aaSI mCVpUcIPY1FipB89uSe3xXhKAIud5feOjJ2AhWPbVLKG0TiZ2gwcnqVB30REsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961699; a=rsa-sha256; cv=none; b=qzWD56l45i+XgR5LtxA/1Zuzn8VwUSg9o7MpWTU9vgTW/LM6kQdqjFuqff2+71zW4jSWfM GAogoER062Qfhu3fUaWnhX95YaUzS3Kve2aG4dnWvHB1ZKPKMydTm6gEU3O55STQ0N9IMB rpe8StwIEbdAQ2Z/bF/2fnqth7ydEFq1WAR9wVKNS/0CgRrwpaOm5lWahRESPFO32OG+ke EOHgp6nLBf/b4IykTKgOyCPL0BheNfe9ZxkSITzOpvkwmhkwwvpmsUSJLbTX4MnTOHY9z3 AKozJYX0LBxYnT4Vk60PYFswNbPTZDKwWt0vEu+4ENqlQTSn2tctiiZW/8Dc1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq1+FR4BDFF5dgM3nQsbtvAQL7xMkfGjjx7GkoOQju4=; b=Qq5LkXd3n0soZgc8JUwkrvlNrsjyj5SvQWZBBrgNBSUC8jLiO8q0nWbyVDu1ZihaDw0q22 BSCGdXDyJ80WHxUxMwqz59OHSAmUUMwPDdNR6t/46CBJQxUC15xWuXiwEtfUWA/nEcSVbF U+yrT5krxcunBs2Lz2IIs2Sy7S/LlXpuG2M/5VDeuTBxBmHNoI0lyB+XYk6OVTOAM4bUCC VjhZzTqXZ+DGBtqWudVuSbckQ3QSkrxSJLE81Ov4PmNNMue298jUM1rSMAQG6Rm7EeFovD WuiXpYp9mmehykEthkXnIaZpXogj1ewgsbBf75eBq4CsrCMrVZMXGsgPxDpIdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxv4GTkz12md; Wed, 19 Feb 2025 10:41: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 51JAfdtt035369; Wed, 19 Feb 2025 10:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfdJK035366; Wed, 19 Feb 2025 10:41:39 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:39 GMT Message-Id: <202502191041.51JAfdJK035366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5b7bfd0046c2 - main - pfctl: consolidate some code by using reallocarray in all cases List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b7bfd0046c2a3725fa71783ac7d7b842ec0de58 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b7bfd0046c2a3725fa71783ac7d7b842ec0de58 commit 5b7bfd0046c2a3725fa71783ac7d7b842ec0de58 Author: Kristof Provost AuthorDate: 2025-02-11 15:12:55 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:09 +0000 pfctl: consolidate some code by using reallocarray in all cases ok deraadt millert Obtained from: OpenBSD, tedu , 97d14fe110 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_radix.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index 94de63414885..3bb2469a9bfb 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -434,25 +434,15 @@ pfr_buf_grow(struct pfr_buffer *b, int minsize) if (!b->pfrb_msize) { if (minsize < 64) minsize = 64; - b->pfrb_caddr = calloc(bs, minsize); - if (b->pfrb_caddr == NULL) - return (-1); - b->pfrb_msize = minsize; - } else { - if (minsize == 0) - minsize = b->pfrb_msize * 2; - if (minsize < 0 || minsize >= SIZE_T_MAX / bs) { - /* msize overflow */ - errno = ENOMEM; - return (-1); - } - p = realloc(b->pfrb_caddr, minsize * bs); - if (p == NULL) - return (-1); - bzero(p + b->pfrb_msize * bs, (minsize - b->pfrb_msize) * bs); - b->pfrb_caddr = p; - b->pfrb_msize = minsize; } + if (minsize == 0) + minsize = b->pfrb_msize * 2; + p = reallocarray(b->pfrb_caddr, minsize, bs); + if (p == NULL) + return (-1); + bzero(p + b->pfrb_msize * bs, (minsize - b->pfrb_msize) * bs); + b->pfrb_caddr = p; + b->pfrb_msize = minsize; return (0); } From nobody Wed Feb 19 10:41:40 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxx25hfz5p9d8; Wed, 19 Feb 2025 10:41: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 4YyXxw5rLkz3lRG; Wed, 19 Feb 2025 10:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xd9IOsX7SimzGit4NcpbIqwKLs8k22SgLofvQDYF1ko=; b=BsTmTSZ+XHRiRYfqOFZR4yYxjuFFEzPp+BB888a07vUfGmlQV+G9jjJb3KPInEGxYXYpgo YnDDjYa8Ogjei77QBQkfiU+yiTPWZe2rDqx6ECG7bgi4lO3G+auxhBsgXSafA6GlFvpBJm HZqjbvtQrtWK7wz5anNnBT6b1bNpznFxsE2KwQsYLzOY817s9gf/c6gM25PRU5PRUSF2tx sNh1AcY1TtCzWbXdTeCbUFGg0S5pfzVagLDpjSpxXddIN3gI9w/lcIYV3En8Lbez9HeyyV IUW7KJt362QRXXkmp5f8Xh4Z8fivi5Gbv2DRBHsnx5/JqFuqDsRtji7t9bDw4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961700; a=rsa-sha256; cv=none; b=QJzOVVRjJFqALdHkVzeHV5RXRc/ob6i3yoY6oznXPe/SAOizuNPB3vQDDiJMFQpoxwfGtQ 03WjokSp5XU88ljhVhcwV5q1LAJLAulN1mQkApClDZW6+jNaQt+LOPaLI28G5uKtjAuuA7 1VuvsrVM8PEQQ2q9FoxAN4yXdmE+LVgNgh93tdDM65k7pj+XCC87BUyFmct9nJNY9LyySy BsfOz/HRrRdWTxFN/GMe52g2nazCknpx/4tpO7dLXZZPJrbNVFROOjRG7UIQO6otF0r9sM e/SmWR1XhHbHnK+g9PpqRjDGnfGFnl+tyKMCL43Y6AN13N97hHuu1QCegf+JWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xd9IOsX7SimzGit4NcpbIqwKLs8k22SgLofvQDYF1ko=; b=YLWmRMqCHU7rUI9XNiTDOpzA5M+VLh9LeyaFj4/85mIGscyLnTG6e7/AcDm40fjyWhN9gg wcVGRLDtdutp7aHu8dIbeJXXsj1ANRfvUKTS9W5idxaxWR3nqALeVzkUpxVOHYFwEZ/Gyh X3dAGpiWg47hkDkJ4qBlx2PzzUm6yOgqDYnRdaAjqpsdjrtn80JNBcj9E0ZHXLc3QcaFnP lVCAHT3hsV/KRnoGPvwjY4FfCCMPi06njH2Gtst07DI2U9nGQQFkIAU657o2blnwrEqoyd pNwW3Q3Fy4QTMmw+LDqHk93GIriewPKvBs3lOUPjW2ujKd4aGkCvk84v7pj5MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxw59Sjz12mf; Wed, 19 Feb 2025 10:41: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 51JAfeDk035403; Wed, 19 Feb 2025 10:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfeCw035400; Wed, 19 Feb 2025 10:41:40 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:40 GMT Message-Id: <202502191041.51JAfeCw035400@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9d5c83a0b84c - main - pf: convert to use sha512 for pf iss List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d5c83a0b84caab2fbc4be22a7008b280aaedc80 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d5c83a0b84caab2fbc4be22a7008b280aaedc80 commit 9d5c83a0b84caab2fbc4be22a7008b280aaedc80 Author: Kristof Provost AuthorDate: 2025-02-11 16:37:16 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:09 +0000 pf: convert to use sha512 for pf iss ok deraadt dlg Obtained from: OpenBSD, tedu , 842fba9566 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2a1ee73b3aef..0e816f1205c5 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,8 @@ #include #include +#include + #include #include #include @@ -176,7 +177,7 @@ VNET_DEFINE(u_int32_t, ticket_altqs_inactive); VNET_DEFINE(int, altqs_inactive_open); VNET_DEFINE(u_int32_t, ticket_pabuf); -VNET_DEFINE(MD5_CTX, pf_tcp_secret_ctx); +VNET_DEFINE(SHA512_CTX, pf_tcp_secret_ctx); #define V_pf_tcp_secret_ctx VNET(pf_tcp_secret_ctx) VNET_DEFINE(u_char, pf_tcp_secret[16]); #define V_pf_tcp_secret VNET(pf_tcp_secret) @@ -5050,35 +5051,38 @@ pf_calc_mss(struct pf_addr *addr, sa_family_t af, int rtableid, u_int16_t offer) static u_int32_t pf_tcp_iss(struct pf_pdesc *pd) { - MD5_CTX ctx; - u_int32_t digest[4]; + SHA512_CTX ctx; + union { + uint8_t bytes[SHA512_DIGEST_LENGTH]; + uint32_t words[1]; + } digest; if (V_pf_tcp_secret_init == 0) { arc4random_buf(&V_pf_tcp_secret, sizeof(V_pf_tcp_secret)); - MD5Init(&V_pf_tcp_secret_ctx); - MD5Update(&V_pf_tcp_secret_ctx, V_pf_tcp_secret, + SHA512_Init(&V_pf_tcp_secret_ctx); + SHA512_Update(&V_pf_tcp_secret_ctx, V_pf_tcp_secret, sizeof(V_pf_tcp_secret)); V_pf_tcp_secret_init = 1; } ctx = V_pf_tcp_secret_ctx; - MD5Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short)); - MD5Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short)); + SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short)); + SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short)); switch (pd->af) { case AF_INET6: - MD5Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr)); - MD5Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr)); + SHA512_Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr)); + SHA512_Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr)); break; case AF_INET: - MD5Update(&ctx, (char *)&pd->src->v4, sizeof(struct in_addr)); - MD5Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr)); + SHA512_Update(&ctx, (char *)&pd->src->v4, sizeof(struct in_addr)); + SHA512_Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr)); break; } - MD5Final((u_char *)digest, &ctx); + SHA512_Final(digest.bytes, &ctx); V_pf_tcp_iss_off += 4096; #define ISN_RANDOM_INCREMENT (4096 - 1) - return (digest[0] + (arc4random() & ISN_RANDOM_INCREMENT) + + return (digest.words[0] + (arc4random() & ISN_RANDOM_INCREMENT) + V_pf_tcp_iss_off); #undef ISN_RANDOM_INCREMENT } From nobody Wed Feb 19 10:41:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxy0hqTz5p9p3; Wed, 19 Feb 2025 10:41: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 4YyXxx6WpJz3lVH; Wed, 19 Feb 2025 10:41:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eZOMiWmz3ProoVctIRCKhswFNFhlR2DuaF32uYi6RdI=; b=lDqcM6RlHg0ZfZRgirbnwdcoQDE5MKn4Zch9h+OkQJqq8D66c5xqID733vdat+SW0UUE7d b8o8wECTKjRwl26hvwCVcVNyYNoRbAMcyTAYrIHc9ymRVpXJf8dcY6KEpjDRgsvsnkjuoE qYjxNFyJM/aYtJ802owwAe/khJMG+X2qf3Bjp3mwZ7+RzehdKONvQsaC5ICr9JQNBZLeWD aIb2DSqVDtgd1j5995zOzrvOtRVGaCZ9y++gY7KTSrpbQurPIhWAcyhBBsvgFpvmAFqs1l dm/XMDosjlt2ha2ijnJiwtA7mNBYPS8+G+eQ983lViOk/1rk9SoV7bH8isdnFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961701; a=rsa-sha256; cv=none; b=hI5F0mpq8NQAAHUIlinph+JE8DbMp7erSubHZ/6cZYE3K9tSiP4DNLSgTRVHrpoVU6EFSQ dkfsnqNoFUiocjDwAOKW29d5N4qEm/MePRjju+2C7y1Ap+E0zWJD8wldQ7WLc4V5xdq4aH 2Rd9uiJEnP84fbXeNPoFSWfWJE3gz6ljrZ3dd8UTjtUQ8DGicGWsPGEzSh+x91JFwMRs8v wnLnAjAc8qwYwM7LZtUSOxs5S7ZCZFbiFTV1K7MoC/2t6Oy3PHFzwM1m3kRw28YIvg+i7G 29qYHE/F5Y2dHJihehuNxc6gQhVTpdholrpE8VCHFr+VmIElbsUyk+rK4kauUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eZOMiWmz3ProoVctIRCKhswFNFhlR2DuaF32uYi6RdI=; b=oIjDEG0Xrt85IyoIX439Lfv77Jh4UPy/O6yCGj+C03DmGZdiGbT310BDJEa49FXtbE6oM8 uuxXppA9dvq+vdu5dJsvjC5/MlxNp+HqOrWxAuBX6eDnuYEujnYH8k6EGi7gnmXBPES/iw p6bMBHEL8QGVKW9NKkzqHCGozGcmzj72BRqkzNCB5Agb0YGOKf/+Fk9B4g+I308Q+DpojA 15dSGXf1dosup/5XQDjXYzON/4gCKcxHTnbCzRqs9DhX2jwaBUdfinCPkNxtRCYYG7AyGh YVGwDNSyIZaEWX1hu5E90v3mIuf1ghshvZjj2fSv9qtqwlBMcqt+IB4GhySGPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxx67Nbz12jr; Wed, 19 Feb 2025 10:41: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 51JAffbw035443; Wed, 19 Feb 2025 10:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAff4r035440; Wed, 19 Feb 2025 10:41:41 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:41 GMT Message-Id: <202502191041.51JAff4r035440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b0ba95a9ce57 - main - pf: remove now unnecessary casts from hash update calls List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0ba95a9ce57db8b6eef6ab2e6c9c2482c7d30ed Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b0ba95a9ce57db8b6eef6ab2e6c9c2482c7d30ed commit b0ba95a9ce57db8b6eef6ab2e6c9c2482c7d30ed Author: Kristof Provost AuthorDate: 2025-02-12 16:28:30 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:09 +0000 pf: remove now unnecessary casts from hash update calls Obtained from: OpenBSD, tedu , e04cbca0bb Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0e816f1205c5..9b1a2f6a1bac 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -5067,16 +5067,16 @@ pf_tcp_iss(struct pf_pdesc *pd) ctx = V_pf_tcp_secret_ctx; - SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_sport, sizeof(u_short)); - SHA512_Update(&ctx, (char *)&pd->hdr.tcp.th_dport, sizeof(u_short)); + SHA512_Update(&ctx, &pd->hdr.tcp.th_sport, sizeof(u_short)); + SHA512_Update(&ctx, &pd->hdr.tcp.th_dport, sizeof(u_short)); switch (pd->af) { case AF_INET6: - SHA512_Update(&ctx, (char *)&pd->src->v6, sizeof(struct in6_addr)); - SHA512_Update(&ctx, (char *)&pd->dst->v6, sizeof(struct in6_addr)); + SHA512_Update(&ctx, &pd->src->v6, sizeof(struct in6_addr)); + SHA512_Update(&ctx, &pd->dst->v6, sizeof(struct in6_addr)); break; case AF_INET: - SHA512_Update(&ctx, (char *)&pd->src->v4, sizeof(struct in_addr)); - SHA512_Update(&ctx, (char *)&pd->dst->v4, sizeof(struct in_addr)); + SHA512_Update(&ctx, &pd->src->v4, sizeof(struct in_addr)); + SHA512_Update(&ctx, &pd->dst->v4, sizeof(struct in_addr)); break; } SHA512_Final(digest.bytes, &ctx); From nobody Wed Feb 19 10:41:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXxz3dk8z5p9gj; Wed, 19 Feb 2025 10:41: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 4YyXxz0NY0z3llY; Wed, 19 Feb 2025 10:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CxxvoYUqvlPf/X8t/Gj+VQfyKo+KPJRKj/JP67ToWL8=; b=KPmtHFpu3hq0rYZfyoxUhziTf0Urmz/BwPWm+2rQc7m21NciDd5esrCt99TbP+OLd2KK5r f8yOZ1jMFFdafSGaMyDKPIUL2dCp/6Kdmy28rd9hEw0iCo2GRt79E92GhucGZvKaU2PSFJ D8e7Uu39k0rmZlVDillxgKIELWqIrddRy16DGhhOQi3q3lgT4Bnr4kFkxlmDCvZkcQh3bb aBH2PiOKbtGmFPGje6cKh2v8MCqj6nczEYQN4d5Xq65VHqw7DOL2LDJ/vj3PZ2ePs/nxMu m9N0GJNWDTv3dS19hiG9bGSZ7fMyGMEzoS4eQbrLCpa5ZfVW9RyNkHghgN0gCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961703; a=rsa-sha256; cv=none; b=JiorzOT/NQ0QL1fikisPw/BF3OmGvGiK6eeyQxotHhzStPklxUj+RFAMo3xahG+p6+0GWz V5OCDgV9D8t1x3QK6PTU+3sfY5YV2u/hb4r0uEFAh93Q3wXMWyX6IJfVFzJx0tLmONcpRp ZyqNcnvT1evBm1tU6DjKqw7TG/OWB1C9VCIuOJ/RZ4q7P3egn3GX04+0ppxJAMzKDn244v 7XrBrwz7Lnz6S+Wk4YwH5C7UGRuIIZZTOzykNnRawRRBiX/1FoRD2FRn29ddE2daejaUdL PkIvEOTYHVFlvY1JTQnTTEvO/4ZV4GA7PmDdf8McvCBp85h8uHegJTRsoE0FRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961703; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CxxvoYUqvlPf/X8t/Gj+VQfyKo+KPJRKj/JP67ToWL8=; b=h/arWXxSuSG91rbwZuDKvM758bdUkBL3VtlUoOcOJrGdVns/AqWpcT4jyArsCEjwaEqICA alkABmykpQQ7bj8djgKgfTUYsyDMujwN+CXLh9wS1mG6s6tQ3izpATnHa7EKjEjDya2Snt SR3LRFQZzlfv8DUbApa0YLa4/P2xc1ZCce2Jo/y0N9g7VAu7ddbjGX9Yy5xcuGEaeJswoT 6aCCy5S4MVBfNT+2G93ryZ9HX4KPMoHrDLqccFEdYMkGLKXwStx/SdEoD0dEbNRrAPXvcU hu5QtvYz28SMFVFf2GhFKWsaV35cYSk5ll7Zsz7UH/y96up0hVy512b/cYn/PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXxy6vc8z12dJ; Wed, 19 Feb 2025 10:41: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 51JAfgDe035477; Wed, 19 Feb 2025 10:41:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfgdf035474; Wed, 19 Feb 2025 10:41:42 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:42 GMT Message-Id: <202502191041.51JAfgdf035474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 2514ac810dc9 - main - pfctl: Don't allow embedded nul characters in strings. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2514ac810dc992c6a9ae6854b9a06bba6eb10782 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2514ac810dc992c6a9ae6854b9a06bba6eb10782 commit 2514ac810dc992c6a9ae6854b9a06bba6eb10782 Author: Kristof Provost AuthorDate: 2025-02-12 16:36:47 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:10 +0000 pfctl: Don't allow embedded nul characters in strings. Fixes a pfctl crash with an anchor name containing an embedded nul found with the afl fuzzer. pfctl parse.y patch from and ok deraadt@ Obtained from: OpenBSD, jsg , 41eef22fad Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 522d2a910de7..f3334c961909 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -6795,6 +6795,9 @@ top: } else if (c == quotec) { *p = '\0'; break; + } else if (c == '\0') { + yyerror("syntax error"); + return (findeol()); } if (p + 1 >= buf + sizeof(buf) - 1) { yyerror("string too long"); From nobody Wed Feb 19 10:41:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXy05fnNz5p9d9; Wed, 19 Feb 2025 10:41: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 4YyXy01PtBz3llm; Wed, 19 Feb 2025 10:41:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRjZLMUI0aAJiXgRnhUFWPzuN+5oJr6eTWxNBH+SW7M=; b=Ad3NmIx0QuMhPAPL0YBjPj1jx7ZNLaKmKM0jWR3KSqOyqYg1nNoQ+PhdkCdgEpafv5Kt/9 jAgPUZM5VRXeuFaVLl2Rt9MA7q2ygc8Fi/gML76yHWlMQbwuhBY5XgXmM+xpJbBmenztPR 9pkHYuBTuMg78RDuaLubM/iBM+xhBIgXdl2ZBexnGaRVB3NnO+3LX3ccJCfxYr8oQcqMkd q2yQBFMjSmuRp2nb2N/KqY3juHQnZy15VHxjw0RJfyLWmbpkdTRMBviOGMDqvVaiS3oD// 95f6ueOfsBiulT+dEhrmpnx/THVwgwTcZ6CqMRKbfo4N+cJLLiBl7/NfSUmWLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961704; a=rsa-sha256; cv=none; b=eM18llJwUj7gX6/3h6DForltjw+njNZ2Yya2Bqw515f6Qqln2x6HSWJKkNtbfD11oP9hlJ nUe2FECjfXMYJ4kMnyxAAKTVLExO8tZJsi8UK/2jYdNnhglZpECXHPJVFgtHASkDoNewJl gCJKO4A1jD3oB7sxltuCIrg0xxP22EZ9KSc78hsgUI9oKu3RAuOt2bU2Od9EHzPxEGZERj BcI1+oyK/Snysq8JSnPxMwcorYMU1FQUw0Yh2g54ECbwMI0DH6eoYiixAhPd8NTS9yMjwS MUA/f6ZW/WlziDI+wtY0an9b5mv+CpBtQlWgDwqDEU5vh/2IC4a0uMVBwRFGJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961704; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iRjZLMUI0aAJiXgRnhUFWPzuN+5oJr6eTWxNBH+SW7M=; b=WuyZ2JlDStEsbmHhOggpGXGkDPIiOxNWNw6mMnCtLs+vBfayOn04Qdy8wApleS0jY9e7ur yfQ7aK2krAemkMWrHnUnyxyPGVFVBpZQJ7178zOZsBFJ2H9JQJ3gdZ2ZFmrzsnmOSlxgon ZVnZthLs+WW299Sn/i9k0VfgeCURqqUp0NiUPmHZNyIVipli6tCNDkPfv6pcIRoA0GSZBY jTsHbK7lNiKQRf2aVsVtjD8soQt8a1K1Epr3S4obKqOsX2kivD1PtjxDYKPNa9P1LRoJgx /4MES0EtOHnID/dWMawCRdca9yI1W+cYWZNRMOBO6thHsqtb7J3MjOgtKiilCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXy00Yrpz12gf; Wed, 19 Feb 2025 10:41: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 51JAfhZH035510; Wed, 19 Feb 2025 10:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfhhw035507; Wed, 19 Feb 2025 10:41:43 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:43 GMT Message-Id: <202502191041.51JAfhhw035507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 81dc007a00a9 - main - pfctl: improve warnings for limits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81dc007a00a9d160653398afc80a58725747d24d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81dc007a00a9d160653398afc80a58725747d24d commit 81dc007a00a9d160653398afc80a58725747d24d Author: Kristof Provost AuthorDate: 2025-02-12 16:41:18 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:10 +0000 pfctl: improve warnings for limits If pfctl cannot set a limit in the kernel, print the name of the limit and the requested value. OK henning@ Obtained from: OpenBSD, bluhm , beb5ed50a7 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index e05c96a252fc..fd76a1926457 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2470,9 +2470,11 @@ pfctl_load_limit(struct pfctl *pf, unsigned int index, unsigned int limit) { if (pfctl_set_limit(pf->h, index, limit)) { if (errno == EBUSY) - warnx("Current pool size exceeds requested hard limit"); + warnx("Current pool size exceeds requested %s limit %u", + pf_limits[index].name, limit); else - warnx("cannot set '%s' limit", pf_limits[index].name); + warnx("Cannot set %s limit to %u", + pf_limits[index].name, limit); return (1); } return (0); From nobody Wed Feb 19 10:41:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyXy14zdJz5p9jX; Wed, 19 Feb 2025 10:41: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 4YyXy123WSz3lm2; Wed, 19 Feb 2025 10:41:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NwpPII5AIZ1UQ+z+k/OS44qCYBy3GX/rkqq0HC/x2hs=; b=pd19/9U9kRskgu5P62iyjwsaDmyI6UNH+ExfVo32E2UfVNYuU05qx+lye/ddnp/gBMxKb8 q4plrqbeR0uBg4+P4utKgCxVQhsuuQbLs9qgi8NB6uWOoHqwHpQr58AjvOeqSld6cENhnQ POSqVznA3uic11EG6zq5aKYE0/RtSybeuV9rNkonCNm8M9jHsvhq+o7XbawknwUXkYRVvS GUCtdMygIr2i8gey9D27a/XukaYtjk6eQd1/i5vaLqabL20N03u4uIudyc8ZKpAgLEQ0IM dsnOfoR6HeTSWTmyt9cR4eYqPPkGQedwLPBoPldZKdh3mQ72Kdl7jylfFnJDrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739961705; a=rsa-sha256; cv=none; b=I2K87rsvkPjmdaTn9H2LQFbGb2KyaHHBA5JJg0E4QBrgh59jqEpRVqFZu2xBMXe0aRDbnW cAIqpJnQC4j5mQ2Ih/A9lso6eaa0ICSk+/xPUN7+LMyN9p+RbZeo/c4tfnXIk+NxagKILx ntDiuaYyzpy+kZxaDY+EOHZuECG9ViYjtVNwXXeMJwAnP7rKnmydZSrkXZsaLi8i+hsEQ6 6tveL8ORZZvb25sNaOBHl2y/KLL3VyPwzOb8iWW/iwovCdiap1AfaFjOZEEyhDyzWZb+yL RuTemqvPrkHa25KsOd4qjcksobGGoxMUrPo+d9LFGafX5JWDe0D2nJrV2vrq1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739961705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NwpPII5AIZ1UQ+z+k/OS44qCYBy3GX/rkqq0HC/x2hs=; b=dj1XMajwU/+8z17g71XtSrh/DOe7BRUW/1awOoHeHv2ezcypw2gyAoLyzVCKNiFQ8LR5A8 yj2G4U4kgXs1GHhRxikEZ2KoKZJc8Yy/3+iZHP8IESBdS30ln3uXzzPvb8h3Y7Nl1T9+IB kqwG/lS65AWe1cYfHajR823wlFltvj+54M+CDQ/EOfrndbXbaWpRSO5Qn3tNKE0ddhOEiI JDdFz0lZb1f2hBzYJ5VcooT4lKucCFEE4WQeoKSIt5A7dhJR1Xy9LqYLCdFznps/oceSUt Vye8Pvt9MXXjzHYYUBrm2v/Lt5bMP9cKJm2zvjHXae/DCdNhWq85FEgIx7J7Iw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyXy11V6Gz12M2; Wed, 19 Feb 2025 10:41: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 51JAfjYk035543; Wed, 19 Feb 2025 10:41:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JAfjUi035540; Wed, 19 Feb 2025 10:41:45 GMT (envelope-from git) Date: Wed, 19 Feb 2025 10:41:45 GMT Message-Id: <202502191041.51JAfjUi035540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: da64fc8609d5 - main - pflog: ensure we can't read outside V_pflogifs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da64fc8609d53e3b72529c32b76bf1c29bb48e23 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=da64fc8609d53e3b72529c32b76bf1c29bb48e23 commit da64fc8609d53e3b72529c32b76bf1c29bb48e23 Author: Kristof Provost AuthorDate: 2025-02-14 08:07:02 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 10:41:10 +0000 pflog: ensure we can't read outside V_pflogifs Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/if_pflog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 7c9baaeaba76..016ff96b02b4 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -251,6 +251,9 @@ pflog_packet(uint8_t action, u_int8_t reason, if (rm == NULL || pd == NULL) return (1); + if (rm->logif > V_npflogifs) + return (0); + ifn = V_pflogifs[rm->logif]; if (ifn == NULL || !bpf_peers_present(ifn->if_bpf)) return (0); From nobody Wed Feb 19 12:12:14 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyZyR4H18z5pHRQ; Wed, 19 Feb 2025 12:12: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 4YyZyQ1V31z3cs2; Wed, 19 Feb 2025 12:12:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739967134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfAe/YRRXlYRFVUT+uQM2M0mMGzKZE5J21TtgJTMr/Y=; b=LWoXAKKryzKf+x1uo5ABa4kHrs94TDw8VmTaLBMLKRyjr0BoQXiVqJrQe5rXUs519TKAx0 VlTPBDcgRTXZTvdb3RaEe9HyU6/4WwFlG6ND4xlAhr9lTBOUT4QohTqsXNBa5iVzJD5L4y A80jZ9Qr99IVZXbeVCWGlfjSpP7Jl/2Y9eBffISvcAjpyzQnqnv/KkGhbLQXqZ4mVR6AG5 nVoVGFykX/TgMXodlNvS6TEpHuEBOghVcwHZ4nnf0JVtGStHB/nbubT60LjulEr6lwQRDP bZfXOg/CxolP5+B95e7ffiIWL4YAwjTilF8ijfh38JWJasTEwysqH5Om1Dp+bA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739967134; a=rsa-sha256; cv=none; b=B9vs0KZBgaKr7Iv9Z2NBbjEFLxPmN4H0DOi6B/PB/KozDK1BvoTlGRBMYXEBybNpV4BKNO w/ukoe8qYyI16OZ7qrE/TUyc7oT2KYbvZ9Pgnj19jq/Bh8/KXIz5SQ/i4l5bMkGPyQerlu uLGJF3f+cNbrkxzSOjJyUZNIlyc3YJXeCdX3utTU81cPVequMnaKNxZov5gnzIRGWZPsjR DNGsDmEW4gDnNiObL+mVhNZhv9chexAxFRDPEYdAjmAoW/lGG1UUyjaNAuLI82r+7rKH0Y DAWwMiyMxNvod0ojQO+wKeZYOCcKjzkOQjkHS2APFlgMzONMWhbqKkFk9JkjlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739967134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BfAe/YRRXlYRFVUT+uQM2M0mMGzKZE5J21TtgJTMr/Y=; b=OOkimRJBYfv9dsxAJB7eWc+aLrFpSnipVmQbqYp9T6Luql41YG3zBSH+grD64fIKR8N11s 0AJ50cIonbMqW2lcQBtRKaUnlliY3c3xijY3rm4mplercxVt8oFxlfKoo/RFM9TeYbShgh SifBI15vSVlUTTw2U6HEoGly4fmYh1p911F02HFl2P27BHMbL4Tsm0U6eA/k8Z+Zrjxr0E 2e7nEpquTKyiwIEI3WwXEwLkXINT0r2bnKC6DKm/7V5l4RViE3C559brE1zWs5zGjZI0eL If5cOGNk59gIrKTAIniHM9EvOLhGAOupE6Ijjm5H1Fvd8zXr+Gaj/iXuj6itYg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyZyQ137wz1514; Wed, 19 Feb 2025 12:12: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 51JCCEx7012148; Wed, 19 Feb 2025 12:12:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JCCEhn012145; Wed, 19 Feb 2025 12:12:14 GMT (envelope-from git) Date: Wed, 19 Feb 2025 12:12:14 GMT Message-Id: <202502191212.51JCCEhn012145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 12a511c84470 - main - LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12a511c844706917e49e24c8d1daa861288aea23 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=12a511c844706917e49e24c8d1daa861288aea23 commit 12a511c844706917e49e24c8d1daa861288aea23 Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 12:04:47 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-19 12:11:02 +0000 LinuxKPI: 802.11: make (unsupported) cipher suite prints user friendly Rather than just printing the cipher suite as uint32_t hex (or split into OUI and number) also print a short name. iwlwifi(4), for example, now prints on startup with HW_CRYPTO on: unsupported WLAN Cipher Suite 0x000fac | 8 (GCMP) unsupported WLAN Cipher Suite 0x000fac | 9 (GCMP_256) unsupported WLAN Cipher Suite 0x000fac | 6 (AES_CMAC) unsupported WLAN Cipher Suite 0x000fac | 11 (BIP_GMAC_128) unsupported WLAN Cipher Suite 0x000fac | 12 (BIP_GMAC_256) Likewise _lkpi_iv_key_set() would now print: iwlwifi0: _lkpi_iv_key_set: CIPHER SUITE 0xfac02 (TKIP) not supported Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 47 +++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 36c6f92123ff..95c7507fc34e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -750,6 +750,38 @@ lkpi_opmode_to_vif_type(enum ieee80211_opmode opmode) } #ifdef LKPI_80211_HW_CRYPTO +static const char * +lkpi_cipher_suite_to_name(uint32_t wlan_cipher_suite) +{ + + switch (wlan_cipher_suite) { + case WLAN_CIPHER_SUITE_WEP40: + return ("WEP40"); + case WLAN_CIPHER_SUITE_TKIP: + return ("TKIP"); + case WLAN_CIPHER_SUITE_CCMP: + return ("CCMP"); + case WLAN_CIPHER_SUITE_WEP104: + return ("WEP104"); + case WLAN_CIPHER_SUITE_AES_CMAC: + return ("AES_CMAC"); + case WLAN_CIPHER_SUITE_GCMP: + return ("GCMP"); + case WLAN_CIPHER_SUITE_GCMP_256: + return ("GCMP_256"); + case WLAN_CIPHER_SUITE_CCMP_256: + return ("CCMP_256"); + case WLAN_CIPHER_SUITE_BIP_GMAC_128: + return ("BIP_GMAC_128"); + case WLAN_CIPHER_SUITE_BIP_GMAC_256: + return ("BIP_GMAC_256"); + case WLAN_CIPHER_SUITE_BIP_CMAC_256: + return ("BIP_CMAC_256"); + default: + return ("??"); + } +} + static uint32_t lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) { @@ -770,12 +802,16 @@ lkpi_l80211_to_net80211_cyphers(uint32_t wlan_cipher_suite) case WLAN_CIPHER_SUITE_BIP_GMAC_128: case WLAN_CIPHER_SUITE_BIP_GMAC_256: case WLAN_CIPHER_SUITE_BIP_CMAC_256: - printf("%s: unsupported WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unsupported WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); break; default: - printf("%s: unknown WLAN Cipher Suite %#08x | %u\n", __func__, - wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff); + printf("%s: unknown WLAN Cipher Suite %#08x | %u (%s)\n", + __func__, + wlan_cipher_suite >> 8, wlan_cipher_suite & 0xff, + lkpi_cipher_suite_to_name(wlan_cipher_suite)); } return (0); @@ -1127,7 +1163,8 @@ _lkpi_iv_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) break; case WLAN_CIPHER_SUITE_TKIP: default: - ic_printf(ic, "%s: CIPHER SUITE %#x not supported\n", __func__, lcipher); + ic_printf(ic, "%s: CIPHER SUITE %#x (%s) not supported\n", + __func__, lcipher, lkpi_cipher_suite_to_name(lcipher)); IMPROVE(); wiphy_unlock(hw->wiphy); ieee80211_free_node(ni); From nobody Wed Feb 19 12:17:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yyb523r0xz5pHjv; Wed, 19 Feb 2025 12:17: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 4Yyb522BNbz3gtH; Wed, 19 Feb 2025 12:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739967478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HI2p62XrradcWbw5tU8VIFhqNUqrTVASQlLuzEgXuqw=; b=JDeMB7NO0pz4G1ntBeIK7siRmAeqaYud0L5M2bLzeOinqzw/je8lTs7R1xQrO660jgdpxQ oFnr5zkEhjXpti/9u+c37vemZuayk9N65SnvARgt/V2magaAGhosLNm2lmNCkZa7C5UayZ YSEhIFElVLU/eBsJXmjA7tp4QcuZW3mPnWb4fWb4QqArgQVsizyWnMqusRUDrodP287xbe DkXuM+xwGjhQvPCAfZDDJSD19vFkUfONfe9YbXMZforzvLlx5u1NNKkNw19pEt6GBcajJH Gf5xz52sQd+czybb6pA1uCh6zLdpYlcax4iPXdDlD4tteVZnU6oJEW/78N+QIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739967478; a=rsa-sha256; cv=none; b=niJYADUS2jw3bR+q8MVQZzR1Yeuo7s2NmurmpoqbBNVD+GAySszaFf3ffkGFAeXsmKu3Lt WgcQCuYXbObONsD8IQF8grFmm5wTepQhZTsVvqZY0T7L4enhR6QDEtHvgJ5d75UIqjxlE8 i9Ib787qpEDx/SVICbLeh6Dt9izQzvzJL1063x+3Yep6g2adi5awKgyJTJiCwho12m4Ib0 qGP4+QNGlon/HKdg0U5KrPj1F7jtYT1pgH0nQiXIOfI+sLM7E3MpA5jal6/KXKxcjXoNs7 70aWPsfrYjlxz7Itx5kGcJv9FQsRWk/d78KJvRtFc0+f90LdZJZE08AQDCY+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=1739967478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HI2p62XrradcWbw5tU8VIFhqNUqrTVASQlLuzEgXuqw=; b=mzdPP66hYBrnS9ixx5n0h4CcxABlUW7QrXhpaUxuYQzfGF7nT7eclye5k5B9iHd+ktvWzT LELNrNXdv1r8UTv65tLjgScjzVtT1K47GXTzXnaSluu3D4Q9tNtywnl8AUTCny13qzM4Ah Ni+2r3g5fKGQIWsqaskuN1hTauRoUuRhhUEk83yyxsoSXtEsFUJRPC0lNFIklQT7SpMFe4 7pxFlMHXmCX55QqFQIntvNMZl9bbh2P9E4FpjK5c5VSkp6uoaOc4VZeZTVcoWZbFepff9v AU8UyRXpH5FVZMVu+t2X2H5WbrsuO3gdb07RYQnOHIcqcZmv/1VTVQlGZq8RIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yyb521cRkz15F7; Wed, 19 Feb 2025 12:17: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 51JCHwvX013920; Wed, 19 Feb 2025 12:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JCHwRi013917; Wed, 19 Feb 2025 12:17:58 GMT (envelope-from git) Date: Wed, 19 Feb 2025 12:17:58 GMT Message-Id: <202502191217.51JCHwRi013917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a8f735a66130 - main - LinuxKPI: 802.11: switch vif station list to a linux list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8f735a66130aa737999fad9b3246159099dc9eb Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a8f735a66130aa737999fad9b3246159099dc9eb commit a8f735a66130aa737999fad9b3246159099dc9eb Author: Bjoern A. Zeeb AuthorDate: 2025-01-25 23:39:53 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-19 12:16:15 +0000 LinuxKPI: 802.11: switch vif station list to a linux list We ran into problems with locking the VIF for the lsta tailq on and off. Switch from a native tailq to the LinuxKPI list. This allows us to implement the "rcu" part in linuxkpi_ieee80211_iterate_keys() which we could not before. Further using either rcu or the wiphy lock we no longer run into problems with the lock not being sleepable. The last case was rtw89 debugfs which was doing a sleepable alloc in the iterator callback of linuxkpi_ieee80211_iterate_stations_atomic(). Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 60 ++++++++++++++-------------- sys/compat/linuxkpi/common/src/linux_80211.h | 9 ++++- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 95c7507fc34e..1bce8f9f54b5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -74,6 +74,7 @@ #include #include +#include #include "linux_80211.h" #define LKPI_80211_WME @@ -294,7 +295,7 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) sbuf_new_for_sysctl(&s, NULL, 1024, req); wiphy_lock(hw->wiphy); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); sbuf_putc(&s, '\n'); @@ -463,12 +464,11 @@ lkpi_lsta_remove(struct lkpi_sta *lsta, struct lkpi_vif *lvif) { - LKPI_80211_LVIF_LOCK(lvif); - KASSERT(lsta->lsta_entry.tqe_prev != NULL, - ("%s: lsta %p lsta_entry.tqe_prev %p ni %p\n", __func__, - lsta, lsta->lsta_entry.tqe_prev, lsta->ni)); - TAILQ_REMOVE(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + wiphy_lock(lsta->hw->wiphy); + KASSERT(!list_empty(&lsta->lsta_list), + ("%s: lsta %p ni %p\n", __func__, lsta, lsta->ni)); + list_del_init(&lsta->lsta_list); + wiphy_unlock(lsta->hw->wiphy); } static struct lkpi_sta * @@ -488,6 +488,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], if (lsta == NULL) return (NULL); + lsta->hw = hw; lsta->added_to_drv = false; lsta->state = IEEE80211_STA_NOTEXIST; /* @@ -1773,10 +1774,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lsta->txq_ready = true; LKPI_80211_LSTA_TXQ_UNLOCK(lsta); - LKPI_80211_LVIF_LOCK(lvif); + wiphy_lock(hw->wiphy); /* Insert the [l]sta into the list of known stations. */ - TAILQ_INSERT_TAIL(&lvif->lsta_head, lsta, lsta_entry); - LKPI_80211_LVIF_UNLOCK(lvif); + list_add_tail(&lsta->lsta_list, &lvif->lsta_list); + wiphy_unlock(hw->wiphy); /* Add (or adjust) sta and change state (from NOTEXIST) to NONE. */ KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); @@ -3297,7 +3298,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); mtx_init(&lvif->mtx, "lvif", NULL, MTX_DEF); - TAILQ_INIT(&lvif->lsta_head); + INIT_LIST_HEAD(&lvif->lsta_list); lvif->lvif_bss = NULL; lvif->lvif_bss_synched = false; vap = LVIF_TO_VAP(lvif); @@ -5751,11 +5752,12 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, lvif = VIF_TO_LVIF(vif); if (rcu) { + rcu_read_lock_held(); /* XXX-BZ is this correct? */ + if (vif == NULL) { TODO(); } else { - IMPROVE("We do not actually match the RCU code"); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5770,7 +5772,7 @@ linuxkpi_ieee80211_iterate_keys(struct ieee80211_hw *hw, if (vif == NULL) { TODO(); } else { - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + list_for_each_entry(lsta, &lvif->lsta_list, lsta_list) { for (ieee80211_keyix keyix = 0; keyix < nitems(lsta->kc); keyix++) lkpi_ieee80211_iterate_keys(hw, vif, @@ -5831,14 +5833,14 @@ linuxkpi_ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) { - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (!lsta->added_to_drv) continue; sta = LSTA_TO_STA(lsta); iterfunc(arg, sta); } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } LKPI_80211_LHW_LVIF_UNLOCK(lhw); } @@ -6605,14 +6607,14 @@ lkpi_find_lsta_by_ni(struct lkpi_vif *lvif, struct ieee80211_node *ni) { struct lkpi_sta *lsta, *temp; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { if (lsta->ni == ni) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (lsta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -6622,20 +6624,20 @@ struct ieee80211_sta * linuxkpi_ieee80211_find_sta(struct ieee80211_vif *vif, const u8 *peer) { struct lkpi_vif *lvif; - struct lkpi_sta *lsta, *temp; + struct lkpi_sta *lsta; struct ieee80211_sta *sta; lvif = VIF_TO_LVIF(vif); - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH_SAFE(lsta, &lvif->lsta_head, lsta_entry, temp) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { sta = LSTA_TO_STA(lsta); if (IEEE80211_ADDR_EQ(sta->addr, peer)) { - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (sta); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); return (NULL); } @@ -7175,8 +7177,8 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) #endif lvif->hw_queue_stopped[ac] = false; - LKPI_80211_LVIF_LOCK(lvif); - TAILQ_FOREACH(lsta, &lvif->lsta_head, lsta_entry) { + rcu_read_lock(); + list_for_each_entry_rcu(lsta, &lvif->lsta_list, lsta_list) { struct ieee80211_sta *sta; sta = LSTA_TO_STA(lsta); @@ -7199,7 +7201,7 @@ lkpi_ieee80211_wake_queues(struct ieee80211_hw *hw, int hwq) lkpi_80211_mo_wake_tx_queue(hw, sta->txq[tid]); } } - LKPI_80211_LVIF_UNLOCK(lvif); + rcu_read_unlock(); } } } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 40b11ebfef13..b17e6072066c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -126,6 +126,8 @@ struct lkpi_radiotap_rx_hdr { (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE)) +struct lkpi_hw; + struct lkpi_txq { TAILQ_ENTRY(lkpi_txq) txq_entry; @@ -142,8 +144,9 @@ struct lkpi_txq { struct lkpi_sta { - TAILQ_ENTRY(lkpi_sta) lsta_entry; + struct list_head lsta_list; struct ieee80211_node *ni; + struct ieee80211_hw *hw; /* back pointer f. locking. */ /* Deferred TX path. */ /* Eventually we might want to migrate this into net80211 entirely. */ @@ -164,6 +167,7 @@ struct lkpi_sta { #define STA_TO_LSTA(_sta) container_of(_sta, struct lkpi_sta, sta) #define LSTA_TO_STA(_lsta) (&(_lsta)->sta) +/* Either protected by wiphy lock or rcu for the list. */ struct lkpi_vif { TAILQ_ENTRY(lkpi_vif) lvif_entry; struct ieee80211vap iv_vap; @@ -179,7 +183,8 @@ struct lkpi_vif { enum ieee80211_state, int); struct ieee80211_node * (*iv_update_bss)(struct ieee80211vap *, struct ieee80211_node *); - TAILQ_HEAD(, lkpi_sta) lsta_head; + struct list_head lsta_list; + struct lkpi_sta *lvif_bss; bool lvif_bss_synched; bool added_to_drv; /* Driver knows; i.e. we called add_interface(). */ From nobody Wed Feb 19 12:24:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YybDb4M3Kz5pJ9V; Wed, 19 Feb 2025 12:24: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 4YybDb2wYRz3lMr; Wed, 19 Feb 2025 12:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739967871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sara0NumZohoIxgSdyi450ZNf31JLE2kfPEMkXe3pzI=; b=QwYRpGDkMlnEVz1etfL7jH88pstuzTtEnZY6XGatwzvrub0KfI4zbhcyPCmHfw+fJaPoH8 o7D9q3TLnqDFcP8JLB0QkG97qovSndlBP7M2YL3qXCpXakSHkyghMBEA2CJ4WQ7Gg+HQZO bTUw4FEYj7NfIM9Suz6JJO57Gm7yv0MSvDQm/ATkZrIAAGhvRjAIZiG0o/+i1H8B1Jwn70 xBCHnl9E2dWDkjAMiTsDp79rkdr4dgwCxjomTe2jrcDc52JJZPJINfLv1ORrhJatj8JnPK iFxAF4GHwHy1YtJWgruti5sQCuCn7oHH4JQS/nm1kJjfigReWjkibHlN9OII5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739967871; a=rsa-sha256; cv=none; b=uYUf/QLT5n+ct036lxsZekqvihKfKyjhZz+8LZykQah8riXfXnQnJagXcANWrc12PA3nML XSV4d46ndmV4jC7QkVpLvN7xXwdj8OrrE3TOorRZnsptNiOsRtOA4IuCOoz7kvF/P81erj AQLpaCkao0cjQRkV6ouZQkLYKC9WGH2loUxFGItWLxaKyZNGxlzpPbho7PeBFENEHceGaL UfT8uNGK/iMJcH+lav+0mCSKvALUw/kLVY3aOtXNey6g0X2c181R/7eJ1UYT1VkQTP9iNn Gaa2urKjZ8L+IOop1t+FAP/lHJRmo/iehcpYWpA8/bDqIfIl//0U1UKDZd5UAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739967871; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sara0NumZohoIxgSdyi450ZNf31JLE2kfPEMkXe3pzI=; b=dCrpHwsRX7DmKSdsTIEFJLovb+pHjEfrRh2raxyPedC5aYy2IDJObuoFWJksYeng28oThA vIJfrvVmvRyiIAL740LUPxAZXu0g7JCASq833zvzweOzRz2/Be4bUrlf7foK9/hr5rFPpb MP7qWRkSBD8NC3HYbz53YzXCeoTl5aO5DAKRAjj50Fy5+H5lXG+f5zopqySeQgnOVArogV 36WjvaiBgkLy6aoqHf4r2IX0W44oGSHI8gxsAaS7qI3W1cBbzQXI2Jqj5DM0x+o+ZbcO6s H1wN+9c9TeyzM7Y+JuaCydJcx4AGRLsaERCm4J9NVGp+WDlO0nv4WDcQn/qIMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YybDb27Xqz15Fx; Wed, 19 Feb 2025 12:24: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 51JCOVns031605; Wed, 19 Feb 2025 12:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JCOV2j031602; Wed, 19 Feb 2025 12:24:31 GMT (envelope-from git) Date: Wed, 19 Feb 2025 12:24:31 GMT Message-Id: <202502191224.51JCOV2j031602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1432e0f20ccd - main - LinuxKPI: 802.11: remove a blank between ltxq-> stopped List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1432e0f20ccde8eaa23d3d3e20fca2989cd344b6 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1432e0f20ccde8eaa23d3d3e20fca2989cd344b6 commit 1432e0f20ccde8eaa23d3d3e20fca2989cd344b6 Author: Bjoern A. Zeeb AuthorDate: 2025-02-19 12:22:41 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-19 12:22:41 +0000 LinuxKPI: 802.11: remove a blank between ltxq-> stopped No functional changes. Sponsored by: The FreeBSD Foundation Fixes: bcf1d8ee35521 MFC after: 1 days X-MFC with: bcf1d8ee35521 --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 1bce8f9f54b5..729eb2dcd570 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4446,7 +4446,7 @@ lkpi_80211_txq_tx_one(struct lkpi_sta *lsta, struct mbuf *m) continue; ltxq = TXQ_TO_LTXQ(sta->txq[tid]); ic_printf(ic, " tid %d ltxq %p seen_dequeue %d stopped %d skb_queue_len %u\n", - tid, ltxq, ltxq->seen_dequeue, ltxq-> stopped, skb_queue_len(<xq->skbq)); + tid, ltxq, ltxq->seen_dequeue, ltxq->stopped, skb_queue_len(<xq->skbq)); } } ieee80211_free_node(ni); From nobody Wed Feb 19 12:44:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YybgC1CWZz5pK8j; Wed, 19 Feb 2025 12:44: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 4YybgB5TJLz3xxk; Wed, 19 Feb 2025 12:44:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739969046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+7t+CBherzE+eLL+sdxqQuu22fEj3hwFc+f/kbKqfc=; b=SBmMP0fYzNNDf1IB1B7dDi0A+xvMzd1WQV+PFUOGrinBfTdLzhq0JZkFLiAJdiYg6c3L3+ TBfgJJJFoEU6I5xSODGKy5t/MbZ1QDpR7ejn/phCcRYzB3tpHlfzL3gt39OjFrPataGxK2 3Jf4ITKKgbfHtusBSvjFXb0suJeuzGylOsCv9yS/Zy1DrrA890WZwO69lJQfa8F+15g1zn sMWIvD4f/0x1MBvyoxthOw0/1vN0N55FyCmNm5OGkAn+JF0OotaZ9K/lUt09+OiaRMhV2G vYU6j+46TXbNJ21LzTJAvNy9LCpBrSUoPpZQ3IDHUwDcnDdiH4UcQipgCHmngg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739969046; a=rsa-sha256; cv=none; b=pQFFWW1rDqx6IoLKq8O4Cq4lmjh6RFNm+tDZPDssbT+COVMNBCGFCfSxc6Hs/9jRMvpg2C Jkoc0j/vYDXvB6iJp//17m/WZJZm1cIMQjF/v8iQEYZcGkszPXFpumw0bagm6ubC2JnjTQ rXviYtn8zCftSy+YE1nlwErjVRdT2ItNpNVnGwDOQRtZO7Mwo/vX07d8KRRBAb0lplGlRr PoeHE9OVXliTqn2J3J8+116pBPA4MUUc1tM27MHH4kcaLj7gmVrfr3fgL32hgJUByx/eVL s4g+CmS7Zl2jvuIrWG7KQ8oMwbZa+fvKfgUQNGLXaRRbegc5Al7QwCr2F/UviQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739969046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j+7t+CBherzE+eLL+sdxqQuu22fEj3hwFc+f/kbKqfc=; b=G38MxS7q/cpbpbYJKjiCS+A5GDy0Q4PyKbL6Z6FlYMPff8bIQIKvIxdatepEnVQ5GeC1Za Otwy2JTqRFTqcwnhzYPXm0SDV0FxjGcRSXKHeuRlac52vKnVmlvACchdTiSzRKEQmhvJT2 TdayoCfTeKD4D5G70AbPja/hpwbEXSEgZDoihS/tNrLRm1WvqxTvOg79iEn7iV+y2DMytI kVuULY5N6wM9uEpAYeUTeTXRbdDXQZJ/mCr19ogVwc55OEnrT3HHPGi0PkpdWyV1IQQhcJ ynv4rCHKomysi28qVONew/mTwJ26XqIRlZf0VK4O6+82rbrKLonwrAXf7HoEjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YybgB400xz15Vx; Wed, 19 Feb 2025 12:44: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 51JCi6vh068641; Wed, 19 Feb 2025 12:44:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JCi6hv068638; Wed, 19 Feb 2025 12:44:06 GMT (envelope-from git) Date: Wed, 19 Feb 2025 12:44:06 GMT Message-Id: <202502191244.51JCi6hv068638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 170059d6d33c - main - ssh: Fix cases where error codes were not correctly set List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 170059d6d33cf4e890067097f3c0beb3061cabbd Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=170059d6d33cf4e890067097f3c0beb3061cabbd commit 170059d6d33cf4e890067097f3c0beb3061cabbd Author: Ed Maste AuthorDate: 2025-02-19 03:03:26 +0000 Commit: Ed Maste CommitDate: 2025-02-19 12:25:55 +0000 ssh: Fix cases where error codes were not correctly set Obtained from: OpenSSH 38df39ecf278 Security: CVE-2025-26465 Sponsored by: The FreeBSD Foundation --- crypto/openssh/krl.c | 4 +++- crypto/openssh/ssh-agent.c | 5 +++++ crypto/openssh/ssh-sk-client.c | 4 +++- crypto/openssh/sshconnect2.c | 5 ++++- crypto/openssh/sshsig.c | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/crypto/openssh/krl.c b/crypto/openssh/krl.c index e2efdf0667a7..0d0f69534182 100644 --- a/crypto/openssh/krl.c +++ b/crypto/openssh/krl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: krl.c,v 1.59 2023/07/17 05:22:30 djm Exp $ */ +/* $OpenBSD: krl.c,v 1.60 2025/02/18 08:02:48 djm Exp $ */ /* * Copyright (c) 2012 Damien Miller * @@ -674,6 +674,7 @@ revoked_certs_generate(struct revoked_certs *rc, struct sshbuf *buf) break; case KRL_SECTION_CERT_SERIAL_BITMAP: if (rs->lo - bitmap_start > INT_MAX) { + r = SSH_ERR_INVALID_FORMAT; error_f("insane bitmap gap"); goto out; } @@ -1059,6 +1060,7 @@ ssh_krl_from_blob(struct sshbuf *buf, struct ssh_krl **krlp) } if ((krl = ssh_krl_init()) == NULL) { + r = SSH_ERR_ALLOC_FAIL; error_f("alloc failed"); goto out; } diff --git a/crypto/openssh/ssh-agent.c b/crypto/openssh/ssh-agent.c index 67fa376a36ff..5ea283ddaf29 100644 --- a/crypto/openssh/ssh-agent.c +++ b/crypto/openssh/ssh-agent.c @@ -1226,6 +1226,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, "restrict-destination-v00@openssh.com") == 0) { if (*dcsp != NULL) { error_f("%s already set", ext_name); + r = SSH_ERR_INVALID_FORMAT; goto out; } if ((r = sshbuf_froms(m, &b)) != 0) { @@ -1235,6 +1236,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, while (sshbuf_len(b) != 0) { if (*ndcsp >= AGENT_MAX_DEST_CONSTRAINTS) { error_f("too many %s constraints", ext_name); + r = SSH_ERR_INVALID_FORMAT; goto out; } *dcsp = xrecallocarray(*dcsp, *ndcsp, *ndcsp + 1, @@ -1252,6 +1254,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, } if (*certs != NULL) { error_f("%s already set", ext_name); + r = SSH_ERR_INVALID_FORMAT; goto out; } if ((r = sshbuf_get_u8(m, &v)) != 0 || @@ -1263,6 +1266,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp, while (sshbuf_len(b) != 0) { if (*ncerts >= AGENT_MAX_EXT_CERTS) { error_f("too many %s constraints", ext_name); + r = SSH_ERR_INVALID_FORMAT; goto out; } *certs = xrecallocarray(*certs, *ncerts, *ncerts + 1, @@ -1759,6 +1763,7 @@ process_ext_session_bind(SocketEntry *e) /* record new key/sid */ if (e->nsession_ids >= AGENT_MAX_SESSION_IDS) { error_f("too many session IDs recorded"); + r = -1; goto out; } e->session_ids = xrecallocarray(e->session_ids, e->nsession_ids, diff --git a/crypto/openssh/ssh-sk-client.c b/crypto/openssh/ssh-sk-client.c index 321fe53a2d91..06fad22134fb 100644 --- a/crypto/openssh/ssh-sk-client.c +++ b/crypto/openssh/ssh-sk-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-sk-client.c,v 1.12 2022/01/14 03:34:00 djm Exp $ */ +/* $OpenBSD: ssh-sk-client.c,v 1.13 2025/02/18 08:02:48 djm Exp $ */ /* * Copyright (c) 2019 Google LLC * @@ -439,6 +439,7 @@ sshsk_load_resident(const char *provider_path, const char *device, } if ((srk = calloc(1, sizeof(*srk))) == NULL) { error_f("calloc failed"); + r = SSH_ERR_ALLOC_FAIL; goto out; } srk->key = key; @@ -450,6 +451,7 @@ sshsk_load_resident(const char *provider_path, const char *device, if ((tmp = recallocarray(srks, nsrks, nsrks + 1, sizeof(*srks))) == NULL) { error_f("recallocarray keys failed"); + r = SSH_ERR_ALLOC_FAIL; goto out; } debug_f("srks[%zu]: %s %s uidlen %zu", nsrks, diff --git a/crypto/openssh/sshconnect2.c b/crypto/openssh/sshconnect2.c index 745c2a0517f3..51079f067d8a 100644 --- a/crypto/openssh/sshconnect2.c +++ b/crypto/openssh/sshconnect2.c @@ -101,7 +101,7 @@ verify_host_key_callback(struct sshkey *hostkey, struct ssh *ssh) options.required_rsa_size)) != 0) fatal_r(r, "Bad server host key"); if (verify_host_key(xxx_host, xxx_hostaddr, hostkey, - xxx_conn_info) == -1) + xxx_conn_info) != 0) fatal("Host key verification failed."); return 0; } @@ -700,6 +700,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) if ((pktype = sshkey_type_from_name(pkalg)) == KEY_UNSPEC) { debug_f("server sent unknown pkalg %s", pkalg); + r = SSH_ERR_INVALID_FORMAT; goto done; } if ((r = sshkey_from_blob(pkblob, blen, &key)) != 0) { @@ -710,6 +711,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) error("input_userauth_pk_ok: type mismatch " "for decoded key (received %d, expected %d)", key->type, pktype); + r = SSH_ERR_INVALID_FORMAT; goto done; } @@ -729,6 +731,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, struct ssh *ssh) SSH_FP_DEFAULT); error_f("server replied with unknown key: %s %s", sshkey_type(key), fp == NULL ? "" : fp); + r = SSH_ERR_INVALID_FORMAT; goto done; } ident = format_identity(id); diff --git a/crypto/openssh/sshsig.c b/crypto/openssh/sshsig.c index 470b286a3a98..057e1df02381 100644 --- a/crypto/openssh/sshsig.c +++ b/crypto/openssh/sshsig.c @@ -874,6 +874,7 @@ cert_filter_principals(const char *path, u_long linenum, } if ((principals = sshbuf_dup_string(nprincipals)) == NULL) { error_f("buffer error"); + r = SSH_ERR_ALLOC_FAIL; goto out; } /* success */ From nobody Wed Feb 19 12:44:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yybg94CwCz5pKYm; Wed, 19 Feb 2025 12:44: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 4Yybg93LgGz3y3M; Wed, 19 Feb 2025 12:44:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739969045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PEqgVuj7MdkfL0nXVZsxxxYQkleiKpwzpNe1clwsmjw=; b=OBRt5AwU6BWIhmRlUWcejpNJKbuTNaTpNoExsVx300y6hm5p/GgQZ+jY4Qi4y4jy/hhkEJ Y/VZlSGF/RV/aUP+i3jjjQq1ACvTRSCDg63N5lVg5JJbyHn0m+CVsYHptUhJJIl5TD5LXT xgNeV/rx2AbciULSsxsQMXbMTKUbk7NDbiSYljarHOzcxNvXqukwaV+WCa7BzaoPr8iZud zsLBFm5EMcgbmXloxrJXVYTeTrZxfils0+K6SFvR9XCqd/Z9z8eWFcBl9R5IoCgo1jiadR JpiBk2DWnFnZVYDz7zJH0edmQQNUjMrJkoHURTSy8h79i4PQkdQFoRr/f+PDRg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739969045; a=rsa-sha256; cv=none; b=Vh/575kj2sIrYppAdc6det+ByVaMI7VIOyctO43tE4qoTPOfopsVTCUOqvFQRX3nL/v1Bw wwRvxcsj81mCL986wYHF4qEt6nRyPLgVNT6Y4VAfTC1EJznGYO9j/x5dIJgaqtNplploUl Jhtt4gT2rEDRtaq+2CHPCUOIxgNcPIG+gqtyNKMkAVMjvw8TdF0n1llfuXBoXbtjcmRp9N lK/n4jsaMwy1M+ecevQOauPr7R4fUFuhPNz7dmMUNUK0l+Bk8rB/6Fgr18OeGd1j9Bhrj/ 77Epz1VkORPAcseE4aRgS7kmpbZG1OZRv05vKPGD043xlINmUTUEyJnIjO+PfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739969045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PEqgVuj7MdkfL0nXVZsxxxYQkleiKpwzpNe1clwsmjw=; b=tkz2tmUUpUrC4ahb4rgzLqvz7R23ZLSo82T/Lke2xj0ovj/pJ4U82pXR1hUfn6VutIvszZ 2Gq54/9q1hccw6qwb6Gvye+Rd1Ix5NvY7J/n1deLlsp7MqdDMcJxwy9u8XTH/59c7VKlZd bhkxA7M0muLsdbqrPchksahO5uj0da9oQksgeceyYio8DZZubgbDPdQjmvviSHgXs5+KCr Z0JVbZ/M8UTGZ2Q+L6uAKzDuY7LRLBChsz7esZrAuo8F7Wv7kejyKqpgSsOiboDkoECB+B FyEyIqEC/MhMnq+xuBUW10eiq//JVpgSIvqOdDR7O1Gudlu5poKC8QAn80s3lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yybg92xtyz15Vw; Wed, 19 Feb 2025 12:44: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 51JCi5l6068604; Wed, 19 Feb 2025 12:44:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JCi5Hu068601; Wed, 19 Feb 2025 12:44:05 GMT (envelope-from git) Date: Wed, 19 Feb 2025 12:44:05 GMT Message-Id: <202502191244.51JCi5Hu068601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8a16d0831e70 - main - ssh: Don't reply to PING in preauth phase or during KEX List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a16d0831e70530b2fbd682e748bd051de35f192 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8a16d0831e70530b2fbd682e748bd051de35f192 commit 8a16d0831e70530b2fbd682e748bd051de35f192 Author: Ed Maste AuthorDate: 2025-02-19 03:00:45 +0000 Commit: Ed Maste CommitDate: 2025-02-19 12:25:55 +0000 ssh: Don't reply to PING in preauth phase or during KEX Obtained from: OpenSSH 5e07dee272c3 Security: CVE-2025-26466 Sponsored by: The FreeBSD Foundation --- crypto/openssh/packet.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index 2d1401e7c9f5..d8fbfa28b800 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.313 2023/12/18 14:45:17 djm Exp $ */ +/* $OpenBSD: packet.c,v 1.318 2025/02/18 08:02:12 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1774,6 +1774,14 @@ ssh_packet_read_poll_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p) if ((r = sshpkt_get_string_direct(ssh, &d, &len)) != 0) return r; DBG(debug("Received SSH2_MSG_PING len %zu", len)); + if (!ssh->state->after_authentication) { + DBG(debug("Won't reply to PING in preauth")); + break; + } + if (ssh_packet_is_rekeying(ssh)) { + DBG(debug("Won't reply to PING during KEX")); + break; + } if ((r = sshpkt_start(ssh, SSH2_MSG_PONG)) != 0 || (r = sshpkt_put_string(ssh, d, len)) != 0 || (r = sshpkt_send(ssh)) != 0) From nobody Wed Feb 19 13:34:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yycnq1yrTz5pNGL; Wed, 19 Feb 2025 13:34: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 4Yycnq1Y6dz3R94; Wed, 19 Feb 2025 13:34:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739972095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CyKQ9BhLgsgm78PK27D+XHwVxCj9K9oWXq/gL1EESo=; b=hXEs/LnqF8uqdEWWwEc0xCg1d0XF4xJ8t7llRVaDkpM74Gss/s1VzCjFbgKYj8SR17zaoc 0pa6gpHb2hoKj+mVldsoLNxOPMqm+iAkx3OgtTQxEFG39o3huBSxvwhX+xZzWlSbtLc1cg 9cnxSBbA5SeTmhSWY6xsVkhkS/cQp4DMt0+4XWqfciexSsSGozhV447t2B47eJj1K82K3G fm/rRGM9u1ODvngPTwnEc4lwYft7bJ7x3LdY0lrdFZyBLsggCqBPskF9AS1xhNDbgnK727 eZWitZF+LMM3eLF6LHy56+nUt5bu8JH14I73MdDKPGhg/LKFH63cRowjpM7iRA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739972095; a=rsa-sha256; cv=none; b=NGwZQmaHYWO0MIvT346ZczFBY3OlifzGO57oQ0ZtTFDhQeay15MZnmTqrcKVFUeBKrG+nh tYBBJl004ZgskTs2dk9YQlRCMPG/yKMbIGFl2KrXPJaE8eul/Qm38F5TCT2a1wJ7gmc+eI 7vZgJF3vt9rzUSfuSXkvmCUDS4Npd7mNOnR5PfLsRSr3AlwMRsKIMn+XjgY0TkQTqEkdGo jixFxZnUKY4WdElAkApDusqqtInXxI1GeQW0Z5nY8M3IhYGxysmjgGFpohTuth9LFaxnIi CzjMoV8N2u3YnJBedI1UXWh5YZbiUBmv9UiogESIAG9b3vFpVWhktCnDecYbpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739972095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1CyKQ9BhLgsgm78PK27D+XHwVxCj9K9oWXq/gL1EESo=; b=IdgvN/fupk6kT1ovgfUAOCd93mf6F5xBtq/1alDcRtBVZ5+RiT9++5CKY2GbPeUSsVvyt0 ggxqliagouag+0wxJPbHDIGghrk+I+2UxzfGzJh0tobhpDcoHC3W6grI9hmbm+Tbp2daGI XRQtHgsSSJtX3bxeY/NaJSGQ8D910ZslRuARE2AXGFXJV2fFCLz29CxiPavOJoEeGmCXuC GtvU1lWAKzQ3tRiyFSZpo3n2ZZivKQfSDOH7/wXvrSOWT/v17zgQ7jcfrJ1s3VdaFySAgG sdgezWOuIPDK+gLf7UbUG9EtJMD0KQqNOdwlSSaIp5AxkoVHSP6ALYyoTf58aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yycnq12dSz16bN; Wed, 19 Feb 2025 13:34: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 51JDYtof062697; Wed, 19 Feb 2025 13:34:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JDYtVa062694; Wed, 19 Feb 2025 13:34:55 GMT (envelope-from git) Date: Wed, 19 Feb 2025 13:34:55 GMT Message-Id: <202502191334.51JDYtVa062694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 86f2641b99f0 - main - pf: fix icmp-in-icmp handling with if-bound states List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86f2641b99f01eb8e8191c4435f22c17433b0c2f Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=86f2641b99f01eb8e8191c4435f22c17433b0c2f commit 86f2641b99f01eb8e8191c4435f22c17433b0c2f Author: Kristof Provost AuthorDate: 2025-02-19 12:28:33 +0000 Commit: Kristof Provost CommitDate: 2025-02-19 13:34:45 +0000 pf: fix icmp-in-icmp handling with if-bound states When we receive an ICMP packet containing another ICMP packet we look up the original ICMP state. This is done through a second struct pf_pdesc ('pd2'), containing relevant information (i.e. addresses, type, id, ..). pd2 did not contain the network interface ('kif'), leading to state lookup failures. This only affected if-bound mode, because floating states match all interfaces. Set kif in pd2. Extend the icmp.py:test_fragmentation_needed test case to use if-bound mode. It already checked that we handled icmp-in-icmp correctly. PR: 284866 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 1 + tests/sys/netpfil/pf/icmp.py | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9b1a2f6a1bac..e8b7a071a3c9 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7792,6 +7792,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, pd2.sidx = (pd->dir == PF_IN) ? 1 : 0; pd2.didx = (pd->dir == PF_IN) ? 0 : 1; pd2.m = pd->m; + pd2.kif = pd->kif; switch (pd->af) { #ifdef INET case AF_INET: diff --git a/tests/sys/netpfil/pf/icmp.py b/tests/sys/netpfil/pf/icmp.py index 6ab649f62be7..232c56a23dbf 100644 --- a/tests/sys/netpfil/pf/icmp.py +++ b/tests/sys/netpfil/pf/icmp.py @@ -53,6 +53,7 @@ class TestICMP(VnetTestTemplate): ToolsHelper.print_output("/sbin/pfctl -e") ToolsHelper.pf_rules([ "set reassemble yes", + "set state-policy if-bound", "block", "pass inet proto icmp icmp-type echoreq", ]) From nobody Wed Feb 19 14:01:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydNZ6kTtz5pPsG; Wed, 19 Feb 2025 14:01: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 4YydNZ44dBz3gk9; Wed, 19 Feb 2025 14:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739973694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1jv0s/WgJ4a4Q7vS9HbtwJJhBkT3EUvsTs/itm74yM=; b=HRbEqXcRR/Iz4nvAbZHbjYOyU6o2+6H3cYurrlONEP9uocnRCrYjSu0utpsrlYELcPVntp JnMWt7rmohtg1Jk/2bJTnZUq5n5brhCn6WfeZROWtl3YdFG4lsgpWqtQzgEg/lW2ONkSO0 kDRO7B/gz3jQ+OEyT/NTB/HxA7huOnuwX2AvRUAsozXQKZK/Wmma72RBfhs+iW6USeEtp+ X2UJkQDci2Y3QzzcdTLdO3mGnNs4Ztrgj1zwN+pDdc2deeakU5Xz2LJ3rGSPLDAYpi3bUr X3/cZhqDsSqZAOVAgs9iw2zeuNkZCLFOFyzZ7ruVnDGG271lWA/qMR8YX/bVqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739973694; a=rsa-sha256; cv=none; b=hX9pZJX+f/zEr9GoEPjXvJ0gfM2Y2F8Wvo/sbPylJy9DhR9xhhhhudr//3n2tmKrMZmSDm drbov6o2LVlnattHtVydhN4hoYgbYlEB/yhz2FPiGI7DLEJpRZGJOHEDnRgAoxuUDsW4pf AImm80QLpVl67CQWoX1ZXC61CWM3AwoXY5Ic4ZmE2DoXb2qgkDM1+Dj5INCXd12VPW7Ivm c66qoBBPyHGMltwe+em19jHSI3mhL++EBPshf0W0bfR6XmYWT8CCuWhedK0dZqj4Orz4iX o58o8hV5zK/DWFvrYaEswE8TTFsicY5coje0GWDwqlpaY/p0PVEd2QgOFyFUEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739973694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H1jv0s/WgJ4a4Q7vS9HbtwJJhBkT3EUvsTs/itm74yM=; b=SJz4vUfkraEWoBtRXGzW+UhuEAk4I8aaP/YAJCsW4q/WCEUyp5fZ/Xh6qJfbE7/wipaBdA 7a+xoDOrAHoKPXicWEQ8z1rV05jh4osU85fybUHE+k7PuGEzNkKTWcxgCcgUaZipV4nVvW 77NnIkmXjLMCvsxrPH8Ae+DXSODi40cWw+PKWQbpnCGMKK4LdlmqZscS9LQTSqQVYKBoOQ IrrCouXp9Q0D1UMyrwwslMfsw61i8iY8AIen5go+F66laYtRb3NYLxsMXIH6Ox29v/+fHb eIT6cWlPrej3PvGXyESjUEQhnAfXJrDVNljZPR18LPQtLjzsAkIEjTbSjcpPhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydNZ3fBmz17yL; Wed, 19 Feb 2025 14:01: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 51JE1YuJ015757; Wed, 19 Feb 2025 14:01:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JE1YPq015754; Wed, 19 Feb 2025 14:01:34 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:01:34 GMT Message-Id: <202502191401.51JE1YPq015754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 62df41ae0a71 - main - ssh: Bump VersionAddendum for CVE fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62df41ae0a71e77ccb1e8fae06d82eec5dff441a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=62df41ae0a71e77ccb1e8fae06d82eec5dff441a commit 62df41ae0a71e77ccb1e8fae06d82eec5dff441a Author: Ed Maste AuthorDate: 2025-02-19 14:00:42 +0000 Commit: Ed Maste CommitDate: 2025-02-19 14:01:13 +0000 ssh: Bump VersionAddendum for CVE fixes Sponsored by: The FreeBSD Foundation --- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/version.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config index 7f559775e3b3..a17484b1da2d 100644 --- a/crypto/openssh/sshd_config +++ b/crypto/openssh/sshd_config @@ -105,7 +105,7 @@ AuthorizedKeysFile .ssh/authorized_keys #PermitTunnel no #ChrootDirectory none #UseBlacklist no -#VersionAddendum FreeBSD-20240806 +#VersionAddendum FreeBSD-20250219 # no default banner path #Banner none diff --git a/crypto/openssh/sshd_config.5 b/crypto/openssh/sshd_config.5 index 4de510ac8795..bc7d9e7df969 100644 --- a/crypto/openssh/sshd_config.5 +++ b/crypto/openssh/sshd_config.5 @@ -1944,7 +1944,7 @@ The default is Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is -.Qq FreeBSD-20240806 . +.Qq FreeBSD-20250219 . The value .Cm none may be used to disable this. diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h index 82be0be8498f..f3fb7fe333eb 100644 --- a/crypto/openssh/version.h +++ b/crypto/openssh/version.h @@ -5,4 +5,4 @@ #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20240806" +#define SSH_VERSION_FREEBSD "FreeBSD-20250219" From nobody Wed Feb 19 14:14:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgJ4G2Nz5pQgm; Wed, 19 Feb 2025 14:14: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 4YydgJ2STTz3mxw; Wed, 19 Feb 2025 14:14:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mpXun/BP/piNOXEuGa+1Fdm6U/b6Ixh8jCkg4gdoaAQ=; b=iBAYpY6NJAup4zLJbMKIKYglTk5AehW4KZ/fFo1irTnhIL2v9jb2oAfhev8w8xJza8ArYj Nfwndpn5NBHKoXFw90wy+c4QeDqorLZS72FTlBPKVauNE86Y1Qn9i3IiDdMfTo1X6IUPY4 HWei9MVqiZDYIyNI082fQIBGuj/c7SzcoUq61g4lFbV4KEMwKuegZhWpLR8KCUlI4a/3ad 4Op9ncVQwhbiMMURj4NV+SBTmAx21vi/3WJ9Z/O3GCzBXNojEfd8Os6XSwWaco0Xh9K1pQ Yef0OBM+ojr1Wm4SgsgXb5ooi22/fW/EfUkdXnVpLXRYIDkA7WXTYf83LD6F+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974460; a=rsa-sha256; cv=none; b=fFUKXgUxC0p6M5rAEQBC5tlTM3cEfcWlmRzgHpjbEn36boYBK3bHh47WDnJ3PuwqYMJxuz IdkbxoEfEtkw4/r/m5vl2pK6lZ2jzk54BOxA+6La8dbZfC0uPOsIrHUVZp6Jg9Exz4Qcx/ lGFz2A9ryj62zDA+FK/LuQowhJK80hoHm5ADJOb6XHauIAuBmXAv+u6M4H7Jr+jMLuABag muPi81AD9DewoA6p4uWymf1KlGiohurzA81Wq29logTD4YC5la/lohpa1XA20AnGB7ZJZt lqA1W8+sBoy/S8GVxdxG+tvSpv6HvetIkSB080TsOpbwa9TG4C3Fn/qrsSAjZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mpXun/BP/piNOXEuGa+1Fdm6U/b6Ixh8jCkg4gdoaAQ=; b=YJ1enh3K5hBkYFXZuZg5sz3NT3Pb17LjtHbfH1N0pkAsuS2XvnsvCA4ZB2w7Z/kEbC/ap3 10YjXQXfu5ytfD4sQI8v+fRDRPlkhO9sOOOlTRD77ERHfGvekppCeI9iXeUCGJva49UHdq SnwXcEDLOtLV/JL5FNVLvS/caMoFQTxZlq1nUxmYL6n2mpjQpWlUICePQjxkigJQ+nyuyX tYbI7FgdbMPZTtNhzxgocFvJ6cP1U6QNHY1EIsimMRZ4f9dgZlJCMyS6VEy4vQwd9SG/6C CqVyEmK9uwTmQ1qVGqlQspOf/A/Um/YqYNWZAQvwOBraOIhOyDc/kX/h6Sa6yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgJ2420z18HT; Wed, 19 Feb 2025 14:14: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 51JEEKK2038060; Wed, 19 Feb 2025 14:14:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEEKYr038057; Wed, 19 Feb 2025 14:14:20 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:20 GMT Message-Id: <202502191414.51JEEKYr038057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 125ef4e041fe - main - vm_phys_avail_check(): Check index parity, fix panic messages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 125ef4e041fed40fed2d00b0ddd90fa0eb7b6ac3 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=125ef4e041fed40fed2d00b0ddd90fa0eb7b6ac3 commit 125ef4e041fed40fed2d00b0ddd90fa0eb7b6ac3 Author: Olivier Certner AuthorDate: 2024-11-05 08:58:26 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:21 +0000 vm_phys_avail_check(): Check index parity, fix panic messages The passed index must be the start of a chunk in phys_avail[], so must be even. Test for that and print a separate panic message. While here, fix panic messages: In one, the wrong chunk boundary was printed, and in another, the desired but not the actual condition was printed, possibly leading to confusion. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48626 --- sys/vm/vm_phys.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 0b7de1d34255..01d3d5e22eb0 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1780,15 +1780,17 @@ vm_phys_avail_count(void) static void vm_phys_avail_check(int i) { + if (i % 2 != 0) + panic("Chunk start index %d is not even.", i); if (phys_avail[i] & PAGE_MASK) panic("Unaligned phys_avail[%d]: %#jx", i, (intmax_t)phys_avail[i]); - if (phys_avail[i+1] & PAGE_MASK) + if (phys_avail[i + 1] & PAGE_MASK) panic("Unaligned phys_avail[%d + 1]: %#jx", i, - (intmax_t)phys_avail[i]); + (intmax_t)phys_avail[i + 1]); if (phys_avail[i + 1] < phys_avail[i]) - panic("phys_avail[%d] start %#jx < end %#jx", i, - (intmax_t)phys_avail[i], (intmax_t)phys_avail[i+1]); + panic("phys_avail[%d]: start %#jx > end %#jx", i, + (intmax_t)phys_avail[i], (intmax_t)phys_avail[i + 1]); } /* From nobody Wed Feb 19 14:14:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgK63XNz5pQDK; Wed, 19 Feb 2025 14:14: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 4YydgK4GV1z3n3g; Wed, 19 Feb 2025 14:14:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DMEPU0KmasMuOmpm0B0TofD9lwikxK2cj/ZUd2ljEV8=; b=wcSYOv5v/q5p/Sfzv8UtZpPZs8FJvB/+4ikFqFxMjpd31jpEkMJyD+T0CXDRHpkBvROyPz w/8ig8OMb/z7HOWbVirvSoB2VrwlLl5H4P5Ukz6D+JZx2qxHyXpwILXxzYRrxw4NR+XXtu KyZcto6wL0KC7d/psdN3/SSqco4uBjRyAGtsEG5KGy6JjijKuSC6fHdjEO88PqoCO8XeRG UJu+TE5cPM6CK8lxpeZAAtSYOESimKBnshafAsSwFSgcnEoLDVasjZU9HiLFoSYRIC2mzT TSs9BxETnE569cIAEhym32UGDyn/+Efstga7o3myK7cJ1euUUDtEPgL8ht5IPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974461; a=rsa-sha256; cv=none; b=k/GDdeLrqnbDDD21aXjJSoEBWpyBUg8JUOEgbJzy4K3x6nOGZrv0lXb4Am3NNZVJo8FAfR WsVfoAMTUPBrsUWjgdSe++6vE+GitxtRxaMTm0oN7604SC139A0+LB9q/+idNnpZxLQ9Lz 3EXQiDtVMJNR9bUf/17A45fghWjdGNhEB5mSi5labAW8pFkqK/IgFCmKbYnMiaX0tPJk3U XV+ZT3zIkIT1E5VqMFcVYjMfx/pb5jdKst+GsXsN7aLej505Zt36D6ssX94zh3cLJS8S/j sbg59VUqL4xvaXuXJ2KPbjPnytxFwJJvH2tLM0GdJgibsP7y7nbtblBFG+0hsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DMEPU0KmasMuOmpm0B0TofD9lwikxK2cj/ZUd2ljEV8=; b=xsoqi4pAjsfmMcCj1HZNRUKQ8GyxGhDp89vJCbZll62Ayqi3N8psTLuxz7eYz4U5PgpPZc FSEp3ysRdQarOq4MkDFCCSN3ooIPR+ZOY350jrOPPKXZVROaVgOWrWEQIn3Yhl5iFqii37 jI2vHt2M8CkeCpfJJK5khfmszB11/B+TWhc8ZtdN7lgXExqqAaGh7gyy89ph2zwIrOsOqS udAdZKOhNxHpLIBgJGK4A7AzQ8fzfjfDXZ8Kc1zOe1o7fMWxqsKjxAlaS6YCaP9F97bd4l lzKuSbj6yIKetImCJdGpl7/fZrP2jimnq86F+3ChyPaIvixN9ZOBHGtt4sLCyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgK31nVz17Zt; Wed, 19 Feb 2025 14:14: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 51JEELBE038093; Wed, 19 Feb 2025 14:14:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEELef038090; Wed, 19 Feb 2025 14:14:21 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:21 GMT Message-Id: <202502191414.51JEELef038090@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: f30309abcce4 - main - vm_phys_add_seg(): Check for bad segments, allow empty ones List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f30309abcce4cec891413da5cba2db92dd6ab0d7 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f30309abcce4cec891413da5cba2db92dd6ab0d7 commit f30309abcce4cec891413da5cba2db92dd6ab0d7 Author: Olivier Certner AuthorDate: 2024-10-09 17:04:34 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:26 +0000 vm_phys_add_seg(): Check for bad segments, allow empty ones A bad specification is if 'start' is strictly greater than 'end', or bounds are not page aligned. The latter was already tested under INVARIANTS, but now will be also on production kernels. The reason is that vm_phys_early_startup() pours early segments into the final phys_segs[] array via vm_phys_add_seg(), but vm_phys_early_add_seg() did not check their validity. Checking segments once and for all in vm_phys_add_seg() avoids duplicating validity tests and is possible since early segments are not used before being poured into phys_segs[]. Finally, vm_phys_add_seg() is not performance critical. Allow empty segments and discard them (silently, unless 'bootverbose' is true), as vm_page_startup() was testing for this case before calling vm_phys_add_seg(), and we felt the same test in vm_phys_early_startup() was due before calling vm_phys_add_seg(). As a consequence, remove the empty segment test from vm_page_startup(). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48627 --- sys/vm/vm_page.c | 3 +-- sys/vm/vm_phys.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f0e3fc73fb34..06965633ee07 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -750,8 +750,7 @@ vm_page_startup(vm_offset_t vaddr) * physical pages. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) - if (vm_phys_avail_size(i) != 0) - vm_phys_add_seg(phys_avail[i], phys_avail[i + 1]); + vm_phys_add_seg(phys_avail[i], phys_avail[i + 1]); /* * Initialize the physical memory allocator. diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 01d3d5e22eb0..c28bc5d25616 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -476,10 +476,18 @@ vm_phys_add_seg(vm_paddr_t start, vm_paddr_t end) { vm_paddr_t paddr; - KASSERT((start & PAGE_MASK) == 0, - ("vm_phys_define_seg: start is not page aligned")); - KASSERT((end & PAGE_MASK) == 0, - ("vm_phys_define_seg: end is not page aligned")); + if ((start & PAGE_MASK) != 0) + panic("%s: start (%jx) is not page aligned", __func__, + (uintmax_t)start); + if ((end & PAGE_MASK) != 0) + panic("%s: end (%jx) is not page aligned", __func__, + (uintmax_t)end); + if (start > end) + panic("%s: start (%jx) > end (%jx)!", __func__, + (uintmax_t)start, (uintmax_t)end); + + if (start == end) + return; /* * Split the physical memory segment if it spans two or more free From nobody Wed Feb 19 14:14:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgL6sG6z5pQPh; Wed, 19 Feb 2025 14:14: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 4YydgL4Nz7z3n3h; Wed, 19 Feb 2025 14:14:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NeBPMOmvZ8HjQgAL5VEwAGe2mpAWEm+bpmtMH8fwkB4=; b=HuMNWNqS0bYJLvby2W9sESD5mAmJfv9jzvkKf07/xKl9l6iZz5Gk0NhOM2BDv3gNbSgPKR lQaif6woRXbkgu2EqF0q3bkCc1pVh31NCx+3+3kBCW1d8urdbt5iugeK3DS16B2uAOT20U dI0wZW2koyWDKd/7oV0TYdg06zBDJ0D6DerPSkSppicymjQV+8uRaB7X6zEm9q+KjQZAjS wDQTupEmh0xzM3yonGiyZKHr5UQyVGtAu3FpmiPIK2hNUmqkj/Zr6/c7kzVJFUB6Ows/td W+5y6Iod6ebbpNpqLCn4epsdnl335LLhoBU7jLTRMlH3m4DogHKeR+s1h302uA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974462; a=rsa-sha256; cv=none; b=XmlMTTj8c89ISpBjWYC0PZqGgSDKVsfpkM6l/bUKrrkFMBaPHsBmOF3FuMCQt4O0jJHmka dECxeWZO4R2wT1jOil087rETngZWX2AqtJRlwYE9TaesktE5fXAQmzIJv8z3vcG5kB5Mx1 715pekKpBt3YzHTxTu+m75zFDdUT+kS3YBasyNvdHleuI99wghYMLasMpTpIInBoyQhMG+ HY3Sfbm7yJQVAilHbc43ZnMOYUyArvvJpoPdtQ4p+UztSB26FnG426OOJqhUKgleHaMc32 BLXI7HcT9vz+UXPzDv4O7d02A3XDi5/ti+ArHYe9bMZyKhfN8GV4txpyvp8CIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NeBPMOmvZ8HjQgAL5VEwAGe2mpAWEm+bpmtMH8fwkB4=; b=KvSdl4iBSxm78KY3a/KdaPkkVfrTiP4U0N2I9n+cvj5NsX+DIg1ZEBrWtDH3PpKzDvOeP+ Ko8C76vxF/tMiPp6YCyil/fAhP4PUkevPTcLkGLXFD4UIgKPcBJpieZo7rE3UgIlYSJsaX SWFAP9l/KI7Jsrr9bw1ZYKb8mZvl/pyQNsndDGLIdIRHu7NSrQgfDvWaK0mcintCER5JOL CxHynsPJ4CTDyvw7xImNNZu1Xm52G+LZWdh5K7AXnBNQslgdDTJBAI6VP7XG/cOtPcRyXf pa53eMf7rA+NRyHicRf7zst0qtV9tjh5uC7+NA+ukVOjHxegm1M6KHpPf6Ez3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgL3ymfz18HV; Wed, 19 Feb 2025 14:14: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 51JEEMlQ038126; Wed, 19 Feb 2025 14:14:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEEM1Y038123; Wed, 19 Feb 2025 14:14:22 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:22 GMT Message-Id: <202502191414.51JEEM1Y038123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 8a14ddcc1d8e - main - vm_phys: Check for overlap when adding a segment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a14ddcc1d8e4384d8ad77c5536c916c6e9a7d65 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=8a14ddcc1d8e4384d8ad77c5536c916c6e9a7d65 commit 8a14ddcc1d8e4384d8ad77c5536c916c6e9a7d65 Author: Olivier Certner AuthorDate: 2024-10-10 07:41:40 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:26 +0000 vm_phys: Check for overlap when adding a segment Segments are passed by machine-dependent routines, so explicit checks will make debugging much easier on very weird machines or when someone is tweaking these machine-dependent routines. Additionally, this operation is not performance-sensitive. For the same reasons, test that we don't reach the maximum number of physical segments (the compile-time of the internal storage) in production kernels (replaces the existing KASSERT()). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48628 --- sys/vm/vm_phys.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index c28bc5d25616..3b3b3cb16bb9 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -421,18 +421,26 @@ _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int domain) { struct vm_phys_seg *seg; - KASSERT(vm_phys_nsegs < VM_PHYSSEG_MAX, - ("vm_phys_create_seg: increase VM_PHYSSEG_MAX")); - KASSERT(domain >= 0 && domain < vm_ndomains, - ("vm_phys_create_seg: invalid domain provided")); + if (!(0 <= domain && domain < vm_ndomains)) + panic("%s: Invalid domain %d ('vm_ndomains' is %d)", + __func__, domain, vm_ndomains); + if (vm_phys_nsegs >= VM_PHYSSEG_MAX) + panic("Not enough storage for physical segments, " + "increase VM_PHYSSEG_MAX"); + seg = &vm_phys_segs[vm_phys_nsegs++]; - while (seg > vm_phys_segs && (seg - 1)->start >= end) { + while (seg > vm_phys_segs && seg[-1].start >= end) { *seg = *(seg - 1); seg--; } seg->start = start; seg->end = end; seg->domain = domain; + if (seg != vm_phys_segs && seg[-1].end > start) + panic("Overlapping physical segments: Current [%#jx,%#jx) " + "at index %zu, previous [%#jx,%#jx)", + (uintmax_t)start, (uintmax_t)end, seg - vm_phys_segs, + (uintmax_t)seg[-1].start, (uintmax_t)seg[-1].end); } static void From nobody Wed Feb 19 14:14:23 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgN1mYlz5pQbw; Wed, 19 Feb 2025 14:14: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 4YydgM5K38z3my7; Wed, 19 Feb 2025 14:14:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkDjNh2BWZoEk6GtnPVpgtqaPeKn1FNoAEtZe13qBW4=; b=fBZUlrI5KxrbbpbAsGUv20ZDXqa8q54FCwvG4bK5+OeHkiCIQOXQL/PexEN3SzzMNzSCXH mDSg1s68RErjuIXRyz6EGnbAchFshpG+hyM/cqV0YLV6/rw4CyLLdYEOX4l+9xWrWviOPX w5x3WYqbkijap2g2/wQd9UgSDFSEk9uOBoyPqrp5hCPzR08oOHl4E9cIeJUiA+17hEOUIW Nn/0+/KQkmIqV7ArzYM5k/ZPN03fwA0LXkocGAQXsDFv/bQlrAwow1L7O8c8LqJOq3BTcj pJH9W224sY0MU2TN55v1pzdX7b5/jrusS//mL9ZfVgfvQtQ8+EdM5p1Pm4TN5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974463; a=rsa-sha256; cv=none; b=NCCWY51raMAKIpR3cH2TPC3PeylE2sdl/bD6q3sZDGpxrU999TtN6YfSExvPJSE/azfZRm bIMDsbgpRovWCOerTRwy2qfNxXzT5aYcWOWM5j4PtIAdwWFbuQCpaq61zStMqCb2goI7H5 i/OUwFCcgYpLDA63XA4KVRLmx3X0ZuNeujl0ppRwnzLZPUopbYqPRWO2s0QZocCAJ3uqUn Qx0tcA/t14TvxwYRwSuE1ipiXmAWuFhraD3jWZ88X+SzrCSLK5IkidvE3CRScOfDmIQVWX w9YWVCUrgylYLeyyQy126h30Ks+t1H2mWeExtHZ7MS9s4OEjtvi8wDFkLZ4wPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KkDjNh2BWZoEk6GtnPVpgtqaPeKn1FNoAEtZe13qBW4=; b=TfhUZIUj66Oe6rUUnMaPmcGCh4+QTvWpuTNeaywaup/zUsqrzCDQ/7CYBLGYjvH3VWDI9A 6ozwotOy29/CD1Nix+oCiJGpgiR8tu90NPO2TL7chDKKskykycg7neB1LPVs+RR3B2PtvO Xv96m2DQgE1cGgSKiMHSlshx0TbOYl0qJaYt4hwYzu+2w3fxSuWTUD/sesvNQTiwOKowV2 G2xQNHXLDO4jbopV9+B2q75Wwsiz0A7ucg/H6jLQUnMBUJa8ZDoe1yVi8NhNtc+inOLzEt dF5FVo26ya3TLX1+7q9GPGtH/4Ks6fMjsm4EiGMBHLP39BY8Kyom2pqSGxafqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgM4vnLz17p2; Wed, 19 Feb 2025 14:14: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 51JEENtm038159; Wed, 19 Feb 2025 14:14:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEENNH038156; Wed, 19 Feb 2025 14:14:23 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:23 GMT Message-Id: <202502191414.51JEENNH038156@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 291b7bf071e8 - main - vm_phys_avail_count(): Fix out-of-bounds accesses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 291b7bf071e8b50f2b7877213b2d3307ae5d3e38 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=291b7bf071e8b50f2b7877213b2d3307ae5d3e38 commit 291b7bf071e8b50f2b7877213b2d3307ae5d3e38 Author: Olivier Certner AuthorDate: 2024-10-28 16:22:28 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:27 +0000 vm_phys_avail_count(): Fix out-of-bounds accesses On improper termination of phys_avail[] (two consecutive 0 starting at an even index), this function would (unnecessarily) continue searching for the termination markers even if the index was out of bounds. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48629 --- sys/vm/vm_phys.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 3b3b3cb16bb9..e2b5a6e21365 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1782,12 +1782,10 @@ vm_phys_avail_count(void) { int i; - for (i = 0; phys_avail[i + 1]; i += 2) - continue; - if (i > PHYS_AVAIL_ENTRIES) - panic("Improperly terminated phys_avail %d entries", i); - - return (i); + for (i = 0; i < PHYS_AVAIL_COUNT; i += 2) + if (phys_avail[i] == 0 && phys_avail[i + 1] == 0) + return (i); + panic("Improperly terminated phys_avail[]"); } /* From nobody Wed Feb 19 14:14:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgP3jCgz5pQdV; Wed, 19 Feb 2025 14:14: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 4YydgP0P5dz3nBm; Wed, 19 Feb 2025 14:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9+uSu3vPIB5siU1aWNSYDD3L9F7ja6O+m9lNNSvypt8=; b=go/iWzYBD3s7HOlXadurwzUttekqnpRP/qdpdk3RfJC9uH29iDjzCjmRMjyrAjZVbILxz8 yEw1ehgK8KwjQ3Ug3SSmXXRq9VjD/p3JjZ7RzWHNMAc+ybXkhT0CxsoUoLSnO/Kc+/haoI 9OuYXJro4YCwx4k3a+l0Kh0eYtizdTI7OFdyGUeegiOkNdmxo+FTEt+LdOC9sHWJl4MrP5 Mkl1zofCZvenR6eh/wo3Tdd7/nBwxJd/elJT6qF0mpqMBYRu6lORQoP0rFqD6WgwTC0gWn U09uwlT6JTCfLDHYf3iP2vciJli0HLXrDt4kqwwrMw77olOAh+rP9ehmV4T5VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974465; a=rsa-sha256; cv=none; b=iZ9m7FBrnofML3arvmJs8JyiE0o1KKp3PbeDKHmFYibRsUcXIk6HkegERbPk6ExqORukKk XEns/i7AXaGgyqwmYbF5zAJ/CPP7sHVxD+cowWmqTN/XtvP9hiwYG7WTFGP7KWAkekXC22 ZBcqqNPIyTXllO01R3FlTjdqta/jjaiGzwRX+t3XEg1IWtSQLv6n2gmRUJMktixncb0A5U ehZvMcXuj5ybsP27zJUvh34EQb8QssZIpTjFkW2tFEdY8Qf0SCCCB+Fulllo2UofkP4MrR +K1tAcitnyQ3/O8Bj3/HyS6tCkoW8x1lT2bNX3Qsf3VzzBM3A9pa/4lJ0+LiLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9+uSu3vPIB5siU1aWNSYDD3L9F7ja6O+m9lNNSvypt8=; b=aP8eAH6xwJ7HeS9x1WboGVawZ2jmuc3/lht6D3a40rAz2bQlYQHV6XUN4WtxiIbIPsEFPD xK2hm83NyoVfHsjBGv3exEFkmOQG6LKpXMJ9MXHaFME0hyErq//tiCJ15IPBWGUBBzuWsm U8pMzwVpqmAnOMYErud2uCEHtMMVVBfKZYIoodPbP3De9vRkRnH21wFFFBqzDFGUIKKBrq ab6PwuP6cwrDhN9GMlSSGL4h0j8niKERCf9fO+kGM2EMvhMs+B5b9QWABhP3sLCyT1pnK/ RjSQQTZ+0qe1ab8VWQcAoMsLWPktY2hlKTAvromuWPzCz9YbvWpQ5PdO8dEjGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgN5sWXz181r; Wed, 19 Feb 2025 14:14: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 51JEEOoh038198; Wed, 19 Feb 2025 14:14:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEEOHQ038195; Wed, 19 Feb 2025 14:14:24 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:24 GMT Message-Id: <202502191414.51JEEOHQ038195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: e1499bfff8b8 - main - vm_phys_avail_split(): Tolerate split requests at boundaries List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e1499bfff8b8c128d7b3d330f95e0c67d7c1fa77 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=e1499bfff8b8c128d7b3d330f95e0c67d7c1fa77 commit e1499bfff8b8c128d7b3d330f95e0c67d7c1fa77 Author: Olivier Certner AuthorDate: 2024-11-04 17:05:19 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:27 +0000 vm_phys_avail_split(): Tolerate split requests at boundaries Previously, such requests would lead to a panic. The only caller so far (vm_phys_early_startup()) actually faces the case where some address can be one of the chunk's boundaries and has to test it by hand. Moreover, a later commit will introduce vm_phys_early_alloc_ex(), which will also have to deal with such boundary cases. Consequently, make this function handle boundaries by not splitting the chunk and returning EJUSTRETURN instead of 0 to distinguish this case from the "was split" result. While here, expand the panic message when the address to split is not in the passed chunk with available details. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48630 --- sys/vm/vm_phys.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index e2b5a6e21365..82272be1a6c9 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -1854,7 +1854,13 @@ vm_phys_avail_size(int i) } /* - * Split an entry at the address 'pa'. Return zero on success or errno. + * Split a chunk in phys_avail[] at the address 'pa'. + * + * 'pa' must be within a chunk (slots i and i + 1) or one of its boundaries. + * Returns zero on actual split, in which case the two new chunks occupy slots + * i to i + 3, else EJUSTRETURN if 'pa' was one of the boundaries (and no split + * actually occurred) else ENOSPC if there are not enough slots in phys_avail[] + * to represent the additional chunk caused by the split. */ static int vm_phys_avail_split(vm_paddr_t pa, int i) @@ -1862,8 +1868,12 @@ vm_phys_avail_split(vm_paddr_t pa, int i) int cnt; vm_phys_avail_check(i); - if (pa <= phys_avail[i] || pa >= phys_avail[i + 1]) - panic("vm_phys_avail_split: invalid address"); + if (pa < phys_avail[i] || pa > phys_avail[i + 1]) + panic("%s: Address %#jx not in range at slot %d [%#jx;%#jx].", + __func__, (uintmax_t)pa, i, + (uintmax_t)phys_avail[i], (uintmax_t)phys_avail[i + 1]); + if (pa == phys_avail[i] || pa == phys_avail[i + 1]) + return (EJUSTRETURN); cnt = vm_phys_avail_count(); if (cnt >= PHYS_AVAIL_ENTRIES) return (ENOSPC); @@ -2025,12 +2035,10 @@ vm_phys_early_startup(void) for (i = 0; mem_affinity[i].end != 0; i++) { idx = vm_phys_avail_find(mem_affinity[i].start); - if (idx != -1 && - phys_avail[idx] != mem_affinity[i].start) + if (idx != -1) vm_phys_avail_split(mem_affinity[i].start, idx); idx = vm_phys_avail_find(mem_affinity[i].end); - if (idx != -1 && - phys_avail[idx] != mem_affinity[i].end) + if (idx != -1) vm_phys_avail_split(mem_affinity[i].end, idx); } } From nobody Wed Feb 19 14:14:25 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgQ4zjLz5pQgr; Wed, 19 Feb 2025 14:14: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 4YydgQ0XDdz3n45; Wed, 19 Feb 2025 14:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gcVGm6Yds3yuMok8pm4R0s7+XDk7hUGyAUMDkE8b9hI=; b=NUQU+G5gn3xyyYQh0sPp2XVyRE/HPux3RtUNH8gcbu+2SiiuLdeYmfwyQACuLYTXw07Yml lhGmYj975EYAu+I5tXt20SL5P0XqeAJYWaAX8+xbl0rXUplCWkPEtDgr9AEfpw/zCqwJJ2 fNsNOnpQ8AVzXt1LNOqGSRIB6QHqBHeuxhZ32gb/W3iMmEjT5kouHNGs6BdQBc9U+mGs3p NQCypDs5ZmhV/sLD2Tpjdwbhj86fsy/mbd3xovL+kRctQGlYAAiBoJIkDtKIDoPMQ12v6L afh0Zc8Np/Fo2da3XmyqGaudkBeeZweOZ6UkiN604gC3qzh+5P7sxUgvYN+9oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974466; a=rsa-sha256; cv=none; b=S4evmrWF/iaG+WQ/ImaCEH5mjYxKrjHyjdyNawZEhRjU4EJus67JWBeoSfaEYDzR6W+wZj uSIXA1GrtlsSyvgaB/1qLe8nVymnn4RL1aJLfigjdEM6p/XbF5A7KP83IYxKq2GlMW/ryr DeH/Rv+kYgRhIOcf/yi0EkjqVW2fQdtO7prWt0tnToevfyKBgSj9rT7/RPM7fiJ1THQo31 6tP+4yq57Gl9aNJZufjgiD0nY0znfW/S09/P+QLSvxrw2ErtK2gO7oqzNeYbB0SOUQJX/J k+IsgKBqNfnkRCbh7UxlxCHPis1cj26XXPVfvGbNXCrH79zQ+jDdMwDY5o3ZEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974466; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gcVGm6Yds3yuMok8pm4R0s7+XDk7hUGyAUMDkE8b9hI=; b=ozAqa+3ixt0Q/8Zepv0G6PStK8da49F34D+6y9EFPiW+/pbiInkGG2sNZH74NB4+r/y+7u SwX1djghLnATNzNd0aBUBMNpcBHO4G3Mgw2zJdkbJpJ6/vJaZIL7uzCVFbRrWt8NJEi1Xc p0iowvuQ9sBcxJIi6t3aedwe1GrbC5HIOjQlbN7l0xI37hC4awNEwXAmwxIt59ZJHpzu3W kDplSDC9rOmKe91X/WIuc+Z/z9GH/JXm9XYFn0Jl10j0ElcqGJ5DQ7BTE3d/xrrRJX1Hrm DqufUyWBaojuH77hHaZdseBzSdnN7NWUbsIYuHoIn+zwUHbvVbMshzyvG4XDYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgP6Qn8z181s; Wed, 19 Feb 2025 14:14: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 51JEEPPi038232; Wed, 19 Feb 2025 14:14:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEEPD3038229; Wed, 19 Feb 2025 14:14:25 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:25 GMT Message-Id: <202502191414.51JEEPD3038229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 32e77bcdec5c - main - vm_phys_early_startup(): Panic if phys_avail[] is empty List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32e77bcdec5c034a9252876aa018f0bf34b36dbc Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=32e77bcdec5c034a9252876aa018f0bf34b36dbc commit 32e77bcdec5c034a9252876aa018f0bf34b36dbc Author: Olivier Certner AuthorDate: 2024-10-28 16:59:57 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:27 +0000 vm_phys_early_startup(): Panic if phys_avail[] is empty Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48631 --- sys/vm/vm_phys.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c index 82272be1a6c9..ca6bec8b8b9f 100644 --- a/sys/vm/vm_phys.c +++ b/sys/vm/vm_phys.c @@ -2017,6 +2017,9 @@ vm_phys_early_startup(void) struct vm_phys_seg *seg; int i; + if (phys_avail[1] == 0) + panic("phys_avail[] is empty"); + for (i = 0; phys_avail[i + 1] != 0; i += 2) { phys_avail[i] = round_page(phys_avail[i]); phys_avail[i + 1] = trunc_page(phys_avail[i + 1]); From nobody Wed Feb 19 14:14:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgS3DQdz5pQPt; Wed, 19 Feb 2025 14:14: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 4YydgS1ccWz3nHx; Wed, 19 Feb 2025 14:14:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qTBOTH8EQwzLynpieChMekOnAHnsvZSE07/x/BCdLs=; b=ZCBao1otcDZ0HKdZ9YhXa5W8CyZJeu3gl1+Yu86npRhROZvpX186WBKAnQXSEhPcSfIdSt b/o61c6Br7b1fkR1+tQusHLt0C6EvO9jVJig0WOwW/bgsw1kuQsjYnL6TFTYQz+EtJeZYs jJXPid4G+YE3QXPAr8UY6UvRHgM4z+KkM8SUkmJAVzATFG0/8qKEUWv/7XWosC9aJvZmS3 WjAqDRomqSPeXhusi2dMrtzf/dgtfqGw5j0uQcTlAxAUEzmJ5LZctVyEb1YPwpDmymiSjo +5ZIpk2PM2yIZK71s2iMsttuOMY4jT3sRgReHfOZun7ZRHggguV2l8Xy8XsMYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974468; a=rsa-sha256; cv=none; b=acbuQRO3+N2o/7WayTYNVnXaIy4DmvJXhpdn7NlhLLm0YihN6DcxNoBJuMiNI9xC6EaEkh tKS+CJINdGVKNc5xt0Ipu54Mz7txYXB/HJrCvkBHKFoT7F2O5uVLBIpOs69JKOJqjdjHaX XxuJnUUM9CFxHeMBeTmrWSAo4Zb2nzN5N+2mZf1RVobIGqt2Gg3NSTgjGGwtIF2ID0+sHN Z4YIViHAbjxjKQxhfrHuQTU8jBfYyAi8hsYL7fpTLIFnMMlRohzuI+jzYFY2rWSHjk42s/ x7LXRy1kA0MACavUDHyG8t678ALd9Ry8YLxv0DCT7ITufc3AqZeQKztcWV7I7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9qTBOTH8EQwzLynpieChMekOnAHnsvZSE07/x/BCdLs=; b=S2lbWn1JCZK7Dw+UZGDs3aHzTtoGeM1O0u2DJB5VVvVVbhRMfNG9rtWmVsHv3jehKfQJI2 Y0YxIaS2ByDYrzUuIU1B8+fjpRXHY6sPUzxYLjLaQtmVW3cAGPoo3rIF+96ygtZiJdp7tb WNHyiwktg7a2jCpnJlnpMj0wsgfa/cg/BErzRTXj3yDWC8oTTPlEvHXfbq1EuT3/BD/R8U zMK5MxvIXhtMQyFQE1dM2e1syYTsXsub6EBuO04h76tdWFYXO8Z+x7yT9h+uZtMCLOvXyf dCz9lr5u6a/JI2Ik/uoZ4lOFr8kL71hbzGUNzPbKA2T2HXR8YNL9qWRBv5YNRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgS10KVz17Zv; Wed, 19 Feb 2025 14:14: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 51JEESbo038298; Wed, 19 Feb 2025 14:14:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEESor038295; Wed, 19 Feb 2025 14:14:28 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:28 GMT Message-Id: <202502191414.51JEESor038295@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 0ebd9cf85d36 - main - powerpc: mmu_radix_page_array_startup(): Don't force allocation from domain 0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ebd9cf85d3627e50e6a7330b67719fce4d1a5fe Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0ebd9cf85d3627e50e6a7330b67719fce4d1a5fe commit 0ebd9cf85d3627e50e6a7330b67719fce4d1a5fe Author: Olivier Certner AuthorDate: 2025-02-07 15:24:10 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:28 +0000 powerpc: mmu_radix_page_array_startup(): Don't force allocation from domain 0 In this case, the domain from which the memory to back the VM page array is allocated does not matter, so just let vm_phys_early_alloc() choose a suitable domain. Reviewed by: jhibbits, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48888 --- sys/powerpc/aim/mmu_radix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/aim/mmu_radix.c b/sys/powerpc/aim/mmu_radix.c index 0a38ad97ad91..388ab386b35a 100644 --- a/sys/powerpc/aim/mmu_radix.c +++ b/sys/powerpc/aim/mmu_radix.c @@ -6438,7 +6438,7 @@ mmu_radix_page_array_startup(long pages) start = VM_MIN_KERNEL_ADDRESS; end = start + pages * sizeof(struct vm_page); - pa = vm_phys_early_alloc(0, end - start); + pa = vm_phys_early_alloc(-1, end - start); start = mmu_radix_map(&start, pa, end - start, VM_MEMATTR_DEFAULT); #ifdef notyet From nobody Wed Feb 19 14:14:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YydgR5x37z5pQB8; Wed, 19 Feb 2025 14:14: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 4YydgR0hm8z3nC9; Wed, 19 Feb 2025 14:14:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sK8sPWJdHmnOBGLbysbJ6U1QurIDeDpzjhc/iDhn350=; b=Xi9iPBFhK4QclME4nl9XcDIzhBUuzq7WlPCNIoSMdlP59X4+7ziYqPcgEmlRbQzJofGfh0 9as0V3i+jhpHoYtJ4kphQk2LX9PrHwRv1EI51zzGKxvq3rtvqmmaVq/j5g6/l9GVY/vOqG 5O6hpk3crs2huQZciaQeo4J9Vyt4Yi8rsccJ1sXl2D5/7f4OtxYTJtbBoI4g12CGxZWmn5 ot6nOqayzE/4C334dkOuxQ+1e9siZhyeeMn4WoI4LDqHOR8bu/aowUoGTvJmnPBeA3yXPM sNNDeEhb39L4yNa+lV+CspeYE8ZA6bwrgbK50Xo/ugQdRGFrNiM3HV4Zxt5bLg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739974467; a=rsa-sha256; cv=none; b=kpJmPZtcUBVgiBToXNGGqOzq7V8eZNOkuLmvuUc8jfo96VNRMhOZs/X7GRC9UvATixPR7I 4PTD1soBJkrlbke7saY+HgfVKA40mMUuSP1mYqKTfafsfNOFJTN+m+KFyIxaGGhH9Q1Urq chhr4K0QaaaH+CHWyEjBOG+SfsAY4XHrJmosiRAk5I3a99lJwfkUKBOCquqOtQqj20PzVK +xaT7xgSqty5VK9PagtUrKNTqeVTVAlMdPDog5hNRF521mwURqob17C4qSr3Mfe0rV9/eS R0jCsDMVplAdNafX2J66QM2da9wqUdWhq/IAj8u8cnh+4aDRHmCM4dNUjFcvpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739974467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sK8sPWJdHmnOBGLbysbJ6U1QurIDeDpzjhc/iDhn350=; b=QGiHPbmfxBw+eZQFML5Xo9e//oNbV7yswDQIjjciJvzkRo7Vx1eEuEJyYTxkjRKIDH46Pl 2lHNVb1Rp17f1zxyIjMExmu+pAUdyuKQEHLjNbi8z5psfUMn96qm8a3ezHNE5W94GUpywo vwaaw2VGJjRHeMy2Tjnjb1Qv3EXyUA7AATupbLoACCSDcJRgMMjLaMuevVy3rluPMDCVZ9 ZV1JUvEjIBaqTI+RZMpctjay6/h/gA7v/JQSUzssFdG23nCWmkiVYq22glipsgKPh3ZsV9 7ttVQVUOG5rYTWev55r3JnXd9pbdEO40nJNTknfX3HL/HQ55UaTGRU6G5vO0dg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YydgR0F0Vz181t; Wed, 19 Feb 2025 14:14: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 51JEEQuQ038265; Wed, 19 Feb 2025 14:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JEEQpR038262; Wed, 19 Feb 2025 14:14:26 GMT (envelope-from git) Date: Wed, 19 Feb 2025 14:14:26 GMT Message-Id: <202502191414.51JEEQpR038262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 16317a174a52 - main - vm_page_startup(): Clarify memory lowest, highest and size computation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16317a174a5288f0377f8d40421b5c7821d57ac2 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=16317a174a5288f0377f8d40421b5c7821d57ac2 commit 16317a174a5288f0377f8d40421b5c7821d57ac2 Author: Olivier Certner AuthorDate: 2024-10-29 10:41:47 +0000 Commit: Olivier Certner CommitDate: 2025-02-19 14:13:27 +0000 vm_page_startup(): Clarify memory lowest, highest and size computation Change the comment before this block of code, and separate the latter from the preceding one by an empty line. Move the loop on phys_avail[] to compute the minimum and maximum memory physical addresses closer to the initialization of 'low_avail' and 'high_avail', so that it's immediately clear why the loop starts at 2 (and remove the related comment). While here, fuse the additional loop in the VM_PHYSSEG_DENSE case that is used to compute the exact physical memory size. This change suppresses one occurence of detecting whether at least one of VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE is defined at compile time, but there is still another one in PHYS_TO_VM_PAGE(). Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48632 --- sys/vm/vm_page.c | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 06965633ee07..c105aafca40f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -655,40 +655,39 @@ vm_page_startup(vm_offset_t vaddr) #else (void)pa; #endif + /* - * Compute the number of pages of memory that will be available for - * use, taking into account the overhead of a page structure per page. - * In other words, solve - * "available physical memory" - round_page(page_range * - * sizeof(struct vm_page)) = page_range * PAGE_SIZE - * for page_range. + * Determine the lowest and highest physical addresses and, in the case + * of VM_PHYSSEG_SPARSE, the exact size of the available physical + * memory. vm_phys_early_startup() already checked that phys_avail[] + * has at least one element. */ +#ifdef VM_PHYSSEG_SPARSE + size = phys_avail[1] - phys_avail[0]; +#endif low_avail = phys_avail[0]; high_avail = phys_avail[1]; - for (i = 0; i < vm_phys_nsegs; i++) { - if (vm_phys_segs[i].start < low_avail) - low_avail = vm_phys_segs[i].start; - if (vm_phys_segs[i].end > high_avail) - high_avail = vm_phys_segs[i].end; - } - /* Skip the first chunk. It is already accounted for. */ for (i = 2; phys_avail[i + 1] != 0; i += 2) { +#ifdef VM_PHYSSEG_SPARSE + size += phys_avail[i + 1] - phys_avail[i]; +#endif if (phys_avail[i] < low_avail) low_avail = phys_avail[i]; if (phys_avail[i + 1] > high_avail) high_avail = phys_avail[i + 1]; } - first_page = low_avail / PAGE_SIZE; + for (i = 0; i < vm_phys_nsegs; i++) { #ifdef VM_PHYSSEG_SPARSE - size = 0; - for (i = 0; i < vm_phys_nsegs; i++) size += vm_phys_segs[i].end - vm_phys_segs[i].start; - for (i = 0; phys_avail[i + 1] != 0; i += 2) - size += phys_avail[i + 1] - phys_avail[i]; -#elif defined(VM_PHYSSEG_DENSE) +#endif + if (vm_phys_segs[i].start < low_avail) + low_avail = vm_phys_segs[i].start; + if (vm_phys_segs[i].end > high_avail) + high_avail = vm_phys_segs[i].end; + } + first_page = low_avail / PAGE_SIZE; +#ifdef VM_PHYSSEG_DENSE size = high_avail - low_avail; -#else -#error "Either VM_PHYSSEG_DENSE or VM_PHYSSEG_SPARSE must be defined." #endif #ifdef PMAP_HAS_PAGE_ARRAY From nobody Wed Feb 19 16:46:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yyj2K1kr9z5pbhK; Wed, 19 Feb 2025 16:46: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 4Yyj2K0x2nz3ff8; Wed, 19 Feb 2025 16:46:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739983561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xo+eay+f86OKWFZ6uwh9yRK8m/mlwA/yslXNd50j9Z0=; b=w4a3zoywcLQ0O83zdtIHi76bW6CLHDVCzChs0FLzD1NYRj3BH2DIaXHQPpNutK1WB2Ygqd qXZ7ZZzugftl18Hn/ZR9UuHqweMIkmaBTtAsCVTFf9m/VGUbUrGJDM1CY+NVXVMqE0xnCp wP+HaK0Ei9MsYDUwFgh93YNnJEipvjZr21w7AmkSaBgHS1TWQ69f766WCUJiy8rvQCQcIB wT8ztg8kDOKFjQLWApfAPn07Z450PiUpqcZE+40jTSWpa6pt4+c0hqTT+wztELcCFhCWcu kbhy+lvPDjDnQntXQfRGhuoIVBXcqZomfsIcaLLOlZGp6oCTTSVsA1zSBuEPwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739983561; a=rsa-sha256; cv=none; b=Uyg4cTbZPNFxXuQrk+OYrU6osMTLWtZ2DSNf3Pb1ffH5qUgUie5lndmW3YNNjxGFSwe67U asObdJ4MgS6Ksg8kPGm1w5m6W1Ssxp7PmQknWq42wUgSsCt8Y48Yp/c1rZTU17XX4r8H/7 5OP56j2POjfuxtM6B2Dby4wByB+y5/6KZTT/RogFCiqr84Z737oCYLyU/TG60GtH4B7nzd YiOCoutKMi6YpHNmfubBON1nNHXbzPoNm/pzo3d07zJgSbdePTyN5Y7oHgMZ0N7LIqnLtq W9lz2lTW0E/GReU+7jxQzHVHMW7XBLS6V5DuT09747CvJLKiXS6seV3ylnDaMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739983561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xo+eay+f86OKWFZ6uwh9yRK8m/mlwA/yslXNd50j9Z0=; b=h084OG0Ch+gN/D74C8MO1sKsDlKoujwepd6Qei0lojBRNzEpI41a3n76ShWGxRASsfWsiT dIZIyHX/+KZyJxpM64J0MJUCTSNcxGdfM6K3YQMuoGS8Qk5SXE+cYzENG1P3avMCWfGYzq jH2Wb081c0wodrtdrLUHfQ9GtbkwLCokLom4iEpQDESGaElvOUk01K4+lx8JcocOXo8h3n 1x7cWoUUnVh3hHz5fehTYS9auuGqc/UEJ47FI8EYFb4J5LDMHxbMo2SGP2glTEfbzCcwIl OICADUp5P5D4me7OVqu/c/A6MG9369z8x5Ia98wIEb3zXKpd/XlqKTBf4JLbYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yyj2K09GNz7V; Wed, 19 Feb 2025 16:46: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 51JGk0el020455; Wed, 19 Feb 2025 16:46:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JGk0mB020453; Wed, 19 Feb 2025 16:46:00 GMT (envelope-from git) Date: Wed, 19 Feb 2025 16:46:00 GMT Message-Id: <202502191646.51JGk0mB020453@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 06016adaccca - main - ssh_config.5: Remove redundant CheckHostIP default text List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06016adaccca1958cdde4edf845f5b972be7ffc0 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=06016adaccca1958cdde4edf845f5b972be7ffc0 commit 06016adaccca1958cdde4edf845f5b972be7ffc0 Author: Ed Maste AuthorDate: 2025-01-24 21:15:22 +0000 Commit: Ed Maste CommitDate: 2025-02-19 16:45:25 +0000 ssh_config.5: Remove redundant CheckHostIP default text In 2000 (commit a95c1225217b) we changed the CheckHostIP default to "no". We added text to ssh_config(5) documenting FreeBSD's default. In 2021 OpenSSH made the same change, released with OpenSSH 8.5p1. When we imported the update the added text remained, resulting in: If the option is set to no (the default), the check will not be executed. The default is no. Remove the now-redundant text. Fixes: 206be79acbde ("Vendor import of OpenSSH 8.5p1") Sponsored by: The FreeBSD Foundation --- crypto/openssh/ssh_config.5 | 2 -- 1 file changed, 2 deletions(-) diff --git a/crypto/openssh/ssh_config.5 b/crypto/openssh/ssh_config.5 index 60b9b279d0b3..134587d3b85b 100644 --- a/crypto/openssh/ssh_config.5 +++ b/crypto/openssh/ssh_config.5 @@ -548,8 +548,6 @@ If the option is set to .Cm no (the default), the check will not be executed. -The default is -.Cm no . .It Cm Ciphers Specifies the ciphers allowed and their order of preference. Multiple ciphers must be comma-separated. From nobody Wed Feb 19 16:55:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyjF60VWRz5pc8C; Wed, 19 Feb 2025 16:55: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 4YyjF600hkz3gqV; Wed, 19 Feb 2025 16:55:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739984122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBMEGpOmwJwGL/8/NizqCICAH9uyhG7lXLOn7ms1dD0=; b=QbbjZB+goS7JYV2mmNfTeOgojcuf4UXdtBBhJZzQBlQEIqZwPTJOil/4Cih1DOX6/MmNpI hKgy7Okj5u/3lSFIkk6Dryj8TEXgZZDohWnL13O5nHEbjl62pIY2vVv2vjTK4KXrVU9bC+ e4LLWSKZUlGWp8SmONdM7snNXx5WWhePSteIW93OU/D1qUnvEj8riw0XuW0FoBpSThKtLi dN3brbcTAsi8zeBznsG55AOfOj+p9i1n1k4ontXJ1B6K/opdTbNjBoQwYuxTrfPenJ/gg6 raHztowWHhvcudyR3zx0GYzVqZ+VFlLY6jdz89cToMinl1mAcmbkqb8hhR3wgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739984122; a=rsa-sha256; cv=none; b=jwJ9zNexpJF9yeiLPW/dEZfeEwxDEtNI/4LXpbwUgcHlqAFHjdW9uD6s5RxGt+aSZMMNh5 jd8bEzaPkt0T/POSMVNAIC/sbxOrYxlxZxbfd0EbQjhebk7UiKIdQ0CBJCep0R6NuLHSS4 7aMWyNX5NxuYHo+SuvZGbAjXXPFLBbbgxcIEY8RR2v7ZzD7CpHVwQvkOTUPMfzDxlW8v+T e4PhMEk3y5UEgyNVe2MdXxBvxKdowD0ZfLHNGHe54cWDn7qH/rSY3cSImIhRPj/KUAQt3+ 0vAnzjaIamdwi9Ksm0gFkN5vud7sCzGs2ZE2Jcctls40xnrfB+WNJi40fJjAiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739984122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBMEGpOmwJwGL/8/NizqCICAH9uyhG7lXLOn7ms1dD0=; b=lkIRAzl4q5kUbYE+SZnFIY7Io8nswoVo6WUH/q8rANxXxeA8CAjJmDusKiHiwd8weSW/gr BeFRJ/59xJR+vr62fggMoX00pyBYF3LdRR02fn9Bc4WWzK99BGC9GeMErG1FyWkfDVlwuM PSRy+1SzxmSv0xqsgsm6/7Q1jLBUpkAtMhHDMlINIFmNNOEW+2F3Px6YHCYkl5qeV/cPwo 0O0TGtKYJ7EIlj/c/ALv/8xkZATW4Cyre/bxjraJ6uvk0eamvPJuYJ5oXau7LsIV918dry 2dZKcmA2hsSKrJ9PI8WocqLwX3TJuQL5ajJNNL08ZTopQvfxivllNnMu1G+0fg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyjF56Smpz1Cg7; Wed, 19 Feb 2025 16:55: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 51JGtL6E039288; Wed, 19 Feb 2025 16:55:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JGtLvS039285; Wed, 19 Feb 2025 16:55:21 GMT (envelope-from git) Date: Wed, 19 Feb 2025 16:55:21 GMT Message-Id: <202502191655.51JGtLvS039285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: ed955671d2e8 - main - libc: use __sys___realpathat directly in realpath List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ed955671d2e844f274dd8245aa3c5c7e9dcdc77a Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ed955671d2e844f274dd8245aa3c5c7e9dcdc77a commit ed955671d2e844f274dd8245aa3c5c7e9dcdc77a Author: Brooks Davis AuthorDate: 2025-02-19 16:52:04 +0000 Commit: Brooks Davis CommitDate: 2025-02-19 16:55:04 +0000 libc: use __sys___realpathat directly in realpath We don't need to use an interposable symbol for this purpose and it's simpler to just call the syscall in libsys. This resolves a bug where we were incorrectly using __realpathat in libc not libsys. While here, drop support for running on a FreeBSD 12 kernel and simplify includes. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49048 --- lib/libc/stdlib/realpath.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/libc/stdlib/realpath.c b/lib/libc/stdlib/realpath.c index 28348ea9e226..4c52b73319ab 100644 --- a/lib/libc/stdlib/realpath.c +++ b/lib/libc/stdlib/realpath.c @@ -28,21 +28,16 @@ * SUCH DAMAGE. */ -#include "namespace.h" #include #include #include #include +#include #include #include #include #include -#include "un-namespace.h" -#include "libc_private.h" - -extern int __realpathat(int fd, const char *path, char *buf, size_t size, - int flags); /* * Find the real name of path, by removing all ".", ".." and symlink @@ -224,9 +219,8 @@ __ssp_real(realpath)(const char * __restrict path, char * __restrict resolved) if (resolved == NULL) return (NULL); } - if (__getosreldate() >= 1300080) { - if (__realpathat(AT_FDCWD, path, resolved, PATH_MAX, 0) == 0) - return (resolved); + if (__sys___realpathat(AT_FDCWD, path, resolved, PATH_MAX, 0) == 0) { + return (resolved); } res = realpath1(path, resolved); if (res == NULL) From nobody Wed Feb 19 16:55:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YyjF71mvgz5pc3T; Wed, 19 Feb 2025 16: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 4YyjF70W3hz3gkc; Wed, 19 Feb 2025 16: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=1739984123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vy0nSfDhxjjAI8cAu1SBGjdBAtHhF+VR3I1+mbvASZs=; b=uFu08+Q9rQM9owx3P3//R0fATANHX4NQNWYdaa5XSa5IhepjQX4+SYGAUMFN9dJPlSHErm MUe9g/OUY5LVqBOqBvqDMDiWFRkwtG/NarsYB4eoFpOQu8k9UGvpJLduAhLWSmqnIfwyiG QLIyllcHnFZj5NSHV51SS0pUEoqLk6xSe+5oeT9rarMwEBRH9hfGvjsFuOk8DlJdxNHcmL 78OnDysznGjusV613+oRzc4m2R7KclgeH7VkIs6prQohTuIXCV+kuZcvJSu5szkqsP62hx 19GbgjiiWg8O1HGvvieFKfs3FEsksLBbDripvbXgRNip+eAXuRj4Mdv/X5lXeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739984123; a=rsa-sha256; cv=none; b=dmSGam0tmBLCBMOCgYbeg2R5RjQpk4KXmoYe+lfCCxilSo2YhjCfNAfxOvN0f689Rg2eGV 3AaB0UaP/bqgMTnjmIZytrTDFXs5xxoYRAW4HQFoeQpXRDgi6p7CcZ6YZ9ZJDy8a/c8oV+ uvZWUOMoy4rKSOAbDn9f1cOf7oNQyyX5ryfZ74JnFikKbPEJ8nOZsRACt16+TObJIY+jhb pRySrVik6HnSjjaiWQMta/k3dKBo4dHOHnF/b3QnC+kgeJEcQS12nENNRImj9ZsxfIG0nm /9ck6BOeUHbQs+c+ICALFFcE6WGZ2yPHlUPyCbBtb4cFrZVQ8bR/PKXyi0E3Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739984123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vy0nSfDhxjjAI8cAu1SBGjdBAtHhF+VR3I1+mbvASZs=; b=OuMlVST3Lx8cybuWxUIq0VkRBMlsLOi5JDiexp6Z3TbiVA4Fib6QkNXI4431KC05V8q+mQ v0wAv63c8x0L0XmIiXJkHMzEHBtpnlcrSCrbb6f3N6aV0mCm53jzzFeorilfBK5SY9nmSw nSMaYnKwzqXzO9Hq6lxBXI3/p3n6dujCetEWcecDAvRi7fEL4uIb4hQ9CE+c1lIjx9BtTd lzB1i197vpFZ5ZDe8SF4Zti84/mxKATTBRgLYiIeK2QxJUdZ9y6JrVAzp47ZDOfRVLRZRL FzqanTag/2/nJKP+dX7L7WEg1vcuAMOwsIdwjl3rbWF7a3RYosBEjedsZuXpIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YyjF675jdz1CWw; Wed, 19 Feb 2025 16:55: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 51JGtMnJ039326; Wed, 19 Feb 2025 16:55:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JGtMwO039323; Wed, 19 Feb 2025 16:55:22 GMT (envelope-from git) Date: Wed, 19 Feb 2025 16:55:22 GMT Message-Id: <202502191655.51JGtMwO039323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: fdccf0336197 - main - libsys: Don't create or expose __realpathat List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fdccf0336197afe59be6f8859177fe2ff8f87fa6 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=fdccf0336197afe59be6f8859177fe2ff8f87fa6 commit fdccf0336197afe59be6f8859177fe2ff8f87fa6 Author: Brooks Davis AuthorDate: 2025-02-19 16:53:32 +0000 Commit: Brooks Davis CommitDate: 2025-02-19 16:55:05 +0000 libsys: Don't create or expose __realpathat Previously, __realpathat was in libc and libsys (as is currently standard), but not exported from libc which meant the stub in libc was not filtered and thus libc's copy of the syscall was used. This broke an upcoming change to CheriBSD limiting syscalls to libsys. The realpath(3) implementation now uses __sys___realpathat so there are no consumers of __realpathat. Switch it to PSEUDO (only _foo and __sys_foo symbols) and remove __realpathat from Symbol.map. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49049 --- lib/libsys/Makefile.sys | 1 + lib/libsys/Symbol.map | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index b38cd5935e2f..491c765e9416 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -50,6 +50,7 @@ STATICOBJS+= interposing_table.o .endif PSEUDO= \ + __realpathat \ clock_gettime \ exit \ getlogin \ diff --git a/lib/libsys/Symbol.map b/lib/libsys/Symbol.map index 51ea1b5da231..eb71c813ae86 100644 --- a/lib/libsys/Symbol.map +++ b/lib/libsys/Symbol.map @@ -3,7 +3,6 @@ FBSDprivate_1.0 { __libsys_errno; __getosreldate; __libsys_interposing_slot; - __realpathat; _elf_aux_info; freebsd11_fstat; freebsd11_fstatat; From nobody Wed Feb 19 17:21:09 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yyjps6shPz5pd13; Wed, 19 Feb 2025 17:21: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 4Yyjps6V6cz3kwQ; Wed, 19 Feb 2025 17:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739985669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5WDSJN24dWgIhR3XLbOsZ7PQl5irjnCizXtnoMppFwo=; b=gnqfHqi6p7IGhRWVei04bbfXKZufnMFDFVtdlujC+vbReMyI6RH/wHU9yQgqPXuogCJmpi H9u8/mApYVFGdl8isqhUVH34KuuZdhE1l4F2xAIZduXvtgYbYZXi2hTW+RrZzUEheCs/vE oedUjz5HPtyMfaSvEzvrz6E3kwbtEO6bRmuigTqaWGT7dtwYyN85QADZwoPBXSYORx/CEF eTljr+6EqTCxgx1ynu6CE4M2Iv0lWmkyfisyKRvlLt+dwdo3Ozg+DlqAV2mA3is0Pm2Xba 8sgZGsgYwfIknX8QrIyHDw+fsvZnFZ3Rd8hg4TEbrAxtDbhGwLBTYVac3uWxGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739985669; a=rsa-sha256; cv=none; b=OH/pgsdTVWEf7I6Zb2nAo7d+MvIRoncBmC+iVOuUfWdoM5fq/HIr0qDmJ2g2RocdxojNAf b3CMxAOuOVR0peuadNxz5nzk/NKsbfNyGONNjKDfBySGxf/xJUcSKPenKHt7idu+S7xjK1 JmHzQ65XvJW1bYg2ivgeBiRHdRP4X+4oWtICo/fBZknu1WiIEXDu5h7gWa1MnzCnfO+Yv7 HRkSl1JBEDBr/5eupWkgdRHSx+na766f2rQOG01lDB4TQbV2R364qUD9QnML+QsOstRqQO iWyhLZQMLh9FDwUeQ2xOLgZhjjMgB2b17szOpFoM5LFxCkE58rESNnksgdrpFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739985669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5WDSJN24dWgIhR3XLbOsZ7PQl5irjnCizXtnoMppFwo=; b=ezACAMelaVZBhxFTUg2U4oyGVG+WL3FhqRxTI3ZbixM2ufJdM/7z48STXsh+R67BN5o7ou pcf17xIWdgkLQks1BUWyJbADif0goldgyqLoI0+OjMttxKQG9Rf8xpIarF/VxZsy2IEMTd 7xV6bhd4RSoLcAW3WevjYtD4ikmul3kXVKscMMhLCClOWEaEwR82CINj0qvwMEICvG4ogK 4urYEROWaAm6BRNp0kI6nW+0k4LDFnHW36ucee6h4AMULIabcvwFu8q6qB6J/4MeszxtVC 21SRP3lyqGCad+tohttm/0uX8+J70NaUNRRkwU/csPgsTPA5CsDX/+jCfBQZRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yyjps64VdzMx; Wed, 19 Feb 2025 17:21: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 51JHL9fq090251; Wed, 19 Feb 2025 17:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JHL9CT090248; Wed, 19 Feb 2025 17:21:09 GMT (envelope-from git) Date: Wed, 19 Feb 2025 17:21:09 GMT Message-Id: <202502191721.51JHL9CT090248@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0fdf8fae8b56 - main - openssh: Update to 9.8p1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0fdf8fae8b569bf9fff3b5171e669dcd7cf9c79e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0fdf8fae8b569bf9fff3b5171e669dcd7cf9c79e commit 0fdf8fae8b569bf9fff3b5171e669dcd7cf9c79e Merge: fdccf0336197 d565364dadeb Author: Ed Maste AuthorDate: 2025-02-19 17:20:44 +0000 Commit: Ed Maste CommitDate: 2025-02-19 17:20:44 +0000 openssh: Update to 9.8p1 Highlights from the release notes are reproduced below. Some security and bug fixes were previously merged into FreeBSD and have been elided. See the upstream release notes for full details (https://www.openssh.com/releasenotes.html). --- Future deprecation notice ========================= OpenSSH plans to remove support for the DSA signature algorithm in early 2025. Potentially-incompatible changes -------------------------------- * sshd(8): the server will now block client addresses that repeatedly fail authentication, repeatedly connect without ever completing authentication or that crash the server. See the discussion of PerSourcePenalties below for more information. Operators of servers that accept connections from many users, or servers that accept connections from addresses behind NAT or proxies may need to consider these settings. * sshd(8): the server has been split into a listener binary, sshd(8), and a per-session binary "sshd-session". This allows for a much smaller listener binary, as it no longer needs to support the SSH protocol. As part of this work, support for disabling privilege separation (which previously required code changes to disable) and disabling re-execution of sshd(8) has been removed. Further separation of sshd-session into additional, minimal binaries is planned for the future. * sshd(8): several log messages have changed. In particular, some log messages will be tagged with as originating from a process named "sshd-session" rather than "sshd". * ssh-keyscan(1): this tool previously emitted comment lines containing the hostname and SSH protocol banner to standard error. This release now emits them to standard output, but adds a new "-q" flag to silence them altogether. * sshd(8): (portable OpenSSH only) sshd will no longer use argv[0] as the PAM service name. A new "PAMServiceName" sshd_config(5) directive allows selecting the service name at runtime. This defaults to "sshd". bz2101 New features ------------ * sshd(8): sshd(8) will now penalise client addresses that, for various reasons, do not successfully complete authentication. This feature is controlled by a new sshd_config(5) PerSourcePenalties option and is on by default. * ssh(8): allow the HostkeyAlgorithms directive to disable the implicit fallback from certificate host key to plain host keys. Portability ----------- * sshd(8): expose SSH_AUTH_INFO_0 always to PAM auth modules unconditionally. The previous behaviour was to expose it only when particular authentication methods were in use. * ssh(1), ssh-agent(8): allow the presence of the WAYLAND_DISPLAY environment variable to enable SSH_ASKPASS, similarly to the X11 DISPLAY environment variable. GHPR479 --- Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48914 crypto/openssh/.depend | 19 +- crypto/openssh/.git_allowed_signers | 2 + crypto/openssh/.git_allowed_signers.asc | 26 +- crypto/openssh/.github/ci-status.md | 10 +- crypto/openssh/.github/configs | 3 +- crypto/openssh/.github/run_test.sh | 1 + crypto/openssh/.github/workflows/c-cpp.yml | 16 +- crypto/openssh/.github/workflows/cifuzz.yml | 4 +- crypto/openssh/.github/workflows/selfhosted.yml | 55 +- crypto/openssh/.github/workflows/upstream.yml | 18 +- crypto/openssh/.gitignore | 5 +- crypto/openssh/.skipped-commit-ids | 8 + crypto/openssh/ChangeLog | 11260 ++++++++++--------- crypto/openssh/Makefile.in | 25 +- crypto/openssh/PROTOCOL.agent | 5 +- crypto/openssh/PROTOCOL.key | 4 +- crypto/openssh/README | 2 +- crypto/openssh/addr.c | 12 +- crypto/openssh/auth-pam.c | 54 +- crypto/openssh/auth-pam.h | 2 +- crypto/openssh/auth-rhosts.c | 3 +- crypto/openssh/auth.c | 108 +- crypto/openssh/auth.h | 15 +- crypto/openssh/auth2-gss.c | 41 +- crypto/openssh/auth2-hostbased.c | 15 +- crypto/openssh/auth2-kbdint.c | 7 +- crypto/openssh/auth2-methods.c | 134 + crypto/openssh/auth2-none.c | 12 +- crypto/openssh/auth2-passwd.c | 9 +- crypto/openssh/auth2-pubkey.c | 15 +- crypto/openssh/auth2.c | 91 +- crypto/openssh/channels.c | 22 +- crypto/openssh/channels.h | 4 +- crypto/openssh/cipher.c | 4 +- crypto/openssh/clientloop.c | 73 +- crypto/openssh/clientloop.h | 3 +- crypto/openssh/config.h | 21 +- crypto/openssh/configure.ac | 40 +- crypto/openssh/contrib/redhat/openssh.spec | 3 +- crypto/openssh/contrib/suse/openssh.spec | 3 +- crypto/openssh/ed25519.sh | 4 +- crypto/openssh/kex-names.c | 330 + crypto/openssh/kex.c | 270 +- crypto/openssh/kex.h | 9 +- crypto/openssh/kexgexs.c | 4 +- crypto/openssh/log.c | 17 +- crypto/openssh/log.h | 9 +- crypto/openssh/m4/openssh.m4 | 3 + crypto/openssh/misc.c | 100 +- crypto/openssh/misc.h | 11 +- crypto/openssh/moduli | 922 +- crypto/openssh/monitor.c | 57 +- crypto/openssh/monitor.h | 6 +- crypto/openssh/monitor_wrap.c | 234 +- crypto/openssh/monitor_wrap.h | 17 +- crypto/openssh/msg.c | 5 +- crypto/openssh/openbsd-compat/getrrsetbyname.c | 24 +- crypto/openssh/openbsd-compat/port-linux.c | 98 +- crypto/openssh/openbsd-compat/port-linux.h | 5 + crypto/openssh/packet.c | 92 + crypto/openssh/packet.h | 5 +- crypto/openssh/pathnames.h | 7 +- crypto/openssh/platform-listen.c | 84 + crypto/openssh/platform.c | 49 +- crypto/openssh/platform.h | 1 + crypto/openssh/readconf.c | 4 +- crypto/openssh/readpass.c | 9 +- crypto/openssh/regress/Makefile | 6 +- crypto/openssh/regress/cfgmatchlisten.sh | 2 +- crypto/openssh/regress/dropbear-ciphers.sh | 15 +- crypto/openssh/regress/dropbear-kex.sh | 14 +- crypto/openssh/regress/key-options.sh | 2 +- .../regress/misc/fuzz-harness/agent_fuzz_helper.c | 1 - .../openssh/regress/misc/fuzz-harness/kex_fuzz.cc | 8 +- .../openssh/regress/misc/fuzz-harness/sig_fuzz.cc | 8 +- crypto/openssh/regress/penalty-expire.sh | 35 + crypto/openssh/regress/penalty.sh | 52 + crypto/openssh/regress/percent.sh | 5 - crypto/openssh/regress/rekey.sh | 4 +- crypto/openssh/regress/sftp-cmds.sh | 29 +- crypto/openssh/regress/test-exec.sh | 96 +- crypto/openssh/regress/unittests/kex/Makefile | 3 +- crypto/openssh/regress/unittests/kex/test_kex.c | 6 +- crypto/openssh/regress/yes-head.sh | 2 +- crypto/openssh/scp.c | 4 +- crypto/openssh/servconf.c | 283 +- crypto/openssh/servconf.h | 34 +- crypto/openssh/serverloop.c | 50 +- crypto/openssh/session.c | 51 +- crypto/openssh/sftp-client.c | 4 +- crypto/openssh/sftp-server.c | 10 +- crypto/openssh/sftp.c | 8 +- crypto/openssh/srclimit.c | 396 +- crypto/openssh/srclimit.h | 22 +- crypto/openssh/ssh-add.1 | 12 +- crypto/openssh/ssh-gss.h | 3 +- crypto/openssh/ssh-keygen.1 | 20 +- crypto/openssh/ssh-keyscan.1 | 21 +- crypto/openssh/ssh-keyscan.c | 76 +- crypto/openssh/ssh-keysign.8 | 6 +- crypto/openssh/ssh-keysign.c | 4 +- crypto/openssh/ssh-pkcs11.c | 27 +- crypto/openssh/ssh-sk-helper.0 | 34 + crypto/openssh/ssh.1 | 25 +- crypto/openssh/ssh_api.c | 17 +- crypto/openssh/ssh_config.5 | 20 +- crypto/openssh/ssh_namespace.h | 27 +- crypto/openssh/sshconnect.c | 34 +- crypto/openssh/sshconnect.h | 6 +- crypto/openssh/sshconnect2.c | 4 +- crypto/openssh/sshd-session.c | 1505 +++ crypto/openssh/sshd.8 | 9 +- crypto/openssh/sshd.c | 1711 +-- crypto/openssh/sshd_config.5 | 110 +- crypto/openssh/sshkey.h | 3 +- crypto/openssh/version.h | 4 +- secure/lib/libssh/Makefile | 2 +- secure/libexec/Makefile | 2 +- secure/libexec/sshd-session/Makefile | 66 + secure/usr.sbin/sshd/Makefile | 48 +- 120 files changed, 10945 insertions(+), 8531 deletions(-) diff --cc crypto/openssh/.gitignore index 7fccc6fe3dc3,000000000000..41d505c46dde mode 100644,000000..100644 --- a/crypto/openssh/.gitignore +++ b/crypto/openssh/.gitignore @@@ -1,38 -1,0 +1,35 @@@ +Makefile +buildpkg.sh +config.h - config.h.in +config.h.in~ +config.log +config.status - configure - aclocal.m4 +openbsd-compat/Makefile +openbsd-compat/regress/Makefile +openssh.xml +opensshd.init +survey.sh - **/*.0 +**/*.o +**/*.lo +**/*.so +**/*.out +**/*.a +**/*.un~ +**/.*.swp +autom4te.cache/ +scp +sftp +sftp-server +ssh +ssh-add +ssh-agent +ssh-keygen +ssh-keyscan +ssh-keysign +ssh-pkcs11-helper +ssh-sk-helper +sshd +!regress/misc/fuzz-harness/Makefile +!regress/unittests/sshsig/Makefile +tags ++ diff --cc crypto/openssh/auth-pam.c index cf7a661a7daa,13c0a792e99e..f95f6abbcbe0 --- a/crypto/openssh/auth-pam.c +++ b/crypto/openssh/auth-pam.c @@@ -105,7 -100,7 +100,8 @@@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" + #include "srclimit.h" +#include "blacklist_client.h" extern ServerOptions options; extern struct sshbuf *loginmsg; diff --cc crypto/openssh/auth.c index f390df839d62,000000000000..059104f26688 mode 100644,000000..100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@@ -1,879 -1,0 +1,785 @@@ - /* $OpenBSD: auth.c,v 1.160 2023/03/05 05:34:09 dtucker Exp $ */ ++/* $OpenBSD: auth.c,v 1.161 2024/05/17 00:30:23 djm Exp $ */ +/* + * Copyright (c) 2000 Markus Friedl. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 "includes.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#ifdef HAVE_PATHS_H +# include +#endif +#include +#ifdef HAVE_LOGIN_H +#include +#endif +#ifdef USE_SHADOW +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "xmalloc.h" +#include "match.h" +#include "groupaccess.h" +#include "log.h" +#include "sshbuf.h" +#include "misc.h" +#include "servconf.h" +#include "sshkey.h" +#include "hostfile.h" +#include "auth.h" +#include "auth-options.h" +#include "canohost.h" +#include "uidswap.h" +#include "packet.h" +#include "loginrec.h" +#ifdef GSSAPI +#include "ssh-gss.h" +#endif +#include "authfile.h" +#include "monitor_wrap.h" +#include "ssherr.h" +#include "channels.h" +#include "blacklist_client.h" + +/* import */ +extern ServerOptions options; +extern struct include_list includes; - extern int use_privsep; +extern struct sshbuf *loginmsg; +extern struct passwd *privsep_pw; +extern struct sshauthopt *auth_opts; + +/* Debugging messages */ +static struct sshbuf *auth_debug; + +/* + * Check if the user is allowed to log in via ssh. If user is listed + * in DenyUsers or one of user's groups is listed in DenyGroups, false + * will be returned. If AllowUsers isn't empty and user isn't listed + * there, or if AllowGroups isn't empty and one of user's groups isn't + * listed there, false will be returned. + * If the user's shell is not executable, false will be returned. + * Otherwise true is returned. + */ +int +allowed_user(struct ssh *ssh, struct passwd * pw) +{ + struct stat st; + const char *hostname = NULL, *ipaddr = NULL; + u_int i; + int r; + + /* Shouldn't be called if pw is NULL, but better safe than sorry... */ + if (!pw || !pw->pw_name) + return 0; + + if (!options.use_pam && platform_locked_account(pw)) { + logit("User %.100s not allowed because account is locked", + pw->pw_name); + return 0; + } + + /* + * Deny if shell does not exist or is not executable unless we + * are chrooting. + */ + if (options.chroot_directory == NULL || + strcasecmp(options.chroot_directory, "none") == 0) { + char *shell = xstrdup((pw->pw_shell[0] == '\0') ? + _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ + + if (stat(shell, &st) == -1) { + logit("User %.100s not allowed because shell %.100s " + "does not exist", pw->pw_name, shell); + free(shell); + return 0; + } + if (S_ISREG(st.st_mode) == 0 || + (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) { + logit("User %.100s not allowed because shell %.100s " + "is not executable", pw->pw_name, shell); + free(shell); + return 0; + } + free(shell); + } + + if (options.num_deny_users > 0 || options.num_allow_users > 0 || + options.num_deny_groups > 0 || options.num_allow_groups > 0) { + hostname = auth_get_canonical_hostname(ssh, options.use_dns); + ipaddr = ssh_remote_ipaddr(ssh); + } + + /* Return false if user is listed in DenyUsers */ + if (options.num_deny_users > 0) { + for (i = 0; i < options.num_deny_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.deny_users[i]); + if (r < 0) { + fatal("Invalid DenyUsers pattern \"%.100s\"", + options.deny_users[i]); + } else if (r != 0) { + logit("User %.100s from %.100s not allowed " + "because listed in DenyUsers", + pw->pw_name, hostname); + return 0; + } + } + } + /* Return false if AllowUsers isn't empty and user isn't listed there */ + if (options.num_allow_users > 0) { + for (i = 0; i < options.num_allow_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.allow_users[i]); + if (r < 0) { + fatal("Invalid AllowUsers pattern \"%.100s\"", + options.allow_users[i]); + } else if (r == 1) + break; + } + /* i < options.num_allow_users iff we break for loop */ + if (i >= options.num_allow_users) { + logit("User %.100s from %.100s not allowed because " + "not listed in AllowUsers", pw->pw_name, hostname); + return 0; + } + } + if (options.num_deny_groups > 0 || options.num_allow_groups > 0) { + /* Get the user's group access list (primary and supplementary) */ + if (ga_init(pw->pw_name, pw->pw_gid) == 0) { + logit("User %.100s from %.100s not allowed because " + "not in any group", pw->pw_name, hostname); + return 0; + } + + /* Return false if one of user's groups is listed in DenyGroups */ + if (options.num_deny_groups > 0) + if (ga_match(options.deny_groups, + options.num_deny_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because a group is listed in DenyGroups", + pw->pw_name, hostname); + return 0; + } + /* + * Return false if AllowGroups isn't empty and one of user's groups + * isn't listed there + */ + if (options.num_allow_groups > 0) + if (!ga_match(options.allow_groups, + options.num_allow_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because none of user's groups are listed " + "in AllowGroups", pw->pw_name, hostname); + return 0; + } + ga_free(); + } + +#ifdef CUSTOM_SYS_AUTH_ALLOWED_USER + if (!sys_auth_allowed_user(pw, loginmsg)) + return 0; +#endif + + /* We found no reason not to let this user try to log on... */ + return 1; +} + +/* + * Formats any key left in authctxt->auth_method_key for inclusion in + * auth_log()'s message. Also includes authxtct->auth_method_info if present. + */ +static char * +format_method_key(Authctxt *authctxt) +{ + const struct sshkey *key = authctxt->auth_method_key; + const char *methinfo = authctxt->auth_method_info; + char *fp, *cafp, *ret = NULL; + + if (key == NULL) + return NULL; + + if (sshkey_is_cert(key)) { + fp = sshkey_fingerprint(key, + options.fingerprint_hash, SSH_FP_DEFAULT); + cafp = sshkey_fingerprint(key->cert->signature_key, + options.fingerprint_hash, SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s ID %s (serial %llu) CA %s %s%s%s", + sshkey_type(key), fp == NULL ? "(null)" : fp, + key->cert->key_id, + (unsigned long long)key->cert->serial, + sshkey_type(key->cert->signature_key), + cafp == NULL ? "(null)" : cafp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + free(cafp); + } else { + fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s%s%s", sshkey_type(key), + fp == NULL ? "(null)" : fp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + } + return ret; +} + +void +auth_log(struct ssh *ssh, int authenticated, int partial, + const char *method, const char *submethod) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + int level = SYSLOG_LEVEL_VERBOSE; + const char *authmsg; + char *extra = NULL; + - if (use_privsep && !mm_is_monitor() && !authctxt->postponed) ++ if (!mm_is_monitor() && !authctxt->postponed) + return; + + /* Raise logging level */ + if (authenticated == 1 || + !authctxt->valid || + authctxt->failures >= options.max_authtries / 2 || + strcmp(method, "password") == 0) + level = SYSLOG_LEVEL_INFO; + + if (authctxt->postponed) + authmsg = "Postponed"; + else if (partial) + authmsg = "Partial"; + else { + authmsg = authenticated ? "Accepted" : "Failed"; + if (authenticated) + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); + } + + if ((extra = format_method_key(authctxt)) == NULL) { + if (authctxt->auth_method_info != NULL) + extra = xstrdup(authctxt->auth_method_info); + } + + do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s", + authmsg, + method, + submethod != NULL ? "/" : "", submethod == NULL ? "" : submethod, + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), + extra != NULL ? ": " : "", + extra != NULL ? extra : ""); + + free(extra); + +#if defined(CUSTOM_FAILED_LOGIN) || defined(SSH_AUDIT_EVENTS) + if (authenticated == 0 && !(authctxt->postponed || partial)) { + /* Log failed login attempt */ +# ifdef CUSTOM_FAILED_LOGIN + if (strcmp(method, "password") == 0 || + strncmp(method, "keyboard-interactive", 20) == 0 || + strcmp(method, "challenge-response") == 0) + record_failed_login(ssh, authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +# endif +# ifdef SSH_AUDIT_EVENTS + audit_event(ssh, audit_classify_auth(method)); +# endif + } +#endif +#if defined(CUSTOM_FAILED_LOGIN) && defined(WITH_AIXAUTHENTICATE) + if (authenticated) + sys_auth_record_login(authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh", + loginmsg); +#endif +} + +void +auth_maxtries_exceeded(struct ssh *ssh) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + + error("maximum authentication attempts exceeded for " + "%s%.100s from %.200s port %d ssh2", + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh)); + ssh_packet_disconnect(ssh, "Too many authentication failures"); + /* NOTREACHED */ +} + +/* + * Check whether root logins are disallowed. + */ +int +auth_root_allowed(struct ssh *ssh, const char *method) +{ + switch (options.permit_root_login) { + case PERMIT_YES: + return 1; + case PERMIT_NO_PASSWD: + if (strcmp(method, "publickey") == 0 || + strcmp(method, "hostbased") == 0 || + strcmp(method, "gssapi-with-mic") == 0) + return 1; + break; + case PERMIT_FORCED_ONLY: + if (auth_opts->force_command != NULL) { + logit("Root login accepted for forced command."); + return 1; + } + break; + } + logit("ROOT LOGIN REFUSED FROM %.200s port %d", + ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); + return 0; +} + + +/* + * Given a template and a passwd structure, build a filename + * by substituting % tokenised options. Currently, %% becomes '%', + * %h becomes the home directory and %u the username. + * + * This returns a buffer allocated by xmalloc. + */ +char * +expand_authorized_keys(const char *filename, struct passwd *pw) +{ + char *file, uidstr[32], ret[PATH_MAX]; + int i; + + snprintf(uidstr, sizeof(uidstr), "%llu", + (unsigned long long)pw->pw_uid); + file = percent_expand(filename, "h", pw->pw_dir, + "u", pw->pw_name, "U", uidstr, (char *)NULL); + + /* + * Ensure that filename starts anchored. If not, be backward + * compatible and prepend the '%h/' + */ + if (path_absolute(file)) + return (file); + + i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file); + if (i < 0 || (size_t)i >= sizeof(ret)) + fatal("expand_authorized_keys: path too long"); + free(file); + return (xstrdup(ret)); +} + +char * +authorized_principals_file(struct passwd *pw) +{ + if (options.authorized_principals_file == NULL) + return NULL; + return expand_authorized_keys(options.authorized_principals_file, pw); +} + +/* return ok if key exists in sysfile or userfile */ +HostStatus +check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host, + const char *sysfile, const char *userfile) +{ + char *user_hostfile; + struct stat st; + HostStatus host_status; + struct hostkeys *hostkeys; + const struct hostkey_entry *found; + + hostkeys = init_hostkeys(); + load_hostkeys(hostkeys, host, sysfile, 0); + if (userfile != NULL) { + user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); + if (options.strict_modes && + (stat(user_hostfile, &st) == 0) && + ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || + (st.st_mode & 022) != 0)) { + logit("Authentication refused for %.100s: " + "bad owner or modes for %.200s", + pw->pw_name, user_hostfile); + auth_debug_add("Ignored %.200s: bad ownership or modes", + user_hostfile); + } else { + temporarily_use_uid(pw); + load_hostkeys(hostkeys, host, user_hostfile, 0); + restore_uid(); + } + free(user_hostfile); + } + host_status = check_key_in_hostkeys(hostkeys, key, &found); + if (host_status == HOST_REVOKED) + error("WARNING: revoked key for %s attempted authentication", + host); + else if (host_status == HOST_OK) + debug_f("key for %s found at %s:%ld", + found->host, found->file, found->line); + else + debug_f("key for host %s not found", host); + + free_hostkeys(hostkeys); + + return host_status; +} + +struct passwd * +getpwnamallow(struct ssh *ssh, const char *user) +{ +#ifdef HAVE_LOGIN_CAP + extern login_cap_t *lc; +#ifdef HAVE_AUTH_HOSTOK + const char *from_host, *from_ip; +#endif +#ifdef BSD_AUTH + auth_session_t *as; +#endif +#endif + struct passwd *pw; + struct connection_info *ci; + u_int i; + - ci = get_connection_info(ssh, 1, options.use_dns); ++ ci = server_get_connection_info(ssh, 1, options.use_dns); + ci->user = user; + parse_server_match_config(&options, &includes, ci); + log_change_level(options.log_level); + log_verbose_reset(); + for (i = 0; i < options.num_log_verbose; i++) + log_verbose_add(options.log_verbose[i]); - process_permitopen(ssh, &options); ++ server_process_permitopen(ssh); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_setauthdb(user); +#endif + + pw = getpwnam(user); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_restoreauthdb(); +#endif + if (pw == NULL) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); + logit("Invalid user %.100s from %.100s port %d", + user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); +#ifdef CUSTOM_FAILED_LOGIN + record_failed_login(ssh, user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +#endif +#ifdef SSH_AUDIT_EVENTS + audit_event(ssh, SSH_INVALID_USER); +#endif /* SSH_AUDIT_EVENTS */ + return (NULL); + } + if (!allowed_user(ssh, pw)) + return (NULL); +#ifdef HAVE_LOGIN_CAP + if ((lc = login_getpwclass(pw)) == NULL) { + debug("unable to get login class: %s", user); + return (NULL); + } +#ifdef HAVE_AUTH_HOSTOK + from_host = auth_get_canonical_hostname(ssh, options.use_dns); + from_ip = ssh_remote_ipaddr(ssh); + if (!auth_hostok(lc, from_host, from_ip)) { + debug("Denied connection for %.200s from %.200s [%.200s].", + pw->pw_name, from_host, from_ip); + return (NULL); + } +#endif /* HAVE_AUTH_HOSTOK */ +#ifdef HAVE_AUTH_TIMEOK + if (!auth_timeok(lc, time(NULL))) { + debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name); + return (NULL); + } +#endif /* HAVE_AUTH_TIMEOK */ +#ifdef BSD_AUTH + if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || + auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { + debug("Approval failure for %s", user); + pw = NULL; + } + if (as != NULL) + auth_close(as); +#endif +#endif + if (pw != NULL) + return (pwcopy(pw)); + return (NULL); +} + +/* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ +int +auth_key_is_revoked(struct sshkey *key) +{ + char *fp = NULL; + int r; + + if (options.revoked_keys_file == NULL) + return 0; + if ((fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT)) == NULL) { + r = SSH_ERR_ALLOC_FAIL; + error_fr(r, "fingerprint key"); + goto out; + } + + r = sshkey_check_revoked(key, options.revoked_keys_file); + switch (r) { + case 0: + break; /* not revoked */ + case SSH_ERR_KEY_REVOKED: + error("Authentication key %s %s revoked by file %s", + sshkey_type(key), fp, options.revoked_keys_file); + goto out; + default: + error_r(r, "Error checking authentication key %s %s in " + "revoked keys file %s", sshkey_type(key), fp, + options.revoked_keys_file); + goto out; + } + + /* Success */ + r = 0; + + out: + free(fp); + return r == 0 ? 0 : 1; +} + +void +auth_debug_add(const char *fmt,...) +{ + char buf[1024]; + va_list args; + int r; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + debug3("%s", buf); + if (auth_debug != NULL) + if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0) + fatal_fr(r, "sshbuf_put_cstring"); +} + +void +auth_debug_send(struct ssh *ssh) +{ + char *msg; + int r; + + if (auth_debug == NULL) + return; + while (sshbuf_len(auth_debug) != 0) { + if ((r = sshbuf_get_cstring(auth_debug, &msg, NULL)) != 0) + fatal_fr(r, "sshbuf_get_cstring"); + ssh_packet_send_debug(ssh, "%s", msg); + free(msg); + } +} + +void +auth_debug_reset(void) +{ + if (auth_debug != NULL) + sshbuf_reset(auth_debug); + else if ((auth_debug = sshbuf_new()) == NULL) + fatal_f("sshbuf_new failed"); +} + +struct passwd * +fakepw(void) +{ + static int done = 0; + static struct passwd fake; + const char hashchars[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz0123456789"; /* from bcrypt.c */ + char *cp; + + if (done) + return (&fake); + + memset(&fake, 0, sizeof(fake)); + fake.pw_name = "NOUSER"; + fake.pw_passwd = xstrdup("$2a$10$" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + for (cp = fake.pw_passwd + 7; *cp != '\0'; cp++) + *cp = hashchars[arc4random_uniform(sizeof(hashchars) - 1)]; +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + fake.pw_gecos = "NOUSER"; +#endif + fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; + fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + fake.pw_class = ""; +#endif + fake.pw_dir = "/nonexist"; + fake.pw_shell = "/nonexist"; + done = 1; + + return (&fake); +} + - /* - * Returns the remote DNS hostname as a string. The returned string must not - * be freed. NB. this will usually trigger a DNS query the first time it is - * called. - * This function does additional checks on the hostname to mitigate some - * attacks on based on conflation of hostnames and IP addresses. - */ - - static char * - remote_hostname(struct ssh *ssh) - { - struct sockaddr_storage from; - socklen_t fromlen; - struct addrinfo hints, *ai, *aitop; - char name[NI_MAXHOST], ntop2[NI_MAXHOST]; - const char *ntop = ssh_remote_ipaddr(ssh); - - /* Get IP address of client. */ - fromlen = sizeof(from); - memset(&from, 0, sizeof(from)); - if (getpeername(ssh_packet_get_connection_in(ssh), - (struct sockaddr *)&from, &fromlen) == -1) { - debug("getpeername failed: %.100s", strerror(errno)); - return xstrdup(ntop); - } - - ipv64_normalise_mapped(&from, &fromlen); - if (from.ss_family == AF_INET6) - fromlen = sizeof(struct sockaddr_in6); - - debug3("Trying to reverse map address %.100s.", ntop); - /* Map the IP address to a host name. */ - if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), - NULL, 0, NI_NAMEREQD) != 0) { - /* Host name not found. Use ip address. */ - return xstrdup(ntop); - } - - /* - * if reverse lookup result looks like a numeric hostname, - * someone is trying to trick us by PTR record like following: - * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5 - */ - memset(&hints, 0, sizeof(hints)); - hints.ai_socktype = SOCK_DGRAM; /*dummy*/ - hints.ai_flags = AI_NUMERICHOST; - if (getaddrinfo(name, NULL, &hints, &ai) == 0) { - logit("Nasty PTR record \"%s\" is set up for %s, ignoring", *** 18231 LINES SKIPPED *** From nobody Wed Feb 19 17:35:00 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yyk6t6wclz5nQKv; Wed, 19 Feb 2025 17:35:02 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yyk6t6Bf7z3mh1; Wed, 19 Feb 2025 17:35:02 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739986502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CEtxL02QwYHkQx7I8GWag7p3vA3uAaXYWwVsE2eyp6Q=; b=uC7hcmcffAxFBzq1NgA5jc1KV3Jxk+oZGew4bwhUo3X+F9W+G/syfg4DGNC55QBqT3XuOa gdEFKq4yWIvol1NcQs8TGHzS+U1kWh1u3w7US9y6yV7wGSIqv+ksj8U84XzHwhWdyCNYEA 2bdvrSec1udvqq+eDNQxsfmPJSp5k7K/cwEpVhYW453+v7mh1Jsrr+SLakDnu7HbwjdOF+ NCUx+4GiRvs54RpWXH98BAH/3YHet6B0M1UDY1SSivKZDQ8Vff1IR84js1DmlsAcb/uvFY us31zz50sk8+fHGlp/c2HCpXpRYs8jBfYy1UywbVSdg+HHHVoQUN+JhbKz0fdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739986502; a=rsa-sha256; cv=none; b=m13Pg6HS57RXr6xsb8PvFTZ0f1IHJZrk4cT2D78W8kJdorP3ytpwpOw4ygFF0MxTIZ3AE+ 4qariS/OfkbGk2EqqFi6dEXo9b980rYPBbMOIJCna1aXhe2iv5n/bY65vkWOh/+Rwvo7GB Ybetx0UuZv4ASzj9y2UBWrDVGp1dqWpqGSU1QUGSJeQAwFkQ8tacWAs6GkOZyxZSSTrmX8 36Vh8EzjnGtsDotTldi6lstmIo61MNWPyMLYTYcP0AupzH+iPEczVzSxL/2nhSTGz2L7U4 V8QmRf2I1rTE5mE2vay+9IoNBL90qz1j+cS1goTEgT0zS00s0jtxf1YpZ8NWdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739986502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CEtxL02QwYHkQx7I8GWag7p3vA3uAaXYWwVsE2eyp6Q=; b=IZ5RCiBPXIWQaI5NRMsqy/AJCAsPzrvokvPxYe6byDK7ZW/jGK+X8LqlAKUXcQryCAD/yf 9SJkCKkLoLeA9V57LeWtxyHtYk5X/y+9IoC1iAIBA5xOC0cL3OTZdQXba5jkhRgBIYn+ik L4zGGWLO93NkX0wfzLfmP99qqvOfWprax/0gJzHLv/W8QuS/Cr7Sc3s8DPiz4vMm05ROBf C+AW2ZP+c35jL9e/0wV8w3cXUtoevN1C4hEj1Om2B76NGKlnMj6RTg6wP3Q5JQsOq1tUT3 GP2JkoovSrMqKBH9coO9yzkJtcv+c1dx72u8RSfeD2Uawh7maWFLYdiIupmtjw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Yyk6t0xj5zBs0; Wed, 19 Feb 2025 17:35:02 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 19 Feb 2025 09:35:00 -0800 From: Gleb Smirnoff To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin Message-ID: References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> On Wed, Feb 19, 2025 at 02:57:27AM +0000, Bjoern A. Zeeb wrote: B> commit 61ce422531805307d413bf04c9ad1aabd7f3a879 B> Author: Bjoern A. Zeeb B> AuthorDate: 2025-02-19 02:50:11 +0000 B> Commit: Bjoern A. Zeeb B> CommitDate: 2025-02-19 02:56:59 +0000 B> B> wlanstats: move from tools to usr.sbin B> B> wlanstats is an incredible tool to get a quick overview of state B> of affairs of wireless by looking at the counters. B> And it makes it simple. B> B> Having landed the LinuxKPI HW_CRYPTO bits I was asked by users B> what to check and I realised the answer is in wlanstats. B> B> It is annoying even as a developer to manually build it for each B> installation but given it's also useful to users and support B> make it available with the general installation. B> Probably very long overdue. B> B> Adjust the Makefile and make build again on main. B> Hook it up to the build conditional on MK_WIRELESS. B> B> Discussed with: adrian B> Sponsored by: The FreeBSD Foundation B> TODO: man page Please let's not create a precedent of a new utility without a manual page. Better one with grammar mistakes and terse than nothing. This takes less than 15 minutes. Please, fill this gap. -- Gleb Smirnoff From nobody Wed Feb 19 17:39:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YykDF3X47z5nQhW; Wed, 19 Feb 2025 17:39: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 4YykDF2Dx1z3mtf; Wed, 19 Feb 2025 17:39:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739986781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=txGesk9qilWsegSRvRrzPHfVP7CukaJn5K3S5iDCk6k=; b=ywY00/2Q2ziuiYjT+/rSExRTLfRyCTCXIU0iIJf23MGduIij/mPnoJeaC+zz5aJj+XRm6h V0230djEuxARyMG8twf7PWzgvT6CmTLzqWMsiF0NV3/q3Nw7FI5rNZxHe+6Mz/cGmlHrTe 6rV7dZO1bfKghhSHpdg/snEeGlzO8e8NrhuixwPWRtNCFmf7Yu6/Osa/RiMs+pC2RpHvBC xUmiMqKRTdXqo3qPDDpGlCZc8rht0Okv8URcsDJxixhw1fMZKtbCq8eNoEg/pKrMWobx46 Nu4DK92R4ILKLRr7zjMNciILfQp7ONgFXnt2+RqXJMAYp12kkK6vCfx/yu/oHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739986781; a=rsa-sha256; cv=none; b=opu4sOv+/aGRgJh2A+LdooqmH0VH9UnpmvJEpW8Bl2VwNfTaiDFMVGFmES2JG1gGttGgW2 X7JxnQItN/w5o6HuPScd1JtmUNPQCiU4WX35iLBWo4Rg5c+l/wXFU1LdDwkcfIWq3Eql+y +41h/Uc8Pj8AXU4OYXaCfahvlHwI2I6wAcZY4W1HLu1sajGwwVJ8h/flRmlZPISUT2/qF2 9zad5AS+mMgUlqsG7/ezv9uopCGoZt0Yfpfh63rqA810MxaDQg9cTQ6A/fiR7sII7QneQM V+he/ypZ+CUhgua57x1Z8P635xfRl8zUbDasChkbf8jvcQdgIrNoQ5B3uSkG+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=1739986781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=txGesk9qilWsegSRvRrzPHfVP7CukaJn5K3S5iDCk6k=; b=K770JyfGsiYD91/GAJ5eF3kL3mdHH4RAtTYU77+5+m2YtiwxvMN/8xXwY7avRqCo/SqCa1 aZb1jwiUkBG4RfI8RzgwcsgDJrAsU7sZmONs/UcTXZdTtEvDu8FtGRIJF/5TeIgxyNL7pn 8qeOUUAh3bvKAILDtX1QVvoykYcQAmw+VjHkBiSfBxRBwrcl7A6MJa1Ct/wzVhRc6rwbJB uMiNNTE97QW4ZUh+OoDKG1IwulXA8pNQSBs3GeRBN0qsyXGwys/eGU+Sp4uVfvm9itITj/ M9h5XHMaw31DokQQmBY6D4dCfnf9FZhqGrWatO+DQt6Gmb8tc/9jVoTMjT2waQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YykDF1r3Hz1Ml; Wed, 19 Feb 2025 17:39: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 51JHdfPg016913; Wed, 19 Feb 2025 17:39:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JHdfLZ016910; Wed, 19 Feb 2025 17:39:41 GMT (envelope-from git) Date: Wed, 19 Feb 2025 17:39:41 GMT Message-Id: <202502191739.51JHdfLZ016910@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b4bb480ae929 - main - ssh: Remove unintended XAUTH_PATH setting List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4bb480ae9294d7e4b375f0ead9ae57517c79ef3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b4bb480ae9294d7e4b375f0ead9ae57517c79ef3 commit b4bb480ae9294d7e4b375f0ead9ae57517c79ef3 Author: Ed Maste AuthorDate: 2025-02-19 17:37:09 +0000 Commit: Ed Maste CommitDate: 2025-02-19 17:39:17 +0000 ssh: Remove unintended XAUTH_PATH setting This crept in while rebasing the OpenSSH 9.8p1 update across a63701848fe5 ("ssh: Move XAUTH_PATH setting to ssh.mk"). Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") Sponsored by: The FreeBSD Foundation --- secure/libexec/sshd-session/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/secure/libexec/sshd-session/Makefile b/secure/libexec/sshd-session/Makefile index 2461962f00e2..e365b0c53dde 100644 --- a/secure/libexec/sshd-session/Makefile +++ b/secure/libexec/sshd-session/Makefile @@ -57,10 +57,6 @@ LIBADD+= wrap LIBADD+= crypto -.if defined(LOCALBASE) -CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" -.endif - .include .PATH: ${SSHDIR} From nobody Wed Feb 19 17:40:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YykDm1jDLz5nQP7; Wed, 19 Feb 2025 17:40:08 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YykDm0vwpz3n9B; Wed, 19 Feb 2025 17:40:08 +0000 (UTC) (envelope-from bz@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739986808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ot0KU9duE4HtKRHiS+palNgOSnfTHIFxkfWNyIlye2Y=; b=JGd1gPoDyuNTVnN67jOey0hXwk7Cy7et9KH/xKgmBjEEknUZdNwU95W1+S2FJKiJR0OUS4 HcoJipqoXXv2LGmHoRAG6fw6tnJDHgffF4UsD7drJf56V0I7cRtMOcdnV4G+gGUmMZ0n11 uv0qcE/iNT9olSoaaXqdgtghpl1GAKBjJW5NZ+fKvMg8G7RpMg3rEqXO7tkbFd3d3ffduf DMu0eEzurOa6G2184Qhm7slHjdppApCWToYu1rHmyZX0WgIWwHkHe/4m7/QTKSEPhAklT3 vnwr95ZUjrDw9m8z7DOn0gnDYNqftKk+2339SMdF/6o5m2gtpRLYg2L/wIuRWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739986808; a=rsa-sha256; cv=none; b=wKiEA5CktWy2WM14LZTW+t8Ueg1Lo1CVVxKUMN2RUMIxYTSQo/rKcnhZyCSPKhB6yez8gR P+Yy/hHHJTazJqOLYpTm8bD5Qs79S7KFE7R6wyi/Je/CTtKUt0Abp31xLfMPCJiKHDSdqN CPl88Vg5iNTJz/2KVHLcghsrLuQsTjFnArRYG8sUrexEC0hm+D4xLWDJEYx0x+v3gRg37w VMduCuIr16vTNqYa5iTlbrzBX83O+obgE3/JbQMoA0K9m2+nLk7Uypf++6Z5xX7++qS1Wd ZHEQyTaRIsV64GpLtVLrvvYwa0CTSNtOTPxYZ5//EkWDm5/E2UbcE9euI/sjMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739986808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ot0KU9duE4HtKRHiS+palNgOSnfTHIFxkfWNyIlye2Y=; b=gG12trA3MGjxlxQqDR4Ze17ScsjG0HfxYDTYu5Bs/lNMoAGWqUg7A5OgwgxE0Ad3wO5yXW RZJZma+jG5dsZpWwmyKOW5MvcAUSoQ8DuqN93zjLGrA9loYme39i21gVs5gGnFHfMCoxvG JGRGq0rcxd55IT5HWRawgVihUwJsSvaxGNl8JlxcTuIXMepkZ6vlin7qdg3sno28r+XfRw xPpgg663OiRFKjZJNBIawNGYHoJwZAi+DKLiR2zi+KZIK7d2jZQziVFxYqjCoFa3+JWuYl AEuepu3cseiMP3/G8o16OXITAYHV8UF2Sxr6Crjh1SHspsTvnVBcgb1FHMfYQQ== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YykDl6TRkzBs1; Wed, 19 Feb 2025 17:40:07 +0000 (UTC) (envelope-from bz@freebsd.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 02409A64806; Wed, 19 Feb 2025 17:40:04 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 180AA2D029D8; Wed, 19 Feb 2025 17:40:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id SR_kLzG0vA9p; Wed, 19 Feb 2025 17:40:05 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 170BC2D029E0; Wed, 19 Feb 2025 17:40:05 +0000 (UTC) Date: Wed, 19 Feb 2025 17:40:04 +0000 (UTC) From: "Bjoern A. Zeeb" To: Gleb Smirnoff cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin In-Reply-To: Message-ID: References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 19 Feb 2025, Gleb Smirnoff wrote: > On Wed, Feb 19, 2025 at 02:57:27AM +0000, Bjoern A. Zeeb wrote: > B> commit 61ce422531805307d413bf04c9ad1aabd7f3a879 > B> Author: Bjoern A. Zeeb > B> AuthorDate: 2025-02-19 02:50:11 +0000 > B> Commit: Bjoern A. Zeeb > B> CommitDate: 2025-02-19 02:56:59 +0000 > B> > B> wlanstats: move from tools to usr.sbin > B> > B> wlanstats is an incredible tool to get a quick overview of state > B> of affairs of wireless by looking at the counters. > B> And it makes it simple. > B> > B> Having landed the LinuxKPI HW_CRYPTO bits I was asked by users > B> what to check and I realised the answer is in wlanstats. > B> > B> It is annoying even as a developer to manually build it for each > B> installation but given it's also useful to users and support > B> make it available with the general installation. > B> Probably very long overdue. > B> > B> Adjust the Makefile and make build again on main. > B> Hook it up to the build conditional on MK_WIRELESS. > B> > B> Discussed with: adrian > B> Sponsored by: The FreeBSD Foundation > B> TODO: man page > > Please let's not create a precedent of a new utility without > a manual page. Better one with grammar mistakes and terse > than nothing. Better one that #manpage has reviewed than anything else. > This takes less than 15 minutes. Please, fill > this gap. I will; otherwise I wouldn't have mentioned it and just moved on? /bz -- Bjoern A. Zeeb r15:7 From nobody Wed Feb 19 19:07:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yym9r472Vz5nXJl; Wed, 19 Feb 2025 19:07: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 4Yym9r3cVFz3xbs; Wed, 19 Feb 2025 19:07:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739992064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wFTLdaBdv7dOdbAgb4WWw4aPcUyUhnjJRuVRqyENyUw=; b=tZBCGmODBDkv8Udl/ZFeQhSO4QLNZEPQnSIDPbk/3/HArDwCgswMwNDnpUMN8X1XimzaXD 0V0StTUIP2etu3mUqiR1HT+wEhiVEumY0cty7LO/L3QDFzlajq5w41c5NS+hnutT+kF2Us hQQ0t5TXzRNunn4sfNpmKK/oDqsWXeMqcp7MSAtNzZytb/PNd9BhHhKE6NUBpdjHA3s22k LECXLMJKRY4LD9s+IPWyHa2JPKhxQ7Y+iPbz1yP49YlnObAsyYcLF/FiJXK+p8K1Hg/IyA n8A1NLpKAcQdqje4tH3leyWae8ajCDpvJeGPTWOz7Qb/Ni8Y9fDX92Sd+MUHnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739992064; a=rsa-sha256; cv=none; b=yyvbDanHRVLb5839mu8Vmu8R303ytIGHefoMCS2vrMXDTN3+vVwzu7dMmqP7oZWijKVRBP HBEG5zBcgZLaYrTzVoU8IRb7mlpHKFkGIPtLoNcEWb77XYjJHYQ9XCR7chN628Lu0iMspJ dBgI3TAaVXqDMa7ffaYVuNsoFmUsxE5VMI1aS5aylD0Qnvg5SBadap8bY2+nrYUatiWywf Lsm+rFuViBuX+8Vpx4FpAQAwsTsjPNEoYJqUEbJe2TlLKWQr8F2T1gTiP0nL4qHkAp7oMF /RBaBq1bArZQQqa8rovRIhO4paFrvBzri2iREoqAU6ZIbYqcClBxQm/YwRjXWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739992064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wFTLdaBdv7dOdbAgb4WWw4aPcUyUhnjJRuVRqyENyUw=; b=G7++fjrK37/GUN96crzSOJox4RqeTmWxAoY5LdfB4nK8x51YTQMfPJlAAd+sEqWxoB7Xep T5m/R8i9te0CFivVncfjFUn3nRzLe+qP9d1WZmcuGqAG8khAJPuUrWAwST2d7cEPIbz1y4 qMHEBeNXkR1Q/z6oQCtSoc5bY5cNb0s0VpXBBWZ59buu5j50dV2r+ZJwv894aii+Ieg00R Ni/N9DJVkhqJg8vppX9l/OqItZnmX3M0XFdrNtz4K5EqZxRqP2cnZWpJ5+ZqVRZytbPX/f fuyMffNMFOCrjGyacMduCXgOK66DCAbfY628lu1nxiR0EZK95VR8kBVYozwvDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yym9r3CyKz3bq; Wed, 19 Feb 2025 19:07: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 51JJ7i3J084636; Wed, 19 Feb 2025 19:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJ7iG2084633; Wed, 19 Feb 2025 19:07:44 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:07:44 GMT Message-Id: <202502191907.51JJ7iG2084633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 58d43a3cd72a - main - Revert "libsys: Don't create or expose __realpathat" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58d43a3cd72a4a85ab8489313672c7eab367495e Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=58d43a3cd72a4a85ab8489313672c7eab367495e commit 58d43a3cd72a4a85ab8489313672c7eab367495e Author: Brooks Davis AuthorDate: 2025-02-19 19:07:03 +0000 Commit: Brooks Davis CommitDate: 2025-02-19 19:07:34 +0000 Revert "libsys: Don't create or expose __realpathat" This change broke RTLD. Revert while I test a fix. This reverts commit fdccf0336197afe59be6f8859177fe2ff8f87fa6. --- lib/libsys/Makefile.sys | 1 - lib/libsys/Symbol.map | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index 491c765e9416..b38cd5935e2f 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -50,7 +50,6 @@ STATICOBJS+= interposing_table.o .endif PSEUDO= \ - __realpathat \ clock_gettime \ exit \ getlogin \ diff --git a/lib/libsys/Symbol.map b/lib/libsys/Symbol.map index eb71c813ae86..51ea1b5da231 100644 --- a/lib/libsys/Symbol.map +++ b/lib/libsys/Symbol.map @@ -3,6 +3,7 @@ FBSDprivate_1.0 { __libsys_errno; __getosreldate; __libsys_interposing_slot; + __realpathat; _elf_aux_info; freebsd11_fstat; freebsd11_fstatat; From nobody Wed Feb 19 19:10:05 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YymDY6Rv4z5nXD9; Wed, 19 Feb 2025 19:10: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 4YymDY68PFz3y4m; Wed, 19 Feb 2025 19:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739992205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rbuH7OKsNeG3seDIzDdGpftQySkzo8gHLV70a076r78=; b=usgkUz4Y2o40edM1VdFgFnF2pnlz1b4bH87CMAx7x8a/Sj6/Mxci4EMOOYM8UgIbRL752/ BQcPqR3DWxH0fbYogzTxfKBXWYeivKS0NNbd5+hGyeM4gPnqp+Qxnjf6WPZz/NrDz0Wlnl /uv5HzB1P6OjGLYPmvXQmBiB47wFLavopmgZ3fUv0lo1YaO8HQibaC09lnIC+suW16OKN4 AQMZTqxRK5CMLVJCoz21Jof8j2ZW7l9NiQwbmDxZy4P6WxuiRIHz2uZHyHXQHw96LhRPdV OgXHLEXmz+FyJL1HGUrG/FTKXAms4XpmP1bhLYV9A3+O0XTdptAddLAWobgfrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739992205; a=rsa-sha256; cv=none; b=V37jp/imLr0V+WlU/+pr1wVBl8hUUMslvT429IMwdi8hVm09AF8T7eHHkXeJjY46t750z6 051SjlbdXqY9a2IxTlugB3JX0C5vsn/DVomY8UMvFVGxBSxl/8j1QmboCx1SBkdn1f+ole V/bKjljjeb21uHMU/lJsXwsbg5iSMtyCb+VhIeGNgB+IKV2bY4ovwBlW4cEmaUFdtXq1MR V5YeyRvqDkBSu5rPgOvgy1oqOguUejlWt9f3TeLRKLM1BqK55CjBmcafUFyt1uuo4kcMqs z5YvGu6PowTkbyxdU0Gkt50025or7A9Sa/5/EzbD+wZK2BJdNof10+Hug6sRwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739992205; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rbuH7OKsNeG3seDIzDdGpftQySkzo8gHLV70a076r78=; b=kJN6h/5vr5/I1eiWkeHMUanrtpswRgNDsrI83WJKej+nPqJc5DXswTfKkgMIbk7Gz131TB RCEVozYr4zKfmpwq2Fjw9cwaG3cMGTNkBajhLl/XUdBNvJitQqw9Bg9NpDKhHK910y6xWf /AC7C1i8k1HN8eR5gWq1E5W62ZOlTgZmHbu2GYXNdKx1OC34XLY9JOFwHg+35bGgpp7g66 7inHjZD2PHa60gn5Nx83q45Lky1eSRfKOw2ZydLv7s8dtiLIkSvkYD8Nz8FoPq89ItOdFP ZfFPp5V6MT9MGuhgN2CgICZ2xJK3X5IcBbianHfz1V2pqw7BatfudzGYv+D4CQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YymDY5Y1Vz3DB; Wed, 19 Feb 2025 19:10: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 51JJA5pV088255; Wed, 19 Feb 2025 19:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJA5Jl088173; Wed, 19 Feb 2025 19:10:05 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:10:05 GMT Message-Id: <202502191910.51JJA5Jl088173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 3d9fd9fcb432 - main - openssh: Update to 9.9p1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d9fd9fcb432750f3716b28f6ccb0104cd9d351a Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=3d9fd9fcb432750f3716b28f6ccb0104cd9d351a commit 3d9fd9fcb432750f3716b28f6ccb0104cd9d351a Merge: 58d43a3cd72a 126e0f4f7dcb Author: Ed Maste AuthorDate: 2025-02-19 19:08:59 +0000 Commit: Ed Maste CommitDate: 2025-02-19 19:08:59 +0000 openssh: Update to 9.9p1 Highlights from the release notes are reproduced below. Bug fixes and improvements that were previously merged into FreeBSD have been elided. See the upstream release notes for full details of the 9.9p1 release (https://www.openssh.com/releasenotes.html). --- Future deprecation notice ========================= OpenSSH plans to remove support for the DSA signature algorithm in early 2025. Potentially-incompatible changes -------------------------------- * ssh(1): remove support for pre-authentication compression. * ssh(1), sshd(8): processing of the arguments to the "Match" configuration directive now follows more shell-like rules for quoted strings, including allowing nested quotes and \-escaped characters. New features ------------ * ssh(1), sshd(8): add support for a new hybrid post-quantum key exchange based on the FIPS 203 Module-Lattice Key Enapsulation mechanism (ML-KEM) combined with X25519 ECDH as described by https://datatracker.ietf.org/doc/html/draft-kampanakis-curdle-ssh-pq-ke-03 This algorithm "mlkem768x25519-sha256" is available by default. * ssh(1), sshd(8), ssh-agent(1): prevent private keys from being included in core dump files for most of their lifespans. This is in addition to pre-existing controls in ssh-agent(1) and sshd(8) that prevented coredumps. This feature is supported on OpenBSD, Linux and FreeBSD. * All: convert key handling to use the libcrypto EVP_PKEY API, with the exception of DSA. Bugfixes -------- * sshd(8): do not apply authorized_keys options when signature verification fails. Prevents more restrictive key options being incorrectly applied to subsequent keys in authorized_keys. bz3733 * ssh-keygen(1): include pathname in some of ssh-keygen's passphrase prompts. Helps the user know what's going on when ssh-keygen is invoked via other tools. Requested in GHPR503 * ssh(1), ssh-add(1): make parsing user@host consistently look for the last '@' in the string rather than the first. This makes it possible to more consistently use usernames that contain '@' characters. * ssh(1), sshd(8): be more strict in parsing key type names. Only allow short names (e.g "rsa") in user-interface code and require full SSH protocol names (e.g. "ssh-rsa") everywhere else. bz3725 * ssh-keygen(1): clarify that ed25519 is the default key type generated and clarify that rsa-sha2-512 is the default signature scheme when RSA is in use. GHPR505 --- Reviewed by: jlduran (build infrastructure) Reviewed by: cy (build infrastructure) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48947 crypto/openssh/.depend | 3 +- crypto/openssh/.github/ci-status.md | 4 + crypto/openssh/.github/configs | 8 +- crypto/openssh/.github/setup_ci.sh | 2 +- crypto/openssh/.github/workflows/c-cpp.yml | 1 - crypto/openssh/.github/workflows/selfhosted.yml | 3 + crypto/openssh/ChangeLog | 11538 ++++++++--------- crypto/openssh/LICENCE | 41 + crypto/openssh/Makefile.in | 2 +- crypto/openssh/README | 2 +- crypto/openssh/auth.c | 5 +- crypto/openssh/channels.c | 8 +- crypto/openssh/channels.h | 4 +- crypto/openssh/cipher.c | 8 +- crypto/openssh/config.h | 6 + crypto/openssh/configure.ac | 11 +- crypto/openssh/contrib/redhat/openssh.spec | 6 +- crypto/openssh/contrib/ssh-copy-id | 62 +- crypto/openssh/contrib/ssh-copy-id.1 | 21 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/crypto_api.h | 7 +- crypto/openssh/defines.h | 4 +- crypto/openssh/kex-names.c | 8 +- crypto/openssh/kex.c | 4 +- crypto/openssh/kex.h | 16 +- crypto/openssh/kexc25519.c | 4 +- crypto/openssh/kexgen.c | 15 +- crypto/openssh/kexmlkem768x25519.c | 280 + crypto/openssh/kexsntrup761x25519.c | 6 +- crypto/openssh/libcrux_mlkem768_sha3.h | 12332 +++++++++++++++++++ crypto/openssh/loginrec.c | 89 +- crypto/openssh/match.c | 8 +- crypto/openssh/mlkem768.sh | 148 + crypto/openssh/moduli | 879 +- crypto/openssh/monitor.c | 15 +- crypto/openssh/mux.c | 28 +- crypto/openssh/myproposal.h | 4 +- crypto/openssh/nchan.c | 6 +- crypto/openssh/openbsd-compat/arc4random.h | 2 + crypto/openssh/openbsd-compat/openssl-compat.c | 26 + crypto/openssh/openbsd-compat/openssl-compat.h | 10 + crypto/openssh/openbsd-compat/port-linux.c | 2 +- crypto/openssh/packet.c | 24 +- crypto/openssh/packet.h | 6 +- crypto/openssh/readconf.c | 164 +- crypto/openssh/regress/cfginclude.sh | 26 +- crypto/openssh/regress/misc/fuzz-harness/Makefile | 44 +- .../regress/misc/fuzz-harness/mkcorpus_sntrup761.c | 82 + .../misc/fuzz-harness/sntrup761_dec_fuzz.cc | 74 + .../misc/fuzz-harness/sntrup761_enc_fuzz.cc | 57 + .../regress/misc/fuzz-harness/watch-sntrup761.sh | 20 + crypto/openssh/regress/multiplex.sh | 29 +- crypto/openssh/regress/rekey.sh | 118 +- crypto/openssh/regress/unittests/kex/Makefile | 3 +- crypto/openssh/regress/unittests/kex/test_kex.c | 6 +- crypto/openssh/regress/unittests/sshkey/common.c | 18 +- .../openssh/regress/unittests/sshkey/test_file.c | 11 +- .../openssh/regress/unittests/sshkey/test_sshkey.c | 26 +- .../openssh/regress/unittests/test_helper/fuzz.c | 2 +- crypto/openssh/servconf.c | 79 +- crypto/openssh/servconf.h | 6 +- crypto/openssh/sntrup761.c | 2886 +++-- crypto/openssh/sntrup761.sh | 62 +- crypto/openssh/srclimit.c | 4 + crypto/openssh/srclimit.h | 12 +- crypto/openssh/ssh-add.c | 4 +- crypto/openssh/ssh-ecdsa-sk.c | 49 +- crypto/openssh/ssh-ecdsa.c | 258 +- crypto/openssh/ssh-keygen.1 | 8 +- crypto/openssh/ssh-keygen.c | 93 +- crypto/openssh/ssh-keyscan.c | 5 +- crypto/openssh/ssh-pkcs11-client.c | 83 +- crypto/openssh/ssh-pkcs11-helper.c | 89 +- crypto/openssh/ssh-pkcs11.c | 42 +- crypto/openssh/ssh-rsa.c | 385 +- crypto/openssh/ssh-sk.c | 29 +- crypto/openssh/ssh.1 | 6 +- crypto/openssh/ssh_api.c | 4 +- crypto/openssh/ssh_config.5 | 22 +- crypto/openssh/ssh_namespace.h | 31 +- crypto/openssh/sshbuf-getput-crypto.c | 12 +- crypto/openssh/sshbuf.c | 18 +- crypto/openssh/sshbuf.h | 4 +- crypto/openssh/sshconnect2.c | 3 +- crypto/openssh/sshd-session.c | 31 +- crypto/openssh/sshd.8 | 8 +- crypto/openssh/sshd.c | 14 +- crypto/openssh/sshd_config.5 | 45 +- crypto/openssh/sshkey.c | 290 +- crypto/openssh/sshkey.h | 27 +- crypto/openssh/version.h | 4 +- secure/lib/libssh/Makefile | 2 +- 92 files changed, 22746 insertions(+), 8209 deletions(-) diff --cc crypto/openssh/auth.c index 059104f26688,000000000000..961082b76667 mode 100644,000000..100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@@ -1,785 -1,0 +1,786 @@@ - /* $OpenBSD: auth.c,v 1.161 2024/05/17 00:30:23 djm Exp $ */ ++/* $OpenBSD: auth.c,v 1.162 2024/09/15 01:18:26 djm Exp $ */ +/* + * Copyright (c) 2000 Markus Friedl. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 "includes.h" + +#include +#include +#include +#include + +#include + +#include +#include +#include +#ifdef HAVE_PATHS_H +# include +#endif +#include +#ifdef HAVE_LOGIN_H +#include +#endif +#ifdef USE_SHADOW +#include +#endif +#include +#include +#include +#include +#include +#include +#include + +#include "xmalloc.h" +#include "match.h" +#include "groupaccess.h" +#include "log.h" +#include "sshbuf.h" +#include "misc.h" +#include "servconf.h" +#include "sshkey.h" +#include "hostfile.h" +#include "auth.h" +#include "auth-options.h" +#include "canohost.h" +#include "uidswap.h" +#include "packet.h" +#include "loginrec.h" +#ifdef GSSAPI +#include "ssh-gss.h" +#endif +#include "authfile.h" +#include "monitor_wrap.h" +#include "ssherr.h" +#include "channels.h" +#include "blacklist_client.h" + +/* import */ +extern ServerOptions options; +extern struct include_list includes; +extern struct sshbuf *loginmsg; +extern struct passwd *privsep_pw; +extern struct sshauthopt *auth_opts; + +/* Debugging messages */ +static struct sshbuf *auth_debug; + +/* + * Check if the user is allowed to log in via ssh. If user is listed + * in DenyUsers or one of user's groups is listed in DenyGroups, false + * will be returned. If AllowUsers isn't empty and user isn't listed + * there, or if AllowGroups isn't empty and one of user's groups isn't + * listed there, false will be returned. + * If the user's shell is not executable, false will be returned. + * Otherwise true is returned. + */ +int +allowed_user(struct ssh *ssh, struct passwd * pw) +{ + struct stat st; + const char *hostname = NULL, *ipaddr = NULL; + u_int i; + int r; + + /* Shouldn't be called if pw is NULL, but better safe than sorry... */ + if (!pw || !pw->pw_name) + return 0; + + if (!options.use_pam && platform_locked_account(pw)) { + logit("User %.100s not allowed because account is locked", + pw->pw_name); + return 0; + } + + /* + * Deny if shell does not exist or is not executable unless we + * are chrooting. + */ + if (options.chroot_directory == NULL || + strcasecmp(options.chroot_directory, "none") == 0) { + char *shell = xstrdup((pw->pw_shell[0] == '\0') ? + _PATH_BSHELL : pw->pw_shell); /* empty = /bin/sh */ + + if (stat(shell, &st) == -1) { + logit("User %.100s not allowed because shell %.100s " + "does not exist", pw->pw_name, shell); + free(shell); + return 0; + } + if (S_ISREG(st.st_mode) == 0 || + (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) { + logit("User %.100s not allowed because shell %.100s " + "is not executable", pw->pw_name, shell); + free(shell); + return 0; + } + free(shell); + } + + if (options.num_deny_users > 0 || options.num_allow_users > 0 || + options.num_deny_groups > 0 || options.num_allow_groups > 0) { + hostname = auth_get_canonical_hostname(ssh, options.use_dns); + ipaddr = ssh_remote_ipaddr(ssh); + } + + /* Return false if user is listed in DenyUsers */ + if (options.num_deny_users > 0) { + for (i = 0; i < options.num_deny_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.deny_users[i]); + if (r < 0) { + fatal("Invalid DenyUsers pattern \"%.100s\"", + options.deny_users[i]); + } else if (r != 0) { + logit("User %.100s from %.100s not allowed " + "because listed in DenyUsers", + pw->pw_name, hostname); + return 0; + } + } + } + /* Return false if AllowUsers isn't empty and user isn't listed there */ + if (options.num_allow_users > 0) { + for (i = 0; i < options.num_allow_users; i++) { + r = match_user(pw->pw_name, hostname, ipaddr, + options.allow_users[i]); + if (r < 0) { + fatal("Invalid AllowUsers pattern \"%.100s\"", + options.allow_users[i]); + } else if (r == 1) + break; + } + /* i < options.num_allow_users iff we break for loop */ + if (i >= options.num_allow_users) { + logit("User %.100s from %.100s not allowed because " + "not listed in AllowUsers", pw->pw_name, hostname); + return 0; + } + } + if (options.num_deny_groups > 0 || options.num_allow_groups > 0) { + /* Get the user's group access list (primary and supplementary) */ + if (ga_init(pw->pw_name, pw->pw_gid) == 0) { + logit("User %.100s from %.100s not allowed because " + "not in any group", pw->pw_name, hostname); + return 0; + } + + /* Return false if one of user's groups is listed in DenyGroups */ + if (options.num_deny_groups > 0) + if (ga_match(options.deny_groups, + options.num_deny_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because a group is listed in DenyGroups", + pw->pw_name, hostname); + return 0; + } + /* + * Return false if AllowGroups isn't empty and one of user's groups + * isn't listed there + */ + if (options.num_allow_groups > 0) + if (!ga_match(options.allow_groups, + options.num_allow_groups)) { + ga_free(); + logit("User %.100s from %.100s not allowed " + "because none of user's groups are listed " + "in AllowGroups", pw->pw_name, hostname); + return 0; + } + ga_free(); + } + +#ifdef CUSTOM_SYS_AUTH_ALLOWED_USER + if (!sys_auth_allowed_user(pw, loginmsg)) + return 0; +#endif + + /* We found no reason not to let this user try to log on... */ + return 1; +} + +/* + * Formats any key left in authctxt->auth_method_key for inclusion in + * auth_log()'s message. Also includes authxtct->auth_method_info if present. + */ +static char * +format_method_key(Authctxt *authctxt) +{ + const struct sshkey *key = authctxt->auth_method_key; + const char *methinfo = authctxt->auth_method_info; + char *fp, *cafp, *ret = NULL; + + if (key == NULL) + return NULL; + + if (sshkey_is_cert(key)) { + fp = sshkey_fingerprint(key, + options.fingerprint_hash, SSH_FP_DEFAULT); + cafp = sshkey_fingerprint(key->cert->signature_key, + options.fingerprint_hash, SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s ID %s (serial %llu) CA %s %s%s%s", + sshkey_type(key), fp == NULL ? "(null)" : fp, + key->cert->key_id, + (unsigned long long)key->cert->serial, + sshkey_type(key->cert->signature_key), + cafp == NULL ? "(null)" : cafp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + free(cafp); + } else { + fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT); + xasprintf(&ret, "%s %s%s%s", sshkey_type(key), + fp == NULL ? "(null)" : fp, + methinfo == NULL ? "" : ", ", + methinfo == NULL ? "" : methinfo); + free(fp); + } + return ret; +} + +void +auth_log(struct ssh *ssh, int authenticated, int partial, + const char *method, const char *submethod) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + int level = SYSLOG_LEVEL_VERBOSE; + const char *authmsg; + char *extra = NULL; + + if (!mm_is_monitor() && !authctxt->postponed) + return; + + /* Raise logging level */ + if (authenticated == 1 || + !authctxt->valid || + authctxt->failures >= options.max_authtries / 2 || + strcmp(method, "password") == 0) + level = SYSLOG_LEVEL_INFO; + + if (authctxt->postponed) + authmsg = "Postponed"; + else if (partial) + authmsg = "Partial"; + else { + authmsg = authenticated ? "Accepted" : "Failed"; + if (authenticated) + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); + } + + if ((extra = format_method_key(authctxt)) == NULL) { + if (authctxt->auth_method_info != NULL) + extra = xstrdup(authctxt->auth_method_info); + } + + do_log2(level, "%s %s%s%s for %s%.100s from %.200s port %d ssh2%s%s", + authmsg, + method, + submethod != NULL ? "/" : "", submethod == NULL ? "" : submethod, + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh), + extra != NULL ? ": " : "", + extra != NULL ? extra : ""); + + free(extra); + +#if defined(CUSTOM_FAILED_LOGIN) || defined(SSH_AUDIT_EVENTS) + if (authenticated == 0 && !(authctxt->postponed || partial)) { + /* Log failed login attempt */ +# ifdef CUSTOM_FAILED_LOGIN + if (strcmp(method, "password") == 0 || + strncmp(method, "keyboard-interactive", 20) == 0 || + strcmp(method, "challenge-response") == 0) + record_failed_login(ssh, authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +# endif +# ifdef SSH_AUDIT_EVENTS + audit_event(ssh, audit_classify_auth(method)); +# endif + } +#endif +#if defined(CUSTOM_FAILED_LOGIN) && defined(WITH_AIXAUTHENTICATE) + if (authenticated) + sys_auth_record_login(authctxt->user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh", + loginmsg); +#endif +} + +void +auth_maxtries_exceeded(struct ssh *ssh) +{ + Authctxt *authctxt = (Authctxt *)ssh->authctxt; + + error("maximum authentication attempts exceeded for " + "%s%.100s from %.200s port %d ssh2", + authctxt->valid ? "" : "invalid user ", + authctxt->user, + ssh_remote_ipaddr(ssh), + ssh_remote_port(ssh)); + ssh_packet_disconnect(ssh, "Too many authentication failures"); + /* NOTREACHED */ +} + +/* + * Check whether root logins are disallowed. + */ +int +auth_root_allowed(struct ssh *ssh, const char *method) +{ + switch (options.permit_root_login) { + case PERMIT_YES: + return 1; + case PERMIT_NO_PASSWD: + if (strcmp(method, "publickey") == 0 || + strcmp(method, "hostbased") == 0 || + strcmp(method, "gssapi-with-mic") == 0) + return 1; + break; + case PERMIT_FORCED_ONLY: + if (auth_opts->force_command != NULL) { + logit("Root login accepted for forced command."); + return 1; + } + break; + } + logit("ROOT LOGIN REFUSED FROM %.200s port %d", + ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); + return 0; +} + + +/* + * Given a template and a passwd structure, build a filename + * by substituting % tokenised options. Currently, %% becomes '%', + * %h becomes the home directory and %u the username. + * + * This returns a buffer allocated by xmalloc. + */ +char * +expand_authorized_keys(const char *filename, struct passwd *pw) +{ + char *file, uidstr[32], ret[PATH_MAX]; + int i; + + snprintf(uidstr, sizeof(uidstr), "%llu", + (unsigned long long)pw->pw_uid); + file = percent_expand(filename, "h", pw->pw_dir, + "u", pw->pw_name, "U", uidstr, (char *)NULL); + + /* + * Ensure that filename starts anchored. If not, be backward + * compatible and prepend the '%h/' + */ + if (path_absolute(file)) + return (file); + + i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file); + if (i < 0 || (size_t)i >= sizeof(ret)) + fatal("expand_authorized_keys: path too long"); + free(file); + return (xstrdup(ret)); +} + +char * +authorized_principals_file(struct passwd *pw) +{ + if (options.authorized_principals_file == NULL) + return NULL; + return expand_authorized_keys(options.authorized_principals_file, pw); +} + +/* return ok if key exists in sysfile or userfile */ +HostStatus +check_key_in_hostfiles(struct passwd *pw, struct sshkey *key, const char *host, + const char *sysfile, const char *userfile) +{ + char *user_hostfile; + struct stat st; + HostStatus host_status; + struct hostkeys *hostkeys; + const struct hostkey_entry *found; + + hostkeys = init_hostkeys(); + load_hostkeys(hostkeys, host, sysfile, 0); + if (userfile != NULL) { + user_hostfile = tilde_expand_filename(userfile, pw->pw_uid); + if (options.strict_modes && + (stat(user_hostfile, &st) == 0) && + ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || + (st.st_mode & 022) != 0)) { + logit("Authentication refused for %.100s: " + "bad owner or modes for %.200s", + pw->pw_name, user_hostfile); + auth_debug_add("Ignored %.200s: bad ownership or modes", + user_hostfile); + } else { + temporarily_use_uid(pw); + load_hostkeys(hostkeys, host, user_hostfile, 0); + restore_uid(); + } + free(user_hostfile); + } + host_status = check_key_in_hostkeys(hostkeys, key, &found); + if (host_status == HOST_REVOKED) + error("WARNING: revoked key for %s attempted authentication", + host); + else if (host_status == HOST_OK) + debug_f("key for %s found at %s:%ld", + found->host, found->file, found->line); + else + debug_f("key for host %s not found", host); + + free_hostkeys(hostkeys); + + return host_status; +} + +struct passwd * +getpwnamallow(struct ssh *ssh, const char *user) +{ +#ifdef HAVE_LOGIN_CAP + extern login_cap_t *lc; +#ifdef HAVE_AUTH_HOSTOK + const char *from_host, *from_ip; +#endif +#ifdef BSD_AUTH + auth_session_t *as; +#endif +#endif + struct passwd *pw; + struct connection_info *ci; + u_int i; + + ci = server_get_connection_info(ssh, 1, options.use_dns); + ci->user = user; ++ ci->user_invalid = getpwnam(user) == NULL; + parse_server_match_config(&options, &includes, ci); + log_change_level(options.log_level); + log_verbose_reset(); + for (i = 0; i < options.num_log_verbose; i++) + log_verbose_add(options.log_verbose[i]); + server_process_permitopen(ssh); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_setauthdb(user); +#endif + + pw = getpwnam(user); + +#if defined(_AIX) && defined(HAVE_SETAUTHDB) + aix_restoreauthdb(); +#endif + if (pw == NULL) { + BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); + logit("Invalid user %.100s from %.100s port %d", + user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); +#ifdef CUSTOM_FAILED_LOGIN + record_failed_login(ssh, user, + auth_get_canonical_hostname(ssh, options.use_dns), "ssh"); +#endif +#ifdef SSH_AUDIT_EVENTS + audit_event(ssh, SSH_INVALID_USER); +#endif /* SSH_AUDIT_EVENTS */ + return (NULL); + } + if (!allowed_user(ssh, pw)) + return (NULL); +#ifdef HAVE_LOGIN_CAP + if ((lc = login_getpwclass(pw)) == NULL) { + debug("unable to get login class: %s", user); + return (NULL); + } +#ifdef HAVE_AUTH_HOSTOK + from_host = auth_get_canonical_hostname(ssh, options.use_dns); + from_ip = ssh_remote_ipaddr(ssh); + if (!auth_hostok(lc, from_host, from_ip)) { + debug("Denied connection for %.200s from %.200s [%.200s].", - pw->pw_name, from_host, from_ip); ++ pw->pw_name, from_host, from_ip); + return (NULL); + } +#endif /* HAVE_AUTH_HOSTOK */ +#ifdef HAVE_AUTH_TIMEOK + if (!auth_timeok(lc, time(NULL))) { + debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name); + return (NULL); + } +#endif /* HAVE_AUTH_TIMEOK */ +#ifdef BSD_AUTH + if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || + auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { + debug("Approval failure for %s", user); + pw = NULL; + } + if (as != NULL) + auth_close(as); +#endif +#endif + if (pw != NULL) + return (pwcopy(pw)); + return (NULL); +} + +/* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */ +int +auth_key_is_revoked(struct sshkey *key) +{ + char *fp = NULL; + int r; + + if (options.revoked_keys_file == NULL) + return 0; + if ((fp = sshkey_fingerprint(key, options.fingerprint_hash, + SSH_FP_DEFAULT)) == NULL) { + r = SSH_ERR_ALLOC_FAIL; + error_fr(r, "fingerprint key"); + goto out; + } + + r = sshkey_check_revoked(key, options.revoked_keys_file); + switch (r) { + case 0: + break; /* not revoked */ + case SSH_ERR_KEY_REVOKED: + error("Authentication key %s %s revoked by file %s", + sshkey_type(key), fp, options.revoked_keys_file); + goto out; + default: + error_r(r, "Error checking authentication key %s %s in " + "revoked keys file %s", sshkey_type(key), fp, + options.revoked_keys_file); + goto out; + } + + /* Success */ + r = 0; + + out: + free(fp); + return r == 0 ? 0 : 1; +} + +void +auth_debug_add(const char *fmt,...) +{ + char buf[1024]; + va_list args; + int r; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + debug3("%s", buf); + if (auth_debug != NULL) + if ((r = sshbuf_put_cstring(auth_debug, buf)) != 0) + fatal_fr(r, "sshbuf_put_cstring"); +} + +void +auth_debug_send(struct ssh *ssh) +{ + char *msg; + int r; + + if (auth_debug == NULL) + return; + while (sshbuf_len(auth_debug) != 0) { + if ((r = sshbuf_get_cstring(auth_debug, &msg, NULL)) != 0) + fatal_fr(r, "sshbuf_get_cstring"); + ssh_packet_send_debug(ssh, "%s", msg); + free(msg); + } +} + +void +auth_debug_reset(void) +{ + if (auth_debug != NULL) + sshbuf_reset(auth_debug); + else if ((auth_debug = sshbuf_new()) == NULL) + fatal_f("sshbuf_new failed"); +} + +struct passwd * +fakepw(void) +{ + static int done = 0; + static struct passwd fake; + const char hashchars[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz0123456789"; /* from bcrypt.c */ + char *cp; + + if (done) + return (&fake); + + memset(&fake, 0, sizeof(fake)); + fake.pw_name = "NOUSER"; + fake.pw_passwd = xstrdup("$2a$10$" + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); + for (cp = fake.pw_passwd + 7; *cp != '\0'; cp++) + *cp = hashchars[arc4random_uniform(sizeof(hashchars) - 1)]; +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + fake.pw_gecos = "NOUSER"; +#endif + fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; + fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + fake.pw_class = ""; +#endif + fake.pw_dir = "/nonexist"; + fake.pw_shell = "/nonexist"; + done = 1; + + return (&fake); +} + +/* + * Return the canonical name of the host in the other side of the current + * connection. The host name is cached, so it is efficient to call this + * several times. + */ + +const char * +auth_get_canonical_hostname(struct ssh *ssh, int use_dns) +{ + static char *dnsname; + + if (!use_dns) + return ssh_remote_ipaddr(ssh); + if (dnsname != NULL) + return dnsname; + dnsname = ssh_remote_hostname(ssh); + return dnsname; +} + +/* These functions link key/cert options to the auth framework */ + +/* Log sshauthopt options locally and (optionally) for remote transmission */ +void +auth_log_authopts(const char *loc, const struct sshauthopt *opts, int do_remote) +{ + int do_env = options.permit_user_env && opts->nenv > 0; + int do_permitopen = opts->npermitopen > 0 && + (options.allow_tcp_forwarding & FORWARD_LOCAL) != 0; + int do_permitlisten = opts->npermitlisten > 0 && + (options.allow_tcp_forwarding & FORWARD_REMOTE) != 0; + size_t i; + char msg[1024], buf[64]; + + snprintf(buf, sizeof(buf), "%d", opts->force_tun_device); + /* Try to keep this alphabetically sorted */ + snprintf(msg, sizeof(msg), "key options:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", + opts->permit_agent_forwarding_flag ? " agent-forwarding" : "", + opts->force_command == NULL ? "" : " command", + do_env ? " environment" : "", + opts->valid_before == 0 ? "" : "expires", + opts->no_require_user_presence ? " no-touch-required" : "", + do_permitopen ? " permitopen" : "", + do_permitlisten ? " permitlisten" : "", + opts->permit_port_forwarding_flag ? " port-forwarding" : "", + opts->cert_principals == NULL ? "" : " principals", + opts->permit_pty_flag ? " pty" : "", + opts->require_verify ? " uv" : "", + opts->force_tun_device == -1 ? "" : " tun=", + opts->force_tun_device == -1 ? "" : buf, + opts->permit_user_rc ? " user-rc" : "", + opts->permit_x11_forwarding_flag ? " x11-forwarding" : ""); + + debug("%s: %s", loc, msg); + if (do_remote) + auth_debug_add("%s: %s", loc, msg); + + if (options.permit_user_env) { + for (i = 0; i < opts->nenv; i++) { + debug("%s: environment: %s", loc, opts->env[i]); + if (do_remote) { + auth_debug_add("%s: environment: %s", + loc, opts->env[i]); + } + } + } + + /* Go into a little more details for the local logs. */ + if (opts->valid_before != 0) { + format_absolute_time(opts->valid_before, buf, sizeof(buf)); + debug("%s: expires at %s", loc, buf); + } + if (opts->cert_principals != NULL) { + debug("%s: authorized principals: \"%s\"", + loc, opts->cert_principals); + } + if (opts->force_command != NULL) + debug("%s: forced command: \"%s\"", loc, opts->force_command); + if (do_permitopen) { + for (i = 0; i < opts->npermitopen; i++) { + debug("%s: permitted open: %s", + loc, opts->permitopen[i]); + } + } + if (do_permitlisten) { + for (i = 0; i < opts->npermitlisten; i++) { + debug("%s: permitted listen: %s", + loc, opts->permitlisten[i]); + } + } +} + +/* Activate a new set of key/cert options; merging with what is there. */ +int +auth_activate_options(struct ssh *ssh, struct sshauthopt *opts) +{ + struct sshauthopt *old = auth_opts; + const char *emsg = NULL; + + debug_f("setting new authentication options"); + if ((auth_opts = sshauthopt_merge(old, opts, &emsg)) == NULL) { + error("Inconsistent authentication options: %s", emsg); + return -1; + } + return 0; +} + +/* Disable forwarding, etc for the session */ +void +auth_restrict_session(struct ssh *ssh) +{ + struct sshauthopt *restricted; + + debug_f("restricting session"); + + /* A blank sshauthopt defaults to permitting nothing */ + if ((restricted = sshauthopt_new()) == NULL) + fatal_f("sshauthopt_new failed"); + restricted->permit_pty_flag = 1; + restricted->restricted = 1; + + if (auth_activate_options(ssh, restricted) != 0) + fatal_f("failed to restrict session"); + sshauthopt_free(restricted); +} diff --cc crypto/openssh/config.h index 1fe7eae0c0fd,000000000000..904a6f91c210 mode 100644,000000..100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@@ -1,2071 -1,0 +1,2077 @@@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address *** 12087 LINES SKIPPED *** From nobody Wed Feb 19 19:24:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YymYF2pcZz5nY29; Wed, 19 Feb 2025 19:24: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 4YymYF22thz43BP; Wed, 19 Feb 2025 19:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j5/5OCXJv/p6HHtorM5EV25iukUb6E4RSdN3nH5VtQw=; b=ScU9Z3ENuKjjIuEPlvwZMoAdr1dd9mX27gmyix5llD5CW+wdh29toxymtaH+5m7i419tUj iqmNhgYOpqEngCfNYJ87YD7jgMIqM6Fkzbz0jt46HYnlOW8P9FBt1LWoI95gwg79yKXrUC VtHVjW1jdh/iStAHo5ahVfGjTChcIVKGkSygJ40zKjYDtG6UoLSBhhGLQwr2IVVbBIijnv xHguwE7h4y0Sp6ccVXbB1eQUpKjOxIvku/3SK1C6ADJL5oRX2rNsXNxGwCcUxhxsrogg/S vT8pT70mac4d5dE07rVq4PcyvXXQHuGf5ZcmNln+sZDL8L7P3H3OPyMNaXmQdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739993073; a=rsa-sha256; cv=none; b=t2RI7p1yOJnpWkGYDHp3pwE4ZYxaO1zQ1+4frSM/InATFg9mirz6fsycwba1/1Cyg8g8EP 61kVt9cBIKedaHgXSrb+hqitjyt6Y+E+ODI/XuyEOCCDEd0B0FzDqplpgKaegOpET3mqyP 1189NGLwODo+kA3tWn1ClWtrZyVN6diWjNilz2JI2VLwR8u5M67kaoqrYJQ7ibKs33ZKVk P5clFeXAO/dOZw4YWUdVbGDEvkrkSKaMRiN7gLrH45jR/XuYFvFAvVD+RvkBqnbxUQjwsI lWtW1xIIRRcrjIYkPgPFTi8SXroOA6D4Dn9MLGu+5hBlVMNNm2ceyCkcgWKRSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993073; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j5/5OCXJv/p6HHtorM5EV25iukUb6E4RSdN3nH5VtQw=; b=o/1v+C8ZFfGQ6OvaDb066s59FCb3mKs3x2N/Sz8ik9LRMfDUTIP+YpTn4PQJNu3Fbu24Xd KtKxgxV/k0REz9Py+8B0a1Y35FcWJnVQMGrbqi2D79enEw6vtE3vkm729OdzqXluBNEfPZ dSX2W+RmYoXO5YorSZZ6IaIDs2QNTQbBdc2jD7WTia6yYdY0sff650EesxI76yQe9ScJUV i8iL8AdYcsiQxtGlNiwDJcsuiPt2v/3VwydTHid/HnZe0HOcRoMolqVZMpDU/6chPny668 JS0dWJDsAfSUIGWQSShHNBthVowouYL3V3tXpa2tU5bvD+UtGr5CcyWeDRHqRg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YymYF1XDdz3tt; Wed, 19 Feb 2025 19:24: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 51JJOXep021734; Wed, 19 Feb 2025 19:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJOXC2021731; Wed, 19 Feb 2025 19:24:33 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:24:33 GMT Message-Id: <202502191924.51JJOXC2021731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 0d7b98c06c5e - main - pkg-stage.sh: kde5 -> kde List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d7b98c06c5ec9638020844ee460af075cfc6e54 Auto-Submitted: auto-generated The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0d7b98c06c5ec9638020844ee460af075cfc6e54 commit 0d7b98c06c5ec9638020844ee460af075cfc6e54 Author: Colin Percival AuthorDate: 2025-02-19 19:21:04 +0000 Commit: Colin Percival CommitDate: 2025-02-19 19:24:06 +0000 pkg-stage.sh: kde5 -> kde The "kde5" package no longer exists; KDE goes to 6. Note: Depending on the size of 13.5-BETA3 DVD images, KDE might end up being removed from this list in the near future. With hat: re@ MFC after: 30 seconds Sponsored by: Amazon --- release/scripts/pkg-stage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/pkg-stage.sh b/release/scripts/pkg-stage.sh index 8f96bd5cf5a1..495c328e4724 100755 --- a/release/scripts/pkg-stage.sh +++ b/release/scripts/pkg-stage.sh @@ -30,7 +30,7 @@ sysutils/tmux www/firefox www/links x11/gnome -x11/kde5 +x11/kde x11/sddm x11/xorg x11-wm/sway" From nobody Wed Feb 19 19:28:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yymf92SdBz5nYTY; Wed, 19 Feb 2025 19:28: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 4Yymf91l18z43kG; Wed, 19 Feb 2025 19:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/72ncPGMjqssPIWLUMwxCcMkh+GrirJlMXYrUpZzCQ=; b=UDPrZgMCOlTVYQD6PQDRqM/RTo5jBCIed6cTypV+goRs7u1aRdUiiE/NF7aA90l9QXeW7k eotDnrvOJTS3GWH3tBEZWJ8G77AH3n0+/Ef4ti6NgMbpIl9ZVct1ZH4JBN6Cg+X/xZEXAY TzWdLtALGhXpHygsTxf8+NeeQoHePMDqlCDvOYifFkJOrnq3vPZrAZVQ3pb4YZj82kVSUl Bnu8FtDIK/8Nz78PIopnRcQJKQfqOkHet5PgSgGWqHns19hvPyR6rHLFtGYllQ6SKXcmTA FCmU+itxZYNXKDZ6yb19fbXsKx4mWMQzRPjSsyO9aktZliEyyB4UDAQmpbiakA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739993329; a=rsa-sha256; cv=none; b=h8rylwguERhRByv7yXLKxN2OwgvV8/nRSrqi/TmG8+mzfScRCJjjaKGgv/ksV35jvuGN6y CLrkMNa8d5bEwK6J1VKXZnjf8b80Ac6j1I2d3Y8rKB/yKfSBXGSQ79TyRW+jOTRDrhSwEO fLC4i1CgvIA8Q10Pringlh8Z1oarpxJ2iFKCIPKGwXm9IDqy42q4fErj+KePlw0+qYuFnj MJwWY6Kn2n9KnH6psPW8a2PaKN/zZFgFVYYAdquJGYJKeSRPuOf3WdW7GNLkr1xJt+V9M/ fQoUvYpsHcjdJKo/txhj+pqXEOTINpdi59Zm/whV5z/JVZY5B8H66qQE+ZCdSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/72ncPGMjqssPIWLUMwxCcMkh+GrirJlMXYrUpZzCQ=; b=fX5In/YiyvmsEJox6sgxMwxpLpb7wOjR4WKC2CUajybnoDZd/pFN3fGsOalIdYgzhpE4B8 tltd4VDy523XipTLw1ui7s3tyxNyywymfnY0JCnHgf+PJiEOEv89S4rxYmLZhCHfdBwTr3 1oyPT7slLodSj7KdBUi7Rrc+ymfxItDhpRTJo/3lmhalhvr4qdeeQ/G0FZCDTFDd50oSm0 HbjrEgw4QBAdCpGlu+KzNYyqTCXF2+c0yRbZJgqI6m3CI9QvgsAsnewH6wpYx2LOdQRjcH O1FUNUGDENMX8knzQat3LcTvoJRpttBxdCB1Fv7Z2YI9vIUEmkvmGT52FyY7dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yymf91Kg6z47X; Wed, 19 Feb 2025 19:28: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 51JJSnqe023222; Wed, 19 Feb 2025 19:28:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJSnUs023219; Wed, 19 Feb 2025 19:28:49 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:28:49 GMT Message-Id: <202502191928.51JJSnUs023219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: e95979047aec - main - ssh: Remove unused prerendered man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e95979047aec384852102cf8bb1d55278ea77eeb Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e95979047aec384852102cf8bb1d55278ea77eeb commit e95979047aec384852102cf8bb1d55278ea77eeb Author: Ed Maste AuthorDate: 2025-02-19 19:23:39 +0000 Commit: Ed Maste CommitDate: 2025-02-19 19:27:13 +0000 ssh: Remove unused prerendered man page We use the source mdoc man pages (i.e., ssh-sk-helper.8) not the rendered ones included in the OpenSSH releases. Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") Sponsored by: The FreeBSD Foundation --- crypto/openssh/ssh-sk-helper.0 | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/crypto/openssh/ssh-sk-helper.0 b/crypto/openssh/ssh-sk-helper.0 deleted file mode 100644 index ea2117abd13a..000000000000 --- a/crypto/openssh/ssh-sk-helper.0 +++ /dev/null @@ -1,34 +0,0 @@ -SSH-SK-HELPER(8) System Manager's Manual SSH-SK-HELPER(8) - -NAME - ssh-sk-helper M-bM-^@M-^S OpenSSH helper for FIDO authenticator support - -SYNOPSIS - ssh-sk-helper [-v] - -DESCRIPTION - ssh-sk-helper is used by ssh(1), ssh-agent(1), and ssh-keygen(1) to - access keys provided by a FIDO authenticator. - - ssh-sk-helper is not intended to be invoked directly by the user. - - A single option is supported: - - -v Verbose mode. Causes ssh-sk-helper to print debugging messages - about its progress. This is helpful in debugging problems. - Multiple -v options increase the verbosity. The maximum is 3. - - Note that ssh(1), ssh-agent(1), and ssh-keygen(1) will - automatically pass the -v flag to ssh-sk-helper when they have - themselves been placed in debug mode. - -SEE ALSO - ssh(1), ssh-agent(1), ssh-keygen(1) - -HISTORY - ssh-sk-helper first appeared in OpenBSD 6.7. - -AUTHORS - Damien Miller - -OpenBSD 7.5 April 29, 2022 OpenBSD 7.5 From nobody Wed Feb 19 19:34:33 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yymmn5ZPLz5nZ1M; Wed, 19 Feb 2025 19:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yymmn3YWTz44kl; Wed, 19 Feb 2025 19:34:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXGK66djQGih/dZ96CZZclOHeNe3SBK6+H0EEqyV3oc=; b=Mt84nKcQdNITNIuHEScS4oXMiPUsOchgGvVOjiffj7uo4vBkgoY7CMfGb4Y/0KuPhG3bvt Jibms3x9nW9JHhSbv9E8MMy7uO3aa5luULXB3uSBcLPyYpwT0K/+I+g3aMNHIlqRw1yl4p fRXABobAq+ZDI9hSJTUBegnKTgVLX07faompsjyh96ZotwTVt/xHV5ra5weXK78IuIjOq1 61UjMId5aSKlKlduxZ8W7USFqNzoB3FhtsLdJfvofkweFoDwEDkJ9Fa6fQ3rf3PRY6GQYF BwVd7ZKDooGO8KJ6XprN/0Nx2oOtgPighERSwfAjmVqDzTLIhast1nEopClGSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739993673; a=rsa-sha256; cv=none; b=wLe+vnFdmppRwYeaYsQOVsl5tb/6oFTBTAiNUusCm1zhJvlpfBf7CLFFpo8FD/oSOvTZYV ji1eoemgMSB2o+bWB6SYpjFEjLT89PtHDx7fEaFfv2SjwoAOTyCowMr8TwnEbNgKiU3BkA MKOXn5tra9Qf1xjfkAsVskwn4zdqI5XeIMZ2jUbfAy9beXvU6KofrxRirdCtlPAzysy1Z6 KXpZ8xUKZlB9jBVKntYQdYELpFI+xhUZsoX7lNjgdaQzkpJEeIgC5UqnUom4sNTb62V6ei WgFpysQskzwZHWxbE3YSnzXjs6locnJt14vLwulZBwxz8zgHBd6nswmAyRr5VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739993673; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DXGK66djQGih/dZ96CZZclOHeNe3SBK6+H0EEqyV3oc=; b=CUKp3JksgWSaWNbRwUfNluMyL3YJXx/OM/vMaxbn+7ynZ6f6/XElPKP0/60IoWnqf7Kpmg lLLMMd2PoRP5IRfOzKBGKzJo4cfKZD+VmznAwuioUlw6CVyZCPAq46DiVSv3vs8XNhpm13 Qk3ZYY9S2r/WO12KQz3RcAZXS6gHTdOkf6WS50rYH/s28Bv4MiEFVV7nwsDbFBjpfBx3P0 IbKUk480fHl2CRuLxjPUzprFB5/lg2VfkZEqJmu3k7+zcCrEjIUiG2Fa+irQxUKwmYQ6hE 4WMGI9rxaESNCjqLbiLXS657ojgSB8J1/a99H21C6jbzHyno/jMFo7KsneAtsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yymmn2y3wz4Rk; Wed, 19 Feb 2025 19:34: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 51JJYXXJ040179; Wed, 19 Feb 2025 19:34:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJYXB4040176; Wed, 19 Feb 2025 19:34:33 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:34:33 GMT Message-Id: <202502191934.51JJYXB4040176@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0ae642c7dd0c - main - openssh: Update to 9.9p2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ae642c7dd0c2cfd965a22bf73876cd26cceadd2 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0ae642c7dd0c2cfd965a22bf73876cd26cceadd2 commit 0ae642c7dd0c2cfd965a22bf73876cd26cceadd2 Merge: e95979047aec de47678f9822 Author: Ed Maste AuthorDate: 2025-02-19 19:33:38 +0000 Commit: Ed Maste CommitDate: 2025-02-19 19:33:38 +0000 openssh: Update to 9.9p2 This release exists primarily to fix two security bugs. The fixes have been independently imported into FreeBSD. This import serves to update the ssh and sshd version number. A few minor bug fixes are also included; see the upstream release notes for full details of the 9.9p2 release (https://www.openssh.com/releasenotes.html). Sponsored by: The FreeBSD Foundation crypto/openssh/.github/ci-status.md | 10 +- crypto/openssh/ChangeLog | 2186 ++-------------------------- crypto/openssh/README | 2 +- crypto/openssh/config.h | 3 - crypto/openssh/configure.ac | 1 - crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/defines.h | 26 + crypto/openssh/gss-serv.c | 1 + crypto/openssh/kexmlkem768x25519.c | 5 +- crypto/openssh/libcrux_mlkem768_sha3.h | 8 +- crypto/openssh/loginrec.c | 8 +- crypto/openssh/misc.c | 23 +- crypto/openssh/misc.h | 3 +- crypto/openssh/mlkem768.sh | 17 +- crypto/openssh/readconf.c | 28 +- crypto/openssh/servconf.c | 61 +- crypto/openssh/ssh_namespace.h | 1 + crypto/openssh/version.h | 2 +- 19 files changed, 289 insertions(+), 2100 deletions(-) diff --cc crypto/openssh/config.h index 904a6f91c210,000000000000..a8876e853b94 mode 100644,000000..100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@@ -1,2077 -1,0 +1,2074 @@@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if you have a getaddrinfo that fails for the all-zeros IPv6 address + */ +/* #undef AIX_GETNAMEINFO_HACK */ + +/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */ +/* #undef AIX_LOGINFAILED_4ARG */ + +/* System only supports IPv4 audit records */ +/* #undef AU_IPv4 */ + +/* Define if your resolver libs need this for getrrsetbyname */ +/* #undef BIND_8_COMPAT */ + +/* The system has incomplete BSM API */ +/* #undef BROKEN_BSM_API */ + +/* broken in chroots on older kernels */ +/* #undef BROKEN_CLOSEFROM */ + +/* Define if cmsg_type is not passed correctly */ +/* #undef BROKEN_CMSG_TYPE */ + +/* getaddrinfo is broken (if present) */ +/* #undef BROKEN_GETADDRINFO */ + +/* getgroups(0,NULL) will return -1 */ +/* #undef BROKEN_GETGROUPS */ + +/* getline is not what we expect */ +/* #undef BROKEN_GETLINE */ + +/* FreeBSD glob does not do what we need */ +#define BROKEN_GLOB 1 + +/* Define if you system's inet_ntoa is busted (e.g. Irix gcc issue) */ +/* #undef BROKEN_INET_NTOA */ + +/* Define if your struct dirent expects you to allocate extra space for d_name + */ +/* #undef BROKEN_ONE_BYTE_DIRENT_D_NAME */ + +/* System poll(2) implementation is broken */ +/* #undef BROKEN_POLL */ + +/* Can't do comparisons on readv */ +/* #undef BROKEN_READV_COMPARISON */ + +/* NetBSD read function is sometimes redirected, breaking atomicio comparisons + against it */ +/* #undef BROKEN_READ_COMPARISON */ + +/* Needed for NeXT */ +/* #undef BROKEN_SAVED_UIDS */ + +/* Define if your setregid() is broken */ +/* #undef BROKEN_SETREGID */ + +/* Define if your setresgid() is broken */ +/* #undef BROKEN_SETRESGID */ + +/* Define if your setresuid() is broken */ +/* #undef BROKEN_SETRESUID */ + +/* Define if your setreuid() is broken */ +/* #undef BROKEN_SETREUID */ + +/* LynxOS has broken setvbuf() implementation */ +/* #undef BROKEN_SETVBUF */ + +/* QNX shadow support is broken */ +/* #undef BROKEN_SHADOW_EXPIRE */ + +/* Define if your snprintf is busted */ +/* #undef BROKEN_SNPRINTF */ + +/* strndup broken, see APAR IY61211 */ +/* #undef BROKEN_STRNDUP */ + +/* strnlen broken, see APAR IY62551 */ +/* #undef BROKEN_STRNLEN */ + +/* strnvis detected broken */ +#define BROKEN_STRNVIS 1 + +/* tcgetattr with ICANON may hang */ +/* #undef BROKEN_TCGETATTR_ICANON */ + +/* updwtmpx is broken (if present) */ +/* #undef BROKEN_UPDWTMPX */ + +/* Define if you have BSD auth support */ +/* #undef BSD_AUTH */ + +/* Define if you want to specify the path to your lastlog file */ +/* #undef CONF_LASTLOG_FILE */ + +/* Define if you want to specify the path to your utmp file */ +/* #undef CONF_UTMP_FILE */ + +/* Define if you want to specify the path to your wtmpx file */ +/* #undef CONF_WTMPX_FILE */ + +/* Define if you want to specify the path to your wtmp file */ +/* #undef CONF_WTMP_FILE */ + +/* Need to call setpgrp as root */ +/* #undef DISABLE_FD_PASSING */ + +/* Define if you don't want to use lastlog */ +/* #undef DISABLE_LASTLOG */ + +/* Define if you don't want to use your system's login() call */ +/* #undef DISABLE_LOGIN */ + +/* Define if you don't want to use pututline() etc. to write [uw]tmp */ +/* #undef DISABLE_PUTUTLINE */ + +/* Define if you don't want to use pututxline() etc. to write [uw]tmpx */ +/* #undef DISABLE_PUTUTXLINE */ + +/* Define if you want to disable shadow passwords */ +/* #undef DISABLE_SHADOW */ + +/* Define if you don't want to use utmp */ +#define DISABLE_UTMP 1 + +/* Define if you don't want to use utmpx */ +/* #undef DISABLE_UTMPX */ + +/* Define if you don't want to use wtmp */ +#define DISABLE_WTMP 1 + +/* Define if you don't want to use wtmpx */ +#define DISABLE_WTMPX 1 + +/* Enable for PKCS#11 support */ +#define ENABLE_PKCS11 /**/ + +/* Enable for U2F/FIDO support */ +#define ENABLE_SK /**/ + +/* Enable for built-in U2F/FIDO support */ +/* #undef ENABLE_SK_INTERNAL */ + +/* define if fflush(NULL) does not work */ +/* #undef FFLUSH_NULL_BUG */ + +/* File names may not contain backslash characters */ +/* #undef FILESYSTEM_NO_BACKSLASH */ + +/* fsid_t has member val */ +/* #undef FSID_HAS_VAL */ + +/* fsid_t has member __val */ +/* #undef FSID_HAS___VAL */ + +/* getpgrp takes one arg */ +#define GETPGRP_VOID 1 + +/* Conflicting defs for getspnam */ +/* #undef GETSPNAM_CONFLICTING_DEFS */ + +/* Define if your system glob() function has the GLOB_ALTDIRFUNC extension */ +#define GLOB_HAS_ALTDIRFUNC 1 + +/* Define if your system glob() function has gl_matchc options in glob_t */ +#define GLOB_HAS_GL_MATCHC 1 + +/* Define if your system glob() function has gl_statv options in glob_t */ +/* #undef GLOB_HAS_GL_STATV */ + +/* Define this if you want GSSAPI support in the version 2 protocol */ +/* #undef GSSAPI */ + +/* Define if you want to use shadow password expire field */ +/* #undef HAS_SHADOW_EXPIRE */ + +/* Define if your system uses access rights style file descriptor passing */ +/* #undef HAVE_ACCRIGHTS_IN_MSGHDR */ + +/* Define if you have ut_addr in utmp.h */ +/* #undef HAVE_ADDR_IN_UTMP */ + +/* Define if you have ut_addr in utmpx.h */ +/* #undef HAVE_ADDR_IN_UTMPX */ + +/* Define if you have ut_addr_v6 in utmp.h */ +/* #undef HAVE_ADDR_V6_IN_UTMP */ + +/* 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 HAVE_ARC4RANDOM 1 + +/* 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. */ +/* #undef HAVE_ARC4RANDOM_STIR */ + +/* 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 HAVE_ASPRINTF 1 + +/* OpenBSD's gcc has bounded */ +/* #undef HAVE_ATTRIBUTE__BOUNDED__ */ + +/* Have attribute nonnull */ +#define HAVE_ATTRIBUTE__NONNULL__ 1 + +/* OpenBSD's gcc has sentinel */ +/* #undef HAVE_ATTRIBUTE__SENTINEL__ */ + +/* 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 HAVE_AUTH_HOSTOK 1 + +/* 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. */ +/* #undef HAVE_B64_NTOP */ + +/* 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 HAVE_BCOPY 1 + +/* 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 HAVE_BINDRESVPORT_SA 1 + +/* 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. */ +/* #undef HAVE_BLOWFISH_EXPAND0STATE */ + +/* Define to 1 if you have the 'Blowfish_expandstate' function. */ +/* #undef HAVE_BLOWFISH_EXPANDSTATE */ + +/* Define to 1 if you have the 'Blowfish_initstate' function. */ +/* #undef HAVE_BLOWFISH_INITSTATE */ + +/* 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 HAVE_BN_IS_PRIME_EX 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSD_LIBUTIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSM_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BSTRING_H */ + +/* Define to 1 if you have the 'bzero' function. */ +#define HAVE_BZERO 1 + +/* calloc(0, x) returns NULL */ +#define HAVE_CALLOC 1 + +/* Define if you have caph_cache_tzdata */ +#define HAVE_CAPH_CACHE_TZDATA 1 + +/* 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 HAVE_CAP_RIGHTS_LIMIT 1 + +/* Define to 1 if you have the 'clock' function. */ +#define HAVE_CLOCK 1 + +/* Have clock_gettime */ +#define HAVE_CLOCK_GETTIME 1 + +/* define if you have clock_t data type */ +#define HAVE_CLOCK_T 1 + +/* Define to 1 if you have the 'closefrom' function. */ +#define HAVE_CLOSEFROM 1 + +/* Define to 1 if you have the 'close_range' function. */ +#define HAVE_CLOSE_RANGE 1 + +/* Define if gai_strerror() returns const char * */ +#define HAVE_CONST_GAI_STRERROR_PROTO 1 + +/* 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 HAVE_CRYPT 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRYPTO_SHA2_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CRYPT_H */ + +/* Define if you are on Cygwin */ +/* #undef HAVE_CYGWIN */ + +/* 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 + you don't. */ +#define HAVE_DECL_AI_NUMERICSERV 1 + +/* 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 HAVE_DECL_BZERO 1 + +/* 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 + don't. */ +#define HAVE_DECL_GETENTROPY 1 + +/* 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 + don't. */ +#define HAVE_DECL_GLOB_NOMATCH 1 + +/* 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 + don't. */ +#define HAVE_DECL_HOWMANY 1 + +/* 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 + don't. */ +/* #undef HAVE_DECL_LOGINFAILED */ + +/* 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 + don't. */ +/* #undef HAVE_DECL_LOGINSUCCESS */ + +/* 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 HAVE_DECL_MEMMEM 1 + +/* 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 + don't. */ +#define HAVE_DECL_OFFSETOF 1 + +/* Define to 1 if you have the declaration of 'OPENSSL_IS_BORINGSSL', and to 0 + if you don't. */ +/* #undef HAVE_DECL_OPENSSL_IS_BORINGSSL */ + +/* Define to 1 if you have the declaration of 'OPENSSL_NO_DSA', and to 0 if + you don't. */ +/* #undef HAVE_DECL_OPENSSL_NO_DSA */ + +/* 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 + don't. */ +/* #undef HAVE_DECL_PASSWDEXPIRED */ + +/* 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 + don't. */ +/* #undef HAVE_DECL_SETAUTHDB */ + +/* 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 + 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 HAVE_DECL_WRITEV 1 + +/* 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 + don't. */ +#define HAVE_DECL__GETSHORT 0 + +/* Define to 1 if you have the 'DES_crypt' function. */ +#define HAVE_DES_CRYPT 1 + +/* Define if you have /dev/ptmx */ +/* #undef HAVE_DEV_PTMX */ + +/* Define if you have /dev/ptc */ +/* #undef HAVE_DEV_PTS_AND_PTC */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the 'dirfd' function. */ +#define HAVE_DIRFD 1 + +/* Define to 1 if you have the 'dirname' function. */ +#define HAVE_DIRNAME 1 + +/* 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 HAVE_DSA_GENERATE_PARAMETERS_EX 1 + +/* 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 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. */ +/* #undef HAVE_ENDUTENT */ + +/* Define to 1 if you have the 'endutxent' function. */ +#define HAVE_ENDUTXENT 1 + +/* Define to 1 if you have the 'err' function. */ +#define HAVE_ERR 1 + +/* Define to 1 if you have the 'errx' function. */ +#define HAVE_ERRX 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERR_H 1 + +/* Define if your system has /etc/default/login */ +/* #undef HAVE_ETC_DEFAULT_LOGIN */ + +/* 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. */ +/* #undef HAVE_EVP_CIPHER_CTX_GET_IV */ + +/* Define to 1 if you have the 'EVP_CIPHER_CTX_get_updated_iv' function. */ +#define HAVE_EVP_CIPHER_CTX_GET_UPDATED_IV 1 + +/* 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 HAVE_EVP_CIPHER_CTX_IV_NOCONST 1 + +/* 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 HAVE_EVP_DIGESTFINAL_EX 1 + +/* 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_DigestSign' function. */ +#define HAVE_EVP_DIGESTSIGN 1 + +/* Define to 1 if you have the 'EVP_DigestVerify' function. */ +#define HAVE_EVP_DIGESTVERIFY 1 + +/* 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 HAVE_EVP_MD_CTX_COPY_EX 1 + +/* 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 HAVE_EVP_PKEY_GET_RAW_PRIVATE_KEY 1 + +/* 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 HAVE_EVP_SHA256 1 + +/* 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 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 HAVE_EXPLICIT_BZERO 1 + +/* Define to 1 if you have the 'explicit_memset' function. */ +/* #undef HAVE_EXPLICIT_MEMSET */ + +/* Define to 1 if you have the 'fchmod' function. */ +#define HAVE_FCHMOD 1 + +/* Define to 1 if you have the 'fchmodat' function. */ +#define HAVE_FCHMODAT 1 + +/* Define to 1 if you have the 'fchown' function. */ +#define HAVE_FCHOWN 1 + +/* Define to 1 if you have the 'fchownat' function. */ +#define HAVE_FCHOWNAT 1 + +/* Use F_CLOSEM fcntl for closefrom */ +/* #undef HAVE_FCNTL_CLOSEM */ + +/* 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 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. */ +/* #undef HAVE_FIDO_ASSERT_SET_CLIENTDATA */ + +/* 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. */ +/* #undef HAVE_FIDO_CRED_SET_CLIENTDATA */ + +/* 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. */ +/* #undef HAVE_FIDO_DEV_GET_TOUCH_BEGIN */ + +/* 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. */ +/* #undef HAVE_FIDO_DEV_IS_WINHELLO */ + +/* 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 HAVE_FLOCK 1 + +/* Define to 1 if you have the 'fmt_scaled' function. */ +/* #undef HAVE_FMT_SCALED */ + +/* 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 HAVE_FREEADDRINFO 1 + +/* Define to 1 if you have the 'freezero' function. */ +/* #undef HAVE_FREEZERO */ + +/* 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 HAVE_FSFILCNT_T 1 + +/* Define to 1 if you have the 'fstatfs' function. */ +#define HAVE_FSTATFS 1 + +/* Define to 1 if you have the 'fstatvfs' function. */ +#define HAVE_FSTATVFS 1 + +/* Define to 1 if you have the 'futimes' function. */ +#define HAVE_FUTIMES 1 + +/* 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 HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the 'getaudit' function. */ +/* #undef HAVE_GETAUDIT */ + +/* Define to 1 if you have the 'getaudit_addr' function. */ +/* #undef HAVE_GETAUDIT_ADDR */ + +/* Define to 1 if you have the 'getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the 'getentropy' function. */ +#define HAVE_GETENTROPY 1 + +/* Define to 1 if you have the 'getgrouplist' function. */ +#define HAVE_GETGROUPLIST 1 + +/* Define to 1 if you have the 'getgrset' function. */ +/* #undef HAVE_GETGRSET */ + +/* Define to 1 if you have the 'getlastlogxbyname' function. */ +/* #undef HAVE_GETLASTLOGXBYNAME */ + +/* Define to 1 if you have the 'getline' function. */ +#define HAVE_GETLINE 1 + +/* Define to 1 if you have the 'getluid' function. */ +/* #undef HAVE_GETLUID */ + +/* Define to 1 if you have the 'getnameinfo' function. */ +#define HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the 'getopt' function. */ +#define HAVE_GETOPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_GETOPT_H 1 + +/* Define if your getopt(3) defines and uses optreset */ +#define HAVE_GETOPT_OPTRESET 1 + +/* Define if your libraries define getpagesize() */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the 'getpeereid' function. */ +#define HAVE_GETPEEREID 1 + +/* Define to 1 if you have the 'getpeerucred' function. */ +/* #undef HAVE_GETPEERUCRED */ + +/* Define to 1 if you have the 'getpgid' function. */ +#define HAVE_GETPGID 1 + +/* Define to 1 if you have the 'getpgrp' function. */ +#define HAVE_GETPGRP 1 + +/* Define to 1 if you have the 'getpwanam' function. */ +/* #undef HAVE_GETPWANAM */ + +/* Define to 1 if you have the 'getrandom' function. */ +#define HAVE_GETRANDOM 1 + +/* 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. */ +/* #undef HAVE_GETSEUSERBYNAME */ + +/* Define to 1 if you have the 'getsid' function. */ +#define HAVE_GETSID 1 + +/* Define to 1 if you have the 'gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the 'getttyent' function. */ +#define HAVE_GETTTYENT 1 + +/* Define to 1 if you have the 'getutent' function. */ +/* #undef HAVE_GETUTENT */ + +/* Define to 1 if you have the 'getutid' function. */ +/* #undef HAVE_GETUTID */ + +/* Define to 1 if you have the 'getutline' function. */ +/* #undef HAVE_GETUTLINE */ + +/* Define to 1 if you have the 'getutxent' function. */ +#define HAVE_GETUTXENT 1 + +/* Define to 1 if you have the 'getutxid' function. */ +#define HAVE_GETUTXID 1 + +/* Define to 1 if you have the 'getutxline' function. */ +#define HAVE_GETUTXLINE 1 + +/* 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. */ +/* #undef HAVE_GET_DEFAULT_CONTEXT_WITH_LEVEL */ + +/* 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 HAVE_GROUP_FROM_GID 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_GENERIC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_GSSAPI_GENERIC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_GSSAPI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_GSSAPI_KRB5_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_GSSAPI_KRB5_H */ + +/* 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. */ +/* #undef HAVE_HMAC_CTX_INIT */ + +/* Define if you have ut_host in utmp.h */ +/* #undef HAVE_HOST_IN_UTMP */ + +/* Define if you have ut_host in utmpx.h */ +#define HAVE_HOST_IN_UTMPX 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IAF_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IA_H */ + +/* Define if you have ut_id in utmp.h */ +/* #undef HAVE_ID_IN_UTMP */ + +/* Define if you have ut_id in utmpx.h */ +#define HAVE_ID_IN_UTMPX 1 + +/* 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 HAVE_INET_ATON 1 + +/* 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 HAVE_INET_NTOP 1 + +/* 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 HAVE_INTMAX_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* 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 HAVE_IN_ADDR_T 1 + +/* 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 HAVE_KILLPG 1 + +/* 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. */ +/* #undef HAVE_KRB5_FREE_ERROR_MESSAGE */ + +/* 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. */ +#define HAVE_LANGINFO_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LASTLOG_H */ + +/* Define if you want ldns support */ +/* #undef HAVE_LDNS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBAUDIT_H */ + +/* Define to 1 if you have the 'bsm' library (-lbsm). */ +/* #undef HAVE_LIBBSM */ + +/* Define to 1 if you have the 'dl' library (-ldl). */ +#define HAVE_LIBDL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBGEN_H 1 + +/* Define if system has libiaf that supports set_id */ +/* #undef HAVE_LIBIAF */ + +/* Define to 1 if you have the 'network' library (-lnetwork). */ +/* #undef HAVE_LIBNETWORK */ + +/* 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). */ +/* #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). */ +/* #undef HAVE_LIBXNET */ + +/* Define to 1 if you have the 'z' library (-lz). */ +#define HAVE_LIBZ 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_AUDIT_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_FILTER_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_IF_TUN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_SECCOMP_H */ + +/* 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 HAVE_LOCALTIME_R 1 + +/* 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 HAVE_LOGIN_GETCAPBOOL 1 + +/* 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. */ +/* #undef HAVE_LOGOUT */ + *** 8036 LINES SKIPPED *** From nobody Wed Feb 19 19:58:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YynJG2r2yz5nbMK; Wed, 19 Feb 2025 19:58: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 4YynJG2D6kz46gy; Wed, 19 Feb 2025 19:58:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739995102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inbGAxLCNs2nWaZn3tfkjflItLgVRsv+5RSdsou0ezA=; b=VuLoApWxz0dBerBjfQEFhnMMTOK9Af+Homqd9jLfXvblc2kYyr+ZRmWYKzGFl3WsHx5J6h ZHQnCnNNUaaFhualOWdOAla8kKruCIjM3jvwn7LR/VPoQ98v2w6anLhQRMiM2Ma0CYdfvC OBP5gXR3gNw8SaOYZv399+GhxtGKXAbyYWxoNXYuiANOJio9qGg7Kp4KAWKjzEiUGXPXKK etLiX97UQiKaI5jLhMYJuicJFBt+lXm0ES7V6lAhB+iOvC1uqeJ7v8aRmns5Uyj1gdBSbG HLyaEvzYCMUBy5H5jWQXlt53y/ZWfOiz22Xxd4G5BpDCoyuRDSuyXM7m7uR1XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739995102; a=rsa-sha256; cv=none; b=TBsLm18Ji73V9Y3VSF7YRVjW/8fVfgDMz2f0VIFdC6AKjN4/bX2P0EiR8tS9T9zr+cdTNz VR0AzK79d5Ya3YbZO8vTSXGONhiRa+UQVNiJ5O8AdZb67shvpUqmVVJguP5Xt3xA30iRk2 v5ltGKJ+i5FMs0bFSAjSygecZaqely6P2sizVw0mtaG0jzWm8od0MxjhSboFXTzkp5x6rS v8UQl3eZMqFlpp/JoEOrLpBQ2KiaucAqg1Vb0T4E153CTcaubb8pV9bE3+Tbx1LkeJYTSU luMfP7qmTyg71SrXlV2iBalSOtg+awIHEvVwbaU7GaDz2YFnJNvlPcghZ9tLMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739995102; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=inbGAxLCNs2nWaZn3tfkjflItLgVRsv+5RSdsou0ezA=; b=F8fLxYWlCmbwFadyKBBZ61LAuLLSHWImm6OV7RV/cnAhWfHBNkuW3+BvilaC5fAn8aLJB5 2+k08QtAxjFt//5scd2yu99bQSPafw6u22YldH8IPy9ae0nKkY4++MUaRp9XUiJ+S7FF+q duGSWtbpIRbAgWIjpYX9qVyFo0DlbCggMb3slXyf7BN5q2SyQbRvJrYaMX7DOAEyyy/tgk ZTLOM/VdQbNwse0iYS+ZNw9trFsNor+L4Yk4lB2ximOUJLdj8DEI9GHFvBsvuPrph44XAk foXI7dLpl2JW4uR3ImISuJ3Jsiadm8E+IAqTzc3HIePDVDAasNlBX6hJNQMuDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YynJG1XMbz4q8; Wed, 19 Feb 2025 19:58: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 51JJwM8u078637; Wed, 19 Feb 2025 19:58:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JJwMRD078634; Wed, 19 Feb 2025 19:58:22 GMT (envelope-from git) Date: Wed, 19 Feb 2025 19:58:22 GMT Message-Id: <202502191958.51JJwMRD078634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7f8a5c5a1585 - main - upgt: Deprecate ancient 802.11b/g driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785 commit 7f8a5c5a1585fd9b56adfd8de4f9194ba5cc0785 Author: Ed Maste AuthorDate: 2025-02-18 13:18:56 +0000 Commit: Ed Maste CommitDate: 2025-02-19 19:57:43 +0000 upgt: Deprecate ancient 802.11b/g driver Recently-reported bugs in this driver should be fixed, but also the hardware it supports is obsolete so mark it for deprecation. PR: 284876 Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49045 --- share/man/man4/upgt.4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/share/man/man4/upgt.4 b/share/man/man4/upgt.4 index 805d045e61dd..508c87c6a925 100644 --- a/share/man/man4/upgt.4 +++ b/share/man/man4/upgt.4 @@ -48,7 +48,7 @@ .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 17, 2008 +.Dd February 18, 2025 .Dt UPGT 4 .Os .Sh NAME @@ -74,6 +74,11 @@ module at boot time, place the following line in .Bd -literal -offset indent if_upgt_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is slated to be removed in +.Fx 15.0 . .Sh DESCRIPTION The .Nm From nobody Wed Feb 19 20:05:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YynT32n1Hz5nbvJ; Wed, 19 Feb 2025 20:05: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 4YynT31n9qz49KW; Wed, 19 Feb 2025 20:05:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739995559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vaO3pcapVNM+ESxKf7j3XJ7Kcg/gKtB88/s31AsBY/w=; b=j1VWpQOBsYa+3LtdeP3gjDgk0bEoESjN2e6A4LjBBOcITD2Hm5zdxT1AW08U/sKqCzdw28 8oKDpgDoiS/S2TTz7T6na92OR8C2DB1S60RpRDasehYr3qidnDtTPdTwkuJ7RSMEDrx73A BneorWxIxGuFttHUOjAncG8tuI8Q3+yEE+tp9KRzaQ9wgb8qbAJlUTpmtEjyAFZLsufdsI uQKiEbZJ9XeXUtYEG6sTw7Xxwt1CJlGY/ztwJ0O5dUiGXUSnJNNxUkCtHD7c9LWYGMnYSi U6FowfGbhz46C/Q0d9QH1L2APB7eLqQ94diZtjKzY6NUrb/q/lIriquJ8rQfsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739995559; a=rsa-sha256; cv=none; b=iZgsXfHzWTyw+53OtjTrgj30aRqF5sK/Je8n5FylbtMBCo0skjO6a1/JA1ptT93rMniOV9 kkkp0INjUwqDY2bZQiNwhLpFT+zSgSRpgfIRuqaucGhe7xE3Eazj/DlQcv7P6Nmn3o0ieC c1mpuMgEheyA1NtrXoMQBRa8FDoEivsOwD5ampCtPFG7gK/Q+BqBcEvKkUyq+JnQT5xiMD YKAZtG5AYhgmZT9/3PqXPpPJQ3zNiNxqbaZDVfBSorEIPpaJdsO7ZWWCF5nR5CP82svDjK 6FavDmbYyp4nE7n9ObUhsFW3/NiES/qr3ZTBPuZID09l3APexqzzI7apiZZR3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739995559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vaO3pcapVNM+ESxKf7j3XJ7Kcg/gKtB88/s31AsBY/w=; b=HdaW/VymyD2vdNovvK9matp29izHNOPPqQphw88JaFS6/DVrH1TykKTbt64ofU2NKKuVQ6 Qxpt1Uuc8LzCOnEJxldTIY/+RfFpczH9bvx/0upP2B0Q7s8fCPkEj1cW5PNVrh7Wn+7rMW Ekj/6zTGX3zjeRwi6lsLlFkpiN2mmpUJQY3gaz5a2KWxliReOU7OLt4UiebjO+XTQkg5vw X//qUegKDfZts1fta6xXVqQRwbMN1hSCGUYmoG5lCofDECF+E/T8OYoIWPggQnXcuI5Iy4 q3bP+YGeKlpr/ocSIJiPwDhEMKPgU8BdcnD0USDQM1DQXDjhhz61P19yGnsxVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YynT319hhz4r7; Wed, 19 Feb 2025 20:05: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 51JK5xaN097658; Wed, 19 Feb 2025 20:05:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JK5xmZ097655; Wed, 19 Feb 2025 20:05:59 GMT (envelope-from git) Date: Wed, 19 Feb 2025 20:05:59 GMT Message-Id: <202502192005.51JK5xmZ097655@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: cdb24fbb0a75 - main - libsys: Don't create or expose __realpathat List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cdb24fbb0a75209043efd3b5e94faa57dfc44bd1 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=cdb24fbb0a75209043efd3b5e94faa57dfc44bd1 commit cdb24fbb0a75209043efd3b5e94faa57dfc44bd1 Author: Brooks Davis AuthorDate: 2025-02-19 16:53:32 +0000 Commit: Brooks Davis CommitDate: 2025-02-19 20:05:47 +0000 libsys: Don't create or expose __realpathat Previously, __realpathat was in libc and libsys (as is currently standard), but not exported from libc which meant the stub in libc was not filtered and thus libc's copy of the syscall was used. This broke an upcoming change to CheriBSD limiting syscalls to libsys. The realpath(3) implementation now uses __sys___realpathat so there are no consumers of __realpathat. Switch it to PSEUDO (only _foo and __sys_foo symbols) and remove __realpathat from Symbol.map. This is a corrected version of 58d43a3cd72a4a85ab8489313672c7eab367495e. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49049 --- lib/libsys/Makefile.sys | 1 + lib/libsys/Symbol.map | 1 - libexec/rtld-elf/rtld-libc/Makefile.inc | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libsys/Makefile.sys b/lib/libsys/Makefile.sys index b38cd5935e2f..491c765e9416 100644 --- a/lib/libsys/Makefile.sys +++ b/lib/libsys/Makefile.sys @@ -50,6 +50,7 @@ STATICOBJS+= interposing_table.o .endif PSEUDO= \ + __realpathat \ clock_gettime \ exit \ getlogin \ diff --git a/lib/libsys/Symbol.map b/lib/libsys/Symbol.map index 51ea1b5da231..eb71c813ae86 100644 --- a/lib/libsys/Symbol.map +++ b/lib/libsys/Symbol.map @@ -3,7 +3,6 @@ FBSDprivate_1.0 { __libsys_errno; __getosreldate; __libsys_interposing_slot; - __realpathat; _elf_aux_info; freebsd11_fstat; freebsd11_fstatat; diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index c3a74fbecbdc..14f31f05829d 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -58,7 +58,7 @@ _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ sysarch __sysctl issetugid __getcwd utrace getpid \ thr_self thr_kill pread mmap lseek _exit \ getdirentries _close _fcntl _open _openat _read \ - _sigprocmask _write readlink __realpathat _setjmp setjmp setjmperr + _sigprocmask _write readlink ___realpathat _setjmp setjmp setjmperr # Finally add additional architecture-dependent libc dependencies From nobody Wed Feb 19 20:19:38 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yynms3YHQz5ncRk; Wed, 19 Feb 2025 20:19:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta004.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yynmr6Fj2z3CBF; Wed, 19 Feb 2025 20:19:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTPS id kg5wtwZ0u5MqykqXktq4bn; Wed, 19 Feb 2025 20:19:40 +0000 Received: from spqr.komquats.com ([70.66.136.217]) by cmsmtp with ESMTPSA id kqXite9gp4k0okqXjt3DIW; Wed, 19 Feb 2025 20:19:40 +0000 X-Auth-User: cschuber X-Authority-Analysis: v=2.4 cv=fLKa3oae c=1 sm=1 tr=0 ts=67b63cdc a=h7br+8Ma+Xn9xscxy5znUg==:117 a=h7br+8Ma+Xn9xscxy5znUg==:17 a=kj9zAlcOel0A:10 a=T2h4t0Lz3GQA:10 a=6I5d2MoRAAAA:8 a=HU1OPnRnAAAA:8 a=EkcXrb_YAAAA:8 a=YxBL1-UpAAAA:8 a=j9ArpBs3sUbxuZrqQqYA:9 a=CjuIK1q_8ugA:10 a=Cil3w7wJrOMA:10 a=y4ddQsrDJA4A:10 a=vQ5cN67eHy2kcvnFvKcb:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 2CCD610E; Wed, 19 Feb 2025 12:19:38 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 18A35A8; Wed, 19 Feb 2025 12:19:38 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ed Maste cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 0fdf8fae8b56 - main - openssh: Update to 9.8p1 In-reply-to: <202502191721.51JHL9CT090248@gitrepo.freebsd.org> References: <202502191721.51JHL9CT090248@gitrepo.freebsd.org> Comments: In-reply-to Ed Maste message dated "Wed, 19 Feb 2025 17:21:09 +0000." List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 19 Feb 2025 12:19:38 -0800 Message-Id: <20250219201938.18A35A8@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCxnDp2ZvOAo2xttjYrdjrNmsOFTcMKlEIkVu3TloKuuZtcLOF7Hj0+ZVdIE1sYf//j1Oj7L9PQoxKuay5Z5Fzcc+U10bisuPOSU3A3JhudJKiXjNkRY CrSIgyL2kQoRw8vMgzDyR3qx7kOabFmSncqHb1/hgMDF3mUW3uOVsdNJqkkI0r6Tgnvm6tklP2dFBE8er+mphm48JJMRgzmjdRhr7h6ywr3QRImkisNM13un nZkcPid1WDFaHYaINL1IMkeQqf78iIsxlyDwixyMEZ7GrHiLnZNJQtf9rE1lX9eH6aBXXyZV0102QRRsGVUDoi/5ivTJeYO43YataMtP4Eo= X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] X-Rspamd-Queue-Id: 4Yynmr6Fj2z3CBF X-Spamd-Bar: ---- In message <202502191721.51JHL9CT090248@gitrepo.freebsd.org>, Ed Maste writes: > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=0fdf8fae8b569bf9fff3b5171e669dcd > 7cf9c79e > > commit 0fdf8fae8b569bf9fff3b5171e669dcd7cf9c79e > Merge: fdccf0336197 d565364dadeb > Author: Ed Maste > AuthorDate: 2025-02-19 17:20:44 +0000 > Commit: Ed Maste > CommitDate: 2025-02-19 17:20:44 +0000 > > openssh: Update to 9.8p1 > > Highlights from the release notes are reproduced below. Some security > and bug fixes were previously merged into FreeBSD and have been elided. > See the upstream release notes for full details > (https://www.openssh.com/releasenotes.html). > > --- > > Future deprecation notice > ========================= > > OpenSSH plans to remove support for the DSA signature algorithm in > early 2025. > > Potentially-incompatible changes > -------------------------------- > > * sshd(8): the server will now block client addresses that > repeatedly fail authentication, repeatedly connect without ever > completing authentication or that crash the server. See the > discussion of PerSourcePenalties below for more information. > Operators of servers that accept connections from many users, or > servers that accept connections from addresses behind NAT or > proxies may need to consider these settings. > > * sshd(8): the server has been split into a listener binary, sshd(8), > and a per-session binary "sshd-session". This allows for a much > smaller listener binary, as it no longer needs to support the SSH > protocol. As part of this work, support for disabling privilege > separation (which previously required code changes to disable) and > disabling re-execution of sshd(8) has been removed. Further > separation of sshd-session into additional, minimal binaries is > planned for the future. > > * sshd(8): several log messages have changed. In particular, some > log messages will be tagged with as originating from a process > named "sshd-session" rather than "sshd". > > * ssh-keyscan(1): this tool previously emitted comment lines > containing the hostname and SSH protocol banner to standard error. > This release now emits them to standard output, but adds a new > "-q" flag to silence them altogether. > > * sshd(8): (portable OpenSSH only) sshd will no longer use argv[0] > as the PAM service name. A new "PAMServiceName" sshd_config(5) > directive allows selecting the service name at runtime. This > defaults to "sshd". bz2101 > > New features > ------------ > > * sshd(8): sshd(8) will now penalise client addresses that, for various > reasons, do not successfully complete authentication. This feature is > controlled by a new sshd_config(5) PerSourcePenalties option and is > on by default. > > * ssh(8): allow the HostkeyAlgorithms directive to disable the > implicit fallback from certificate host key to plain host keys. > > Portability > ----------- > > * sshd(8): expose SSH_AUTH_INFO_0 always to PAM auth modules > unconditionally. The previous behaviour was to expose it only when > particular authentication methods were in use. > > * ssh(1), ssh-agent(8): allow the presence of the WAYLAND_DISPLAY > environment variable to enable SSH_ASKPASS, similarly to the X11 > DISPLAY environment variable. GHPR479 > > --- > > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D48914 I think it was this commit but could have been a later commit. I'm seeing the following error: cwsys# service sshd restart Performing sanity check on sshd configuration. /etc/ssh/sshd_config line 70: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 77: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 128: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 129: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 132: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 133: Unsupported option GSSAPIAuthentication Stopping sshd. Waiting for PIDS: 3432. Performing sanity check on sshd configuration. /etc/ssh/sshd_config line 70: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 77: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 128: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 129: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 132: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 133: Unsupported option GSSAPIAuthentication Starting sshd. /etc/ssh/sshd_config line 70: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 77: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 128: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 129: Unsupported option GSSAPIAuthentication /etc/ssh/sshd_config line 132: Unsupported option KerberosAuthentication /etc/ssh/sshd_config line 133: Unsupported option GSSAPIAuthentication cwsys# -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Wed Feb 19 20:48:03 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YypPc2Clbz5nfHm; Wed, 19 Feb 2025 20:48: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 4YypPc1Br0z3Gbb; Wed, 19 Feb 2025 20:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x13Mh1FFupBYIh0a7tRhHEVfW8Zcgf3ixGQ95t/dANE=; b=Zyb8colWVnb9fJliA2srCqyr8s1nV+OKk+CPoEKKRZOG/bKZ8tz6ME+Ri3kRphXnogIEfq FLyMrBHTeV135eBeOZDHjR8fpMaOZS3J0xIJ9i7heurLy5bnQaTR6AjXwmmzzDhrPbYGZg CNlOE5+nkq09rlWM9tXjIoJFC8EaE4onNM1I/FRNjiJos8uUB+DLNU9PhqbESm7vSBdYQF uD7GkG3BrK/waeg5J6NJYOOyA1Cj/E5C3pCdjLOtrUneHrG3w2hYqDQ0RaXnQCW1Tj5glP Rq0grTwfYwR6daHUtK0CsjfKvMtZvoNSLMRkRQ7N61cghkSR7N+TodJVvVhfIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739998084; a=rsa-sha256; cv=none; b=Mf26fUpzwZnCqCSuQ9AvT18h02/Ulm+DFZC4r7siRN+P3XsG6Q8/oDJNBpsGl2+6CkpzI2 bBzZBJxwORYk4V2IKvKib8WDAHjjMGiL0tlnxNOmsTRS/b3rVixihJeT6ZRPrbMcUteYF3 Vc+laR9B69wH7bCm2OYYLOy8YFSFmG674oK5ab6ybljpvVbo8GI2st/aro3qiFi3UMtzRq G6tWYF27UIkAyVP67LmObJJLGY49oKY2mMKrY/gY6nanIqeo7IGuJ3PRut1d79VCTYQplV sh/2z9ZCIeqDciuEUfF4f+3Bxqn7KuHsjtTDzKSUmUpzaNgMnCG+nk8q08/nAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x13Mh1FFupBYIh0a7tRhHEVfW8Zcgf3ixGQ95t/dANE=; b=CWcfYJMxCQ06mjpuzacl9PnXLvM3E0FIK1anTI8GeviY8WEHwwr/ENQqWpAlomGlZp9MzQ c2aG2dxw/KThToRK2oa6OkzlkkpOJQg+igf9vfBZ4GOpRdu72O0ifHNewFbJV/fZeFOClx AY76KBpqrp8TsELeqR+KVIsim4g+btcoh/t96GzCu12Y7GpUfcltHNtGrzM2oRgazueq2H QwD4Uh86DZs2pj/eTp2aVWp1oW3UzoLhS1IB6N+4ijYWR+zmv9w6WCxB2VgjsSv4hYywzB Su1y2sMHuEfuRDNzLE5nAVvxyC0aKAru0ynxPW7Cu1emkwHHKFopJMuYrynWJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YypPc0SYpz50h; Wed, 19 Feb 2025 20:48: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 51JKm3s7072004; Wed, 19 Feb 2025 20:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JKm32Y072001; Wed, 19 Feb 2025 20:48:03 GMT (envelope-from git) Date: Wed, 19 Feb 2025 20:48:03 GMT Message-Id: <202502192048.51JKm32Y072001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: 585cdb74f4a6 - main - linuxkpi: Defaults to `get_file_rcu()` version from Linux 6.7 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 585cdb74f4a6a578fc307ed5af940708c26acde4 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=585cdb74f4a6a578fc307ed5af940708c26acde4 commit 585cdb74f4a6a578fc307ed5af940708c26acde4 Author: Jean-Sébastien Pédron AuthorDate: 2025-02-05 18:08:29 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-02-19 20:39:46 +0000 linuxkpi: Defaults to `get_file_rcu()` version from Linux 6.7 To use the old version, one has to explicitly set `LINUXKPI_VERSION` to the expected version of Linux KPI. Reported by: bz Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48860 --- sys/compat/linuxkpi/common/include/linux/fs.h | 8 ++++---- sys/compat/linuxkpi/common/src/linux_compat.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 56de0e3e490a..76a81e676744 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -264,17 +264,17 @@ get_file(struct linux_file *f) return (f); } -struct linux_file * linux67_get_file_rcu(struct linux_file **f); +struct linux_file * linux_get_file_rcu(struct linux_file **f); struct linux_file * get_file_active(struct linux_file **f); -#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60700 -#define get_file_rcu(f) linux67_get_file_rcu(f) -#else +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION < 60700 static inline bool get_file_rcu(struct linux_file *f) { return (refcount_acquire_if_not_zero( f->_file == NULL ? &f->f_count : &f->_file->f_count)); } +#else +#define get_file_rcu(f) linux_get_file_rcu(f) #endif static inline struct inode * diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 3e2938ab2c2b..af6cc01d8020 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1105,7 +1105,7 @@ __get_file_rcu(struct linux_file **f) } struct linux_file * -linux67_get_file_rcu(struct linux_file **f) +linux_get_file_rcu(struct linux_file **f) { struct linux_file *file1; From nobody Wed Feb 19 20:48:04 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YypPd2Mb6z5nfgf; Wed, 19 Feb 2025 20:48: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 4YypPd0v47z3G1B; Wed, 19 Feb 2025 20:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ANoFzb+0jmc/GW9DxiHWrfGbnV4LjYYIWCem7pRQeA=; b=NzfvDlcyiARo1RJUeUhCk30MGbx5UXu8gNO+RUZQWuqOooiswtF0ur6DbBg6bL5YgxU/9y U5Vt0ACeUOWr35t9hPzHNsVFGTyn1/wHx8iUS4Xda7iXQ4WlIYQyrFBHSxsV8IPnku6tJf g9UJFTFidP7QS1wNgyYMFlyy2sojoEZTP8PFKZgqCl8tm0ovoVfkHn1uCx3gkq9o5kz+L1 0qzHMpNP57q/ve33y59lCfrBd+mw3YFCoew5rcgHcf9Fr2BONG7/NLyRcRC8uDQ29gUz8Z ri8kA7yEESlDn3GXFnmqrMn1doekK84klpzTdMI0fIi8e/icFPP1lswhuG6qYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739998085; a=rsa-sha256; cv=none; b=DQ8fs0LjgyG+oRPtWuWYoLrw+C6JpHUU9D95LqPGp+ikZUfR/ZITrDXR34vP1Qh3mvjmWS Hu7N8CZeLDAOF7/7qNQA8AbcmrvgpLRO5cIfFiWMHvyBq452BaSln+6mzr9gNPXl3ghcGO 8hzQYH/kysA1TuPyqk75C1eBTq+YcM9c1NsY8i42aETQwJRQgsFyCwg/JLhh74ZwPFfDsQ UoI9epQ58A2J7iHWiZ6Nxv+t06RMKx4X8lZzrS1xQm3jscu/mayFvY+r2+SOdNU+iBySuh uOPp1ivBGd+JLx0kHh+7AtDxFCSC9gOKrjqgQiVKWa1i8WHU44Y9lSraROso1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ANoFzb+0jmc/GW9DxiHWrfGbnV4LjYYIWCem7pRQeA=; b=wSAJKXrAebupwzmi8dyfvKPM5y7NqL8pZNqK3bmqwVQrlP/bfJFDFaRpSu2Pk9fDwrUv/m fHIuN+kEWbrpIjrPYvu6PA3zjGeyfV84b+sikGW93ZbN6AQlWK+Ocg+kTk3qyWQX2/Pey4 smYXS6liu1hiUVQ1ze/xv0ghgE4P8w6rLiKwVfUzvua/6AjMUBcVAElYpOYPkYuH7hHLqt DwVZR+HDcuW1vLcOoVCsgfeIvl577KnIMhBY3w2Jn1JohQKBEc0chMjy8Fv+vBnELJIWPS +7LgQMYMyYKagj0AJ3zI9pq52MYvbrUvqRDKxyRFCswTmpugzyBpH+zmeVZtvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YypPd0PM6z5RB; Wed, 19 Feb 2025 20:48: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 51JKm4Ra072043; Wed, 19 Feb 2025 20:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JKm4Tr072040; Wed, 19 Feb 2025 20:48:04 GMT (envelope-from git) Date: Wed, 19 Feb 2025 20:48:04 GMT Message-Id: <202502192048.51JKm4Tr072040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: dec2806f9681 - main - linuxkpi: Define `PCI_IRQ_LEGACY` for Linux < 6.10 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dec2806f9681b44937c63f0d875e96d09d38fab5 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=dec2806f9681b44937c63f0d875e96d09d38fab5 commit dec2806f9681b44937c63f0d875e96d09d38fab5 Author: Jean-Sébastien Pédron AuthorDate: 2025-02-05 18:11:32 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-02-19 20:39:46 +0000 linuxkpi: Define `PCI_IRQ_LEGACY` for Linux < 6.10 Commit 03e39d3d42e70482cd6f65ecaa5cf8ff9674d27c decreased the Linux version that exposes this constant to be Linux 6.7. It happens that the constant is older. However, it is removed in Linux 6.10. Let's change the version condition to say that it is defined for any version before 6.10. Reported by: bz Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48861 --- sys/compat/linuxkpi/common/include/linux/pci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index 64f44812ee3e..b3f89760dac9 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -238,7 +238,7 @@ extern const char *pci_power_names[6]; #define PCI_IRQ_MSIX 0x04 #define PCI_IRQ_ALL_TYPES (PCI_IRQ_MSIX|PCI_IRQ_MSI|PCI_IRQ_INTX) -#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION >= 60700) +#if defined(LINUXKPI_VERSION) && (LINUXKPI_VERSION <= 61000) #define PCI_IRQ_LEGACY PCI_IRQ_INTX #endif From nobody Wed Feb 19 20:48:06 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YypPg2tS9z5nfdk; Wed, 19 Feb 2025 20:48: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 4YypPf43mKz3GNB; Wed, 19 Feb 2025 20:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eFT/y7id7La/UNHMhyjE9nHWPysMPd2TeaM289qsFUc=; b=vHXAtJDIeUnFgMpLXCEdoMzFT/0piu3tBvK+cH1ZNDTHb4f2741VPkRgkMM7RnxqSNU1OP AymKTsO1qfbGvGro4fHhb6ugPkmkMI+3f0HNdbaqffcxU/MuVjNRnSjTGn4g4HydDAtrY6 n75qHXNuaScVImHGw+pO7Pr60+mmpnalj5NnCgkeFw60Iuyhw2J1fyKR+nD/ZN2xANT0CM nmEF3s62pDASnosS8g9v5+6oWuC2SNeI4VB6SfFbXO10vrVMNfpfGo17YHf9L/S6CfdeF2 wfQnxBu97dRiUjTQvp6KFQNo+Bmt0Kboxz+f3w1HawwZMlKd+1xeoA1VxWMEVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739998086; a=rsa-sha256; cv=none; b=Ajl3PDLUfSAlp0cPt7/66E2PfrJDcalNLTD0eUbdbRpv9obIuJ4+PYN5O+6oRGR3HRNt/T QZKZWs788U39X2uc3/Od/a2qttrCPWo/fimVmh891bTiBW2M/ZKvSTZzblW9dyEoKq1MJk WxOjLU5riJETa0KQCsu2B7e8xR4VqR3nzqaSLsori4YYdC3KCyKtQO8dFRx9FDDtTaywDE /aaIjbf1Ypkmp9CRJpdXhOnVDj+VaBz7Nn1lKqG63RXnzCHNT1tiIgGwjtpyI5TWCCdB4k 9k0xEfAOzRGJqcwTIyoXmk3/UWjDz21end/6RrYy2a4UY/Uyo9AxtJjNAgMisA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eFT/y7id7La/UNHMhyjE9nHWPysMPd2TeaM289qsFUc=; b=rtlfXvrDpnGt8dbShvQOBf46ydaCA1eOhC+2kpbW7rs52cBEAbfooypyipiS5WmVAifuKC QqE8De3g1EpfyIGLambfDHEgws+F4V55dJ6lWAAyLLx6iOZLbMauIfOG2vEhNfEy6/NufH KnbmtGb5q62Yl9R0h1atKQU6ELcXXxFG2GEyrfPFAOPi6bMtJUzSKGXIwf1yTG1QaEJ4Nw Y6ryuSr49eIfvsutc+3mrZWi8LFqTvzS3BVUbamUlBVpTRBUAeXJdejzl6DSwHtMGQLngf cP9o5AfQ0CKB2cqQfMBNmdpsrNGvOjkTDMKeDbPHyX86bhi9Jxgd9ph68i3TAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YypPf1MSJz5y9; Wed, 19 Feb 2025 20:48: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 51JKm61V072082; Wed, 19 Feb 2025 20:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JKm6Fa072079; Wed, 19 Feb 2025 20:48:06 GMT (envelope-from git) Date: Wed, 19 Feb 2025 20:48:06 GMT Message-Id: <202502192048.51JKm6Fa072079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: 1396a7316f40 - main - linuxkpi: Print "TODO" if a driver call `pci_wake_from_d3()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1396a7316f40267e8ff28b9d2d79206ebb20a330 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=1396a7316f40267e8ff28b9d2d79206ebb20a330 commit 1396a7316f40267e8ff28b9d2d79206ebb20a330 Author: Jean-Sébastien Pédron AuthorDate: 2025-02-05 18:17:07 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-02-19 20:39:46 +0000 linuxkpi: Print "TODO" if a driver call `pci_wake_from_d3()` This helps developers working with linuxkpi find out a function is already defined but is just a stub. Reported by: bz Reviewed by: bz, emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48862 --- sys/compat/linuxkpi/common/include/linux/pci.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/pci.h b/sys/compat/linuxkpi/common/include/linux/pci.h index b3f89760dac9..31475d6dc7c3 100644 --- a/sys/compat/linuxkpi/common/include/linux/pci.h +++ b/sys/compat/linuxkpi/common/include/linux/pci.h @@ -60,6 +60,8 @@ #include #include +#include /* pr_debug */ + struct pci_device_id { uint32_t vendor; uint32_t device; @@ -1504,6 +1506,7 @@ static inline int pci_wake_from_d3(struct pci_dev *pdev, bool enable) { + pr_debug("%s: TODO\n", __func__); return (0); } From nobody Wed Feb 19 20:48:07 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YypPh4Ffdz5nfrN; Wed, 19 Feb 2025 20:48: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 4YypPg2Yn6z3GNL; Wed, 19 Feb 2025 20:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/1F82RyqPyI8b9UfudcWupStyT7xAMR4K+FKZO/BSc=; b=gnEHtMz8eFVJ2VMjAUE70duq9EAk/Bd8+TklGJl8whJxWmIzFwUe5qrjGSJ9L/MPrf0oj3 Q+gU8Kme3MAh2KfDO+pCQrqaxhdJwyL+PyH4eANxfXMuGLNe4eUJOTkeHgX47knHyDvRUJ 8aoUOieCbMv+XDFmj5y1EseYUodmFBOU/M68fqXpXs8nqVvBUxhxjUNYGJShDtg2MPf5Cv f0DaMJhXLuSVgKViES7lGlm4yGOg2KcddggxbC3vLjhwrbcLqBnBYGKEQX7L23z1pMD8/k J0mkVnzdL3xs3O91Xk3WcYWemIV9vgZ32YCZubOuvKsRjxgZRax/B6eUpB5WKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739998087; a=rsa-sha256; cv=none; b=Pc5KDEvBriQExZhewy2uK3U+TdPCMq/ObUsZn80X4Q8nA05I0pkPp317twcMQVwco3ET75 VU5vmsYPgTmaS+eXle5bB7aod77pvJtxjXXJQq/ai/ZjXz6shEisDJ2BCJMQYMzy9DLy75 rpCa5tcVtFoett9eFDgcWV6gUZGzDxjr5EZcw4ir/gg2aXXewqflAryiqTkalCMHiATAZ8 wy689TfKxtRHFfYyJyieuivI336xe8hN1IkpI7ODZ5ZehtDw7wiFu5PSLPftS7mSGP1FrO wu4dDvXvdec57NK8tGszjbX3MO0zXZVJMu9ZqI4qCHkub/hMRH6WgVER64hIfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739998087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7/1F82RyqPyI8b9UfudcWupStyT7xAMR4K+FKZO/BSc=; b=cyeFmatR+VSqmDP7ElcTYOKsDkWsK9/yqFDzYgJqtZT6rtL9w/KvHL6eaViVKPA2CkREI9 OTOR/4DGWhDDiuZkpW38csc9exyahBaK6+b2DTzFhswS0lzodpnytZ5GTFcusSBFedJDix UYefRXzYnNNm/y5Vun4AvSuEY2haQxzR2VnCxdhqfUh9/c0B7ZuklpbJP3Ng8kY+OaVVQR NP4GmReCPjnu1GiahPL2Ox/jyP8MOS0jxHomg6pxm83HX1Iii3bgr+QrlgePAyebhNe9ST 6xEiGjD20+IlhcF1jRolgFL6nJelyn2allwlPeel6CRMCMR7vhlVjCL57EpoBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YypPg21q5z69V; Wed, 19 Feb 2025 20:48: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 51JKm7hI072127; Wed, 19 Feb 2025 20:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51JKm7Ts072124; Wed, 19 Feb 2025 20:48:07 GMT (envelope-from git) Date: Wed, 19 Feb 2025 20:48:07 GMT Message-Id: <202502192048.51JKm7Ts072124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Jean-S=C3=A9bastien?= =?utf-8?Q?P=C3=A9dron?= Subject: git: 05dfaadde4ae - main - linuxkpi: Add `shrinker_alloc()` and `shrinker_free()` List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dumbbell X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05dfaadde4ae0f5d823836d5d849e3ba5ebdbf17 Auto-Submitted: auto-generated The branch main has been updated by dumbbell: URL: https://cgit.FreeBSD.org/src/commit/?id=05dfaadde4ae0f5d823836d5d849e3ba5ebdbf17 commit 05dfaadde4ae0f5d823836d5d849e3ba5ebdbf17 Author: Jean-Sébastien Pédron AuthorDate: 2024-12-22 18:10:23 +0000 Commit: Jean-Sébastien Pédron CommitDate: 2025-02-19 20:39:46 +0000 linuxkpi: Add `shrinker_alloc()` and `shrinker_free()` They are used by the DRM drivers in Linux 6.7. Bump `FreeBSD_version` because external drivers that use `struct shrinker` will have to be recompiled. Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48747 --- .../linuxkpi/common/include/linux/shrinker.h | 16 +++++++++++++ sys/compat/linuxkpi/common/src/linux_shrinker.c | 28 ++++++++++++++++++++++ sys/sys/param.h | 2 +- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/shrinker.h b/sys/compat/linuxkpi/common/include/linux/shrinker.h index 88cbca2dcf60..eb95dafb83ce 100644 --- a/sys/compat/linuxkpi/common/include/linux/shrinker.h +++ b/sys/compat/linuxkpi/common/include/linux/shrinker.h @@ -27,6 +27,8 @@ #define _LINUXKPI_LINUX_SHRINKER_H_ #include + +#include #include struct shrink_control { @@ -39,6 +41,7 @@ struct shrinker { unsigned long (*count_objects)(struct shrinker *, struct shrink_control *); unsigned long (*scan_objects)(struct shrinker *, struct shrink_control *); int seeks; + unsigned int flags; void * private_data; long batch; TAILQ_ENTRY(shrinker) next; @@ -48,10 +51,23 @@ struct shrinker { #define DEFAULT_SEEKS 2 +#define SHRINKER_REGISTERED BIT(0) +#define SHRINKER_ALLOCATED BIT(1) + +struct shrinker *linuxkpi_shrinker_alloc( + unsigned int flags, const char *fmt, ...); int linuxkpi_register_shrinker(struct shrinker *s); void linuxkpi_unregister_shrinker(struct shrinker *s); +void linuxkpi_shrinker_free(struct shrinker *shrinker); void linuxkpi_synchronize_shrinkers(void); +#define shrinker_alloc(flags, fmt, ...) \ + linuxkpi_shrinker_alloc(flags, fmt __VA_OPT__(,) __VA_ARGS__) +#define shrinker_register(shrinker) \ + linuxkpi_register_shrinker(shrinker) +#define shrinker_free(shrinker) \ + linuxkpi_shrinker_free(shrinker) + #if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 60000 #define register_shrinker(s, ...) linuxkpi_register_shrinker(s) #else diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index 52a0472348d8..18200fa0bc01 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -32,10 +32,26 @@ #include #include +#include TAILQ_HEAD(, shrinker) lkpi_shrinkers = TAILQ_HEAD_INITIALIZER(lkpi_shrinkers); static struct sx sx_shrinker; +struct shrinker * +linuxkpi_shrinker_alloc(unsigned int flags, const char *fmt, ...) +{ + struct shrinker *shrinker; + + shrinker = kzalloc(sizeof(*shrinker), GFP_KERNEL); + if (shrinker == NULL) + return (NULL); + + shrinker->flags = flags | SHRINKER_ALLOCATED; + shrinker->seeks = DEFAULT_SEEKS; + + return (shrinker); +} + int linuxkpi_register_shrinker(struct shrinker *s) { @@ -44,6 +60,7 @@ linuxkpi_register_shrinker(struct shrinker *s) KASSERT(s->count_objects != NULL, ("NULL shrinker")); KASSERT(s->scan_objects != NULL, ("NULL shrinker")); sx_xlock(&sx_shrinker); + s->flags |= SHRINKER_REGISTERED; TAILQ_INSERT_TAIL(&lkpi_shrinkers, s, next); sx_xunlock(&sx_shrinker); return (0); @@ -55,9 +72,20 @@ linuxkpi_unregister_shrinker(struct shrinker *s) sx_xlock(&sx_shrinker); TAILQ_REMOVE(&lkpi_shrinkers, s, next); + s->flags &= ~SHRINKER_REGISTERED; sx_xunlock(&sx_shrinker); } +void +linuxkpi_shrinker_free(struct shrinker *shrinker) +{ + + if (shrinker->flags & SHRINKER_REGISTERED) + unregister_shrinker(shrinker); + + kfree(shrinker); +} + void linuxkpi_synchronize_shrinkers(void) { diff --git a/sys/sys/param.h b/sys/sys/param.h index d3344c41562a..6645130e2614 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500032 +#define __FreeBSD_version 1500033 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From nobody Wed Feb 19 23:35:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yyt7J54fsz5nrk3; Wed, 19 Feb 2025 23: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 4Yyt7J4S9Kz3dBT; Wed, 19 Feb 2025 23: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=1740008156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zj5cxgdE06p/P3VtMmifSLB2ZtDZcF8+v4TpQYTqJys=; b=evy5qsvRO0V3SbLUDeNppR+B7S3AJZcdFp1vZDVjABfVl5ZHTGSD46TTasVOMhZuYuXJ77 WSZq5Q11weJDdtmUT/UBnaLvzyfbOWw2d8tdCAsOkb5xSktH83QcBD1ntAGCRy8RopbACX yYiKWz6bR9q9XvzZelvtKj9G7RdFVMmqzG/E8t5xLKBqlP2TG+Vp3Zapw/vImzgY6M7j0w RU8KVC0cHEZ/FwsGS5HZMnmqb0+3kV5z4cf7p1CLP582OCjYib9Ebo6HWq7k9zzqi8+A8m xKksfL2OPuTuxsMk3nBz/m305GkBLlc4m5kKSn3nvYl9ZS46h3r+9Pov52SLxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740008156; a=rsa-sha256; cv=none; b=WpBbZC5kq5KZxrCjEdIRM5uWArJLxlqmjz4wddinZsVEFstrF6nHoJB7CdgTzQeKse3+G+ R2yR3TZMzynqhMx70ZemkIRKf0AbmSqcv8wOpsqvV2yf9yjiD0oFg2NTaEAV0taGHQ8L1P HKtvWtpoe/LCmCif6tiMMm9DJeD44LmYhytv3daN7nqOWl4cMLKG1FUA400cn5zS4lol/m fKPexLSzlvIRc0yHUz2jvv9ZJsnXibbc/2QbPHd/EBZWquRubFoK2d7l9TJD7ob50IMnP+ 4pDlyLUopNNQxPB/yTk9hWc9p5tSe+zhl4dFzLgNtDmbIaxZ7LNUvMSRzjOAew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740008156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zj5cxgdE06p/P3VtMmifSLB2ZtDZcF8+v4TpQYTqJys=; b=Vo7YH/+XOuFEe8eDeEZ15FAPTKeth3W+Wvs3spvz2tKkMPXligZ0vP+5kMmyf55KRhIAJw h/EvEpDE0hbfMpewMAQHXi61FZV8rdjOjV9P56bqd+AAox4cilCDNSZLhN7WkFXqoQr3pF AkWyQ5V3OjLaQX+85SgI0uyrFaQakpWyMsdramO8Ojoio4EETqwydjjpOfm9e44gFBsjZq I+PL4z2XOof/wHPsFtf5GUoy5DGNq67zPVvZHbXzV5Z7yH1Bh4GYhOyYirUwwywwIwKR/R rjjF3wZqLVRn0/kFhO4WX9lNiTAEtChc+38eBmvwjhQI1cYrTDiDgLYQVUgqbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yyt7J3w9czBF6; Wed, 19 Feb 2025 23: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 51JNZuHN090047; Wed, 19 Feb 2025 23: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 51JNZurv090044; Wed, 19 Feb 2025 23:35:56 GMT (envelope-from git) Date: Wed, 19 Feb 2025 23:35:56 GMT Message-Id: <202502192335.51JNZurv090044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 56c8c19046c4 - main - nfscl: Return appropriate reply status for NFSv4.1 callbacks List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56c8c19046c46cb9e89c2a3967f8cf2cd0ace428 Auto-Submitted: auto-generated The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=56c8c19046c46cb9e89c2a3967f8cf2cd0ace428 commit 56c8c19046c46cb9e89c2a3967f8cf2cd0ace428 Author: Rick Macklem AuthorDate: 2025-02-19 23:34:53 +0000 Commit: Rick Macklem CommitDate: 2025-02-19 23:34:53 +0000 nfscl: Return appropriate reply status for NFSv4.1 callbacks Certain NFSv4.1 callbacks are not currently supported/used by the FreeBSD client. Without this patch, NFS4ERR_NOTSUPP is replied for the callbacks. Since NFSv4.1 does not specify all of these callbacks as optional, I think it is preferable to reply NFS_OK or NFS4ERR_REJECT_DELEG instead of NFS4ERR_NOTSUPP. This patch changes the reply status for these unsupported callbacks, which the client has no use for. I am not aware of any NFSv4.1 servers that will perform any of these callbacks against the FreeBSD client at this time. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clstate.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 16d201d65b34..7d1aab753628 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3989,6 +3989,25 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) NFSUNLOCKCLSTATE(); } break; + case NFSV4OP_CBNOTIFY: + case NFSV4OP_CBRECALLOBJAVAIL: + case NFSV4OP_CBNOTIFYLOCK: + /* + * These callbacks are not necessarily optional, + * so I think it is better to reply NFS_OK than + * NFSERR_NOTSUPP. + * All provide information for which the FreeBSD client + * does not currently have a use. + * I am not sure if any of these could be generated + * by a NFSv4.1/4.2 server for this client? + */ + error = 0; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; + case NFSV4OP_CBPUSHDELEG: + error = NFSERR_REJECTDELEG; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS; From nobody Thu Feb 20 04:19:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz0Qs628Xz5pBsv; Thu, 20 Feb 2025 04:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yz0Qs2DNkz3LBd; Thu, 20 Feb 2025 04:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740025189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KH6QSlTeuydKuwQppgqSd10/Y+ysqaokh9urZIkBZtk=; b=qDfFu5U8yYbNYjuqfTOblCBrS3x/CJKZdYQDWko5I9fpZEQAuxF08JmGHlEkeRAVxeAKuq gJ+fznpeHSI5dKWI4BRTE5Nzb1QQHyipqoPtucHICPDiftDyfHM4rsOar1+aTVxLSWf7Ly VBe7pvyV06yAt9KGnMmCx1fvgXTz/J0mT6qD263ZDxmZclwfIUq5JkMUaxyXe4bYxnZPXk 8VIjvhWYRl0w038VzSw7IJllclUUznTN00+7eXr9uu8s4i+BnA7bd0Wnn1MWyysMfHwxqw Y0Kigt9TnRnvyFTXhWnpAYCI/V74Znz7hc0gTyTXCMtgo5+9Z1mVWQaywCCyNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740025189; a=rsa-sha256; cv=none; b=svpWkeIhRpWr/zEe5BpAQxI1y6wck6H7iByTHCtjbeKrYwubUaT5fbkEzNB0lOyEcj4Bvu ervmvN2HXJBWW5Pn14VbEbYjFwXnoUx4+V3nz9zQgv/88B7fHjSa3x52JWFMmTCXHC+v7d 544Ya+M7uyeiu7/MEM2l68/PKl8dfl398eso3rVcFPB5HhLfNMuNhTr08OfWL9g1DsiUcd 6bz6nWiKC54U/ssAmYl3gnlUQ/IzUT8U4nTpJs20KbzjbdZ1P9crrtV64JqwPzP9LGpVLc 6Kk6ypSQ3+/S1MVOhYRd8btuh7Faw5631C8mZtkdqLvBjPLovflxKJhjlZD0bw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740025189; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KH6QSlTeuydKuwQppgqSd10/Y+ysqaokh9urZIkBZtk=; b=xsC+OH6nNpHQeHqNWermz9vevEoiZy5mhTX3THRqHyxUjzNc1BnzWnc4YV7sKFbhYMiTh7 NPO20ueQlPG9ZcG6khWP/23/6YaXGzESHSumrsxMXw4egD1X5aV0RL8DCM+WL1I8iD+rPP ZU5wStGkDU5F/nX3CaS9xm5kwQmvVxlopDyNIAU8Wk9jExTU6Fzn6ennzCvLTBELGelfYG EAiJxFoVkLvRSs1O9uY0Bz8wQ+h0+9nMkEFX3ZHoA/238tVjKY3jJ8m/AxoJASt+PNNlSJ Vr2424ZNVgeIh9hKBCLwbXRDiqspMsXKRIHSmHI/GIP66yGEOSs0zeOpXd8mJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yz0Qs1PP3zbs5; Thu, 20 Feb 2025 04:19:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51K4JnM5015523; Thu, 20 Feb 2025 04:19:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51K4Jn7s015519; Thu, 20 Feb 2025 04:19:49 GMT (envelope-from git) Date: Thu, 20 Feb 2025 04:19:49 GMT Message-Id: <202502200419.51K4Jn7s015519@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: dcb4ae528d35 - main - openssh: Add GSSAPI and Kerberos support to sshd Makefile List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcb4ae528d357f34e4a4b4882c2757c67c98e395 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=dcb4ae528d357f34e4a4b4882c2757c67c98e395 commit dcb4ae528d357f34e4a4b4882c2757c67c98e395 Author: Jose Luis Duran AuthorDate: 2025-02-20 04:11:30 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-20 04:18:04 +0000 openssh: Add GSSAPI and Kerberos support to sshd Makefile Reported by: cy Reviewed by: emaste Approved by: emaste (mentor) Fixes: 0fdf8fae8b56 ("openssh: Update to 9.8p1") --- secure/usr.sbin/sshd/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index 4e1f330076b4..d5bcf008e233 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -16,6 +16,12 @@ moduli: .MADE LIBADD= ssh util +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" +CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h +LIBADD+= gssapi_krb5 gssapi krb5 +.endif + .if ${MK_TCP_WRAPPERS} != "no" CFLAGS+= -DLIBWRAP=1 LIBADD+= wrap From nobody Thu Feb 20 05:02:16 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz1Mt2wd7z5pDZw for ; Thu, 20 Feb 2025 05:02:18 +0000 (UTC) (envelope-from 0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yz1Mr6xDdz3XYK for ; Thu, 20 Feb 2025 05:02:16 +0000 (UTC) (envelope-from 0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57 header.b="AgCd61S/"; dkim=pass header.d=amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=Thsjk1+l; dmarc=pass (policy=none) header.from=tarsnap.com; spf=pass (mx1.freebsd.org: domain of 0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com designates 54.240.8.176 as permitted sender) smtp.mailfrom=0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1740027736; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=US3Q1lWSfEYAe520pT9qOUR4MalGqPWLbdHNsUE9Z9c=; b=AgCd61S/K4FKdOZEx5Vm8SuXfynjzpwODWqygcDmFBQePZT/PQFXew99dkry/0qU IRsM/4XFSGaycUzye0xQQZNJCwYlrFmcboeHICes/1AGaRVZfUdPX6jSrL65gA5sL7B FvrjXXNSDrItuaxD7JoZWZJH2e09wKmrsOmgcMKo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1740027736; h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=US3Q1lWSfEYAe520pT9qOUR4MalGqPWLbdHNsUE9Z9c=; b=Thsjk1+lJscABh/VNSQ6YXIZObA1kdbKel30k0cv53ASCGAG/aI+JZcSDIjFxGfV /WTJ0l1ysrKHEXRysCv8wRhMWxaj2R1+bQ+q8DMLkEUaEhr1b4jS1A9gnXSYowSFFK5 X5XjcQCAtt4F7KW7kOjI/3sKySvZatLWtK5zrz3g= Message-ID: <0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@email.amazonses.com> Date: Thu, 20 Feb 2025 05:02:16 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin To: "Bjoern A. Zeeb" , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Feedback-ID: ::1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2025.02.20-54.240.8.176 X-Spamd-Result: default: False [-1.27 / 15.00]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.965]; DMARC_POLICY_ALLOW(-0.50)[tarsnap.com,none]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18:c]; RWL_MAILSPIKE_VERYGOOD(-0.20)[54.240.8.176:from]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57,amazonses.com:s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; DWL_DNSWL_NONE(0.00)[amazonses.com:dkim]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@FreeBSD.org]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,0100019521bc3085-bc8b294c-738c-4529-8234-fcb81991d083-000000@amazonses.com]; RCPT_COUNT_THREE(0.00)[4]; RCVD_IN_DNSWL_NONE(0.00)[54.240.8.176:from]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+] X-Rspamd-Queue-Id: 4Yz1Mr6xDdz3XYK X-Spamd-Bar: - On 2/18/25 18:57, Bjoern A. Zeeb wrote: > commit 61ce422531805307d413bf04c9ad1aabd7f3a879 > Author: Bjoern A. Zeeb > > wlanstats: move from tools to usr.sbin Looks like this resulted in it being compiled with a higher WARNS, which broke the build on some platforms (so far powerpc and powerpcspe have failed the weekly snapshots): > /usr/src/usr.sbin/wlanstats/wlanstats.c:842:29: error: cast from 'struct bsdstat *' to 'struct wlanstatfoo_p *' increases required alignment from 4 to 8 [-Werror,-Wcast-align] > 842 | struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Please fix the build before you MFC. :-) -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Thu Feb 20 09:35:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz7R247Wtz5nc6q; Thu, 20 Feb 2025 09: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 4Yz7R23Qbyz3L8J; Thu, 20 Feb 2025 09: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=1740044126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQgQy1B3LLyg+M2+8Cpbk2BUlstsRJ3+5vCecXWiQMs=; b=O/OQjvEwW0FqF5tBD77Je8aV650rAstg51fhj6+fXJsB3Hdlr9dfA/aiPEDm+dcj/HDpHW GcGGxjs0Cy/0yS6tjo2mKXXC3v8wPZZxHzvbK3H2sC1qZMGE3b0lBr84unN7HEVcEfqnrV 9+SCOJSPeSzbljLfRHeo2DgnqkIK9OwRGb0200nLd0yPiQA8DLTp7VMsAz1Zrt172LgAwa eek9Rs2xuoR0FcbTTSN2GdCT5GKTNLMwmlGGUg7a7BuxlAgZLloEHD72ueGbAEWOUI+Qyn ej1bNOO+5MpUlnqvRanI4DGHxwwhpUHKl7Bji9Twoox1URjtjG5nhyxFfmJKdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740044126; a=rsa-sha256; cv=none; b=lHeRMV/quas6fuMDVN5VDMRY0UbXx4BlathCC2Fzvr8iB+kYZIRq8SIbJ+GECI/c9ljxSB eLn++BsK2h7ndrqvj6Lfj1ySx4mj32EivN80RasGARD8jepGzlnHq61YousQCMbkyyxHds NQBBaFFSJNrc9LkcbG67Tle66NtIl5hdAf+Q1IkcpIGAvlJgqzTDsFxQMOq/A1ljfXztd5 Rp11xPGHkcaOaDozGSQgoAPhOYTatpYOXS/5lVf9Lj0W9lCWA15vJA/8aHJA5TtHYhKGkz GMLY3eK5FTEYVit7tCQ8oysE8/JN9wt71RtmC7WIzT+LQk9WGduT/Tn0vBF9bA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740044126; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kQgQy1B3LLyg+M2+8Cpbk2BUlstsRJ3+5vCecXWiQMs=; b=WQ6L3FiVDH+ykp47X9JM4eB6Pp5nsoilzfaXUw3uPoQdVQ9WtXuKY7L+cviArHm/xWYYZS kKeqej3nFQ9HbZFbvWNXYXs6qVyIwO8dNjwOV09sqJ34h9aEVMTro4Xie4HCuuny6FNpg0 Kc6gcpR0WKDHTkZ0KOEL/EpZQtGP1dCRgjUbKP70JgB7Se5rBWHqU8Dt3bCG+26UH6eVNo HkDNBfpHPpKu94KRhPkHQApsRbxI3rCy3/zMfWFtwCTjloEVf0KCp/HBJwvqXcj/W1I5nK 392ytey07HxdVmuHHN1OZJ8H+Gu+neblb6P1pWZ5wtWAzxUXSrRqR84GFwhhmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yz7R231jGzmkv; Thu, 20 Feb 2025 09: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 51K9ZQ2h031999; Thu, 20 Feb 2025 09: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 51K9ZQWh031996; Thu, 20 Feb 2025 09:35:26 GMT (envelope-from git) Date: Thu, 20 Feb 2025 09:35:26 GMT Message-Id: <202502200935.51K9ZQWh031996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: bc830a1acca6 - main - pf: use siphash for pf_lb List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc830a1acca67b74283d40d7ebdb048f9af3567e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bc830a1acca67b74283d40d7ebdb048f9af3567e commit bc830a1acca67b74283d40d7ebdb048f9af3567e Author: Kristof Provost AuthorDate: 2025-02-12 16:56:45 +0000 Commit: Kristof Provost CommitDate: 2025-02-20 08:25:50 +0000 pf: use siphash for pf_lb for ipv6, we stretch it out a bit, but good enough. ok reyk Obtained from: OpenBSD, tedu , a558d13e2f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_lb.c | 60 +++++++++++++++++++------------------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 9c2d7b4c71b6..dce0520793fa 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -47,6 +47,8 @@ #include #include +#include + #include #include #include @@ -82,19 +84,6 @@ static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, pf_sn_types_t); static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); -#define mix(a,b,c) \ - do { \ - a -= b; a -= c; a ^= (c >> 13); \ - b -= c; b -= a; b ^= (a << 8); \ - c -= a; c -= b; c ^= (b >> 13); \ - a -= b; a -= c; a ^= (c >> 12); \ - b -= c; b -= a; b ^= (a << 16); \ - c -= a; c -= b; c ^= (b >> 5); \ - a -= b; a -= c; a ^= (c >> 3); \ - b -= c; b -= a; b ^= (a << 10); \ - c -= a; c -= b; c ^= (b >> 15); \ - } while (0) - /* * hash function based on bridge_hash in if_bridge.c */ @@ -102,38 +91,35 @@ static void pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, struct pf_poolhashkey *key, sa_family_t af) { - u_int32_t a = 0x9e3779b9, b = 0x9e3779b9, c = key->key32[0]; + SIPHASH_CTX ctx; +#ifdef INET6 + union { + uint64_t hash64; + uint32_t hash32[2]; + } h; +#endif + + _Static_assert(sizeof(*key) >= SIPHASH_KEY_LENGTH, ""); switch (af) { #ifdef INET case AF_INET: - a += inaddr->addr32[0]; - b += key->key32[1]; - mix(a, b, c); - hash->addr32[0] = c + key->key32[2]; + hash->addr32[0] = SipHash24(&ctx, (const uint8_t *)key, + &inaddr->addr32[0], sizeof(inaddr->addr32[0])); break; #endif /* INET */ #ifdef INET6 case AF_INET6: - a += inaddr->addr32[0]; - b += inaddr->addr32[2]; - mix(a, b, c); - hash->addr32[0] = c; - a += inaddr->addr32[1]; - b += inaddr->addr32[3]; - c += key->key32[1]; - mix(a, b, c); - hash->addr32[1] = c; - a += inaddr->addr32[2]; - b += inaddr->addr32[1]; - c += key->key32[2]; - mix(a, b, c); - hash->addr32[2] = c; - a += inaddr->addr32[3]; - b += inaddr->addr32[0]; - c += key->key32[3]; - mix(a, b, c); - hash->addr32[3] = c; + h.hash64 = SipHash24(&ctx, (const uint8_t *)key, + &inaddr->addr32[0], 4 * sizeof(inaddr->addr32[0])); + hash->addr32[0] = h.hash32[0]; + hash->addr32[1] = h.hash32[1]; + /* + * siphash isn't big enough, but flipping it around is + * good enough here. + */ + hash->addr32[2] = ~h.hash32[1]; + hash->addr32[3] = ~h.hash32[0]; break; #endif /* INET6 */ } From nobody Thu Feb 20 09:35:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz7R36Hmgz5nbkx; Thu, 20 Feb 2025 09: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 4Yz7R34MN5z3Kwx; Thu, 20 Feb 2025 09: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=1740044127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ATAfAZRax1qRodh2k7cED+vhhuJWOgVRlx2z3caXP4=; b=odV34q8jeaM9S9rvsybLPJS45FCymL2cdTX3LrvoPnBGgOJ1h9Sa4FqZAVkqxMrpzgj65O NFi/Zf+Of5j4Soo5lq0ewwzqeiLmD7u8Z9FbcNPef/9Y+nbF+9v8TDauzJbWAR/02akGpw cZniqHhF6pwGaSZ5dJbwZm8+Z68iMCg5kXX9+N0F/CRaEfmiPms8WYJcZ0fMZnZ/lA4q1G tc7QkV7U+l5/zFTS31n+FE6pOPeii7t8wgzyyaZpy4IhbsbI2IcjoBbRVW8QqHv+CsJ6/o F8QC8uEB9ZtybFtEUOOIcq1r1VcpuC24o6xN/hl2+j9ixpLhdKm3kSySk7h6wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740044127; a=rsa-sha256; cv=none; b=TYMH5uTusRET1GHhXoU/x+8uESNMh2E1u6HBtP9DpugXDaEcwjYqdTylXo1YO/q9JeKQOI tqfDjbMWDjHBPgdQQiiC7oT8aGHQZ5w2vCIxiJdgE6ZriFI/fz+er7n6uBJdNGJA6Zl2ls yhnofTJ3fLZQLeh8zlqv/tHCmC6CNRHrnjYdR6PMc36N0jN6MHfTgqdhpoOZwZlpHlYYRF ZnZKiWHfFQul9zr/4Jgjh/sGTX/5fLO/UYElYiYNWbEomj1rdHXR6leIm+rs6rrWOIrVL9 VKIKNkgp5uJXh4/8864bD7hyzSX7Y84xg+J8K+K1fjsZXAVv6WJ7URv9c42mtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740044127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ATAfAZRax1qRodh2k7cED+vhhuJWOgVRlx2z3caXP4=; b=v1J5hoQ3GpCgGmQXcH77EoxTS8wewGiyYaerqYbtlrvcDvExbHh1fI4wBJgmha4bRjM/kz y1hhKCfUlleZY1OnP7UD6XAbVN+5/Q3cwc/iEimM48ezPYNW5Hewb08ygvI3nXozkn+9Aj M2YKCRFeBQVOLhY5t5884eARTiJK/ISaCzy8woh+THm0Z3cNmf+WRbzSHb9yO+iPzAY1p0 /HML6+DOONRwlUB3PkU/vdBI+kCmwOKl11+tCL0PApUKqtiWxTKNE5jhdaU1+DPQAiRwHn CoEThyZjbz9mpXBWalAavZZZBTwHirCf528HewVdN0qDW20jc2EDQ5iBw3QcUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yz7R33yKSzmhh; Thu, 20 Feb 2025 09: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 51K9ZRsH032032; Thu, 20 Feb 2025 09: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 51K9ZRQs032029; Thu, 20 Feb 2025 09:35:27 GMT (envelope-from git) Date: Thu, 20 Feb 2025 09:35:27 GMT Message-Id: <202502200935.51K9ZRQs032029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 050691f35094 - main - pf: Comment is no longer true, remove it. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 050691f35094fcef2d0744f49297e94b002123a3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=050691f35094fcef2d0744f49297e94b002123a3 commit 050691f35094fcef2d0744f49297e94b002123a3 Author: Kristof Provost AuthorDate: 2025-02-12 17:00:50 +0000 Commit: Kristof Provost CommitDate: 2025-02-20 08:25:50 +0000 pf: Comment is no longer true, remove it. Obtained from: OpenBSD, mcbride , 6263ddcd7c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_lb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index dce0520793fa..83dd63fd2290 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -84,9 +84,6 @@ static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, pf_sn_types_t); static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); -/* - * hash function based on bridge_hash in if_bridge.c - */ static void pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, struct pf_poolhashkey *key, sa_family_t af) From nobody Thu Feb 20 09:35:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yz7R54HgVz5nbR3; Thu, 20 Feb 2025 09: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 4Yz7R45rW8z3LF6; Thu, 20 Feb 2025 09:35:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740044128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U8CE1qw6+EbL7Ew87Bo6vegqVlrZaBRwXhPt2pqEmAo=; b=B2y0hr8o6/UX6Rb07iJKB7w0b0jCGDg/zf/ICPwrdIKHmoZPBqzbQLBmHQ5frKvs+J7sC4 czMRU+bzCXUPvvVJ8dGFp7NwpZQjxlaod8YzC/xyoifaTdn1M0VRmoQ8CJYwwd14Wp4ZOf EN+wfxgBcCX9/PUJekICl1NNx64YAA6unv+ijqGdsGLuSfI0eEXEG3rr9bTsKNG0l3sins o+L/waaNB2XvMHXUSF96/XgHx7tF2VcQzhd5/xtgfXBRYS1iF2YJg6Bju2i5qg2LT3HF0a g/rY/QpdVMN4fTmc1/l7JvlA50dRzYW88NpuLWI+txHX6m9Z6mmjFVHhW/PyTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740044128; a=rsa-sha256; cv=none; b=yvHfj6GAOuzVqFgaOMRM4ivMnag3f/MKpLK45XcF+aN3ZfqnOQotBE0eMONyIKGHwljivU 92QlEw51+MV5qpLn3To8Oltxq/BDspg3tnQLj062i+nCsivb2jzKqM3o3BmmF49v63Fm/U WmWn2ee29v3yJ7iVWOCTE7BshY98oMCzUNW+7/axDmqz+rOAKW5BzDFeyQn+YPuC/jWvAr yHT2QEuS8qGTN2H4jtPm5vPksjQKaLK8MdYRDb4BzX5lPl5zDmaY0o+MRDhd0TaxexJ1o6 +XVP8KjKU4Z/QH3QGTKbIzMTYg3TQoikXXpf9M+aTO+PoMmKXlyF5CxEv+4NPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740044128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U8CE1qw6+EbL7Ew87Bo6vegqVlrZaBRwXhPt2pqEmAo=; b=F4MLwyR1ZfihRuMMmeawZfX+g6ecKyoSuNx8qvA/4TRtMiqYbMJYdwMybqGq+MYuDz4M3c hZTQQ8ncYAY8GQjRHRoWzLr8PLwljGvewyiONuuVw1BLIGD3zpa5+drerhzJ1HkoMJw/X6 k3XDV3tiW4FGRdx+dHx7UfAHVvlOv/J7PHx9DL5EJVFfcLFAxwsmLw6gs5R5Fws+BmDv7Z fCgKlkjQ4VIQz3+S4alsuN3f1G6SQVUIeuySGk9JUA4/sa9hK2PVc52gQVR61vPExS8ag7 bfeEN55a62DVlOl7Hd4H9C97WmnLcx3VPT162u39octo0nOhWw7VuxKT8/3Tvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yz7R4521Tzmhj; Thu, 20 Feb 2025 09:35: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 51K9ZSAI032065; Thu, 20 Feb 2025 09: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 51K9ZSQV032062; Thu, 20 Feb 2025 09:35:28 GMT (envelope-from git) Date: Thu, 20 Feb 2025 09:35:28 GMT Message-Id: <202502200935.51K9ZSQV032062@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: c2346c3d3ab7 - main - pf: support source-hash and random with tables and dynifs, not just pools List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2346c3d3ab754299d1e75705997db6fb9a49420 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c2346c3d3ab754299d1e75705997db6fb9a49420 commit c2346c3d3ab754299d1e75705997db6fb9a49420 Author: Kristof Provost AuthorDate: 2025-02-13 13:14:56 +0000 Commit: Kristof Provost CommitDate: 2025-02-20 08:25:51 +0000 pf: support source-hash and random with tables and dynifs, not just pools This finally allows to use source-hash for dynamic loadbalancing, eg. "rdr-to source-hash", instead of just round-robin and least-states. An older pre-siphash version of this diff was tested by many people. OK tedu@ benno@ Obtained from: OpenBSD, reyk , 252a05523f Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 43 ++++++++++-------------- share/man/man5/pf.conf.5 | 10 +++--- sys/netpfil/pf/pf.h | 5 +++ sys/netpfil/pf/pf_lb.c | 74 ++++++++++++++++++++++++++++++++++------- tests/sys/netpfil/pf/nat64.sh | 76 +++++++++++++++++++++++++++++++++---------- 5 files changed, 148 insertions(+), 60 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index f3334c961909..8f732bdf268a 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -2747,16 +2747,16 @@ pfrule : action dir logquick interface route af proto fromto $5.host->addr.type == PF_ADDR_TABLE || DYNIF_MULTIADDR($5.host->addr))) r.route.opts |= PF_POOL_ROUNDROBIN; - if ((r.route.opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN && - disallow_table($5.host, "tables are only " - "supported in round-robin routing pools")) - YYERROR; - if ((r.route.opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN && - disallow_alias($5.host, "interface (%s) " - "is only supported in round-robin " - "routing pools")) + if ($5.host->next != NULL && + !PF_POOL_DYNTYPE(r.route.opts)) { + yyerror("address pool option " + "not supported by type"); + } + if (!PF_POOL_DYNTYPE(r.route.opts) && + (disallow_table($5.host, + "tables are not supported by pool type") || + disallow_alias($5.host, + "interface (%s) is not supported by pool type"))) YYERROR; if ($5.host->next != NULL) { if ((r.route.opts & PF_POOL_TYPEMASK) != @@ -2829,10 +2829,9 @@ pfrule : action dir logquick interface route af proto fromto r.nat.opts = $9.nat.pool_opts.type; r.nat.opts |= $9.nat.pool_opts.opts; - if ((r.nat.opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN && - disallow_table($9.nat.rdr->host, "tables are only " - "supported in round-robin pools")) + if (!PF_POOL_DYNTYPE(r.nat.opts) && + disallow_table($9.nat.rdr->host, "tables are not " + "supported by pool type")) YYERROR; } @@ -4916,17 +4915,11 @@ natrule : nataction interface af proto fromto tag tagged rtable $9->host->addr.type == PF_ADDR_TABLE || DYNIF_MULTIADDR($9->host->addr))) r.rdr.opts = PF_POOL_ROUNDROBIN; - if ((r.rdr.opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN && - disallow_table($9->host, "tables are only " - "supported in round-robin redirection " - "pools")) - YYERROR; - if ((r.rdr.opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN && - disallow_alias($9->host, "interface (%s) " - "is only supported in round-robin " - "redirection pools")) + if (!PF_POOL_DYNTYPE(r.rdr.opts) && + (disallow_table($9->host, + "tables are not supported by pool type") || + disallow_alias($9->host, + "interface (%s) is not supported by pool type"))) YYERROR; if ($9->host->next != NULL) { if ((r.rdr.opts & PF_POOL_TYPEMASK) != diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 75cb0b39272f..1192cd3d02e8 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 11, 2025 +.Dd February 13, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -132,8 +132,8 @@ Tables can also be used for the redirect address of .Ar nat and .Ar rdr -rules and in the routing options of filter rules, but only for -.Ar round-robin +and in the routing options of filter rules, but not for +.Ar bitmask pools. .Pp Tables can be defined with any of the following @@ -2335,8 +2335,8 @@ The option loops through the redirection address(es). .Pp When more than one redirection address is specified, -.Ar round-robin -is the only permitted pool type. +.Ar bitmask +is not permitted as a pool type. .It Ar static-port With .Ar nat diff --git a/sys/netpfil/pf/pf.h b/sys/netpfil/pf/pf.h index dfa86e7f1d6d..b5c0eeaa8f01 100644 --- a/sys/netpfil/pf/pf.h +++ b/sys/netpfil/pf/pf.h @@ -133,6 +133,11 @@ enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL, #define PF_WSCALE_FLAG 0x80 #define PF_WSCALE_MASK 0x0f +#define PF_POOL_DYNTYPE(_o) \ + ((((_o) & PF_POOL_TYPEMASK) == PF_POOL_ROUNDROBIN) || \ + (((_o) & PF_POOL_TYPEMASK) == PF_POOL_RANDOM) || \ + (((_o) & PF_POOL_TYPEMASK) == PF_POOL_SRCHASH)) + #define PF_LOG 0x01 #define PF_LOG_ALL 0x02 #define PF_LOG_SOCKET_LOOKUP 0x04 diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 83dd63fd2290..d1ba2495dc30 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -73,7 +73,7 @@ VNET_DEFINE_STATIC(int, pf_rdr_srcport_rewrite_tries) = 16; #define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x -static void pf_hash(struct pf_addr *, struct pf_addr *, +static uint64_t pf_hash(struct pf_addr *, struct pf_addr *, struct pf_poolhashkey *, sa_family_t); static struct pf_krule *pf_match_translation(struct pf_pdesc *, int, struct pf_kanchor_stackframe *); @@ -84,7 +84,7 @@ static int pf_get_sport(struct pf_pdesc *, struct pf_krule *, pf_sn_types_t); static bool pf_islinklocal(const sa_family_t, const struct pf_addr *); -static void +static uint64_t pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, struct pf_poolhashkey *key, sa_family_t af) { @@ -95,20 +95,23 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, uint32_t hash32[2]; } h; #endif + uint64_t res = 0; _Static_assert(sizeof(*key) >= SIPHASH_KEY_LENGTH, ""); switch (af) { #ifdef INET case AF_INET: - hash->addr32[0] = SipHash24(&ctx, (const uint8_t *)key, + res = SipHash24(&ctx, (const uint8_t *)key, &inaddr->addr32[0], sizeof(inaddr->addr32[0])); + hash->addr32[0] = res; break; #endif /* INET */ #ifdef INET6 case AF_INET6: - h.hash64 = SipHash24(&ctx, (const uint8_t *)key, + res = SipHash24(&ctx, (const uint8_t *)key, &inaddr->addr32[0], 4 * sizeof(inaddr->addr32[0])); + h.hash64 = res; hash->addr32[0] = h.hash32[0]; hash->addr32[1] = h.hash32[1]; /* @@ -120,6 +123,7 @@ pf_hash(struct pf_addr *inaddr, struct pf_addr *hash, break; #endif /* INET6 */ } + return (res); } static struct pf_krule * @@ -459,6 +463,8 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, { u_short reason = PFRES_MATCH; struct pf_addr *raddr = NULL, *rmask = NULL; + uint64_t hashidx; + int cnt; mtx_lock(&rpool->mtx); /* Find the route using chosen algorithm. Store the found route @@ -472,8 +478,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, #ifdef INET case AF_INET: if (rpool->cur->addr.p.dyn->pfid_acnt4 < 1 && - (rpool->opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN) { + !PF_POOL_DYNTYPE(rpool->opts)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; } @@ -484,8 +489,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, #ifdef INET6 case AF_INET6: if (rpool->cur->addr.p.dyn->pfid_acnt6 < 1 && - (rpool->opts & PF_POOL_TYPEMASK) != - PF_POOL_ROUNDROBIN) { + !PF_POOL_DYNTYPE(rpool->opts)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; } @@ -495,7 +499,7 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, #endif /* INET6 */ } } else if (rpool->cur->addr.type == PF_ADDR_TABLE) { - if ((rpool->opts & PF_POOL_TYPEMASK) != PF_POOL_ROUNDROBIN) { + if (!PF_POOL_DYNTYPE(rpool->opts)) { reason = PFRES_MAPFAILED; goto done_pool_mtx; /* unsupported */ } @@ -512,7 +516,28 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, PF_POOLMASK(naddr, raddr, rmask, saddr, af); break; case PF_POOL_RANDOM: - if (init_addr != NULL && PF_AZERO(init_addr, af)) { + if (rpool->cur->addr.type == PF_ADDR_TABLE) { + cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; + rpool->tblidx = (int)arc4random_uniform(cnt); + memset(&rpool->counter, 0, sizeof(rpool->counter)); + if (pfr_pool_get(rpool->cur->addr.p.tbl, + &rpool->tblidx, &rpool->counter, af, NULL)) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; /* unsupported */ + } + PF_ACPY(naddr, &rpool->counter, af); + } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + rpool->tblidx = (int)arc4random_uniform(cnt); + memset(&rpool->counter, 0, sizeof(rpool->counter)); + if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, + &rpool->tblidx, &rpool->counter, af, + pf_islinklocal)) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; /* unsupported */ + } + PF_ACPY(naddr, &rpool->counter, af); + } else if (init_addr != NULL && PF_AZERO(init_addr, af)) { switch (af) { #ifdef INET case AF_INET: @@ -554,8 +579,33 @@ pf_map_addr(sa_family_t af, struct pf_krule *r, struct pf_addr *saddr, { unsigned char hash[16]; - pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); - PF_POOLMASK(naddr, raddr, rmask, (struct pf_addr *)&hash, af); + hashidx = + pf_hash(saddr, (struct pf_addr *)&hash, &rpool->key, af); + if (rpool->cur->addr.type == PF_ADDR_TABLE) { + cnt = rpool->cur->addr.p.tbl->pfrkt_cnt; + rpool->tblidx = (int)(hashidx % cnt); + memset(&rpool->counter, 0, sizeof(rpool->counter)); + if (pfr_pool_get(rpool->cur->addr.p.tbl, + &rpool->tblidx, &rpool->counter, af, NULL)) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; /* unsupported */ + } + PF_ACPY(naddr, &rpool->counter, af); + } else if (rpool->cur->addr.type == PF_ADDR_DYNIFTL) { + cnt = rpool->cur->addr.p.dyn->pfid_kt->pfrkt_cnt; + rpool->tblidx = (int)(hashidx % cnt); + memset(&rpool->counter, 0, sizeof(rpool->counter)); + if (pfr_pool_get(rpool->cur->addr.p.dyn->pfid_kt, + &rpool->tblidx, &rpool->counter, af, + pf_islinklocal)) { + reason = PFRES_MAPFAILED; + goto done_pool_mtx; /* unsupported */ + } + PF_ACPY(naddr, &rpool->counter, af); + } else { + PF_POOLMASK(naddr, raddr, rmask, + (struct pf_addr *)&hash, af); + } break; } case PF_POOL_ROUNDROBIN: diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index 9cc6aececc42..68d9191cacb9 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -409,7 +409,7 @@ pool_cleanup() atf_test_case "table" table_head() { - atf_set descr 'Tables require round-robin' + atf_set descr 'Check table restrictions' atf_set require.user root } @@ -417,9 +417,18 @@ table_body() { pft_init - echo "pass in on epair inet6 from any to 64:ff9b::/96 af-to inet from " | \ + # Round-robin and random are allowed + echo "pass in on epair inet6 from any to 64:ff9b::/96 af-to inet from round-robin" | \ + atf_check -s exit:0 \ + pfctl -f - + echo "pass in on epair inet6 from any to 64:ff9b::/96 af-to inet from random" | \ + atf_check -s exit:0 \ + pfctl -f - + + # bitmask is not + echo "pass in on epair inet6 from any to 64:ff9b::/96 af-to inet from bitmask" | \ atf_check -s exit:1 \ - -e match:"tables are only supported in round-robin pools" \ + -e match:"tables are not supported by pool type" \ pfctl -f - } @@ -489,15 +498,11 @@ table_range_cleanup() pft_cleanup } -atf_test_case "table_round_robin" "cleanup" -table_round_robin_head() +table_common_body() { - atf_set descr 'Use a table of IPv4 addresses in round-robin mode' - atf_set require.user root -} + pool_type=$1 +echo pool_type=${pool_type} -table_round_robin_body() -{ pft_init epair_link=$(vnet_mkepair) @@ -527,7 +532,7 @@ table_round_robin_body() "set reassemble yes" \ "set state-policy if-bound" \ "table { 192.0.2.1, 192.0.2.3, 192.0.2.4 }" \ - "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from round-robin" + "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from ${pool_type}" # Use pf to count sources jexec dst pfctl -e @@ -541,13 +546,30 @@ table_round_robin_body() atf_check -s exit:0 -o ignore \ ping6 -c 1 64:ff9b::192.0.2.2 - # Verify on dst that we saw different source addresses - atf_check -s exit:0 -o match:".*192.0.2.1.*" \ - jexec dst pfctl -ss - atf_check -s exit:0 -o match:".*192.0.2.3.*" \ - jexec dst pfctl -ss - atf_check -s exit:0 -o match:".*192.0.2.4.*" \ - jexec dst pfctl -ss + # XXX We can't reasonably check pool type random because it's random. It may end + # up choosing the same source IP for all three connections. + if [ "${pool_type}" == "round-robin" ]; + then + # Verify on dst that we saw different source addresses + atf_check -s exit:0 -o match:".*192.0.2.1.*" \ + jexec dst pfctl -ss + atf_check -s exit:0 -o match:".*192.0.2.3.*" \ + jexec dst pfctl -ss + atf_check -s exit:0 -o match:".*192.0.2.4.*" \ + jexec dst pfctl -ss + fi +} + +atf_test_case "table_round_robin" "cleanup" +table_round_robin_head() +{ + atf_set descr 'Use a table of IPv4 addresses in round-robin mode' + atf_set require.user root +} + +table_round_robin_body() +{ + table_common_body round-robin } table_round_robin_cleanup() @@ -555,6 +577,23 @@ table_round_robin_cleanup() pft_cleanup } +atf_test_case "table_random" "cleanup" +table_random_head() +{ + atf_set descr 'Use a table of IPv4 addresses in random mode' + atf_set require.user root +} + +table_random_body() +{ + table_common_body random +} + +table_random_cleanup() +{ + pft_cleanup +} + atf_test_case "dummynet" "cleanup" dummynet_head() { @@ -775,6 +814,7 @@ atf_init_test_cases() atf_add_test_case "table" atf_add_test_case "table_range" atf_add_test_case "table_round_robin" + atf_add_test_case "table_random" atf_add_test_case "dummynet" atf_add_test_case "gateway6" atf_add_test_case "route_to" From nobody Thu Feb 20 14:59:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzGcg1rGLz5p0sW; Thu, 20 Feb 2025 14:59:15 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 4YzGcf757gz3vDF; Thu, 20 Feb 2025 14:59:14 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43690d4605dso6773955e9.0; Thu, 20 Feb 2025 06:59:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740063554; x=1740668354; darn=freebsd.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=NPLfYekhHUMiBXhtbHkE626Zy4PVjU/s7+j8UODKEAI=; b=OyObOgp3lZyRdwxMHCLSkqIFaza05tex3TB9yM3x8sO/T/bKfluFrV6qGaslvpNQUL l1lfrdhNzyhtJfv4WCffuMPPWJ51ubeEgUH3S2GEN2b2tV1p13lDQhsPyNP+wBLNU+FF +F+pw52y6P3Hmg9Eb4p0/wUGV/LPOsPmZqVc2ymrm6bbMr8/qPMjrdJ6WfWons7D17qP cw9RJfkZsqGeUTKSkmFhcHKwIFCVVck0ibeaQNioq5LFdQ7hes4GdvqnyZIr2M5iftbM TS9zFMFzS/1ChmorVaDmZrr4etcOttCbRPlfdlFBK48LLw55PBKSAj60eoRDFxcpsZuA KuHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740063554; x=1740668354; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:reply-to:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NPLfYekhHUMiBXhtbHkE626Zy4PVjU/s7+j8UODKEAI=; b=VvIr/3K9+C1IRX1+viTLe6cLFyeQzLKJsP/PnDwYvxoYHqiVxj5HrUYVDnpD4etexv +XiA3MiHtLFLsSI0DDdSAUDIMB5urw6oCJaUB221boDPnDMXyak2r8K4zpj7AuGf1met xi+BUVqmxVthYYK6+07XodwK30UroMYjNYyMsYf38EB8hPf2Bl/x3CchSx9GfXuNFsVy GCbl9/iV9BndSRmwbks4tfGNDBxrTkNhPWif/0StXy0KjOWPNRFjL8GHJFAdIlRtcmf7 gLk9RmLK1S8bn+orBw+CjU0oya4KWU0/5BCy5bly0yd5Ia83QDhSUsqXpp5ICeQ1HQBg 9hgw== X-Forwarded-Encrypted: i=1; AJvYcCVxZqdEgPB+uIE/m9pdhFhNRSNr4WhcsEudc09aW3n6SZ2ERLMnRE9jS0qYgYtJG+0qVSlo4F1wgQ==@freebsd.org, AJvYcCWJ47baVHcp51FslfzFoZwUxO6DEJqLAJfjPTlhskOMTUscg+GLZv7Cu2jd10UG3XbnXcc9qxFuDbTx3b7q8Npv2Scj@freebsd.org, AJvYcCWY0cXWd3YbfoZ8Tjw+a8vdQZGlQ3MYtTZVnGt3IelEjAW1VJRO+BcPELDxvzG+yb/b80Th19bQWBF/4Gm99Gfcatsrtx4=@freebsd.org X-Gm-Message-State: AOJu0Yzl8Nm2dBn1pyHm4KW2DGGhl4m6FTLlG9Y7S9kGB5qPixucAStC 2Njc/kuZR2YurpnFMAVQVorPfHOanZhrw2wsj2CGMXaxAL8GbkHExnV077MB X-Gm-Gg: ASbGncuHeqld6k6/D5vN9Dg8f2Furv2UZJ8ruyGSVDnAgGAgoBHEiZZlPoxNI4sADrF I8qPjRIq2Hj9sh8zNILQj80DnM6/3mGqmOBD5KwWgW88oOZFm3ytTJOhLK9vD5Z+pn0SrZQMQ6z vzKhhjpNhcsGzTU7sAL6/aYXLpXtt62PDQls2LxIQWi1ZLl07UqiyL64BHICXDgsYzkmWvFMlhg xifjY5n9BiG1IjMrLT+6e4jYx9DLsmiG5Thf/B7foRwKjDfsj47veopvaTLxPqX2TA3xvpUTqWc U5VUlKXp00rQV8oxsxjBXfN/CiMC1+iCg4FFdquFSFza77EvgsoPlvzbxART9WmUQRxc7TlIJRP q X-Google-Smtp-Source: AGHT+IG5FqOr0MGAGiBU2S3VCLabCPw6nhiX6vXAOCrIbNDnjY5e79UY61dqgS9B6fJ98kxWKF/oMw== X-Received: by 2002:a05:600c:3ba8:b0:439:a138:20 with SMTP id 5b1f17b1804b1-439a1380584mr44268095e9.20.1740063553485; Thu, 20 Feb 2025 06:59:13 -0800 (PST) Received: from ?IPV6:2001:67c:14a0:5fe0:ad43:aa20:cd33:9c46? ([2001:67c:14a0:5fe0:ad43:aa20:cd33:9c46]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439872b5a46sm111924175e9.32.2025.02.20.06.59.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Feb 2025 06:59:13 -0800 (PST) Message-ID: <5678bc5e-eb1b-4ac5-8b34-c7a7bfac5816@gmail.com> Date: Thu, 20 Feb 2025 15:59:12 +0100 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: meloun.michal@gmail.com Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin To: "Bjoern A. Zeeb" , Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> Content-Language: cs, en-US From: Michal Meloun In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4YzGcf757gz3vDF X-Spamd-Bar: ---- On 19.02.2025 18:40, Bjoern A. Zeeb wrote: > On Wed, 19 Feb 2025, Gleb Smirnoff wrote: > >> On Wed, Feb 19, 2025 at 02:57:27AM +0000, Bjoern A. Zeeb wrote: >> B> commit 61ce422531805307d413bf04c9ad1aabd7f3a879 >> B> Author:     Bjoern A. Zeeb >> B> AuthorDate: 2025-02-19 02:50:11 +0000 >> B> Commit:     Bjoern A. Zeeb >> B> CommitDate: 2025-02-19 02:56:59 +0000 >> B> >> B>     wlanstats: move from tools to usr.sbin >> B> >> B>     wlanstats is an incredible tool to get a quick overview of state >> B>     of affairs of wireless by looking at the counters. >> B>     And it makes it simple. >> B> >> B>     Having landed the LinuxKPI HW_CRYPTO bits I was asked by users >> B>     what to check and I realised the answer is in wlanstats. >> B> >> B>     It is annoying even as a developer to manually build it for each >> B>     installation but given it's also useful to users and support >> B>     make it available with the general installation. >> B>     Probably very long overdue. >> B> >> B>     Adjust the Makefile and make build again on main. >> B>     Hook it up to the build conditional on MK_WIRELESS. >> B> >> B>     Discussed with: adrian >> B>     Sponsored by:   The FreeBSD Foundation >> B>     TODO:           man page >> >> Please let's not create a precedent of a new utility without >> a manual page.  Better one with grammar mistakes and terse >> than nothing. > > Better one that #manpage has reviewed than anything else. > >> This takes less than 15 minutes.  Please, fill >> this gap. > > I will; otherwise I wouldn't have mentioned it and just moved on? > > > /bz > Unfortunately, the code contains invalid behaviour. In many places it uses the following construct: struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) wf0; where wf0 is struct wlanstatfoo type. These types are not compatible and have different alignment requirements, so these are cannot be compiled at least on arm32. Moreover naming looks wrong, because wlanstatfoo_p is not pointer to struct wlanstatfoo, but to different structure. Please revert it and push fixed version. Michal From nobody Thu Feb 20 15:26:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHDR70spz5p2LF; Thu, 20 Feb 2025 15:26: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 4YzHDR6Q4Jz47S2; Thu, 20 Feb 2025 15:26:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tQ+CdVmDyAetqAGe0pii8BlV93kZuFbdhI2zf7DmHUc=; b=iin4JPUR5jXvFFv0/adSBO49urAnmY7Eiit0aMKr0VWkbcl0T9UmPMFZwigjXqse6rYp1M /N1YAvMtYQHa8n3TRLOrIG7hW1coDhqPqv/X4UCaq9FN8QTttLMGW/QEyJRzCHbovql9Dw HlT/yLEr3vSwtZfQxCOoLRhUNCF0gQUw4NCyIghE4NLww1AnLKu5gn0rc/505dz9ZyfTf1 Vn1okFDZo/Wdv47ingMmZP3B7uChHoMpwYwh2XORxPOg3iS4ICkA3aT0BcM84LV4nb7/IV uoYXwrRPSCoxJ8v+17FpCAN9NKFBAuOVYZg3/B1SyZ7fjBVBPtPQFyKzekeDAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740065207; a=rsa-sha256; cv=none; b=VLvL7dEboiCUvNRjCLUvZt2PzzwYAqB2AsNh3ZS2WFEq0dviY8LhoI1yhUf+0ilC2RxXRu k+p0IVZaMfFFTJIubUqxQUKeoS8sUdCl6TvknQIxmEaAiz4S9or+rNy4HIVXUgwiR1mu0d F8wB3yitq/EFxlr+A8PLnNp/BhDXLrV5YVuHNglE0SoVPItWbVNxSGQ3F20fJPoiZjZM3i cl7cDVaErqzOjUJxxtEhIjq/mI00inQ0T9rH8BJCgFx5TOzb3RBKoSKbJDKLOn1sgXm7BP 0DRT09qqsfwVBfGZ2dAfIUWLa7IPpuaciL4r2sZksFuhJCoGfoh4f17ITK7JMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tQ+CdVmDyAetqAGe0pii8BlV93kZuFbdhI2zf7DmHUc=; b=mZkpc6WBhwmm2mZ9ypHUFJG+NdQEu4UO7V5Lhu/C/jMk2MAcdJMT1yDYaaNI0Nze668mH2 zCbjX8b/vg3eIit6Ge24I79psXVkYmHx7feIwdOhZn1zqr3tu+5nQ4H08x8Umz0du2ondR h/6txeMKSDzVVw5TDV+yxXI9oWGZR5Idu2V37nXfGDYDbP+c58bHHlMsAEHLbVdYCCW5Qy Gh9AvvVt0c/Pc0roLg2YrflBCyuqqNU1DS5u03CteKLUsGe8qIxawCplgeK3eKGFMDnKc6 XV/J4533xc2QUwdFUkyKQdDilYOUYIDNv9dsgB3kMinC+iA2Kfp824tf06yD0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHDR5hHDzxqw; Thu, 20 Feb 2025 15:26: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 51KFQlee086100; Thu, 20 Feb 2025 15:26:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFQlpS086097; Thu, 20 Feb 2025 15:26:47 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:26:47 GMT Message-Id: <202502201526.51KFQlpS086097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 270542d95d0d - main - statfs.2: uncomment and describe MNT_IGNORE List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 270542d95d0d931ebdd369f4f78871828502d486 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=270542d95d0d931ebdd369f4f78871828502d486 commit 270542d95d0d931ebdd369f4f78871828502d486 Author: Konstantin Belousov AuthorDate: 2025-02-20 14:56:52 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-20 14:58:17 +0000 statfs.2: uncomment and describe MNT_IGNORE Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libsys/statfs.2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index a2abd9e7d7cd..f2c2003918f1 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -141,8 +141,9 @@ The file system is exported read-only. Updating of file access times is disabled. .It Dv MNT_USER The file system has been mounted by a user. -.\".It Dv MNT_IGNORE -.\"XXX +.It Dv MNT_IGNORE +The file system should not be listed, e.g. by +.Xr df 1 . .It Dv MNT_EXPORTED The file system is exported for both reading and writing. .It Dv MNT_DEFEXPORTED From nobody Thu Feb 20 15:26:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHDT0btBz5p2j9; Thu, 20 Feb 2025 15:26: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 4YzHDS6Mzyz47Pv; Thu, 20 Feb 2025 15:26:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JAjD856GX88OFKq5UKtPPOVsDlAunqxLpN6OBhKbPuM=; b=C6K7zn1PUBZMNwFR3j/J8R2XMqbGFSIa8mRte3kaY+RMcFAX+JRK8MUHOyLJnHyU+foMQf WTojRTrf+aA6ij9FxUbfo0JLYfZLQwwwB4tRd8I8rI79gMsEagdj7ikta98qodUXfGcthQ ZdZFlQRaE2YROcuucII2p2201YEfiMUD0D/6/6NrEmaaHiA4knh6/AkI1kNqxCgGtMh/GA /HlemimwCJPpsTNaak3gmW8n9H3HG1d7zA/UX21JRU08mkmxhTXLkdhuqnYdqjCDvFHqbE 2zCeeOh7QNYpdCSq6WP5w7VwXJ1F6mgk4N3bdKPVN26jvbo9BV5K4A7DgSE1UQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740065208; a=rsa-sha256; cv=none; b=UyueoY2IDXPYE+NdnxYmiYAHUZuK/WxjXyQWLVGiWmgYsYEW8OSQLG65OmMyiGFCSE8DiH 42ydzZPsBNWVWeFmWPzEb9+HrSjht95yS0iIk8/yNack3q2YT0oIbqSq0I6zzqG/OHaRI4 6c3mPLpRZpuhSfr8o1vBAY/N7uz9kvNS/rRNEaJ1UOJ9FY4GqcH9n6hgsBRgsgRJEd5b83 6TjtaAPzN4uxc8NLBcsHnIbc+pvEClJ50csTpt608dXWGLr/zdyNYxaRCZgDnzRoarL9aM 5aX8t/NbM7wEgHn/brCGrdK8UmCJ7GpvTNsKDub0rrj9JxxC02RyqFhVsWkmxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JAjD856GX88OFKq5UKtPPOVsDlAunqxLpN6OBhKbPuM=; b=gKXkWbyhQWBOamkZpyYz4dYQSfgFFdCXNatPH+nzxKT5CRMyDfBWHgNJbrYWuXnUdX7m9X 88U7pKiO/Q4I0rHrvimUpRD7iN7e9yoKAtRLLklFGro7qOgkl37t9z6f9u5Ky6YNNXnOFy O+xLphzNsINCIbmW5ITlFsD1xvdwBdhYArp/h49BdQfoEGVYzqkOPcFLPqgd3tsPIw7k4j M6+aC3A7aAjI6r+9AP6Q3L8GYTT8/+VwyqBRmbBxsx0cuS0i2NlucrjFWvACukLjagdVZj Kh0C9efSQ9e+asbXluwWJg4+nh8bu7wdiF6q+yi1FgItV/YalRG7TY6aSkaonw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHDS5y5fzwhc; Thu, 20 Feb 2025 15:26: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 51KFQmXX086133; Thu, 20 Feb 2025 15:26:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFQmhh086130; Thu, 20 Feb 2025 15:26:48 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:26:48 GMT Message-Id: <202502201526.51KFQmhh086130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 13b92ae9655d - main - statfs.2: remove dead comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13b92ae9655deb22c3ad89f1e90e26f2f1da9961 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=13b92ae9655deb22c3ad89f1e90e26f2f1da9961 commit 13b92ae9655deb22c3ad89f1e90e26f2f1da9961 Author: Konstantin Belousov AuthorDate: 2025-02-20 14:52:00 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-20 14:58:17 +0000 statfs.2: remove dead comment Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libsys/statfs.2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index f2c2003918f1..cf996e0fe552 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -121,8 +121,6 @@ Symbolic links are not followed. Read clustering is disabled. .It Dv MNT_NOCLUSTERW Write clustering is disabled. -.\".It Dv MNT_JAILDEVFS -.\"XXX .It Dv MNT_MULTILABEL Mandatory Access Control (MAC) support for individual objects (see From nobody Thu Feb 20 15:26:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHDV3VlWz5p2NZ; Thu, 20 Feb 2025 15:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzHDV03h7z47Q3; Thu, 20 Feb 2025 15:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rG1xcueKR6LMSkuN4b7g0L5hL6yfsQSKvBq//c9bLQo=; b=evgm6pdB1LNsEmUKYUGJfKdqaqgYT85oZCYtH6puEZ/5VbvJNgyuQfegaw8lX48/GncUCj aUKFRJJI9VRsEL7WjVDQAyYxdpRkQ12jxAWbm6N5gTOFLJowwn5CvqQ64CfElOSNE5AotC 3xG5DgHtmlYFIUKbarF3c8fKz121UpF0vnxGJJkBxePCgjBSlRSqdDlGG9Hyhd14+sW9UZ vO5nN89No0oxoVGNoUo9Bw1fGPD5MZiO7jQ404X7ZBfpDwcOqsOTD0qcSNdcwg3hy0sj1X XTE7YL9Lg41oTmgbtOUc6vjCS8MwibwKv7ompFsemuWq0bey0gqWO81lJLLsDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740065210; a=rsa-sha256; cv=none; b=OdXrp9I8GOgH/nBZMVYaw9rKpXFb8gKo9toPc+/fdLpZles6lFoYw2DBh3U2yid1UkzydJ RsrRAIwc/yRUawBGBdxkE4SQOnA4gfEeO9WQSH9JpnTHWh3a6RRWPX2RfFBYC7irIXltf3 dBxIVZ9Zyanj5mfOqna+9BxT4VjLK4GX8FCZbpU7h6TIbpK6ow0+vgiYjG3LbtkWPC1hof gfKLN4jyCEPQbSSrbNgzFNjM82dCpCIEt+QuS7BSg1cDGcNyYL3FUvm1hoU8p3Rwf5dBEy QErBlmp2NqWEZuuabOZcf0QdfRMybooPx1KrBJkn0FbnU3huNKtbRXiBlRdICw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rG1xcueKR6LMSkuN4b7g0L5hL6yfsQSKvBq//c9bLQo=; b=HWoB6bfY24VyPvkQvd+1glUVwRq+YuzlLWOCBrOAh9G29qubrrVVNQCa6jMKO/R7nJWbBe M4kHxpjIUzl6mAjaHqt6ESQQwWLSKplRw+9WItJQ+BDiXKPOBCDx4bMBvcX95Ogo1Ao7fa tVeqTlGKEW6fejYcPw1gC7Q0h2ucqS8+hBULqqQzY43yEpsgVAMTyS7G1DQ6M6dI83SlMa XfqIJZyKpcRTMV5fld/W2pjJv+zdL0WfNK1ICDVsKf1D3gCytg3V9WrEo30LSCc6JsnerL mXgdcnzhlgJT/hof4NxNwmtW+a456+o45YC1N0a7EikWw2+ypU2hrqoiw9j6/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 4YzHDT6bDmzxqx; Thu, 20 Feb 2025 15:26: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 51KFQnRX086167; Thu, 20 Feb 2025 15:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFQnl6086164; Thu, 20 Feb 2025 15:26:49 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:26:49 GMT Message-Id: <202502201526.51KFQnl6086164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 0738cd9766a5 - main - statfs.2: order MNT flags alphabetically List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0738cd9766a570e085831f6241387baa35cd64a3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0738cd9766a570e085831f6241387baa35cd64a3 commit 0738cd9766a570e085831f6241387baa35cd64a3 Author: Konstantin Belousov AuthorDate: 2025-02-20 14:54:14 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-20 15:03:49 +0000 statfs.2: order MNT flags alphabetically Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libsys/statfs.2 | 86 ++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index cf996e0fe552..91f9e96cc048 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -94,64 +94,64 @@ char f_mntonname[MNAMELEN]; /* directory on which mounted */ .Pp The flags that may be returned include: .Bl -tag -width MNT_SYNCHRONOUS -.It Dv MNT_RDONLY -The file system is mounted read-only; -Even the super-user may not write on it. -.It Dv MNT_NOEXEC -Files may not be executed from the file system. -.It Dv MNT_NOSUID -Setuid and setgid bits on files are not honored when they are executed. -.It Dv MNT_SYNCHRONOUS -All I/O to the file system is done synchronously. +.It Dv MNT_ACLS +Access Control List (ACL) support enabled. .It Dv MNT_ASYNC No file system I/O is done synchronously. -.It Dv MNT_SOFTDEP -Soft updates being done (see -.Xr ffs 4 ) . +.It Dv MNT_DEFEXPORTED +The file system is exported for both reading and writing to any Internet host. .It Dv MNT_GJOURNAL Journaling with gjournal is enabled (see .Xr gjournal 8 ) . -.It Dv MNT_SUIDDIR -Special handling of SUID bit on directories. -.It Dv MNT_UNION -Union with underlying file system. -.It Dv MNT_NOSYMFOLLOW -Symbolic links are not followed. -.It Dv MNT_NOCLUSTERR -Read clustering is disabled. -.It Dv MNT_NOCLUSTERW -Write clustering is disabled. +.It Dv MNT_EXKERB +The file system is exported with Kerberos uid mapping. +.It Dv MNT_EXPORTANON +The file system maps all remote accesses to the anonymous user. +.It Dv MNT_EXPORTED +The file system is exported for both reading and writing. +.It Dv MNT_EXPUBLIC +The file system is exported publicly (WebNFS). +.It Dv MNT_EXRDONLY +The file system is exported read-only. +.It Dv MNT_IGNORE +The file system should not be listed, e.g. by +.Xr df 1 . +.It Dv MNT_LOCAL +The file system resides locally. .It Dv MNT_MULTILABEL Mandatory Access Control (MAC) support for individual objects (see .Xr mac 4 ) . -.It Dv MNT_ACLS -Access Control List (ACL) support enabled. -.It Dv MNT_LOCAL -The file system resides locally. +.It Dv MNT_NOATIME +Updating of file access times is disabled. +.It Dv MNT_NOCLUSTERR +Read clustering is disabled. +.It Dv MNT_NOCLUSTERW +Write clustering is disabled. +.It Dv MNT_NOEXEC +Files may not be executed from the file system. +.It Dv MNT_NOSUID +Setuid and setgid bits on files are not honored when they are executed. +.It Dv MNT_NOSYMFOLLOW +Symbolic links are not followed. +.It Dv MNT_SOFTDEP +Soft updates being done (see +.Xr ffs 4 ) . +.It Dv MNT_SUIDDIR +Special handling of SUID bit on directories. +.It Dv MNT_SYNCHRONOUS +All I/O to the file system is done synchronously. .It Dv MNT_QUOTA The file system has quotas enabled on it. +.It Dv MNT_RDONLY +The file system is mounted read-only; +Even the super-user may not write on it. .It Dv MNT_ROOTFS Identifies the root file system. -.It Dv MNT_EXRDONLY -The file system is exported read-only. -.It Dv MNT_NOATIME -Updating of file access times is disabled. +.It Dv MNT_UNION +Union with underlying file system. .It Dv MNT_USER The file system has been mounted by a user. -.It Dv MNT_IGNORE -The file system should not be listed, e.g. by -.Xr df 1 . -.It Dv MNT_EXPORTED -The file system is exported for both reading and writing. -.It Dv MNT_DEFEXPORTED -The file system is exported for both reading and writing to any Internet host. -.It Dv MNT_EXPORTANON -The file system maps all remote accesses to the anonymous user. -.It Dv MNT_EXKERB -The file system is exported with Kerberos uid mapping. -.It Dv MNT_EXPUBLIC -The file system is exported publicly (WebNFS). .El .Pp Fields that are undefined for a particular file system are set to -1. From nobody Thu Feb 20 15:26:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHDX0jXDz5p2d3; Thu, 20 Feb 2025 15:26: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 4YzHDW11Z7z47bF; Thu, 20 Feb 2025 15:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxR7DWpk+0a7jiC81kUgEJtKVhFyAdA7lCjK9SMYRd4=; b=rbc5uNuTxORUlzQdLJz+wNE5nKJ82pWguC3Rhu24Ie8mAk2ytzWpLGBjTYfLJZnBFpeGDJ cUJpV9bPwb+15sxl2ZTBPv5Ebm3EptbGbsVEpEH10z00N8j3WKcyxDKxfYi6Um7wbh6ikn PG5jTHDsgRwmX57nrxXQM9du2GvqxqQ8B/S48qX2O5SIMoNKOQaQQ13D0q4wErqArPGqEW fDsOJNxmQd5sqY+H6ysQNb959c584aeCnDJqcHTZMgyYtj4WZTbMcvV5kX67WGYPqnCWmt VBcsOcg4t83KWjObS+bJmwrUxfGfklg1TEsvMevEthUAxk8Dhc/X/ifupfXgsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740065211; a=rsa-sha256; cv=none; b=wMGZkMEvlZPN4dtONWIu5/eM++4WH6ylbvF0sqM8cOXuI1w7HsB8G8DLFCMgexWjxQZQDU cXYJoz62/fd0pAINbhPpOW7vsnecDXkbSeg5fewVqUhrWabMzRsKD9C41DtrCLUd0PB2wN BU7HjX0I+puTgqQgOI4/WRVVdf2xuQUoHmEDq8C+OE/RMuHhaFkdkDSv0XCAu2v01rQJuF B5cNkdXu0hjDlq1Fxc7HATi1i/Gfz1q351/D0VOOQydOTiNoUzH70uOD2mjf3qutdBpvQg 0Pz3VquYv4Ye/F7KoLZRgE54fDiGVwe1m3UvtGEmBxmZQLmEgUNhQLJsA4G21g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740065211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AxR7DWpk+0a7jiC81kUgEJtKVhFyAdA7lCjK9SMYRd4=; b=fyI3EesKnJURTuXIMCWXvkZ3ZIyps4KZXjAZipRQQ+d/VmrCTpT3e14GfY9v3Si570QJUe 7SrWdbxkLKT0pJR8LAuqZoa8isudmxD+3/oOMSOF+NgPre5Tuj9F4Opjd7A5s1gSaoYmNm JrWpkEr9drD3py+d8joP/bYLInEneUIFkx+TEQegVNwPssWP4rtZFe96HT6cn7q0zEhcMa nA/vQq9hSgB3LqjzGw2uH0OTM2C9O20W3lJgiFsNz77pXbTP7Yb4n0kQ/ucFHI701c5r8Y 6fHCvEzSwlgq2M7UnSyJAv2ssmHT1W5HtasHapGrNaGe0JfAgMAfudjJcI6nAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHDW06MWzx5l; Thu, 20 Feb 2025 15:26: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 51KFQo9w086203; Thu, 20 Feb 2025 15:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFQoHG086200; Thu, 20 Feb 2025 15:26:50 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:26:50 GMT Message-Id: <202502201526.51KFQoHG086200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e951247a983d - main - statfs.2: document missing user-visible MNT flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e951247a983daf7814d06e9e49bdd503ceaa0b68 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e951247a983daf7814d06e9e49bdd503ceaa0b68 commit e951247a983daf7814d06e9e49bdd503ceaa0b68 Author: Konstantin Belousov AuthorDate: 2025-02-20 15:11:13 +0000 Commit: Konstantin Belousov CommitDate: 2025-02-20 15:25:42 +0000 statfs.2: document missing user-visible MNT flags Sponsored by: The FreeBSD Foundation MFC after: 3 days --- lib/libsys/statfs.2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/libsys/statfs.2 b/lib/libsys/statfs.2 index 91f9e96cc048..b411b3b6ff46 100644 --- a/lib/libsys/statfs.2 +++ b/lib/libsys/statfs.2 @@ -98,6 +98,9 @@ The flags that may be returned include: Access Control List (ACL) support enabled. .It Dv MNT_ASYNC No file system I/O is done synchronously. +.It Dv MNT_AUTOMOUNTED +The filesystem was auto-mounted, see +.Xr autofs 4 . .It Dv MNT_DEFEXPORTED The file system is exported for both reading and writing to any Internet host. .It Dv MNT_GJOURNAL @@ -122,6 +125,8 @@ The file system resides locally. Mandatory Access Control (MAC) support for individual objects (see .Xr mac 4 ) . +.It Dv MNT_NFS4ACLS +ACLs in NFSv4 variant are supported. .It Dv MNT_NOATIME Updating of file access times is disabled. .It Dv MNT_NOCLUSTERR @@ -139,6 +144,8 @@ Soft updates being done (see .Xr ffs 4 ) . .It Dv MNT_SUIDDIR Special handling of SUID bit on directories. +.It Dv MNT_SUJ +Soft-updates with journaling being done. .It Dv MNT_SYNCHRONOUS All I/O to the file system is done synchronously. .It Dv MNT_QUOTA @@ -150,8 +157,19 @@ Even the super-user may not write on it. Identifies the root file system. .It Dv MNT_UNION Union with underlying file system. +.It Dv MNT_UNTRUSTED +The file system was mounted with the +.Cm untrusted +option, which indicates media of unknown provenance or integrity. +Currently honored by +.Xr ffs 4 . .It Dv MNT_USER The file system has been mounted by a user. +.It Dv MNT_VERIFIED +The file system is marked as verified, no fingerprint check on +.Xr execve 2 +is needed, see +.Xr mac_veriexec 4 . .El .Pp Fields that are undefined for a particular file system are set to -1. From nobody Thu Feb 20 15:40:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHXT6B0qz5p3Vt; Thu, 20 Feb 2025 15:40: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 4YzHXT5X8rz4Hsp; Thu, 20 Feb 2025 15:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l5KlP35HVe+goHM7Ih3UfQyaRVtysL6aSpr4cheLkvI=; b=Po3xLe2JhEDAWtwJelBigoL5raI+E5QUyhwJvnJcRSemAaIcz//EFZSICP0j6BD+gB4SgZ Od8Y6N7OPZGBMQapaz8QQOnevHpOdJ5+7E8bce7DDWYRjhT352YAd0w6tR29TuVsllPveW we4im9ep6omWnD4cbSEKKXuSqdVKsWlp5E5FJzBE/LomySGtJUt7eF8WKYKTINA0Ys7R3o QOALYxd08AB7U1PBvHn9soKnFAlHVuDVTBsdc9SItb+k3lRRs5sYVXXucDmohZJ5Zf7cAM +/kKtdanZcWUBQaJcZaCeFS/pniffeyka0V9fRbxPQ/w/qUrNIavhjhAvgef8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740066041; a=rsa-sha256; cv=none; b=vgICCVQbs9KwR9BR3JynhAfEGCI1CeE1v+O2PBoT1LX8ao5E4Hfpxchum4IZVucWXd7qqj bh3Mzu7ESUJ43Q8ZtPTbPDEgENQs4FnOHWGZxsQoB8CypubhenRRPMpBqdZhAubb1e9Lvf e8k8tlPOre2/Lp0xVvOh1YROCxcfGe+zNgooyl2kgXMQCEsE2Y26D5ZrF0yLXhhGod7zd8 C7lIpzaVErjzpMf2MmbuR/QsS25bDnhMEczvtzjJRPDtHvog7Pe9v+SGA3GaMp2Ode8m5Y TmJ3ldFSlL98dIE1lawyf6ZhYEA+enubyCShgHUGMtuNZVjjVV4eZCpFgHPC1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066041; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l5KlP35HVe+goHM7Ih3UfQyaRVtysL6aSpr4cheLkvI=; b=yy4GEyXxBXrbI5QgVltlRPJdjJ5AymUTnb6BeTY0v1t1en16V9L2ubUAS1nqzWjvuOH+Iy EguHJHO3gZtzDnrjyDZsVuUxXsua2lo8w8b28slpWXiB+NhNN8RzFashokcfENE5+X9jvt j7N6M5zbGwY/nWxFySaeKbubw9fHai8RmVRCCoMijRLP4727ZIj2O31Jmp+ytdDWbCQUQj FiCiPDrFbgabnOwuEmJHjwjnMkCf7dgCD8tUPzQ5OL8mejAnIQbbgtMvdvh7ZvA9upyjea fjQBDnukH2wAjtTqrBvzAOkCmXgjH1fcW2/rESQpZcCPzq5LXWciPxSO0TFIBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHXT4pNpzyBB; Thu, 20 Feb 2025 15:40: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 51KFefnc016896; Thu, 20 Feb 2025 15:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFef5Y016893; Thu, 20 Feb 2025 15:40:41 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:40:41 GMT Message-Id: <202502201540.51KFef5Y016893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 97ca2ada80b8 - main - nvmft: Switch the per-port lock from sx(9) to mtx(9) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97ca2ada80b870edbbb4f66b26e274cf8e55e0bc Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=97ca2ada80b870edbbb4f66b26e274cf8e55e0bc commit 97ca2ada80b870edbbb4f66b26e274cf8e55e0bc Author: John Baldwin AuthorDate: 2025-02-20 15:14:16 +0000 Commit: John Baldwin CommitDate: 2025-02-20 15:31:20 +0000 nvmft: Switch the per-port lock from sx(9) to mtx(9) This is needed to avoid LORs for a following commit. Sponsored by: Chelsio Communications --- sys/dev/nvmf/controller/ctl_frontend_nvmf.c | 58 ++++++++++++++++------------- sys/dev/nvmf/controller/nvmft_controller.c | 46 ++++++++++++++--------- sys/dev/nvmf/controller/nvmft_var.h | 2 +- 3 files changed, 62 insertions(+), 44 deletions(-) diff --git a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c index fcfa8b90ebb7..a28a613e23aa 100644 --- a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c +++ b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c @@ -70,9 +70,9 @@ nvmft_online(void *arg) { struct nvmft_port *np = arg; - sx_xlock(&np->lock); + mtx_lock(&np->lock); np->online = true; - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); } static void @@ -81,7 +81,7 @@ nvmft_offline(void *arg) struct nvmft_port *np = arg; struct nvmft_controller *ctrlr; - sx_xlock(&np->lock); + mtx_lock(&np->lock); np->online = false; TAILQ_FOREACH(ctrlr, &np->controllers, link) { @@ -91,8 +91,8 @@ nvmft_offline(void *arg) } while (!TAILQ_EMPTY(&np->controllers)) - sx_sleep(np, &np->lock, 0, "nvmfoff", 0); - sx_xunlock(&np->lock); + mtx_sleep(np, &np->lock, 0, "nvmfoff", 0); + mtx_unlock(&np->lock); } static int @@ -102,7 +102,7 @@ nvmft_lun_enable(void *arg, int lun_id) struct nvmft_controller *ctrlr; uint32_t *old_ns, *new_ns; uint32_t nsid; - u_int i; + u_int i, new_count; if (lun_id >= le32toh(np->cdata.nn)) { printf("NVMFT: %s lun %d larger than maximum nsid %u\n", @@ -111,14 +111,22 @@ nvmft_lun_enable(void *arg, int lun_id) } nsid = lun_id + 1; - sx_xlock(&np->lock); - new_ns = mallocarray(np->num_ns + 1, sizeof(*new_ns), M_NVMFT, - M_WAITOK); + mtx_lock(&np->lock); + for (;;) { + new_count = np->num_ns + 1; + mtx_unlock(&np->lock); + new_ns = mallocarray(new_count, sizeof(*new_ns), M_NVMFT, + M_WAITOK); + mtx_lock(&np->lock); + if (np->num_ns + 1 <= new_count) + break; + free(new_ns, M_NVMFT); + } for (i = 0; i < np->num_ns; i++) { if (np->active_ns[i] < nsid) continue; if (np->active_ns[i] == nsid) { - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); free(new_ns, M_NVMFT); printf("NVMFT: %s duplicate lun %d\n", np->cdata.subnqn, lun_id); @@ -145,7 +153,7 @@ nvmft_lun_enable(void *arg, int lun_id) nvmft_controller_lun_changed(ctrlr, lun_id); } - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); free(old_ns, M_NVMFT); return (0); @@ -163,12 +171,12 @@ nvmft_lun_disable(void *arg, int lun_id) return (0); nsid = lun_id + 1; - sx_xlock(&np->lock); + mtx_lock(&np->lock); for (i = 0; i < np->num_ns; i++) { if (np->active_ns[i] == nsid) goto found; } - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); printf("NVMFT: %s request to disable nonexistent lun %d\n", np->cdata.subnqn, lun_id); return (EINVAL); @@ -185,7 +193,7 @@ found: nvmft_controller_lun_changed(ctrlr, lun_id); } - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); return (0); } @@ -196,7 +204,7 @@ nvmft_populate_active_nslist(struct nvmft_port *np, uint32_t nsid, { u_int i, count; - sx_slock(&np->lock); + mtx_lock(&np->lock); count = 0; for (i = 0; i < np->num_ns; i++) { if (np->active_ns[i] <= nsid) @@ -206,7 +214,7 @@ nvmft_populate_active_nslist(struct nvmft_port *np, uint32_t nsid, if (count == nitems(nslist->ns)) break; } - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); } void @@ -625,7 +633,7 @@ nvmft_port_free(struct nvmft_port *np) free(np->active_ns, M_NVMFT); clean_unrhdr(np->ids); delete_unrhdr(np->ids); - sx_destroy(&np->lock); + mtx_destroy(&np->lock); free(np, M_NVMFT); } @@ -797,7 +805,7 @@ nvmft_port_create(struct ctl_req *req) refcount_init(&np->refs, 1); np->max_io_qsize = max_io_qsize; np->cap = _nvmf_controller_cap(max_io_qsize, enable_timeout / 500); - sx_init(&np->lock, "nvmft port"); + mtx_init(&np->lock, "nvmft port", NULL, MTX_DEF); np->ids = new_unrhdr(0, MIN(CTL_MAX_INIT_PER_PORT - 1, NVMF_CNTLID_STATIC_MAX), UNR_NO_MTX); TAILQ_INIT(&np->controllers); @@ -915,12 +923,12 @@ nvmft_port_remove(struct ctl_req *req) TAILQ_REMOVE(&nvmft_ports, np, link); sx_xunlock(&nvmft_ports_lock); - sx_slock(&np->lock); + mtx_lock(&np->lock); if (np->online) { - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); ctl_port_offline(&np->port); } else - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_port_rele(np); req->status = CTL_LUN_OK; @@ -1058,7 +1066,7 @@ nvmft_list(struct ctl_nvmf *cn) sbuf_printf(sb, "\n"); sx_slock(&nvmft_ports_lock); TAILQ_FOREACH(np, &nvmft_ports, link) { - sx_slock(&np->lock); + mtx_lock(&np->lock); TAILQ_FOREACH(ctrlr, &np->controllers, link) { sbuf_printf(sb, "" "%s" @@ -1070,7 +1078,7 @@ nvmft_list(struct ctl_nvmf *cn) np->cdata.subnqn, ctrlr->trtype); } - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); } sx_sunlock(&nvmft_ports_lock); sbuf_printf(sb, "\n"); @@ -1108,7 +1116,7 @@ nvmft_terminate(struct ctl_nvmf *cn) found = false; sx_slock(&nvmft_ports_lock); TAILQ_FOREACH(np, &nvmft_ports, link) { - sx_slock(&np->lock); + mtx_lock(&np->lock); TAILQ_FOREACH(ctrlr, &np->controllers, link) { if (tp->all != 0) match = true; @@ -1126,7 +1134,7 @@ nvmft_terminate(struct ctl_nvmf *cn) nvmft_controller_error(ctrlr, NULL, ECONNABORTED); found = true; } - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); } sx_sunlock(&nvmft_ports_lock); diff --git a/sys/dev/nvmf/controller/nvmft_controller.c b/sys/dev/nvmf/controller/nvmft_controller.c index 83a156d9b92a..96c9fee47357 100644 --- a/sys/dev/nvmf/controller/nvmft_controller.c +++ b/sys/dev/nvmf/controller/nvmft_controller.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -55,8 +54,6 @@ nvmft_controller_alloc(struct nvmft_port *np, uint16_t cntlid, ctrlr = malloc(sizeof(*ctrlr), M_NVMFT, M_WAITOK | M_ZERO); ctrlr->cntlid = cntlid; - nvmft_port_ref(np); - TAILQ_INSERT_TAIL(&np->controllers, ctrlr, link); ctrlr->np = np; mtx_init(&ctrlr->lock, "nvmft controller", NULL, MTX_DEF); callout_init(&ctrlr->ka_timer, 1); @@ -126,10 +123,10 @@ nvmft_handoff_admin_queue(struct nvmft_port *np, enum nvmf_trtype trtype, return (ENXIO); } - sx_xlock(&np->lock); + mtx_lock(&np->lock); cntlid = alloc_unr(np->ids); if (cntlid == -1) { - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); printf("NVMFT: Unable to allocate controller for %.*s\n", (int)sizeof(data->hostnqn), data->hostnqn); nvmft_connect_error(qp, cmd, NVME_SCT_COMMAND_SPECIFIC, @@ -144,8 +141,21 @@ nvmft_handoff_admin_queue(struct nvmft_port *np, enum nvmf_trtype trtype, ("%s: duplicate controllers with id %d", __func__, cntlid)); } #endif + mtx_unlock(&np->lock); ctrlr = nvmft_controller_alloc(np, cntlid, data); + + mtx_lock(&np->lock); + if (!np->online) { + mtx_unlock(&np->lock); + nvmft_controller_free(ctrlr); + free_unr(np->ids, cntlid); + nvmft_qpair_destroy(qp); + return (ENXIO); + } + nvmft_port_ref(np); + TAILQ_INSERT_TAIL(&np->controllers, ctrlr, link); + nvmft_printf(ctrlr, "associated with %.*s\n", (int)sizeof(data->hostnqn), data->hostnqn); ctrlr->admin = qp; @@ -165,9 +175,9 @@ nvmft_handoff_admin_queue(struct nvmft_port *np, enum nvmf_trtype trtype, callout_reset_sbt(&ctrlr->ka_timer, ctrlr->ka_sbt, 0, nvmft_keep_alive_timer, ctrlr, C_HARDCLOCK); } + mtx_unlock(&np->lock); nvmft_finish_accept(qp, cmd, ctrlr); - sx_xunlock(&np->lock); return (0); } @@ -195,13 +205,13 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, return (ENXIO); } - sx_slock(&np->lock); + mtx_lock(&np->lock); TAILQ_FOREACH(ctrlr, &np->controllers, link) { if (ctrlr->cntlid == cntlid) break; } if (ctrlr == NULL) { - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); printf("NVMFT: Nonexistent controller %u for I/O queue %u from %.*s\n", ctrlr->cntlid, qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -212,7 +222,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, } if (memcmp(ctrlr->hostid, data->hostid, sizeof(ctrlr->hostid)) != 0) { - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "hostid mismatch for I/O queue %u from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -222,7 +232,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, return (EINVAL); } if (memcmp(ctrlr->hostnqn, data->hostnqn, sizeof(ctrlr->hostnqn)) != 0) { - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "hostnqn mismatch for I/O queue %u from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -237,7 +247,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, mtx_lock(&ctrlr->lock); if (ctrlr->shutdown) { mtx_unlock(&ctrlr->lock); - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "attempt to create I/O queue %u on disabled controller from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -248,7 +258,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, } if (ctrlr->num_io_queues == 0) { mtx_unlock(&ctrlr->lock); - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "attempt to create I/O queue %u without enabled queues from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -259,7 +269,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, } if (cmd->qid > ctrlr->num_io_queues) { mtx_unlock(&ctrlr->lock); - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "attempt to create invalid I/O queue %u from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -270,7 +280,7 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, } if (ctrlr->io_qpairs[qid - 1].qp != NULL) { mtx_unlock(&ctrlr->lock); - sx_sunlock(&np->lock); + mtx_unlock(&np->lock); nvmft_printf(ctrlr, "attempt to re-create I/O queue %u from %.*s\n", qid, (int)sizeof(data->hostnqn), data->hostnqn); @@ -282,8 +292,8 @@ nvmft_handoff_io_queue(struct nvmft_port *np, enum nvmf_trtype trtype, ctrlr->io_qpairs[qid - 1].qp = qp; mtx_unlock(&ctrlr->lock); + mtx_unlock(&np->lock); nvmft_finish_accept(qp, cmd, ctrlr); - sx_sunlock(&np->lock); return (0); } @@ -382,11 +392,11 @@ nvmft_controller_terminate(void *arg, int pending) /* Remove association (CNTLID). */ np = ctrlr->np; - sx_xlock(&np->lock); + mtx_lock(&np->lock); TAILQ_REMOVE(&np->controllers, ctrlr, link); - free_unr(np->ids, ctrlr->cntlid); wakeup_np = (!np->online && TAILQ_EMPTY(&np->controllers)); - sx_xunlock(&np->lock); + mtx_unlock(&np->lock); + free_unr(np->ids, ctrlr->cntlid); if (wakeup_np) wakeup(np); diff --git a/sys/dev/nvmf/controller/nvmft_var.h b/sys/dev/nvmf/controller/nvmft_var.h index 7a1748d5999e..6d20e2c8ac11 100644 --- a/sys/dev/nvmf/controller/nvmft_var.h +++ b/sys/dev/nvmf/controller/nvmft_var.h @@ -35,7 +35,7 @@ struct nvmft_port { uint32_t max_io_qsize; bool online; - struct sx lock; + struct mtx lock; struct unrhdr *ids; TAILQ_HEAD(, nvmft_controller) controllers; From nobody Thu Feb 20 15:40:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHXW0lqsz5p3dy; Thu, 20 Feb 2025 15:40: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 4YzHXV6cGnz4Hhh; Thu, 20 Feb 2025 15:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kWzHj9FI3LAy6oEqaSF0YTjLiOugTlZlJOazA/owy14=; b=iskULi5eGAikE+0SpgMBZ8PtsbvvsciBXwIeMHdyzZq+GRLKt4oJBDlExjCbS6XlZK7IcA nbB1lBdIGxCetXp5tB3MrPnWzkx68/sVurnmK6toqlluC7Yw/3FEishx2EiSZySQouyCRr aajRP2ToF7wfCF741iF+fcRIhNoNV1YsebMMtPwlhl2jS0GuzGbF783nicvKXQ5nnYpOSI Y/6SUM7UZoeTA5JaNcRxGEp02BYdxmSOohbaXDWVWAFVVTkGxJ2/zy/ncoNZ2YqksJGpiy 4KAqxbZXlp2J4EkhRmr5MqwdiuPV/bjAEhwKYkn8iy67wnZkTYTC/hm270nodg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740066042; a=rsa-sha256; cv=none; b=D++gghafMVaY9MxnyxwbLzX7FaCkkgZpFJvflZWBCxjw5YMCzF5t61lVW8D30vUerwWkOc bh8W2JYbt/3ChtLG3tqt2Zh5n9mnqk7f5P+Nc24WjpQ+O68l5OuNcdJxHt6IFXFjr6Sn/X 51sfPF8ctygYoMY4Ashmdq2TzuypA+STXMz9Hzd0ae3pVz1tjFdrBeZifDpO8u5pJZHcGB BexJrc2xmGCVN44a0F1gsDozm0Rex+p6dBt273ZqF7j8jf0LVYrqdlu8iFEdlsOWXU4zUA hBgnvSWU38Z3j1ZPTEpjdWWh0U1IALaCyP6e50VaplapgqpD/ae0J5A5aSAyLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kWzHj9FI3LAy6oEqaSF0YTjLiOugTlZlJOazA/owy14=; b=orRXc2Fgmg36b6hmK5wo6OTi43d7h7rQ0GQRK872Ilo2VQucYPrVvCNbzwBw56+xXlRFoD BkSL+4hLMzkXQKHjLktgu9PVRtL7PF5dQy+HjPFF6EPvbHTjP7FjDP/KE4OXMoY0nKWJQ1 BaRAx3DJ9KclEzrZ/NwXNMqAmEFzzpgGWSrTQxV9tLnt1e7GgP4nJZs1vbxeJV7D7yomUU /a6BdHu5M7GhTsUOn0pn9KbeZbjw9JsAkRcacPEYdMNTOQSwW+q65pqmFQLLaWG24KQQVl ojodRsnuRb/EIz8NwGunNHtvAT+G3/4PDL7gfe7ktT75JyUrohbX+BBkUtYmew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHXV5cCNzxtT; Thu, 20 Feb 2025 15:40: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 51KFegSt016935; Thu, 20 Feb 2025 15:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFegPO016932; Thu, 20 Feb 2025 15:40:42 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:40:42 GMT Message-Id: <202502201540.51KFegPO016932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 11509c6ef2fb - main - nvmft: Export more info for a ctl port for use by ctladm List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11509c6ef2fb3e6a83211109cba98da7560b5e12 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11509c6ef2fb3e6a83211109cba98da7560b5e12 commit 11509c6ef2fb3e6a83211109cba98da7560b5e12 Author: John Baldwin AuthorDate: 2025-02-20 15:14:42 +0000 Commit: John Baldwin CommitDate: 2025-02-20 15:31:20 +0000 nvmft: Export more info for a ctl port for use by ctladm In particular, export a "port" entry as well as an array of "host" entries for each active connection. Reviewed by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48775 --- sys/dev/nvmf/controller/ctl_frontend_nvmf.c | 26 ++++++++++++++++++++++++++ sys/dev/nvmf/controller/nvmft_var.h | 1 + 2 files changed, 27 insertions(+) diff --git a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c index a28a613e23aa..658b47699c1d 100644 --- a/sys/dev/nvmf/controller/ctl_frontend_nvmf.c +++ b/sys/dev/nvmf/controller/ctl_frontend_nvmf.c @@ -95,6 +95,30 @@ nvmft_offline(void *arg) mtx_unlock(&np->lock); } +static int +nvmft_info(void *arg, struct sbuf *sb) +{ + struct nvmft_port *np = arg; + struct nvmft_controller *ctrlr; + int retval; + + mtx_lock(&np->lock); + retval = sbuf_printf(sb, "\t%s,p,%u\n", np->cdata.subnqn, + np->portid); + if (retval != 0) + goto out; + + TAILQ_FOREACH(ctrlr, &np->controllers, link) { + retval = sbuf_printf(sb, "\t%s\n", + ctrlr->cntlid, ctrlr->hostnqn); + if (retval != 0) + break; + } +out: + mtx_unlock(&np->lock); + return (retval); +} + static int nvmft_lun_enable(void *arg, int lun_id) { @@ -803,6 +827,7 @@ nvmft_port_create(struct ctl_req *req) np = malloc(sizeof(*np), M_NVMFT, M_WAITOK | M_ZERO); refcount_init(&np->refs, 1); + np->portid = portid; np->max_io_qsize = max_io_qsize; np->cap = _nvmf_controller_cap(max_io_qsize, enable_timeout / 500); mtx_init(&np->lock, "nvmft port", NULL, MTX_DEF); @@ -834,6 +859,7 @@ nvmft_port_create(struct ctl_req *req) port->virtual_port = 0; port->port_online = nvmft_online; port->port_offline = nvmft_offline; + port->port_info = nvmft_info; port->onoff_arg = np; port->lun_enable = nvmft_lun_enable; port->lun_disable = nvmft_lun_disable; diff --git a/sys/dev/nvmf/controller/nvmft_var.h b/sys/dev/nvmf/controller/nvmft_var.h index 6d20e2c8ac11..85032b2dc55f 100644 --- a/sys/dev/nvmf/controller/nvmft_var.h +++ b/sys/dev/nvmf/controller/nvmft_var.h @@ -33,6 +33,7 @@ struct nvmft_port { struct nvme_firmware_page fp; uint64_t cap; uint32_t max_io_qsize; + uint16_t portid; bool online; struct mtx lock; From nobody Thu Feb 20 15:40:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHXX1ZPkz5p3Vx; Thu, 20 Feb 2025 15:40: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 4YzHXX0CpXz4Hn9; Thu, 20 Feb 2025 15:40:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XGLW0xsMjTgyMW3IGb9eM7TrO1GdE1qDSLkg1Yh3Iw=; b=BmtRhJOPj/MMtZCgJm0k8saXXG5P6VjondKLDZNvIZVCyU6WsZPKN9DsscjdICDuwweF/4 xWG8YWuj2fiRezGHwZpQhv79rOk7PyYZT00ltZLIo6UiZok0Co0fn6Oa7nGX/whMUQ59nL at4SnlNLYoZGRqOYO+TW3GOgOa7t5L27hj4YSgVGGNrfpRKUg+RVzq7N6VVOJNeqj4hgpj Tztuo2cHRkg/VL5SPBqieb7VmZw/TimMKT5JZEWhEo+4C5pTydXyx6dFV0rnNbS3RwFfg/ s740KiKjrm4cHrVjcuBQ4uqqcwyoA00CpuXt2K1tgMrzRCaVntbk34pSDAdfEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740066044; a=rsa-sha256; cv=none; b=dD9qBDOqIg9ndWxOLkgtIHhbM8j+s7kXwAiLL0ZRcRLHIy9lSOiu8tfvdKaM8ThYcKVxp0 u5wcwKelrOCUBQAcD1sJogxa4TlB8HRzTgKWe8JfnG6YjrgUhW3aDQsZbNYXCNGYmaOjSh o4IrlYvfdQi+2LcqFAiGlI/LWYBe08Kz299xHElRtCv/z8ptTZ0nQTv9Q7emO8n7bqoTdl ybh2vg3Z+TwDA4mM1R3RfEcEXcG5rsUdChfUio0VHMR6MLKtXxvN8BK+YW3zwQSloTlcCK sFN2Mx3B+w3444kGNWX/km60DGlZjq0VJhUw0dkOZg1R2vZpRgG2wXhgZaxKvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1XGLW0xsMjTgyMW3IGb9eM7TrO1GdE1qDSLkg1Yh3Iw=; b=H43m8fS1pXPssKADUbsqpMABgfZ7RUD9EUOkOMS4u3Sk8W9tXgU5uCIi5kHKsxr6oDGH7C ujfbf/qhbQlnU4OVHJ+ohgh1m+TqKfiPn9pYdZjyCS9tKZnakUz/S2G7h4uYHJa5a+GxcB 5oGRN3HxwkE8Vn0ePsBnZVNGfdWdz3DsZ5bLzgHffbVviced7hks6cO6bFDpzWvJTkMCmR gZEGght/KmHqpocKI0dys2giVyn0SjooZU/wTARqwtNYo1j5iX7jXsFqLmUOJYi5BPVfHw 4scDC0unQ6mZYUtkkwwQfDQorQOLfLR+nJq8Mnz6UW2vPuWx0IxIqkiKOqwHBw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHXW6tbkzy7s; Thu, 20 Feb 2025 15:40: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 51KFehOi016969; Thu, 20 Feb 2025 15:40:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFehke016966; Thu, 20 Feb 2025 15:40:43 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:40:43 GMT Message-Id: <202502201540.51KFehke016966@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b277346d2462 - main - ctladm: Handle connected hosts for NVMeoF ports List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b277346d246237dd4051e9e03311b8ae5b0893d1 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b277346d246237dd4051e9e03311b8ae5b0893d1 commit b277346d246237dd4051e9e03311b8ae5b0893d1 Author: John Baldwin AuthorDate: 2025-02-20 15:15:43 +0000 Commit: John Baldwin CommitDate: 2025-02-20 15:31:21 +0000 ctladm: Handle connected hosts for NVMeoF ports Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48776 --- usr.sbin/ctladm/ctladm.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index d9bfa27c4820..593d3259125f 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -3496,7 +3496,8 @@ struct cctl_port { char *frontend_type; char *name; int pp, vp; - char *target, *port, *lun_map; + char *controller, *target, *port, *lun_map; + nvlist_t *host_list; nvlist_t *init_list; nvlist_t *lun_list; nvlist_t *attr_list; @@ -3550,6 +3551,7 @@ cctl_start_pelement(void *user_data, const char *name, const char **attr) portlist->num_ports++; portlist->cur_port = cur_port; + cur_port->host_list = nvlist_create(0); cur_port->init_list = nvlist_create(0); cur_port->lun_list = nvlist_create(0); cur_port->attr_list = nvlist_create(NV_FLAG_NO_UNIQUE); @@ -3610,6 +3612,9 @@ cctl_end_pelement(void *user_data, const char *name) } else if (strcmp(name, "target") == 0) { cur_port->target = str; str = NULL; + } else if (strcmp(name, "subnqn") == 0) { + cur_port->controller = str; + str = NULL; } else if (strcmp(name, "port") == 0) { cur_port->port = str; str = NULL; @@ -3620,6 +3625,14 @@ cctl_end_pelement(void *user_data, const char *name) portlist->cur_port = NULL; } else if (strcmp(name, "ctlportlist") == 0) { /* Nothing. */ + } else if (strcmp(name, "host") == 0) { + snprintf(idname, sizeof(idname), "%ju", portlist->cur_id); + nvlist_move_string(cur_port->host_list, idname, str); + error = nvlist_error(cur_port->host_list); + if (error != 0) + errc(1, error, "%s: can't add host nv pair", + __func__); + str = NULL; } else if (strcmp(name, "initiator") == 0) { snprintf(idname, sizeof(idname), "%ju", portlist->cur_id); nvlist_move_string(cur_port->init_list, idname, str); @@ -3771,6 +3784,9 @@ retry: port->port ? port->port : ""); if (init || verbose) { + if (port->controller) + printf(" Controller: %s\n", port->controller); + print_nvlist(port->host_list, " Host %s: %s\n"); if (port->target) printf(" Target: %s\n", port->target); print_nvlist(port->init_list, " Initiator %s: %s\n"); From nobody Thu Feb 20 15:40:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHXZ3nXGz5p3f4; Thu, 20 Feb 2025 15:40: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 4YzHXY3qX9z4HcB; Thu, 20 Feb 2025 15:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRC2jZ7egrHIcZR6Ytb8c3E5DyhaaxrNwMaGJaMWYuU=; b=FQsc1/ilY9ulXOQ/K859u5GSJfCxb7ijHo2T6EiLHGzcET6cZY9IFbfwmzpIn528C3shOL +tW97NQ0OcFFKGh1PMpqpDze/Ik6d00yawCL7AH8ftEpnpFlLzkI/ZJqUpEdFGif8Hzein u7kDEzVr9mpVsmsrkUfbjo9HMH2DYLUtQE9/kh/XudEARBhNPcivjXyYPZJwtdoyey5MbR 0N1xnEAhc9Jyf4M2dJdpLh+4/L+CgLkFXKnTdVwOmGl0xa9IIprxv4z2nP+ZUOGG6ktZNB FLzGL97OZy7MPANf30iUVEZdurymup7R6nSrziKv5qGXRA+EN0kSJTwaRcGa7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740066045; a=rsa-sha256; cv=none; b=lm4GYbgJgKCLuACF99sMKXxCOQM7WLXldLHZoBAbFE/LhCXmUScQczLL6qhvcAiCQM4fKK hVGfRAuVyzjXBgn/SZpbrrJ0e7km9YIEMjw44eIQ0/d2zHeOUr0Zq0HXBJk3qL1RMfDfTX 9oZWEnt6MwAOIPavvOX1n2EiT7CI8FSGdAVWvM6UBgC4Pt0o3ECS6RufInmVcuvNxBbjQ4 +lwwQiqTry25C2dHOYujPss6e/G+qV82pa9OvCzK5G2sphNizMIOxJnh0VLEW770MQF1pn nz2HoFePOOl5N6l5fVoFZSXGSzZwqWHvmqm8ZUbvOzKhjv4gesbgvq6XqN5WYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740066045; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qRC2jZ7egrHIcZR6Ytb8c3E5DyhaaxrNwMaGJaMWYuU=; b=eAAmMfOfKv/gs8YsYsrTQHY19a5IUqVmT4o0Bn2gaLr19vBc9qlSDNwtJW7BeKh0uMUdrt jqubwTzVoP0PKwyxApKiWm7vfimC6UNXhH93qW559HMsbEQ7pQfGa5wNs4suDxUGVZ25BB U8e+6CzWu6+axogmvTCoc4RJTFkWEGants00HynDdzdvIThClqIuw+eAGF32IOPCuLrrRN XSpclKKalCUwkMDbivrO6Okn1NeekXgWtp3RIuKs5YTy48wE2qj9AfU+ttruGaihhCBzw+ dpV4S+ARtGPxd2b96i5jEAA3UiCzCeLJ4YtbsEaPlMB5cE1r6h0VrF9RjCqdlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHXY16pGzy3V; Thu, 20 Feb 2025 15:40: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 51KFejxt017002; Thu, 20 Feb 2025 15:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KFei6j016999; Thu, 20 Feb 2025 15:40:44 GMT (envelope-from git) Date: Thu, 20 Feb 2025 15:40:44 GMT Message-Id: <202502201540.51KFei6j016999@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8206fcc5ef82 - main - ctladm: portlist -i lists target and initiator names rather than addresses List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8206fcc5ef82a0e0518ed5e3a011ef38893b3eb6 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8206fcc5ef82a0e0518ed5e3a011ef38893b3eb6 commit 8206fcc5ef82a0e0518ed5e3a011ef38893b3eb6 Author: John Baldwin AuthorDate: 2025-02-20 15:39:50 +0000 Commit: John Baldwin CommitDate: 2025-02-20 15:39:50 +0000 ctladm: portlist -i lists target and initiator names rather than addresses Sponsored by: Chelsio Communications --- usr.sbin/ctladm/ctladm.8 | 4 ++-- usr.sbin/ctladm/ctladm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ctladm/ctladm.8 b/usr.sbin/ctladm/ctladm.8 index 3da9713accac..64b507404359 100644 --- a/usr.sbin/ctladm/ctladm.8 +++ b/usr.sbin/ctladm/ctladm.8 @@ -35,7 +35,7 @@ .\" .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" -.Dd June 6, 2024 +.Dd February 20, 2025 .Dt CTLADM 8 .Os .Sh NAME @@ -710,7 +710,7 @@ List CTL frontend ports. .It Fl f Ar frontend Specify the frontend type. .It Fl i -Report target and connected initiators addresses. +Report target and connected initiator names. .It Fl l Report LUN mapping. .It Fl p Ar targ_port diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c index 593d3259125f..d93334a6722d 100644 --- a/usr.sbin/ctladm/ctladm.c +++ b/usr.sbin/ctladm/ctladm.c @@ -4289,7 +4289,7 @@ usage(int error) "-r : remove frontend port\n" "portlist options:\n" "-f frontend : specify frontend type\n" -"-i : report target and initiators addresses\n" +"-i : report target and connected initiator names\n" "-l : report LUN mapping\n" "-p targ_port : specify target port number\n" "-q : omit header in list output\n" From nobody Thu Feb 20 16:00:59 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzHzx2SjCz5p4hB; Thu, 20 Feb 2025 16:01: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 4YzHzv6Lddz3Fk7; Thu, 20 Feb 2025 16:00:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740067259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x3VVEPcZPdO6stmvym8XbdUQ4CpxUtxI80WqRWd+8tE=; b=fD0UCYwvmiPWWzvqdyECW0JXVUfcvt+Yhc66Q6VCz9vuJh7/XBeANwjZT1NkUGNAmbU5xS Mpor5F8vRsmzJpuHDnC66lm5notDlpAFE/E1QMdXGZc/LsKg7groQMvClkS0MHC3SrNJcJ cqTqojDH8NlOMLFbgZuAR9HYoi/uH6r+dsCEhbeDGl1pQCbz4IJiUq0AIlinYBudXtBhG5 /idqPt4vhd+VG+Pm11upncUPq/5O9TVl+h/ZAi5QKI1q6qUuP+Ii0Yy5eC9b6SZvw6F3gT zzaLKgrUWomayxlETUS1Qh7yzepzf1acuV+8T8etRdjhzNqXtM7mn0W0qGTEWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740067259; a=rsa-sha256; cv=none; b=aP+XqEGkjeHuPYH33y1jvqdLFfbX/6+PMZ3xhhjXdtAL1tmjLP2hEKFIGe4YWBQP8+GU+u f+B4yE7igrcLc+VC4SgiIV9RI86JJJjMMkcrXrpUPKOKiq7PDWooMDP339jDHz2M4kTDMv Z1BQOp0NzS9M/XTNu0eSjqHB3WI75UtBHXzQCpOTfz5sSYHQ6diqTq+mb77Cz6v8ihfhOx wZw1AgL96M6XmVMWx/xU5AY5PB1Jdzsn8qhraCq1JbbQ7szDZNCG4FO/WNd1Z0GJOhVAhQ 8t4uwAllotOcdWjMA9ejNC6SVYaf9Ej2OBTLfp1bx8ln/HQmV1+r01988Y/ViA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740067259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=x3VVEPcZPdO6stmvym8XbdUQ4CpxUtxI80WqRWd+8tE=; b=TnML1ZAEFbqy4ZUywA5GfkxQ5vhgtV1YSmcdRWSk0e7XBhhr0+13e9dISWfaLaMZlOhhkI 9iMrLHHrmuoFZHWwmYd1mFJPdcWWALM6LOg+7YH4NRS4913oNqxfuLmHWvzMPhpxsebfaB ZGawK4Hme0BP4x+q/slM3Ik6yPJDW7V1RcwVeFVeHUqfWxSxvXspTkaZPHEeV+z8qY8lnI kX/PD9swXGsLsvoBGnFeoSUBdWOLIk6Bl9AYzljeOG1D2xrzqTSXK6reAeOHDij4lVqCc3 iCjTg+HAT1rWI8uQgNFG4YLYVjwqDuAYK+7Eg56n/JgCxeuIiOS2ufspgPyVng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzHzv5szjzybD; Thu, 20 Feb 2025 16:00: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 51KG0x0g053734; Thu, 20 Feb 2025 16:00:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KG0xrh053731; Thu, 20 Feb 2025 16:00:59 GMT (envelope-from git) Date: Thu, 20 Feb 2025 16:00:59 GMT Message-Id: <202502201600.51KG0xrh053731@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: 7f9ef5c75fd1 - main - cc_cubic: remove redundant code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f9ef5c75fd18fadcd2a74c2c489f218d7611208 Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=7f9ef5c75fd18fadcd2a74c2c489f218d7611208 commit 7f9ef5c75fd18fadcd2a74c2c489f218d7611208 Author: Cheng Cui AuthorDate: 2025-02-14 16:00:44 +0000 Commit: Cheng Cui CommitDate: 2025-02-20 16:00:41 +0000 cc_cubic: remove redundant code During my progress on updating cc_cubic to RFC9438, found such redundancy as: - W_est: we use the alternative stack local variable `W_est` in `cubic_ack_received()`. - cwnd_prior: it is used for Reno-Friendly Region in RFC9438 Section 4.3, but we use the alternative cwnd from NewReno for Reno-Friendly as in commit ee45061051715be4704ba22d2fcd1c373e29079d. No functional change intended. Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D49008 --- sys/netinet/cc/cc_cubic.c | 5 ----- sys/netinet/cc/cc_cubic.h | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index ae1561ca54c3..91d6642eb08d 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -468,8 +468,6 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) */ cubic_data->undo_t_epoch = cubic_data->t_epoch; cubic_data->undo_cwnd_epoch = cubic_data->cwnd_epoch; - cubic_data->undo_W_est = cubic_data->W_est; - cubic_data->undo_cwnd_prior = cubic_data->cwnd_prior; cubic_data->undo_W_max = cubic_data->W_max; cubic_data->undo_K = cubic_data->K; if (V_tcp_do_newsack) { @@ -484,16 +482,13 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) CUBIC_BETA) >> CUBIC_SHIFT) / mss) * mss; } cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; - cubic_data->undo_W_max = cubic_data->W_max; CCV(ccv, snd_cwnd) = mss; break; case CC_RTO_ERR: cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); cubic_data->K = cubic_data->undo_K; - cubic_data->cwnd_prior = cubic_data->undo_cwnd_prior; cubic_data->W_max = cubic_data->undo_W_max; - cubic_data->W_est = cubic_data->undo_W_est; cubic_data->cwnd_epoch = cubic_data->undo_cwnd_epoch; cubic_data->t_epoch = cubic_data->undo_t_epoch; break; diff --git a/sys/netinet/cc/cc_cubic.h b/sys/netinet/cc/cc_cubic.h index b4773618e6f8..c30128570ab0 100644 --- a/sys/netinet/cc/cc_cubic.h +++ b/sys/netinet/cc/cc_cubic.h @@ -94,16 +94,8 @@ struct cubic { int64_t sum_rtt_usecs; /* Size of cwnd just before cwnd was reduced in the last congestion event */ uint64_t W_max; - /* An estimate for the congestion window in the Reno-friendly region */ - uint64_t W_est; /* The cwnd at the beginning of the current congestion avoidance stage */ uint64_t cwnd_epoch; - /* - * Size of cwnd at the time of setting ssthresh most recently, - * either upon exiting the first slow start, or just before cwnd - * was reduced in the last congestion event - */ - uint64_t cwnd_prior; /* various flags */ uint32_t flags; /* Minimum observed rtt in usecs. */ @@ -118,9 +110,7 @@ struct cubic { int undo_t_epoch; /* Few variables to restore the state after RTO_ERR */ int64_t undo_K; - uint64_t undo_cwnd_prior; uint64_t undo_W_max; - uint64_t undo_W_est; uint64_t undo_cwnd_epoch; uint32_t css_baseline_minrtt; uint32_t css_current_round_minrtt; From nobody Thu Feb 20 16:43:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzJwn140Gz5p78m; Thu, 20 Feb 2025 16:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzJwn0lvqz3YRr; Thu, 20 Feb 2025 16:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740069801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WncrzNEDIx9tJYqtWbBX+R47QcrxA+CgJuo7JUEBCSw=; b=fuSgv46+DLBldAplhrvz/OQgWWirL1C+L4Jmz+lY1SxDKfar4hWOLHVCsb4rm8t4K2ROmV +5o+ogOBkkXEt78xIEf4i5DCdOkrtOErOan5YCBFqV0nioLoT0c9VZM5SSAY02672uYzpr OBs/HGtG8BPaT7u2tZP9rayA1bxvL+0W4y8SLJ2ChBrdg0GfqWMx4CB8U0u//EeZilpx75 mLDcQpUg5CUOb2diYFs2s57oERmwWDs2+MQ7XaQrxSRIE6itI4dTXrLKptMU9/SByPbTGC o7UoGCLD/2qRzYch5sTJsXQlwDJrq/iy+qFHQHmZhpt3k5xaxeLSSEkHx0e8NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740069801; a=rsa-sha256; cv=none; b=DQ4kFPVaB1sXL22+fz6KoFhxl068T3+jMbV2xBmpk0SOgNHHemRVbC16RH5o8tWDwq4Ax9 tTrPfK4eXA/sv9O5fIYOjXrNWYDjQYtuWMi0hye8rrPHa6+RUeQzXuaufTmL+9P6JVzG6D dMb4u0hZeQriMm4w3XSLYcpKMfoDXvq3Fuz2sTvxLIUBSYkGau1Wqs3mawrdhIJrXbm13W eg/ibXCItFMw9dBTZ5UgN6UfbQ3JYsTdqpl3dtJawAEilutw+asDToZ3hrkgqKxh4u64kf j2KrrOA+H6buPTMnCq9kVDiG4ftFycYXgchb1G34S1+G3AbIhwMm30AaeCdKJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740069801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WncrzNEDIx9tJYqtWbBX+R47QcrxA+CgJuo7JUEBCSw=; b=wfeOyN0F3BonYI/YJp7Bmxwwr254sZmvRqimQ1Eg2m4ea83iKJcKVi67TUjUkJZQUPMcCF GJMnS1NqxWXJRpn9kikn0mQ8KfxCmyAc4OdT4uA1AqcBKA160ByT/dp6VuMnE2DhJlg+HE S005CmjhGmUgNu5XR8M89yQJWCxLK7msVpt5q6pehQdbIGAhGJqPkMaEOvhrsmS+AQ7zCd JVe1IosTcLKuwZORd15YccmMQ14T5yr5FcHXsJNjtFpKmGt2BpH34zwPyAKZ/poLhcIY9q TNFavDZZx1auBSGDFWZYz9vnIeQ7eS1OfWcveN9nyuKSIjNrZty9DuTR0eqD4w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzJwn0ChRz10g5; Thu, 20 Feb 2025 16:43: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 51KGhKNj035779; Thu, 20 Feb 2025 16:43:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KGhKpK035775; Thu, 20 Feb 2025 16:43:20 GMT (envelope-from git) Date: Thu, 20 Feb 2025 16:43:20 GMT Message-Id: <202502201643.51KGhKpK035775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: b59a0cde6a52 - main - zfs: merge openzfs/zfs@6a2f7b384 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b59a0cde6a5253f94494397ce5b18dbfa071e08c Auto-Submitted: auto-generated The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=b59a0cde6a5253f94494397ce5b18dbfa071e08c commit b59a0cde6a5253f94494397ce5b18dbfa071e08c Merge: 7f9ef5c75fd1 6a2f7b38442b Author: Martin Matuska AuthorDate: 2025-02-20 16:39:54 +0000 Commit: Martin Matuska CommitDate: 2025-02-20 16:40:55 +0000 zfs: merge openzfs/zfs@6a2f7b384 Notable upstream pull request merges: #16857 387ed5ca4 Add recursive dataset mounting and unmounting support to pam_zfs_key #16929 c2458ba92 optimize recv_fix_encryption_hierarchy() #16980 12f0baf34 Make the vfs.zfs.vdev.raidz_impl sysctl cross-platform #16986 40496514b Expand fragmentation table to reflect larger possibile allocation sizes #17003 88020b993 Add kstats tracking gang allocations #17013 21205f648 Avoid ARC buffer transfrom operations in prefetch #17016 390f6c119 zio: lock parent zios when updating wait counts on reexecute #17029 b8c73ab78 zio: do no-op injections just before handing off to vdevs #17037 6a2f7b384 Fix metaslab group fragmentation math #17040 b901d4a0b Update the dataset name in handle after zfs_rename Obtained from: OpenZFS OpenZFS commit: 6a2f7b38442b42f4bc9a848f8de10fc792ce8d76 cddl/lib/pam_zfs_key/Makefile | 1 + sys/contrib/openzfs/cmd/zdb/zdb.c | 109 ++-- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 8 +- sys/contrib/openzfs/config/kernel-automount.m4 | 41 +- sys/contrib/openzfs/config/kernel-vfs-iov_iter.m4 | 27 + .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 304 ++++++++--- .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 3 + sys/contrib/openzfs/include/os/linux/spl/sys/uio.h | 10 + sys/contrib/openzfs/include/sys/dnode.h | 2 +- sys/contrib/openzfs/include/sys/metaslab.h | 2 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 24 +- sys/contrib/openzfs/include/sys/range_tree.h | 253 ++++----- sys/contrib/openzfs/include/sys/space_map.h | 16 +- sys/contrib/openzfs/include/sys/space_reftree.h | 4 +- sys/contrib/openzfs/include/sys/vdev.h | 10 +- sys/contrib/openzfs/include/sys/vdev_impl.h | 19 +- sys/contrib/openzfs/include/sys/vdev_raidz.h | 3 + sys/contrib/openzfs/include/sys/vdev_rebuild.h | 3 +- sys/contrib/openzfs/include/sys/vdev_removal.h | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 1 + sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 100 ++-- sys/contrib/openzfs/man/man4/zfs.4 | 2 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 33 +- sys/contrib/openzfs/module/Kbuild.in | 1 + sys/contrib/openzfs/module/Makefile.in | 4 +- .../openzfs/module/os/freebsd/zfs/sysctl_os.c | 21 + .../openzfs/module/os/linux/spl/spl-kmem-cache.c | 1 + .../openzfs/module/os/linux/zfs/vdev_raidz.c | 42 ++ sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 64 ++- .../openzfs/module/os/linux/zfs/zpl_ctldir.c | 6 + sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 11 +- sys/contrib/openzfs/module/zfs/arc.c | 1 + sys/contrib/openzfs/module/zfs/dbuf.c | 4 +- sys/contrib/openzfs/module/zfs/dnode.c | 10 +- sys/contrib/openzfs/module/zfs/dnode_sync.c | 23 +- sys/contrib/openzfs/module/zfs/dsl_pool.c | 4 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 101 ++-- sys/contrib/openzfs/module/zfs/metaslab.c | 581 +++++++++++---------- sys/contrib/openzfs/module/zfs/range_tree.c | 484 ++++++++--------- sys/contrib/openzfs/module/zfs/spa.c | 2 +- sys/contrib/openzfs/module/zfs/spa_checkpoint.c | 4 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 16 +- sys/contrib/openzfs/module/zfs/space_map.c | 59 ++- sys/contrib/openzfs/module/zfs/space_reftree.c | 17 +- sys/contrib/openzfs/module/zfs/vdev.c | 120 +++-- sys/contrib/openzfs/module/zfs/vdev_draid.c | 6 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 6 +- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 41 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 3 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 37 +- sys/contrib/openzfs/module/zfs/vdev_raidz_math.c | 21 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 29 +- sys/contrib/openzfs/module/zfs/vdev_removal.c | 167 +++--- sys/contrib/openzfs/module/zfs/vdev_trim.c | 97 ++-- sys/contrib/openzfs/module/zfs/zio.c | 110 +++- sys/contrib/openzfs/tests/runfiles/freebsd.run | 4 +- sys/contrib/openzfs/tests/runfiles/linux.run | 6 +- .../openzfs/tests/zfs-tests/tests/Makefile.am | 2 + .../tests/functional/direct/dio_loopback_dev.ksh | 78 +++ .../zfs-tests/tests/functional/pam/cleanup.ksh | 1 + .../tests/functional/pam/pam_mount_recursively.ksh | 90 ++++ .../functional/rsend/send_encrypted_hierarchy.ksh | 31 +- sys/modules/zfs/zfs_config.h | 10 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 64 files changed, 2002 insertions(+), 1294 deletions(-) diff --cc cddl/lib/pam_zfs_key/Makefile index 4d3b41bf3ad0,000000000000..517ca402d4da mode 100644,000000..100644 --- a/cddl/lib/pam_zfs_key/Makefile +++ b/cddl/lib/pam_zfs_key/Makefile @@@ -1,29 -1,0 +1,30 @@@ +.PATH: ${SRCTOP}/sys/contrib/openzfs/contrib/pam_zfs_key +.PATH: ${SRCTOP}/sys/contrib/openzfs/include + +PACKAGE= zfs +LIB= pam_zfs_key + +SHLIBDIR?= /usr/lib + +LIBADD= zfs zfs_core nvpair uutil crypto + +SRCS= pam_zfs_key.c + +WARNS?= 2 +CSTD= c99 +CFLAGS+= -DIN_BASE +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include ++CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs +CFLAGS+= -DRUNSTATEDIR=\"/var/run\" + +.include "../../lib/libpam/modules/Makefile.inc" +.include diff --cc sys/contrib/openzfs/module/os/linux/zfs/vdev_raidz.c index 000000000000,0b34ca52fb90..0b34ca52fb90 mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/os/linux/zfs/vdev_raidz.c +++ b/sys/contrib/openzfs/module/os/linux/zfs/vdev_raidz.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/direct/dio_loopback_dev.ksh index 000000000000,7186eba5aafc..7186eba5aafc mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/direct/dio_loopback_dev.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/direct/dio_loopback_dev.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/pam/pam_mount_recursively.ksh index 000000000000,93683da7d7db..93683da7d7db mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/pam/pam_mount_recursively.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/pam/pam_mount_recursively.ksh diff --cc sys/modules/zfs/zfs_config.h index b6cb1ab0652e,000000000000..fcf5949c8ca6 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,826 -1,0 +1,832 @@@ +/* + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* __assign_str() has one arg */ +/* #undef HAVE_1ARG_ASSIGN_STR */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* add_disk() returns int */ +/* #undef HAVE_ADD_DISK_RET */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +/* Define if you have [rt] */ +#define HAVE_AIO_H 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* backtrace() is available */ +/* #undef HAVE_BACKTRACE */ + +/* bdevname() is available */ +/* #undef HAVE_BDEVNAME */ + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_file_open_by_path() exists */ +/* #undef HAVE_BDEV_FILE_OPEN_BY_PATH */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_63 */ + +/* bdev_*_io_acct() available */ +/* #undef HAVE_BDEV_IO_ACCT_OLD */ + +/* bdev_kobj() exists */ +/* #undef HAVE_BDEV_KOBJ */ + +/* bdev_max_discard_sectors() is available */ +/* #undef HAVE_BDEV_MAX_DISCARD_SECTORS */ + +/* bdev_max_secure_erase_sectors() is available */ +/* #undef HAVE_BDEV_MAX_SECURE_ERASE_SECTORS */ + +/* bdev_nr_bytes() is available */ +/* #undef HAVE_BDEV_NR_BYTES */ + +/* bdev_open_by_path() exists */ +/* #undef HAVE_BDEV_OPEN_BY_PATH */ + +/* bdev_release() exists */ +/* #undef HAVE_BDEV_RELEASE */ + +/* block_device_operations->submit_bio() returns void */ +/* #undef HAVE_BDEV_SUBMIT_BIO_RETURNS_VOID */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio_alloc() takes 4 arguments */ +/* #undef HAVE_BIO_ALLOC_4ARG */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_dev() is a macro */ +/* #undef HAVE_BIO_SET_DEV_MACRO */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_get_by_path() exists and takes 4 args */ +/* #undef HAVE_BLKDEV_GET_BY_PATH_4ARG */ + +/* blkdev_get_by_path() handles ERESTARTSYS */ +/* #undef HAVE_BLKDEV_GET_ERESTARTSYS */ + +/* __blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_FLAGS */ + +/* __blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_ASYNC_NOFLAGS */ + +/* blkdev_issue_discard(flags) is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_FLAGS */ + +/* blkdev_issue_discard() is available */ +/* #undef HAVE_BLKDEV_ISSUE_DISCARD_NOFLAGS */ + +/* blkdev_issue_secure_erase() is available */ +/* #undef HAVE_BLKDEV_ISSUE_SECURE_ERASE */ + +/* blkdev_put() exists */ +/* #undef HAVE_BLKDEV_PUT */ + +/* blkdev_put() accepts void* as arg 2 */ +/* #undef HAVE_BLKDEV_PUT_HOLDER */ + +/* struct queue_limits has a features field */ +/* #undef HAVE_BLKDEV_QUEUE_LIMITS_FEATURES */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_disk() exists and takes 2 args */ +/* #undef HAVE_BLK_ALLOC_DISK_2ARG */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk_cleanup_disk() exists */ +/* #undef HAVE_BLK_CLEANUP_DISK */ + +/* blk_mode_t is defined */ +/* #undef HAVE_BLK_MODE_T */ + +/* block multiqueue hardware context is cached in struct request */ +/* #undef HAVE_BLK_MQ_RQ_HCTX */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_discard() is available */ +/* #undef HAVE_BLK_QUEUE_DISCARD */ + +/* backing_dev_info is available through queue gendisk */ +/* #undef HAVE_BLK_QUEUE_DISK_BDI */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_update_readahead() exists */ +/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ + +/* BLK_STS_RESV_CONFLICT is defined */ +/* #undef HAVE_BLK_STS_RESV_CONFLICT */ + +/* Define if release() in block_device_operations takes 1 arg */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_1ARG */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* copy_splice_read exists */ +/* #undef HAVE_COPY_SPLICE_READ */ + +/* cpu_has_feature() is GPL-only */ +/* #undef HAVE_CPU_HAS_FEATURE_GPL_ONLY */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* 3-arg dequeue_signal() takes a type argument */ +/* #undef HAVE_DEQUEUE_SIGNAL_3ARG_TYPE */ + +/* dequeue_signal() takes 4 arguments */ +/* #undef HAVE_DEQUEUE_SIGNAL_4ARG */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* disk_check_media_change() exists */ +/* #undef HAVE_DISK_CHECK_MEDIA_CHANGE */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* disk_update_readahead() exists */ +/* #undef HAVE_DISK_UPDATE_READAHEAD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + ++/* dops->d_revalidate() takes 4 args */ ++/* #undef HAVE_D_REVALIDATE_4ARGS */ ++ +/* Define to 1 if you have the 'execvpe' function. */ +#define HAVE_EXECVPE 1 + +/* fault_in_iov_iter_readable() is available */ +/* #undef HAVE_FAULT_IN_IOV_ITER_READABLE */ + +/* file->f_version exists */ +/* #undef HAVE_FILE_F_VERSION */ + +/* flush_dcache_page() is GPL-only */ +/* #undef HAVE_FLUSH_DCACHE_PAGE_GPL_ONLY */ + +/* Define if compiler supports -Wformat-overflow */ +/* #undef HAVE_FORMAT_OVERFLOW */ + +/* fsync_bdev() is declared in include/blkdev.h */ +/* #undef HAVE_FSYNC_BDEV */ + +/* yes */ +/* #undef HAVE_GENERIC_FADVISE */ + +/* generic_fillattr requires struct mnt_idmap* */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP */ + +/* generic_fillattr requires struct mnt_idmap* and u32 request_mask */ +/* #undef HAVE_GENERIC_FILLATTR_IDMAP_REQMASK */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* GENHD_FL_EXT_DEVT flag is available */ +/* #undef HAVE_GENHD_FL_EXT_DEVT */ + +/* GENHD_FL_NO_PART flag is available */ +/* #undef HAVE_GENHD_FL_NO_PART */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the 'gettid' function. */ +/* #undef HAVE_GETTID */ + +/* iops->get_acl() exists */ +/* #undef HAVE_GET_ACL */ + +/* iops->get_acl() takes rcu */ +/* #undef HAVE_GET_ACL_RCU */ + +/* has iops->get_inode_acl() */ +/* #undef HAVE_GET_INODE_ACL */ + +/* iattr->ia_vfsuid and iattr->ia_vfsgid exist */ +/* #undef HAVE_IATTR_VFSID */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* iops->getattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_GETATTR */ + +/* iops->setattr() takes struct mnt_idmap* */ +/* #undef HAVE_IDMAP_IOPS_SETATTR */ + +/* APIs for idmapped mount are present */ +/* #undef HAVE_IDMAP_MNT_API */ + +/* mnt_idmap does not have user_namespace */ +/* #undef HAVE_IDMAP_NO_USERNS */ + +/* Define if compiler supports -Wimplicit-fallthrough */ +/* #undef HAVE_IMPLICIT_FALLTHROUGH */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_INFINITE_RECURSION */ + +/* inode_get_atime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_ATIME */ + +/* inode_get_ctime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_CTIME */ + +/* inode_get_mtime() exists in linux/fs.h */ +/* #undef HAVE_INODE_GET_MTIME */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes mnt_idmap */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAP */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_USERNS */ + +/* inode_set_atime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_ATIME_TO_TS */ + +/* inode_set_ctime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_CTIME_TO_TS */ + +/* inode_set_mtime_to_ts() exists in linux/fs.h */ +/* #undef HAVE_INODE_SET_MTIME_TO_TS */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* iops->create() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_CREATE_IDMAP */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKDIR_IDMAP */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_MKNOD_IDMAP */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->permission() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_PERMISSION_IDMAP */ + +/* iops->permission() takes struct user_namespace* */ +/* #undef HAVE_IOPS_PERMISSION_USERNS */ + +/* iops->rename() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_RENAME_IDMAP */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct mnt_idmap* */ +/* #undef HAVE_IOPS_SYMLINK_IDMAP */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + ++/* iov_iter_get_pages2() is available */ ++/* #undef HAVE_IOV_ITER_GET_PAGES2 */ ++ +/* iov_iter_type() is available */ +/* #undef HAVE_IOV_ITER_TYPE */ + +/* Define to 1 if you have the 'issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* iter_iov() is available */ +/* #undef HAVE_ITER_IOV */ + +/* iter_is_ubuf() is available */ +/* #undef HAVE_ITER_IS_UBUF */ + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* kernel has asm/fpu/internal.h */ +/* #undef HAVE_KERNEL_FPU_INTERNAL_HEADER */ + +/* Define if compiler supports -Winfinite-recursion */ +/* #undef HAVE_KERNEL_INFINITE_RECURSION */ + +/* kernel defines intptr_t */ +/* #undef HAVE_KERNEL_INTPTR_T */ + +/* kernel has kernel_neon_* functions */ +/* #undef HAVE_KERNEL_NEON */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* strlcpy() exists */ +/* #undef HAVE_KERNEL_STRLCPY */ + +/* kernel has kmap_local_page */ +/* #undef HAVE_KMAP_LOCAL_PAGE */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [unwind] */ +/* #undef HAVE_LIBUNWIND */ + +/* libunwind has unw_get_elf_filename */ +/* #undef HAVE_LIBUNWIND_ELF */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* building against unsupported kernel version */ +/* #undef HAVE_LINUX_EXPERIMENTAL */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Define to 1 if you have the 'mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* PG_error flag is available */ +/* #undef HAVE_MM_PAGE_FLAG_ERROR */ + +/* page_mapping() is available */ +/* #undef HAVE_MM_PAGE_MAPPING */ + +/* page_size() is available */ +/* #undef HAVE_MM_PAGE_SIZE */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* folio_wait_bit() exists */ +/* #undef HAVE_PAGEMAP_FOLIO_WAIT_BIT */ + +/* part_to_dev() exists */ +/* #undef HAVE_PART_TO_DEV */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* pin_user_pages_unlocked() is available */ +/* #undef HAVE_PIN_USER_PAGES_UNLOCKED */ + +/* proc_handler ctl_table arg is const */ +/* #undef HAVE_PROC_HANDLER_CTL_TABLE_CONST */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* struct reclaim_state has reclaimed */ +/* #undef HAVE_RECLAIM_STATE_RECLAIMED */ + +/* register_shrinker is vararg */ +/* #undef HAVE_REGISTER_SHRINKER_VARARG */ + +/* register_sysctl_sz exists */ +/* #undef HAVE_REGISTER_SYSCTL_SZ */ + +/* register_sysctl_table exists */ +/* #undef HAVE_REGISTER_SYSCTL_TABLE */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() accepts mnt_idmap */ +/* #undef HAVE_SETATTR_PREPARE_IDMAP */ + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() takes 4 args, arg1 is struct mnt_idmap * */ +/* #undef HAVE_SET_ACL_IDMAP_DENTRY */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* iops->set_acl() takes 4 args, arg2 is struct dentry * */ +/* #undef HAVE_SET_ACL_USERNS_DENTRY_ARG2 */ + +/* shrinker_register exists */ +/* #undef HAVE_SHRINKER_REGISTER */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* standalone exists */ +/* #undef HAVE_STANDALONE_LINUX_STDARG */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the 'strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the 'strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* have super_block s_shrink */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK */ + +/* have super_block s_shrink pointer */ +/* #undef HAVE_SUPER_BLOCK_S_SHRINK_PTR */ + +/* sync_blockdev() is declared in include/blkdev.h */ +/* #undef HAVE_SYNC_BLOCKDEV */ + +/* struct kobj_type has default_groups */ +/* #undef HAVE_SYSFS_DEFAULT_GROUPS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() uses old dentry signature */ +/* #undef HAVE_TMPFILE_DENTRY */ + +/* i_op->tmpfile() has mnt_idmap */ +/* #undef HAVE_TMPFILE_IDMAP */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the 'udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->setattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_SETATTR */ + +/* fops->clone_file_range() is available */ +/* #undef HAVE_VFS_CLONE_FILE_RANGE */ + +/* fops->dedupe_file_range() is available */ +/* #undef HAVE_VFS_DEDUPE_FILE_RANGE */ + +/* filemap_dirty_folio exists */ +/* #undef HAVE_VFS_FILEMAP_DIRTY_FOLIO */ + +/* generic_copy_file_range() is available */ +/* #undef HAVE_VFS_GENERIC_COPY_FILE_RANGE */ + +/* migrate_folio exists */ +/* #undef HAVE_VFS_MIGRATE_FOLIO */ + +/* address_space_operations->readpages exists */ +/* #undef HAVE_VFS_READPAGES */ + +/* read_folio exists */ +/* #undef HAVE_VFS_READ_FOLIO */ + +/* fops->remap_file_range() is available */ +/* #undef HAVE_VFS_REMAP_FILE_RANGE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* splice_copy_file_range() is available */ +/* #undef HAVE_VFS_SPLICE_COPY_FILE_RANGE */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* int (*writepage_t)() takes struct folio* */ +/* #undef HAVE_WRITEPAGE_T_FOLIO */ + +/* xattr_handler->get() wants dentry and inode and flags */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE_FLAGS */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() takes mnt_idmap */ +/* #undef HAVE_XATTR_SET_IDMAP */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if host toolchain supports XSAVE */ +#define HAVE_XSAVE 1 + +/* Define if host toolchain supports XSAVEOPT */ +#define HAVE_XSAVEOPT 1 + +/* Define if host toolchain supports XSAVES */ +#define HAVE_XSAVES 1 + +/* ZERO_PAGE() is GPL-only */ +/* #undef HAVE_ZERO_PAGE_GPL_ONLY */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* using complete_and_exit() instead */ +/* #undef SPL_KTHREAD_COMPLETE_AND_EXIT */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* pde_data() is PDE_DATA() */ +/* #undef SPL_PDE_DATA */ + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* Version number of package */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.3.99-170-FreeBSD_g34205715e" ++#define ZFS_META_ALIAS "zfs-2.3.99-189-FreeBSD_g6a2f7b384" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + +/* Define the maximum compatible kernel version. */ +#define ZFS_META_KVER_MAX "6.12" + +/* Define the minimum compatible kernel version. */ +#define ZFS_META_KVER_MIN "4.18" + +/* Define the project license. */ +#define ZFS_META_LICENSE "CDDL" + +/* Define the libtool library 'age' version information. */ +/* #undef ZFS_META_LT_AGE */ + +/* Define the libtool library 'current' version information. */ +/* #undef ZFS_META_LT_CURRENT */ + +/* Define the libtool library 'revision' version information. */ +/* #undef ZFS_META_LT_REVISION */ + +/* Define the project name. */ +#define ZFS_META_NAME "zfs" + +/* Define the project release. */ - #define ZFS_META_RELEASE "170-FreeBSD_g34205715e" ++#define ZFS_META_RELEASE "189-FreeBSD_g6a2f7b384" + +/* Define the project version. */ +#define ZFS_META_VERSION "2.3.99" + +/* count is located in percpu_ref.data */ *** 9 LINES SKIPPED *** From nobody Thu Feb 20 17:15:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzKfL0crmz5p9dn; Thu, 20 Feb 2025 17:15:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzKfL02mRz3lhT; Thu, 20 Feb 2025 17:15:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740071754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QG543cGkZlBtrg0qSDGaxb0hgo+X4ryU+athMZKjcQw=; b=pnjo7AJ8DNcXNpU2oRE6o243zdXHovnypNujzRMSvPXln4x/muLdxcNhvXVEQooKyYQf16 SxSE4RLvI5uqxFogUz5F5f5dfqv+j6/6Q+cQhOWAtJUTFl8n5IVttbZv6Z63hgDTVRVh7M bvrjMnY+Nr/eDATr+hfXorKS0I7PnJ74YnGLikCUpkGHswKnyEyZLiKGYgdssFstEwJSK8 cLBl5M9sg0gzSVF8jo2GgIH4B6EqxK4UNj8H5TKF8VZHorBFMDjrBPZiTOHLn/vDO0Qu82 uCOgIeCaxifSvWkiBHxzA9yhaVZ/6GA84kpzNnzvZFwMgMA5wqGmrZXjm0RPzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740071754; a=rsa-sha256; cv=none; b=oB32mkS1ti7Zs4tLR1hTJw82kD0ZqPrDdsx614m3eAcpw0Hw4gcAM94fUL1Jouf+yNkHK3 EaVjgCYHVL6tMD2BEFeT5WSJtV6Y/DfMVMylkd1FAXhMclp6v7RfOpV75mPGWKzmQUA3+K F/PpfVFUoLsbYHqOo3FRQzk++/LXazXA1ASHPR7V95LOnZ8AakOS5SUxyOYcFUmDY9GEUU 2JMp3O1Mr6g6IlJfTT2ZaPYWe8XsCb3BXgXUWHlS7sfYsRYVqfPXwWI2ms5Rlb3/7QvGOY Ex3rmprk7woVxrUEtnZlvB/mjS0HVVGlCfPeJOxhPVoDikr3JN8uck8477dDbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740071754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QG543cGkZlBtrg0qSDGaxb0hgo+X4ryU+athMZKjcQw=; b=GWUOe4jA93m8g0f7bR9TGkm8Ytt7p4XwghhzKBj788nypcWhR+Atl/EX6TpMwkS30KKYOv XjQ713I3vlBW2oTgxSq6LNS6h7nO6/Oip2ez38HorwOoZ12aCHpY6eYdgeH769e2w5QXC1 ic0ykyOJh6o7nLgjFLA3R6ni/knFsp0my1MmK9w5BMd1tvtk3jMcDu8QGRCXOLqmuMNXo0 ZYRj0+EKcz9KJEUBqfj5aINIFP0nUr+h+7jAJvCZcF7CSpSN5xFYvaDGpaJvZrKjd/oB2p 8ISy7AJoZQILMy5X19z6vkcR+1asV+w08EYoObbJrqo7Zo80jaMtfTT0nzQpUQ== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YzKfK5d5szyh4; Thu, 20 Feb 2025 17:15:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id E8A92A64806; Thu, 20 Feb 2025 17:15:50 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 16DAF2D029E0; Thu, 20 Feb 2025 17:15:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id qg_Y7GQO-JUU; Thu, 20 Feb 2025 17:15:51 +0000 (UTC) Received: from strong-rtwn0.sbone.de (strong-rtwn0.sbone.de [IPv6:fde9:577b:c1a9:4902:da44:89ff:fedd:d5ab]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 647E92D029DF; Thu, 20 Feb 2025 17:15:51 +0000 (UTC) Date: Thu, 20 Feb 2025 17:15:51 +0000 (UTC) From: "Bjoern A. Zeeb" To: Colin Percival cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin In-Reply-To: <0100019521bc3080-e3de9a98-0421-4ce6-8cd4-f28ffd86f7b9-000000@email.amazonses.com> Message-ID: <26533875-n160-op63-qn3o-qpq1o6n55o34@SerrOFQ.bet> References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> <0100019521bc3080-e3de9a98-0421-4ce6-8cd4-f28ffd86f7b9-000000@email.amazonses.com> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Thu, 20 Feb 2025, Colin Percival wrote: > On 2/18/25 18:57, Bjoern A. Zeeb wrote: >> commit 61ce422531805307d413bf04c9ad1aabd7f3a879 >> Author: Bjoern A. Zeeb >> >> wlanstats: move from tools to usr.sbin > > Looks like this resulted in it being compiled with a higher WARNS, which > broke the build on some platforms (so far powerpc and powerpcspe have > failed the weekly snapshots): > >> /usr/src/usr.sbin/wlanstats/wlanstats.c:842:29: error: cast from 'struct >> bsdstat *' to 'struct wlanstatfoo_p *' increases required alignment from 4 >> to 8 [-Werror,-Wcast-align] >> 842 | struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Please fix the build before you MFC. :-) I am on it. I had done a build on amd64, arm64, and i386 and fixed the build breakage from Gleb from Decmeber and the line next to it. Seems CI is down as well. Thanks for letting me now! /bz -- Bjoern A. Zeeb r15:7 From nobody Thu Feb 20 18:05:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzLlX2sN3z5pDtF; Thu, 20 Feb 2025 18:05: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 4YzLlV6byYz3HZK; Thu, 20 Feb 2025 18:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740074727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Br7vSuk943vT7YJsAoJZBYevvrW4JCl3cqULAPeK7H8=; b=DVQh0GNrYXjuDPGM1xLSkQjepSkd7+uxKGZXpFgRb1LHqaT99jYZ6cZJbQ8kzpEAQ0KIg+ Kv2os7ps53C8+ITDFNmaEHBgBukpfbtB8u4SNQHGjX9rPxwyZnNV4F4Qg8XJbEFwfIb/io nPonQJbaZ3x6bGZrU8dLltPuT9dQjKiJLmNCg4pBT27US+czXOBdBSVMMqW1uYewmqysC4 m3DsCfmiy2kD5Vlx4y49k0HlU5uPZ/jK1g3ymapxNlNemOeimhuUR8cHUbr49XOtB0mFlU 4MO3pTy3GlWEQf1aK5BQhycq5uVkmAYRQIK0TKM5UI3KiptXek0fgHBBUfNHmA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740074727; a=rsa-sha256; cv=none; b=Ts30n+3iUswTz53TXh3LXehgJwaLW1Jb1zD1WQM2vPwMSx28lf3eh5LnwShkWIHf2MYWXE u+TDRJyYkqhiC3TwjQTPJao4dD5aaLUOzvfDReSerSPnoWsu2nYNICNtbfElCUgMRCpmNh /ccJvHPkYI2fm8HJxT3zHgQlMVkLG7EZdfagxLNq/n3S18ZW+H6rFlQhpwUYESL5U6xtHQ 2K+TcyDvJ5NA3+KI9DBmwypjQ9zwQH74XIkj7hCEn8VW4qMpkMokwf6rfVOzv7vJd8nSxg ZfY+U+8AUYxxOJ+0B67Phze2hEZRZEmPUwWQHf5MffKyFzPyWXmjphsaoPKGcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740074727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Br7vSuk943vT7YJsAoJZBYevvrW4JCl3cqULAPeK7H8=; b=N5+fsscYxkE9uEDwxBh080AxNeklTty76gaJdNMWX3/yfxJPRh7/CZmnC02Y3/Q2V80waa ySeDYrbOAiLu+vk6ffidw0fwqgu06hXOtaEoAC/V+UsyojXje7KZ/Os8Iwd+3CwblXiRxW C53eNq0aEO0PTgErBsEVQkQR7BdwE0Wy5vUgUXb6Sy7law1AQCuLFlDWYS/JQUwfwPH2cj 3yVYCri/IfbxKoLdy/DmdtJeYoMtB2YRVdW9dmUbrIWdR3m5w5RiW+eTLqtJl+0JmjbQ4a m/EKD3zWuDF7wLSHu+1l4tODZJOgKTMR9wAjMEnxmJ1qzawCwAjX9esDQaLzog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzLlV5FWxz134J; Thu, 20 Feb 2025 18:05: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 51KI5QNq088068; Thu, 20 Feb 2025 18:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KI5Q5j088065; Thu, 20 Feb 2025 18:05:26 GMT (envelope-from git) Date: Thu, 20 Feb 2025 18:05:26 GMT Message-Id: <202502201805.51KI5Q5j088065@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 8dcdffdb0861 - main - net80211: crypto: ccmp: simplify and style(9) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=8dcdffdb086103e9ce36bfa82fc1179c88ebc31b commit 8dcdffdb086103e9ce36bfa82fc1179c88ebc31b Author: Bjoern A. Zeeb AuthorDate: 2025-01-27 13:54:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-20 18:05:00 +0000 net80211: crypto: ccmp: simplify and style(9) Comply with style(9) and andd checks for booleaness when doing bit tests. If there is no need for double negated checks simplify them. This all makes the conditions a lot easier to read. Slip in a comment about MIC vs. MMIC. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D49055 --- sys/net80211/ieee80211_crypto_ccmp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index 06028cf2a37c..404996b1cbca 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -242,7 +242,7 @@ ccmp_decap(struct ieee80211_key *k, struct mbuf *m, int hdrlen) rxs = ieee80211_get_rx_params_ptr(m); - if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP)) + if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) != 0) goto finish; /* @@ -297,14 +297,15 @@ finish: /* * XXX TODO: see if MMIC_STRIP also covers CCMP MIC trailer. + * Well no as it's a MIC not MMIC but we re-use the same flag for now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP))) + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_MMIC_STRIP) == 0) m_adj(m, -ccmp.ic_trailer); /* * Ok to update rsc now. */ - if (! ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP))) { + if ((rxs == NULL) || (rxs->c_pktflags & IEEE80211_RX_F_IV_STRIP) == 0) { /* * Do not go backwards in the IEEE80211_KEY_NOREPLAY cases * or in case hardware has checked but frames are arriving From nobody Thu Feb 20 18:14:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzLy76LG6z5pF28 for ; Thu, 20 Feb 2025 18:14:39 +0000 (UTC) (envelope-from 010001952491a2d8-75405478-d189-46d2-8468-fa753eb3c0af-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzLy74g3Xz3Mwy for ; Thu, 20 Feb 2025 18:14:39 +0000 (UTC) (envelope-from 010001952491a2d8-75405478-d189-46d2-8468-fa753eb3c0af-000000@amazonses.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=vnqrkfnvu6csdl6mwgk5t6ix3nnepx57; d=tarsnap.com; t=1740075279; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=46JebtIT31YcF7zGn6sT4HTSEg3PrK8gLEw/7CNcu7Q=; b=m8rzjBPAYvQQGtxgiXajpVWhjnjwFWsny6WvcvxlzvapIT0UiBNb2nu5xR6zCaJk MAYb5HvIuzJKwkORR+a4Nm9Ig0Y8jVJlE72/80jQQZAE/YKTmxdtn6FWI247xqqujn9 seVqVia3tFugbpXNrvUb0PsDbndaEEUHIenamVC8= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1740075279; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=46JebtIT31YcF7zGn6sT4HTSEg3PrK8gLEw/7CNcu7Q=; b=pmqnAF42jr3KY+rQyJoe65SLOO+dZRauu1CuBJ+J4zqCFIvSC6uaobd1H/mxlqtl jWfCwJ4u8+zAuBztz9WYStPk6vz9jGgowQsM0t/nDfpnb2IeyfvkZaECtVbW6tOWPnz R9Zz0ZVoKf0AdunKJ/a00P7zEHDOxYEPhCrl/YhA= Message-ID: <010001952491a2d8-75405478-d189-46d2-8468-fa753eb3c0af-000000@email.amazonses.com> Date: Thu, 20 Feb 2025 18:14:39 +0000 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 61ce42253180 - main - wlanstats: move from tools to usr.sbin To: "Bjoern A. Zeeb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202502190257.51J2vRTI049767@gitrepo.freebsd.org> <0100019521bc3080-e3de9a98-0421-4ce6-8cd4-f28ffd86f7b9-000000@email.amazonses.com> <26533875-n160-op63-qn3o-qpq1o6n55o34@SerrOFQ.bet> Content-Language: en-US From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; keydata= xsFNBGWMSrYBEACdWRqDn3B3SKO7IG0/fGHYtfs26f3Q5QeAcasy1fQLniwGQWn5rlILhbCD K/jdNoDm5Zxq20eqyffoDNObCjnHgg4tGANdi+RmDy+7CDpE789H8dss9y7Pt5DlGGAXQQnt hxush3EYS/Ctprd9UUL/lzOOLOU1aNtzB84tNrJBtcJmL7OYHfyTSNFxvedqJrrasejIQOLI t/DQ89BPzz+vsKHz7FJPXh3fsVkzLA00DJYcfkgxyABfJNA7U6yMwd4DVSdx/SsvfIDMVXnu UXCXswo106WPZbYGlZPpq0wW6iibtTerJix+8AeuwXvl9O1p8yESK4ErkIxCnmghTSz+pdzj z/6xBRkdDM9VdZ0r+CzsaNXMpDOzFuKyjaiYBdgCLljbDnXIHFcqXenrZ7Xwkm09g/M4uVSh pIUG2RYa6tsHSQoGCp3f2RZv1znfViKQFbbL83QjtPA20AhseZSYbHp1FPhXyy9J0wkGL16L e99g6gdGeIRE82BZjBjKGDkoyDPq+oDRSFl8NtzmIKy+cfz00nViqcTF4bREXEawFGhlpO0X O9q8mijI9iFB6zaPBiSdJGBL5ML5qLTNCl8Zlf4m1TBvmRTqF/lzMHVXHidDoUhpSh/y3AFZ 1KrYc27ztJQywDJPJPWPbtY8YhFLFs377gfP8WldsZjzp8nvoQARAQABzSVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+wsGRBBMBCAA7FiEEglY7hNBiDtwN+4ZBOJfy 4i5lrT8FAmWMSyYCGwMICwkNCAwHCwMFFQoJCAsFFgMCAQACHgUCF4AACgkQOJfy4i5lrT+i Yg/+PYyJNoFuygtV5t/skcjYmvEC93mnazEvh+x99vGYZnGKeJ8NDOF4QCUzeHquOWxDi8Zl reXyswKcrIquPxxX6+YyGe97VbvLnez3ksfzOYRj1F4qV0Rq8ZNK51+bvIrbcS3SfDaRioAk D7WWwFor8y/hSwxYkfsKbtP5PRcem20JUxuC085zqWLaKv5t5n2CBzAGMjwJaQ3tM3AXVwWJ uJaHA6ot/6fntJlmkfcyCYyyr0D6b0guRj3STbZ2hNn5o2AI+f6LJJ31s2sPFjl6rs7fORf3 hFSNOHDd2HxfVBXFdQy24ROkC4orBBz2xh9GScjxxT/hbXkfufkubFubw7n0HkvHzA3UF+Qq A8JiI3n+d7ocsP0/5BQ2sZdeqPGJgHx6RkAMuW1tJ29wSvCN1qMgFwhYkpQdfvHlociQrimU fvlRfSrBEe8o7tvIuEdpvwvCZSTJqQbVoMw8UHFE7nzyCXUSab5h6PbjakCqim13ekVO2KFF TTPcz5o5jEeUY75tzbIwcDfFbT5KqNjWy06TVdM9VEJDHSfOfxHR3kSEwZ+tT2aTvL3grsUn gFwSNcj4Cl4CRFfUw8zVZY+7O7RiMlhBqykikvUurrdGKc1Scwa0yuppdA6eVvylyTWSQGrQ +uLWtV1LUKN7ZqKJWBkLPt9nS4XZWGyBvxOHYqjOwU0EZYxKtgEQANYfgbtUMVnhjxDHhWLp g5kLHK3YW0TfJKzpXqDB7NiqxHofn4OcbZnVC3MKggcbs9o1/UtsjnlsG8550PfiYkDXvPiO RJwgbGs6MGIDK797C6cnBLQ8xwBa9SL4cl5iQFnhWmt6vwnJ+an/cm5JpYves3wL7jV09qU9 57hkHXEUcl38r4FssZzVcLKPUVTa3Un+QGRTGDGe/f4ctjMaqv0ZCM+l2ixPhf/vqESrfSLv V/+T3dmtUfXjazO3SABvsHwxgGuTTYOlKoPCaebr+BRdqm0xeIShoIlhvTI8y4clchqx/Uxg UG5X2kvU13k3DS3Q8uLE4Et9x1CcZT6WGgBZSR6R0WfD0SDnzufNnRWJ0dEPA2MtJHE7+85R Vi9j/IgZV+y5Ur+bnPkjDG1s2SVciX5v9HQ0oilcBhvx0j5lGE9hhurD9F+fCvkr4KdbCknE 6Y8ce8pCNBUoB/DqibJivOzTk9K9MGB5x0De5TerIrFiaw3/mQC9nGeO9dtE7wvDJetWeoTq 4BEaCzpufNqbkpOaTQILr4V6Gp7M6v97g83TVAwZntz/q8ptwuKQPZ2JaSFLZn7oWUpYXA5s +SIODFHLn6iMoYpBQskHQjnj4lEPJadl4qj+ZKA89iDAKsniyoFXsbJe2CPbMS1yzBxKZq6K D/jpt7BOnuHr/JrXABEBAAHCwXYEGAEIACAWIQSCVjuE0GIO3A37hkE4l/LiLmWtPwUCZYxK tgIbDAAKCRA4l/LiLmWtP3jmEACQrh9gWe8F1Tkw3m6VoHKwLc5he4tX3WpQa//soPO6iGG3 S3WPruQ46NrAaAojoOcKI9UONDO5rxG0ZTX53S+lu2EO47jbcLwOCjaEpjKpDRt9ZXBQE8Xl mtBE9Bp3W9gpjB1nE3KNM1mJYgsK0QdRpwwfh4pVgGpOj8j23I6MCK+v99zEBnpgCn2GX8W/ kctRXHqWwndHysOJtRP/zrl7dDaABF1f9efUl0LL3TD3GJ9VDz+DNOin/uK2a1hiJo8QzTRk PpfUQ2ebzDsrd1i/pOWkMSkdH+rEu4AGrXWtaBwrMyrGkL6Icb6yO+P9/z0W2wlgBf3P1YRt JPgQt/Dj3yvA/UnaV/QmuVQPjl13o24UnJGsZM8XGnNdfWBKkC1Q6VXC4QT+dyBHYH9MuE9d 6oGl8pFM1+cTfEfbM62/rRoPkF1yHMsI/903VxEvuUIKfhEZAVLFyHldooNxuchntHQP9y8J 8Ou9bWYQP7MnEn+kwSwrZkjurfPkan+xQvp6dDYnj3V0GwA5pprBMaB928VIDVOv+1PNQI3t Cvk5VPv/skq+TJRMHW7bFSt8PRa91cUf1FOLIz9APDiJOzXkwxUEHGV3zPSaUhs1JYjyBeGT wDAvtLUdjOnRhEUOwlnIrztmvyciutjJoVzKEEjj5WXnHk9L9kQ1bpAjkjTONw== In-Reply-To: <26533875-n160-op63-qn3o-qpq1o6n55o34@SerrOFQ.bet> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Feedback-ID: ::1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-SES-Outgoing: 2025.02.20-54.240.8.176 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:14618, ipnet:54.240.8.0/21, country:US] X-Rspamd-Queue-Id: 4YzLy74g3Xz3Mwy X-Spamd-Bar: ---- On 2/20/25 09:15, Bjoern A. Zeeb wrote: > On Thu, 20 Feb 2025, Colin Percival wrote: >> On 2/18/25 18:57, Bjoern A. Zeeb wrote: >>> commit 61ce422531805307d413bf04c9ad1aabd7f3a879 >>> Author:     Bjoern A. Zeeb >>> >>>      wlanstats: move from tools to usr.sbin >> >> Looks like this resulted in it being compiled with a higher WARNS, which >> broke the build on some platforms (so far powerpc and powerpcspe have >> failed the weekly snapshots): >> >>> /usr/src/usr.sbin/wlanstats/wlanstats.c:842:29: error: cast from 'struct >>> bsdstat *' to 'struct wlanstatfoo_p *' increases required alignment from 4 >>> to 8 [-Werror,-Wcast-align] >>>   842 |         struct wlanstatfoo_p *wf = (struct wlanstatfoo_p *) sf; >>>       |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~ >> >> Please fix the build before you MFC. :-) > > I am on it.  I had done a build on amd64, arm64, and i386 and fixed the > build breakage from Gleb from Decmeber and the line next to it. Thanks! Please send me an email once this is committed (I might not notice the commit go into the tree) so I can restart the weekly snapshots -- enough of the builds failed that it's worth re-running them once the tree is fixed. -- Colin Percival FreeBSD Release Engineering Lead & EC2 platform maintainer Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From nobody Thu Feb 20 19:51:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzP6G16Bsz5pLTS; Thu, 20 Feb 2025 19:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzP6G0V6mz3LyT; Thu, 20 Feb 2025 19:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740081110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j0BREnkEHh8W7jnAxpwjnUwpMn3oOhVLTS2t3A6OQ3E=; b=b7pCJtj+QRoIii/qo8SX5M72YK4r2y6ptMkEw90jNslKRGanMyzAkr8t3+qoj7r8wabBC5 L1gi2kMkSlbCuHDD2sAjVwAIjd76P78/xyL8ZdCFPovcC2HzXiqw78YFUEKpdSm5Vx3771 Fe6j6AYFMUoILm/1ZrC9OYSrUcUA4ihYDvU9WNc6mmqoQDPxkcvpZMrDM7FwFfCLlaJaCH xnvYgFNQ8pXasNs5fL3E9GSMDamc3kZYqk4Csacw2oDn7gjiDRxXBsG5HxmoWeSUxq9klK bSze0HD0EZJrXRmCVIiBvjv3KJKB/wanmp/yd1lMfQyV8yEji7fpDNKu83Pc1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740081110; a=rsa-sha256; cv=none; b=HzQesMeTU70L71paWxYFh29wsEpRV5qN1IyBRbOU9MTNXmX1l260gp5dwhis6KyiL7eIdg xgOX6N9EqpMjFjDJR2J9HMgy+3CLZb2vV9QvrpHAX6UTPwj2ouSWpp4/6h0DJKLS7lWmf8 973vZnRyBfxN4OlIlSpo9u86iv4aywQOJZZFoQ4TW9Ef7/1y2wTJMx4dlFuIXqnKV9wlQ3 6/SqqE+V46qHvm3hKakP3FQATTnRw/2TJoltMzkNVuEo0WBmeT1qLRIqfXpD7PDGgSTTm0 zZJcCyZfXtw23m4FM3N7L+XgI2pwkDGr+z5fCZI+JM9MNgIr02ZOu4YnkaPScw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740081110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j0BREnkEHh8W7jnAxpwjnUwpMn3oOhVLTS2t3A6OQ3E=; b=pIJNLWFhvEQHu6pjokxdN29Y1fdQk8hSm6kECGs2XUfXGosu7ykYe7uRGWTnfGYdgZ1INL v9cNaHoq+Tk+50dyuyHRzgY4DOZR2aR8yVs6nFFPeGN8WyjcwHh3mtNd3Ittv0i8uQjJXa rfZf+YDZN7BW1nD9Bo/mBySLKLM78LRNk5NTajuELJK4HApSlmdiCx9UMhEFhSbSyLXZIF KZwdthlur/I4NaNiaNhT7KC16FSN+ifjAfLnFS7MWbWc8lSMwpRQf96IWqzdDftpUhRPgL QT+YTGsWG9zA+4/domH9OOWmGP2KxGejRBnYm03NH8UZXc+Ga+faheCB7KCWyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzP6G047Rz15nG; Thu, 20 Feb 2025 19:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51KJpnLG089685; Thu, 20 Feb 2025 19:51:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KJpn85089682; Thu, 20 Feb 2025 19:51:49 GMT (envelope-from git) Date: Thu, 20 Feb 2025 19:51:49 GMT Message-Id: <202502201951.51KJpn85089682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 21b5b8b38b1c - main - loader.efi: add "gop blt " command List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21b5b8b38b1c606fb8f6b1b0e3549072b3c1d44d Auto-Submitted: auto-generated The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=21b5b8b38b1c606fb8f6b1b0e3549072b3c1d44d commit 21b5b8b38b1c606fb8f6b1b0e3549072b3c1d44d Author: Toomas Soome AuthorDate: 2025-02-20 19:50:20 +0000 Commit: Toomas Soome CommitDate: 2025-02-20 19:50:20 +0000 loader.efi: add "gop blt " command Some systems have very slow console output and it may be about either wrong memory attributes are set or gop->Blt() implementation is bad. We do not have good way to set memory attributes, but we can choose which Blt() to use (or we can set "gop off" to fall back on use of SimpleTextOutput protocol). This update adds argument for "gop" command to switch gop->Blt() use. Note, this update does not fix the problem, but allows us to try to understand the possible cause. PR: 254381 Reported by: Michael Galassi Reviewed by: manu, imp Differential Revision: https://reviews.freebsd.org/D49073 --- stand/common/gfx_fb.c | 10 +++++++++- stand/efi/loader/framebuffer.c | 26 +++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 63036f3c07f6..395332af9990 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -161,6 +161,14 @@ static const int vga_to_cons_colors[NCOLORS] = { 8, 9, 10, 11, 12, 13, 14, 15 }; +/* + * It is reported very slow console draw in some systems. + * in order to exclude buggy gop->Blt(), we want option + * to use direct draw to framebuffer and avoid gop->Blt. + * Can be toggled with "gop" command. + */ +bool ignore_gop_blt = false; + struct text_pixel *screen_buffer; #if defined(EFI) static EFI_GRAPHICS_OUTPUT_BLT_PIXEL *GlyphBuffer; @@ -795,7 +803,7 @@ gfxfb_blt(void *BltBuffer, GFXFB_BLT_OPERATION BltOperation, * done as they are provided by protocols that disappear when exit * boot services. */ - if (gop != NULL && boot_services_active) { + if (!ignore_gop_blt && gop != NULL && boot_services_active) { tpl = BS->RaiseTPL(TPL_NOTIFY); switch (BltOperation) { case GfxFbBltVideoFill: diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c index ea4131b751c8..141a29305f7c 100644 --- a/stand/efi/loader/framebuffer.c +++ b/stand/efi/loader/framebuffer.c @@ -856,6 +856,7 @@ command_gop(int argc, char *argv[]) struct efi_fb efifb; EFI_STATUS status; u_int mode; + extern bool ignore_gop_blt; if (gop == NULL) { snprintf(command_errbuf, sizeof(command_errbuf), @@ -866,7 +867,7 @@ command_gop(int argc, char *argv[]) if (argc < 2) goto usage; - if (!strcmp(argv[1], "set")) { + if (strcmp(argv[1], "set") == 0) { char *cp; if (argc != 3) @@ -884,7 +885,26 @@ command_gop(int argc, char *argv[]) return (CMD_ERROR); } (void) cons_update_mode(true); + } else if (strcmp(argv[1], "blt") == 0) { + /* + * "blt on" does allow gop->Blt() to be used (default). + * "blt off" does block gop->Blt() to be used and use + * software rendering instead. + */ + if (argc != 3) + goto usage; + if (strcmp(argv[2], "on") == 0) + ignore_gop_blt = false; + else if (strcmp(argv[2], "off") == 0) + ignore_gop_blt = true; + else + goto usage; } else if (strcmp(argv[1], "off") == 0) { + /* + * Tell console to use SimpleTextOutput protocol. + * This means that we do not render the glyphs, but rely on + * UEFI firmware to draw on ConsOut device(s). + */ (void) cons_update_mode(false); } else if (strcmp(argv[1], "get") == 0) { edid_res_list_t res; @@ -908,7 +928,7 @@ command_gop(int argc, char *argv[]) } print_efifb(gop->Mode->Mode, &efifb, 1); printf("\n"); - } else if (!strcmp(argv[1], "list")) { + } else if (strcmp(argv[1], "list") == 0) { EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; UINTN infosz; @@ -931,7 +951,7 @@ command_gop(int argc, char *argv[]) usage: snprintf(command_errbuf, sizeof(command_errbuf), - "usage: %s [list | get | set | off]", argv[0]); + "usage: %s [list | get | set | off | blt ]", argv[0]); return (CMD_ERROR); } From nobody Thu Feb 20 20:16:10 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzPfM152Dz5pN5G; Thu, 20 Feb 2025 20:16: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 4YzPfM0Nldz3c2c; Thu, 20 Feb 2025 20:16:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FAehOGxxxuXIUexjE/Xc4HPXZdcUZk638OsGm6rNK2I=; b=Q4Zb8vPFICIFbxItfiOpVQWLmgn9uFGS6f2fa/mCHtCJEjNdT0ollTgrR36P7OuYDgXEmi nD/+kyU7iqjJEhNyiiosHWKac8V/dPHrc9mjzZPWcPYVqMF24lsq6g4iO/0b6v0/qgEn+G aTYaWPqC8aoAMNF21P20coELl95SCyCRoCkNcqdUIqHkqjiLjVJeS+P1pVPJgiaF5gu1fm 4Pby14CK8geUyMENdmpqMmiELXFPuUL3GWRA0gSXPkcXF2RuYGltarxKj53+1/JAuXAcat JxIPVrTU/kYhuZ/6vBJB3QoCQaeAcN4eA0uax3DQxRm3H00+fQ8sZRLlCkIueA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740082571; a=rsa-sha256; cv=none; b=VE6VVJenbvxmjxHWc+B3Q7dcdRHICUpp8tnD4HNhU4YQJtvOHY0zPbFEAuiXXVbxTYBjIf i7hE5cyvpVoJKQ65ytgOWKs8Pimk3X31RNbAyf2KFbdzFH8D0KzlUoih9OXfabMecBX4fL feZz+dG7yB099yqzdd4nlYdtwD0TypEL2qvdtnAa5CxBSMbbj4aOTNc5iyOqIMMRg1YMbo RyuIWQ3z9baVzXvrv2ZwoCleFOaNtPV6gz/1NPl1+EyYtctr2uC1jkUmTSV9rhULHUM/Zx gsUpumHKDurUhUr5FhXNuiCqUXhh7+yrF+1R1kV0Dny4RXypbA51nfhQQfEAUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FAehOGxxxuXIUexjE/Xc4HPXZdcUZk638OsGm6rNK2I=; b=kpa55B6g8RQ31AKz1lQe8c/0ZGIMoYgA/IGPPtN9LDw2+JwNbvg81sPoWLtJ8sVuLo26P0 TPXYmrPFx/jm2m1ZXvRAbTIBPwClV4H2lGfIbpDI3+QNMTOUJY9gcX5X5lT2mDI+HeRITU a5p2hevnuMZV1bvnSoPOEp4+NJGQBzT2+J86k+FP+/X2YHzvMcqa6HOU43zVxXwrH5xER2 82e54IoaimBlk8U+//Fp0DyzByEhs8y1vCOnNu70ZefipGtHKlS3Ni+T9O28iHCTjg7Kgu hDGi8l3W2PbnsDHciJYJ7KuUUnhzkVXRVgCXds2srpx6oUoHOq0qhquKkAbqeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzPfL6lnBz15W5; Thu, 20 Feb 2025 20:16: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 51KKGA7m031037; Thu, 20 Feb 2025 20:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KKGAKe031034; Thu, 20 Feb 2025 20:16:10 GMT (envelope-from git) Date: Thu, 20 Feb 2025 20:16:10 GMT Message-Id: <202502202016.51KKGAKe031034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: b5f60442a03e - main - libefivar: Fix sed pattern List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5f60442a03ed53bfc5e16ed445490d1b5f14638 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=b5f60442a03ed53bfc5e16ed445490d1b5f14638 commit b5f60442a03ed53bfc5e16ed445490d1b5f14638 Author: Jose Luis Duran AuthorDate: 2025-02-20 20:10:06 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-20 20:10:06 +0000 libefivar: Fix sed pattern Add a 'g' flag to allow the replacement to occur more than once on the same line. Reviewed by: imp, emaste Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D49058 --- lib/libefivar/FreeBSD-update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libefivar/FreeBSD-update b/lib/libefivar/FreeBSD-update index 375f9ceb9536..52d0db4021ef 100644 --- a/lib/libefivar/FreeBSD-update +++ b/lib/libefivar/FreeBSD-update @@ -6,7 +6,7 @@ efivar-dp-parse.c is a copy of MdePkg/Library/UefiDevicePathLib/DevicePathFromTe These files are first mechnaically processed with -sed -e "s/L'/'/;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ *$//g' +sed -e "s/L'/'/g;"'s/L"/"/g;s/%g/%36s/g;s/%a/%s/g;s/^VOID/static VOID/g;s/ *$//g' for several reasons. We're moving from wide rotuines to narrow routines. The UTC-2 this code is written for is a bad match for wchar_t which is an int. It's From nobody Thu Feb 20 20:16:11 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzPfN2Fjkz5pN5K; Thu, 20 Feb 2025 20:16: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 4YzPfN0Rybz3bpK; Thu, 20 Feb 2025 20:16:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYLNQErvWi/Kp0aPZxJ1JtWxd8rWl1fFT7+BA/e/PTw=; b=wS9gYszjx2bkLGnI3nc8hrKvEggzdGAwWBR/+Ql4Iwz1qduUJ4qha8eyXZlXh7SUckw/Qr hcgS7/xblcgDnRuEZGXobJqPGDLmaXrC34PcQ2qXUiLNJt7l91yglRY4ZqzMf3KLf3CorY 0L9Tr75LrjiJ3VxLH3vVZjOoMwNFShPW3MsaUsu1XNXygnNfzN/uvtIgTS9iB4E0EKqiX7 v1xGOwvfli2qHApuQ9owaxD79KrAaDfAZvCs3g5Vvfy9qBY0h9vbYlwx8EGrlGC+yPkALe u69RQqbBCQUioRHvZreootX7GyTgyr92sK0sWSEhNq2mXry2l86eksqkfLGRpQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740082572; a=rsa-sha256; cv=none; b=NxHPSuvqZ+5rp/GHstMi8zGLJjYFFsDYWZ/sjGNTlo1G0rWjZVyEPBwFszZyO2dC77jzPW UkWriTTs5Q2b7SoS85AzOkUQc7iE3ROPSwbT+ClnYk1VmHPQYvlin1TeCRXdberrc0Eoxl nb9J2B+8VY38GoTodysaFI68Uoy5RrB9SQmMUONIBJ6fGKaUmHJKCBWlNp9aS+IDhzUJJW C+FGe6Z2RddojRrNOHuuTNViG/XFzqBh44dvq1KYIOkUgpi3841asVTIe2UawfDHpS6ufM BIR1KGJfO8AcZ0xPo9sE8X/AHxsn21LIwh83zbOmHhksm2EfyLoSgFZnIA8Nzw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uYLNQErvWi/Kp0aPZxJ1JtWxd8rWl1fFT7+BA/e/PTw=; b=T9dPYoFipczxN8y/kP7XyMGs6eN80RzSyabQhlZh15KpWEkXv2hlp2yFiaAmjJ10lbAcrl HipEyqB2HVMs+2D5rdFPRQDMhMd2s2Dd3msqTQ9IOzWOtvCJ3gRgY/dCpIIHH6ZFF98tW8 2B/uiA40LMlg5TxxqPC6pUAWzKrvFr+aqZZtmy4oj9dZMdxZc1hUB5V7g9kcXKQphE2dv4 fbQlkqYs5HJoqG54Dj1vSbBxg/VhE5ode1iUrzEuSf5ermWBN9PUjAqNtwUcr7iD4mR+sE b5t77bCgzptDS9NSCTl7uLyDW6rwR4YXkW6qRDASClmdxpYNeg4pIJFbIXs2jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzPfM6wD4z16GY; Thu, 20 Feb 2025 20:16: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 51KKGBYF031072; Thu, 20 Feb 2025 20:16:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KKGBcq031069; Thu, 20 Feb 2025 20:16:11 GMT (envelope-from git) Date: Thu, 20 Feb 2025 20:16:11 GMT Message-Id: <202502202016.51KKGBcq031069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 05653fc774ff - main - libefivar: CodeQL Fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05653fc774ffc97856507b871d05d7a232e899a5 Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=05653fc774ffc97856507b871d05d7a232e899a5 commit 05653fc774ffc97856507b871d05d7a232e899a5 Author: Jose Luis Duran AuthorDate: 2025-02-20 20:10:20 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-20 20:11:52 +0000 libefivar: CodeQL Fixes These libefivar files correspond to the following EDK2 Tianocore routines: efivar-dp-format.c -> MdePkg/Library/UefiDevicePathLib/DevicePathToText.c efivar-dp-parse.c -> MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c The following changes were apparently applied upstream to appease their CodeQL workflows on GitHub. Note that some of these changes are logically contradictory, however avoiding differences between the two code bases is a priority, as noted in the review. Commit message from upstream: Includes changes across the repo for the following CodeQL rules: - cpp/comparison-with-wider-type - cpp/overflow-buffer - cpp/redundant-null-check-param - cpp/uselesstest Reviewed by: imp Approved by: emaste (mentor) Obtained from: https://github.com/tianocore/edk2/commit/b7735a087afce6a5157b61e5450b6848ed535a14 Differential Revision: https://reviews.freebsd.org/D49059 --- lib/libefivar/efivar-dp-format.c | 6 +- lib/libefivar/efivar-dp-parse.c | 488 +++++++++++++++++++++++++++------------ 2 files changed, 340 insertions(+), 154 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 72e024470a11..b4300573e41c 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -1904,7 +1904,11 @@ DevPathToTextUri ( Uri = DevPath; UriLength = DevicePathNodeLength (Uri) - sizeof (URI_DEVICE_PATH); UriStr = AllocatePool (UriLength + 1); - ASSERT (UriStr != NULL); + + if (UriStr == NULL) { + ASSERT (UriStr != NULL); + return; + } CopyMem (UriStr, Uri->Uri, UriLength); UriStr[UriLength] = '\0'; diff --git a/lib/libefivar/efivar-dp-parse.c b/lib/libefivar/efivar-dp-parse.c index f68c9798fb2e..3382666730c4 100644 --- a/lib/libefivar/efivar-dp-parse.c +++ b/lib/libefivar/efivar-dp-parse.c @@ -337,14 +337,14 @@ IsHexStr ( // // skip preceeding white space // - while ((*Str != 0) && *Str == ' ') { + while (*Str == ' ') { Str++; } // // skip preceeding zeros // - while ((*Str != 0) && *Str == '0') { + while (*Str == '0') { Str++; } @@ -461,7 +461,10 @@ DevPathFromTextGenericPath ( (UINT16)(sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength) ); - StrHexToBytes (DataStr, DataLength * 2, (UINT8 *)(Node + 1), DataLength); + if (Node != NULL) { + StrHexToBytes (DataStr, DataLength * 2, (UINT8 *)(Node + 1), DataLength); + } + return Node; } @@ -529,8 +532,10 @@ DevPathFromTextPci ( (UINT16)sizeof (PCI_DEVICE_PATH) ); - Pci->Function = (UINT8)Strtoi (FunctionStr); - Pci->Device = (UINT8)Strtoi (DeviceStr); + if (Pci != NULL) { + Pci->Function = (UINT8)Strtoi (FunctionStr); + Pci->Device = (UINT8)Strtoi (DeviceStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Pci; } @@ -559,7 +564,9 @@ DevPathFromTextPcCard ( (UINT16)sizeof (PCCARD_DEVICE_PATH) ); - Pccard->FunctionNumber = (UINT8)Strtoi (FunctionNumberStr); + if (Pccard != NULL) { + Pccard->FunctionNumber = (UINT8)Strtoi (FunctionNumberStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Pccard; } @@ -592,9 +599,11 @@ DevPathFromTextMemoryMapped ( (UINT16)sizeof (MEMMAP_DEVICE_PATH) ); - MemMap->MemoryType = (UINT32)Strtoi (MemoryTypeStr); - Strtoi64 (StartingAddressStr, &MemMap->StartingAddress); - Strtoi64 (EndingAddressStr, &MemMap->EndingAddress); + if (MemMap != NULL) { + MemMap->MemoryType = (UINT32)Strtoi (MemoryTypeStr); + Strtoi64 (StartingAddressStr, &MemMap->StartingAddress); + Strtoi64 (EndingAddressStr, &MemMap->EndingAddress); + } return (EFI_DEVICE_PATH_PROTOCOL *)MemMap; } @@ -638,8 +647,10 @@ ConvertFromTextVendor ( (UINT16)(sizeof (VENDOR_DEVICE_PATH) + Length) ); - StrToGuid (GuidStr, &Vendor->Guid); - StrHexToBytes (DataStr, Length * 2, (UINT8 *)(Vendor + 1), Length); + if (Vendor != NULL) { + StrToGuid (GuidStr, &Vendor->Guid); + StrHexToBytes (DataStr, Length * 2, (UINT8 *)(Vendor + 1), Length); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vendor; } @@ -688,7 +699,10 @@ DevPathFromTextCtrl ( HW_CONTROLLER_DP, (UINT16)sizeof (CONTROLLER_DEVICE_PATH) ); - Controller->ControllerNumber = (UINT32)Strtoi (ControllerStr); + + if (Controller != NULL) { + Controller->ControllerNumber = (UINT32)Strtoi (ControllerStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Controller; } @@ -719,11 +733,13 @@ DevPathFromTextBmc ( (UINT16)sizeof (BMC_DEVICE_PATH) ); - BmcDp->InterfaceType = (UINT8)Strtoi (InterfaceTypeStr); - WriteUnaligned64 ( - (UINT64 *)(&BmcDp->BaseAddress), - StrHexToUint64 (BaseAddressStr) - ); + if (BmcDp != NULL) { + BmcDp->InterfaceType = (UINT8)Strtoi (InterfaceTypeStr); + WriteUnaligned64 ( + (UINT64 *)(&BmcDp->BaseAddress), + StrHexToUint64 (BaseAddressStr) + ); + } return (EFI_DEVICE_PATH_PROTOCOL *)BmcDp; } @@ -791,8 +807,10 @@ DevPathFromTextAcpi ( (UINT16)sizeof (ACPI_HID_DEVICE_PATH) ); - Acpi->HID = EisaIdFromText (HIDStr); - Acpi->UID = (UINT32)Strtoi (UIDStr); + if (Acpi != NULL) { + Acpi->HID = EisaIdFromText (HIDStr); + Acpi->UID = (UINT32)Strtoi (UIDStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Acpi; } @@ -823,8 +841,10 @@ ConvertFromTextAcpi ( (UINT16)sizeof (ACPI_HID_DEVICE_PATH) ); - Acpi->HID = EFI_PNP_ID (PnPId); - Acpi->UID = (UINT32)Strtoi (UIDStr); + if (Acpi != NULL) { + Acpi->HID = EFI_PNP_ID (PnPId); + Acpi->UID = (UINT32)Strtoi (UIDStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Acpi; } @@ -971,14 +991,16 @@ DevPathFromTextAcpiEx ( Length ); - AcpiEx->HID = EisaIdFromText (HIDStr); - AcpiEx->CID = EisaIdFromText (CIDStr); - AcpiEx->UID = (UINT32)Strtoi (UIDStr); + if (AcpiEx != NULL) { + AcpiEx->HID = EisaIdFromText (HIDStr); + AcpiEx->CID = EisaIdFromText (CIDStr); + AcpiEx->UID = (UINT32)Strtoi (UIDStr); - AsciiStr = (CHAR8 *)((UINT8 *)AcpiEx + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); - StrToAscii (HIDSTRStr, &AsciiStr); - StrToAscii (UIDSTRStr, &AsciiStr); - StrToAscii (CIDSTRStr, &AsciiStr); + AsciiStr = (CHAR8 *)((UINT8 *)AcpiEx + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); + StrToAscii (HIDSTRStr, &AsciiStr); + StrToAscii (UIDSTRStr, &AsciiStr); + StrToAscii (CIDSTRStr, &AsciiStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)AcpiEx; } @@ -1014,6 +1036,10 @@ DevPathFromTextAcpiExp ( Length ); + if (AcpiEx == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)AcpiEx; + } + AcpiEx->HID = EisaIdFromText (HIDStr); // // According to UEFI spec, the CID parameter is optional and has a default value of 0. @@ -1070,7 +1096,10 @@ DevPathFromTextAcpiAdr ( ACPI_ADR_DP, (UINT16)sizeof (ACPI_ADR_DEVICE_PATH) ); - ASSERT (AcpiAdr != NULL); + if (AcpiAdr == NULL) { + ASSERT (AcpiAdr != NULL); + return (EFI_DEVICE_PATH_PROTOCOL *)AcpiAdr; + } for (Index = 0; ; Index++) { DisplayDeviceStr = GetNextParamStr (&TextDeviceNode); @@ -1085,7 +1114,12 @@ DevPathFromTextAcpiAdr ( Length + sizeof (UINT32), AcpiAdr ); - ASSERT (AcpiAdr != NULL); + + if (AcpiAdr == NULL) { + ASSERT (AcpiAdr != NULL); + return (EFI_DEVICE_PATH_PROTOCOL *)AcpiAdr; + } + SetDevicePathNodeLength (AcpiAdr, Length + sizeof (UINT32)); } @@ -1137,6 +1171,10 @@ DevPathFromTextAta ( (UINT16)sizeof (ATAPI_DEVICE_PATH) ); + if (Atapi == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Atapi; + } + PrimarySecondaryStr = GetNextParamStr (&TextDeviceNode); SlaveMasterStr = GetNextParamStr (&TextDeviceNode); LunStr = GetNextParamStr (&TextDeviceNode); @@ -1188,8 +1226,10 @@ DevPathFromTextScsi ( (UINT16)sizeof (SCSI_DEVICE_PATH) ); - Scsi->Pun = (UINT16)Strtoi (PunStr); - Scsi->Lun = (UINT16)Strtoi (LunStr); + if (Scsi != NULL) { + Scsi->Pun = (UINT16)Strtoi (PunStr); + Scsi->Lun = (UINT16)Strtoi (LunStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Scsi; } @@ -1220,9 +1260,11 @@ DevPathFromTextFibre ( (UINT16)sizeof (FIBRECHANNEL_DEVICE_PATH) ); - Fibre->Reserved = 0; - Strtoi64 (WWNStr, &Fibre->WWN); - Strtoi64 (LunStr, &Fibre->Lun); + if (Fibre != NULL) { + Fibre->Reserved = 0; + Strtoi64 (WWNStr, &Fibre->WWN); + Strtoi64 (LunStr, &Fibre->Lun); + } return (EFI_DEVICE_PATH_PROTOCOL *)Fibre; } @@ -1253,12 +1295,14 @@ DevPathFromTextFibreEx ( (UINT16)sizeof (FIBRECHANNELEX_DEVICE_PATH) ); - FibreEx->Reserved = 0; - Strtoi64 (WWNStr, (UINT64 *)(&FibreEx->WWN)); - Strtoi64 (LunStr, (UINT64 *)(&FibreEx->Lun)); + if (FibreEx != NULL) { + FibreEx->Reserved = 0; + Strtoi64 (WWNStr, (UINT64 *)(&FibreEx->WWN)); + Strtoi64 (LunStr, (UINT64 *)(&FibreEx->Lun)); - *(UINT64 *)(&FibreEx->WWN) = SwapBytes64 (*(UINT64 *)(&FibreEx->WWN)); - *(UINT64 *)(&FibreEx->Lun) = SwapBytes64 (*(UINT64 *)(&FibreEx->Lun)); + *(UINT64 *)(&FibreEx->WWN) = SwapBytes64 (*(UINT64 *)(&FibreEx->WWN)); + *(UINT64 *)(&FibreEx->Lun) = SwapBytes64 (*(UINT64 *)(&FibreEx->Lun)); + } return (EFI_DEVICE_PATH_PROTOCOL *)FibreEx; } @@ -1287,8 +1331,10 @@ DevPathFromText1394 ( (UINT16)sizeof (F1394_DEVICE_PATH) ); - F1394DevPath->Reserved = 0; - F1394DevPath->Guid = StrHexToUint64 (GuidStr); + if (F1394DevPath != NULL) { + F1394DevPath->Reserved = 0; + F1394DevPath->Guid = StrHexToUint64 (GuidStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)F1394DevPath; } @@ -1319,8 +1365,10 @@ DevPathFromTextUsb ( (UINT16)sizeof (USB_DEVICE_PATH) ); - Usb->ParentPortNumber = (UINT8)Strtoi (PortStr); - Usb->InterfaceNumber = (UINT8)Strtoi (InterfaceStr); + if (Usb != NULL) { + Usb->ParentPortNumber = (UINT8)Strtoi (PortStr); + Usb->InterfaceNumber = (UINT8)Strtoi (InterfaceStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Usb; } @@ -1349,7 +1397,9 @@ DevPathFromTextI2O ( (UINT16)sizeof (I2O_DEVICE_PATH) ); - I2ODevPath->Tid = (UINT32)Strtoi (TIDStr); + if (I2ODevPath != NULL) { + I2ODevPath->Tid = (UINT32)Strtoi (TIDStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)I2ODevPath; } @@ -1386,11 +1436,13 @@ DevPathFromTextInfiniband ( (UINT16)sizeof (INFINIBAND_DEVICE_PATH) ); - InfiniBand->ResourceFlags = (UINT32)Strtoi (FlagsStr); - StrToGuid (GuidStr, (EFI_GUID *)InfiniBand->PortGid); - Strtoi64 (SidStr, &InfiniBand->ServiceId); - Strtoi64 (TidStr, &InfiniBand->TargetPortId); - Strtoi64 (DidStr, &InfiniBand->DeviceId); + if (InfiniBand != NULL) { + InfiniBand->ResourceFlags = (UINT32)Strtoi (FlagsStr); + StrToGuid (GuidStr, (EFI_GUID *)InfiniBand->PortGid); + Strtoi64 (SidStr, &InfiniBand->ServiceId); + Strtoi64 (TidStr, &InfiniBand->TargetPortId); + Strtoi64 (DidStr, &InfiniBand->DeviceId); + } return (EFI_DEVICE_PATH_PROTOCOL *)InfiniBand; } @@ -1437,7 +1489,10 @@ DevPathFromTextVenPcAnsi ( MSG_VENDOR_DP, (UINT16)sizeof (VENDOR_DEVICE_PATH) ); - CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid); + + if (Vendor != NULL) { + CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vendor; } @@ -1463,7 +1518,10 @@ DevPathFromTextVenVt100 ( MSG_VENDOR_DP, (UINT16)sizeof (VENDOR_DEVICE_PATH) ); - CopyGuid (&Vendor->Guid, &gEfiVT100Guid); + + if (Vendor != NULL) { + CopyGuid (&Vendor->Guid, &gEfiVT100Guid); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vendor; } @@ -1489,7 +1547,10 @@ DevPathFromTextVenVt100Plus ( MSG_VENDOR_DP, (UINT16)sizeof (VENDOR_DEVICE_PATH) ); - CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid); + + if (Vendor != NULL) { + CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vendor; } @@ -1515,7 +1576,10 @@ DevPathFromTextVenUtf8 ( MSG_VENDOR_DP, (UINT16)sizeof (VENDOR_DEVICE_PATH) ); - CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid); + + if (Vendor != NULL) { + CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vendor; } @@ -1544,13 +1608,15 @@ DevPathFromTextUartFlowCtrl ( (UINT16)sizeof (UART_FLOW_CONTROL_DEVICE_PATH) ); - CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid); - if (StrCmp (ValueStr, "XonXoff") == 0) { - UartFlowControl->FlowControlMap = 2; - } else if (StrCmp (ValueStr, "Hardware") == 0) { - UartFlowControl->FlowControlMap = 1; - } else { - UartFlowControl->FlowControlMap = 0; + if (UartFlowControl != NULL) { + CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid); + if (StrCmp (ValueStr, "XonXoff") == 0) { + UartFlowControl->FlowControlMap = 2; + } else if (StrCmp (ValueStr, "Hardware") == 0) { + UartFlowControl->FlowControlMap = 1; + } else { + UartFlowControl->FlowControlMap = 0; + } } return (EFI_DEVICE_PATH_PROTOCOL *)UartFlowControl; @@ -1596,6 +1662,10 @@ DevPathFromTextSAS ( (UINT16)sizeof (SAS_DEVICE_PATH) ); + if (Sas == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Sas; + } + CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid); Strtoi64 (AddressStr, &Sas->SasAddress); Strtoi64 (LunStr, &Sas->Lun); @@ -1692,6 +1762,10 @@ DevPathFromTextSasEx ( (UINT16)sizeof (SASEX_DEVICE_PATH) ); + if (SasEx == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)SasEx; + } + Strtoi64 (AddressStr, &SasAddress); Strtoi64 (LunStr, &Lun); WriteUnaligned64 ((UINT64 *)&SasEx->SasAddress, SwapBytes64 (SasAddress)); @@ -1776,12 +1850,14 @@ DevPathFromTextNVMe ( (UINT16)sizeof (NVME_NAMESPACE_DEVICE_PATH) ); - Nvme->NamespaceId = (UINT32)Strtoi (NamespaceIdStr); - Uuid = (UINT8 *)&Nvme->NamespaceUuid; + if (Nvme != NULL) { + Nvme->NamespaceId = (UINT32)Strtoi (NamespaceIdStr); + Uuid = (UINT8 *)&Nvme->NamespaceUuid; - Index = sizeof (Nvme->NamespaceUuid) / sizeof (UINT8); - while (Index-- != 0) { - Uuid[Index] = (UINT8)StrHexToUintn (SplitStr (&NamespaceUuidStr, '-')); + Index = sizeof (Nvme->NamespaceUuid) / sizeof (UINT8); + while (Index-- != 0) { + Uuid[Index] = (UINT8)StrHexToUintn (SplitStr (&NamespaceUuidStr, '-')); + } } return (EFI_DEVICE_PATH_PROTOCOL *)Nvme; @@ -1813,8 +1889,10 @@ DevPathFromTextUfs ( (UINT16)sizeof (UFS_DEVICE_PATH) ); - Ufs->Pun = (UINT8)Strtoi (PunStr); - Ufs->Lun = (UINT8)Strtoi (LunStr); + if (Ufs != NULL) { + Ufs->Pun = (UINT8)Strtoi (PunStr); + Ufs->Lun = (UINT8)Strtoi (LunStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Ufs; } @@ -1843,7 +1921,9 @@ DevPathFromTextSd ( (UINT16)sizeof (SD_DEVICE_PATH) ); - Sd->SlotNumber = (UINT8)Strtoi (SlotNumberStr); + if (Sd != NULL) { + Sd->SlotNumber = (UINT8)Strtoi (SlotNumberStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Sd; } @@ -1872,7 +1952,9 @@ DevPathFromTextEmmc ( (UINT16)sizeof (EMMC_DEVICE_PATH) ); - Emmc->SlotNumber = (UINT8)Strtoi (SlotNumberStr); + if (Emmc != NULL) { + Emmc->SlotNumber = (UINT8)Strtoi (SlotNumberStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Emmc; } @@ -1899,7 +1981,9 @@ DevPathFromTextDebugPort ( (UINT16)sizeof (VENDOR_DEVICE_PATH) ); - CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid); + if (Vend != NULL) { + CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vend; } @@ -1931,14 +2015,16 @@ DevPathFromTextMAC ( (UINT16)sizeof (MAC_ADDR_DEVICE_PATH) ); - MACDevPath->IfType = (UINT8)Strtoi (IfTypeStr); + if (MACDevPath != NULL) { + MACDevPath->IfType = (UINT8)Strtoi (IfTypeStr); - Length = sizeof (EFI_MAC_ADDRESS); - if ((MACDevPath->IfType == 0x01) || (MACDevPath->IfType == 0x00)) { - Length = 6; - } + Length = sizeof (EFI_MAC_ADDRESS); + if ((MACDevPath->IfType == 0x01) || (MACDevPath->IfType == 0x00)) { + Length = 6; + } - StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length); + StrHexToBytes (AddressStr, Length * 2, MACDevPath->MacAddress.Addr, Length); + } return (EFI_DEVICE_PATH_PROTOCOL *)MACDevPath; } @@ -2002,6 +2088,10 @@ DevPathFromTextIPv4 ( (UINT16)sizeof (IPv4_DEVICE_PATH) ); + if (IPv4 == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)IPv4; + } + StrToIpv4Address (RemoteIPStr, NULL, &IPv4->RemoteIpAddress, NULL); IPv4->Protocol = (UINT16)NetworkProtocolFromText (ProtocolStr); if (StrCmp (TypeStr, "Static") == 0) { @@ -2059,6 +2149,10 @@ DevPathFromTextIPv6 ( (UINT16)sizeof (IPv6_DEVICE_PATH) ); + if (IPv6 == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)IPv6; + } + StrToIpv6Address (RemoteIPStr, NULL, &IPv6->RemoteIpAddress, NULL); IPv6->Protocol = (UINT16)NetworkProtocolFromText (ProtocolStr); if (StrCmp (TypeStr, "Static") == 0) { @@ -2114,6 +2208,10 @@ DevPathFromTextUart ( (UINT16)sizeof (UART_DEVICE_PATH) ); + if (Uart == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Uart; + } + if (StrCmp (BaudStr, "DEFAULT") == 0) { Uart->BaudRate = 115200; } else { @@ -2195,6 +2293,10 @@ ConvertFromTextUsbClass ( (UINT16)sizeof (USB_CLASS_DEVICE_PATH) ); + if (UsbClass == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)UsbClass; + } + VIDStr = GetNextParamStr (&TextDeviceNode); PIDStr = GetNextParamStr (&TextDeviceNode); if (UsbClassText->ClassExist) { @@ -2653,19 +2755,22 @@ DevPathFromTextUsbWwid ( MSG_USB_WWID_DP, (UINT16)(sizeof (USB_WWID_DEVICE_PATH) + SerialNumberStrLen * sizeof (CHAR16)) ); - UsbWwid->VendorId = (UINT16)Strtoi (VIDStr); - UsbWwid->ProductId = (UINT16)Strtoi (PIDStr); - UsbWwid->InterfaceNumber = (UINT16)Strtoi (InterfaceNumStr); - // - // There is no memory allocated in UsbWwid for the '\0' in SerialNumberStr. - // Therefore, the '\0' will not be copied. - // - CopyMem ( - (UINT8 *)UsbWwid + sizeof (USB_WWID_DEVICE_PATH), - SerialNumberStr, - SerialNumberStrLen * sizeof (CHAR16) - ); + if (UsbWwid != NULL) { + UsbWwid->VendorId = (UINT16)Strtoi (VIDStr); + UsbWwid->ProductId = (UINT16)Strtoi (PIDStr); + UsbWwid->InterfaceNumber = (UINT16)Strtoi (InterfaceNumStr); + + // + // There is no memory allocated in UsbWwid for the '\0' in SerialNumberStr. + // Therefore, the '\0' will not be copied. + // + CopyMem ( + (UINT8 *)UsbWwid + sizeof (USB_WWID_DEVICE_PATH), + SerialNumberStr, + SerialNumberStrLen * sizeof (CHAR16) + ); + } return (EFI_DEVICE_PATH_PROTOCOL *)UsbWwid; } @@ -2694,7 +2799,9 @@ DevPathFromTextUnit ( (UINT16)sizeof (DEVICE_LOGICAL_UNIT_DEVICE_PATH) ); - LogicalUnit->Lun = (UINT8)Strtoi (LunStr); + if (LogicalUnit != NULL) { + LogicalUnit->Lun = (UINT8)Strtoi (LunStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)LogicalUnit; } @@ -2738,6 +2845,10 @@ DevPathFromTextiSCSI ( (UINT16)(sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + StrLen (NameStr)) ); + if (ISCSIDevPath == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)ISCSIDevPath; + } + AsciiStr = ISCSIDevPath->TargetName; StrToAscii (NameStr, &AsciiStr); @@ -2800,7 +2911,9 @@ DevPathFromTextVlan ( (UINT16)sizeof (VLAN_DEVICE_PATH) ); - Vlan->VlanId = (UINT16)Strtoi (VlanStr); + if (Vlan != NULL) { + Vlan->VlanId = (UINT16)Strtoi (VlanStr); + } return (EFI_DEVICE_PATH_PROTOCOL *)Vlan; } @@ -2828,12 +2941,16 @@ DevPathFromTextBluetooth ( MSG_BLUETOOTH_DP, (UINT16)sizeof (BLUETOOTH_DEVICE_PATH) ); - StrHexToBytes ( - BluetoothStr, - sizeof (BLUETOOTH_ADDRESS) * 2, - BluetoothDp->BD_ADDR.Address, - sizeof (BLUETOOTH_ADDRESS) - ); + + if (BluetoothDp != NULL) { + StrHexToBytes ( + BluetoothStr, + sizeof (BLUETOOTH_ADDRESS) * 2, + BluetoothDp->BD_ADDR.Address, + sizeof (BLUETOOTH_ADDRESS) + ); + } + return (EFI_DEVICE_PATH_PROTOCOL *)BluetoothDp; } @@ -2863,7 +2980,7 @@ DevPathFromTextWiFi ( (UINT16)sizeof (WIFI_DEVICE_PATH) ); - if (NULL != SSIdStr) { + if ((NULL != SSIdStr) && (NULL != WiFiDp)) { DataLen = StrLen (SSIdStr); if (StrLen (SSIdStr) > 32) { SSIdStr[32] = '\0'; @@ -2903,13 +3020,16 @@ DevPathFromTextBluetoothLE ( (UINT16)sizeof (BLUETOOTH_LE_DEVICE_PATH) ); - BluetoothLeDp->Address.Type = (UINT8)Strtoi (BluetoothLeAddrTypeStr); - StrHexToBytes ( - BluetoothLeAddrStr, - sizeof (BluetoothLeDp->Address.Address) * 2, - BluetoothLeDp->Address.Address, - sizeof (BluetoothLeDp->Address.Address) - ); + if (BluetoothLeDp != NULL) { + BluetoothLeDp->Address.Type = (UINT8)Strtoi (BluetoothLeAddrTypeStr); + StrHexToBytes ( + BluetoothLeAddrStr, + sizeof (BluetoothLeDp->Address.Address) * 2, + BluetoothLeDp->Address.Address, + sizeof (BluetoothLeDp->Address.Address) + ); + } + return (EFI_DEVICE_PATH_PROTOCOL *)BluetoothLeDp; } @@ -3031,7 +3151,7 @@ DevPathFromTextUri ( (UINT16)(sizeof (URI_DEVICE_PATH) + UriLength) ); - while (UriLength-- != 0) { + while (Uri != NULL && UriLength-- != 0) { Uri->Uri[UriLength] = (CHAR8)UriStr[UriLength]; } @@ -3088,6 +3208,10 @@ DevPathFromTextHD ( (UINT16)sizeof (HARDDRIVE_DEVICE_PATH) ); + if (Hd == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Hd; + } + Hd->PartitionNumber = (UINT32)Strtoi (PartitionStr); ZeroMem (Hd->Signature, 16); @@ -3142,9 +3266,11 @@ DevPathFromTextCDROM ( (UINT16)sizeof (CDROM_DEVICE_PATH) ); - CDROMDevPath->BootEntry = (UINT32)Strtoi (EntryStr); - Strtoi64 (StartStr, &CDROMDevPath->PartitionStart); - Strtoi64 (SizeStr, &CDROMDevPath->PartitionSize); + if (CDROMDevPath != NULL) { + CDROMDevPath->BootEntry = (UINT32)Strtoi (EntryStr); + Strtoi64 (StartStr, &CDROMDevPath->PartitionStart); + Strtoi64 (SizeStr, &CDROMDevPath->PartitionSize); + } return (EFI_DEVICE_PATH_PROTOCOL *)CDROMDevPath; } @@ -3193,7 +3319,9 @@ DevPathFromTextFilePath ( (UINT16)(sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) * 2) ); - StrCpyS (File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode); + if (File != NULL) { + StrCpyS (File->PathName, StrLen (TextDeviceNode) + 1, TextDeviceNode); + } #else size_t len = (sizeof (FILEPATH_DEVICE_PATH) + StrLen (TextDeviceNode) * 2); efi_char *v; @@ -3202,8 +3330,10 @@ DevPathFromTextFilePath ( MEDIA_FILEPATH_DP, (UINT16)len ); - v = File->PathName; - utf8_to_ucs2(TextDeviceNode, &v, &len); + if (File != NULL) { + v = File->PathName; + utf8_to_ucs2(TextDeviceNode, &v, &len); + } #endif return (EFI_DEVICE_PATH_PROTOCOL *)File; @@ -3233,7 +3363,9 @@ DevPathFromTextMedia ( (UINT16)sizeof (MEDIA_PROTOCOL_DEVICE_PATH) ); - StrToGuid (GuidStr, &Media->Protocol); + if (Media != NULL) { + StrToGuid (GuidStr, &Media->Protocol); + } return (EFI_DEVICE_PATH_PROTOCOL *)Media; } @@ -3262,7 +3394,9 @@ DevPathFromTextFv ( (UINT16)sizeof (MEDIA_FW_VOL_DEVICE_PATH) ); - StrToGuid (GuidStr, &Fv->FvName); + if (Fv != NULL) { + StrToGuid (GuidStr, &Fv->FvName); + } return (EFI_DEVICE_PATH_PROTOCOL *)Fv; } @@ -3291,7 +3425,9 @@ DevPathFromTextFvFile ( (UINT16)sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH) ); - StrToGuid (GuidStr, &FvFile->FvFileName); + if (FvFile != NULL) { + StrToGuid (GuidStr, &FvFile->FvFileName); + } return (EFI_DEVICE_PATH_PROTOCOL *)FvFile; } @@ -3322,8 +3458,10 @@ DevPathFromTextRelativeOffsetRange ( (UINT16)sizeof (MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH) ); - Strtoi64 (StartingOffsetStr, &Offset->StartingOffset); - Strtoi64 (EndingOffsetStr, &Offset->EndingOffset); + if (Offset != NULL) { + Strtoi64 (StartingOffsetStr, &Offset->StartingOffset); + Strtoi64 (EndingOffsetStr, &Offset->EndingOffset); + } return (EFI_DEVICE_PATH_PROTOCOL *)Offset; } @@ -3360,12 +3498,14 @@ DevPathFromTextRamDisk ( (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH) ); - Strtoi64 (StartingAddrStr, &StartingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); - Strtoi64 (EndingAddrStr, &EndingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); - RamDisk->Instance = (UINT16)Strtoi (InstanceStr); - StrToGuid (TypeGuidStr, &RamDisk->TypeGuid); + if (RamDisk != NULL) { + Strtoi64 (StartingAddrStr, &StartingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); + Strtoi64 (EndingAddrStr, &EndingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); + RamDisk->Instance = (UINT16)Strtoi (InstanceStr); + StrToGuid (TypeGuidStr, &RamDisk->TypeGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk; } @@ -3401,12 +3541,14 @@ DevPathFromTextVirtualDisk ( (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH) ); - Strtoi64 (StartingAddrStr, &StartingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); - Strtoi64 (EndingAddrStr, &EndingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); - RamDisk->Instance = (UINT16)Strtoi (InstanceStr); - CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualDiskGuid); + if (RamDisk != NULL) { + Strtoi64 (StartingAddrStr, &StartingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); + Strtoi64 (EndingAddrStr, &EndingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); + RamDisk->Instance = (UINT16)Strtoi (InstanceStr); + CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualDiskGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk; } @@ -3442,12 +3584,14 @@ DevPathFromTextVirtualCd ( (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH) ); - Strtoi64 (StartingAddrStr, &StartingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); - Strtoi64 (EndingAddrStr, &EndingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); - RamDisk->Instance = (UINT16)Strtoi (InstanceStr); - CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualCdGuid); + if (RamDisk != NULL) { + Strtoi64 (StartingAddrStr, &StartingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); + Strtoi64 (EndingAddrStr, &EndingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); + RamDisk->Instance = (UINT16)Strtoi (InstanceStr); + CopyGuid (&RamDisk->TypeGuid, &gEfiVirtualCdGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk; } @@ -3483,12 +3627,14 @@ DevPathFromTextPersistentVirtualDisk ( (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH) ); - Strtoi64 (StartingAddrStr, &StartingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); - Strtoi64 (EndingAddrStr, &EndingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); - RamDisk->Instance = (UINT16)Strtoi (InstanceStr); - CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualDiskGuid); + if (RamDisk != NULL) { + Strtoi64 (StartingAddrStr, &StartingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); + Strtoi64 (EndingAddrStr, &EndingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); + RamDisk->Instance = (UINT16)Strtoi (InstanceStr); + CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualDiskGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk; } @@ -3524,12 +3670,14 @@ DevPathFromTextPersistentVirtualCd ( (UINT16)sizeof (MEDIA_RAM_DISK_DEVICE_PATH) ); - Strtoi64 (StartingAddrStr, &StartingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); - Strtoi64 (EndingAddrStr, &EndingAddr); - WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); - RamDisk->Instance = (UINT16)Strtoi (InstanceStr); - CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualCdGuid); + if (RamDisk != NULL) { + Strtoi64 (StartingAddrStr, &StartingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->StartingAddr[0]), StartingAddr); + Strtoi64 (EndingAddrStr, &EndingAddr); + WriteUnaligned64 ((UINT64 *)&(RamDisk->EndingAddr[0]), EndingAddr); + RamDisk->Instance = (UINT16)Strtoi (InstanceStr); + CopyGuid (&RamDisk->TypeGuid, &gEfiPersistentVirtualCdGuid); + } return (EFI_DEVICE_PATH_PROTOCOL *)RamDisk; } @@ -3580,6 +3728,10 @@ DevPathFromTextBBS ( (UINT16)(sizeof (BBS_BBS_DEVICE_PATH) + StrLen (IdStr)) ); + if (Bbs == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Bbs; + } + if (StrCmp (TypeStr, "Floppy") == 0) { Bbs->DeviceType = BBS_TYPE_FLOPPY; } else if (StrCmp (TypeStr, "HD") == 0) { @@ -3632,6 +3784,11 @@ DevPathFromTextSata ( MSG_SATA_DP, (UINT16)sizeof (SATA_DEVICE_PATH) ); + + if (Sata == NULL) { + return (EFI_DEVICE_PATH_PROTOCOL *)Sata; + } + Sata->HBAPortNumber = (UINT16)Strtoi (Param1); // @@ -3832,29 +3989,54 @@ UefiDevicePathLibConvertTextToDevicePath ( } DevicePath = (EFI_DEVICE_PATH_PROTOCOL *)AllocatePool (END_DEVICE_PATH_LENGTH); - ASSERT (DevicePath != NULL); + + if (DevicePath == NULL) { + ASSERT (DevicePath != NULL); + return NULL; + } + SetDevicePathEndNode (DevicePath); DevicePathStr = UefiDevicePathLibStrDuplicate (TextDevicePath); + if (DevicePathStr == NULL) { + return NULL; + } + Str = DevicePathStr; while ((DeviceNodeStr = GetNextDeviceNodeStr (&Str, &IsInstanceEnd)) != NULL) { DeviceNode = UefiDevicePathLibConvertTextToDeviceNode (DeviceNodeStr); NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode); - FreePool (DevicePath); - FreePool (DeviceNode); + if (DevicePath != NULL) { + FreePool (DevicePath); + } *** 32 LINES SKIPPED *** From nobody Thu Feb 20 20:16:12 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzPfQ00r9z5pN3Z; Thu, 20 Feb 2025 20:16: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 4YzPfP3dVpz3bpX; Thu, 20 Feb 2025 20:16:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UZQn5GE48Xmddmy7e34RPj1YyOVJbTkPehS8s2PfRWk=; b=tFy/IBGKiUApFkH7zFG8tZ/gTfuxX7GjYhPCMeJ566r4SKkA8Iq71Anby2FqmpcH9Uxkpc mqqH3bceQRZ6ONUqBfWJiyw3D/P5GhMX5Y4pMebDzA7kNw6nv1ZS08XphoM5nFAqLcM9te yKnAthuQIfghshUloYXwlyErjQyLe4/rXGZxsv3LJF6bLQ1Q/r8iqkOQfkfcYm70o8jsWL fx353fjZkhRHZWoKWSz24uzPBNaRoDSOJpRUP0Fny23u46fSMVbiN3yGVwdhZtr4DTB0YU 1FQ9uhTxZbUVsnIDuuZk0gMhuUJifQQF38TsXgSm3mqldFz2d70+Fhd8HVWehg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740082573; a=rsa-sha256; cv=none; b=jfydVrgHwbQfvBBTomefuc9L2aqBsF1c6p/4Dsyi3OsZcYoeIyPt4aAM9df/O/dxz8BGTi U10LA1iEvAZxVbiecsEakdYN1XfnXuuPhBQjnbF1MPYre24U3RyoHzcBG+mh7M/lUnp10t KI3rOCBL8GGO6FbF20BT1PKyMRs5BWRxyKWHUxnvSUp4HMaQhk91AQzxHo7RtFdmxRDQit VK0jWF11o4bg9exXIRMWykGLl7QpbXfTBVvPp6hAoxsVNZ9LM6RpMPh+CqdUdBWl+bWbUn 5c6m5pp7JDycMEv+UA3uR1fRaj+w4WMBOfb4UFjZYX40lVBoFusgr3D8/OzwcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740082573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UZQn5GE48Xmddmy7e34RPj1YyOVJbTkPehS8s2PfRWk=; b=xjIWZJqyMG3QUXAoqjACVXRf6jEuwKqrLBv5j0rXqIDt5rx/l7SOwGQr9dL5ry69jp53AD tYKCFT1TSeRn57nCnn8jZB6kBBVJhf8AlvOQRtSNKImHG+JSfxxD1PvX2ZgDzsrE9pdEnV /lrIvwbmo+87FY9sTofI20S8M0pGSgQ4ZO5GlGsQQpnlytqjw8UJ+djecYqEVSIYb15AGn uHaloDERlEGrD80r2wJfhbcY761mrrAhSAYh4DiWgqu1vqYNW/GybIGsN/e3wxBj64iz0y AGKkd1diTfGqxiIIadBP8t25dTCHie3OB9Q6sb6qgGUnIvGD9MdgyCMH6nJqzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzPfP0kJBz16B4; Thu, 20 Feb 2025 20:16: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 51KKGCJb031108; Thu, 20 Feb 2025 20:16:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KKGCKL031105; Thu, 20 Feb 2025 20:16:12 GMT (envelope-from git) Date: Thu, 20 Feb 2025 20:16:12 GMT Message-Id: <202502202016.51KKGCKL031105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 39d58c816068 - main - libefivar: Add Display Only format for Hard Drive List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39d58c816068178515af0718c47f4f64d1cffc1d Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=39d58c816068178515af0718c47f4f64d1cffc1d commit 39d58c816068178515af0718c47f4f64d1cffc1d Author: Jose Luis Duran AuthorDate: 2025-02-20 20:10:44 +0000 Commit: Jose Luis Duran CommitDate: 2025-02-20 20:14:26 +0000 libefivar: Add Display Only format for Hard Drive Ref: UEFI Specification Version 2.1 (Errata D) (released October 2008) Reviewed by: imp, emaste Approved by: emaste (mentor) Obtained from: https://github.com/tianocore/edk2/commit/9e6537469d4700d9d793ee21e9c2f2e7ddbb2176 Differential Revision: https://reviews.freebsd.org/D49060 --- lib/libefivar/efivar-dp-format.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index b4300573e41c..3fa2833a7e7a 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -1944,7 +1944,7 @@ DevPathToTextHardDrive ( case SIGNATURE_TYPE_MBR: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%s,0x%08x,", + "HD(%d,%s,0x%08x", Hd->PartitionNumber, "MBR", // *((UINT32 *)(&(Hd->Signature[0]))) @@ -1955,7 +1955,7 @@ DevPathToTextHardDrive ( case SIGNATURE_TYPE_GUID: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%s,%36s,", + "HD(%d,%s,%36s", Hd->PartitionNumber, "GPT", G(&(Hd->Signature[0])) @@ -1965,14 +1965,18 @@ DevPathToTextHardDrive ( default: UefiDevicePathLibCatPrint ( Str, - "HD(%d,%d,0,", + "HD(%d,%d,0", Hd->PartitionNumber, Hd->SignatureType ); break; } - UefiDevicePathLibCatPrint (Str, "0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize); + if (DisplayOnly) { + UefiDevicePathLibCatPrint (Str, ")"); + } else { + UefiDevicePathLibCatPrint (Str, ",0x%lx,0x%lx)", Hd->PartitionStart, Hd->PartitionSize); + } } /** From nobody Thu Feb 20 21:53:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzRpV32Y7z5pT7j; Thu, 20 Feb 2025 21:53: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 4YzRpV2B27z3l5k; Thu, 20 Feb 2025 21:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740088402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JsZ5tsJ6NHF+8KxCNB1hQ/ud4mtwsBDsFCQ8oImmxK0=; b=l6yMOJFEwJJDIzHICggKiUke9hU0O4SthnoN7GuusyeL90gEQHLZHSznLEwtYkDuSERkFp gReE/FLG312GhVn3k3i0rmQCAWhXK1kHJuDI4AgkQOSIK4IdlakyKWb+17YqIoVE7dMmau eXLKhDEJKV+iwEYP6czXmcOLmYJTg869OyxKkugp/jJVVB4P7WxjDyw527hyoy+dEzTASm T3SFokl0VOfAucV5d/W4biDUpynaG6ByDeSRij7YAiDwz8TfqiQAMku3wa57AiPoVVC9u0 YY8T8Tl545p9jNPp0ghIDeoFTX+sZQbAJq3CgrZtDoojhkDC4E3GUxmIR7nS6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740088402; a=rsa-sha256; cv=none; b=E9d4JaLgLPfJL8TU73skoIy33iCW9+QuBgfgla0bYhxrsIymxVg6tq6SYNyK8NUZ7unbR0 Ly53iVrsALojUfBWoJIYlqGAUMPnX/omFNXlnQ4TCA455AM4eNPiCFK9qNTjPrx9nz55tt yx2CuEwNeR1fJsSrBRpAjMY/Lyt1MV/0Lw1Jbj0MPbwX37jRg5J1xzK8cmOxfZ19G9y8np cuOQpshcIZCCkzLG1G68ZooEoS0y2Qy+Hg+zMSjatTXoAufXdlCy5iXPPh2NHyFd7YvRdr GYu/X8jDZ2QOVkGTK/OfRyreS02jCXlWQdO/y0XqHk5sNSk0NtCIc0yNqFxmAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740088402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JsZ5tsJ6NHF+8KxCNB1hQ/ud4mtwsBDsFCQ8oImmxK0=; b=bpsixv6DWwYmE0f5wYAPwJUta0lbyWymNJulVA4HeJhc/IfL19xIbj10MyOYqget2Ed4A3 hXS4uuhOYO9gfn0IqAeCXYedkeVoRpfxLs+E4NtaLawjYV9Xv3jJIDfvDVHmcbzmpg9SA9 rIEBWgdVtm5eZeYNUsDbgoFnyfvtyuR85e9L6fXAQBFlDzAYMzzt0roK9LzWbpV+RQeGPZ txLDhigOF/3sUrsnAsUg7D1ZnZxEWW0c9wDMxKFsBuda1lR8Uk5zPuHLq5LAcE4mwePpsw 6sWj63HMfK6n+NieyrAwsG/mD3/cBM544iWgI1ugR2q1M2Z4uG3Zs6PBT0Np+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 4YzRpV1n9gz18Z9; Thu, 20 Feb 2025 21:53: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 51KLrM9j015410; Thu, 20 Feb 2025 21:53:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KLrMts015407; Thu, 20 Feb 2025 21:53:22 GMT (envelope-from git) Date: Thu, 20 Feb 2025 21:53:22 GMT Message-Id: <202502202153.51KLrMts015407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 045a4c108fcf - main - wlanstats: add -Wno-cast-align back for now List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 045a4c108fcf4d8d77da0abab0d24f072bd24244 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=045a4c108fcf4d8d77da0abab0d24f072bd24244 commit 045a4c108fcf4d8d77da0abab0d24f072bd24244 Author: Bjoern A. Zeeb AuthorDate: 2025-02-20 21:40:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-20 21:53:09 +0000 wlanstats: add -Wno-cast-align back for now After fixing the obvious build and cast error when moving this from tools to usr.sbin and removing -Wno-cast-align, re-add it back as at least powerpc* does not compile without it (amd64, arm64, and i386 were ok). In general wlanstats may now get a bit more love after 22 years of being in the tree and being moved at least twice. But first unbreak things again. Reported by: mmel, cperciva (weekly snapshots) Sponsored by: The FreeBSD Foundation Fixes: 61ce422531805 MFC after: 3 days --- usr.sbin/wlanstats/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/wlanstats/Makefile b/usr.sbin/wlanstats/Makefile index d6d29dcc57ad..60c56d24700b 100644 --- a/usr.sbin/wlanstats/Makefile +++ b/usr.sbin/wlanstats/Makefile @@ -9,6 +9,6 @@ LIBADD= bsdstat SRCS= main.c \ wlanstats.c -CFLAGS.clang+= -fbracket-depth=512 +CFLAGS.clang+= -fbracket-depth=512 -Wno-cast-align .include From nobody Thu Feb 20 22:39:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzSrF2pqWz5pWjC; Thu, 20 Feb 2025 22:39: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 4YzSrF288xz4MPv; Thu, 20 Feb 2025 22:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740091197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qf9GdkKVCA/X1rMhLHQIgQqm/4MI+nTEJKu1XGfO4J8=; b=luZ1wv05j5o7NjAUkZ89MSBhcjkPOWR5wxTAw7mcYM6jI1Ym2di7w+5iEt5RiU4Ymwuit8 RwPw8kPVDug8ju56KsbcM+sQieisGQIn+XwTg9DOj+SS29kXTEvWseyxep/cQXCZRcyEnT WvTgeQyiflnSoKwVfso2cO0/5Utis7x+Km9kKmQPv80tSMEv1zn7zVqRYit6bWdyrOhrjC F778JECKpr6Q+H7EyDy93g8aZ5KckR60o0fo2/BL2jZGhtXZ5qgqNz78Ta21gwyRu4ZnH3 Ej1WAmmbKykthEPX+1gMLS5WIcVUsh5wSBX9F7Dy/XFMm4CULI8ZVhcFK+37TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740091197; a=rsa-sha256; cv=none; b=EpmiFtqx5tj3sW8UiZHbim14tlTlJcl1phDv2BEd9gjOv+YGC2XjcthAF6v8sneiOy3xEs EgKnjXaybajcln8rroER2BMdVzcxFBO4NeoTLdrUWR+ZI0fHNKLbKNgnjAsBfhG2thlpja ++i7855elN4N/NwADAAk1ame7wGsF0Nv2b1JiPW30eleXAUyQw1GAAR5Y47GdM85Aq8Epq ezw422kRZ99lLj3Z+z3rP39a+ZZdAUHSzrQp9qXjjINBPvH5kISEkkiKl4xtL5bWDQK9FB GOInIKcIY322vmyeTN/cF49bzRKqhb8BokWRrWdM+U7/3mf6jFyiIJw75Xftdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740091197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qf9GdkKVCA/X1rMhLHQIgQqm/4MI+nTEJKu1XGfO4J8=; b=ZZ8qoimFcS39FIyLKrkajhwn0q5SO5tdwbFc9PgI81egLMeY8LlaJftKJF8aupisZ8y7Ze iB3tDE+Hy32YvDGPu4SanoKn7HxzxRcPkL+uz7KA+6kuc8bQfE27cWCodYfOdsl3ddAP4x /vegm4ujjdL6Zwqlpn+Qu/FFkhClMwQha0ZAaJtmqa5qbLiWdtiCrIRfetpFptyctDgZqG dcrotn2PeIB3gEokiLxbZZcVYWTHUtSLoAs2sAGFroeqYk9oJWHbwnlGFpJzWo/jvmMCNz iPwtRxJ5s36r9adu2Jv7NJiOVGcccWVOCvghNX3r7BP6DV2vfdbSWJLMS8zDTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzSrF0sZwz19ZN; Thu, 20 Feb 2025 22:39: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 51KMduXA092615; Thu, 20 Feb 2025 22:39:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KMdup4092612; Thu, 20 Feb 2025 22:39:56 GMT (envelope-from git) Date: Thu, 20 Feb 2025 22:39:56 GMT Message-Id: <202502202239.51KMdup4092612@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7f916236044d - main - ssh: tidy include handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f916236044d9a733de8b3c47b5dcbf71988cb03 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7f916236044d9a733de8b3c47b5dcbf71988cb03 commit 7f916236044d9a733de8b3c47b5dcbf71988cb03 Author: Ed Maste AuthorDate: 2022-03-02 14:45:23 +0000 Commit: Ed Maste CommitDate: 2025-02-20 22:39:48 +0000 ssh: tidy include handling Centralize optional krb5_config.h handling in ssh.mk. Do not add headers (that are committed to the src tree) to SRCS as there is no need. Reviewed by: imp, jlduran, kevans (all earlier) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34409 --- secure/lib/libssh/Makefile | 5 ----- secure/libexec/sshd-session/Makefile | 2 -- secure/ssh.mk | 5 ++++- secure/usr.bin/ssh/Makefile | 2 -- secure/usr.sbin/sshd/Makefile | 2 -- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index c8cf1fe6de80..43fa46149dfa 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -50,11 +50,6 @@ SRCS+= getrrsetbyname-ldns.c LIBADD+= ldns .endif -.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" -CFLAGS+= -include krb5_config.h -SRCS+= krb5_config.h -.endif - .if defined(LOCALBASE) CFLAGS+= -D_PATH_SSH_ASKPASS_DEFAULT='"${LOCALBASE}/bin/ssh-askpass"' .endif diff --git a/secure/libexec/sshd-session/Makefile b/secure/libexec/sshd-session/Makefile index e365b0c53dde..bce96112f65a 100644 --- a/secure/libexec/sshd-session/Makefile +++ b/secure/libexec/sshd-session/Makefile @@ -45,8 +45,6 @@ LDFLAGS+=-L${LIBBLACKLISTDIR} .endif .if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" -CFLAGS+= -include krb5_config.h -SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 .endif diff --git a/secure/ssh.mk b/secure/ssh.mk index c331e40c16f8..bd88e43aa0a3 100644 --- a/secure/ssh.mk +++ b/secure/ssh.mk @@ -5,7 +5,10 @@ SSHDIR= ${SRCTOP}/crypto/openssh CFLAGS+= -I${SSHDIR} -include ssh_namespace.h -SRCS+= ssh_namespace.h + +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" +CFLAGS+= -include krb5_config.h +.endif CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE:U/usr/local}/bin/xauth\" diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile index 9bff63f29395..aba1bce9c9a1 100644 --- a/secure/usr.bin/ssh/Makefile +++ b/secure/usr.bin/ssh/Makefile @@ -22,8 +22,6 @@ CFLAGS+= -DHAVE_LDNS=1 .endif .if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" -CFLAGS+= -include krb5_config.h -SRCS+= krb5_config.h LIBADD+= gssapi .endif diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index d5bcf008e233..d3b228bbbeb4 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -17,8 +17,6 @@ moduli: .MADE LIBADD= ssh util .if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" -CFLAGS+= -include krb5_config.h -SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 .endif From nobody Thu Feb 20 23:33:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzV2Z34Jpz5pZp9; Thu, 20 Feb 2025 23:33: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 4YzV2Z1BzHz3pZJ; Thu, 20 Feb 2025 23:33:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740094438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/fTD40IkR5Vh6isW6WoV9646tsCa0fowargno2qepg8=; b=EMEeICAR+QC4bLz06n8I2ox8Bt6cyXK4PF5T8A9y7ai/kGPMQZ/JeRWuu7B1fK52fg2yDV M1Hie/vF7FbpZ8f6TcgGl5lrUk8vETJIPXDsxfYTM/rAx5PKxrMYwGAyaArwLk23KIYwEg POAQEhcxlUSmvRhprN7TsGoVq/cP391iWVydmL4T9KWQC41Mo7/dBdnt7psDbfV4nl8UZz RrmvjO+7DQZkJ092N3mlyGy2DaR2S45wy4Bpus6JuUvQlojvJcmIYR0w9W5oFm6vroQocl IEOQw7xDyOsG+kDeLP0H/VU2W2aDV46F7rgWjfuzl7Y36sFbxh5VQcW1mrAC3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740094438; a=rsa-sha256; cv=none; b=v58wwwhYoIxdSuM1ppbnBC0fAFy5lQ8BhmLMukOvv2SpAYyKG+83AdjkXNIbI5nTk8HTn4 f5gctZ0t9BAwrsbRk2sn7ePNNOQ7Y11AMmDXTirsZi8NXg8YJFQEspAdKQYxpLsElHbRIo oDMr4JFQ5G8q5/XevJnuKZQmzincWFFQLPEm9agD0AW4ByzydS84cv5C+l3ocAXjH5180z 4dfTRQ+hKjXraqu6zvRDJkBlp09WiCR63ydc3/U0JmfsM3wwBNRXsGVzuxHrcioLz+q1+T WKF4zlYjtLIY/eJYASkVI0DtpNqphCl+aE7mZ0lgDUJDcdxd5OCrEIOYBQbOgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740094438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/fTD40IkR5Vh6isW6WoV9646tsCa0fowargno2qepg8=; b=Li/N7NDUXz9V+3js+SpiFjgIwO3npD94Ec6VFOsySPBQAn7FdlRY7FZU9/ulcq1T7Zmvuv cU0+M//5htXPXcOMzgQYTxMJGlt/GaqrIWvdKghcRyxitnnJpOh9XouHPy9yn52AOA5Kf1 PbDKhfwIrwgB6lOVPiTrwDI4fD0Q23+vupD2SeUxkyJGgSsP3Gj+9vvL4wfO+TqrERHkSS zsUb6SzuhZwYqP9VZZmJDUhDs0ndMBH0pNtymKYBAPWPk+QdGadidE6twlVOI1bQQS5VjW IpKC2mjiCiVF6TKwKqrOLJpB+30/cqzVT+CVPA+NFJ17hsG1MqV2IjSdbWdwuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzV2Z0lqSz1C6S; Thu, 20 Feb 2025 23:33: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 51KNXvWL005056; Thu, 20 Feb 2025 23:33:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KNXvgN005053; Thu, 20 Feb 2025 23:33:57 GMT (envelope-from git) Date: Thu, 20 Feb 2025 23:33:57 GMT Message-Id: <202502202333.51KNXvgN005053@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d71e7e57fc14 - main - ssh: Consolidate HAVE_LDNS / LIBWRAP in ssh.mk List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d71e7e57fc1472e3ea6d31c44e187c2819d2c71e Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d71e7e57fc1472e3ea6d31c44e187c2819d2c71e commit d71e7e57fc1472e3ea6d31c44e187c2819d2c71e Author: Ed Maste AuthorDate: 2022-04-12 13:18:20 +0000 Commit: Ed Maste CommitDate: 2025-02-20 23:33:46 +0000 ssh: Consolidate HAVE_LDNS / LIBWRAP in ssh.mk Commit 9d63429fa163 ("ssh: move common Makefile boilerplate to a new ssh.mk") introduced ssh.mk for common OpenSSH paths and flags, as part of enabling FIDO/U2F. Move duplicated MK_LDNS and MK_TCP_WRAPPERS handling there. Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31896 --- secure/lib/libssh/Makefile | 2 +- secure/libexec/sftp-server/Makefile | 6 ------ secure/libexec/ssh-keysign/Makefile | 10 +--------- secure/libexec/ssh-pkcs11-helper/Makefile | 10 +--------- secure/libexec/sshd-session/Makefile | 6 ------ secure/ssh.mk | 8 ++++++++ secure/usr.bin/scp/Makefile | 6 ------ secure/usr.bin/sftp/Makefile | 6 ------ secure/usr.bin/ssh-add/Makefile | 6 ------ secure/usr.bin/ssh-agent/Makefile | 10 +--------- secure/usr.bin/ssh-keygen/Makefile | 8 +------- secure/usr.bin/ssh-keyscan/Makefile | 6 ------ secure/usr.bin/ssh/Makefile | 4 ---- secure/usr.sbin/sshd/Makefile | 1 - 14 files changed, 13 insertions(+), 76 deletions(-) diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile index 43fa46149dfa..d5292be88a4b 100644 --- a/secure/lib/libssh/Makefile +++ b/secure/lib/libssh/Makefile @@ -45,7 +45,7 @@ SRCS+= bcrypt_pbkdf.c blowfish.c bsd-misc.c bsd-signal.c explicit_bzero.c \ SRCS+= getrrsetbyname.c .else LDNSDIR= ${SRCTOP}/contrib/ldns -CFLAGS+= -DHAVE_LDNS=1 -I${LDNSDIR} +CFLAGS+= -I${LDNSDIR} SRCS+= getrrsetbyname-ldns.c LIBADD+= ldns .endif diff --git a/secure/libexec/sftp-server/Makefile b/secure/libexec/sftp-server/Makefile index 40d86926d1bb..29f7a8df9fdd 100644 --- a/secure/libexec/sftp-server/Makefile +++ b/secure/libexec/sftp-server/Makefile @@ -7,12 +7,6 @@ MAN= sftp-server.8 LIBADD= ssh -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/libexec/ssh-keysign/Makefile b/secure/libexec/ssh-keysign/Makefile index 6027b164a35f..e66ed527affd 100644 --- a/secure/libexec/ssh-keysign/Makefile +++ b/secure/libexec/ssh-keysign/Makefile @@ -6,15 +6,7 @@ SRCS= ssh-keysign.c readconf.c uidswap.c MAN= ssh-keysign.8 BINMODE=4555 -LIBADD= ssh - -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - -LIBADD+= crypto +LIBADD= crypto ssh .include diff --git a/secure/libexec/ssh-pkcs11-helper/Makefile b/secure/libexec/ssh-pkcs11-helper/Makefile index 4bc3a814ab8e..84374fdca43b 100644 --- a/secure/libexec/ssh-pkcs11-helper/Makefile +++ b/secure/libexec/ssh-pkcs11-helper/Makefile @@ -5,15 +5,7 @@ PROG= ssh-pkcs11-helper SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c MAN= ssh-pkcs11-helper.8 -LIBADD= ssh - -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - -LIBADD+= crypto +LIBADD= crypto ssh .include diff --git a/secure/libexec/sshd-session/Makefile b/secure/libexec/sshd-session/Makefile index bce96112f65a..81e481559189 100644 --- a/secure/libexec/sshd-session/Makefile +++ b/secure/libexec/sshd-session/Makefile @@ -26,12 +26,6 @@ MAN= # pam should always happen before ssh here for static linking LIBADD= pam ssh util -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .if ${MK_AUDIT} != "no" CFLAGS+= -DUSE_BSM_AUDIT=1 -DHAVE_GETAUDIT_ADDR=1 LIBADD+= bsm diff --git a/secure/ssh.mk b/secure/ssh.mk index bd88e43aa0a3..8411fb11fb16 100644 --- a/secure/ssh.mk +++ b/secure/ssh.mk @@ -12,6 +12,14 @@ CFLAGS+= -include krb5_config.h CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE:U/usr/local}/bin/xauth\" +.if ${MK_LDNS} != "no" +CFLAGS+= -DHAVE_LDNS=1 +.endif + +.if ${MK_TCP_WRAPPERS} != "no" +CFLAGS+= -DLIBWRAP=1 +.endif + .if ${MK_USB} != "no" # Built-in security key support CFLAGS+= -include sk_config.h diff --git a/secure/usr.bin/scp/Makefile b/secure/usr.bin/scp/Makefile index dbc896286dd3..2ecea0ef52da 100644 --- a/secure/usr.bin/scp/Makefile +++ b/secure/usr.bin/scp/Makefile @@ -7,12 +7,6 @@ PACKAGE= ssh LIBADD= ssh -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/usr.bin/sftp/Makefile b/secure/usr.bin/sftp/Makefile index 841c89b71c67..f903f5e611d5 100644 --- a/secure/usr.bin/sftp/Makefile +++ b/secure/usr.bin/sftp/Makefile @@ -8,12 +8,6 @@ PACKAGE= ssh LIBADD= ssh edit -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/usr.bin/ssh-add/Makefile b/secure/usr.bin/ssh-add/Makefile index ec709c721089..8df3789534af 100644 --- a/secure/usr.bin/ssh-add/Makefile +++ b/secure/usr.bin/ssh-add/Makefile @@ -7,12 +7,6 @@ PACKAGE= ssh LIBADD= ssh -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/usr.bin/ssh-agent/Makefile b/secure/usr.bin/ssh-agent/Makefile index bc5985a7325e..06abc627fcd5 100644 --- a/secure/usr.bin/ssh-agent/Makefile +++ b/secure/usr.bin/ssh-agent/Makefile @@ -5,20 +5,12 @@ PROG= ssh-agent SRCS= ssh-agent.c ssh-pkcs11-client.c PACKAGE= ssh -LIBADD= ssh - -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif +LIBADD= crypto ssh .if defined(LOCALBASE) CFLAGS+= -DDEFAULT_PKCS11_WHITELIST='"/usr/lib*/*,${LOCALBASE}/lib*/*"' .endif -LIBADD+= crypto - .include .PATH: ${SSHDIR} diff --git a/secure/usr.bin/ssh-keygen/Makefile b/secure/usr.bin/ssh-keygen/Makefile index 149dc6936659..89e61e68ee55 100644 --- a/secure/usr.bin/ssh-keygen/Makefile +++ b/secure/usr.bin/ssh-keygen/Makefile @@ -6,13 +6,7 @@ PROG= ssh-keygen SRCS= ssh-keygen.c sshsig.c ssh-sk-client.c PACKAGE= ssh -LIBADD= ssh - -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -.endif - -LIBADD+= crypto +LIBADD= crypto ssh .include diff --git a/secure/usr.bin/ssh-keyscan/Makefile b/secure/usr.bin/ssh-keyscan/Makefile index b842841f765f..baa7f54b048d 100644 --- a/secure/usr.bin/ssh-keyscan/Makefile +++ b/secure/usr.bin/ssh-keyscan/Makefile @@ -7,12 +7,6 @@ PACKAGE= ssh LIBADD= ssh -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -#DPADD+= ${LIBLDNS} -#LDADD+= -lldns -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile index aba1bce9c9a1..df85f47d5975 100644 --- a/secure/usr.bin/ssh/Makefile +++ b/secure/usr.bin/ssh/Makefile @@ -17,10 +17,6 @@ SRCS+= gss-genr.c LIBADD= ssh -.if ${MK_LDNS} != "no" -CFLAGS+= -DHAVE_LDNS=1 -.endif - .if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" LIBADD+= gssapi .endif diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index d3b228bbbeb4..23a053f27ae7 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -21,7 +21,6 @@ LIBADD+= gssapi_krb5 gssapi krb5 .endif .if ${MK_TCP_WRAPPERS} != "no" -CFLAGS+= -DLIBWRAP=1 LIBADD+= wrap .endif From nobody Thu Feb 20 23:42:32 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzVDT2RLMz5pb70; Thu, 20 Feb 2025 23:42: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 4YzVDT18qhz3wrh; Thu, 20 Feb 2025 23:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740094953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tBnHPrrdFFfyx2hLutlOOka5V3g90ARAWCIVvFF4D0=; b=oi89Ogw183Pmfx8bMsjVngNjXAerjnaG5EGqcv1sr6VQKh2/vhTfxNYJXd9rVbwGreLrZY GC0uxGN3MvUgB1lMZGSLaLEtrUJL/ORszIJMeVhc18eOhXSU8uS9I95/t44jrv1KpOyZ2R X/4v37S0K3Z/iY6Jg37d87SagBUeMIriqbxZxQUcGFh7i6MSqxLQk6gFT3tCS3LD+hhbh1 bxHmbDISHOmfGjsJFyf7WpCyc+vDefA5B9kGx2pL5nyQsEn/b++0207NJD74M0I9iOvEIE Z/HSBOTutSzO2GiHs1bXQwb1lQVFVR9gJDSe8eY4e7fCcFNmx1mgNI669a5THw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740094953; a=rsa-sha256; cv=none; b=AuuBHqe1SSgP5JHCze33fSdRfvWbxod2Q8t/rvAeDo/FTlGXWr0SNM9CQHWbwbrwzECKqW h411VUgQkQHLMdrj0HClPPkzB/xJ54D/Gc3Qtl7OQK5GNdXExSEPFO/dgI/zp28TAY/rTi 8eYJ7PJSLoXD5eUlPDo7SaRhXolSP3kARokTKlW1Alfp1s61juMPtGvk0k7tpv+SuBKfVG fBu+mJBVWSseb0u+O9TQUcRZM8i3eZzkVD903VPwQPgolNgHc56ZMqtxRMC3OQvxGHcijl fGWEIUYTY0hDfQ502tEeN/sc/b4EdHtO1WhjdKUBCKyXV1mdWtgAelrBqvG5vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740094953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tBnHPrrdFFfyx2hLutlOOka5V3g90ARAWCIVvFF4D0=; b=rfGP+/CyJzrLzXzBCyqpBFNJo4eZ7d6K66Jf97tBq4YeonVkiLi8gHdzBTZQKnwj4sSbd/ xaspoe9q56QOFM22LKfWy1YwH0KyXNTrBtP0Pk5OOYca0NhkvjWRTAX6u7/Wvy80rBkmlV 8w5xhw5i8I/mvIurBOQ90786IJGszmYpjEU7Bg9JIanmu8zj4fikrNdWd48+vQ3YftVz8G eA5EGWQx2JxKrwMqC+3N5xTV6c0Sk0T2YbLk8xr4SNwH5zLG3PAbfDk3/KXr0B1Io/wvDc EHERcMV/29yi2kk0JrVOoq1eD3QexnbsbDsJzG/1tsnSE+0uK/UDPoOJGC5HNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzVDT06XHz1CVn; Thu, 20 Feb 2025 23:42: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 51KNgWUZ023057; Thu, 20 Feb 2025 23:42:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51KNgWpj023054; Thu, 20 Feb 2025 23:42:32 GMT (envelope-from git) Date: Thu, 20 Feb 2025 23:42:32 GMT Message-Id: <202502202342.51KNgWpj023054@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 79979aa44d1b - main - ssh: Remove reference to now-upstreamed patch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79979aa44d1b7fd5d04fd574ba8702f76c81c80c Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=79979aa44d1b7fd5d04fd574ba8702f76c81c80c commit 79979aa44d1b7fd5d04fd574ba8702f76c81c80c Author: Ed Maste AuthorDate: 2025-02-20 23:40:52 +0000 Commit: Ed Maste CommitDate: 2025-02-20 23:41:14 +0000 ssh: Remove reference to now-upstreamed patch Our class-based login restrictions patch was merged upstream in commit c276672fc0e9 ("Class-imposed login restrictions"). Sponsored by: The FreeBSD Foundation --- crypto/openssh/FREEBSD-upgrade | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index ef05c55a37e3..2d0a4e61289b 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -154,28 +154,21 @@ counting; the agent will automatically exit when the last client disconnects. -7) Class-based login restrictions (27ceebbc2402) - - We've added code to auth.c to enforce the host.allow, host.deny, - times.allow and times.deny login class capabilities, based on an - upstream submission from - https://github.com/openssh/openssh-portable/pull/262. - -8) Blocklist integration +7) Blocklist integration We include blocklist (https://github.com/zoulasc/blocklist) in FreeBSD, and ssh is patched to report login failures to it. -9) Paths +8) Paths A number of paths are changed to match FreeBSD's configuration (e.g., using /usr/local/ instead of /uxr/X11R6/). -10) Retired patches +9) Retired patches We no longer have client-side VersionAddendum. -11) PrintLastLog bugfix +10) PrintLastLog bugfix Upstream's autoconf sets DISABLE_LASTLOG if the system does not have lastlog.ll_line, but uses it to disable the PrintLastLog configuration From nobody Fri Feb 21 02:49:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzZNQ3Dqbz5nqbW; Fri, 21 Feb 2025 02:49: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 4YzZNP62brz3ZkJ; Fri, 21 Feb 2025 02:49:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740106181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jPpvMLHoZbDcPecN2zq0B2TmUrcNPP4mWQ1bupCGhok=; b=UHuwGp7GvdqFb7pgXBVYNApKC9nUpVLxS7HM7MaDuIOLPaaPPbtEdRF110aG7iZLICeKmA h+IUKCiiwN43c7f6sCG+YxhN5y/okW2+Xuh0g4Uey+engdo7S9EFBvW3Q1hxTfeYDCngpr k1uob/dhD4B16Goomp86WQVNf6fqLmyKPQhDQAQ50xPKT0Jx3OGL4QZZmV5Om+0ghW3oN2 EVCB1Up0+NRKnT3VNHUZ9R/Ls3ethfK9W7xXk6L8zX2HhWME2RjhwBEfZD8CYnyfV5Jlxz RIGvoU+JG7f5gRBLD8Hjbw67VCdnDK1jwNiitsWomJFWYwJ4Hb83H5Wmbzu4JQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740106181; a=rsa-sha256; cv=none; b=GYQaHy8kM+4cL5q7kqYEQT+sA8hIopPL1ccq25aj8vCvoJZ7XpEaX9iMkIIK+/rHpwouv7 XX11J3vcDBKDGonLlxAPAjXGBsgNAc/OJR6XgK6LJ0qyovu2F/y1BbdDi7YhIRUpJsE15G Mu4PTtJ1ANYgaJq+TjYRDxfkaZsKMGgC2pske+BMfa4B9jTSO3PBxierDNAbJUgxqAlTj3 n0LRw0fPr4rncwsfcYOl9UVgSffGX3CmR/RkxcTBlbdsvLrSpZ0zzR9dA/vfPbbIRf8Ln5 OR+vqoKAmS99meixXyUPgiz3J75LVgY1JGXd12XC9pGtG+vEBI5Yi9gyDlXKYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740106181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jPpvMLHoZbDcPecN2zq0B2TmUrcNPP4mWQ1bupCGhok=; b=JkSVG6+JvRoOCEXyFTAQCflibGwgr6wt79wTymm2LIoUN9zgW7rzpTgwtewaYz0j89R3GA LSyYA/Cl1irlLNqVADo4qj8v0/rsmp4SswdjX8QCVzUlICFYUJZvEm44suqaMdzx4xlN31 A70IjosnpHqTFmDviqDGJHthu0W356yqFBDtytExATosnfFc6LRi4s+3A8p4ymapwDmmMo frikPQfVcEWjg1PP39J+sbuWvh0TljdXfkm+WVfqMuf+NMrrXmr96p94Y2ou0kFc5o//cA V7q10y1Xb8yBkLJLgAA+qCYNlSqU2JVFXhQ0tR7Inc7aRUoCM6L8sqwWqhyFJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzZNP48cDz1Hqh; Fri, 21 Feb 2025 02:49: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 51L2nfY8062136; Fri, 21 Feb 2025 02:49:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L2nf49062133; Fri, 21 Feb 2025 02:49:41 GMT (envelope-from git) Date: Fri, 21 Feb 2025 02:49:41 GMT Message-Id: <202502210249.51L2nf49062133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 9f32893b05da - main - qcom_ess_edma: Add the IPQ4018/IPQ4019 ethernet MAC/MDIO driver. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f32893b05dabedc7f8332ec12e2a944b6543158 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=9f32893b05dabedc7f8332ec12e2a944b6543158 commit 9f32893b05dabedc7f8332ec12e2a944b6543158 Author: Adrian Chadd AuthorDate: 2023-04-05 04:36:52 +0000 Commit: Adrian Chadd CommitDate: 2025-02-21 02:48:12 +0000 qcom_ess_edma: Add the IPQ4018/IPQ4019 ethernet MAC/MDIO driver. This adds the ESS EDMA driver introduced by the IPQ4018/IPQ4019. It provides a number of transmit and receive rings which can be mapped into virtual ethernet devices, which this driver supports. It's partially integrated into the ar40xx etherswitch which supplies the port and some filtering/VPN offload functionality. This driver only currently supports the per-port options which allow for the virtual ethernet driver mapping. This was written by reverse engineering the functionality of the ethernet switch and ethernet driver support provided by Qualcomm Atheros via their OpenWRT contributions. The code is all originally authored by myself. Differential Revision: https://reviews.freebsd.org/D49027 --- sys/arm/qualcomm/std.ipq4018 | 7 + sys/dev/qcom_ess_edma/qcom_ess_edma.c | 985 ++++++++++++++++++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_debug.h | 52 ++ sys/dev/qcom_ess_edma/qcom_ess_edma_desc.c | 351 ++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_desc.h | 63 ++ sys/dev/qcom_ess_edma/qcom_ess_edma_gmac.c | 462 +++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_gmac.h | 46 ++ sys/dev/qcom_ess_edma/qcom_ess_edma_hw.c | 752 +++++++++++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_hw.h | 86 +++ sys/dev/qcom_ess_edma/qcom_ess_edma_reg.h | 429 ++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_rx.c | 514 +++++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_rx.h | 51 ++ sys/dev/qcom_ess_edma/qcom_ess_edma_tx.c | 454 +++++++++++++ sys/dev/qcom_ess_edma/qcom_ess_edma_tx.h | 50 ++ sys/dev/qcom_ess_edma/qcom_ess_edma_var.h | 258 ++++++++ 15 files changed, 4560 insertions(+) diff --git a/sys/arm/qualcomm/std.ipq4018 b/sys/arm/qualcomm/std.ipq4018 index e6719efb9bce..6360a3ce25db 100644 --- a/sys/arm/qualcomm/std.ipq4018 +++ b/sys/arm/qualcomm/std.ipq4018 @@ -55,3 +55,10 @@ dev/qcom_tlmm/qcom_tlmm_pinmux.c optional qcom_tlmm_ipq4018 dev/qcom_tcsr/qcom_tcsr.c optional qcom_tcsr dev/qcom_mdio/qcom_mdio_ipq4018.c optional qcom_mdio_ipq4018 + +dev/qcom_ess_edma/qcom_ess_edma.c optional qcom_ess_edma +dev/qcom_ess_edma/qcom_ess_edma_desc.c optional qcom_ess_edma +dev/qcom_ess_edma/qcom_ess_edma_gmac.c optional qcom_ess_edma +dev/qcom_ess_edma/qcom_ess_edma_hw.c optional qcom_ess_edma +dev/qcom_ess_edma/qcom_ess_edma_rx.c optional qcom_ess_edma +dev/qcom_ess_edma/qcom_ess_edma_tx.c optional qcom_ess_edma diff --git a/sys/dev/qcom_ess_edma/qcom_ess_edma.c b/sys/dev/qcom_ess_edma/qcom_ess_edma.c new file mode 100644 index 000000000000..990bfe5ee074 --- /dev/null +++ b/sys/dev/qcom_ess_edma/qcom_ess_edma.c @@ -0,0 +1,985 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Adrian Chadd + * + * 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 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +static int +qcom_ess_edma_probe(device_t dev) +{ + + if (! ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_is_compatible(dev, "qcom,ess-edma") == 0) + return (ENXIO); + + device_set_desc(dev, + "Qualcomm Atheros IPQ4018/IPQ4019 Ethernet driver"); + return (0); +} + +static int +qcom_ess_edma_release_intr(struct qcom_ess_edma_softc *sc, + struct qcom_ess_edma_intr *intr) +{ + + if (intr->irq_res == NULL) + return (0); + + if (intr->irq_intr != NULL) + bus_teardown_intr(sc->sc_dev, intr->irq_res, intr->irq_intr); + if (intr->irq_res != NULL) + bus_release_resource(sc->sc_dev, SYS_RES_IRQ, intr->irq_rid, + intr->irq_res); + + return (0); +} + +static void +qcom_ess_edma_tx_queue_xmit(struct qcom_ess_edma_softc *sc, int queue_id) +{ + struct qcom_ess_edma_tx_state *txs = &sc->sc_tx_state[queue_id]; + int n = 0; + int ret; + + QCOM_ESS_EDMA_DPRINTF(sc, QCOM_ESS_EDMA_DBG_TX_TASK, + "%s: called; TX queue %d\n", __func__, queue_id); + + EDMA_RING_LOCK_ASSERT(&sc->sc_tx_ring[queue_id]); + + sc->sc_tx_ring[queue_id].stats.num_tx_xmit_defer++; + + (void) atomic_cmpset_int(&txs->enqueue_is_running, 1, 0); + + /* Don't do any work if the ring is empty */ + if (buf_ring_empty(txs->br)) + return; + + /* + * The ring isn't empty, dequeue frames and hand + * them to the hardware; defer updating the + * transmit ring pointer until we're done. + */ + while (! buf_ring_empty(txs->br)) { + if_t ifp; + struct qcom_ess_edma_gmac *gmac; + struct mbuf *m; + + m = buf_ring_peek_clear_sc(txs->br); + if (m == NULL) + break; + + ifp = m->m_pkthdr.rcvif; + gmac = if_getsoftc(ifp); + + /* + * The only way we'll know if we have space is to + * to try and transmit it. + */ + ret = qcom_ess_edma_tx_ring_frame(sc, queue_id, &m, + gmac->port_mask, gmac->vlan_id); + if (ret == 0) { + if_inc_counter(gmac->ifp, IFCOUNTER_OPACKETS, 1); + buf_ring_advance_sc(txs->br); + } else { + /* Put whatever we tried to transmit back */ + if_inc_counter(gmac->ifp, IFCOUNTER_OERRORS, 1); + buf_ring_putback_sc(txs->br, m); + break; + } + n++; + } + + /* + * Only push the updated descriptor ring stuff to the hardware + * if we actually queued something. + */ + if (n != 0) + (void) qcom_ess_edma_tx_ring_frame_update(sc, queue_id); +} + +/* + * Enqueued when a deferred TX needs to happen. + */ +static void +qcom_ess_edma_tx_queue_xmit_task(void *arg, int npending) +{ + struct qcom_ess_edma_tx_state *txs = arg; + struct qcom_ess_edma_softc *sc = txs->sc; + + QCOM_ESS_EDMA_DPRINTF(sc, QCOM_ESS_EDMA_DBG_INTERRUPT, + "%s: called; TX queue %d\n", __func__, txs->queue_id); + + EDMA_RING_LOCK(&sc->sc_tx_ring[txs->queue_id]); + + sc->sc_tx_ring[txs->queue_id].stats.num_tx_xmit_task++; + qcom_ess_edma_tx_queue_xmit(sc, txs->queue_id); + + EDMA_RING_UNLOCK(&sc->sc_tx_ring[txs->queue_id]); +} + +/* + * Enqueued when a TX completion interrupt occurs. + */ +static void +qcom_ess_edma_tx_queue_complete_task(void *arg, int npending) +{ + struct qcom_ess_edma_tx_state *txs = arg; + struct qcom_ess_edma_softc *sc = txs->sc; + + /* Transmit queue */ + QCOM_ESS_EDMA_DPRINTF(sc, QCOM_ESS_EDMA_DBG_INTERRUPT, + "%s: called; TX queue %d\n", __func__, txs->queue_id); + + EDMA_RING_LOCK(&sc->sc_tx_ring[txs->queue_id]); + + /* + * Complete/free tx mbufs. + */ + (void) qcom_ess_edma_tx_ring_complete(sc, txs->queue_id); + + /* + * ACK the interrupt. + */ + (void) qcom_ess_edma_hw_intr_tx_ack(sc, txs->queue_id); + + /* + * Re-enable the interrupt. + */ + (void) qcom_ess_edma_hw_intr_tx_intr_set_enable(sc, txs->queue_id, + true); + + /* + * Do any pending TX work if there's any buffers in the ring. + */ + if (! buf_ring_empty(txs->br)) + qcom_ess_edma_tx_queue_xmit(sc, txs->queue_id); + + EDMA_RING_UNLOCK(&sc->sc_tx_ring[txs->queue_id]); +} + +static int +qcom_ess_edma_setup_tx_state(struct qcom_ess_edma_softc *sc, int txq, int cpu) +{ + struct qcom_ess_edma_tx_state *txs; + struct qcom_ess_edma_desc_ring *ring; + cpuset_t mask; + + txs = &sc->sc_tx_state[txq]; + ring = &sc->sc_tx_ring[txq]; + + snprintf(txs->label, QCOM_ESS_EDMA_LABEL_SZ - 1, "txq%d_compl", txq); + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + + txs->queue_id = txq; + txs->sc = sc; + txs->completion_tq = taskqueue_create_fast(txs->label, M_NOWAIT, + taskqueue_thread_enqueue, &txs->completion_tq); +#if 0 + taskqueue_start_threads_cpuset(&txs->completion_tq, 1, PI_NET, + &mask, "%s", txs->label); +#else + taskqueue_start_threads(&txs->completion_tq, 1, PI_NET, + "%s", txs->label); +#endif + + TASK_INIT(&txs->completion_task, 0, + qcom_ess_edma_tx_queue_complete_task, txs); + TASK_INIT(&txs->xmit_task, 0, + qcom_ess_edma_tx_queue_xmit_task, txs); + + txs->br = buf_ring_alloc(EDMA_TX_BUFRING_SIZE, M_DEVBUF, M_WAITOK, + &ring->mtx); + + return (0); +} + +/* + * Free the transmit ring state. + * + * This assumes that the taskqueues have been drained and DMA has + * stopped - all we're doing here is freeing the allocated resources. + */ +static int +qcom_ess_edma_free_tx_state(struct qcom_ess_edma_softc *sc, int txq) +{ + struct qcom_ess_edma_tx_state *txs; + + txs = &sc->sc_tx_state[txq]; + + taskqueue_free(txs->completion_tq); + + while (! buf_ring_empty(txs->br)) { + struct mbuf *m; + + m = buf_ring_dequeue_sc(txs->br); + m_freem(m); + } + + buf_ring_free(txs->br, M_DEVBUF); + + return (0); +} + +static void +qcom_ess_edma_rx_queue_complete_task(void *arg, int npending) +{ + struct qcom_ess_edma_rx_state *rxs = arg; + struct qcom_ess_edma_softc *sc = rxs->sc; + struct mbufq mq; + + mbufq_init(&mq, EDMA_RX_RING_SIZE); + + /* Receive queue */ + QCOM_ESS_EDMA_DPRINTF(sc, QCOM_ESS_EDMA_DBG_INTERRUPT, + "%s: called; RX queue %d\n", + __func__, rxs->queue_id); + + EDMA_RING_LOCK(&sc->sc_rx_ring[rxs->queue_id]); + + /* + * Do receive work, get completed mbufs. + */ + (void) qcom_ess_edma_rx_ring_complete(sc, rxs->queue_id, &mq); + + /* + * ACK the interrupt. + */ + (void) qcom_ess_edma_hw_intr_rx_ack(sc, rxs->queue_id); + + /* + * Re-enable interrupt for this ring. + */ + (void) qcom_ess_edma_hw_intr_rx_intr_set_enable(sc, rxs->queue_id, + true); + + EDMA_RING_UNLOCK(&sc->sc_rx_ring[rxs->queue_id]); + + /* Push frames into networking stack */ + (void) qcom_ess_edma_gmac_receive_frames(sc, rxs->queue_id, &mq); +} + +static int +qcom_ess_edma_setup_rx_state(struct qcom_ess_edma_softc *sc, int rxq, int cpu) +{ + struct qcom_ess_edma_rx_state *rxs; + cpuset_t mask; + + rxs = &sc->sc_rx_state[rxq]; + + snprintf(rxs->label, QCOM_ESS_EDMA_LABEL_SZ - 1, "rxq%d_compl", rxq); + + CPU_ZERO(&mask); + CPU_SET(cpu, &mask); + + rxs->queue_id = rxq; + rxs->sc = sc; + rxs->completion_tq = taskqueue_create_fast(rxs->label, M_NOWAIT, + taskqueue_thread_enqueue, &rxs->completion_tq); +#if 0 + taskqueue_start_threads_cpuset(&rxs->completion_tq, 1, PI_NET, + &mask, "%s", rxs->label); +#else + taskqueue_start_threads(&rxs->completion_tq, 1, PI_NET, + "%s", rxs->label); +#endif + + TASK_INIT(&rxs->completion_task, 0, + qcom_ess_edma_rx_queue_complete_task, rxs); + return (0); +} + +/* + * Free the receive ring state. + * + * This assumes that the taskqueues have been drained and DMA has + * stopped - all we're doing here is freeing the allocated resources. + */ + +static int +qcom_ess_edma_free_rx_state(struct qcom_ess_edma_softc *sc, int rxq) +{ + struct qcom_ess_edma_rx_state *rxs; + + rxs = &sc->sc_rx_state[rxq]; + + taskqueue_free(rxs->completion_tq); + + return (0); +} + + +static int +qcom_ess_edma_detach(device_t dev) +{ + struct qcom_ess_edma_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_IRQS; i++) { + (void) qcom_ess_edma_release_intr(sc, &sc->sc_tx_irq[i]); + } + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_IRQS; i++) { + (void) qcom_ess_edma_release_intr(sc, &sc->sc_rx_irq[i]); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_RINGS; i++) { + (void) qcom_ess_edma_free_tx_state(sc, i); + (void) qcom_ess_edma_tx_ring_clean(sc, &sc->sc_rx_ring[i]); + (void) qcom_ess_edma_desc_ring_free(sc, &sc->sc_tx_ring[i]); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_RINGS; i++) { + (void) qcom_ess_edma_free_rx_state(sc, i); + (void) qcom_ess_edma_rx_ring_clean(sc, &sc->sc_rx_ring[i]); + (void) qcom_ess_edma_desc_ring_free(sc, &sc->sc_rx_ring[i]); + } + + if (sc->sc_dma_tag) { + bus_dma_tag_destroy(sc->sc_dma_tag); + sc->sc_dma_tag = NULL; + } + + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); + mtx_destroy(&sc->sc_mtx); + + return(0); +} + +static int +qcom_ess_edma_filter(void *arg) +{ + struct qcom_ess_edma_intr *intr = arg; + struct qcom_ess_edma_softc *sc = intr->sc; + + if (intr->irq_rid < QCOM_ESS_EDMA_NUM_TX_IRQS) { + int tx_queue = intr->irq_rid; + + intr->stats.num_intr++; + + /* + * Disable the interrupt for this ring. + */ + (void) qcom_ess_edma_hw_intr_tx_intr_set_enable(sc, tx_queue, + false); + + /* + * Schedule taskqueue to run for this queue. + */ + taskqueue_enqueue(sc->sc_tx_state[tx_queue].completion_tq, + &sc->sc_tx_state[tx_queue].completion_task); + + return (FILTER_HANDLED); + } else { + int rx_queue = intr->irq_rid - QCOM_ESS_EDMA_NUM_TX_IRQS; + + intr->stats.num_intr++; + + /* + * Disable the interrupt for this ring. + */ + (void) qcom_ess_edma_hw_intr_rx_intr_set_enable(sc, rx_queue, + false); + + /* + * Schedule taskqueue to run for this queue. + */ + taskqueue_enqueue(sc->sc_rx_state[rx_queue].completion_tq, + &sc->sc_rx_state[rx_queue].completion_task); + + return (FILTER_HANDLED); + } +} + +static int +qcom_ess_edma_setup_intr(struct qcom_ess_edma_softc *sc, + struct qcom_ess_edma_intr *intr, int rid, int cpu_id) +{ + + QCOM_ESS_EDMA_DPRINTF(sc, QCOM_ESS_EDMA_DBG_INTERRUPT, + "%s: setting up interrupt id %d\n", __func__, rid); + intr->sc = sc; + intr->irq_rid = rid; + intr->irq_res = bus_alloc_resource_any(sc->sc_dev, + SYS_RES_IRQ, &intr->irq_rid, RF_ACTIVE); + if (intr->irq_res == NULL) { + device_printf(sc->sc_dev, + "ERROR: couldn't allocate IRQ %d\n", + rid); + return (ENXIO); + } + + if ((bus_setup_intr(sc->sc_dev, intr->irq_res, + INTR_TYPE_NET | INTR_MPSAFE, + qcom_ess_edma_filter, NULL, intr, + &intr->irq_intr))) { + device_printf(sc->sc_dev, + "ERROR: unable to register interrupt handler for" + " IRQ %d\n", rid); + return (ENXIO); + } + + /* If requested, bind the interrupt to the given CPU. */ + if (cpu_id != -1) { + if (intr_bind_irq(sc->sc_dev, intr->irq_res, cpu_id) != 0) { + device_printf(sc->sc_dev, + "ERROR: unable to bind IRQ %d to CPU %d\n", + rid, cpu_id); + } + /* Note: don't completely error out here */ + } + + return (0); +} + +static int +qcom_ess_edma_sysctl_dump_state(SYSCTL_HANDLER_ARGS) +{ + struct qcom_ess_edma_softc *sc = arg1; + int val = 0; + int error; + int i; + + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return (error); + if (val == 0) + return (0); + + EDMA_LOCK(sc); + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_RINGS; i++) { + device_printf(sc->sc_dev, + "RXQ[%d]: prod=%u, cons=%u, hw prod=%u, hw cons=%u," + " REG_SW_CONS_IDX=0x%08x\n", + i, + sc->sc_rx_ring[i].next_to_fill, + sc->sc_rx_ring[i].next_to_clean, + EDMA_REG_READ(sc, + EDMA_REG_RFD_IDX_Q(i)) & EDMA_RFD_PROD_IDX_BITS, + qcom_ess_edma_hw_rfd_get_cons_index(sc, i), + EDMA_REG_READ(sc, EDMA_REG_RX_SW_CONS_IDX_Q(i))); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_RINGS; i++) { + device_printf(sc->sc_dev, + "TXQ[%d]: prod=%u, cons=%u, hw prod=%u, hw cons=%u\n", + i, + sc->sc_tx_ring[i].next_to_fill, + sc->sc_tx_ring[i].next_to_clean, + (EDMA_REG_READ(sc, EDMA_REG_TPD_IDX_Q(i)) + >> EDMA_TPD_CONS_IDX_SHIFT) & EDMA_TPD_CONS_IDX_MASK, + EDMA_REG_READ(sc, EDMA_REG_TX_SW_CONS_IDX_Q(i))); + } + + device_printf(sc->sc_dev, "EDMA_REG_TXQ_CTRL=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_TXQ_CTRL)); + device_printf(sc->sc_dev, "EDMA_REG_RXQ_CTRL=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_RXQ_CTRL)); + device_printf(sc->sc_dev, "EDMA_REG_RX_DESC0=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_RX_DESC0)); + device_printf(sc->sc_dev, "EDMA_REG_RX_DESC1=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_RX_DESC1)); + device_printf(sc->sc_dev, "EDMA_REG_RX_ISR=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_RX_ISR)); + device_printf(sc->sc_dev, "EDMA_REG_TX_ISR=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_TX_ISR)); + device_printf(sc->sc_dev, "EDMA_REG_MISC_ISR=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_MISC_ISR)); + device_printf(sc->sc_dev, "EDMA_REG_WOL_ISR=0x%08x\n", + EDMA_REG_READ(sc, EDMA_REG_WOL_ISR)); + + EDMA_UNLOCK(sc); + + return (0); +} + +static int +qcom_ess_edma_sysctl_dump_stats(SYSCTL_HANDLER_ARGS) +{ + struct qcom_ess_edma_softc *sc = arg1; + int val = 0; + int error; + int i; + + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + return (error); + if (val == 0) + return (0); + + EDMA_LOCK(sc); + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_RINGS; i++) { + device_printf(sc->sc_dev, + "RXQ[%d]: num_added=%llu, num_cleaned=%llu," + " num_dropped=%llu, num_enqueue_full=%llu," + " num_rx_no_gmac=%llu, tx_mapfail=%llu," + " num_tx_maxfrags=%llu, num_rx_ok=%llu\n", + i, + sc->sc_rx_ring[i].stats.num_added, + sc->sc_rx_ring[i].stats.num_cleaned, + sc->sc_rx_ring[i].stats.num_dropped, + sc->sc_rx_ring[i].stats.num_enqueue_full, + sc->sc_rx_ring[i].stats.num_rx_no_gmac, + sc->sc_rx_ring[i].stats.num_tx_mapfail, + sc->sc_rx_ring[i].stats.num_tx_maxfrags, + sc->sc_rx_ring[i].stats.num_rx_ok); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_RINGS; i++) { + device_printf(sc->sc_dev, + "TXQ[%d]: num_added=%llu, num_cleaned=%llu," + " num_dropped=%llu, num_enqueue_full=%llu," + " tx_mapfail=%llu, tx_complete=%llu, tx_xmit_defer=%llu," + " tx_xmit_task=%llu, num_tx_maxfrags=%llu," + " num_tx_ok=%llu\n", + i, + sc->sc_tx_ring[i].stats.num_added, + sc->sc_tx_ring[i].stats.num_cleaned, + sc->sc_tx_ring[i].stats.num_dropped, + sc->sc_tx_ring[i].stats.num_enqueue_full, + sc->sc_tx_ring[i].stats.num_tx_mapfail, + sc->sc_tx_ring[i].stats.num_tx_complete, + sc->sc_tx_ring[i].stats.num_tx_xmit_defer, + sc->sc_tx_ring[i].stats.num_tx_xmit_task, + sc->sc_tx_ring[i].stats.num_tx_maxfrags, + sc->sc_tx_ring[i].stats.num_tx_ok); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_IRQS; i++) { + device_printf(sc->sc_dev, "INTR_RXQ[%d]: num_intr=%llu\n", + i, + sc->sc_rx_irq[i].stats.num_intr); + } + + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_IRQS; i++) { + device_printf(sc->sc_dev, "INTR_TXQ[%d]: num_intr=%llu\n", + i, + sc->sc_tx_irq[i].stats.num_intr); + } + + EDMA_UNLOCK(sc); + + return (0); +} + + +static int +qcom_ess_edma_sysctl_tx_intmit(SYSCTL_HANDLER_ARGS) +{ + struct qcom_ess_edma_softc *sc = arg1; + uint32_t usec; + int val = 0; + int error; + + EDMA_LOCK(sc); + (void) qcom_ess_edma_hw_get_tx_intr_moderation(sc, &usec); + EDMA_UNLOCK(sc); + + val = usec; + + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr) + goto finish; + + EDMA_LOCK(sc); + error = qcom_ess_edma_hw_set_tx_intr_moderation(sc, (uint32_t) val); + EDMA_UNLOCK(sc); +finish: + return error; +} + + +static int +qcom_ess_edma_attach_sysctl(struct qcom_ess_edma_softc *sc) +{ + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "debug", CTLFLAG_RW, &sc->sc_debug, 0, + "debugging flags"); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "state", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, qcom_ess_edma_sysctl_dump_state, "I", ""); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "stats", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, qcom_ess_edma_sysctl_dump_stats, "I", ""); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_intmit", CTLTYPE_INT | CTLFLAG_RW, sc, + 0, qcom_ess_edma_sysctl_tx_intmit, "I", ""); + + return (0); +} + +static int +qcom_ess_edma_attach(device_t dev) +{ + struct qcom_ess_edma_softc *sc = device_get_softc(dev); + int i, ret; + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + sc->sc_dev = dev; + sc->sc_debug = 0; + + (void) qcom_ess_edma_attach_sysctl(sc); + + /* Create parent DMA tag. */ + ret = bus_dma_tag_create( + bus_get_dma_tag(sc->sc_dev), /* parent */ + 1, 0, /* alignment, boundary */ + BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->sc_dma_tag); + if (ret != 0) { + device_printf(sc->sc_dev, + "ERROR: failed to create parent DMA tag\n"); + goto error; + } + + /* Map control/status registers. */ + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); + + if (sc->sc_mem_res == NULL) { + device_printf(dev, "ERROR: couldn't map MMIO space\n"); + goto error; + } + + sc->sc_mem_res_size = (size_t) bus_get_resource_count(dev, + SYS_RES_MEMORY, sc->sc_mem_rid); + if (sc->sc_mem_res_size == 0) { + device_printf(dev, "%s: failed to get device memory size\n", + __func__); + goto error; + } + + /* + * How many TX queues per CPU, for figuring out flowid/CPU + * mapping. + */ + sc->sc_config.num_tx_queue_per_cpu = + QCOM_ESS_EDMA_NUM_TX_RINGS / mp_ncpus; + + /* Allocate TX IRQs */ + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_IRQS; i++) { + int cpu_id; + + /* + * The current mapping in the if_transmit() path + * will map mp_ncpu groups of flowids to the TXQs. + * So for a 4 CPU system the first four will be CPU 0, + * the second four will be CPU 1, etc. + */ + cpu_id = qcom_ess_edma_tx_queue_to_cpu(sc, i); + if (qcom_ess_edma_setup_intr(sc, &sc->sc_tx_irq[i], + i, cpu_id) != 0) + goto error; + if (bootverbose) + device_printf(sc->sc_dev, + "mapping TX IRQ %d to CPU %d\n", + i, cpu_id); + } + + /* Allocate RX IRQs */ + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_IRQS; i++) { + int cpu_id = qcom_ess_edma_rx_queue_to_cpu(sc, i); + if (qcom_ess_edma_setup_intr(sc, &sc->sc_rx_irq[i], + i + QCOM_ESS_EDMA_NUM_TX_IRQS, cpu_id) != 0) + goto error; + if (bootverbose) + device_printf(sc->sc_dev, + "mapping RX IRQ %d to CPU %d\n", + i, cpu_id); + } + + /* Default receive frame size - before ETHER_ALIGN hack */ + sc->sc_config.rx_buf_size = 2048; + sc->sc_config.rx_buf_ether_align = true; + + /* Default RSS paramters */ + sc->sc_config.rss_type = + EDMA_RSS_TYPE_IPV4TCP | EDMA_RSS_TYPE_IPV6_TCP + | EDMA_RSS_TYPE_IPV4_UDP | EDMA_RSS_TYPE_IPV6UDP + | EDMA_RSS_TYPE_IPV4 | EDMA_RSS_TYPE_IPV6; + + /* Default queue parameters */ + sc->sc_config.tx_ring_count = EDMA_TX_RING_SIZE; + sc->sc_config.rx_ring_count = EDMA_RX_RING_SIZE; + + /* Default interrupt masks */ + sc->sc_config.rx_intr_mask = EDMA_RX_IMR_NORMAL_MASK; + sc->sc_config.tx_intr_mask = EDMA_TX_IMR_NORMAL_MASK; + sc->sc_state.misc_intr_mask = 0; + sc->sc_state.wol_intr_mask = 0; + sc->sc_state.intr_sw_idx_w = EDMA_INTR_SW_IDX_W_TYPE; + + /* + * Parse out the gmac count so we can start parsing out + * the gmac list and create us some ifnets. + */ + if (OF_getencprop(ofw_bus_get_node(dev), "qcom,num_gmac", + &sc->sc_config.num_gmac, sizeof(uint32_t)) > 0) { + device_printf(sc->sc_dev, "Creating %d GMACs\n", + sc->sc_config.num_gmac); + } else { + device_printf(sc->sc_dev, "Defaulting to 1 GMAC\n"); + sc->sc_config.num_gmac = 1; + } + if (sc->sc_config.num_gmac > QCOM_ESS_EDMA_MAX_NUM_GMACS) { + device_printf(sc->sc_dev, "Capping GMACs to %d\n", + QCOM_ESS_EDMA_MAX_NUM_GMACS); + sc->sc_config.num_gmac = QCOM_ESS_EDMA_MAX_NUM_GMACS; + } + + /* + * And now, create some gmac entries here; we'll create the + * ifnet's once this is all done. + */ + for (i = 0; i < sc->sc_config.num_gmac; i++) { + ret = qcom_ess_edma_gmac_parse(sc, i); + if (ret != 0) { + device_printf(sc->sc_dev, + "Failed to parse gmac%d\n", i); + goto error; + } + } + + /* allocate tx rings */ + for (i = 0; i < QCOM_ESS_EDMA_NUM_TX_RINGS; i++) { + char label[QCOM_ESS_EDMA_LABEL_SZ]; + int cpu_id; + + snprintf(label, QCOM_ESS_EDMA_LABEL_SZ - 1, "tx_ring%d", i); + if (qcom_ess_edma_desc_ring_setup(sc, &sc->sc_tx_ring[i], + label, + sc->sc_config.tx_ring_count, + sizeof(struct qcom_ess_edma_sw_desc_tx), + sizeof(struct qcom_ess_edma_tx_desc), + QCOM_ESS_EDMA_MAX_TXFRAGS, + ESS_EDMA_TX_BUFFER_ALIGN) != 0) + goto error; + if (qcom_ess_edma_tx_ring_setup(sc, &sc->sc_tx_ring[i]) != 0) + goto error; + + /* Same CPU as the interrupts for now */ + cpu_id = qcom_ess_edma_tx_queue_to_cpu(sc, i); + + if (qcom_ess_edma_setup_tx_state(sc, i, cpu_id) != 0) + goto error; + } + + /* allocate rx rings */ + for (i = 0; i < QCOM_ESS_EDMA_NUM_RX_RINGS; i++) { + char label[QCOM_ESS_EDMA_LABEL_SZ]; + int cpu_id; + + snprintf(label, QCOM_ESS_EDMA_LABEL_SZ - 1, "rx_ring%d", i); + if (qcom_ess_edma_desc_ring_setup(sc, &sc->sc_rx_ring[i], + label, + sc->sc_config.rx_ring_count, + sizeof(struct qcom_ess_edma_sw_desc_rx), + sizeof(struct qcom_ess_edma_rx_free_desc), + 1, + ESS_EDMA_RX_BUFFER_ALIGN) != 0) + goto error; + if (qcom_ess_edma_rx_ring_setup(sc, &sc->sc_rx_ring[i]) != 0) + goto error; + + /* Same CPU as the interrupts for now */ + cpu_id = qcom_ess_edma_rx_queue_to_cpu(sc, i); + + if (qcom_ess_edma_setup_rx_state(sc, i, cpu_id) != 0) + goto error; + } + + /* + * map the gmac instances <-> port masks, so incoming frames know + * where they need to be forwarded to. + */ + for (i = 0; i < QCOM_ESS_EDMA_MAX_NUM_PORTS; i++) + sc->sc_gmac_port_map[i] = -1; + for (i = 0; i < sc->sc_config.num_gmac; i++) { + ret = qcom_ess_edma_gmac_setup_port_mapping(sc, i); + if (ret != 0) { + device_printf(sc->sc_dev, + "Failed to setup port mpapping for gmac%d\n", i); + goto error; + } + } + + + /* Create ifnets */ + for (i = 0; i < sc->sc_config.num_gmac; i++) { + ret = qcom_ess_edma_gmac_create_ifnet(sc, i); + if (ret != 0) { + device_printf(sc->sc_dev, + "Failed to create ifnet for gmac%d\n", i); + goto error; + } + } + + /* + * NOTE: If there's no ess-switch / we're a single phy, we + * still need to reset the ess fabric to a fixed useful state. + * Otherwise we won't be able to pass packets to anything. + * + * Worry about this later. + */ + + EDMA_LOCK(sc); + + /* disable all interrupts */ + ret = qcom_ess_edma_hw_intr_disable(sc); + if (ret != 0) { + device_printf(sc->sc_dev, + "Failed to disable interrupts (%d)\n", + ret); + goto error_locked; + } + + /* reset edma */ + ret = qcom_ess_edma_hw_stop(sc); *** 3712 LINES SKIPPED *** From nobody Fri Feb 21 02:49:42 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzZNR4F4Rz5nqbl; Fri, 21 Feb 2025 02:49: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 4YzZNQ6FlWz3b0x; Fri, 21 Feb 2025 02:49:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740106182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXBBENxSTXkjDr878cHSVDPzFl2ibA3wQkpiKlM1rfU=; b=nYUwcfxkLjwHSHxDOVo+h3DgfVkUEOrp5/uEkUmqrKNfLT3VQUgHOxPteHHpblt5yBd7B3 48aB7AmimA+BrgY/Z4G/dM9Qkn05rAu0vyYhMznGwdNDqYmKYI3XGni1Cx6IGiRL5EQiql UawUes17tTfxh0TdHAh2MRcyiI1jl4oUU27PddiYLmst1DexMnGe5PMPNlrZMpDNjsaNp4 VpKNJbAufZWGkf0b1zG/NVFZAozHTbTu9HRLNKWXal65Smq91b9ipCm6yvw5EvstLCNsiw L0PH6z/xflNX65t/sdRyuJOkQWZjh92UgRLiTMFdZtDpIJhiUAC7Hl1JY81YBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740106182; a=rsa-sha256; cv=none; b=CKTgJAf/f6DMUxsWx+NiaxSOaMj99ZnHVfDPZLOb7j6/JLZYih2xPc/GFn4s33GpiNUUVr 5trXUPazwO8lZge0+jA70v1Ol/+tGJIn+n2c5vUElJnDOTXd8Fei02P2t7dv7sB+f/b37x vFgWnijrXsV2k1J27m+HO3aWt96u6eZYei1eyp1boVcPHpqZhG8S5tq4ziaEK9kXK10/dJ 0VOtx5pcd833zXZBt1txa3VV5uivElUhwcYZ8vJESLESz4jH67PYdUeXxtj648g7yaNM7F SIkmIFAvooTvTubdLSRzldv5zKeuXGtuF8QuAb7MdVEZ3tbwRp0JkZMFQgclIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740106182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXBBENxSTXkjDr878cHSVDPzFl2ibA3wQkpiKlM1rfU=; b=mqTv2NOml8a30mpw9VfEOf/gHNcXfHpyN+psLNbb5FbWSKkugawd/Kv2LjCMkf+kul4TwY OZAYxqzI4UC9EGWJijBeAAuhlSyZyx+UK7/mZ9lBW7CDTrO1metKaat76J6QkXE1hTPDcg 7SQQaBBu1nea79opeqLwmVBRPd1HJ1URERDuQGnJoS1kP/G6ZplwjNb5trIQ+zqSwLJHMX UDEp0MBe4KsYeAB//p2DeahW6o5jRWkhn2CLkLF7W3JPsJNQJts7Juhc+7tGVUDb1EIguU WiUzXMUJlWpMqPDPnfzGJznqqO9yJIlW6eEYSpeYbBE14nUDPPkMkZiQsi2BTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzZNQ590Mz1J1D; Fri, 21 Feb 2025 02:49: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 51L2ngLi062170; Fri, 21 Feb 2025 02:49:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L2ngHW062167; Fri, 21 Feb 2025 02:49:42 GMT (envelope-from git) Date: Fri, 21 Feb 2025 02:49:42 GMT Message-Id: <202502210249.51L2ngHW062167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: cf82a0d2b72f - main - ASUS_AC1300: add storage device options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf82a0d2b72ffa749a845d721033d27106f954f7 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=cf82a0d2b72ffa749a845d721033d27106f954f7 commit cf82a0d2b72ffa749a845d721033d27106f954f7 Author: Adrian Chadd AuthorDate: 2025-02-15 20:47:46 +0000 Commit: Adrian Chadd CommitDate: 2025-02-21 02:48:12 +0000 ASUS_AC1300: add storage device options This adds the required bits for the installed NAND/NOR chips. Differential Revision: https://reviews.freebsd.org/D49028 --- sys/arm/conf/ASUS_AC1300 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/arm/conf/ASUS_AC1300 b/sys/arm/conf/ASUS_AC1300 index 67ee0b541c2e..1730d389f988 100644 --- a/sys/arm/conf/ASUS_AC1300 +++ b/sys/arm/conf/ASUS_AC1300 @@ -49,4 +49,18 @@ device gpio device ether device mii device bpf +device vlan +options GEOM_UZIP +device xz + +# SPI NOR flash +device mx25l + +# SPI NAND flash +device w25n + +# USB storage +device scbus +device umass +device da From nobody Fri Feb 21 08:11:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX31fFDz5pMwp; Fri, 21 Feb 2025 08:11: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 4YzjX30nPbz3QNB; Fri, 21 Feb 2025 08:11:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FwgV9jkncXsj+swl8BU6GILug71TIWWjJFHRJdDp2mI=; b=JyzOszcUP/aCbMtNRXavJzy/p52+kfPGxAkCVmCG5zfqvGAN+OJdiDfC9/GRfnEYj3cNX/ Qhk1JxWyxcaktMJa6q8k8/9yLhsXjwW/x8yIFu+ZGiZ+U5gWFRsaDXtzKg9IaIj8pE0a1S Yuqlx5Ab+a1qTu5L5AumBF/RBi0cd6Kxg2Qpbqx5h7JmCYxMbO2O57972/JDIxRk9Pbpbd UhAVpjuq72xL4awlDVGUQ1fRxDs+3Ls4WVZbZNUNtnR6+QS6Em5f2zSFQj6I1izrzBvmzY Yl/hJ4BO2mR9iHjcwPrAjD+3MeUzeUowv2nrOnmQwcDxA9cqwxnNrKFgMCHbCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125507; a=rsa-sha256; cv=none; b=BNsyM/l1kTKtrDC5/wbTIOsgR94tqL01KZxIr37m7KkbAjZG7z1/cghQlGOWCh1x35Nx6e Br8KLzXeAteo1dBDL3Yu4edGkN1QidkGDqoBDiivu1HLwR2nruQw6LkJS7fV8G1I5NB6Mq jtQE6Yff2+YgAFk5Iuj/NZMsujY0PdsY0JbiMtYMgELTDEhdF1E084lo14pHC7ewaNyAak DFPj+/wPfG7KruFr8lNqHeMla2uld4xHJ9dACkFuFs8TJpeVjtPtcAcEQXhDuwTVEgLaOp uKDAdeR+nYvGxorzfEu5tHLB7BBuAZvqQlCT6F6vL/Bof5T1q/rr20Fw+LMgbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FwgV9jkncXsj+swl8BU6GILug71TIWWjJFHRJdDp2mI=; b=EVGOmPoPSoayp1ZEudxafhwbchlGVT0YnRcAHW68VBQSNd6Z0/hKF5TOZqmR32JFHi1ix0 RIMsYWnkL/+0KpMiFL3CaYUJcDiSlmDiTB7EVXlg1PKIw6OexImFI1PPXv6aECo2hWl0R3 I6vZj56W6LhvsJl/1BZlUTznc+HnLu1sj56MuzuZ1MjvyMifAnmxsLqW8/+ag7zdhlSPK3 0H7fgoUT1vLikEoEcQoAsr6GL1hhtOULxBsib8wJrajEnVilJJLkRkYDvU9EcA+VrAh3OO rDdiZIeOXadurRP/Bqe9LzzKpvmh995pPlOL4PYgsqoyIRqoxUKrbFE2GqkNKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX30L4nz1Rvj; Fri, 21 Feb 2025 08:11: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 51L8BkIl075897; Fri, 21 Feb 2025 08:11:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8Bkhe075894; Fri, 21 Feb 2025 08:11:46 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:46 GMT Message-Id: <202502210811.51L8Bkhe075894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8754ba5a5f6e - main - pfctl: Rewrite to void using union sockaddr_union List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8754ba5a5f6ee681de776601110313b69a779067 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8754ba5a5f6ee681de776601110313b69a779067 commit 8754ba5a5f6ee681de776601110313b69a779067 Author: Kristof Provost AuthorDate: 2025-02-13 17:30:12 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:02 +0000 pfctl: Rewrite to void using union sockaddr_union ok mikeb Obtained from: OpenBSD, deraadt , 8717211fe3 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl_table.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/sbin/pfctl/pfctl_table.c b/sbin/pfctl/pfctl_table.c index 7137f42b13e8..90e87adadb0f 100644 --- a/sbin/pfctl/pfctl_table.c +++ b/sbin/pfctl/pfctl_table.c @@ -36,9 +36,10 @@ #include #include +#include +#include #include #include -#include #include #include @@ -496,20 +497,24 @@ print_addrx(struct pfr_addr *ad, struct pfr_addr *rad, int dns) printf("\t nomatch"); if (dns && ad->pfra_net == hostnet) { char host[NI_MAXHOST]; - union sockaddr_union sa; + struct sockaddr_storage ss; strlcpy(host, "?", sizeof(host)); - bzero(&sa, sizeof(sa)); - sa.sa.sa_family = ad->pfra_af; - if (sa.sa.sa_family == AF_INET) { - sa.sa.sa_len = sizeof(sa.sin); - sa.sin.sin_addr = ad->pfra_ip4addr; + bzero(&ss, sizeof(ss)); + ss.ss_family = ad->pfra_af; + if (ss.ss_family == AF_INET) { + struct sockaddr_in *sin = (struct sockaddr_in *)&ss; + + sin->sin_len = sizeof(*sin); + sin->sin_addr = ad->pfra_ip4addr; } else { - sa.sa.sa_len = sizeof(sa.sin6); - sa.sin6.sin6_addr = ad->pfra_ip6addr; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&ss; + + sin6->sin6_len = sizeof(*sin6); + sin6->sin6_addr = ad->pfra_ip6addr; } - if (getnameinfo(&sa.sa, sa.sa.sa_len, host, sizeof(host), - NULL, 0, NI_NAMEREQD) == 0) + if (getnameinfo((struct sockaddr *)&ss, ss.ss_len, host, + sizeof(host), NULL, 0, NI_NAMEREQD) == 0) printf("\t(%s)", host); } printf("\n"); From nobody Fri Feb 21 08:11:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX42B5nz5pMSR; Fri, 21 Feb 2025 08:11: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 4YzjX41RpBz3QFf; Fri, 21 Feb 2025 08:11:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tYwH78Nugx3qqR0M+X6BGhI+XkBQyArQkVdfR1wB3Mo=; b=JatELM2jrhoZcMsaYqct7TBGebFJF4Q7ywz3PvbAQ3WNgwhNC8P+sIxloAhRtW/q+D2sqR cebosYi77SXrCiwrYnVVKFkxQ4iE6ets99FK9xYPe15rggpzqpVMzWwOGRAR0sJOyAGZIb GWztru6Fx4uwKaqMC7ONp1l7PnGkrlqgbBcqvrbOXsn9qApUEHZrKkWMY66ALaYBieTByT bTXqkJM2YTuPJlHKfK4BJyRkWz2jR9sPLwgTI12XwYtP6XVLZczHmvsC9NO5H9N19kVICw 7TWHJse/9GsdBRU+pjG0Lrto3VH0JitwSn/J6nTpUTgZlZGOyG/rpWD7l6OLIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125508; a=rsa-sha256; cv=none; b=OuRN89SPh0sKTMV4pDwrMXU3eBHBwEzsChS8q/em0SQwXFRpCRBlGGyRAjGRNcLBjrzvz0 GQpO4q3No8PrW4V7ICj4/7J0TzlXuMHFF2XFkxKQS4wM+Qu2QqLrE2kpSCC8eSzvdyqFOd hOiMgqUGjbwsTR/s8LEY8cMA3vcK43xlAeDtThK8ERjLUL7HpIbEP74BdWBgH6jqa/vbXX aSavQXUaf30Lm5fiG6L8You/VWlom2MAV+FeDYW6GI1BLAckCHCmiL2w41ONC/nivpLNQ4 8wl68a5XqgMikCGmuqoLnHWdNh0vqOe6G4B5tD/Q363QwfV0rlIu006Ln13LQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tYwH78Nugx3qqR0M+X6BGhI+XkBQyArQkVdfR1wB3Mo=; b=NyzlAnyG5u33PPXaceLtetnR/AHNPatwGj8l9SAvskN5gcqex3vQzNZr7RM5MYXpudhXz4 AcKclkIYUrTGFXM3LfL+gh0BnyAIyF4WSrweCnWt2EhHQfLiWF0lRgEIBNiUB50VKenlO8 rqg14DEYT7Q9oj17aPLyiNwKvWngv60dX1dHOtE00Gbtlwfs4GjAS7K3EUoCcPCZodJzOZ R/9p2FOXTpbOONkngqifJxnpdcnyr+z05q1B+Rv1oueYk2cPQ8V/1kAJPGfpt+jlbnTIJH T93nKihY9ZZpiQssRNLmj1HIL8s1k2hAL4Q1Qco7+abpqrNYVVTPgpJpQ9F4xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX40qLyz1SC5; Fri, 21 Feb 2025 08:11: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 51L8BmP9076749; Fri, 21 Feb 2025 08:11:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8Bm6A076720; Fri, 21 Feb 2025 08:11:48 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:48 GMT Message-Id: <202502210811.51L8Bm6A076720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 1ba1e152f888 - main - pf: make log(matches) more useful List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ba1e152f8889865e58df6c64d1e595f81f0babc Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1ba1e152f8889865e58df6c64d1e595f81f0babc commit 1ba1e152f8889865e58df6c64d1e595f81f0babc Author: Kristof Provost AuthorDate: 2025-02-14 10:06:26 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:03 +0000 pf: make log(matches) more useful change log(matches) semantics slightly to make it more useful. since it is a debug tool change of semantics not considered problematic. up until now, log(matches) forced logging on subsequent matching rules, the actual logging used the log settings from that matched rule. now, log(matches) causes subsequent matches to be logged with the log settings from the log(matches) rule. in particular (this was the driving point), log(matches, to pflog23) allows you to have the trace log going to a seperate pflog interface, not clobbering your regular pflogs, actually not affecting them at all. long conversation with bluhm about it, which didn't lead to a single bit changed in the diff but was very very helpful. ok bluhm as well. Obtained from: OpenBSD, henning , f61b1efcce Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/if_pflog.h | 4 ++-- sys/net/pfvar.h | 2 +- sys/netpfil/pf/if_pflog.c | 11 +++++++---- sys/netpfil/pf/pf.c | 41 ++++++++++++++++++++++++++++++----------- sys/netpfil/pf/pf_norm.c | 6 +++--- 5 files changed, 43 insertions(+), 21 deletions(-) diff --git a/sys/net/if_pflog.h b/sys/net/if_pflog.h index dc22c05cdea0..906f700b54e3 100644 --- a/sys/net/if_pflog.h +++ b/sys/net/if_pflog.h @@ -69,9 +69,9 @@ struct pf_ruleset; struct pfi_kif; struct pf_pdesc; -#define PFLOG_PACKET(b,t,c,d,e,f,g) do { \ +#define PFLOG_PACKET(b,t,c,d,e,f,g,h) do { \ if (pflog_packet_ptr != NULL) \ - pflog_packet_ptr(b,t,c,d,e,f,g); \ + pflog_packet_ptr(b,t,c,d,e,f,g,h); \ } while (0) #endif /* _KERNEL */ #endif /* _NET_IF_PFLOG_H_ */ diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 0295bcc125f8..b481f767725d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1277,7 +1277,7 @@ struct pf_kruleset; struct pf_pdesc; typedef int pflog_packet_t(uint8_t, u_int8_t, struct pf_krule *, struct pf_krule *, struct pf_kruleset *, - struct pf_pdesc *, int); + struct pf_pdesc *, int, struct pf_krule *); extern pflog_packet_t *pflog_packet_ptr; #endif /* _KERNEL */ diff --git a/sys/netpfil/pf/if_pflog.c b/sys/netpfil/pf/if_pflog.c index 016ff96b02b4..6a87ea2471cb 100644 --- a/sys/netpfil/pf/if_pflog.c +++ b/sys/netpfil/pf/if_pflog.c @@ -243,18 +243,21 @@ pflogioctl(struct ifnet *ifp, u_long cmd, caddr_t data) static int pflog_packet(uint8_t action, u_int8_t reason, struct pf_krule *rm, struct pf_krule *am, - struct pf_kruleset *ruleset, struct pf_pdesc *pd, int lookupsafe) + struct pf_kruleset *ruleset, struct pf_pdesc *pd, int lookupsafe, + struct pf_krule *trigger) { struct ifnet *ifn; struct pfloghdr hdr; if (rm == NULL || pd == NULL) return (1); + if (trigger == NULL) + trigger = rm; - if (rm->logif > V_npflogifs) + if (trigger->logif > V_npflogifs) return (0); - ifn = V_pflogifs[rm->logif]; + ifn = V_pflogifs[trigger->logif]; if (ifn == NULL || !bpf_peers_present(ifn->if_bpf)) return (0); @@ -281,7 +284,7 @@ pflog_packet(uint8_t action, u_int8_t reason, * state lock, since this leads to unsafe LOR. * These conditions are very very rare, however. */ - if (rm->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done && lookupsafe) + if (trigger->log & PF_LOG_SOCKET_LOOKUP && !pd->lookup.done && lookupsafe) pd->lookup.done = pf_socket_lookup(pd); if (pd->lookup.done > 0) hdr.uid = pd->lookup.uid; diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e8b7a071a3c9..153fd11f1d2c 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -386,6 +386,9 @@ static int pf_match_rcvif(struct mbuf *, struct pf_krule *); static void pf_counters_inc(int, struct pf_pdesc *, struct pf_kstate *, struct pf_krule *, struct pf_krule *); +static void pf_log_matches(struct pf_pdesc *, struct pf_krule *, + struct pf_krule *, struct pf_kruleset *, + struct pf_krule_slist *); static void pf_overload_task(void *v, int pending); static u_short pf_insert_src_node(struct pf_ksrc_node *[PF_SN_MAX], struct pf_srchash *[PF_SN_MAX], struct pf_krule *, @@ -5535,7 +5538,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, if (nr->log) { PFLOG_PACKET(nr->action, PFRES_MATCH, nr, a, - ruleset, pd, 1); + ruleset, pd, 1, NULL); } if (pd->ip_sum) @@ -5826,18 +5829,17 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, goto cleanup; } } - if (r->log || pd->act.log & PF_LOG_MATCHES) + if (r->log) PFLOG_PACKET(r->action, PFRES_MATCH, r, - a, ruleset, pd, 1); + a, ruleset, pd, 1, NULL); } else { match = asd; *rm = r; *am = a; *rsm = ruleset; - if (pd->act.log & PF_LOG_MATCHES) - PFLOG_PACKET(r->action, PFRES_MATCH, r, - a, ruleset, pd, 1); } + if (pd->act.log & PF_LOG_MATCHES) + pf_log_matches(pd, r, a, ruleset, &match_rules); if (r->quick) break; r = TAILQ_NEXT(r, entries); @@ -5866,12 +5868,13 @@ nextrule: } } - if (r->log || pd->act.log & PF_LOG_MATCHES) { + if (r->log) { if (rewrite) m_copyback(pd->m, pd->off, pd->hdrlen, pd->hdr.any); - PFLOG_PACKET(r->action, reason, r, a, ruleset, pd, 1); + PFLOG_PACKET(r->action, reason, r, a, ruleset, pd, 1, NULL); } - + if (pd->act.log & PF_LOG_MATCHES) + pf_log_matches(pd, r, a, ruleset, &match_rules); if (pd->virtual_proto != PF_VPROTO_FRAGMENT && (r->action == PF_DROP) && ((r->rule_flag & PFRULE_RETURNRST) || @@ -10092,6 +10095,22 @@ pf_counters_inc(int action, struct pf_pdesc *pd, } pf_counter_u64_critical_exit(); } +static void +pf_log_matches(struct pf_pdesc *pd, struct pf_krule *rm, + struct pf_krule *am, struct pf_kruleset *ruleset, + struct pf_krule_slist *matchrules) +{ + struct pf_krule_item *ri; + + /* if this is the log(matches) rule, packet has been logged already */ + if (rm->log & PF_LOG_MATCHES) + return; + + SLIST_FOREACH(ri, matchrules, entry) + if (ri->r->log & PF_LOG_MATCHES) + PFLOG_PACKET(rm->action, PFRES_MATCH, rm, am, + ruleset, pd, 1, ri->r); +} #if defined(INET) || defined(INET6) int @@ -10495,12 +10514,12 @@ done: if (pd.act.log & PF_LOG_FORCE || lr->log & PF_LOG_ALL) PFLOG_PACKET(action, reason, lr, a, - ruleset, &pd, (s == NULL)); + ruleset, &pd, (s == NULL), NULL); if (s) { SLIST_FOREACH(ri, &s->match_rules, entry) if (ri->r->log & PF_LOG_ALL) PFLOG_PACKET(action, - reason, ri->r, a, ruleset, &pd, 0); + reason, ri->r, a, ruleset, &pd, 0, NULL); } } diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 57b9549df5e0..ac74434cf2b7 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -1217,7 +1217,7 @@ pf_normalize_ip(u_short *reason, struct pf_pdesc *pd) REASON_SET(reason, PFRES_FRAG); drop: if (r != NULL && r->log) - PFLOG_PACKET(PF_DROP, *reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(PF_DROP, *reason, r, NULL, NULL, pd, 1, NULL); return (PF_DROP); } @@ -1421,7 +1421,7 @@ pf_normalize_tcp(struct pf_pdesc *pd) tcp_drop: REASON_SET(&reason, PFRES_NORM); if (rm != NULL && r->log) - PFLOG_PACKET(PF_DROP, reason, r, NULL, NULL, pd, 1); + PFLOG_PACKET(PF_DROP, reason, r, NULL, NULL, pd, 1, NULL); return (PF_DROP); } @@ -2185,7 +2185,7 @@ sctp_drop: REASON_SET(&reason, PFRES_NORM); if (rm != NULL && r->log) PFLOG_PACKET(PF_DROP, reason, r, NULL, NULL, pd, - 1); + 1, NULL); return (PF_DROP); } From nobody Fri Feb 21 08:11:50 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX6623Qz5pMhP; Fri, 21 Feb 2025 08:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzjX63GKFz3QZ9; Fri, 21 Feb 2025 08:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ty68XxpcgadAijqfPj8G/+TLpyB2PZyfqDdTQtyZphs=; b=pDKwj+sOWDD1Ehz8972MEkhYEIBO+a6u8DWN1OLigOJNPhmN/EP9AI5OPsNdGi2HViHKrM 3y8RasrC+S48vwCwbBt6NrhNaShyu8IIYRIHKw/5Aco5LbAVG8XdzibU6stWYBDevG2aDu KJKuvaswR5QG6yRTYM7rJw1aX6M5Usjvwd5NUm+Nnp220Nfx/TMNgrDO1OMsJ6bX5i16Bs jr1p/gwMu7f69mrgW8uWUauo6/qONYi9P7A7SvGoaPGX9R80bq2pdn+nCEpEBFqEHibOS+ NrA0InbjtWcu76vaa69CqWcVgO8l3tBPdoyUZnONRBDv7ECAxYvNieGMJMGzAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125510; a=rsa-sha256; cv=none; b=PPuRM5UiS4fC5f5AEbEMB17fbhce6Z8AtXPH7mHbJJ6aU3nlzpu0p6DWgjlA5PD02AjE53 JUpGEpEZ09y8d2sDRYGrfaKAoa5sKU243t03wSpbEelNhPug2vxlDk1s1bsBpRlS1DVEuO MWK5CAxw+mlw1eZWV4xv4ZeV7jfMANGx6bPLTBSOPg7gvyowhiabr3tRTt/6b2fWndAMdC 8Vvisi+HcyiGeV9DrLbz0xsdSMzf3xiPO6cCOlZswLjwwrzRwZ+OuS+8mcIoc9kigPYyXp uurY8LvtqRJ+2bl/GEyZ/jpqGbZBnh44Es9L08dSH9Zbdz2vWupe/xDab9MsyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ty68XxpcgadAijqfPj8G/+TLpyB2PZyfqDdTQtyZphs=; b=imb43jgR6Z1jMSZzTGkoLP9+saODLLVqTqtl4Rox0S4cyxL0i4CPkxDEGz24YVovx2VQyd NHj4tI/6Mm/zhnbLEVLbSZk18A5iQPhnqcsZaTdC7uwgtukvugdz8idTruvaHy4hohuYMO X0sy2PQuP3ql8Eh8cCpU5luSrt/CYyIN0gMgA86YkWjA6rUHWAKM2bPEl2BInbWE7P14Ng EnpvwQ4GoOj6n5Cmq8uXBd51w1s4V9lxt3ExWmj/5OhLTMnZU0zPixjJ6WgaQ43XrNyUH9 cXKzcBW/YtxvITfZDsH4jI9pWC9frneaHyFtrqLV9h8iWj3PlcTC/mJQ1XXauA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX62lyDz1SFX; Fri, 21 Feb 2025 08:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51L8Bocb076947; Fri, 21 Feb 2025 08:11:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8Boqq076944; Fri, 21 Feb 2025 08:11:50 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:50 GMT Message-Id: <202502210811.51L8Boqq076944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 921c9c7bcc35 - main - pf tests: test new log(matches) behaviour List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 921c9c7bcc35747d61a9200c38da13c5fbce3643 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=921c9c7bcc35747d61a9200c38da13c5fbce3643 commit 921c9c7bcc35747d61a9200c38da13c5fbce3643 Author: Kristof Provost AuthorDate: 2025-02-14 13:55:30 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:03 +0000 pf tests: test new log(matches) behaviour Ensure that a log(matches, to pflog1) sends all future matches to pflog1. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/pflog.sh | 61 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/pflog.sh b/tests/sys/netpfil/pf/pflog.sh index d885364e0df7..a315b88bd4c0 100644 --- a/tests/sys/netpfil/pf/pflog.sh +++ b/tests/sys/netpfil/pf/pflog.sh @@ -133,6 +133,64 @@ matches_cleanup() pft_cleanup } +atf_test_case "matches_logif" "cleanup" +matches_logif_head() +{ + atf_set descr 'Test log(matches, to pflogX)' + atf_set require.user root +} + +matches_logif_body() +{ + pflog_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}a + jexec alcatraz ifconfig ${epair}a 192.0.2.1/24 up + + ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + jexec alcatraz ifconfig pflog0 up + jexec alcatraz ifconfig pflog1 create + jexec alcatraz ifconfig pflog1 up + pft_set_rules alcatraz \ + "match log(matches, to pflog1) inet proto icmp" \ + "match log inet from 192.0.2.2" \ + "pass log(to pflog0)" + + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog1 >> ${PWD}/pflog1.txt & + jexec alcatraz tcpdump -n -e -ttt --immediate-mode -l -U -i pflog0 >> ${PWD}/pflog0.txt & + sleep 1 # Wait for tcpdump to start + + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + echo "Rules" + jexec alcatraz pfctl -sr -vv + echo "States" + jexec alcatraz pfctl -ss -vv + echo "Log 0" + cat ${PWD}/pflog0.txt + echo "Log 1" + cat ${PWD}/pflog1.txt + + atf_check -o match:".*rule 0/0\(match\): match in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog1.txt + atf_check -o match:".*rule 1/0\(match\): match in on ${epair}a: 192.0.2.2 > 192.0.2.1: ICMP echo request.*" \ + cat pflog1.txt +} + +matches_logif_cleanup() +{ + pft_cleanup +} + atf_test_case "state_max" "cleanup" state_max_head() { @@ -326,8 +384,9 @@ atf_init_test_cases() { atf_add_test_case "malformed" atf_add_test_case "matches" - atf_add_test_case "rdr_action" + atf_add_test_case "matches_logif" atf_add_test_case "state_max" atf_add_test_case "unspecified_v4" atf_add_test_case "unspecified_v6" + atf_add_test_case "rdr_action" } From nobody Fri Feb 21 08:11:49 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX60j2xz5pMVy; Fri, 21 Feb 2025 08:11:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzjX54cbkz3QG1; Fri, 21 Feb 2025 08:11:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkKcjs4BQ7HVsaTZ391UR4/uiYGH6NxA1LwvF0p/5dw=; b=Zplrha7EbK/m2ejQqpECrU7ieH14oHfZc5vXE+V8nek3lX0hunxiRlPdD8fOaufKLnNEge rY83nUoYq4lwigqNQ24BgOklp2fz0pb9+8aEHxnaGKzZ1nnyvylvtClHT4/1c7fEt+LrOW aos2bEsqshjfSx9x6EMtvPK+oCR0JQfTO+QaPNsjzADgZI/VXuPdCi6uhuS4SqHy7sYDer jvrzbkq6TxEozcOQE6Jb3oD7uVJC0z+2UxRpK+3j4ztA8waCEakowx2+YWjsYI16lC6k4Z xE1/9bsWtMeELcDKezWdenc+A0HOnPjT1rnjKo0XakgDysVPrAV0feE//gkAQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125509; a=rsa-sha256; cv=none; b=v8myfKjAeh3RVgdHIAFdIlE+H1Hs9HnXVVCbBy+S/GaXFP5+Ijp7Prz6U8kovjabB3Mg3d LbTYTTxJiKlC40mCVl7vuFd9IOHJIMtVXulC2iOM0u+hjoPJFTM3crUO90Huq/UqTGpWvy VE9ox5vIbBM/k1uGBLP+eQ5NSCtdgAGdcnkpGANHbUpjQzXROrOMmg1EcuZsc3MRtxFbAG FdIZOWyoiF/qOqb6OHGq+kei31PLYUg+d6aR9D3UH2rn5y57qYkJtHe3DhRK+XCCsrsuis vcRvGtexxjQ5XULw4E2qa2s6/EkcRl6a/0Orkc6vOYHxUh5O6Lm4mdJLyUghFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wkKcjs4BQ7HVsaTZ391UR4/uiYGH6NxA1LwvF0p/5dw=; b=fAppuU6j6hCFmb8hw2VKK8iyRUBJcf0+IAUWpWdXCrSbDZonL0+wlozad1RsozW7HGXDcp 5G/NB3cCTZHXYyziLOowofycBZ7GF8awp1WWsJl/8F42UegNlP/vXlq9t1V5/at5DROXfG M6HGwzTtIz0KEM5Ai5AlQVeKTYwoUrKosEqF/W7rEt6ZVIOYMoahY/gMEw4VylLAtKzkeR DE/D+vaL+QexKiKmCKHMgCTHlo4YcuVHEGNzPY5v+HITYR7LlsIB8yBygRnm1Qaf6Sk2xJ 9oCJg+iVwe0SDfADpsiEFKHnCK+BIc/OwOC0u5EuaM2w4IhZNObyDxFnCvQlBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX526yCz1SC7; Fri, 21 Feb 2025 08:11: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 51L8BnaW076912; Fri, 21 Feb 2025 08:11:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8BnPZ076909; Fri, 21 Feb 2025 08:11:49 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:49 GMT Message-Id: <202502210811.51L8BnPZ076909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 71cf41071a9c - main - pf.conf.5: a shot at documenting the changed log(matches) semantics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71cf41071a9c3eca0a57e5daff64d274fd3ed04e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=71cf41071a9c3eca0a57e5daff64d274fd3ed04e commit 71cf41071a9c3eca0a57e5daff64d274fd3ed04e Author: Kristof Provost AuthorDate: 2025-02-14 10:12:34 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:03 +0000 pf.conf.5: a shot at documenting the changed log(matches) semantics Obtained from: OpenBSD, henning , eb4e49a617 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 1192cd3d02e8..e96ba094be27 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -27,7 +27,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 13, 2025 +.Dd February 14, 2025 .Dt PF.CONF 5 .Os .Sh NAME @@ -1738,7 +1738,9 @@ As with packets are logged to .Xr pflog 4 . .It Ar log (matches) -Used to force logging of this packet on all subsequent matching rules. +Log this packet on all subsequent matching rules, using the log settings +given here, in particular to the pflog interface specified here so that +regular pflogs are not clobbered. .It Ar log (user) Logs the .Ux From nobody Fri Feb 21 08:11:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX80LBYz5pMhS; Fri, 21 Feb 2025 08:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzjX748vzz3QZQ; Fri, 21 Feb 2025 08:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0B7hojLiubMvPn2jBeKXSsxf/duESvhXpQincewUh4=; b=gwBOiAkbd493r2UxI+QJ49zetD4pM5tKqjZLOSuWESUlXrZuCQBSR+nuTq+ubXLse/Vicr co+9HIJeP7g2HPjRL2lC9OFKwu5tuHfZJmtWWzIDKImTO4tXQtUKx9BljWGAnOvJ0L1NyV eotVdRvcfypxxJ4HpOdEZmjbVgWeOKvS9fdIyXKGOTctl4fcSnSTUPjRcyUwWzRTzRBFs3 Ebc8RwDlAl/L/njwArbQ2Xv2L5VH7oANR0csrUVmFgJz0s78V0ZfmYSh+QQ9Qw+vZ+egWE BctS3qFGb5uhaJdSrstXGYnYrzHvlV72Rdo5kGhVUT63jI4aVbwSPSw06LQOZg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125511; a=rsa-sha256; cv=none; b=twpu9d0N0QFUTqZs0LTWOwsfQHFWNcAtjECw/BR9Ol8BADjD8n63G5M9w5P+AE14b2C6/o wCLzuw1kpe6dl1KA1qhyvenmUAPTbcti8xyFSF4B2gzN4lX6RfM0JwF9vFFJq7vVeeCvrv 6+sTWcA7llw014JwUjCwvU7G/g+Yc1JzskacGTMtm6mmckDH8JwB85LF7Dj6gLQ1KlBbNF haLVdNfOoR96TiAZrXlHU9ThOlfC3nN+4+bQWU19yTG+IthXm1GocHTdd0LMPMph00z8HY LDYxxggykG3fsn6LiD4OVLnAE91R4Ynr9ep7TpSiZqHqZNj9pM4nfWF3riOR+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=1740125511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=f0B7hojLiubMvPn2jBeKXSsxf/duESvhXpQincewUh4=; b=ptjVEgA73yb1INN3Lvefbe3jhnYesqKUvcXQG+nLgpMSZ9uPJbIVf0FaausegZfhVgigGQ NMwKz8a27qbud7fjqlAKcUXXDX4zxl0IGz+mZK63wre1EXu3lGz3LGVm9HQqKKds2UrLAp rsyBXcsdYb0YZsCRBoIrsPGJxqjXa/SITpDjr3iekS74mgxid+6w1Be6GBsfraQOnvQLcb NUkKuUPsJ70MVGqsj5fsLx7N/TNGmuqUzxRCCW+mNZ3N8gdWQwtgA0VSb62j8C1K/uIYCg zAwdBq4ZZgmSCtBk7vXkgux2IJx/f4TK332eNw/9lXyhnBJaonRtHoydp8uumQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX73j7hz1SC9; Fri, 21 Feb 2025 08:11:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51L8Bps1076982; Fri, 21 Feb 2025 08:11:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8BpSO076979; Fri, 21 Feb 2025 08:11:51 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:51 GMT Message-Id: <202502210811.51L8BpSO076979@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 83f9b68fde27 - main - pf.conf.5: Don't use greater-equal/less-equal symbols where "<="/">=" are intended. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 83f9b68fde27a0e136f447ca03ba3953f5730503 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=83f9b68fde27a0e136f447ca03ba3953f5730503 commit 83f9b68fde27a0e136f447ca03ba3953f5730503 Author: Kristof Provost AuthorDate: 2025-02-14 14:50:43 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:03 +0000 pf.conf.5: Don't use greater-equal/less-equal symbols where "<="/">=" are intended. Also, clean up some usage of predefined strings (which are discouraged by mandoc_char(7) for portability reasons) and improve spacing in hostapd.conf(5). ok schwarze@ Obtained from: OpenBSD, bentley , e369c2e695 Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 98 ++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index e96ba094be27..478ce7b956f9 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -195,9 +195,9 @@ Note that this feature carries significant memory overhead for large tables. .Pp For example, .Bd -literal -offset indent -table \*(Ltprivate\*(Gt const { 10/8, 172.16/12, 192.168/16 } -table \*(Ltbadhosts\*(Gt persist -block on fxp0 from { \*(Ltprivate\*(Gt, \*(Ltbadhosts\*(Gt } to any +table const { 10/8, 172.16/12, 192.168/16 } +table persist +block on fxp0 from { , } to any .Ed .Pp creates a table called private, to hold RFC 1918 private network @@ -215,8 +215,8 @@ these hosts can be blocked by using A table can also be initialized with an address list specified in one or more external files, using the following syntax: .Bd -literal -offset indent -table \*(Ltspam\*(Gt persist file \&"/etc/spammers\&" file \&"/etc/openrelays\&" -block on fxp0 from \*(Ltspam\*(Gt to any +table persist file \&"/etc/spammers\&" file \&"/etc/openrelays\&" +block on fxp0 from to any .Ed .Pp The files @@ -1440,9 +1440,9 @@ The packet is redirected to another destination and possibly a different port. .Ar rdr rules can optionally specify port ranges instead of single ports. -rdr ... port 2000:2999 -\*(Gt ... port 4000 +rdr ... port 2000:2999 -> ... port 4000 redirects ports 2000 to 2999 (inclusive) to port 4000. -rdr ... port 2000:2999 -\*(Gt ... port 4000:* +rdr ... port 2000:2999 -> ... port 4000:* redirects port 2000 to 4000, 2001 to 4001, ..., 2999 to 4999. .El .Pp @@ -1505,7 +1505,7 @@ or to the firewall itself. Note that redirecting external incoming connections to the loopback address, as in .Bd -literal -offset indent -rdr on ne3 inet proto tcp to port smtp -\*(Gt 127.0.0.1 port spamd +rdr on ne3 inet proto tcp to port smtp -> 127.0.0.1 port spamd .Ed .Pp will effectively allow an external host to connect to daemons @@ -1875,17 +1875,17 @@ Ports and ranges of ports are specified by using these operators: .Bd -literal -offset indent = (equal) != (unequal) -\*(Lt (less than) +< (less than) <= (less than or equal) -\*(Gt (greater than) +> (greater than) >= (greater than or equal) : (range including boundaries) -\*(Gt\*(Lt (range excluding boundaries) -\*(Lt\*(Gt (except range) +>< (range excluding boundaries) +<> (except range) .Ed .Pp -.Sq \*(Gt\*(Lt , -.Sq \*(Lt\*(Gt +.Sq >< , +.Sq <> and .Sq \&: are binary operators (they take two arguments). @@ -1893,15 +1893,15 @@ For instance: .Bl -tag -width Fl .It Ar port 2000:2004 means -.Sq all ports \*(Ge 2000 and \*(Le 2004 , +.Sq all ports >= 2000 and <= 2004 , hence ports 2000, 2001, 2002, 2003 and 2004. -.It Ar port 2000 \*(Gt\*(Lt 2004 +.It Ar port 2000 >< 2004 means -.Sq all ports \*(Gt 2000 and \*(Lt 2004 , +.Sq all ports > 2000 and < 2004 , hence ports 2001, 2002 and 2003. -.It Ar port 2000 \*(Lt\*(Gt 2004 +.It Ar port 2000 <> 2004 means -.Sq all ports \*(Lt 2000 or \*(Gt 2004 , +.Sq all ports < 2000 or > 2004 , hence ports 1-1999 and 2005-65535. .El .Pp @@ -1917,7 +1917,7 @@ The host, port and OS specifications are optional, as in the following examples: .Bd -literal -offset indent pass in all pass in from any to any -pass in proto tcp from any port \*(Lt 1024 to any +pass in proto tcp from any port < 1024 to any pass in proto tcp from any to any port 25 pass in proto tcp from 10.0.0.0/8 port >= 1024 \e to ! 10.1.2.3 port != ssh @@ -1978,7 +1978,7 @@ The following example allows only selected users to open outgoing connections: .Bd -literal -offset indent block out proto { tcp, udp } all -pass out proto { tcp, udp } all user { \*(Lt 1000, dhartmei } +pass out proto { tcp, udp } all user { < 1000, dhartmei } .Ed .It Xo Ar flags Aq Ar a .Pf / Ns Aq Ar b @@ -2132,15 +2132,15 @@ For example: .Bd -literal -offset indent ips = \&"{ 1.2.3.4, 1.2.3.5 }\&" pass in proto tcp from any to $ips \e - port \*(Gt 1023 label \&"$dstaddr:$dstport\&" + port > 1023 label \&"$dstaddr:$dstport\&" .Ed .Pp expands to .Bd -literal -offset indent pass in inet proto tcp from any to 1.2.3.4 \e - port \*(Gt 1023 label \&"1.2.3.4:\*(Gt1023\&" + port > 1023 label \&"1.2.3.4:>1023\&" pass in inet proto tcp from any to 1.2.3.5 \e - port \*(Gt 1023 label \&"1.2.3.5:\*(Gt1023\&" + port > 1023 label \&"1.2.3.5:>1023\&" .Ed .Pp The macro expansion for the @@ -2615,9 +2615,9 @@ table and have all states originating from it flushed. Any new packets arriving from this host will be dropped unconditionally by the block rule. .Bd -literal -offset indent -block quick from \*(Ltbad_hosts\*(Gt +block quick from pass in on $ext_if proto tcp to $webserver port www keep state \e - (max-src-conn-rate 100/10, overload \*(Ltbad_hosts\*(Gt flush global) + (max-src-conn-rate 100/10, overload flush global) .Ed .Sh OPERATING SYSTEM FINGERPRINTING Passive OS Fingerprinting is a mechanism to inspect nuances of a TCP @@ -3048,7 +3048,7 @@ and therefore lacks permission to bind to port 80). ext_if = \&"ne3\&" # map daemon on 8080 to appear to be on 80 -rdr on $ext_if proto tcp from any to any port 80 -\*(Gt 127.0.0.1 port 8080 +rdr on $ext_if proto tcp from any to any port 80 -> 127.0.0.1 port 8080 .Ed .Pp If the @@ -3056,7 +3056,7 @@ If the modifier is given, packets matching the translation rule are passed without inspecting the filter rules: .Bd -literal -rdr pass on $ext_if proto tcp from any to any port 80 -\*(Gt 127.0.0.1 \e +rdr pass on $ext_if proto tcp from any to any port 80 -> 127.0.0.1 \e port 8080 .Ed .Pp @@ -3069,7 +3069,7 @@ network appear as though it is the Internet routable address for the nodes on vlan12. (Thus, 192.168.168.1 can talk to the 192.168.168.0/24 nodes.) .Bd -literal -nat on ! vlan12 from 192.168.168.0/24 to any -\*(Gt 204.92.77.111 +nat on ! vlan12 from 192.168.168.0/24 to any -> 204.92.77.111 .Ed .Pp In the example below, the machine sits between a fake internal 144.19.74.* @@ -3080,7 +3080,7 @@ rule excludes protocol AH from being translated. .Bd -literal # NO NAT no nat on $ext_if proto ah from 144.19.74.0/24 to any -nat on $ext_if from 144.19.74.0/24 to any -\*(Gt 204.92.77.100 +nat on $ext_if from 144.19.74.0/24 to any -> 204.92.77.100 .Ed .Pp In the example below, packets bound for one specific server, as well as those @@ -3089,7 +3089,7 @@ generated by the sysadmins are not proxied; all other connections are. # NO RDR no rdr on $int_if proto { tcp, udp } from any to $server port 80 no rdr on $int_if proto { tcp, udp } from $sysadmins to any port 80 -rdr on $int_if proto { tcp, udp } from any to any port 80 -\*(Gt 127.0.0.1 \e +rdr on $int_if proto { tcp, udp } from any to any port 80 -> 127.0.0.1 \e port 80 .Ed .Pp @@ -3107,20 +3107,20 @@ manpage. # NAT # Translate outgoing packets' source addresses (any protocol). # In this case, any address but the gateway's external address is mapped. -nat on $ext_if inet from ! ($ext_if) to any -\*(Gt ($ext_if) +nat on $ext_if inet from ! ($ext_if) to any -> ($ext_if) # NAT PROXYING # Map outgoing packets' source port to an assigned proxy port instead of # an arbitrary port. # In this case, proxy outgoing isakmp with port 500 on the gateway. -nat on $ext_if inet proto udp from any port = isakmp to any -\*(Gt ($ext_if) \e +nat on $ext_if inet proto udp from any port = isakmp to any -> ($ext_if) \e port 500 # BINAT # Translate outgoing packets' source address (any protocol). # Translate incoming packets' destination address to an internal machine # (bidirectional). -binat on $ext_if from 10.1.2.150 to any -\*(Gt $ext_if +binat on $ext_if from 10.1.2.150 to any -> $ext_if # Translate packets arriving on $peer_if addressed to 172.22.16.0/20 # to the corresponding address in 172.21.16.0/20 (bidirectional). @@ -3130,14 +3130,14 @@ binat on $peer_if from 172.21.16.0/20 to any -> 172.22.16.0/20 # Translate incoming packets' destination addresses. # As an example, redirect a TCP and UDP port to an internal machine. rdr on $ext_if inet proto tcp from any to ($ext_if) port 8080 \e - -\*(Gt 10.1.2.151 port 22 + -> 10.1.2.151 port 22 rdr on $ext_if inet proto udp from any to ($ext_if) port 8080 \e - -\*(Gt 10.1.2.151 port 53 + -> 10.1.2.151 port 53 # RDR # Translate outgoing ftp control connections to send them to localhost # for proxying with ftp-proxy(8) running on port 8021. -rdr on $int_if proto tcp from any to any port 21 -\*(Gt 127.0.0.1 port 8021 +rdr on $int_if proto tcp from any to any port 21 -> 127.0.0.1 port 8021 .Ed .Pp In this example, a NAT gateway is set up to translate internal addresses @@ -3149,13 +3149,13 @@ network. # Translate outgoing packets' source addresses using an address pool. # A given source address is always translated to the same pool address by # using the source-hash keyword. -nat on $ext_if inet from any to any -\*(Gt 192.0.2.16/28 source-hash +nat on $ext_if inet from any to any -> 192.0.2.16/28 source-hash # RDR ROUND ROBIN # Translate incoming web server connections to a group of web servers on # the internal network. rdr on $ext_if proto tcp from any to any port 80 \e - -\*(Gt { 10.1.2.155, 10.1.2.160, 10.1.2.161 } round-robin + -> { 10.1.2.155, 10.1.2.160, 10.1.2.161 } round-robin .Ed .Sh FILTER EXAMPLES .Bd -literal @@ -3248,8 +3248,8 @@ pass out on $ext_if proto tcp from any to any port 80 # tag incoming packets as they are redirected to spamd(8). use the tag # to pass those packets through the packet filter. -rdr on $ext_if inet proto tcp from \*(Ltspammers\*(Gt to port smtp \e - tag SPAMD -\*(Gt 127.0.0.1 port spamd +rdr on $ext_if inet proto tcp from to port smtp \e + tag SPAMD -> 127.0.0.1 port spamd block in on $ext_if pass in on $ext_if inet proto tcp tagged SPAMD @@ -3332,7 +3332,7 @@ filteropt = user | group | flags | icmp-type | icmp6-type | "tos" tos | nat-rule = [ "no" ] "nat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] [ protospec ] hosts [ "tag" string ] [ "tagged" string ] - [ "-\*(Gt" ( redirhost | "{" redirhost-list "}" ) + [ "->" ( redirhost | "{" redirhost-list "}" ) [ portspec ] [ pooltype ] [ "static-port" ] [ "map-e-portset" number "/" number "/" number ] ] @@ -3341,19 +3341,19 @@ binat-rule = [ "no" ] "binat" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "proto" ( proto-name | proto-number ) ] "from" address [ "/" mask-bits ] "to" ipspec [ "tag" string ] [ "tagged" string ] - [ "-\*(Gt" address [ "/" mask-bits ] ] + [ "->" address [ "/" mask-bits ] ] rdr-rule = [ "no" ] "rdr" [ "pass" [ "log" [ "(" logopts ")" ] ] ] [ "on" ifspec ] [ af ] [ protospec ] hosts [ "tag" string ] [ "tagged" string ] - [ "-\*(Gt" ( redirhost | "{" redirhost-list "}" ) + [ "->" ( redirhost | "{" redirhost-list "}" ) [ portspec ] [ pooltype ] ] antispoof-rule = "antispoof" [ "log" ] [ "quick" ] "for" ifspec [ af ] [ "label" string ] [ "ridentifier" number ] -table-rule = "table" "\*(Lt" string "\*(Gt" [ tableopts-list ] +table-rule = "table" "<" string ">" [ tableopts-list ] tableopts-list = tableopts-list tableopts | tableopts tableopts = "persist" | "const" | "counters" | "file" string | "{" [ tableaddr-list ] "}" @@ -3417,7 +3417,7 @@ hosts = "all" | "{" host-list "}" ) [ port ] ipspec = "any" | host | "{" host-list "}" -host = [ "!" ] ( address [ "/" mask-bits ] | "\*(Lt" string "\*(Gt" ) +host = [ "!" ] ( address [ "/" mask-bits ] | "<" string ">" ) redirhost = address [ "/" mask-bits ] routehost = "(" interface-name [ address [ "/" mask-bits ] ] ")" address = ( interface-name | interface-group | @@ -3433,9 +3433,9 @@ os = "os" ( os-name | "{" os-list "}" ) user = "user" ( unary-op | binary-op | "{" op-list "}" ) group = "group" ( unary-op | binary-op | "{" op-list "}" ) -unary-op = [ "=" | "!=" | "\*(Lt" | "<=" | "\*(Gt" | ">=" ] +unary-op = [ "=" | "!=" | "<" | "<=" | ">" | ">=" ] ( name | number ) -binary-op = number ( "\*(Lt\*(Gt" | "\*(Gt\*(Lt" | ":" ) number +binary-op = number ( "<>" | "><" | ":" ) number op-list = ( unary-op | binary-op ) [ [ "," ] op-list ] os-name = operating-system-name @@ -3460,7 +3460,7 @@ state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "max-src-nodes" number | "max-src-states" number | "max-src-conn" number | "max-src-conn-rate" number "/" number | - "overload" "\*(Lt" string "\*(Gt" [ "flush" ] | + "overload" "<" string ">" [ "flush" ] | "if-bound" | "floating" | "pflow" ) fragmentation = [ "fragment reassemble" ] From nobody Fri Feb 21 08:11:52 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzjX94BvVz5pMSZ; Fri, 21 Feb 2025 08:11:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzjX85jS8z3QjZ; Fri, 21 Feb 2025 08:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as4qvLM4kbKKbslFcwQHTj7b4s7LhriuaD9JXEFW0Q0=; b=U9gR8WwHN1wrGiMBW+Ez4T/FYMCnujgAUE80bP1SCt97J1/ukbqUXG+cE/rJ/8+3KnFOG3 kv2IQM0c5w40xS37YmwZFa+KL2qXy6TgwAmjyRoeNt7hnveeUE9e3j6Sr6ivVI73Uf2fo/ 8Tc/l2UMVr2MgC3nugzS/JSyCYobpMKKaWqc6xmYx77T0EH2J2ZHQECQoszNGbNtzPoac2 refZIp8mp/3akW3AemV0ojZasWi1Ht2W160m5HzjNElcFT7WbbHhFiCxxdGuJ10MmZNsqd okTVeQIQVYC/bPgAyGK03m9LlpDRkJ2ki01PkCG/OddPV8jP1YHXc2ugLhy1kQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740125512; a=rsa-sha256; cv=none; b=AjgHp8rspp7cMoWKtAjnGQo+j5PN6H2PX03ZLZ13lI/UQTPdNL1JxXbB0X0CLn8VEtb3Il nQVhImwPOvu+VzfOKHiTw6uOMmxUtWp8luQNt2+VKjaL9Cfr88PRKkiSw+Di1jsakq+wi0 YT582uAP5OE1wmTgN687ur/ekRRiiWycy/fL82GlAp8ZXPzdcX3zD2lpVIgcGCnCS+sR8P dGbY5KetOhf0g0y69K+/MU6cTkZSE17UKxsyi2T71XtkgOMn3FkWedRaZD558A+eze2COD QnWJ+puC6ZZPTV+CvJtlbnO2BgkOyxlK7borw5NEriOLAHrDsUqURZ7Ofg8EDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740125512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=as4qvLM4kbKKbslFcwQHTj7b4s7LhriuaD9JXEFW0Q0=; b=ES535RB1jZr6mp8jCyxczlJHAn6eOdBWd3CWPZoJpiyBgfTMfLL5VK60tQFyJgCCDhk6of JAxclbvRwqxU+jFqXP5PDzYsVi4Bqr9xg6kfWaObr8osdsRFQSRZ0orgLHQU9WnzpMV6Uo ehM2tg8uC8ClfUziMQ5UxlVPIkdIsLts5wLVmAneKjGi3yKmKuKPc4rb5ZdkIrnYiTr0n5 nVvGi2hSQF7qLOgbG/+jmd1bIRcHYHMNdaFOt+JgL1cc3TvY/YRcnbBTjc6doZZChdjZeT dn5AGDdNvLo3ABO6Dcq01ZulsS3Z8z4ZkW4N3hRs9qdloirEpZiUsh3bv9I5vg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzjX8502nz1SCB; Fri, 21 Feb 2025 08:11:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51L8Bq9F077017; Fri, 21 Feb 2025 08:11:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L8BqSu077014; Fri, 21 Feb 2025 08:11:52 GMT (envelope-from git) Date: Fri, 21 Feb 2025 08:11:52 GMT Message-Id: <202502210811.51L8BqSu077014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3c0a0de20ffe - main - pf.conf.5: rephrase log() documentation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3c0a0de20ffe9d35a0347ce2d19460e84aac808e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3c0a0de20ffe9d35a0347ce2d19460e84aac808e commit 3c0a0de20ffe9d35a0347ce2d19460e84aac808e Author: Kristof Provost AuthorDate: 2025-02-14 15:11:04 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:11:03 +0000 pf.conf.5: rephrase log() documentation after some discussion with henning, document the various log options as one section; some text was altered to make it read better; ok henning Obtained from: OpenBSD, jmc , cea6f9db1f Sponsored by: Rubicon Communications, LLC ("Netgate") --- share/man/man5/pf.conf.5 | 56 ++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 478ce7b956f9..704f43a30f83 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -1711,38 +1711,49 @@ If neither nor .Ar out are specified, the rule will match packets in both directions. -.It Ar log -In addition to the action specified, a log message is generated. +.It Ar log Pq Cm all | matches | to Ao Ar interface Ac | Cm user +In addition to any action specified, +log the packet. Only the packet that establishes the state is logged, unless the .Ar no state option is specified. The logged packets are sent to a .Xr pflog 4 -interface, by default -.Ar pflog0 . -This interface is monitored by the +interface, by default pflog0; +pflog0 is monitored by the .Xr pflogd 8 -logging daemon, which dumps the logged packets to the file +logging daemon which logs to the file .Pa /var/log/pflog in .Xr pcap 3 binary format. -.It Ar log (all) -Used to force logging of all packets for a connection. +.Pp +The keywords +.Cm all , matches , to , +and +.Cm user +are all optional, +and can be combined using commas. +.Pp +Use +.Cm all +to force logging of all packets for a connection. This is not necessary when .Ar no state is explicitly specified. -As with -.Ar log , -packets are logged to -.Xr pflog 4 . -.It Ar log (matches) -Log this packet on all subsequent matching rules, using the log settings -given here, in particular to the pflog interface specified here so that -regular pflogs are not clobbered. -.It Ar log (user) -Logs the +.Pp +If +.Cm matches +is specified, +it logs the packet on all subsequent matching rules. +It is often combined with +.Cm to Aq Ar interface +to avoid adding noise to the default log file. +.Pp +The keyword +.Cm user +logs the .Ux user ID of the user that owns the socket and the PID of the process that has the socket open where the packet is sourced from or destined to @@ -1753,11 +1764,10 @@ Only the first packet logged via .Ar log (all, user) will have the user credentials logged when using stateful matching. -.It Ar log (to Aq Ar interface ) -Send logs to the specified -.Xr pflog 4 -interface instead of -.Ar pflog0 . +.Pp +To specify a logging interface other than pflog0, +use the syntax +.Cm to Aq Ar interface . .It Ar quick If a packet matches a rule which has the .Ar quick From nobody Fri Feb 21 09:11:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yzkrt2Qjxz5pS5r; Fri, 21 Feb 2025 09:11: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 4Yzkrt1dphz3Ydw; Fri, 21 Feb 2025 09:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740129086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpTZktd48ifIPd6lmbLRfRbFjyJ6ZMMBAu6TDmtsFhs=; b=GMTloOPFNTI/Y10tV7453lqf0nAAa/MqL/Zt93OHpY0lmELiZIq8V45N9P3Ki4MRvrHCAm diJtUzG37jlAiICZ+axHRG/HA1lK9gMVreVG1xfyX6ObCW2EltYJymC1T9kBsSZw4peUMt XQ8MpTbwQf3CX4X+moScgFhAHxQ2t1zxjh6ZgXS3MjQEjwlb713WE7DX+AL1J/0JortuHi nOK1GKtDMyTzD0bLqWLn8wxcnm+A34Jk6Cjg/G6GmRhy6jy/MWACMEYHGy1jVS9wxvSIri bl+eUrETeYMpgbHxcZ4HKFrzX8GynScqXoa62gmuI+oEV/aK27loHO/TyMu1aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740129086; a=rsa-sha256; cv=none; b=LXN58iVT49hxdB1UGypLodnsJOYZ3GaPKequALFAU6qmkR5QfWeS9ReNquizTY+uoSo6sQ B1m21W0wmrp3IAqjYMNj/892/QSPzOSDov1FWr8XbY8i617HVfAq+gC4k83ucSVDjicKAB CIVVm3owO5/Pr2G5iMbvBH05FH/7qK8ZwLdcYb76//SC8blnFwJ2mOb/jcefMT3o+AnFND linWxwdL3T2OzaTXDgRMjt2ZGXGNHpHIQ2LZMCG2L3Hb+Mc1KcUWSNVd6RiFNOVaqT7kqS xhQRsPYoT+ReU3Xk6kJKMPh25LXLgwsJ37k7PT8PIzQAGEBLGPZZMZMDqu7zlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740129086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DpTZktd48ifIPd6lmbLRfRbFjyJ6ZMMBAu6TDmtsFhs=; b=TWYbj9K4osn9y+nH9aIRX9U5epY2JYR5/+KNBv738ZRJeQnd/bTnmX5PV3nLY1MZfeZCgT w3RFT8m4BXHzUy8rQl+8/d7ybHjRYpkyYOeLXsQQQx23u6qD9G5fsk98tKBrwpGp3eKTOl a7B9YF4b4j4aaHQwwz1X2pVTQIj0R1h4sdUrhOk0JJRBNL+4U17u5Em/enQG/ItCV8Cr2q 35gXriZvGXdX7xu8DwTU9uNpYoKYGer8oYtvitut3xSEbepdmaLOnq8S8j3H9MSlj12i58 WZT+ze+QJ/A30yjCHu9t2kiTwKIveB7SDOSO5BJpGGRm4mG8LbtN4X+jZcP5sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yzkrt1CvJz17q; Fri, 21 Feb 2025 09:11: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 51L9BQKe086650; Fri, 21 Feb 2025 09:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L9BQKB086647; Fri, 21 Feb 2025 09:11:26 GMT (envelope-from git) Date: Fri, 21 Feb 2025 09:11:26 GMT Message-Id: <202502210911.51L9BQKB086647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 207f938bc563 - main - snmp_pf: address Coverity remarks about time_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 207f938bc56338e6ff41e10b16610a236e1c6270 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=207f938bc56338e6ff41e10b16610a236e1c6270 commit 207f938bc56338e6ff41e10b16610a236e1c6270 Author: Kristof Provost AuthorDate: 2025-02-21 08:25:57 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:25:57 +0000 snmp_pf: address Coverity remarks about time_t On most platforms time_t is 64 bits wide, but we assign it to 32 bits variables. Unfortunately these are SNMP fields that are defined to be 32 bits wide, so we cannot change this. We are similarly unable to prevent the passage of time, meaning that time_t must remain 64 bits wide as well. Explicitly cast to tell Coverity that we're aware of these limitations and do not wish to be reminded of them. CID: 1553869 CID: 1557025 CID: 1592232 CID: 1592234 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 9f7e6d4f31cb..782e5503c8a3 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -171,7 +171,7 @@ pf_status(struct snmp_context __unused *ctx, struct snmp_value *val, case LEAF_pfStatusRuntime: runtime = (pfs->since > 0) ? time(NULL) - pfs->since : 0; - val->v.uint32 = runtime * 100; + val->v.uint32 = (uint32_t)(runtime * 100); break; case LEAF_pfStatusDebug: val->v.uint32 = pfs->debug; @@ -586,7 +586,7 @@ pf_iftable(struct snmp_context __unused *ctx, struct snmp_value *val, break; case LEAF_pfInterfacesIfTZero: val->v.uint32 = - (time(NULL) - e->pfi.pfik_tzero) * 100; + (uint32_t)(time(NULL) - e->pfi.pfik_tzero) * 100; break; case LEAF_pfInterfacesIfRefsRule: val->v.uint32 = e->pfi.pfik_rulerefs; @@ -733,7 +733,7 @@ pf_tbltable(struct snmp_context __unused *ctx, struct snmp_value *val, break; case LEAF_pfTablesTblTZero: val->v.uint32 = - (time(NULL) - e->pft.pfrts_tzero) * 100; + (uint32_t)(time(NULL) - e->pft.pfrts_tzero) * 100; break; case LEAF_pfTablesTblRefsAnchor: val->v.integer = @@ -862,7 +862,7 @@ pf_tbladdr(struct snmp_context __unused *ctx, struct snmp_value __unused *val, break; case LEAF_pfTablesAddrTZero: val->v.uint32 = - (time(NULL) - e->pfas.pfras_tzero) * 100; + (uint32_t)(time(NULL) - e->pfas.pfras_tzero) * 100; break; case LEAF_pfTablesAddrBytesInPass: val->v.counter64 = From nobody Fri Feb 21 09:11:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yzkrv5QXxz5pS7t; Fri, 21 Feb 2025 09:11: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 4Yzkrv2PR1z3Yft; Fri, 21 Feb 2025 09:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740129087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fIyKBBDWPSsbD7UqJEuOcPU8l9GfRGgDZ26seQ5VOC8=; b=CkIXPG2coZrbBgWHUT6FQvlhi5l7FMp2sTPZV+HvdRFOWF+3PUiuUrFDPnlqr0RSLlVt0K 7YY3Agl1DTWn5ExkfjrJ1EQggawRu/MeWpp+KOn905exiiCKI4SOpONzsyfqK7r+bF7hFu kTc8QgIe06khXOSA/SqtkyVyV07/YRnA4iq+u7/aJdwpg8pQZFQZvXYNO+P9vvfAAZSrlz p5HhsgBKUnR4p1YMd4Lif0ZPWVl3pLXHO/qWc7eqHrHcSw4rqNuvk2lU5ezFZi2aobOgah LhRT4EDqxpuIOgKHpL0c0KYLkkeVvcEkOGh5/YhUm4gCooopUGdTDDVVIflTyw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740129087; a=rsa-sha256; cv=none; b=Dtrq4sfeQJ1gdApsxPjQllTVzr65//IIUrGywNGeF8e7lo2Zb0obaJ5Ob00BzA2m86uorf ngoWMVjSHBWHK1Tgob1MC4+UddawgESovWItky4JCBfRSrrUs4LVhCSRvuf4kXAMkrGJmw LTWauHWSLSa3uDgsm1+Wi1B80CI8qeKQrm5+tVLApnwpd3CBcSOjR9mi2WtJpM4fyUoYNc 2ElAp4HPhq1b+edpiBWrn4nkvCsygGPa6OSCFibV6/wnaSbIvIba+1Iu0JynnWc7M0uAjC BDzrVAlJfjLr2ok9GObaLJJQS2wy3W9KoRGpaTVUePI5f3Flkofjka1XpQYYHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740129087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fIyKBBDWPSsbD7UqJEuOcPU8l9GfRGgDZ26seQ5VOC8=; b=Az88a6mQmawH8ciTG79wlmA+S1IODsVtKpKTmCBBOI2Dz9LGsWHXcUV0Gblg4L2XebUfHE Gky29Uj+5eVKUajZXksTeAUq2CemHVo0SKDK5fdkhAGGFrTzMzCcMNv4JZGZ3F+M2Nb0RR MbJ8EMwYMQ1wjgGrTr3SQvzKG9+X0vhmuJK/FsXl+Z/9z38+Prc0y027DwToeTmkgSCm8e +SFpQVt+kWiYs1S61/vWA87lBfbfht9qbMkPjj++HPTUedg+CZNCsmSyMkE169jJjrBiEd 1G6uB2UdPR0HdW6iGBaTxcKvLQOXTLhqaYKopZdQ4trfEw9g1xuPjhDwHK61xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yzkrv1vm9z1Ml; Fri, 21 Feb 2025 09:11: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 51L9BRu6086683; Fri, 21 Feb 2025 09:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51L9BRBQ086680; Fri, 21 Feb 2025 09:11:27 GMT (envelope-from git) Date: Fri, 21 Feb 2025 09:11:27 GMT Message-Id: <202502210911.51L9BRBQ086680@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 08d01204175d - main - snmp_pf: fix rules->label use List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08d01204175dae496742e9ccd570363b267284e8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=08d01204175dae496742e9ccd570363b267284e8 commit 08d01204175dae496742e9ccd570363b267284e8 Author: Kristof Provost AuthorDate: 2025-02-21 08:49:06 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 08:49:06 +0000 snmp_pf: fix rules->label use We now support multiple lables on a rule, so 'rule' is an array of strings, not just one string. Adjust the check for 'is there a label?'. CID: 1471808 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 782e5503c8a3..0e40bcfb843e 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1531,7 +1531,7 @@ pfl_scan_ruleset(const char *path) goto err; } - if (rule.label[0]) { + if (rule.label[0][0]) { e = (struct pfl_entry *)malloc(sizeof(*e)); if (e == NULL) goto err; From nobody Fri Feb 21 10:43:26 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yzmv30FfBz5pZhL; Fri, 21 Feb 2025 10:43: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 4Yzmv26mC3z3jD2; Fri, 21 Feb 2025 10:43:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740134607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtCJC0evhmYVCwIqNF2wfhuP3WcKzbgWLSjXy0TBxfs=; b=TkbqdTnfuNbu+IPN96Js+EZUfLfAX60ArjlrlqtNNY+ww+zJELakjcEoAftsmLgTzVqS8l 153wXUb2m555rYKBpYHEuuRVwtB9a+F5Tg/7s7soTx7KMcXJDmLio2aQZoNUgV8ybuN0d8 OUxkEbI2JlXz3HDjaVi71nU0OkIb6OPGWlPuzR+YUVQsxI1MySnenDd+nu6yT6WEQVgvq7 CEqc+cqQuB31zsQ0ycRya5GOlthJ3/fwU4RefE0c9/Bnn8I5uEnHtzYHih6wE/udovV8r8 1yag8f/4vcqdV7pp2JjCGCA7TkQbAH6ayhiIRwuQ9CwiItOsHnB2oRReEVgdLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740134607; a=rsa-sha256; cv=none; b=OA2/VClqmkqyTKw62gB6Ah8ProvAK+oHdIAtubveMmZf/dAMNfK7O0gflG8YGhFRDp42iA 5kGgbGjG4fJlwdnKaV96fNp+PnRoCjisx6GZpz2TKaac8j0Is9fty6hCEu9uHWD6mzDLSM AjTnlmvOeyFSjpDnKRPm6MkHO6zHfvDovxBS+6qT3DM3psEgIuns6oEqbJQIvnuaX7R5e+ sFrbBl2IlaEMXrOXWyquIJGnzqG+NHllsPDhv7UlakERgK4GUeskA9fHoWyFX3RjPuj4Rv Wkko6+yT/seXdxx+HiHtH/wyZCgqYxoWMvQJtmd3nSjCoswculIWTUioMhfUtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740134606; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DtCJC0evhmYVCwIqNF2wfhuP3WcKzbgWLSjXy0TBxfs=; b=eVcfE7ENoje2GYocwdp+KQF53PN4cxfovcZij2ajkAd1eGxLLlehg4I5oW98xKhHjydFkT gxKFiHS8EpHJNwzuBbbiyiH5PEu5bjfsoLKKBNlSLd9A+BQv6n/UpesFd7YgVRPxmPc3Ag z8yrnvzraALmlX0CsLXvhkxsXGhFld2u9MDOmFXr77uRgbAEe0GEnozjNMPPSnbr1jglkF +yj4f7OuJwOUsv2FPxVQ1ZrSKXd83PKjkEemWEv4IbQxGubX4FLp9tDgRSnoI3sVWlHwPi QAgHB3dRqWPbPtTNNkjBt6bUM1g0d3PAHc30EMIxt6lNANL2dBRJekK9jWOLSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yzmv269yyz3wf; Fri, 21 Feb 2025 10:43: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 51LAhQ5x057994; Fri, 21 Feb 2025 10:43:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LAhQ6F057990; Fri, 21 Feb 2025 10:43:26 GMT (envelope-from git) Date: Fri, 21 Feb 2025 10:43:26 GMT Message-Id: <202502211043.51LAhQ6F057990@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 27cb3328173e - main - pf: micro-optimise padding check List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 27cb3328173e4de80fad90c3b794b3eb0320d69a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=27cb3328173e4de80fad90c3b794b3eb0320d69a commit 27cb3328173e4de80fad90c3b794b3eb0320d69a Author: Kristof Provost AuthorDate: 2025-02-14 15:23:53 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 09:16:52 +0000 pf: micro-optimise padding check In most cases, IP fragments do not have an Ethernet padding. So add a condition to save a useless call to m_adj() and have a paranoid length check in the other cases. OK henning@ Obtained from: OpenBSD, bluhm , fcf0d61153 Obtained from: OpenBSD, chris , ebe64b684c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index ac74434cf2b7..98539be8c6ce 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -706,7 +706,8 @@ pf_join_fragment(struct pf_fragment *frag) TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); m = frent->fe_m; - m_adj(m, (frent->fe_hdrlen + frent->fe_len) - m->m_pkthdr.len); + if ((frent->fe_hdrlen + frent->fe_len) < m->m_pkthdr.len) + m_adj(m, (frent->fe_hdrlen + frent->fe_len) - m->m_pkthdr.len); uma_zfree(V_pf_frent_z, frent); while ((frent = TAILQ_FIRST(&frag->fr_queue)) != NULL) { TAILQ_REMOVE(&frag->fr_queue, frent, fr_next); @@ -715,7 +716,8 @@ pf_join_fragment(struct pf_fragment *frag) /* Strip off ip header. */ m_adj(m2, frent->fe_hdrlen); /* Strip off any trailing bytes. */ - m_adj(m2, frent->fe_len - m2->m_pkthdr.len); + if (frent->fe_len < m2->m_pkthdr.len) + m_adj(m2, frent->fe_len - m2->m_pkthdr.len); uma_zfree(V_pf_frent_z, frent); m_cat(m, m2); From nobody Fri Feb 21 10:43:27 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Yzmv41M0Wz5pZhP; Fri, 21 Feb 2025 10:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Yzmv406ybz3hwp; Fri, 21 Feb 2025 10:43:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740134608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MewTr/6oH/nMxKnBV6Dk8dtLlvERUxsGoAGUiZJwKxk=; b=EBkJJuhgnvnzWjp3NWGrhL9TiOBQG/FcMJ6jNZb+bABR0i5H4DZsa87b8pI0NBHAvlNamY Tq3SpNG+t33mFEQVgRCu/Z/eiFHyNuK4/R66g5NDEwObavDjwx2HNDg50jJkiOznvaTTmi pgA5zei6pol0abNtl2ktCDYrr01eosj3LnR5yDnxBdY6/SWi3zjL8qpeo9o2a6jaIGS2zI OcZXEX+bLIpyY8js47mWTSDN680F2bENg0cBRkzqj1S2C2fqYUaqpR1aEjaKjObrkXge7J IvVDWrtKB2sCiSG7IQv4d2QxlsuGwcMK2ulTQnB6krj4Fyo5Z/dxvLkmgk1Pjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740134608; a=rsa-sha256; cv=none; b=IOk5TprLqkLE/EWW/yXeW/cGHnKpxpHKJ1pEGTeIyw31M2ABLXsDtB/uK6HIsn/1qhUESm FATBxLqr+eOg5Rvi4C/CQmlZxMA1S35Lq0W51hlpKWwkTET4Yh2UWxXaI9ZB+XNz814PqB /8a0sMeq53cZMC0qL+KuIivy4b2C3tZmp6U2CRGPYt13maetuWBN3rnKj3Mk3KfF9m8NEF 502uYkoRnjQl9s6eg9pWPD2EwFl9dsHcae6j5dmyTmd6+HJUHIT8UeM8flgaN46gqit21m YtTky4Q7TZLs4Ah/bnN0qx5WmiSoeU7+YMwe5PZae5gLpmnNyqjprvtyMSkYvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740134608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MewTr/6oH/nMxKnBV6Dk8dtLlvERUxsGoAGUiZJwKxk=; b=YRJV0Gg6CPZZGAOtpCGiHeaX+s/zB8DsKZCAzvbkuteuu4hm7kzJI+i6aCE6CVM9eLH4V3 9+LQSRdSYcsyBPxLfVqzIYy6wiDrJAmkBNTwlQTZgoPXYW+8EUIgnCJpdAkpyelYESWQnB z9hvqQgrRKD823zSiF+UFUSe9O+iyfJiSGOoi7qmw1Nkj4GQoJXMLaA83ZeQfC40R/TUvf pWjWLl2fbhpnCyetVUIU434s+MTaCwHPvxWtq5WECRlfvWyn0AhcTLSS7n73/6DpdXUE5Q H/2Xfpl9KDVApxDNTSyTGAGyKgqsFT1/w+/GP0D11iraSVpN1OpQH5Eh3cLP7A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Yzmv36rH1z3wg; Fri, 21 Feb 2025 10:43: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 51LAhRXq058031; Fri, 21 Feb 2025 10:43:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LAhRxY058028; Fri, 21 Feb 2025 10:43:27 GMT (envelope-from git) Date: Fri, 21 Feb 2025 10:43:27 GMT Message-Id: <202502211043.51LAhRxY058028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 94bf6a48a628 - main - pf: Cleanup leftover PF_ICMP_MULTI_* code that is not needed anymore. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94bf6a48a6281b8f3d4a7e066e7f359959ab9d9d Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=94bf6a48a6281b8f3d4a7e066e7f359959ab9d9d commit 94bf6a48a6281b8f3d4a7e066e7f359959ab9d9d Author: Kristof Provost AuthorDate: 2025-02-14 15:40:42 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 09:16:52 +0000 pf: Cleanup leftover PF_ICMP_MULTI_* code that is not needed anymore. ok henning Obtained from: OpenBSD, mikeb , ecdc46e922 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 153fd11f1d2c..f9715cd18166 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -313,7 +313,7 @@ static void pf_change_ap(struct mbuf *, struct pf_addr *, u_int16_t *, static int pf_modulate_sack(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 *); + 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 *, @@ -421,8 +421,6 @@ extern struct proc *pf_purge_proc; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); -enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI_LINK }; - #define PACKET_UNDO_NAT(_m, _pd, _off, _s) \ do { \ struct pf_state_key *nk; \ @@ -1685,7 +1683,7 @@ pf_state_key_addr_setup(struct pf_pdesc *pd, } break; default: - if (multi == PF_ICMP_MULTI_LINK) { + if (multi) { key->addr[pd->sidx].addr32[0] = IPV6_ADDR_INT32_MLL; key->addr[pd->sidx].addr32[1] = 0; key->addr[pd->sidx].addr32[2] = 0; @@ -2173,7 +2171,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 *virtual_id, u_int16_t *virtual_type) + int *icmp_dir, u_int16_t *virtual_id, u_int16_t *virtual_type) { /* * ICMP types marked with PF_OUT are typically responses to @@ -2181,7 +2179,7 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, * 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 (pd->af) { #ifdef INET @@ -5445,7 +5443,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int tag = -1; int asd = 0; int match = 0; - int state_icmp = 0, icmp_dir, multi; + int state_icmp = 0, icmp_dir; u_int16_t virtual_type, virtual_id; u_int16_t bproto_sum = 0, bip_sum = 0; u_int8_t icmptype = 0, icmpcode = 0; @@ -5485,7 +5483,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, icmptype = pd->hdr.icmp.icmp_type; icmpcode = pd->hdr.icmp.icmp_code; state_icmp = pf_icmp_mapping(pd, icmptype, - &icmp_dir, &multi, &virtual_id, &virtual_type); + &icmp_dir, &virtual_id, &virtual_type); if (icmp_dir == PF_IN) { pd->nsport = virtual_id; pd->ndport = virtual_type; @@ -5501,7 +5499,7 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, 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); + &icmp_dir, &virtual_id, &virtual_type); if (icmp_dir == PF_IN) { pd->nsport = virtual_id; pd->ndport = virtual_type; @@ -7623,7 +7621,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, struct pf_addr *saddr = pd->src, *daddr = pd->dst; u_int16_t *icmpsum, virtual_id, virtual_type; u_int8_t icmptype, icmpcode; - int icmp_dir, iidx, ret, multi; + int icmp_dir, iidx, ret; struct pf_state_key_cmp key; #ifdef INET u_int16_t icmpid; @@ -7653,22 +7651,22 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, #endif /* INET6 */ } - if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &multi, - &virtual_id, &virtual_type) == 0) { + if (pf_icmp_mapping(pd, icmptype, &icmp_dir, &virtual_id, + &virtual_type) == 0) { /* * ICMP query/reply message not related to a TCP/UDP/SCTP * packet. Search for an ICMP state. */ ret = pf_icmp_state_lookup(&key, pd, state, pd->dir, virtual_id, virtual_type, icmp_dir, &iidx, - PF_ICMP_MULTI_NONE, 0); + 0, 0); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { ret = pf_icmp_state_lookup(&key, pd, state, pd->dir, virtual_id, virtual_type, - icmp_dir, &iidx, multi, 0); + icmp_dir, &iidx, 1, 0); if (ret >= 0) { MPASS(*state == NULL); return (ret); @@ -8317,11 +8315,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, icmpid = iih->icmp_id; pf_icmp_mapping(&pd2, iih->icmp_type, - &icmp_dir, &multi, &virtual_id, &virtual_type); + &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, pd2.dir, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); + icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); return (ret); @@ -8422,11 +8420,11 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, } pf_icmp_mapping(&pd2, iih->icmp6_type, - &icmp_dir, &multi, &virtual_id, &virtual_type); + &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, pd->dir, virtual_id, virtual_type, - icmp_dir, &iidx, PF_ICMP_MULTI_NONE, 1); + icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && @@ -8434,7 +8432,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, ret = pf_icmp_state_lookup(&key, &pd2, state, pd->dir, virtual_id, virtual_type, - icmp_dir, &iidx, multi, 1); + icmp_dir, &iidx, 1, 1); if (ret >= 0) { MPASS(*state == NULL); return (ret); From nobody Fri Feb 21 12:43:21 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzqYP2XyQz5plp1; Fri, 21 Feb 2025 12:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YzqYP1yKLz3wWD; Fri, 21 Feb 2025 12:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740141801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+4SYM7CdSjWp5vuW11YCB3L7975kT7YZuwoO2RJSllc=; b=nZjFbaWI5Crph8XO3oVyfhuDA3nX0EFS8lRrMUoW5+7MuNfNMYrobGe4U0UFKUSE8A4tsG ACczxhifkvbntkuU3/802l8RSsXMIYZ0oqcVEx+l4H0W4ggAFoyw8RcusIWYyoW/Cl4Utr 979ek+0w45cgxO672X81hF1oWzV/Jv3MpYcjnCYh2Z7FsEhGidFx2NVP44irJcxReXDHCY eU67+lhsTg3u4h/H+2JIA+I+tOX77LEFCD0ymeQC4xYgR44ByWGrtZwqR61Fp4llAI6Ncn XsL1JJf55YM399AApdRuOsWPxxjOb6FgU52VgxSRPin87F0JqPWtmGYlo1kBIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740141801; a=rsa-sha256; cv=none; b=aIgZxM1LQTsFYmhbEExbb3hiPOoMQVUOOugN8YmCZIiR7ilXufTOp02Ttk/bfx/BxnWc9D scqh9PuLgQ+DI4nBtkRvkira5aTM3jLe0nUGCsfizELQQUaLBouI5t61Ou81Zb+YtzXO1G CEkkY6YFwN24lf/BBYi0wwJ/tJRYmqIqP3BYKgfMbtjW7fnDPHHuuxt8m0refigmUusVNh Bx7gq53XNx86c2fXh7UvOcqJf2p20+Gmf20jm0LNnX7+JnU8A5LThrbwRcT/iw/98zwvfB 0/KWHr9hSM9gVc4gDM7gIjy6O166cIlK6mvE3hpviEk4v9yH+M+pxG1qPtVNrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740141801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+4SYM7CdSjWp5vuW11YCB3L7975kT7YZuwoO2RJSllc=; b=sHTbnowQyGsrumebqJ9YBBM0KQoBjhp14emFSqeqf/JDi3ml9KUoUhlyClDKBY/CmQDXzV 0jK5+Qw8Cf/U6DjToQpESLIHyQN4yeOtTLCqbZxK5CqGjL/0aFc8eXwZZ+oh3SKVrbypyZ 0m8MyWY/4BKJs4kXyEqxIIMLysWemWUfD9Pcbf1RZL/YXW5Jmwy8SOdCQ2Euba7A+Mencp WH6sriibxJQNEjS77qgBCBMfIDVrBvd4bWSZe18x+COK9r1itHpV337BofykE9VkY/II11 ChJtlEaoJ9jefDTFTiDEcZvHhthg4GTddnuWe9u0iZ6KvpauyhCdvMutSXS1Yg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzqYP1XfLz6tZ; Fri, 21 Feb 2025 12:43: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 51LChLdF082971; Fri, 21 Feb 2025 12:43:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LChLpG082968; Fri, 21 Feb 2025 12:43:21 GMT (envelope-from git) Date: Fri, 21 Feb 2025 12:43:21 GMT Message-Id: <202502211243.51LChLpG082968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5dad98d56282 - main - pf: remove redundant argument from pf_icmp_state_lookup() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 commit 5dad98d56282d5ea752375dbdfb1d4a57ec5ae23 Author: Kristof Provost AuthorDate: 2025-02-21 10:38:33 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 10:38:33 +0000 pf: remove redundant argument from pf_icmp_state_lookup() We already pass struct pf_pdesc to pf_icmp_state_lookup(). There's no need to also pass the direction. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index f9715cd18166..610e65026c28 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -358,8 +358,7 @@ static int pf_test_state(struct pf_kstate **, struct pf_pdesc *, u_short *); int pf_icmp_state_lookup(struct pf_state_key_cmp *, struct pf_pdesc *, struct pf_kstate **, - int, u_int16_t, u_int16_t, - int, int *, int, int); + u_int16_t, u_int16_t, int, int *, int, int); static int pf_test_state_icmp(struct pf_kstate **, struct pf_pdesc *, u_short *); static int pf_sctp_track(struct pf_kstate *, struct pf_pdesc *, @@ -7568,10 +7567,11 @@ pf_multihome_scan_asconf(int start, int len, struct pf_pdesc *pd) int pf_icmp_state_lookup(struct pf_state_key_cmp *key, struct pf_pdesc *pd, - struct pf_kstate **state, int direction, - u_int16_t icmpid, u_int16_t type, int icmp_dir, + struct pf_kstate **state, u_int16_t icmpid, u_int16_t type, int icmp_dir, int *iidx, int multi, int inner) { + int direction = pd->dir; + key->af = pd->af; key->proto = pd->proto; if (icmp_dir == PF_IN) { @@ -7657,15 +7657,14 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, * ICMP query/reply message not related to a TCP/UDP/SCTP * packet. Search for an ICMP state. */ - ret = pf_icmp_state_lookup(&key, pd, state, pd->dir, - virtual_id, virtual_type, icmp_dir, &iidx, - 0, 0); + ret = pf_icmp_state_lookup(&key, pd, state, virtual_id, + virtual_type, icmp_dir, &iidx, 0, 0); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { ret = pf_icmp_state_lookup(&key, pd, state, - pd->dir, virtual_id, virtual_type, + virtual_id, virtual_type, icmp_dir, &iidx, 1, 0); if (ret >= 0) { MPASS(*state == NULL); @@ -8318,8 +8317,7 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, - pd2.dir, virtual_id, virtual_type, - icmp_dir, &iidx, 0, 1); + virtual_id, virtual_type, icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); return (ret); @@ -8423,15 +8421,13 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, &icmp_dir, &virtual_id, &virtual_type); ret = pf_icmp_state_lookup(&key, &pd2, state, - pd->dir, virtual_id, virtual_type, - icmp_dir, &iidx, 0, 1); + virtual_id, virtual_type, icmp_dir, &iidx, 0, 1); if (ret >= 0) { MPASS(*state == NULL); if (ret == PF_DROP && pd2.af == AF_INET6 && icmp_dir == PF_OUT) { ret = pf_icmp_state_lookup(&key, &pd2, - state, pd->dir, - virtual_id, virtual_type, + state, virtual_id, virtual_type, icmp_dir, &iidx, 1, 1); if (ret >= 0) { MPASS(*state == NULL); From nobody Fri Feb 21 12:43:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzqYQ4Qs9z5pljR; Fri, 21 Feb 2025 12:43: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 4YzqYQ3Lftz3wYN; Fri, 21 Feb 2025 12:43:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740141802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gn37RRL0LyMEUFomcrEg2rvVdvLsNhWW6meK6bBGwFQ=; b=me4h32J83nyz/L4tOAhV5ZyOGhIRIRWoozT7zVwPlVmG+y0EYlLLllYU3o3B2+8Jq2QIC9 gSbfj3Mfn2S5AhC5vvoDd8tGNzKF3FlWjMhVDHa5vce6TT3/HWP3SZN0n6+m3bggs07ieW II66e5uzOG0vQ5QzWvU6pEB6bavEjmlDWoQWTco9nC8nKqh/b7TUtnJCErBXRfcw+zE6JS lcxK89Y2I8pIaDfcS0ES69ytUf3iuaPCqhrYUG5/RKq0poXt+SVYZd3FUmtqUXA2/Dc89L aoNcyKbMN2rdNGS/NVaLfY9Fm+oMOntDgoezpkOVv8LRNDlkK8VoTk7h6FIKvA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740141802; a=rsa-sha256; cv=none; b=wNRxY8E7iddxDMjUpdUzsBP42hKYdBpCY6fmbFpGLFYI3mj7weWr6KYsGt92dgVgi9YRz1 5EDteRJtAAgjoa5BNjanRkORTa+piJmySoP6YSM0C0TW2GSS1wc0D7Q/O9i4R9z8SDQ7PJ LGYdnFz7NWZwooU3PcOjjR0FLbIFNUwQCLB8a/BFqTwImoK6fDTc6jogiyfDHgZZ3GLdLk kA+fBUV8YD0pKx+I704yzszB+r35pxSCQ7XiDHm1Ee7xX3ATkWt4CCuFPX/mCMXn+oSpUr O3tqkxlR8xWGlarOg0odVHDR20Wy8EIshlVhX6nxm0bmENYwr2yMb5KQRZO1tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740141802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Gn37RRL0LyMEUFomcrEg2rvVdvLsNhWW6meK6bBGwFQ=; b=yEic9Yd6t0R9kXmCsGvg71nvJzrDguXLlzPO+MGyVhYWYC9Oxx09ehwT4U1AvACv2/NjFQ 36B5tQhDwlrCREcSHEGAqvk2PTNboC5Z0OFr1RrJLryDv+l5JirkokvfgutnoIvGr/Z4B3 o5L9kPD+ZQSFc3E7iF1WguT1IIXRry/5t/VlgtFMTgvOaDS4GYoSQRxP3z0L2h/43qOn9z qD3DhnKPN5WzkFgJYHOFftSlNAxdZZV2vqyBr3G4peApP3lSKlzSvHuVcDstQ9QtuYI12W Fg26Wujg2I+CwQ5XgA13Zl1JHhG/KceXHJWPKdfnumYUpIfDruvANNeQZPROLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YzqYQ2Xf0z771; Fri, 21 Feb 2025 12:43: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 51LChMS6083004; Fri, 21 Feb 2025 12:43:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LChM41083001; Fri, 21 Feb 2025 12:43:22 GMT (envelope-from git) Date: Fri, 21 Feb 2025 12:43:22 GMT Message-Id: <202502211243.51LChM41083001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: dbbcbaae1d7b - main - pf: Cut down on if statements around pf_icmp_state_lookup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbbcbaae1d7bb4d05ebadba95cddbde25c0d1f5c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbbcbaae1d7bb4d05ebadba95cddbde25c0d1f5c commit dbbcbaae1d7bb4d05ebadba95cddbde25c0d1f5c Author: Kristof Provost AuthorDate: 2025-02-21 10:52:26 +0000 Commit: Kristof Provost CommitDate: 2025-02-21 10:52:26 +0000 pf: Cut down on if statements around pf_icmp_state_lookup Checked with blambert@, OK millert, henning Obtained from: OpenBSD, mikeb , 12e5d1443d Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 610e65026c28..15d9697c0040 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -7659,19 +7659,16 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, */ ret = pf_icmp_state_lookup(&key, pd, state, virtual_id, virtual_type, icmp_dir, &iidx, 0, 0); + /* IPv6? try matching a multicast address */ + if (ret == PF_DROP && pd->af == AF_INET6 && icmp_dir == PF_OUT) { + MPASS(*state == NULL); + ret = pf_icmp_state_lookup(&key, pd, state, + virtual_id, virtual_type, + icmp_dir, &iidx, 1, 0); + } if (ret >= 0) { MPASS(*state == NULL); - if (ret == PF_DROP && pd->af == AF_INET6 && - icmp_dir == PF_OUT) { - ret = pf_icmp_state_lookup(&key, pd, state, - virtual_id, virtual_type, - icmp_dir, &iidx, 1, 0); - if (ret >= 0) { - MPASS(*state == NULL); - return (ret); - } - } else - return (ret); + return (ret); } (*state)->expire = pf_get_uptime(); @@ -8422,19 +8419,17 @@ pf_test_state_icmp(struct pf_kstate **state, struct pf_pdesc *pd, ret = pf_icmp_state_lookup(&key, &pd2, state, virtual_id, virtual_type, icmp_dir, &iidx, 0, 1); + /* IPv6? try matching a multicast address */ + if (ret == PF_DROP && pd2.af == AF_INET6 && + icmp_dir == PF_OUT) { + MPASS(*state == NULL); + ret = pf_icmp_state_lookup(&key, &pd2, + state, virtual_id, virtual_type, + icmp_dir, &iidx, 1, 1); + } if (ret >= 0) { MPASS(*state == NULL); - if (ret == PF_DROP && pd2.af == AF_INET6 && - icmp_dir == PF_OUT) { - ret = pf_icmp_state_lookup(&key, &pd2, - state, virtual_id, virtual_type, - icmp_dir, &iidx, 1, 1); - if (ret >= 0) { - MPASS(*state == NULL); - return (ret); - } - } else - return (ret); + return (ret); } /* translate source/destination address, if necessary */ From nobody Fri Feb 21 18:49:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YzzhN35Bkz5p7Mn; Fri, 21 Feb 2025 18:49: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 4YzzhN2YSxz44S9; Fri, 21 Feb 2025 18:49:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740163796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TPVenQLZW1hMS7S6vxESvwUgOj5b0pwLnernrmFjHpA=; b=ip3Zlt5YWFvf3G2LMR3qDCR1202LPFHGi7B77Kd112jEOFOzcG6OxfKgLhzBsStyP9RVfo /45gS5oCzQUbWcj8jL5X0AckI4oLrIuVKF4zx93iE/x6SCXfm3wqXOK7zS/k6c4X9R3i6q o1hGTJ6LyTNpaOgsAebSAp6O+BzbFUMHSPOB4kXs6VJWihhZrkF6Ud6z6wm2DQ75M+ADP4 nMDNyURsGEuERiZfvvmS8FjR0WTxLmVFxvDIgKn+xyTnAxPuzmdkHm+JCs3DhVt6f+d/br IgenJOXjmJ8d18hXKOvEL4K4XDoPWprgzc0DGOdUOrDbDzKg3VjMl+EhYykk7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740163796; a=rsa-sha256; cv=none; b=JbGighnfCWLcRxs9xtsmTC2W5Wln3fTlT70KZZ+oh166+URhrWC/RLytoSlgM6ak58mP2t vNONn8lEsufBVlczKNvEDHFSss53uKK0BZmUJwAWDvKhjjF1J1JJXhbn60OTAYzE8d+/Ok N4flmkH6DzLP5znblXGCMxPOadmK5t8Zq+pV+2tmCNsja3kb/8TIbm75VjeuVtReLJchtI k+HSiIRhb2rGQ0SYOw/rH5zmA9yprb3FOzJmYzpWAzVI/fi0xqdNUJcUHINw9ez67A/FUt E5LIxfaK5FtxUv+z9vLWWIegdZjdw04e4OZRkXESTm9AUXPBOFLFi0YYiwwm6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740163796; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TPVenQLZW1hMS7S6vxESvwUgOj5b0pwLnernrmFjHpA=; b=t69aoD/BPOY/5mduGGT3epsa6lR9E3uBGLX1BrywrHhXD6xADg5MI05c8lIypl8STwwW8G CyyNVTfBQU0ixPPlKbwCm3x5jp9plfdDTPiTlUZhRJqdQznJZFzk39xyDhiTwVBDWSmmd0 WcI0M44vYAEwQp5ImNAf4rPwMA0xRZ4hwpS9IRNWWL7OW1PkJE8iKmbQpY3P1Rz919npo+ T5Ebv7xnio/WnYRRL2lNR3Ar8OD0J2yRjQq0zgpXUxmIPddpHq9xDq72qD5zYgm2BMuoen /RJE8M9ixQLCAPSnQt4e+LssNay4hOrHjICYL6rXl1m99bEFJbThxcimlm32+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 4YzzhN27d0zb8C; Fri, 21 Feb 2025 18:49: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 51LInuxJ060478; Fri, 21 Feb 2025 18:49:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LInu95060475; Fri, 21 Feb 2025 18:49:56 GMT (envelope-from git) Date: Fri, 21 Feb 2025 18:49:56 GMT Message-Id: <202502211849.51LInu95060475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 5bd7cf837c5f - main - Cirrus-CI: Bump image to (supported) 13.4 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5bd7cf837c5fd30a04a45e20c1dcf18d113d98c4 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5bd7cf837c5fd30a04a45e20c1dcf18d113d98c4 commit 5bd7cf837c5fd30a04a45e20c1dcf18d113d98c4 Author: Ed Maste AuthorDate: 2025-02-21 18:07:32 +0000 Commit: Ed Maste CommitDate: 2025-02-21 18:49:42 +0000 Cirrus-CI: Bump image to (supported) 13.4 Sponsored by: The FreeBSD Foundation --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8daaef148ca7..5ec1a583255b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ compute_engine_instance: # gcloud compute images list --project freebsd-org-cloud-dev --no-standard-images platform: freebsd image_project: freebsd-org-cloud-dev - image: freebsd-13-3-release-amd64 + image: freebsd-13-4-release-amd64 cpu: 8 memory: 8G disk: 40 From nobody Fri Feb 21 21:03:39 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z02fk5973z5pLnc; Fri, 21 Feb 2025 21:03:42 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z02fk4QRMz3C0X; Fri, 21 Feb 2025 21:03:42 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740171822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=II4LCrgt8xfEXA2OZ6KSPkecjlyX25DfUyB9WH793hk=; b=Y4ei4f6+lkMudGzDdW7UnBcbCvrlc2w32Q1Ddd3nBXr5tIrIF7zzKCXOHd1n6pa5ZqjsV+ 5HqSY3WzNZIOr2SnYRJ2XX6WL8ZkwCqtT5JA6aZ6fmVSNRVhFZxn9QRIBfwfs1nqV6oeA3 KW8hQJzsTrEKWov0EUzC6xPRBhcvB3gfP9FP36M6TjgJ0J1n0frx/4iAQMGhEZGfwVMERD VXo8Lq4xdzAEvNzhCq9xeiIldUIK9dF7iK3AQlnXLMv3xXMoCmfnki4pJ1TUKgI1hd6JQ5 +Lzyl5kwvK67TYUzt0/+QbcdUgq42cOvqHK89cIPHHj61bCycVuZleKshQhQoA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740171822; a=rsa-sha256; cv=none; b=hw989rEtJVhpzp/79iDVPKbkyyeUQx4wj/3/UzvCP0nNKuoorCFnemy1upJ/pgiIjHiDql yz+ONLuiJr0aRfD8/wXwMwk+xspMfcAUfFOvQcYCgbDakKH2nH+pO7ghNljweko1ctOB7b fJ6GtUdrpjcOV3TrTQ12aahMK55lnfy3+3PEiLMfF60J3uCUA0hOlFuTX/lQ51efd3qtZq exqyaqMUW1QLtX3iN6msxF+iK7jY7Dfw4LKhPynE9kAiT9sunNWVi3e/irfXNQWJICcLLN hVCDmH3j6L/Vcyji/SzdqznYJM2WfAoBmm3du6d600/ur7927G/fzA9bl+yBZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740171822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=II4LCrgt8xfEXA2OZ6KSPkecjlyX25DfUyB9WH793hk=; b=QppLxUHUfQ7AfX8dhe5qC6NwX4XYzqddYKDh7QrZ91YBfn9zV6YtiSmlmNlYQXJ3phdS2X zRPbx7zPN46hSTak8wSRslxD7RoAKaYpcrWTOCtEINPosyuafGa38e7YoFcOnuUlDD+ECG ntUVIpUH4PeuRNnB/hvjVPWz7bcv+zs+vnYMw/lnB6uSXsq2JUuQwFOJFqp5r3bY8eXEur 6rrHvyPfa14RzbpZKp+wqSVz/sISdn3WFG8T2RteOFzVECPpdmi42lbzyTcW/+wt6xUHJl jmrdcbnAL8VJpgCVNtwiW2fyjXV/GxkoTEt+GcURJKO2bVEGClLW0QG74tlJHw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Z02fj6hp5zKbH; Fri, 21 Feb 2025 21:03:41 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Fri, 21 Feb 2025 13:03:39 -0800 From: Gleb Smirnoff To: Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8754ba5a5f6e - main - pfctl: Rewrite to void using union sockaddr_union Message-ID: References: <202502210811.51L8Bkhe075894@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202502210811.51L8Bkhe075894@gitrepo.freebsd.org> Kristof, On Fri, Feb 21, 2025 at 08:11:46AM +0000, Kristof Provost wrote: K> commit 8754ba5a5f6ee681de776601110313b69a779067 K> Author: Kristof Provost K> AuthorDate: 2025-02-13 17:30:12 +0000 K> Commit: Kristof Provost K> CommitDate: 2025-02-21 08:11:02 +0000 K> K> pfctl: Rewrite to void using union sockaddr_union K> K> ok mikeb K> K> Obtained from: OpenBSD, deraadt , 8717211fe3 What a nice typo in the commit message! This is how I read it: use void * pointer to sockaddr_union So I was expection to see introduction of sockaddr_union, not removal :) Maybe makes sense to not copy upstream commit messages verbatim, at least in some cases. -- Gleb Smirnoff From nobody Fri Feb 21 21:12:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z02rm2MHBz5pMFX; Fri, 21 Feb 2025 21:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z02rm1xCqz3Csb; Fri, 21 Feb 2025 21:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740172344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bm9Ms0Btlcsxp4tQkoaYGhdKSXiHJpUWYMWFAzMj6vU=; b=xhTYHEn2kSIFsQLu0LpNm8Uk6vOwavzXPcEwE7CX+FXLZeUcpnJ3MdXntZLcGj2tc+MD5W s5YnaYtpkbaGDhYT78CiO8XGduuLcVrdSvA5IvV9aKuKSZw6xP+wa5EHMjbSrM0a3RQZpz yvCTyFntCWH0rw9Bc9fCggc0SRUYR+oOkdt5lqAk7vOiN+bi2KkPV02rg0N8ZObrn6vcNC 8J+CZD0nZRxIs2s7nJehfVGxzdx/W6JTGr3WYPgx0lHuehnlGivNeIb0G0tkeua/4N0XXW hiy9wCYcz+11AgUW+mJODreJgLCWAb6F40gWaq8IiFSsnU2nf07wVSdWtDwrxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740172344; a=rsa-sha256; cv=none; b=XDP3Aez7IKP9wlQt+m06qdpZaDIUAKTqDt47hGjKAkKxSJ0IUnw1ql8xYVgcmiS/aqijhT no75KNZXn6kc33RRv6t7y+aZ8wckJO45Kgluk8fgO/upncuVeq3vcXdP6W02rqc8vdzNd7 /idGLOYzKL531jqXB6yzu4rEUo3pngg7LfqFzKcGbNjeP913mYmEliNlQv6GBTu8WeNI8K rwRzoxlJ9/5QyZgf+3ubFfAL9qo+UHST2b9U9lgAcl+ugE4YHcKEM8pSiD8CCsHmWOKsyT 53N+P3CQHFcxMEUtZdtvIb83e55bfmUrR35NDB13Gn7DxibE/V+0k4f8g9a+uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740172344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bm9Ms0Btlcsxp4tQkoaYGhdKSXiHJpUWYMWFAzMj6vU=; b=Hw5Y3TZHgwcMCAufBH50ilp9bcqMvLHNrPZtNLCahstdpUfAnhph+bi0o4JVpiK9z14B0j iBL0M0kbl/FFP3yJu2RH6Oaqf8t0NixjHLP1DKYbJh4ZuY41RJdgt+R7+6FvvBd6y5U5JP 4C2+ZQqk6Kf3dKKnpfk7XuQMzTqtjuUfyw3cRHN/uvY+TRMBuwJW//VRW/0i+kDTCEOuhc Vz1opUT5267oDxneTfOviTN37aEZyYJp19I68rhGu5ESSAfx3IMRnrRibHno8SW9TGPoIA R7tOcSYTynFwrtU1lyNwr4Zn3ITY/FzbNoe6zIndQyfL6CqLUxQ8j78yC8oqbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z02rm1TBGzgK4; Fri, 21 Feb 2025 21:12:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51LLCO88040266; Fri, 21 Feb 2025 21:12:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LLCO1T040263; Fri, 21 Feb 2025 21:12:24 GMT (envelope-from git) Date: Fri, 21 Feb 2025 21:12:24 GMT Message-Id: <202502212112.51LLCO1T040263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 5611a38d8185 - main - vm_page: define partial page invalidate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5611a38d818587b307e1fb110f72d2996c170035 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=5611a38d818587b307e1fb110f72d2996c170035 commit 5611a38d818587b307e1fb110f72d2996c170035 Author: Doug Moore AuthorDate: 2025-02-21 21:11:13 +0000 Commit: Doug Moore CommitDate: 2025-02-21 21:11:13 +0000 vm_page: define partial page invalidate Two different functions in different files do the same thing - fill a partial page with zeroes. Add that functionality to vm_page.c and remove it elsewhere to avoid code duplication. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49096 --- sys/fs/tmpfs/tmpfs_subr.c | 47 ++++---------------------------------------- sys/kern/uipc_shm.c | 47 ++++---------------------------------------- sys/vm/vm_page.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++ sys/vm/vm_page.h | 2 ++ 4 files changed, 60 insertions(+), 86 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 41d1f27caf13..0cac19ed3780 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -493,50 +493,11 @@ static int tmpfs_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end, boolean_t ignerr) { - vm_page_t m; - int rv, error; - - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(base >= 0, ("%s: base %d", __func__, base)); - KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, - end)); - error = 0; - -retry: - m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); - if (m != NULL) { - MPASS(vm_page_all_valid(m)); - } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL | - VM_ALLOC_WAITFAIL); - if (m == NULL) - goto retry; - vm_object_pip_add(object, 1); - VM_OBJECT_WUNLOCK(object); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeup(object); - if (rv == VM_PAGER_OK) { - /* - * Since the page was not resident, and therefore not - * recently accessed, immediately enqueue it for - * asynchronous laundering. The current operation is - * not regarded as an access. - */ - vm_page_launder(m); - } else { - vm_page_free(m); - m = NULL; - if (!ignerr) - error = EIO; - } - } - if (m != NULL) { - pmap_zero_page_area(m, base, end - base); - vm_page_set_dirty(m); - vm_page_xunbusy(m); - } + int error; + error = vm_page_partial_page_invalidate(object, idx, base, end); + if (ignerr) + error = 0; return (error); } diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 026611a59593..083e95432208 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -697,51 +697,12 @@ static int shm_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end) { - vm_page_t m; - int rv; + int error; - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(base >= 0, ("%s: base %d", __func__, base)); - KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, - end)); - -retry: - m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); - if (m != NULL) { - MPASS(vm_page_all_valid(m)); - } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, - VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); - if (m == NULL) - goto retry; - vm_object_pip_add(object, 1); + error = vm_page_partial_page_invalidate(object, idx, base, end); + if (error == EIO) VM_OBJECT_WUNLOCK(object); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeup(object); - if (rv == VM_PAGER_OK) { - /* - * Since the page was not resident, and therefore not - * recently accessed, immediately enqueue it for - * asynchronous laundering. The current operation is - * not regarded as an access. - */ - vm_page_launder(m); - } else { - vm_page_free(m); - VM_OBJECT_WUNLOCK(object); - return (EIO); - } - } - if (m != NULL) { - pmap_zero_page_area(m, base, end - base); - KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", - __func__, m)); - vm_page_set_dirty(m); - vm_page_xunbusy(m); - } - - return (0); + return (error); } static int diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c105aafca40f..f0f3c1e85564 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -5086,6 +5086,56 @@ out: return (VM_PAGER_OK); } +/* + * Fill a partial page with zeroes. + */ +int +vm_page_partial_page_invalidate(vm_object_t object, vm_pindex_t pindex, + int base, int end) +{ + vm_page_t m; + int rv; + + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(base >= 0, ("%s: base %d", __func__, base)); + KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, + end)); + +retry: + m = vm_page_grab(object, pindex, VM_ALLOC_NOCREAT); + if (m != NULL) { + MPASS(vm_page_all_valid(m)); + } else if (vm_pager_has_page(object, pindex, NULL, NULL)) { + m = vm_page_alloc(object, pindex, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); + if (m == NULL) + goto retry; + vm_object_pip_add(object, 1); + VM_OBJECT_WUNLOCK(object); + rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); + if (rv != VM_PAGER_OK) { + vm_page_free(m); + return (EIO); + } + + /* + * Since the page was not resident, and therefore not recently + * accessed, immediately enqueue it for asynchronous laundering. + * The current operation is not regarded as an access. + */ + vm_page_launder(m); + } else + return (0); + + pmap_zero_page_area(m, base, end - base); + KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", __func__, m)); + vm_page_set_dirty(m); + vm_page_xunbusy(m); + return (0); +} + /* * Locklessly grab a valid page. If the page is not valid or not yet * allocated this will fall back to the object lock method. diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 744688bf789b..b568fddab8d4 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -627,6 +627,8 @@ vm_page_t vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_memattr_t memattr); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); +int vm_page_partial_page_invalidate(vm_object_t object, vm_pindex_t pindex, + int base, int end); vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int); vm_page_t vm_page_grab_unlocked(vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From nobody Fri Feb 21 21:15:41 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z02wY6Prfz5pMPF; Fri, 21 Feb 2025 21:15: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 4Z02wY5fGDz3DdH; Fri, 21 Feb 2025 21:15:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740172541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cPk+B0TheVLhqK4yKaKq+AbtGDqlaVQGFQCui5Zx7ws=; b=pAl0PdUQ8oEx8eUAT/MSHwM76u4iTjyzGs828ql3z9C8X9jG4F86Z3OgPCvvbvIH2KHqsF TazpuO4BDcXvisvlMaPrTfJthM8MSF+gJGGPBtJI1015+hdlzaV1HlBRl9OjJnxq2+qtov jC/2ZkChymDp/GhVnjTyci/3iAVBkFqQ4/1UVTxAyeMBJwQGtSnGAb/qn0/RiIbvdH7Gcv xoW+o5SJFTdKGM9ZbZ6KleL8dTTi9vhN6u9V4N1nnD6lQyatgQ1J9DpNptW/RLTMryM8tv XtU86NdxppGhzGLkuVl04u/S6P+sEe0MxaDsqyN4kb5/Eetkzl1N3HBFCkWtng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740172541; a=rsa-sha256; cv=none; b=oi0GjD9y9dw0bH6VhuabSsc8MAy19kb5dlFVMhlq25ZZZUvhOHBV7CR210Oz3QwCfYEZzg +Biou7uIedGLlw+gcHat5NmqduFd4Cy5heWNHa7ToLKMVBQEwqyOMMbSU+M8NjHcmtk1+y 9v0QqIYr4+JxJtIm6FUs+zb27Y+Q3yvAFKqX09WJe5DqboXc2lrnidAVyd/y7tdnulJHhv K8ajKvutKgNBgEC0HXYl/J8Ays4kW8IpmPah0+EanmwqS9ZQ/pxyeN+W/ZFamAbOZAhwvt t2Bf1Qxwpp3IIhkTkUIUsFMzWZ4NzWB5hmV2VRmCAhNs/7DGzrh/VgY1uhMrhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740172541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cPk+B0TheVLhqK4yKaKq+AbtGDqlaVQGFQCui5Zx7ws=; b=URlL8EUHA7F9oWgsMbAM5W1+YFmnb5QyoRkk2pOZhPCPsV9WBBJ5oftYdTm1tSrB4tadOm Yoe2k1zeE+DZBEV2Xbd8XvpEQo1zKJ/uM4ET2oqGg/JpS0vGmrb9D5PLSNywLRAOVUgNWk +VQPsvzszx8+cvTY+t+1cEx8PjXMJymIzkyi1rhlfG7+32wmFGunonn2NmgTUl+aGW+3oR YBNA2o3xDzTJDK3NxWeOcUaMcPVr0Kk3ntgwyOdiAYBtse7QQoL5TyGqvy6PWJe7L4WAB3 by9W5dkmC0ZOirWvGcPGjsBpPcgtRZMzyTGRYdZXWxcHH190UEb1vuaFqUD19w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z02wY4sVJzfcX; Fri, 21 Feb 2025 21:15: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 51LLFfAj041332; Fri, 21 Feb 2025 21:15:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51LLFfc3041329; Fri, 21 Feb 2025 21:15:41 GMT (envelope-from git) Date: Fri, 21 Feb 2025 21:15:41 GMT Message-Id: <202502212115.51LLFfc3041329@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 2eef41e55385 - main - Revert "vm_page: define partial page invalidate" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2eef41e55385333f9535240f3d31a5a71f718d06 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=2eef41e55385333f9535240f3d31a5a71f718d06 commit 2eef41e55385333f9535240f3d31a5a71f718d06 Author: Doug Moore AuthorDate: 2025-02-21 21:14:54 +0000 Commit: Doug Moore CommitDate: 2025-02-21 21:14:54 +0000 Revert "vm_page: define partial page invalidate" A negative review arrived as this was being committed, so undo and reevaluate. This reverts commit 5611a38d818587b307e1fb110f72d2996c170035. --- sys/fs/tmpfs/tmpfs_subr.c | 47 ++++++++++++++++++++++++++++++++++++++++---- sys/kern/uipc_shm.c | 47 ++++++++++++++++++++++++++++++++++++++++---- sys/vm/vm_page.c | 50 ----------------------------------------------- sys/vm/vm_page.h | 2 -- 4 files changed, 86 insertions(+), 60 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 0cac19ed3780..41d1f27caf13 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -493,11 +493,50 @@ static int tmpfs_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end, boolean_t ignerr) { - int error; + vm_page_t m; + int rv, error; + + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(base >= 0, ("%s: base %d", __func__, base)); + KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, + end)); + error = 0; + +retry: + m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); + if (m != NULL) { + MPASS(vm_page_all_valid(m)); + } else if (vm_pager_has_page(object, idx, NULL, NULL)) { + m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL | + VM_ALLOC_WAITFAIL); + if (m == NULL) + goto retry; + vm_object_pip_add(object, 1); + VM_OBJECT_WUNLOCK(object); + rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); + if (rv == VM_PAGER_OK) { + /* + * Since the page was not resident, and therefore not + * recently accessed, immediately enqueue it for + * asynchronous laundering. The current operation is + * not regarded as an access. + */ + vm_page_launder(m); + } else { + vm_page_free(m); + m = NULL; + if (!ignerr) + error = EIO; + } + } + if (m != NULL) { + pmap_zero_page_area(m, base, end - base); + vm_page_set_dirty(m); + vm_page_xunbusy(m); + } - error = vm_page_partial_page_invalidate(object, idx, base, end); - if (ignerr) - error = 0; return (error); } diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 083e95432208..026611a59593 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -697,12 +697,51 @@ static int shm_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end) { - int error; + vm_page_t m; + int rv; - error = vm_page_partial_page_invalidate(object, idx, base, end); - if (error == EIO) + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(base >= 0, ("%s: base %d", __func__, base)); + KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, + end)); + +retry: + m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); + if (m != NULL) { + MPASS(vm_page_all_valid(m)); + } else if (vm_pager_has_page(object, idx, NULL, NULL)) { + m = vm_page_alloc(object, idx, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); + if (m == NULL) + goto retry; + vm_object_pip_add(object, 1); VM_OBJECT_WUNLOCK(object); - return (error); + rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); + if (rv == VM_PAGER_OK) { + /* + * Since the page was not resident, and therefore not + * recently accessed, immediately enqueue it for + * asynchronous laundering. The current operation is + * not regarded as an access. + */ + vm_page_launder(m); + } else { + vm_page_free(m); + VM_OBJECT_WUNLOCK(object); + return (EIO); + } + } + if (m != NULL) { + pmap_zero_page_area(m, base, end - base); + KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", + __func__, m)); + vm_page_set_dirty(m); + vm_page_xunbusy(m); + } + + return (0); } static int diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f0f3c1e85564..c105aafca40f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -5086,56 +5086,6 @@ out: return (VM_PAGER_OK); } -/* - * Fill a partial page with zeroes. - */ -int -vm_page_partial_page_invalidate(vm_object_t object, vm_pindex_t pindex, - int base, int end) -{ - vm_page_t m; - int rv; - - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(base >= 0, ("%s: base %d", __func__, base)); - KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, - end)); - -retry: - m = vm_page_grab(object, pindex, VM_ALLOC_NOCREAT); - if (m != NULL) { - MPASS(vm_page_all_valid(m)); - } else if (vm_pager_has_page(object, pindex, NULL, NULL)) { - m = vm_page_alloc(object, pindex, - VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); - if (m == NULL) - goto retry; - vm_object_pip_add(object, 1); - VM_OBJECT_WUNLOCK(object); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeup(object); - if (rv != VM_PAGER_OK) { - vm_page_free(m); - return (EIO); - } - - /* - * Since the page was not resident, and therefore not recently - * accessed, immediately enqueue it for asynchronous laundering. - * The current operation is not regarded as an access. - */ - vm_page_launder(m); - } else - return (0); - - pmap_zero_page_area(m, base, end - base); - KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", __func__, m)); - vm_page_set_dirty(m); - vm_page_xunbusy(m); - return (0); -} - /* * Locklessly grab a valid page. If the page is not valid or not yet * allocated this will fall back to the object lock method. diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b568fddab8d4..744688bf789b 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -627,8 +627,6 @@ vm_page_t vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_memattr_t memattr); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); -int vm_page_partial_page_invalidate(vm_object_t object, vm_pindex_t pindex, - int base, int end); vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int); vm_page_t vm_page_grab_unlocked(vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From nobody Sat Feb 22 00:25:44 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z077r3Cjyz5pdqs; Sat, 22 Feb 2025 00:25:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z077r1chpz3Wjk; Sat, 22 Feb 2025 00:25:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740183944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaiqwBlcdZn6mnHH/FYmUHGjpxgXeCQ69TRPwVEaj3Y=; b=QIl5jxmLErblEIBxb7TfpElUDfoY2AHIzFCJJY0wwm0LKGo7FaUPwLzV6HEixJqX6pu3pS bmaKWl6+gXWnG08kmYk0z5yIy5++RQ71GznwodRpaGKU0u07QuMYsCLiEVifFo8SeCd2UP Xmo/fPA4s7TRnNmR4NKQGAtP42mrdSkrBIXBr5j+b7A0ZV0oc70Hax4MUIeS9MnFSZwDw3 leWVYk8cHi3aWaG0I/tI0Hr2rP2syhFIJK4g+OmccRbPuaUMMVqsUdarNjPL9sNKg9HVb6 7lVazbDhNBW1rSz81GoRixCNV3F24qUKq/n03M+svmYSfrtkeVdykXvTTfhBkQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740183944; a=rsa-sha256; cv=none; b=NXdSSqX+aUD0z98o0+k/VylYZEwdFNDP3v/0/dU1Ft872fbkSbU3RHL3VNJ2zv+gSCQiD/ RHbvCqpY+MxjuudS33+uMxmNGKz2M9tpMDSGeQ7SRLdiASGC0YTMLtMtuiec0HyWg6kUu4 dt6lWvnQv5QUrsbhcwcVu5pFztshv1qzlJgZejxxsLmw7LY/rfk6naf+9Wdvt6Wg7uyO2A TxL9Uasz05fopmviDSLoKViZ4WBxASFrYmv90+n0cs3WtmvW68Ri+ULQvz129F8wIAeKSi sng21b1jB4Jx7B/HlJSwcTwFTAHsIhVzXEcrRjlbDeEHGhmz3czBaIJ/MLqplQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740183944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RaiqwBlcdZn6mnHH/FYmUHGjpxgXeCQ69TRPwVEaj3Y=; b=BIlY+bz2H/ySPcAyTlDk/1V+2jdpVQbaz+bkHnKRTZD9fprp0of59zwLxUwswMT+cbYRZR gqEOHruxLDB5LLFJBh+CK4IGEYCQNAbVqb7+Tk76hUjwLmip5fZ8U0A0lFCNgOxqoq8/bD gVdviIpynJn07wbNlECBTjYpIJfmPSsnIUxuSzUPQRK7OuUkcLKD/pwVzMHAzFEHJBRzK1 n0qD5tyuXVUczXNpe7i6EDJVjSFhh4s9Q86TiLTbOOyuTn7zyWOX5Fk9SoWXn2oBzzyoy9 zUR2Co1DeQXr5pOqkyjjgAhSvLdNaVhXSgpP9M9m1pgVegWJ6GG30gGRRZ2JeQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z077r1Cr3zlhw; Sat, 22 Feb 2025 00:25: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 51M0PinJ094924; Sat, 22 Feb 2025 00:25:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M0PiR6094921; Sat, 22 Feb 2025 00:25:44 GMT (envelope-from git) Date: Sat, 22 Feb 2025 00:25:44 GMT Message-Id: <202502220025.51M0PiR6094921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2b1460110ec0 - main - nvmecontrol: Add more keys for CA page (Additional smart data) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b1460110ec0e991a7783a05005b94273bb9233a Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b1460110ec0e991a7783a05005b94273bb9233a commit 2b1460110ec0e991a7783a05005b94273bb9233a Author: Warner Losh AuthorDate: 2025-02-22 00:20:42 +0000 Commit: Warner Losh CommitDate: 2025-02-22 00:23:44 +0000 nvmecontrol: Add more keys for CA page (Additional smart data) Micron and Samsung also use this standard, though Micron is known to use a few different keys. Add the ones that public information say are the same among those the drives that have them. There's others, but either they aren't publicly documented in datasheets or nvme-cli code, or they vary betwen models and our code needs a fair amount of rework needed. Also print hex value for unknown keys. This allows scripts to more easily pick bytes out for those keys who have values that are encoded by packing multiple values into the 48-bit field. Sponsored by: Netflix --- sbin/nvmecontrol/modules/intel/intel.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sbin/nvmecontrol/modules/intel/intel.c b/sbin/nvmecontrol/modules/intel/intel.c index c94fdb356608..4229a48e4153 100644 --- a/sbin/nvmecontrol/modules/intel/intel.c +++ b/sbin/nvmecontrol/modules/intel/intel.c @@ -118,6 +118,8 @@ print_intel_write_lat_log(const struct nvme_controller_data *cdata __unused, voi /* * Table 19. 5.4 SMART Attributes. Others also implement this and some extra data not documented. + * Note: different models implement the same key values to mean different things. To fix that, + * we'd need to index this to a vendor/device values. */ void print_intel_add_smart(const struct nvme_controller_data *cdata __unused, void *buf, uint32_t size __unused) @@ -138,11 +140,15 @@ print_intel_add_smart(const struct nvme_controller_data *cdata __unused, void *b { 0xe2, "Timed: Media Wear" }, { 0xe3, "Timed: Host Read %" }, { 0xe4, "Timed: Elapsed Time" }, + { 0xe7, "Lifetime Temperature" }, + { 0xe8, "Power" }, { 0xea, "Thermal Throttle Status" }, { 0xf0, "Retry Buffer Overflows" }, { 0xf3, "PLL Lock Loss Count" }, { 0xf4, "NAND Bytes Written" }, { 0xf5, "Host Bytes Written" }, + { 0xf9, "NAND GiB Written" }, + { 0xfa, "NAND GiB Read" }, }; printf("Additional SMART Data Log\n"); @@ -170,11 +176,19 @@ print_intel_add_smart(const struct nvme_controller_data *cdata __unused, void *b case 0xe2: printf("%-32s: %3d %.3f%%\n", name, normalized, raw / 1024.0); break; + case 0xe7: + printf("%-32s: %3d %#jx max: %dK min: %dK cur: %dK\n", name, normalized, + (uintmax_t)raw, le16dec(walker+5), le16dec(walker+7), le16dec(walker+9)); + break; + case 0xe8: + printf("%-32s: %3d %#jx max: %dW min: %dW cur: %dW\n", name, normalized, + (uintmax_t)raw, le16dec(walker+5), le16dec(walker+7), le16dec(walker+9)); + break; case 0xea: printf("%-32s: %3d %d%% %d times\n", name, normalized, walker[5], le32dec(walker+6)); break; default: - printf("%-32s: %3d %ju\n", name, normalized, (uintmax_t)raw); + printf("%-32s: %3d %ju %#jx\n", name, normalized, (uintmax_t)raw, (uintmax_t)raw); break; } walker += 12; @@ -190,6 +204,6 @@ NVME_LOGPAGE(intel_rlat, NVME_LOGPAGE(intel_wlat, INTEL_LOG_WRITE_LAT_LOG, "intel", "Write Latencies", print_intel_write_lat_log, DEFAULT_SIZE); -NVME_LOGPAGE(intel_smart, +NVME_LOGPAGE(intel_smart, /* Note: Samsung and Micron also use this */ INTEL_LOG_ADD_SMART, "intel", "Extra Health/SMART Data", print_intel_add_smart, DEFAULT_SIZE); From nobody Sat Feb 22 00:25:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z077s4cF0z5nfXl; Sat, 22 Feb 2025 00:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z077s2dPBz3XBM; Sat, 22 Feb 2025 00:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740183945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZU0ZK8S8jOD7d+vDbE5SWBgihiSBpMT82N9WVBs/52o=; b=p88EOP9BQUbgJWaLYMbopjcBNPdGcO8rqD3BXXnYpFwKqRB4rX30jn+0Q+U9ob/sDowIJN wGhe8l8xmd/bcSqJRzOAP+tflSqolf5kAe3NoNUw1J+cmr//ycFcXohh/4mV3i7h6fqbif SfuWQ7zTQZPe7vauyPq68/mZghJIOydcMBiwAg5sIJSJ5VVxheiQveOA+NaThaKwQ293xb 9GPYxH8Kh73Ifxqpxe/kG31Dy1sXMcxsLFM2JsuNUdnHvPtkjotB9dRfpZNRRcELTCd+bs Uwa3Y1aZqHKtI+uBLn0r7wt2Fm/CxBDHOx1B57s8t38cmQhZaBf5UAW3DDytQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740183945; a=rsa-sha256; cv=none; b=m9tQ0pIaCBy7A2CIgY3cKLqylKOl5z06MXkxPxbnrTLZQ1godcvEeXOV6GZvUK7MO5yY/B ZrcauSAaIdWJ+lWwmhX9Hvuzu3YqDqVFhRSl8GSyR4eSXswd0dqacAGjek4FbNNRSQPjWy QYSflpF7qZKN7ywfXKnYilywPbViqtExZQUm/3noBkk8fsepOFW1kGm83ncGZ40f0NB5jH 5PlMPCK6NEH/s4d3+o2MdDsVMINDT3qukv3KyeL6rwTbJMMngJsiFjCYDbt5kIw2KRvt52 F/DwoeQUBLY5a1zU0SOJ9CA5FxLcGdoDY0+DPNIpwOt1XB7PBwfFu76sof/5Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740183945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZU0ZK8S8jOD7d+vDbE5SWBgihiSBpMT82N9WVBs/52o=; b=tO5X/+9KdKIxr9q9MVF9q3iZbYGy3zgoVSTriZQpsOaKPhJUKKCIcy2Hcqu+TFm72WHzdg v1oGPMfNANnp+90YV3JhSw/7arTZbOAXyi/kLNRD2OSzGu3vkxaDcjZWnE0nieOuh49Nt4 GreVwitgwVCJrBFQkWCg6ioAJYvEKgyF3jABNpPIpjCI0WsKVqL8Iz7rcPrwHkyWAbLN/b 7vvVaDJYhIPbnv9yjqrWZdkRB+yElsfXt2qfYs5xtAJ+/XMz+4BPvZCY5MjWWbbTInHjsU pAwBuJYvgJO5cIPoH1BQiHJQX0B0OiYy0bjE9afStVq7OJJ34Aba01Ci+dG/ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z077s28bVzl8l; Sat, 22 Feb 2025 00:25: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 51M0PjMP094957; Sat, 22 Feb 2025 00:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M0PjCo094954; Sat, 22 Feb 2025 00:25:45 GMT (envelope-from git) Date: Sat, 22 Feb 2025 00:25:45 GMT Message-Id: <202502220025.51M0PjCo094954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 94ffbdb46204 - main - sys: Empty hints files List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94ffbdb4620438499db9e72de2d42615aa51d2cd Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=94ffbdb4620438499db9e72de2d42615aa51d2cd commit 94ffbdb4620438499db9e72de2d42615aa51d2cd Author: Warner Losh AuthorDate: 2025-02-22 00:25:32 +0000 Commit: Warner Losh CommitDate: 2025-02-22 00:25:32 +0000 sys: Empty hints files Create empty hints files for these platforms. They don't normally need a hints file, but people use them for device instance wiring. It's less confusing if they always exist. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D49052 --- sys/arm/conf/GENERIC.hints | 2 ++ sys/arm64/conf/GENERIC.hints | 2 ++ sys/riscv/conf/GENERIC.hints | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sys/arm/conf/GENERIC.hints b/sys/arm/conf/GENERIC.hints new file mode 100644 index 000000000000..9f009dcd175f --- /dev/null +++ b/sys/arm/conf/GENERIC.hints @@ -0,0 +1,2 @@ +# Empty device.hints +# Use to wire devices in the system to specific driver instances diff --git a/sys/arm64/conf/GENERIC.hints b/sys/arm64/conf/GENERIC.hints new file mode 100644 index 000000000000..9f009dcd175f --- /dev/null +++ b/sys/arm64/conf/GENERIC.hints @@ -0,0 +1,2 @@ +# Empty device.hints +# Use to wire devices in the system to specific driver instances diff --git a/sys/riscv/conf/GENERIC.hints b/sys/riscv/conf/GENERIC.hints new file mode 100644 index 000000000000..9f009dcd175f --- /dev/null +++ b/sys/riscv/conf/GENERIC.hints @@ -0,0 +1,2 @@ +# Empty device.hints +# Use to wire devices in the system to specific driver instances From nobody Sat Feb 22 01:23:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z08Qv5vjcz5nlCS; Sat, 22 Feb 2025 01:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z08Qv56VHz3dXh; Sat, 22 Feb 2025 01:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740187431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAJ4gceK7OKoy50Qtw6b/j+YsKJc1U/svfY8mygKYoQ=; b=ZL19yD6+V428wjy55cdhRBKJPpJm0dfbbxV89igcZupBnGwM4noV6ioYkFeYNj4jp+KA6L CRL3y9/CFpjEbAE75sw7FTgpFysFeQ99FYD6c0nPDgK4Z5G5uEK/KfYnCDVSAMR602CL31 y+bAhktNBWyij5HPfg+aBEMParedBlUi02QDLqCrmtXUmFtY1LnhGwenJtDu2DP2DBQmWE C3p46bHt786So4JFflqvDv5khTJ1a827SzxKanc9zvCCXkaIj4ZisQviWa1AqUB8IWGvdn eB1nIpkaGlNqA4TaWCg/dMV6Hw4gHSvmr692i76ofc3AM+jP2/0Zx/aOHj3Liw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740187431; a=rsa-sha256; cv=none; b=BYgzcXhRHssu+fQRC/2Efusx/oSp+UomfcthTqOSoJh6gWY5vWXdgdFLCn12hIrpW9hhL6 ehq2f0x2BuifGmPyud6NWpnErc7HuhjTmPPm6Wfuu91YJhXeAFCWTW4kcgq2gWtWCHPXjI 4Z2G+aCmOd1FYJTJ49PD67IgymcTbGCn7hjwYCkAnek4PsulhFjfFrxTDJ83fik7wtlnyR j0ENCdHIQ+yVDlYfn9AycBc/u2IJf6ZtE9W0BlT3yMnwVV7kuATx/IWTqWvb6eVxhVScMx ejvLrXnuTewOquetkIaRyPC4lK/T7t4/0nsXiXmzbSZ4IrXkKFgcp8bs3Cx+Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740187431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fAJ4gceK7OKoy50Qtw6b/j+YsKJc1U/svfY8mygKYoQ=; b=mTQVKg1JP2sliyKmfaI2J4CmKIksUgusZwJZ7/zf/EEAnawCrX6ATywhZrsxBDMRqH0jr0 zRsdgDYbBWmiJ4ZvC74chuap1fH2xYW52Nzv3wvNtrju7FiWore5xLiUahdTipNaY2fwfB q3a3r5KG8c9BmbobqMMb3SIWoSb+0Iv+T7VUFIQegUJDjYJa2JUFHEkpB5h5+lYAQVBJmy SVy3MjmxZGwVWtZV6Mmy/1WEGGmQVRfBQ0M6ubEjK6dEPeJApxCSXa22GYG3lRsmSrW94V IB8O9Fcf/zvw/J3HSYn6iNINdPik7T2dsO/9PKuYpv06uKiuixShX7QV0XYLdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z08Qv3zc8zmpF; Sat, 22 Feb 2025 01:23:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51M1Npc2005937; Sat, 22 Feb 2025 01:23:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M1NpNC005931; Sat, 22 Feb 2025 01:23:51 GMT (envelope-from git) Date: Sat, 22 Feb 2025 01:23:51 GMT Message-Id: <202502220123.51M1NpNC005931@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: bb1dc6cf9c36 - main - vm_page: define partial page invalidate List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb1dc6cf9c3671c82318e22825d86d54c8d672cb Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=bb1dc6cf9c3671c82318e22825d86d54c8d672cb commit bb1dc6cf9c3671c82318e22825d86d54c8d672cb Author: Doug Moore AuthorDate: 2025-02-22 01:22:47 +0000 Commit: Doug Moore CommitDate: 2025-02-22 01:22:47 +0000 vm_page: define partial page invalidate Two different functions in different files do the same thing - fill a partial page with zeroes. Add that functionality to vm_page.c and remove it elsewhere to avoid code duplication. Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D49096 --- sys/fs/tmpfs/tmpfs_subr.c | 47 ++++--------------------------------------- sys/kern/uipc_shm.c | 47 ++++--------------------------------------- sys/vm/vm_page.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++ sys/vm/vm_page.h | 2 ++ 4 files changed, 61 insertions(+), 86 deletions(-) diff --git a/sys/fs/tmpfs/tmpfs_subr.c b/sys/fs/tmpfs/tmpfs_subr.c index 41d1f27caf13..37be0b762579 100644 --- a/sys/fs/tmpfs/tmpfs_subr.c +++ b/sys/fs/tmpfs/tmpfs_subr.c @@ -493,50 +493,11 @@ static int tmpfs_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end, boolean_t ignerr) { - vm_page_t m; - int rv, error; - - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(base >= 0, ("%s: base %d", __func__, base)); - KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, - end)); - error = 0; - -retry: - m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); - if (m != NULL) { - MPASS(vm_page_all_valid(m)); - } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL | - VM_ALLOC_WAITFAIL); - if (m == NULL) - goto retry; - vm_object_pip_add(object, 1); - VM_OBJECT_WUNLOCK(object); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeup(object); - if (rv == VM_PAGER_OK) { - /* - * Since the page was not resident, and therefore not - * recently accessed, immediately enqueue it for - * asynchronous laundering. The current operation is - * not regarded as an access. - */ - vm_page_launder(m); - } else { - vm_page_free(m); - m = NULL; - if (!ignerr) - error = EIO; - } - } - if (m != NULL) { - pmap_zero_page_area(m, base, end - base); - vm_page_set_dirty(m); - vm_page_xunbusy(m); - } + int error; + error = vm_page_grab_zero_partial(object, idx, base, end); + if (ignerr) + error = 0; return (error); } diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 026611a59593..b4016e9dd6bf 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -697,51 +697,12 @@ static int shm_partial_page_invalidate(vm_object_t object, vm_pindex_t idx, int base, int end) { - vm_page_t m; - int rv; + int error; - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(base >= 0, ("%s: base %d", __func__, base)); - KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, - end)); - -retry: - m = vm_page_grab(object, idx, VM_ALLOC_NOCREAT); - if (m != NULL) { - MPASS(vm_page_all_valid(m)); - } else if (vm_pager_has_page(object, idx, NULL, NULL)) { - m = vm_page_alloc(object, idx, - VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); - if (m == NULL) - goto retry; - vm_object_pip_add(object, 1); + error = vm_page_grab_zero_partial(object, idx, base, end); + if (error == EIO) VM_OBJECT_WUNLOCK(object); - rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); - VM_OBJECT_WLOCK(object); - vm_object_pip_wakeup(object); - if (rv == VM_PAGER_OK) { - /* - * Since the page was not resident, and therefore not - * recently accessed, immediately enqueue it for - * asynchronous laundering. The current operation is - * not regarded as an access. - */ - vm_page_launder(m); - } else { - vm_page_free(m); - VM_OBJECT_WUNLOCK(object); - return (EIO); - } - } - if (m != NULL) { - pmap_zero_page_area(m, base, end - base); - KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", - __func__, m)); - vm_page_set_dirty(m); - vm_page_xunbusy(m); - } - - return (0); + return (error); } static int diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c105aafca40f..e4c2aadf5d56 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -5086,6 +5086,57 @@ out: return (VM_PAGER_OK); } +/* + * Fill a partial page with zeroes. The object write lock is held on entry and + * exit, but may be temporarily released. + */ +int +vm_page_grab_zero_partial(vm_object_t object, vm_pindex_t pindex, int base, + int end) +{ + vm_page_t m; + int rv; + + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(base >= 0, ("%s: base %d", __func__, base)); + KASSERT(end - base <= PAGE_SIZE, ("%s: base %d end %d", __func__, base, + end)); + +retry: + m = vm_page_grab(object, pindex, VM_ALLOC_NOCREAT); + if (m != NULL) { + MPASS(vm_page_all_valid(m)); + } else if (vm_pager_has_page(object, pindex, NULL, NULL)) { + m = vm_page_alloc(object, pindex, + VM_ALLOC_NORMAL | VM_ALLOC_WAITFAIL); + if (m == NULL) + goto retry; + vm_object_pip_add(object, 1); + VM_OBJECT_WUNLOCK(object); + rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); + VM_OBJECT_WLOCK(object); + vm_object_pip_wakeup(object); + if (rv != VM_PAGER_OK) { + vm_page_free(m); + return (EIO); + } + + /* + * Since the page was not resident, and therefore not recently + * accessed, immediately enqueue it for asynchronous laundering. + * The current operation is not regarded as an access. + */ + vm_page_launder(m); + } else + return (0); + + pmap_zero_page_area(m, base, end - base); + KASSERT(vm_page_all_valid(m), ("%s: page %p is invalid", __func__, m)); + vm_page_set_dirty(m); + vm_page_xunbusy(m); + return (0); +} + /* * Locklessly grab a valid page. If the page is not valid or not yet * allocated this will fall back to the object lock method. diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 744688bf789b..5a166d9ba44c 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -627,6 +627,8 @@ vm_page_t vm_page_alloc_noobj_contig_domain(int domain, int req, u_long npages, vm_memattr_t memattr); void vm_page_bits_set(vm_page_t m, vm_page_bits_t *bits, vm_page_bits_t set); bool vm_page_blacklist_add(vm_paddr_t pa, bool verbose); +int vm_page_grab_zero_partial(vm_object_t object, vm_pindex_t pindex, int base, + int end); vm_page_t vm_page_grab(vm_object_t, vm_pindex_t, int); vm_page_t vm_page_grab_unlocked(vm_object_t, vm_pindex_t, int); int vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, From nobody Sat Feb 22 01:26:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z08VS6Cf8z5nlYh; Sat, 22 Feb 2025 01:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z08VS5bXCz3dg4; Sat, 22 Feb 2025 01:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740187616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gABkzUdfdcEy2NeuedfEXLduktxE7oM3RIuGcZGfDrU=; b=EUXcqUjCcIU9H57PyUAABFcAUkHcYXgccrEJWe2m0OZoLCGvCR7DT9mLtoFRBEoXiq2agw 9UjMNHFtdBB+9g0ov8vB2KX3FUGE4vFbqzoA3P0GghBQ3Td+Q1q+Y1wDwSVUdJL0aJpIfG /pc0Txixa81BE0VslFweq0Y/ir6gN7mkxpVpD9wqyGtR2LBiAakQn+zHvgny9upkvJiYDI fBiAhYmAu2NDku8HM47K565wo18zYYtpVuaMhVsaff50PMdtaDAgdJTNtby0hWVbdH1He7 18OJ9dTG7DHGmJXM00O2U8LhwOeA3dyfiQ0xqelKIYGydiXZQeEnAabaNxgkTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740187616; a=rsa-sha256; cv=none; b=kurzJa8uCCYU71ZbMN6O3VUcCU5UwFGlOxqOPesUAxE0j54yomrBPT2HlYu60RCZSz+5/A ALOaPaPft5aPJt+QVfkxKBklciuiPLqz0X6v/WjYxuQCs2H/l+e6V1j/CKYJTresjT1uP1 UoMLr54sOJIN/PTb8bS+SIBWmn1JdmQAuPgoXM++0AiGfDaiDuaK0GitPVcRTK35OBMGjr Bq4Isl+wbBk81xK1ZAI7c200Ugkyx3NecECNgADyrXOffeEeDfKhSZNegTc1zVkXyIDHcv vyIvY6kzocF4X48zA1dTk8HDaAXwEQf6/Mpx26e3zenOl63Kp0tMI7YwWR3MUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740187616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gABkzUdfdcEy2NeuedfEXLduktxE7oM3RIuGcZGfDrU=; b=riYPFFTZ/8d0Ogz6gILMUiKU3KgYOoULg0TDSiN5tZLuuCRG1a0YWLconsfDa1rVu9Z/NO gUzJZHg/2WbwPfQQctd49T5qH0pngMFz2t00k0zVRuBZ71dhoDD52AvxCE1uNrK/Iwhl4Z K8r345lS2JekbIwHy9cjVZIdC8UN5KYroi42g15+TxUI7zzpZguJx9fG+ge1xVFErooAd0 sPmuzf6MbJtfPJDF5mA+GZAfC/uvfBm2fANkxz7qrBFFLA8+m+ImfERwN6DNpIrgIw90dV +OVTaVfLEcQy6Y9niB2OEMj/8I3hsUmb8dptxw/WHSBrzp16xkpqrQdF4Bn2/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 4Z08VS4qz9zmpG; Sat, 22 Feb 2025 01:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51M1Qum5006888; Sat, 22 Feb 2025 01:26:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M1Qufx006885; Sat, 22 Feb 2025 01:26:56 GMT (envelope-from git) Date: Sat, 22 Feb 2025 01:26:56 GMT Message-Id: <202502220126.51M1Qufx006885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4b79443927ec - main - umtx: Fix a bug in do_lock_pp() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b79443927ec2c53514e73b06eb2a9d241882585 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4b79443927ec2c53514e73b06eb2a9d241882585 commit 4b79443927ec2c53514e73b06eb2a9d241882585 Author: Mark Johnston AuthorDate: 2025-02-22 01:23:31 +0000 Commit: Mark Johnston CommitDate: 2025-02-22 01:26:38 +0000 umtx: Fix a bug in do_lock_pp() If the lock is unowned (i.e., owner == UMUTEX_CONTESTED), we might get a spurious failure, and in that case we need to retry the loop. Otherwise, the calling thread can end up sleeping forever. The same problem exists in do_set_ceiling(), which open-codes do_lock_pp(), so fix it there too. Reviewed by: olce Reported by: Daniel King MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D49031 --- sys/kern/kern_umtx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 938dcf2ff1cb..f9189024d629 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -2616,6 +2616,10 @@ do_lock_pp(struct thread *td, struct umutex *m, uint32_t flags, } } else if (owner == UMUTEX_RB_NOTRECOV) { error = ENOTRECOVERABLE; + } else if (owner == UMUTEX_CONTESTED) { + /* Spurious failure, retry. */ + umtxq_unbusy_unlocked(&uq->uq_key); + continue; } if (try != 0) @@ -2825,6 +2829,10 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling, } else if (owner == UMUTEX_RB_NOTRECOV) { error = ENOTRECOVERABLE; break; + } else if (owner == UMUTEX_CONTESTED) { + /* Spurious failure, retry. */ + umtxq_unbusy_unlocked(&uq->uq_key); + continue; } /* From nobody Sat Feb 22 02:12:43 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z09WJ1lclz5nq8l; Sat, 22 Feb 2025 02:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z09WJ0v3yz3hrh; Sat, 22 Feb 2025 02:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdVIfSbkNf1WbsTCWWvTHQ2likCCgC6JcHRubXzeL/A=; b=BNN1FO1Xa80Jkuea2rrBpGO3FZ644AijATfrPLl8udmjbRNqXxLKDb4GsuKBiBs9weYRhJ Akms2J+XygrCD5ROsKBniGrPNkqdbeOgTu+pRipknLCfIkwRWvFsvmllgzfWNWta8s/fZR NdpT+hRJym3ooREBsAkWO+kB1QKz8YYC9KWU1gXNX3xiLt5ayudXJ+mzT8rYThpMH9sTV9 t/kkceZTOZ11aNlto4cfwfRPKJX5+XylXvM663tYOe6Wlm3CUWo2q6rsTAlbn1azbf1I69 NutE/q8zlnqSbjz5KsjLuJoDFcVaOYj8+YUm+rrm7FJspzcRdnblUZBqGWkRAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740190364; a=rsa-sha256; cv=none; b=XXDnY9i27sgmQ12r7aNim2RXuYV/kA9sz3pKzJ+yWOPYBteEPDfHnOKHJdqCRIaYNCNDY6 Iv40dMRVZn04wUzUwV9NG2Y5x4MDz75dlLnO4AjbxP0goHlRoJRVKl7zx/4iFGX+DFFd6g BU+XLhZG75+p+T83cOXF7WcM5ncoSZQr+FafHCzzVD4McvHN6c5kih0diCIctRRgEtodhZ xBxt+B233tMY/bED04lkhQJtzLGwIZ9uXaFQjU+VvDohNJkDKa3U8zGK+UdEcSEEx5VCwB h2EfnUkTpMfBRgZqTeZjz0QIYf2IFj5f/KkVWa1y78Wdu7UWmlR6YG0hzeW9gQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jdVIfSbkNf1WbsTCWWvTHQ2likCCgC6JcHRubXzeL/A=; b=lCGMft/nJFZF1xTWb8f5Ejz1hbReHRp6vPOBw4MHBxFLJ9g6aMJu38GQ78rSFDPDHs3G4I enaa7rYcy2a55SXnc2KU+ifl+tT01uPmHX0ci0mNJQOKoPEY5vEYt3JSsaowTKE0g9PJbr rrHV8EPV3KvuT46wqFbAsESE84kyz1Yd60bUi5DNJE97htrQ6SCR1JiIBz6K85v7AnO98p ZgKYEz4jgR6BNcVNS4oIQyF2odgKFM04g2ONA9d2rZ3C1cU0b694x1aK0IqKjTw4vMfjn8 8+3NIVc69AeC/8jYyQWbd7b/f5TvRrwahxYIxmO+RjnfGkF8bJTulI+hVHhUUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z09WJ0D0LzpVk; Sat, 22 Feb 2025 02:12: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 51M2ChNd099220; Sat, 22 Feb 2025 02:12:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M2ChPs099217; Sat, 22 Feb 2025 02:12:43 GMT (envelope-from git) Date: Sat, 22 Feb 2025 02:12:43 GMT Message-Id: <202502220212.51M2ChPs099217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 197fc4cad097 - main - netinet: rename in_broadcast() to in_ifnet_broadcast() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 197fc4cad0973efa4bb2ab86ed537eafa3ae254e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=197fc4cad0973efa4bb2ab86ed537eafa3ae254e commit 197fc4cad0973efa4bb2ab86ed537eafa3ae254e Author: Gleb Smirnoff AuthorDate: 2025-02-22 02:10:53 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-22 02:10:53 +0000 netinet: rename in_broadcast() to in_ifnet_broadcast() This aligns with existing in_ifaddr_broadcast() and aligns with other simple functions or macros with bare "in_" prefix that operator just on struct in_addr and nothing else, e.g. in_nullhost(). No functional change. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49041 --- sys/netinet/in.c | 2 +- sys/netinet/in.h | 2 +- sys/netinet/in_rmx.c | 2 +- sys/netinet/ip_divert.c | 2 +- sys/netinet/sctp_os_bsd.h | 2 +- sys/netinet/tcp_input.c | 6 +++--- sys/netinet/udp_usrreq.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 0cf148c38575..7d8cbc6725ad 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1293,7 +1293,7 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) * Return true if the address might be a local broadcast address. */ bool -in_broadcast(struct in_addr in, struct ifnet *ifp) +in_ifnet_broadcast(struct in_addr in, struct ifnet *ifp) { struct ifaddr *ifa; diff --git a/sys/netinet/in.h b/sys/netinet/in.h index e03fe3391388..0ee4200017b5 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -672,7 +672,7 @@ int getsourcefilter(int, uint32_t, struct sockaddr *, socklen_t, struct ifnet; struct mbuf; /* forward declarations for Standard C */ struct in_ifaddr; -bool in_broadcast(struct in_addr, struct ifnet *); +bool in_ifnet_broadcast(struct in_addr, struct ifnet *); bool in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index aedfd0bc08c7..b8599143b991 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -71,7 +71,7 @@ rib4_set_nh_pfxflags(u_int fibnum, const struct sockaddr *addr, const struct soc * add these routes to support some cases with active-active * load balancing. Given that, retain this support. */ - if (in_broadcast(addr4->sin_addr, nh->nh_ifp)) + if (in_ifnet_broadcast(addr4->sin_addr, nh->nh_ifp)) is_broadcast = true; } else if (mask4->sin_addr.s_addr == 0) nhop_set_pxtype_flag(nh, NHF_DEFAULT); diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 6bc76e0be111..5a561814cdb5 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -538,7 +538,7 @@ div_output_inbound(int family, struct socket *so, struct mbuf *m, */ if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) m->m_flags |= M_MCAST; - else if (in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) + else if (in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) m->m_flags |= M_BCAST; netisr_queue_src(NETISR_IP, (uintptr_t)so, m); DIVSTAT_INC(inbound); diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h index eb0caec942e9..9cec02aa6a07 100644 --- a/sys/netinet/sctp_os_bsd.h +++ b/sys/netinet/sctp_os_bsd.h @@ -342,7 +342,7 @@ typedef struct callout sctp_os_timer_t; } while(0) /* Other m_pkthdr type things */ -#define SCTP_IS_IT_BROADCAST(dst, m) ((m->m_flags & M_PKTHDR) ? in_broadcast(dst, m->m_pkthdr.rcvif) : 0) +#define SCTP_IS_IT_BROADCAST(dst, m) ((m->m_flags & M_PKTHDR) ? in_ifnet_broadcast(dst, m->m_pkthdr.rcvif) : 0) #define SCTP_IS_IT_LOOPBACK(m) ((m->m_flags & M_PKTHDR) && ((m->m_pkthdr.rcvif == NULL) || (m->m_pkthdr.rcvif->if_type == IFT_LOOP))) /* This converts any input packet header diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 12dc4670f531..e21043fac0cf 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1290,7 +1290,7 @@ tfo_socket_result: * global or subnet broad- or multicast address. * Note that it is quite possible to receive unicast * link-layer packets with a broadcast IP address. Use - * in_broadcast() to find them. + * in_ifnet_broadcast() to find them. */ if (m->m_flags & (M_BCAST|M_MCAST)) { if ((s = tcp_log_addrs(&inc, th, NULL, NULL))) @@ -1335,7 +1335,7 @@ tfo_socket_result: if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || ip->ip_src.s_addr == htonl(INADDR_BROADCAST) || - in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) { + in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) { if ((s = tcp_log_addrs(&inc, th, NULL, NULL))) log(LOG_DEBUG, "%s; %s: Listen socket: " "Connection attempt from/to broad- " @@ -3522,7 +3522,7 @@ tcp_dropwithreset(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || ip->ip_src.s_addr == htonl(INADDR_BROADCAST) || - in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) + in_ifnet_broadcast(ip->ip_dst, m->m_pkthdr.rcvif)) goto drop; } #endif diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 8278efcae60c..6c855e7a756b 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -583,7 +583,7 @@ udp_input(struct mbuf **mp, int *offp, int proto) } if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - in_broadcast(ip->ip_dst, ifp)) + in_ifnet_broadcast(ip->ip_dst, ifp)) return (udp_multi_input(m, proto, udp_in)); pcbinfo = udp_get_inpcbinfo(proto); From nobody Sat Feb 22 02:12:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z09WK2fdqz5nqLS; Sat, 22 Feb 2025 02:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z09WK1lC0z3hcX; Sat, 22 Feb 2025 02:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QICpMOY1BSNOr9v2He9ccaE2dVxtmYvm42JZN9Rpo6s=; b=WeQR4qYZ8jY9oMLVCK+fzJkFMHAGI762NmBr6iI/msgkdOTZoJzJZGBIELqG0vJMCe0hlk 7atJ7e0SHiarQrPlArqo8igs7N15kuzy+RGuBHh1QQhnR/IPmDbnPsIIvfGOV/EaZXQi0T AqXizzUWASzqeA1z+zbcBSzux7vIWaSFRqJ/lmMFRhcXXS0IDQFbSFkMkKo7PBWsgGe5y+ Hsi29Kiq7N/XuCmARi91dQMZ2u49w/1HXxAtN4L8gY/m2MW11kUQU4XBV68Zqt1snt1kvf UYY4skuEtzy+OdPQACe5NzzMGfJEP4CdJcbj2LtYPQaRAcdZ5xqo9Tq4+Z2PSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740190365; a=rsa-sha256; cv=none; b=j8unIulUwAhHHSQf65mQqsBKOTGhwgj57side03WSbLCOJH2IQ9LqMJPW8wFIHSQ2LGaki 7tQiIGIikb82Po6e5Z2XicjJhx/DeUVrzDTlS6SuMX1ySwIs8+PoNnkKiGPad5WGYHaycA YY/vF8Hn3qHX58vPPRy8+v9uX5TUgMrOmE/UwQOHh4oCGlgm4ZocdjV2J4+BY9fkRPgVq4 bZuwQgju/JonV8RoLRdu8y6dWZJq2Q2rNTlbXoXjTcN7RY8sJ5jhNAMwv0RqT2g/XmS+OC 6VoOqJ5ySzCLJLvBcVqkijlsANczzalt2T5nwb8v12dsC60H+J2DF0rSiuPfOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QICpMOY1BSNOr9v2He9ccaE2dVxtmYvm42JZN9Rpo6s=; b=NSlwIh0qNqce6wDsu83LNP/mrgHYAgr+mOIJpmIZbwAmT7jev1pj0qChBOPUVhUUEbpGAN aAQi6fv+MZJQTJNpGm8oO7qCJYqFcT6MB1KoF5oCJtQgyto69j728SuoN1f10kCZMwUgWo u7HeGWoCB6VsS83XDVAejQZfdllH29U8SG2TJL2eU3NWVbI+JNvycqKE5szkwgHNmBmLWs uIxjqqjlayNA2kRBEsG9RoYboNCOy6EVAc+7AWQejGVPC/ceEB9pFP9YSBJdrwmveuBIWN ROXqwJzEZYffClfhZQoup/Ev3r0EdOa+8eeZy3jTnSrR2RWjQgnWme6GPOU0Ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z09WK1FlDzpfJ; Sat, 22 Feb 2025 02:12: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 51M2Cj0V099253; Sat, 22 Feb 2025 02:12:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M2CjUT099250; Sat, 22 Feb 2025 02:12:45 GMT (envelope-from git) Date: Sat, 22 Feb 2025 02:12:45 GMT Message-Id: <202502220212.51M2CjUT099250@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 3b281d1421a7 - main - netinet: enforce broadcast mode for all-ones and all-zeroes destinations List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b281d1421a78b588c5fc4182009ce62d8823d95 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=3b281d1421a78b588c5fc4182009ce62d8823d95 commit 3b281d1421a78b588c5fc4182009ce62d8823d95 Author: Gleb Smirnoff AuthorDate: 2025-02-22 02:11:00 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-22 02:11:00 +0000 netinet: enforce broadcast mode for all-ones and all-zeroes destinations When a socket has SO_BROADCAST set and destination address is INADDR_ANY or INADDR_BROADCAST, the kernel shall pick up first broadcast capable interface and broadcast the packet out of it. Since this API is not reliable on a machine with > 1 broadcast capable interfaces, all practical software seems to use IP_ONESBCAST or other mechanisms to send broadcasts. This has been broken at least since FreeBSD 6.0, see bug 99558. Back then the problem was in the fact that in_broadcast() check was always done against the gateway address, not the destination address. Later, with 90cc51a1ab4be, a second problem piled on top - we aren't checking for INADDR_ANY and INADDR_BROADCAST at all. Better late than never, fix that by checking destination address. PR: 99558 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49042 --- sys/netinet/in.h | 7 +++++++ sys/netinet/ip_output.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 0ee4200017b5..fa710af7cd58 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -686,6 +686,13 @@ char *inet_ntop(int, const void *, char *, socklen_t); /* in libkern */ int inet_pton(int af, const char *, void *); /* in libkern */ void in_ifdetach(struct ifnet *); +static inline bool +in_broadcast(struct in_addr in) +{ + return (in.s_addr == htonl(INADDR_BROADCAST) || + in.s_addr == htonl(INADDR_ANY)); +} + #define in_hosteq(s, t) ((s).s_addr == (t).s_addr) #define in_nullhost(x) ((x).s_addr == INADDR_ANY) #define in_allhosts(x) ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP)) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 1811becbf387..35aaf85d6a4e 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -449,7 +449,8 @@ again: mtu = ifp->if_mtu; ip->ip_ttl = 1; isbroadcast = ifp->if_flags & IFF_BROADCAST ? - in_ifaddr_broadcast(dst->sin_addr, ia) : 0; + (in_broadcast(ip->ip_dst) || + in_ifaddr_broadcast(dst->sin_addr, ia)) : 0; src = IA_SIN(ia)->sin_addr; } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && imo != NULL && imo->imo_multicast_ifp != NULL) { @@ -502,8 +503,11 @@ again: gw = &nh->gw_sa; if (nh->nh_flags & NHF_HOST) isbroadcast = (nh->nh_flags & NHF_BROADCAST); - else if ((ifp->if_flags & IFF_BROADCAST) && (gw->sa_family == AF_INET)) - isbroadcast = in_ifaddr_broadcast(((const struct sockaddr_in *)gw)->sin_addr, ia); + else if ((ifp->if_flags & IFF_BROADCAST) && + (gw->sa_family == AF_INET)) + isbroadcast = in_broadcast(ip->ip_dst) || + in_ifaddr_broadcast( + ((const struct sockaddr_in *)gw)->sin_addr, ia); else isbroadcast = false; mtu = nh->nh_mtu; @@ -533,11 +537,12 @@ again: gw = &nh->gw_sa; ia = ifatoia(nh->nh_ifa); src = IA_SIN(ia)->sin_addr; - isbroadcast = (((nh->nh_flags & (NHF_HOST | NHF_BROADCAST)) == + isbroadcast = ((nh->nh_flags & (NHF_HOST | NHF_BROADCAST)) == (NHF_HOST | NHF_BROADCAST)) || ((ifp->if_flags & IFF_BROADCAST) && (gw->sa_family == AF_INET) && - in_ifaddr_broadcast(((const struct sockaddr_in *)gw)->sin_addr, ia))); + (in_broadcast(ip->ip_dst) || in_ifaddr_broadcast( + ((const struct sockaddr_in *)gw)->sin_addr, ia))); } /* Catch a possible divide by zero later. */ From nobody Sat Feb 22 02:12:46 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z09WL6cy1z5nqVP; Sat, 22 Feb 2025 02:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z09WL2sQZz3hrq; Sat, 22 Feb 2025 02:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB9mvnPi5R4SwtZ3srXpVE/YpejIgfrQUZeG2f2OI6o=; b=Haqk3HyP6zTmClQ6r9ETdzwtXTsADEl2uks11kk47lXeB7Pm4Fdc4wlj8fky64Qlwb65lU f1zBbjbgHPAejyenfqvk7uULoqVBTEB5c7gmmWaRWsueNLfUD1OJeY8Z/t/PZYmWPUjNRm 1Dt2S3KBq0pNST7aWIgkRw6aNGigoSrf5K2W72LDk9BDzhpKCJkLCDO9WJiYUdZLdXBsX6 ABC+yfrPKKpi4PDJr8bf2XgljeTJ8PLPoBdFybEHegDjgtiqvu/g+K8poLh5hsHHcwXEul Oq5hyFWKT93SoBXYMLYWG59gXvzuanfwd6mw0qnIpMjXtNl34dIyM2i+FCEYfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740190366; a=rsa-sha256; cv=none; b=AXYh6zPRjoOywnl1e3ndSFCBNL5qT1jjw7SBrfTYQiAJkvlolwNTk1KJr2d4Nw81fqStp/ gLrD4eB0YVjh+a/rV0N99ba/O5CMU9pGD4bEW01DY8CghxZXF3vVTd3EqvCafFJBTh/Clz DKGtGKG8EweoYFAv2SRJ0L8LeSCrMrXhUjJjNn5L2It3zJLu3DQZJ6Jar8PmSIF1dncmL4 8jyxAl+Q0/9ErE2zM+Gn3/9ml6gmOOx1/P/j0A3yVU20sHAoH7wh5NXvbxlCpOBQkDB9IM hbRE6P5PV3l9okR25xrfcoPYKpWX0jicGyeSdrNe962th35Xqj0QGmcldsYt/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=1740190366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gB9mvnPi5R4SwtZ3srXpVE/YpejIgfrQUZeG2f2OI6o=; b=PyBNv9lTMEKR1oXtDxCKTZphtBh5liV32JfljQDZFYEq3lcOLI+qUOBkXvxVmlJXxwOYTI 8dTvum5HP92aK4HJXiBn2v3zFdTcKQl/QTRAEt4dVLAmEOk8xtLUhgXFpCSjpkRMe1RS4K 90+AyBovyl3q9F/ZlAQazjMXdJu8DcY5SFF2f3EpIaryCoBv2/nyGBHOTbgEmB18vC71je RdI9u5kTD+1oSzn9J/Y/wHKqmOKMTqPfxaJMq7wjd0X1sfBgmeyEcyoLuQohX4QMZuwzTd d0BGNA1YbMG9iM0JQc620BRvuVgWEr36eS2h2KeyUT2dVjMb0Yrqxlnrdm/Sdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z09WL2Q3nzp77; Sat, 22 Feb 2025 02:12: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 51M2Cka6099287; Sat, 22 Feb 2025 02:12:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M2CktR099284; Sat, 22 Feb 2025 02:12:46 GMT (envelope-from git) Date: Sat, 22 Feb 2025 02:12:46 GMT Message-Id: <202502220212.51M2CktR099284@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 532106f7aa29 - main - netinet: use in_broadcast() inline List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 532106f7aa29a5879a168030ec43119d47ee2bd5 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=532106f7aa29a5879a168030ec43119d47ee2bd5 commit 532106f7aa29a5879a168030ec43119d47ee2bd5 Author: Gleb Smirnoff AuthorDate: 2025-02-22 02:11:06 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-22 02:11:06 +0000 netinet: use in_broadcast() inline There should be no functional change. Reviewed by: rrs, markj Differential Revision: https://reviews.freebsd.org/D49088 --- sys/netinet/in.c | 2 +- sys/netinet/in_jail.c | 8 +------- sys/netinet/ip_fastfwd.c | 8 +++----- sys/netinet/ip_icmp.c | 9 ++------- sys/netinet/ip_input.c | 4 +--- sys/netinet/sctp_output.c | 6 ++---- sys/netinet/sctp_pcb.c | 6 ++---- sys/netinet/sctputil.c | 3 +-- 8 files changed, 13 insertions(+), 33 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 7d8cbc6725ad..7196eabc123e 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1299,7 +1299,7 @@ in_ifnet_broadcast(struct in_addr in, struct ifnet *ifp) NET_EPOCH_ASSERT(); - if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) + if (in_broadcast(in)) return (true); if ((ifp->if_flags & IFF_BROADCAST) == 0) return (false); diff --git a/sys/netinet/in_jail.c b/sys/netinet/in_jail.c index 9b6b8f670df1..7b2120f575ca 100644 --- a/sys/netinet/in_jail.c +++ b/sys/netinet/in_jail.c @@ -97,13 +97,7 @@ prison_qcmp_v4(const void *ip1, const void *ip2) bool prison_valid_v4(const void *ip) { - in_addr_t ia = ((const struct in_addr *)ip)->s_addr; - - /* - * We do not have to care about byte order for these - * checks so we will do them in NBO. - */ - return (ia != INADDR_ANY && ia != INADDR_BROADCAST); + return (!in_broadcast(*(const struct in_addr *)ip)); } /* diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 7a80cce908c1..9b81760e58f3 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -278,14 +278,12 @@ ip_tryforward(struct mbuf *m) */ if ((m->m_flags & (M_BCAST|M_MCAST)) || (m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) || - ntohl(ip->ip_src.s_addr) == (u_long)INADDR_BROADCAST || - ntohl(ip->ip_dst.s_addr) == (u_long)INADDR_BROADCAST || + in_broadcast(ip->ip_src) || + in_broadcast(ip->ip_dst) || IN_MULTICAST(ntohl(ip->ip_src.s_addr)) || IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || IN_LINKLOCAL(ntohl(ip->ip_src.s_addr)) || - IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) || - ip->ip_src.s_addr == INADDR_ANY || - ip->ip_dst.s_addr == INADDR_ANY ) + IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) ) return m; /* diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 2b61820cdaa8..936f76e7fbe3 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -635,15 +635,10 @@ icmp_input(struct mbuf **mp, int *offp, int proto) */ if (icmplen < ICMP_MASKLEN) break; - switch (ip->ip_dst.s_addr) { - case INADDR_BROADCAST: - case INADDR_ANY: + if (in_broadcast(ip->ip_dst)) icmpdst.sin_addr = ip->ip_src; - break; - - default: + else icmpdst.sin_addr = ip->ip_dst; - } ia = (struct in_ifaddr *)ifaof_ifpforaddr( (struct sockaddr *)&icmpdst, m->m_pkthdr.rcvif); if (ia == NULL) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 3c340b376433..08c48996a798 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -789,9 +789,7 @@ passin: */ goto ours; } - if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST) - goto ours; - if (ip->ip_dst.s_addr == INADDR_ANY) + if (in_broadcast(ip->ip_dst)) goto ours; /* RFC 3927 2.7: Do not forward packets to or from IN_LINKLOCAL. */ if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) || diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 2a3c0248be60..02ad901259f4 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -3655,8 +3655,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er sin.sin_len = sizeof(struct sockaddr_in); sin.sin_port = stcb->rport; m_copydata(control, cmsg_data_off, sizeof(struct in_addr), (caddr_t)&sin.sin_addr); - if ((sin.sin_addr.s_addr == INADDR_ANY) || - (sin.sin_addr.s_addr == INADDR_BROADCAST) || + if (in_broadcast(sin.sin_addr) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; return (1); @@ -3687,8 +3686,7 @@ sctp_process_cmsgs_for_init(struct sctp_tcb *stcb, struct mbuf *control, int *er #ifdef INET if (IN6_IS_ADDR_V4MAPPED(&sin6.sin6_addr)) { in6_sin6_2_sin(&sin, &sin6); - if ((sin.sin_addr.s_addr == INADDR_ANY) || - (sin.sin_addr.s_addr == INADDR_BROADCAST) || + if (in_broadcast(sin.sin_addr) || IN_MULTICAST(ntohl(sin.sin_addr.s_addr))) { *error = EINVAL; return (1); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 6bbbacfa761e..185530e3bc5e 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -4130,8 +4130,7 @@ sctp_aloc_assoc_locked(struct sctp_inpcb *inp, struct sockaddr *firstaddr, sin = (struct sockaddr_in *)firstaddr; if ((ntohs(sin->sin_port) == 0) || - (sin->sin_addr.s_addr == INADDR_ANY) || - (sin->sin_addr.s_addr == INADDR_BROADCAST) || + in_broadcast(sin->sin_addr) || IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) || ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && (SCTP_IPV6_V6ONLY(inp) != 0))) { @@ -6009,8 +6008,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m, /* Skip multi-cast addresses */ goto next_param; } - if ((sin.sin_addr.s_addr == INADDR_BROADCAST) || - (sin.sin_addr.s_addr == INADDR_ANY)) { + if (in_broadcast(sin.sin_addr)) { goto next_param; } sa = (struct sockaddr *)&sin; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 17e49b413464..ddfa71d5c7ed 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -6634,8 +6634,7 @@ sctp_connectx_helper_add(struct sctp_tcb *stcb, struct sockaddr *addr, case AF_INET: incr = sizeof(struct sockaddr_in); sin = (struct sockaddr_in *)sa; - if ((sin->sin_addr.s_addr == INADDR_ANY) || - (sin->sin_addr.s_addr == INADDR_BROADCAST) || + if (in_broadcast(sin->sin_addr) || IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) { SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, EINVAL); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, From nobody Sat Feb 22 02:12:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z09WM5tTMz5nqLc; Sat, 22 Feb 2025 02:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z09WM3p1dz3hZX; Sat, 22 Feb 2025 02:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BVSozjuV8+FzeWtmKvPgInjlWw4ZE1QLTlhhkU65MXA=; b=OUaL1D+qz+YhrJb5u2JwWIi6tgNehZp3gtBUxrpQWPzwRrt8NyfZ7TVKEypqrKSMeuc8YC t7v/TbiP63njUNnfe6eDp7jf9i3kgMrvvtl5RJeC/12mcsq2a/Id3Oj8oeJ+zaPCrjSD9I dEa2xw3mOUbBnOj5Kwr4MjX9zwgJ9esP6Mp6XpksoEwlkuMYlDfdMH8dNFBnOKIWbCCiEV w5KEydVymlQ/Hmwy3nmG/OU3IL7EclbvT6kGLvmqzIOMMi+cygoZJurYaIQhgFEOtwYXll z8qP1nW50/sH5Hca3qc/2uVQ0V2QotglDbMo4wNpJpS0WL4j+6jZ127q+uZkEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740190367; a=rsa-sha256; cv=none; b=Lq6eqP2R0RRQCCTXcUD1SqiWsWIIbr7MRwneetbkh7B9yMXGN6CyuuZo5JC1+BnoOsn2Lk 8J59qcXW4jhm4kc9q0WQVNXZq1ZiO7SIz99TxXO2UPXmI4vqdU8keby0pxQHfm8t07fUv5 uVoAMIyjRH1EeZYZJgBwYLOMUelnFK5kVzE8/Osir7957EA0HCzDQY95JdzQJCdJ+6F7fw cwdSpIhpNS/l6c7Qc2lOr0Bw2BkA+1ZIru7YneG9g/HRII6hh9Az06meyfoykyHRaHPaFV xIB99qGh5bI/S6HjD/CFNB/l57RIzcoMQNTvGBn/WGIiaMaPzYzAZFhTmaa6rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BVSozjuV8+FzeWtmKvPgInjlWw4ZE1QLTlhhkU65MXA=; b=u4QZMCZ78smQfwZR4ptyn84DIfzqdoPTlRC0vuXVDgPC2kwdXBp4EP6BaXqcSZFaxm9TLD qUU6DGQ6psvVYnt76lY22Snl/lsjCT/vT+/uxgo7PIkNr0gc2HyXzd5vfGfstapLAxGmlj Qmoz1MLddRxZrh2IZFOkv1OMsqc9Z7iHgSTMmGhJpEJsjWsky0T58QZGX7bAtZYkbx2Ai2 OttIZlY3gD1e+AkxPYXLQDmgs6fZi2JZbvMelBNLoM4ksGvoj1tPIVCuCnQrbgBoSTHKdb SSSbD4EL8OkmesBdT3P26Db0WJtVj0vvez/1Zz36qrJebjZjecuUL2QM7wC4PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z09WM3Lj2zpbq; Sat, 22 Feb 2025 02:12: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 51M2ClQW099324; Sat, 22 Feb 2025 02:12:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M2Cl4N099321; Sat, 22 Feb 2025 02:12:47 GMT (envelope-from git) Date: Sat, 22 Feb 2025 02:12:47 GMT Message-Id: <202502220212.51M2Cl4N099321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: ad77d3177f3e - main - tests/netinet: add few tests for sending a broadcast packet List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad77d3177f3ef3de8ee503f7f204919a292d6818 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=ad77d3177f3ef3de8ee503f7f204919a292d6818 commit ad77d3177f3ef3de8ee503f7f204919a292d6818 Author: Gleb Smirnoff AuthorDate: 2025-02-22 02:11:12 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-22 02:11:12 +0000 tests/netinet: add few tests for sending a broadcast packet 1) Set SO_BROADCAST and send to INADDR_BROADCAST. 2) Set SO_BROADCAST, set IP_ONESBCAST and cycle through broadcast capable interfaces sending a datagram on each. 3) Set SO_BROADCAST and send to local broadcast address. For each test we bind a second socket to check whether the broadcast is actually received. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49040 --- tests/sys/netinet/Makefile | 3 +- tests/sys/netinet/broadcast.c | 192 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 194 insertions(+), 1 deletion(-) diff --git a/tests/sys/netinet/Makefile b/tests/sys/netinet/Makefile index 905fbb06cd48..bd972bc3b2a0 100644 --- a/tests/sys/netinet/Makefile +++ b/tests/sys/netinet/Makefile @@ -5,7 +5,8 @@ BINDIR= ${TESTSDIR} TESTS_SUBDIRS+= libalias -ATF_TESTS_C= fibs_multibind_test \ +ATF_TESTS_C= broadcast \ + fibs_multibind_test \ ip_reass_test \ ip6_v4mapped_test \ so_reuseport_lb_test \ diff --git a/tests/sys/netinet/broadcast.c b/tests/sys/netinet/broadcast.c new file mode 100644 index 000000000000..32e6643a3d75 --- /dev/null +++ b/tests/sys/netinet/broadcast.c @@ -0,0 +1,192 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Gleb Smirnoff + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static const char buf[] = "Hello"; + +/* Create a UDP socket with SO_BROADCAST set. */ +static int +bcastsock(void) +{ + int s; + + ATF_REQUIRE((s = socket(PF_INET, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE(setsockopt(s, SOL_SOCKET, SO_BROADCAST, &(int){1}, + sizeof(int)) == 0); + return (s); +} + +/* Send on socket 's' with address 'to', confirm receive on 'r'. */ +static void +bcastecho(int s, struct sockaddr_in *to, int r) +{ + char rbuf[sizeof(buf)]; + + printf("Sending to %s\n", inet_ntoa(to->sin_addr)); + ATF_REQUIRE_MSG(sendto(s, buf, sizeof(buf), 0, (struct sockaddr *)to, + sizeof(*to)) == sizeof(buf), "sending of broadcast failed: %d", + errno); + ATF_REQUIRE(recv(r, rbuf, sizeof(rbuf), 0) == sizeof(rbuf)); + ATF_REQUIRE_MSG(memcmp(buf, rbuf, sizeof(buf)) == 0, + "failed to receive own broadcast"); +} + +/* Find a first broadcast capable interface and copy its broadcast address. */ +static void +firstbcast(struct in_addr *out) +{ + struct ifaddrs *ifa0, *ifa; + struct sockaddr_in sin; + + ATF_REQUIRE(getifaddrs(&ifa0) == 0); + for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) + if (ifa->ifa_addr->sa_family == AF_INET && + (ifa->ifa_flags & IFF_BROADCAST)) + break; + if (ifa == NULL) { + freeifaddrs(ifa0); + atf_tc_skip("No broadcast address found"); + } + memcpy(&sin, ifa->ifa_broadaddr, sizeof(struct sockaddr_in)); + *out = sin.sin_addr; + freeifaddrs(ifa0); +} + +/* Application sends to INADDR_BROADCAST, and this goes on the wire. */ +ATF_TC_WITHOUT_HEAD(INADDR_BROADCAST); +ATF_TC_BODY(INADDR_BROADCAST, tc) +{ + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + }; + socklen_t slen = sizeof(sin); + int l, s; + + l = bcastsock(); + ATF_REQUIRE(bind(l, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(getsockname(l, (struct sockaddr *)&sin, &slen) == 0); + sin.sin_addr.s_addr = htonl(INADDR_BROADCAST); + + s = bcastsock(); + bcastecho(s, &sin, l); + + close(s); + close(l); +} + +/* + * Application sends on broadcast address of an interface, INADDR_BROADCAST + * goes on the wire of the selected interface. + */ +ATF_TC_WITHOUT_HEAD(IP_ONESBCAST); +ATF_TC_BODY(IP_ONESBCAST, tc) +{ + struct ifaddrs *ifa0, *ifa; + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + }; + socklen_t slen = sizeof(sin); + int s, l; + in_port_t port; + bool skip = true; + + s = bcastsock(); + ATF_REQUIRE(setsockopt(s, IPPROTO_IP, IP_ONESBCAST, &(int){1}, + sizeof(int)) == 0); + + l = bcastsock(); + ATF_REQUIRE(bind(l, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(getsockname(l, (struct sockaddr *)&sin, &slen) == 0); + port = sin.sin_port; + + ATF_REQUIRE(getifaddrs(&ifa0) == 0); + for (ifa = ifa0; ifa != NULL; ifa = ifa->ifa_next) { + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + if (!(ifa->ifa_flags & IFF_BROADCAST)) + continue; + skip = false; + memcpy(&sin, ifa->ifa_broadaddr, sizeof(struct sockaddr_in)); + sin.sin_port = port; + bcastecho(s, &sin, l); + } + freeifaddrs(ifa0); + close(s); + close(l); + if (skip) + atf_tc_skip("No broadcast address found"); +} + +/* + * Application sends on broadcast address of an interface, and this is what + * goes out the wire. + */ +ATF_TC_WITHOUT_HEAD(local_broadcast); +ATF_TC_BODY(local_broadcast, tc) +{ + struct sockaddr_in sin = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + }; + socklen_t slen = sizeof(sin); + int s, l; + + s = bcastsock(); + l = bcastsock(); + ATF_REQUIRE(bind(l, (struct sockaddr *)&sin, sizeof(sin)) == 0); + ATF_REQUIRE(getsockname(l, (struct sockaddr *)&sin, &slen) == 0); + firstbcast(&sin.sin_addr); + + bcastecho(s, &sin, l); + + close(s); + close(l); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, INADDR_BROADCAST); + ATF_TP_ADD_TC(tp, IP_ONESBCAST); + ATF_TP_ADD_TC(tp, local_broadcast); + + return (atf_no_error()); +} From nobody Sat Feb 22 02:12:48 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z09WP0p69z5nqjB; Sat, 22 Feb 2025 02:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z09WN5j1wz3hZm; Sat, 22 Feb 2025 02:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcBsLradsdb8sGwBcbeSWlbhM+DWAzjCTAK5q8diwwk=; b=UxjuWMShjmgkX3psuej/Fml1S/M63A4+ZelzrFrpkOR4+Dh0TGGzgPn5qagvLsATruDEem lvf3uDLNQJWf1qWu88pd3DEKF+JYR8FuSoWrlgbwUwPCzxDUzgiP0MkPGs2Mgo9eCM2PZu 8mm2ejaXo/anAs6rUo6AirutEFKOyBmQHl3PDA51J+zRNvsivvLQAjgJxwmr86+FVfJ3g7 yDH9f0vmVpBHAFnK+94sA99lUhMGRpcmXiNls4UxukGkPGYOVfCFHmYjOTdAOWnMnB3nX7 zup8lXzYDJNLYFz9Gq1GMKXACSjynlcysp0h84UeBZK2f2CySksuTrYlKX3feA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740190368; a=rsa-sha256; cv=none; b=n6NyAAD5+PZ5GT0jtvMZgkrsMe1HH9RyfWkjbJRGE9tXi8X0Xgz3/zttz8e6l7PQbVj6gR FVh83C/DeHQ0qTpNomlrZcYKfbblk//BKgFxB1Tu3fo98XvP2axwVmT05ptxVXotsWSnQo /7m7BW9MfyZUNxsg0W5dSD661ia864R6zuQ65fgEAIrUm4eK7MUw4OwSn5hiRpF9IeOzdF SGIFqnyZE51dHViZy8/f2K1qZ92lOzPAQH9ZP8fJiWRiI8JvB+SseIchAE4MW+4Cz3nX1r 6rYcgkl2MeKPm2RxZ3mhBYoRTQaXUycz30foU9lF92T6XWMiTh2/9GMiskFrRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740190368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcBsLradsdb8sGwBcbeSWlbhM+DWAzjCTAK5q8diwwk=; b=R4xsbQZkxT2jLHH2jNz+7gUFC39gOHqqxnla7o5C1/HTKCDM/WURr9uCZWnB+JIkfQLW1M Y0KacrmUDUahM2ty87O4aTXGFaEthAAzCJ0N8CxF5axJ0Yk2Qq9hKB1G27ORjUIOCoVINP 4GDGlSsAcXdIqGtIQnxiRep+ublSUu100y0rpZOKmkPz4rGJeCzqpSralE1KefK2FBvyvw /Gmv5GxNWC4NZYxJv7OkpFFk+C1pguqLTCnnV0AJp4GGaSpS7PX5HeoB3dVdbDrHXDHzdr jk00QBghP9EMoIfGpHbT6TeKb39HaNKn3G4/9a61VTKrF40XBvi3BjqjsEcczw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z09WN4Gqdzpbr; Sat, 22 Feb 2025 02:12: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 51M2CmIw099362; Sat, 22 Feb 2025 02:12:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51M2CmsU099359; Sat, 22 Feb 2025 02:12:48 GMT (envelope-from git) Date: Sat, 22 Feb 2025 02:12:48 GMT Message-Id: <202502220212.51M2CmsU099359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 69c05f428714 - main - udp: make sendto(2) on unconnected UDP socket use public inpcb KPIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69c05f42871406b4b2b2dac00a268d1da0cacd3e Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=69c05f42871406b4b2b2dac00a268d1da0cacd3e commit 69c05f42871406b4b2b2dac00a268d1da0cacd3e Author: Gleb Smirnoff AuthorDate: 2025-02-22 02:11:17 +0000 Commit: Gleb Smirnoff CommitDate: 2025-02-22 02:11:17 +0000 udp: make sendto(2) on unconnected UDP socket use public inpcb KPIs UDP allows to sendto(2) on unconnected socket. The original BSD devise was that such action would create a temporary (for the duration of the syscall) connection between our inpcb and remote addr:port specified in sockaddr 'to' of the syscall. This devise was broken in 2002 in 90162a4e87f0. For more motivation on the removal of the temporary connection see email [1]. Since the removal of the true temporary connection the sendto(2) on unconnected socket has the following side effects: 1) After first sendto(2) the "unconnected" socket will receive datagrams destined to the selected port. 2) All subsequent sendto(2) calls will use the same source port. Effectively, such sendto(2) acts like a bind(2) to INADDR_ANY:0. Indeed, if you do this: s1 = socket(PF_INET, SOCK_DGRAM, 0); s2 = socket(PF_INET, SOCK_DGRAM, 0); sendto(s1, ..., &somedestination, ...); bind(s2, &{ .sin_addr = INADDR_ANY, sin_port = 0 }); And then look into kgdb at resulting inpcbs, you would find them equal in all means modulo bound to different anonymous ports. What is even more interesting is that Linux kernel had picked up same behavior, including that "unconnected" socket will receive datagrams. So it seems that such behavior is now an undocumented standard, thus I covered it in recently added tests/sys/netinet/udp_bindings. Now, with the above knowledge at hand, why are we using in_pcbconnect_setup() and in_pcbinshash(), which are supposed to be private to in_pcb.c, to achieve the binding? Let's use public KPI in_pcbbind() on the first sendto(2) and use in_pcbladdr() on all sendto(2)s. Apart from finally hiding these two should be private functions, we no longer acquire global INP_HASH_WLOCK() for every sendto(2) on unconnected socket as well as remove a couple workarounds. [1] https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210141935.aa83883 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49043 --- sys/netinet/udp_usrreq.c | 88 ++++++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 59 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 6c855e7a756b..131242ce9859 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1135,10 +1135,9 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, sin = (struct sockaddr_in *)addr; /* - * udp_send() may need to temporarily bind or connect the current - * inpcb. As such, we don't know up front whether we will need the - * pcbinfo lock or not. Do any work to decide what is needed up - * front before acquiring any locks. + * udp_send() may need to bind the current inpcb. As such, we don't + * know up front whether we will need the pcbinfo lock or not. Do any + * work to decide what is needed up front before acquiring any locks. * * We will need network epoch in either case, to safely lookup into * pcb hash. @@ -1292,66 +1291,37 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, error = prison_remote_ip4(td->td_ucred, &sin->sin_addr); if (error) goto release; - /* - * If a local address or port hasn't yet been selected, or if - * the destination address needs to be rewritten due to using - * a special INADDR_ constant, invoke in_pcbconnect_setup() - * to do the heavy lifting. Once a port is selected, we - * commit the binding back to the socket; we also commit the - * binding of the address if in jail. - * - * If we already have a valid binding and we're not - * requesting a destination address rewrite, use a fast path. + * sendto(2) on unconnected UDP socket results in implicit + * binding to INADDR_ANY and anonymous port. This has two + * side effects: + * 1) after first sendto(2) the socket will receive datagrams + * destined to the selected port. + * 2) subsequent sendto(2) calls will use the same source port. */ - if (inp->inp_laddr.s_addr == INADDR_ANY || - inp->inp_lport == 0 || - sin->sin_addr.s_addr == INADDR_ANY || - sin->sin_addr.s_addr == INADDR_BROADCAST) { - if ((flags & PRUS_IPV6) != 0) { - vflagsav = inp->inp_vflag; - inp->inp_vflag |= INP_IPV4; - inp->inp_vflag &= ~INP_IPV6; - } + if (inp->inp_lport == 0) { + struct sockaddr_in wild = { + .sin_family = AF_INET, + .sin_len = sizeof(struct sockaddr_in), + }; + INP_HASH_WLOCK(pcbinfo); - error = in_pcbconnect_setup(inp, sin, &laddr.s_addr, - &lport, &faddr.s_addr, &fport, td->td_ucred); - if ((flags & PRUS_IPV6) != 0) - inp->inp_vflag = vflagsav; - if (error) { - INP_HASH_WUNLOCK(pcbinfo); + error = in_pcbbind(inp, &wild, V_udp_bind_all_fibs ? + 0 : INPBIND_FIB, td->td_ucred); + INP_HASH_WUNLOCK(pcbinfo); + if (error) + goto release; + lport = inp->inp_lport; + laddr = inp->inp_laddr; + } + if (laddr.s_addr == INADDR_ANY) { + error = in_pcbladdr(inp, &sin->sin_addr, &laddr, + td->td_ucred); + if (error) goto release; - } - - /* - * XXXRW: Why not commit the port if the address is - * !INADDR_ANY? - */ - /* Commit the local port if newly assigned. */ - if (inp->inp_laddr.s_addr == INADDR_ANY && - inp->inp_lport == 0) { - INP_WLOCK_ASSERT(inp); - /* - * Remember addr if jailed, to prevent - * rebinding. - */ - if (prison_flag(td->td_ucred, PR_IP4)) - inp->inp_laddr = laddr; - inp->inp_lport = lport; - error = in_pcbinshash(inp); - INP_HASH_WUNLOCK(pcbinfo); - if (error != 0) { - inp->inp_lport = 0; - error = EAGAIN; - goto release; - } - inp->inp_flags |= INP_ANONPORT; - } else - INP_HASH_WUNLOCK(pcbinfo); - } else { - faddr = sin->sin_addr; - fport = sin->sin_port; } + faddr = sin->sin_addr; + fport = sin->sin_port; } else { INP_LOCK_ASSERT(inp); faddr = inp->inp_faddr; From nobody Sat Feb 22 19:28:28 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0cVN4yXtz5pG0M; Sat, 22 Feb 2025 19:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0cVN45Ffz3lnh; Sat, 22 Feb 2025 19:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOkihmPriNEvL5RpbwKEbHhSvJ2xpJQaOBVVyI2wuNE=; b=S0t8Am1L9GPkPmlRgb2uMqpi3GvPmr2c7ZSHaEFADApCx6GmSmdP4owpczvgwhbPNFSi9U doGPtBKdzMZx9PEdu6Q7fHj5yar/lbjP+LpBZO/iSfuHvWKLiXCFh2c8o8+JIJjzHRDLGu uzc3B/CmOfN677sDA6IeOHzxPjMU72iSmDmEsKvNzGDpyQ9+XWilQRVfMSE4Q9RzDW7buB TO40SyHJSO9JlKsBaQ8GEm4ko8PoS1eqHVNcz8tGcDCp7FrH8Q8SNgKK1Uq9bYj9/FWCaC jd8+40dZxBmkLbxm6UZ4fuBpBVbdZIGBLHikJkAzZQlZtxDII8SofYdAcWysUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740252508; a=rsa-sha256; cv=none; b=Xd8u6VtQGpS9UZy1ivNi9ZSVJqKmZAEO21ZG6Q4nVgGBarzqKfp18HZhOMN3k5euxYnrod Ajn4C8oNnJWw2C0zsvEgoReU7DhEv3llFoBDfegDXvnKJubaPM9ThoWmXDxtLtFXz4P5PU ekSNxou/qgXK1cB9yAb0bBopDLP2HDO4NSsHOBQ1W77gXXWB7XCEF8ZO3eN6mO6XU16x60 7fqWa3ndC8QCyPSyYFfN/v321V2t1E/da+wzm86P6fkAAythbGtBocML5q8Fd8aFzTI2H0 tLbD33XJxAEglsrpmhBYHSOHwsL9Nd3ZobvdA+hdhm1JoaaTu2rLSjtI37iGgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NOkihmPriNEvL5RpbwKEbHhSvJ2xpJQaOBVVyI2wuNE=; b=Lul/KfAE5HTyQ/qo7yrsWosydo90r7Q/8Xb3V2ECSJ8/rLT6lT8f4PmP7vSpcWVVGUqVjV TP65Rc2DNsgbuWMjpm6ujEgocKwBuTj5ZPg3Y28Bslk3m91L0tAPq2je/LsZvfHAUyMn5j pqtRgfIzcTvyA+44we3rSTHnKOd6AWiTnqcKvk8TpGPR+RkeIaU6wIZASt5vZb+aFjsddg aKrnmWXkrL/xY96Zv5yMykySyxgMg1I+774sbTTdoR4koV/36iiHyUswAS93kLqj1gG20Q UuE572XIcptx7Qo8fm9wbJbMnGdRMHpSyJZMvOQt6K3TxHJ+7auvJiy8+uTxRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0cVN3YrQz6Cr; Sat, 22 Feb 2025 19:28: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 51MJSSF5035396; Sat, 22 Feb 2025 19:28:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51MJSSjA035393; Sat, 22 Feb 2025 19:28:28 GMT (envelope-from git) Date: Sat, 22 Feb 2025 19:28:28 GMT Message-Id: <202502221928.51MJSSjA035393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 93fbdef51a13 - main - tests: carp: Update test case unicast_v4 to catch PR 284872 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93fbdef51a13b8facac3633f55804a59ca27f635 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=93fbdef51a13b8facac3633f55804a59ca27f635 commit 93fbdef51a13b8facac3633f55804a59ca27f635 Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-22 19:26:32 +0000 tests: carp: Update test case unicast_v4 to catch PR 284872 In the current test case unicast_v4, host one acts as a router, but it uses if_bridge(4) to verify the reachability to CARP master. Unfortunately, if_bridge(4) brings the two CARP hosts into the same broadcast domain, thus with an unusual (undocumented) setup, one host is in unicast mode but another one in multicast, or two hosts are both in multicast mode, the test case can falsely report success. Fix that by propagating route via routed(8). PR 284872 shows that CARP(4) happens to send packets with multicast destination when the unicast peer address is in the range x.x.x.224 ~ x.x.x.239. Update the peer address in test case to catch that bug. PR: 284872 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49076 --- tests/sys/netinet/carp.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index f9e47c70f492..2aae2854826e 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -163,49 +163,53 @@ unicast_v4_head() unicast_v4_body() { carp_init - vnet_init_bridge - bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) - vnet_mkjail carp_uni_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_uni_v4_one ${epair_one}a ${epair_two}a vnet_mkjail carp_uni_v4_two ${epair_one}b vnet_mkjail carp_uni_v4_three ${epair_two}b - jexec carp_uni_v4_one ifconfig ${bridge} 192.0.2.4/29 up jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_one ifconfig ${bridge} addm ${epair_one}a \ - addm ${epair_two}a - jexec carp_uni_v4_one ifconfig ${epair_one}a up - jexec carp_uni_v4_one ifconfig ${epair_two}a up - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.1/25 - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.129/25 + jexec carp_uni_v4_one ifconfig ${epair_one}a inet 198.51.100.1/25 + jexec carp_uni_v4_one ifconfig ${epair_two}a inet 198.51.100.129/25 + jexec carp_uni_v4_two sysctl net.inet.ip.forwarding=1 jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up - jexec carp_uni_v4_two route add default 198.51.100.1 + jexec carp_uni_v4_two route add 198.51.100.224 198.51.100.1 + # A peer address x.x.x.224 to catch PR 284872 jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ - peer 198.51.100.130 192.0.2.1/29 + peer 198.51.100.224 192.0.2.1/32 - jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.130/25 up - jexec carp_uni_v4_three route add default 198.51.100.129 + jexec carp_uni_v4_three sysctl net.inet.ip.forwarding=1 + jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.224/25 up + jexec carp_uni_v4_three route add 198.51.100.2 198.51.100.129 jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ - peer 198.51.100.2 192.0.2.1/29 + peer 198.51.100.2 192.0.2.1/32 # Sanity check atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ - ping -c 1 198.51.100.130 + ping -c 1 198.51.100.224 wait_for_carp carp_uni_v4_two ${epair_one}b \ carp_uni_v4_three ${epair_two}b + # Setup RIPv2 route daemon + jexec carp_uni_v4_two routed -s -Pripv2 + jexec carp_uni_v4_three routed -s -Pripv2 + jexec carp_uni_v4_one routed -Pripv2 + + # XXX Wait for route propagation + sleep 3 + atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ ping -c 3 192.0.2.1 # Check that we remain in unicast when tweaking settings atf_check -s exit:0 -o ignore \ jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 - atf_check -s exit:0 -o match:"peer 198.51.100.130" \ + atf_check -s exit:0 -o match:"peer 198.51.100.224" \ jexec carp_uni_v4_two ifconfig ${epair_one}b } From nobody Sat Feb 22 19:28:29 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0cVQ022Lz5pFr7; Sat, 22 Feb 2025 19:28:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0cVP5HPyz3lgL; Sat, 22 Feb 2025 19:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLI70eWLJAkyDWo7J2uhLl29uJXGpppmuhqt/ZEI224=; b=tL/ykITOiDAfXJaRxEd7V3Sp4aexB6FkkRCIMUYf95KQWnsUngleXR71J7rTaKee+u3KTy MXpG49aF5nnWHVE5XBcoXZUWG283UcxuYIV/qZjQRUMID8Bian/dV/8GIktqZWkWv07Q0P w23sMQ92DcCZRsMTQHzHRRwFHh5tpJwTj9LvvySUgsSEp15a2+xJK388Ll6z4ZAE6O611M +yhENaitaxKVUF3G10bxTqQNra9L2hFdrW/mdfIQQa0ZwAjdTx0eXsp9knNVAaPI6QnBUS 23AE1uycmpHWGFqpXWkAObUrsB8o66ioj7lr2KNdF+1ZuZ5h58yP3kndG/pSWw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740252509; a=rsa-sha256; cv=none; b=SF3qVT1qDvpLrfcFww5LF1NDsW0zwjrHSaZQ8AXEt8tO9/KQjQLQpPHQY3qzA+bTN/zMZY TxvnahmCCk7IQVjlqDw1AHEI5rJoY2lG0pZHJ8U7scVZNl9BqH9IuOQOIQLseiUHbEhMio A0LJoITgXkAgStI7ll7juUCnb5QDOfVUaklXdf6urmNjTNWV20sBwndPdXhv8g1lHAdWtP mtc+Y/5n7w5eVhhze6N7FXwycNt+1Xlze6ci5d75o0DYbEAXvEiYUwCslA0zAU0neqzrO/ GTITe7/AUPRKGgzpEnSFgTgh40IFzXiIBzJvD6k0aC1QDW5auyG0xdzqreAbAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aLI70eWLJAkyDWo7J2uhLl29uJXGpppmuhqt/ZEI224=; b=CX8AHqMKVtrc64H1EgrlnToepHMDOTj5acXawlWGLvGCeaCueKkJDqeOUTFNdETc/HNg1x 2hEk7QsG3vNLCMCsHKth2uPH2tviqW6yOug4sgVPUo1zniKG7fnW9xUbXRpxB1HVKDEM4n iTIkXTOk547LXtoOMtNEmsdx3DobbPQtDDuc8kPFMKkJN/mujYzwruW+ec1WTqZ7fTmNU1 XXZjtmFWlfvUNrrCqfQenaBDxZ0MIETSbc3VfkKr8n1DFDy70iSXYrmwouWlJ0RGlJW1Cc PHvzzVKcDgrh5omQiqT2Jgw59ABjImOEiYh9p5Eg/5X1uzpKP9oRX0Auv6ImIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0cVP4pV4z6HV; Sat, 22 Feb 2025 19:28: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 51MJSTNY035429; Sat, 22 Feb 2025 19:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51MJSTWc035426; Sat, 22 Feb 2025 19:28:29 GMT (envelope-from git) Date: Sat, 22 Feb 2025 19:28:29 GMT Message-Id: <202502221928.51MJSTWc035426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 1776633438f2 - main - carp: Fix checking IPv4 multicast address List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1776633438f24df09cb9815650891bcef0152874 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=1776633438f24df09cb9815650891bcef0152874 commit 1776633438f24df09cb9815650891bcef0152874 Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:33 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-22 19:26:33 +0000 carp: Fix checking IPv4 multicast address An IPv4 address stored in `struct in_addr` is in network byte order but `IN_MULTICAST` wants host order. PR: 284872 Reported by: Steven Perreau Reported by: Brett Merrick Reviewed by: Franco Fichtner , ae, kp, glebius Tested by: Steven Perreau Fixes: 137818006de5 carp: support unicast MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49053 --- sys/netinet/ip_carp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 5bec8fce3fcb..6fde7bd70c6b 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -855,7 +855,7 @@ carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af, int ttl) } if (ifa->ifa_addr->sa_family == AF_INET) { - multicast = IN_MULTICAST(sc->sc_carpaddr.s_addr); + multicast = IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr)); } else { multicast = IN6_IS_ADDR_MULTICAST(&sc->sc_carpaddr6); } @@ -1245,7 +1245,7 @@ carp_send_ad_locked(struct carp_softc *sc) m->m_pkthdr.rcvif = NULL; m->m_len = len; M_ALIGN(m, m->m_len); - if (IN_MULTICAST(sc->sc_carpaddr.s_addr)) + if (IN_MULTICAST(ntohl(sc->sc_carpaddr.s_addr))) m->m_flags |= M_MCAST; ip = mtod(m, struct ip *); ip->ip_v = IPVERSION; From nobody Sat Feb 22 19:32:47 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0cbc71rpz5pGZL for ; Sat, 22 Feb 2025 19:33:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (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 4Z0cbc5HLpz3p1d for ; Sat, 22 Feb 2025 19:33:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2fa48404207so6545591a91.1 for ; Sat, 22 Feb 2025 11:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1740252779; x=1740857579; 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=eC4ufv1TO46MdkG4NAUj/ky2vqobbuifjwx0T99SMzg=; b=y4s4DQP7KuEZ60ZGSkrWaiL/H00GehPDyhxurt26bP/Aw+A/hBlHh2fvJlheCy6MOA b/RFiK78/MOMfZ6VKPsDXihf6VxMutUR5D1myWMNGG98fGc4nVKdNctZH0VdLxQNsJPC bl9n7KnR1BcjAoEH8+td/FJgEIRhyL+ZC/LivTnlx/BrbhGHUaRrFcuMXhwf30XlIOpx V0xzHjeUsPP5ivLHYs5bULhnBoVqTGCDlYvYBYTPAAnmGbm0KPmI4S1ciftPAVVCmrRH 1ygWeiqx7KlKmBuabxaAOH4FF/xF9iNo8UfE7OdfdETqH2yqI6vEtLkcJWCZ5OJkK5gX hY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740252779; x=1740857579; 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=eC4ufv1TO46MdkG4NAUj/ky2vqobbuifjwx0T99SMzg=; b=YS4VjzHm760e4grdeekU7nfwGM9DUSBKqPF2AQgFWO0S9zL2rT5pTzUpU9VWR4E7Uw P3pT8FVy5j7MdTWQytMsUJzvUlWYvC+JZ4U0G9UE4vP6isxChWvn4mw/WvCQ4eu/Ie6R ABfgh1dXkh6OmpMWMuIbKvU8bLI//jiO6WryPx820cPCrjnxO4Tbuz6TJvVNpTy+7r2W VHwzeLQhyEft/JjdNlYrOjxqcizNY1+tOFWL9k71lzQ20fLJUIh6swB1A2bjVETV4AAx WhJlUVEvaf0W2PTm2SFYPM+FkrwXMtJQnnuGD1oqlYYrPU2IZLowhk8vFuMQk+XQtQK7 Jw0w== X-Forwarded-Encrypted: i=1; AJvYcCW4PcRAQhibCyxlUSlStQ0l9wbbjpf56b2tWf6bivSsQ3PKruy+AH0V0MYdKBNd2y/joHuwKf3R4GMuzyD8fmkI9rX0Sg==@freebsd.org X-Gm-Message-State: AOJu0YxL1AR8PdnfRmH9yTc2iB6+bAtOdVBE/b9oPWXpiX0a7B/3VDNj uoBmDdcNYRmAEt0/ZdnZDbu/Wd1dlAogF++3G+ZKCjARf55jSl+RLgkR6fdOq6Ix9mUYmGnhqT4 FCN7mDxqxcJpRbyAB27bfrB9S+5z8EjOwLN0dzg== X-Gm-Gg: ASbGncvJyVMD9B7FN8slfe9oI/4CQRthTXhC03bAeg/umY04X4LFVeun9/Q6VfVQPMC KL+jdHEjxRkemB1YxVKq8qS3HEE5dfVXIEgMA96t9XEDP/oxy1FtYFfKfrLqmwlZZnfKtIY41U6 WmkxEi3PDjzJeu/jKFb+QgtFh8UGL22n+T9OKqRQ== X-Google-Smtp-Source: AGHT+IGIMNkVZpVk4su4bVN5zoeBJj7UC6hqRr1MHEL318ZtlYFNPYMSYVZ3VB8YuVr/c3VhuHSjXCpEy78Nho88XJA= X-Received: by 2002:a17:90b:1294:b0:2f4:4003:f3ea with SMTP id 98e67ed59e1d1-2fce7b27dc2mr14495263a91.33.1740252779284; Sat, 22 Feb 2025 11:32:59 -0800 (PST) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202409091648.489GmCNu009544@gitrepo.freebsd.org> <20250222175524.GA51822@zxy.spb.ru> In-Reply-To: <20250222175524.GA51822@zxy.spb.ru> From: Warner Losh Date: Sat, 22 Feb 2025 12:32:47 -0700 X-Gm-Features: AWEUYZknbWmH33YYe4s8B54Pjbm_RRBSLOO9ImGs_EFGmF4Ghum2OGqWTtmqx4Q Message-ID: Subject: Re: git: e2df9bb44109 - main - zfs: merge openzfs/zfs@b10992582 To: Slawa Olhovchenkov Cc: Martin Matuska , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000baa8e1062ec02cc8" 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: 4Z0cbc5HLpz3p1d X-Spamd-Bar: ---- --000000000000baa8e1062ec02cc8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Feb 22, 2025, 11:27=E2=80=AFAM Slawa Olhovchenkov = wrote: > On Mon, Sep 09, 2024 at 04:48:12PM +0000, Martin Matuska wrote: > > > The branch main has been updated by mm: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3De2df9bb44109577475aeb186e7186ac= 040f9bde1 > > > > commit e2df9bb44109577475aeb186e7186ac040f9bde1 > > Merge: f05795e3f65f b109925820fb > > Author: Martin Matuska > > AuthorDate: 2024-09-09 16:13:02 +0000 > > Commit: Martin Matuska > > CommitDate: 2024-09-09 16:13:02 +0000 > > > > zfs: merge openzfs/zfs@b10992582 > > > > Notable upstream pull request merges: > > #15892 -multiple Fast Dedup: Introduce the FDT on-disk format and > feature flag > > #15893 -multiple Fast Dedup: =E2=80=9Cflat=E2=80=9D DDT entry form= at > > #15895 -multiple Fast Dedup: FDT-log feature > > #16239 6be8bf555 zpool: Provide GUID to zpool-reguid(8) with -g > > #16277 -multiple Fast Dedup: prune unique entries > > #16316 5807de90a Fix null ptr deref when renaming a zvol with snap= s > and snapdev=3Dvisible > > #16343 77a797a38 Enable L2 cache of all (MRU+MFU) metadata but MFU > data only > > #16446 83f359245 FreeBSD: fix build without kernel option MAC > > #16449 963e6c9f3 Fix incorrect error report on vdev attach/replace > > #16505 b10992582 spa_prop_get: require caller to supply output > nvlist > > > > Obtained from: OpenZFS > > OpenZFS commit: b109925820fb79db3e37670c159977f03edd950f > > MFC planned? > FreeBSD Stable branches track a specific ZFS stable branch. Any MFC will arrive in FreeBSD that way. Warner > --000000000000baa8e1062ec02cc8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Feb 22, 2025, 11:27=E2= =80=AFAM Slawa Olhovchenkov <slw@zxy.s= pb.ru> wrote:
On Mon, Sep 09= , 2024 at 04:48:12PM +0000, Martin Matuska wrote:

> The branch main has been updated by mm:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=3De2df9bb44109577475aeb186e7186a= c040f9bde1
>
> commit e2df9bb44109577475aeb186e7186ac040f9bde1
> Merge: f05795e3f65f b109925820fb
> Author:=C2=A0 =C2=A0 =C2=A0Martin Matuska <mm@FreeBSD.org>
> AuthorDate: 2024-09-09 16:13:02 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Martin Matuska <mm@FreeBSD.org>
> CommitDate: 2024-09-09 16:13:02 +0000
>
>=C2=A0 =C2=A0 =C2=A0zfs: merge openzfs/zfs@b10992582
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Notable upstream pull request merges:
>=C2=A0 =C2=A0 =C2=A0 #15892 -multiple Fast Dedup: Introduce the FDT on-= disk format and feature flag
>=C2=A0 =C2=A0 =C2=A0 #15893 -multiple Fast Dedup: =E2=80=9Cflat=E2=80= =9D DDT entry format
>=C2=A0 =C2=A0 =C2=A0 #15895 -multiple Fast Dedup: FDT-log feature
>=C2=A0 =C2=A0 =C2=A0 #16239 6be8bf555 zpool: Provide GUID to zpool-regu= id(8) with -g
>=C2=A0 =C2=A0 =C2=A0 #16277 -multiple Fast Dedup: prune unique entries<= br> >=C2=A0 =C2=A0 =C2=A0 #16316 5807de90a Fix null ptr deref when renaming = a zvol with snaps and snapdev=3Dvisible
>=C2=A0 =C2=A0 =C2=A0 #16343 77a797a38 Enable L2 cache of all (MRU+MFU) = metadata but MFU data only
>=C2=A0 =C2=A0 =C2=A0 #16446 83f359245 FreeBSD: fix build without kernel= option MAC
>=C2=A0 =C2=A0 =C2=A0 #16449 963e6c9f3 Fix incorrect error report on vde= v attach/replace
>=C2=A0 =C2=A0 =C2=A0 #16505 b10992582 spa_prop_get: require caller to s= upply output nvlist
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0Obtained from:=C2=A0 OpenZFS
>=C2=A0 =C2=A0 =C2=A0OpenZFS commit: b109925820fb79db3e37670c159977f03ed= d950f

MFC planned?

FreeBSD Stable branches track a specific ZFS stable branch. Any= MFC will arrive in FreeBSD that way.

Warner=C2=A0
--000000000000baa8e1062ec02cc8-- From nobody Sun Feb 23 00:38:51 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0lNW714Pz5p20T; Sun, 23 Feb 2025 00:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0lNW6Wj3z42Bs; Sun, 23 Feb 2025 00:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVeLkOPrnHgN99INp5Nenunwf6LjvJZUsUIySa3wvts=; b=pbLwPOXY8ccbkNGdgxSxu7ZefglE/npkQBS9DLjxl7NS8S5D3XBUbVIPz80MpC5PH0ZDH4 fZTuD7TN+Wl2TNxZV3L3BgFHaHTkceVvw2OF2sMYzBpkG2pKnAJwm9ByICP76dkRDmTPvp HDZ/DhTRhxPOEwrQHVVg6uQyYY5kzD/JLfZfg9JAIUyCUjqiSrg3AzudZvqHQcMDZJa3e6 vY8u6j+zAmygb5i3ur/C8Uvi/MU6er+YIwDBnAxtRQ1G99kpIgAYYQf2x3g4dFT/IRzKBs iGdeEWJQENsP84EFJPB915//n9k1pkfr/JYhC5IZdNJztxYiaocqG3UmRh5b/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740271131; a=rsa-sha256; cv=none; b=wl83S5t1wh7zE7tzZoxGiQ/tWhaSeEgylMeIPhhSiTqe4Z2Msw77nk7pW5mMhaipSamv4C 9zqWQYxy3TxZxDIZChhTlGVnGInkogp9ivrpgEPoVEz7VOnqCp1F4J/GoJROIcWN8YgiQT Pm8a6H8k42seU6pNWfzz6ABiD3vnK+JANE1xWLNxV+LOYw2yo5o3BWkvlLPOtE9mqRupJo bogYP/ZwIyxHVdpYm9O0QZLN3bSGcVPguBMDpCMEx9mQnRJjvWSeKisoOFfA6TlJbFGdhf sSCwhID5CCaFUWMIpg1V1Ytt+vsWuVmppPeuF+iPkA5QWx/zQ2h2bFYFXyR7dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CVeLkOPrnHgN99INp5Nenunwf6LjvJZUsUIySa3wvts=; b=aGOddhcTyu7mmN/i/quGGvERh5vaW+z1LMJ2Jv0ngNcAb+EfEDLM1x7FjvuUPwtLv5sEYO o15O/bF96yt+rGZCQCA8HndQ0KB6j/FBI2zCMQdt2/0WGDw1EVKvrWD6/fHHC8K5zLCuN/ 8Mf+lNIzlTmvBPqpc/ww5TgMUDncKju3jJWkn8GHVD8Gp9Bq/IMaI+urCTV2LPdEoatoOb l1HnPhnEZW+Tb9MGBRaVRRJF6+KxkeGPTdFIIUw9OgfQKkF/vAobI2KPbXaOQsUwgAkiJQ 2D3Dke/k8Dn/wkpQ2ZiWN+cSTCYAXxz6otiD/RB4JFndjqYMrb9ZYVFcoPL30Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0lNW5mfXzXbw; Sun, 23 Feb 2025 00:38:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51N0cpmu014415; Sun, 23 Feb 2025 00:38:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51N0cpIt014412; Sun, 23 Feb 2025 00:38:51 GMT (envelope-from git) Date: Sun, 23 Feb 2025 00:38:51 GMT Message-Id: <202502230038.51N0cpIt014412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 11450726d3cf - main - LinuxKPI: 802.11: improve cfg80211_chandef_create() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11450726d3cf8d76d2113d7cabe995f8ef31ec5a Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=11450726d3cf8d76d2113d7cabe995f8ef31ec5a commit 11450726d3cf8d76d2113d7cabe995f8ef31ec5a Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-22 22:18:51 +0000 LinuxKPI: 802.11: improve cfg80211_chandef_create() Implement cfg80211_chandef_create() to work with HT. Update enum with HT channel types. When calling the function from LinuxKPI 802.11 code, pass in NL80211_CHAN_HT20 if HT is supported rather than NO_HT. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/nl80211.h | 6 ++-- sys/compat/linuxkpi/common/include/net/cfg80211.h | 35 ++++++++++------------ sys/compat/linuxkpi/common/src/linux_80211.c | 4 +-- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/nl80211.h b/sys/compat/linuxkpi/common/include/linux/nl80211.h index 80546e56f0c1..b2a33a28b3a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/nl80211.h +++ b/sys/compat/linuxkpi/common/include/linux/nl80211.h @@ -135,9 +135,11 @@ enum nl80211_band { NUM_NL80211_BANDS } __packed; -enum nl80211_chan_flags { - /* XXX TODO */ +enum nl80211_channel_type { NL80211_CHAN_NO_HT, + NL80211_CHAN_HT20, + NL80211_CHAN_HT40PLUS, + NL80211_CHAN_HT40MINUS, }; enum nl80211_chan_width { diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 338ffb82bd83..4ae31b257ae0 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1483,36 +1483,33 @@ cfg80211_pmsr_report(struct wireless_dev *wdev, TODO(); } -static __inline void +static inline void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, - struct linuxkpi_ieee80211_channel *chan, enum nl80211_chan_flags chan_flag) + struct linuxkpi_ieee80211_channel *chan, enum nl80211_channel_type chan_type) { KASSERT(chandef != NULL, ("%s: chandef is NULL\n", __func__)); KASSERT(chan != NULL, ("%s: chan is NULL\n", __func__)); - memset(chandef, 0, sizeof(*chandef)); + /* memset(chandef, 0, sizeof(*chandef)); */ chandef->chan = chan; - chandef->center_freq2 = 0; /* Set here and only overwrite if needed. */ + chandef->center_freq1 = chan->center_freq; + /* chandef->width, center_freq2, punctured */ - switch (chan_flag) { + switch (chan_type) { case NL80211_CHAN_NO_HT: chandef->width = NL80211_CHAN_WIDTH_20_NOHT; - chandef->center_freq1 = chan->center_freq; break; - default: - IMPROVE("Also depends on our manual settings"); - if (chan->flags & IEEE80211_CHAN_NO_HT40) - chandef->width = NL80211_CHAN_WIDTH_20; - else if (chan->flags & IEEE80211_CHAN_NO_80MHZ) - chandef->width = NL80211_CHAN_WIDTH_40; - else if (chan->flags & IEEE80211_CHAN_NO_160MHZ) - chandef->width = NL80211_CHAN_WIDTH_80; - else { - chandef->width = NL80211_CHAN_WIDTH_160; - IMPROVE("80P80 and 320 ..."); - } - chandef->center_freq1 = chan->center_freq; + case NL80211_CHAN_HT20: + chandef->width = NL80211_CHAN_WIDTH_20; + break; + case NL80211_CHAN_HT40MINUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 -= 10; + break; + case NL80211_CHAN_HT40PLUS: + chandef->width = NL80211_CHAN_WIDTH_40; + chandef->center_freq1 += 10; break; }; } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 729eb2dcd570..92f308fe9228 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4118,7 +4118,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) hw = LHW_TO_HW(lhw); cfg80211_chandef_create(&hw->conf.chandef, chan, #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); @@ -5589,7 +5589,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) cfg80211_chandef_create(&hw->conf.chandef, &channels[i], #ifdef LKPI_80211_HT - (ic->ic_htcaps & IEEE80211_HTC_HT) ? 0 : + (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); break; From nobody Sun Feb 23 00:38:53 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0lNZ2ZyVz5p28J; Sun, 23 Feb 2025 00:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0lNZ0YSKz42HT; Sun, 23 Feb 2025 00:38:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAXhwiqNs2yFdOgiKFOqk6jDJL0e7NjWkwFNW7mPNLM=; b=VFZ3XK4wsEkwSrxvHb8DPU7LUrHL0QloyLXoOuRRU2NBU5ceiKKTQ80InnBnCbefB8LL4e lrNS2WcObe/FQmGAhwHNgx2ccGxz6uICOfuv3gSTinGDM3fFHI1vmUHakE5NIysUA5ghbC xxk8PDBBKq7pder7x9Af18S3ApmkJ5+DFlfP6yf/pMTPh9MBIGAtZnBERM6ZA0spyZ7J8C cA9gr8gDuU5Vv6GJ7/opyGS4B2Q4F2PbjI++Scw+0aquDAwwi29B8JFUq8CRWfPn3jjIJk /bLFze7ooKBx8X51eLhGL9dW3CxTnkGQjJIA5dnQdPkjqxaLvOL74Yn2uTjGLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740271134; a=rsa-sha256; cv=none; b=InJSH6us+MJw3W105JCLio8v8peQPB7xpfMwuWah04pU2pg5xGXtUER2HJzJinTuh/1MuR nAMEhQstgg1u8jJh9C3aQX82U3372zPjYA94POnhCR2l+sCW/ZiMpWF0THZHRAY+pQt+P9 eGu3Amp7X967rWeTGSRVqiHC0heusp1yUZaWYEo4/y5bfg2StkLVYYmmBXStAymcVyiL89 88VzU5JQ7FgBA5OO7l7esDN/RjISIyXXs4ctklJlB4+jb1u4dijyV8LEcDg8JIyYyogYq+ KfHYd7JByjPjW/TF1ZxBfjm8PpN+d8monZ5gJ6R81FbhUQrfUI2np0DWJLtShg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271134; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jAXhwiqNs2yFdOgiKFOqk6jDJL0e7NjWkwFNW7mPNLM=; b=Frhtb++YS7BbKxSXRl6ekazSQhhPkzlqaliqRYbfbR6sy1HDN2z9X1zDXRG3rbYQ/HYPDt 02tW3AwecqDz3+/Y02/elj6ksd6iNnsCAJZjQYt9+Ea/Rasa6obg8DSKio4bwRMcYQUZaU dMd+H60Bb45mX73nLw1KLvUs54acVgDGINtWv+4I8omUwHGpNUvhAQP5p4qi/ng5HlcCHr nl8dJw/rnHaHOqsjqfuh3RPS5qTQTT7Jq8ZFMauZmQtsytrpMvNYGWKq5tVZ+TJb9rzZHi m7qfduYKgdIdFWUV4mP8ck5JgH026cQK2jIA54194itpm9tnUQzSZaOMbHol9g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0lNY6yvszXTT; Sun, 23 Feb 2025 00:38: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 51N0crvH014498; Sun, 23 Feb 2025 00:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51N0crBq014495; Sun, 23 Feb 2025 00:38:53 GMT (envelope-from git) Date: Sun, 23 Feb 2025 00:38:53 GMT Message-Id: <202502230038.51N0crBq014495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 73cd1c5d44ea - main - LinuxKPI: 802.11: add further checks for deflink.supp_rates[] List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73cd1c5d44ead3b84cebcc0c24278429afa9e6ec Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=73cd1c5d44ead3b84cebcc0c24278429afa9e6ec commit 73cd1c5d44ead3b84cebcc0c24278429afa9e6ec Author: Bjoern A. Zeeb AuthorDate: 2024-12-30 06:35:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-22 23:16:25 +0000 LinuxKPI: 802.11: add further checks for deflink.supp_rates[] When setting the per-band supp_rates bitfield check for mandatory rates only. We cannot easily say at that point for 2Ghz whether 11g is supported so assume these days it is not pure-b. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 041789857f0d..62d29feabb09 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -550,10 +550,30 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], continue; for (i = 0; i < supband->n_bitrates; i++) { - - IMPROVE("Further supband->bitrates[i]* checks?"); - /* or should we get them from the ni? */ - sta->deflink.supp_rates[band] |= BIT(i); + switch (band) { + case NL80211_BAND_2GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: /* 11g only */ + case 120: /* 11g only */ + case 110: + case 60: /* 11g only */ + case 55: + case 20: + case 10: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + case NL80211_BAND_5GHZ: + switch (supband->bitrates[i].bitrate) { + case 240: + case 120: + case 60: + sta->deflink.supp_rates[band] |= BIT(i); + break; + } + break; + } } } From nobody Sun Feb 23 00:38:54 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0lNb3Rkdz5p25H; Sun, 23 Feb 2025 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0lNb0wj4z424n; Sun, 23 Feb 2025 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=URamFGR0yKkKbaBn3tqT1+v0b2ZguyxV0WvH1gZK1rw=; b=J2WJLo5RgVQOzpg6UYuLM5/5vEod0ioIz61SZHHGxHeTzittEETLT3JplWndHhVqb+Ncpt 7Yq1wx2UYYda7h/y03ljZJ2ushj56hUKhLYNPgtYm7EEOxpOZ+yg3q+ciA4cXIE5PJ+5RW ZZHuhGqKbfDM4h8hPzxYrnYAV4a3ErYGvVyiBFHg2F5f2m9aZ5Bf6cwxBOnCbnCbZn9/M+ QwhtSiPsc1yT8YxE3oGjcZBLmLNSbHzdUjOOKf0tvgc7c01YZ6GKHY5vxNHxIR3B8MtSpa byKd8x4NSpb8uaKa05sw3cZrlzyg0w/pfA80wudwZTOCmtqArPOvlrBJXuZDuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740271135; a=rsa-sha256; cv=none; b=iOG0F2S4f5ATdjPLti8bxll7V9v/CCo5jtoKpDlcpDQdPLRHLvrM9/RlxAcXcQU24Zicjv cadDMb8Mg0OlnV2yVmuXDsqrdpXo+TglfWIFifx5foqmEc7RBc+E2UjXr1l18WkJpI2WoL r6/hZYwHHD/Ellwf9lc8QKjyd5NosCfCkh5/LzsokcCDbiIG5DWbweiPLbYmZf6cXT8Lrj 9yJz+Ff1RtefwKB0AaWIENq60yW5NbVPdErWMdGPh9Zr6lNi37kUgYGA0NSNcvfKl3Qppj xELwdkrEI1f8fLLbYckSUzrpR64WALS99UjwZ+uy3/40cE+A34H3tNqLO0REBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=URamFGR0yKkKbaBn3tqT1+v0b2ZguyxV0WvH1gZK1rw=; b=ZxIwox4OlQIDNVmj1GJ74Q3ChFPIbArx5c1jmB1NmnfuuIjekOJPTs2WxZDNLYhNdI/oV7 QVkOMtKV5IA3Ce9J9h5YVPBG7MtWhLZzv+RW54ByKZ2ytKFreYqc0iG47B3t6Uh6AxUw/4 HKF7HobrOAsO9yw0bOD84diYUHT9Flv5SmXRNx7a03EVRVNh82UlXCv/HfTsS+EwKEtqwO +7TqxNYGpE3u7A3IscSDWzIu9OzjmD3brUC+r01HKGcZgPWskkqA3wAHHy+lAD1DswJHOe 0HnbHop4ogt5BMpOkEuC+A7c+QdVuy42b5acCDdlmRUGy0rTpMcjKf3J6cQvgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0lNb0QtJzXTV; Sun, 23 Feb 2025 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51N0csph014535; Sun, 23 Feb 2025 00:38:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51N0csPs014532; Sun, 23 Feb 2025 00:38:54 GMT (envelope-from git) Date: Sun, 23 Feb 2025 00:38:54 GMT Message-Id: <202502230038.51N0csPs014532@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a6994e208cca - main - LinuxKPI: rather than manually defining a value use the net80211 define List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6994e208cca65684d160e1795a3b9e8c0a2e0a9 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a6994e208cca65684d160e1795a3b9e8c0a2e0a9 commit a6994e208cca65684d160e1795a3b9e8c0a2e0a9 Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:25:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-22 23:25:35 +0000 LinuxKPI: rather than manually defining a value use the net80211 define Define cfg80211 IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK to net80211 IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK. We should likely at some point make a sweep and replace all the values with the defines from the comments for the matching net80211 version. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 4ae31b257ae0..3454b58f1db7 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2024 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -200,7 +200,7 @@ struct ieee80211_sta_ht_cap { #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ (IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80P80MHZ << IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK_S) -#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK 0x0000000c /* IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK */ +#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 /* IEEE80211_VHTCAP_RXLDPC */ From nobody Sun Feb 23 00:38:56 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0lNc4NPMz5p211; Sun, 23 Feb 2025 00:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0lNc1y7Hz422T; Sun, 23 Feb 2025 00:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SThEHuh/x2rToObO9LO2l5Yydr/gelgFPri1bsX+PWs=; b=eBBLoFPGaoQUxrvdVbs8fMgpwQZmA7yYXnZ671riRKlyON5OxKdJ+Dl68OdJt7kp7YSUMM NyI/4HbyUZ78GhqUgk+mrb7fRJVuFdZDwDW0OeWJlZA9k9d8Atl55cTDZRU3Kyaj5tPBFT cxiGjFh3LiT2EByWHRDeeNBQH3mLQIFX/FhKSk/K/sd9ElAtkUGDwQ92M7742/6jVVVInT rqAaHckf3FWhh8aXq9oRJx7pXXUwqnPj1L7Kx5Zgvlz1qhcr1YXHfGvy0gSVVkh13Ir3um m1ROCK6EU7rnJJkmwcRHBf5gj/7qd/9b3aTNnXQ/8rPtkEtKPq1VS67+E0ELhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740271136; a=rsa-sha256; cv=none; b=HpX6ve4yzjNEt+lRFjZBsn1cIP3W0aSNy+djiQ7Y8HDLNEWHrjcJUByjjq5EM/VSCZC84t DONogi2RObazVO24Vj1946muiD32q/9kmsnOqLDuU4I/e/K3ECl2NegTW2PxckI4jXcO++ ajDF4esJUAVl782Y/cEko98V63frAyCJwhSkKclDRMyhxQAU6h/6kzAfpZHAcZh/fC4f+Y s1+RjaIvVIbMhKO2ek/+r5PfQaY5M3UJFzXqaBHruKGy+kphIBxwKDzwkbrr0F3TVpwJEa Pzf17Ky3AfeTCesHhQ0BewthTPtow5Ylk11ZvGMjm4yhTNw3+lDP4HU/ZrP7ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SThEHuh/x2rToObO9LO2l5Yydr/gelgFPri1bsX+PWs=; b=o74mH2oBYt+so+FxqplUDMx8MvwIiwom9fteQXgECHe7tRwjL0uT0l+JFDrQHXiSaQvHRm epDu2VQDp/A5wBmYxn+HDobbQmkUcyeIgcktK8ynjF3/nGHp7VYhGKUGx9vcao4/n9Q4aq gh0oLoiFEacfgmzKWXe1GA/ZPW+/zPjijUsMd7YIwSzXnC34mlhXvHWh33SsWii2ZvkfCl k5p71p62oJ4loy35s7P7mxIcIoOzCvjQH/J27JDpkRoa/uLjKRB+WASYhxhthMvoIjyGVv LINSNjI0+kSR4e1mnlJZxZU0ZKPxHiBZ10qtcr189xfGsUmTQ/N4YJGdeIWV+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 4Z0lNc1P8QzXMp; Sun, 23 Feb 2025 00:38:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51N0cu4K014573; Sun, 23 Feb 2025 00:38:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51N0cubW014570; Sun, 23 Feb 2025 00:38:56 GMT (envelope-from git) Date: Sun, 23 Feb 2025 00:38:56 GMT Message-Id: <202502230038.51N0cubW014570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 72ee3d57f31e - main - LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72ee3d57f31eff420948048ba3c6afdefe4aab5b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=72ee3d57f31eff420948048ba3c6afdefe4aab5b commit 72ee3d57f31eff420948048ba3c6afdefe4aab5b Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:31:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-22 23:31:46 +0000 LinuxKPI: 802.11: add condition to TODO in ieee80211_sta_recalc_aggregates ieee80211_sta_recalc_aggregates() shows up in TODO traces but there is nothing we have to do there until we have active links (MLO support). Make the TODO conditional for a time when we will get there. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/mac80211.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 69956c90042c..9faf58ed6ee5 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2043,10 +2043,12 @@ ieee80211_sta_pspoll(struct ieee80211_sta *sta) TODO(); } -static __inline void +static inline void ieee80211_sta_recalc_aggregates(struct ieee80211_sta *sta) { - TODO(); + if (sta->valid_links) { + TODO(); + } } static __inline void From nobody Sun Feb 23 00:38:57 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z0lNd6rbkz5p2DS; Sun, 23 Feb 2025 00:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z0lNd2qqZz42Fn; Sun, 23 Feb 2025 00:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2l68dQy3HY2C5ml7JfEh7U9xVbjibZ0HUXbn8f25MwE=; b=am0w8hcO9qxVS3Q1OT6ZOYcGCHORS/dFk1EvqyxQO6EYDAipUQpndlxujqU8hUIR8ZO/7d EUlpmgrF+R9cvbua/Fu8cXyIwEulwl5PTpQrERY+odvoYWOR+KRakPCRWEp8BcZhlertep rgPa2pvPQ5K44sJXq3D6JO/aZF1/yv99o4EmyYdY6tlsBHHMlCws67tscnhf0VpVAa/vcw /4u5aNLJyNEEk+LWXWvmPPEahEcnH0Y5kYBVsNHRcPHUVZ364gNyDrLDaY5Vl+qZaVQgbY isooph/ZN9FZG3C1CK+Oh7YFHO9S0sDscBR5s8FjZlvwnatgv24tFemvk+ygrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740271137; a=rsa-sha256; cv=none; b=X0kALH9eBhsgXFvbxh21bL0kNDZv2QkN5D1LTj5/gIGw9P1WqVS78ZZEv1YbQxmEVd2IAn B5+jqWpVkH9EsGvdxrdjxFdEJRlKopVAz7XAvpzn2IbysrJ8Na++yEFbVF1HZi0YxihVwC KY/ciEzvDWDE1OOs6hOmhzlFgjO9CAxR/n1fIGIC0t5u0L2Ve/B1zpXPgzYsZGwItPzYNd KOfEiS5TzTT1rkvkfWFBrRU65A7Y3hKCEDmfpm5J23EjWTPMiVH3jcdEtePKmKWl2roREh LV/cnP95heZP23UoOA/RsV0ZID9aVjqzEdMmNHGjqcEpYnYd1PofkrbPAYP8Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740271137; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2l68dQy3HY2C5ml7JfEh7U9xVbjibZ0HUXbn8f25MwE=; b=KO4ei/KR5eoOmjLEqpPvEwfL+WUBK3yZqU0rdJ8L8n8wRDOkFsEm3DGx/WYTDqJCQ4e4xs XH5V2GyCQHGqJr/J6QPTn00zqDKngVk5KrSA0QobcX9rR8+0pv/o5OA7V/T6xXbs46vsBL bFEdibJHyXW3VXNQhFWIl+rMY6IaQEMAzUSEPKbkwt4M9SP0kRNionVwJUSsXCL9LHqXPX jAj0h00zm0Jf1BfDgXiF37QDUlniA/feH4KxcDQZQNCLoG3TySsC+MGEaSQDG/pjVhGosi D66Fi3M2847HAP+GLqoW0XFxtuJqVd1uLTzdcAhA5U92T6AdJz8MRQwIso95jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z0lNd2QfZzXbx; Sun, 23 Feb 2025 00:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 51N0cvTq014611; Sun, 23 Feb 2025 00:38:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51N0cvLB014608; Sun, 23 Feb 2025 00:38:57 GMT (envelope-from git) Date: Sun, 23 Feb 2025 00:38:57 GMT Message-Id: <202502230038.51N0cvLB014608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 65c573e47c40 - main - LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65c573e47c40e3f167f3d7e41bd8db40b6b8f91e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=65c573e47c40e3f167f3d7e41bd8db40b6b8f91e commit 65c573e47c40e3f167f3d7e41bd8db40b6b8f91e Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 23:38:54 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-23 00:36:50 +0000 LinuxKPI: 802.11: fix locking in lkpi_ic_ampdu_rx_stop() net80211 has inconsistent locking when calling into (*ic_ampdu_rx_stop)(). Make use of 054c5ddf587a7 and conditionally check if the caller locked or not and if locked temporary drop the lock to avoid sleeping on a non-sleepaable lock during the downcall into the driver. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 62d29feabb09..8daa2fa4dc8e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -5024,6 +5024,7 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) struct ieee80211_ampdu_params params = { }; int error; uint8_t tid; + bool ic_locked; ic = ni->ni_ic; lhw = ic->ic_softc; @@ -5061,11 +5062,14 @@ lkpi_ic_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) params.tid = tid; params.amsdu = false; - // IEEE80211_UNLOCK(ic); + ic_locked = IEEE80211_IS_LOCKED(ic); + if (ic_locked) + IEEE80211_UNLOCK(ic); LKPI_80211_LHW_LOCK(lhw); error = lkpi_80211_mo_ampdu_action(hw, vif, ¶ms); LKPI_80211_LHW_UNLOCK(lhw); - // IEEE80211_LOCK(ic); + if (ic_locked) + IEEE80211_LOCK(ic); if (error != 0) ic_printf(ic, "%s: mo_ampdu_action returned %d. ni %p rap %p\n", __func__, error, ni, rap); From nobody Sun Feb 23 10:49:24 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z10x04RyMz5pyn1; Sun, 23 Feb 2025 10:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z10x02bbXz3fdf; Sun, 23 Feb 2025 10:49:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740307764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5viaRHPlJgl1AJUzjtadGaeAGWSzrS6RaR+BS0a5t30=; b=b0ySzlXIxm69/MJ82zcLB2s7BUPOTNZkmHfASVoJG8H3kZmAdyrQs9eRWIqTej2Iygm8yC HhBHv3OqhUbfQLbNTc6AzWBSneOvDeNl/vpRhzEzHTzPrv4rWzdefkNDyItXB8XodNi4+h qz1R3D5VKr+EG5r4nd9tIpUjOKhjq7FSa5eFqOcw29MlfYrA8yzC72mKfxsqW0eZL8QySB gJ05RJy6QMlZARwaB0/7+T4qhO6vNPO3wr/rHhIoybuhlVD0OBxJPoDi9tt4QgBEkeASfI U/BdW2S4BnS8hm6I9bAu+UQ/hfmlg+L0MQfq6CSF/qRWJXXslhwUIBHyUq/38Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740307764; a=rsa-sha256; cv=none; b=oTNQh43dvGEXGLbuLSrrv6SPh5xQRXAG/4K18UIdt+3p7DAs4bW92QJskc1+0AdexQ9VEv F8rc0Go2f025eYZFUMdTRP2hqP0B8Qp+ovaFMqBAjGPSPXcbDbXi/5nb8JMi2ZN/EVF5Kv mwxeie7th+dB7yBmVJztpU/V+850jJOt9nlaplO9xTiwKjl4onBNI4s9sybgY5syYgSg5i jfrZEz1VCIXzBM1t/ntlJO5mxV6taqoM4nWmR17qxFHsIQZCrsjTsVdb4xRhL0KIkOLfyR 7qDKwaSas74iIT9j8rWHoxdHwOxW1T/ciSU0XNIdB1kGT7Rpp3hJucNj6zVK1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740307764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5viaRHPlJgl1AJUzjtadGaeAGWSzrS6RaR+BS0a5t30=; b=fk45+Th4WBLlCVOpG8uF1gCKdn6QHg7iUddBr8xQztRdh603x/sJR+zPAMF23UtH0yV7FI IsTTb3Rdk9y7rF9SJoQOjTpKmbXSQ9YiiEInWbD+PlyWpBjJH6QhLx0vhQvVtvIOnSq0gc QIh98aeFPC/+KF58Fp60b0f5dI9hk2LIEQkojklellBT40CIKMEUfnGpyThyKSRq2bZcAh UF4HYwvU9ZNO2GSWZjIrpGguIEuWfL0Dbj+FH1oO3lHsPxBnaGZ31ekSSdrssWM4TI4KDi eA7Uu3YgvQ+UoETmx/3JL2asaMTCAc5aRAoHz9RS6VtenC3X5tdomYccXizo+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 4Z10x01h94zrTl; Sun, 23 Feb 2025 10:49: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 51NAnOpx054158; Sun, 23 Feb 2025 10:49:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51NAnOdC054155; Sun, 23 Feb 2025 10:49:24 GMT (envelope-from git) Date: Sun, 23 Feb 2025 10:49:24 GMT Message-Id: <202502231049.51NAnOdC054155@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 51a8eb641046 - main - kyua: Pass unprivileged user config prop to ATF using all known names List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51a8eb6410461c94c8e0f2b59e3417cfb5d7da75 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=51a8eb6410461c94c8e0f2b59e3417cfb5d7da75 commit 51a8eb6410461c94c8e0f2b59e3417cfb5d7da75 Author: Igor Ostapenko AuthorDate: 2025-02-23 10:41:58 +0000 Commit: Igor Ostapenko CommitDate: 2025-02-23 10:41:58 +0000 kyua: Pass unprivileged user config prop to ATF using all known names Kyua and ATF speak different naming styles. In this case, the unprivileged user property can be named with underscore on the Kyua side, and with a hyphen on the ATF side. Sometimes it is not obvious which style should be used in which situation. For instance, a test case may require this configuration property being set using require.config. Also, a test case may want to read the property using something like atf_tc_get_config_var(). Which names should be used in these cases? From the perspective of the original code, it is expected to be this: require.config unprivileged-user atf_tc_get_config_var(tc, "unprivileged-user") But, as long as Kyua is the main interface, its users expect to work with kyua.conf(5), which says that it must be named as unprivileged_user (with underscore). As a result, test authors tend to do this instead: require.config unprivileged_user atf_tc_get_config_var(tc, "unprivileged_user") Kyua already has hacks to understand both unprivileged_user and unprivileged-user coming from require.config. And this patch covers the missing second part -- make Kyua pass both names back to ATF as two identical configuration properties named different ways. Reviewed by: ngie, asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D49039 --- contrib/kyua/engine/scheduler.cpp | 3 ++ contrib/kyua/engine/scheduler_test.cpp | 1 + contrib/kyua/integration/cmd_test_test.sh | 43 +++++++++++++++++++++++++++++ contrib/kyua/integration/helpers/config.cpp | 10 +++++-- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/contrib/kyua/engine/scheduler.cpp b/contrib/kyua/engine/scheduler.cpp index e75091a40e38..d4507a247323 100644 --- a/contrib/kyua/engine/scheduler.cpp +++ b/contrib/kyua/engine/scheduler.cpp @@ -1632,7 +1632,10 @@ scheduler::generate_config(const config::tree& user_config, if (user_config.is_set("unprivileged_user")) { const passwd::user& user = user_config.lookup< engine::user_node >("unprivileged_user"); + // The property is duplicated using both ATF and Kyua naming styles + // for better UX. props["unprivileged-user"] = user.name; + props["unprivileged_user"] = user.name; } return props; diff --git a/contrib/kyua/engine/scheduler_test.cpp b/contrib/kyua/engine/scheduler_test.cpp index e144761d8f01..d91c448f2e5e 100644 --- a/contrib/kyua/engine/scheduler_test.cpp +++ b/contrib/kyua/engine/scheduler_test.cpp @@ -1192,6 +1192,7 @@ ATF_TEST_CASE_BODY(generate_config__some_matches) config::properties_map exp_props; exp_props["unprivileged-user"] = "nobody"; + exp_props["unprivileged_user"] = "nobody"; exp_props["var1"] = "value 1"; ATF_REQUIRE_EQ(exp_props, diff --git a/contrib/kyua/integration/cmd_test_test.sh b/contrib/kyua/integration/cmd_test_test.sh index f0862cf29582..4c2fe863a4f5 100644 --- a/contrib/kyua/integration/cmd_test_test.sh +++ b/contrib/kyua/integration/cmd_test_test.sh @@ -596,6 +596,48 @@ EOF } +utils_test_case config_unprivileged_user +config_unprivileged_user_body() { + cat >"my-config" <Kyuafile < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8b3d2c19d369 - main - inpcb: Fix reuseport lbgroup array resizing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8b3d2c19d3691f29d4e86c73bc11491ae3fbfaec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8b3d2c19d3691f29d4e86c73bc11491ae3fbfaec commit 8b3d2c19d3691f29d4e86c73bc11491ae3fbfaec Author: Mark Johnston AuthorDate: 2025-02-23 16:20:12 +0000 Commit: Mark Johnston CommitDate: 2025-02-23 16:20:12 +0000 inpcb: Fix reuseport lbgroup array resizing in_pcblisten() moves an inpcb from the per-group list into the array, at which point it becomes visible to inpcb lookups in the datapath. It assumes that there is space in the array for this, but that's not guaranteed, since in_pcbinslbgrouphash() doesn't reserve space in the array if the inpcb isn't associated with a listening socket. We could resize the array in in_pcblisten(), but that would introduce a failure case where there currently is none. Instead, keep track of the number of pending inpcbs as well, and modify in_pcbinslbgrouphash() to reserve space for each pending (i.e., not-yet-listening) inpcb. Add a regression test. Reviewed by: glebius Reported by: netchild Fixes: 7cbb6b6e28db ("inpcb: Close some SO_REUSEPORT_LB races, part 2") Differential Revision: https://reviews.freebsd.org/D49100 --- sys/netinet/in_pcb.c | 7 ++++- sys/netinet/in_pcb_var.h | 1 + tests/sys/netinet/so_reuseport_lb_test.c | 46 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 9d174dce9024..1d9cc1866e15 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -339,6 +339,7 @@ in_pcblbgroup_insert(struct inpcblbgroup *grp, struct inpcb *inp) * lookups until listen() has been called. */ LIST_INSERT_HEAD(&grp->il_pending, inp, inp_lbgroup_list); + grp->il_pendcnt++; } else { grp->il_inp[grp->il_inpcnt] = inp; @@ -375,6 +376,8 @@ in_pcblbgroup_resize(struct inpcblbgrouphead *hdr, CK_LIST_INSERT_HEAD(hdr, grp, il_list); LIST_SWAP(&old_grp->il_pending, &grp->il_pending, inpcb, inp_lbgroup_list); + grp->il_pendcnt = old_grp->il_pendcnt; + old_grp->il_pendcnt = 0; in_pcblbgroup_free(old_grp); return (grp); } @@ -435,7 +438,7 @@ in_pcbinslbgrouphash(struct inpcb *inp, uint8_t numa_domain) return (ENOBUFS); in_pcblbgroup_insert(grp, inp); CK_LIST_INSERT_HEAD(hdr, grp, il_list); - } else if (grp->il_inpcnt == grp->il_inpsiz) { + } else if (grp->il_inpcnt + grp->il_pendcnt == grp->il_inpsiz) { if (grp->il_inpsiz >= INPCBLBGROUP_SIZMAX) { if (ratecheck(&lastprint, &interval)) printf("lb group port %d, limit reached\n", @@ -499,6 +502,7 @@ in_pcbremlbgrouphash(struct inpcb *inp) LIST_FOREACH(inp1, &grp->il_pending, inp_lbgroup_list) { if (inp == inp1) { LIST_REMOVE(inp, inp_lbgroup_list); + grp->il_pendcnt--; inp->inp_flags &= ~INP_INLBGROUP; return; } @@ -1503,6 +1507,7 @@ in_pcblisten(struct inpcb *inp) INP_HASH_WLOCK(pcbinfo); grp = in_pcblbgroup_find(inp); LIST_REMOVE(inp, inp_lbgroup_list); + grp->il_pendcnt--; in_pcblbgroup_insert(grp, inp); INP_HASH_WUNLOCK(pcbinfo); } diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h index e2b0ca386e7f..32fdbced175c 100644 --- a/sys/netinet/in_pcb_var.h +++ b/sys/netinet/in_pcb_var.h @@ -82,6 +82,7 @@ struct inpcblbgroup { #define il6_laddr il_dependladdr.id6_addr uint32_t il_inpsiz; /* max count in il_inp[] (h) */ uint32_t il_inpcnt; /* cur count in il_inp[] (h) */ + uint32_t il_pendcnt; /* cur count in il_pending (h) */ struct inpcb *il_inp[]; /* (h) */ }; diff --git a/tests/sys/netinet/so_reuseport_lb_test.c b/tests/sys/netinet/so_reuseport_lb_test.c index 09d8e0ce8f83..aaadaead5e23 100644 --- a/tests/sys/netinet/so_reuseport_lb_test.c +++ b/tests/sys/netinet/so_reuseport_lb_test.c @@ -433,6 +433,51 @@ ATF_TC_BODY(double_listen_ipv6, tc) ATF_REQUIRE_MSG(error == 0, "close() failed: %s", strerror(errno)); } +/* + * Try binding many sockets to the same lbgroup without calling listen(2) on + * them. + */ +ATF_TC_WITHOUT_HEAD(bind_without_listen); +ATF_TC_BODY(bind_without_listen, tc) +{ + const int nsockets = 100; + struct sockaddr_in sin; + socklen_t socklen; + int error, s, s2[nsockets]; + + s = lb_listen_socket(PF_INET, 0); + + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(sin); + sin.sin_family = AF_INET; + sin.sin_port = htons(0); + sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + error = bind(s, (struct sockaddr *)&sin, sizeof(sin)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + + socklen = sizeof(sin); + error = getsockname(s, (struct sockaddr *)&sin, &socklen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + + for (int i = 0; i < nsockets; i++) { + s2[i] = lb_listen_socket(PF_INET, 0); + error = bind(s2[i], (struct sockaddr *)&sin, sizeof(sin)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + } + for (int i = 0; i < nsockets; i++) { + error = listen(s2[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + } + for (int i = 0; i < nsockets; i++) { + error = close(s2[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", strerror(errno)); + } + + error = close(s); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", strerror(errno)); +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, basic_ipv4); @@ -440,6 +485,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, concurrent_add); ATF_TP_ADD_TC(tp, double_listen_ipv4); ATF_TP_ADD_TC(tp, double_listen_ipv6); + ATF_TP_ADD_TC(tp, bind_without_listen); return (atf_no_error()); } From nobody Sun Feb 23 23:26:45 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Z1Kkt0kQvz5pBR7; Sun, 23 Feb 2025 23:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Z1Kkt0YGPz4FB5; Sun, 23 Feb 2025 23:26:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740353206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qf31WMAFVFbgT1hd68p9JEZZKdtYT6b814iMCDt82yk=; b=dks8y9Avz0jTSCxaygLXqbYef3wHbI2zCG+lEcVPwz7pCwELo/zY9ePnC5gK94ByhM3Ozz Gl176pbuY3XRn0hgKozGsQsChFanqciSRzCI/5MMAiwzu0HFLm2BNrS1eTXrmFzeN/4MPZ pYQQSIyOYMuWUnyZFrbc1IvGvr2tDQQyu3bDipsl1s39WT8ytK9swIvJkEApSIA3vs9ATx PnRUISAVscQk4vxS3DbaGRiOFCBJpmjIu7OMx7fsFrB1sACmVVJMHnLK8GmvOdhCb45+YZ 7fr0y0/HZBJb3AUkVmbwbKON57KbuD78NnCWqFrkHkxC8BkicJpc9niQJj3W7A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740353206; a=rsa-sha256; cv=none; b=cWUVKPCz4+m8nhA7dBz/6Njf+ZcCOrr00g2Wrm0JOAoV/HGspSR2Sph61LsckVcHOxSDNZ /Ohk5HVrBusTsobMP2pJQa8sCQOfBdQxRMXfSiMk4AUjQEPZX5MMr0jhfFbKc6HXnTyBlA XwZaXX7bUTVUweZdYdDWUu9G5nastVm6vUbM2G6IHUurm3HLvHnQ0IjMowr2H8HCw5QBFn sPSXhTYEPtISypZooe6mawdk3xUuAr4kzv4qW7OZ5h9NRFFf64UyLDdy9ocMOdfxj8og/+ TqsKgR2/0TkGbFjxCXijsu09SsmGmN4I9K7zU3ebbCA06ZP41F0UH0dQHXxQCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740353206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qf31WMAFVFbgT1hd68p9JEZZKdtYT6b814iMCDt82yk=; b=YC9nQGF9mWd/E91Glw4Vv9ulW9RyicjWa5XFBBCUdt7AChnsiB52aWvU5qgHQVv9n2NMcH 3lOptorc9kopx3aCxLlQp9lV6XvPSmQmhVwPMvYWGNhhwuW0Yqj4PxrlJ+8Wfdeq7szavM YmT8kuY5GlOqxu6U0oVHehmUXGkblV/oiG+bthWU1HGYZGuuAiXMAT6ZYF9uXaKXGG5mbv pmbzlfjjRAvrh/c/kW5VaMA8NKloLVLW5LqioH8OuUia+0OD+KEucVJ+8BrLd9WA//RCDO ZBE0FGFW30YMtDCFRsgRTXJBMfevY2QNMDYzJVeNxg42wlT/T5rHgpu5QUai2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Z1Kks6yBrztX; Sun, 23 Feb 2025 23:26: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 51NNQjNl072039; Sun, 23 Feb 2025 23:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51NNQj9X072036; Sun, 23 Feb 2025 23:26:45 GMT (envelope-from git) Date: Sun, 23 Feb 2025 23:26:45 GMT Message-Id: <202502232326.51NNQj9X072036@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2ab4a4195615 - main - LinuxKPI: skbuff: add synchronization primitives and missing bits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ab4a41956159e7c974979693cb0b13cf552128e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2ab4a41956159e7c974979693cb0b13cf552128e commit 2ab4a41956159e7c974979693cb0b13cf552128e Author: Bjoern A. Zeeb AuthorDate: 2025-02-22 02:00:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-23 23:25:32 +0000 LinuxKPI: skbuff: add synchronization primitives and missing bits Make a pass over skbuff.h: - implement some missing bits, - sprinkle some const, - add locking and read/write_once calls as needed to provide synchronization as expected by Linux, - fix some typos, - remove return from void functions, - adjust tracing macros. Sponsored by: The FreeBSD Foundation MFC after: 3 days PR: 283903 (rtw88 skb leak) Tested by: Guillaume Outters (guillaume-freebsd outters.eu) Differential Revision: https://reviews.freebsd.org/D49101 --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 281 +++++++++++++--------- sys/compat/linuxkpi/common/src/linux_skbuff.c | 2 +- 2 files changed, 165 insertions(+), 118 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index 43f35d8f065f..9db29c72e20c 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2023 The FreeBSD Foundation + * Copyright (c) 2020-2025 The FreeBSD Foundation * Copyright (c) 2021-2023 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -45,6 +45,7 @@ #include #include #include +#include #include "opt_wlan.h" @@ -167,6 +168,7 @@ struct sk_buff { #define _SKB_FLAGS_SKBEXTFRAG 0x0001 enum sk_buff_pkt_type pkt_type; uint16_t mac_header; /* offset of mac_header */ + refcount_t refcnt; /* "Scratch" area for layers to store metadata. */ /* ??? I see sizeof() operations so probably an array. */ @@ -199,7 +201,7 @@ struct sk_buff *linuxkpi_dev_alloc_skb(size_t, gfp_t); struct sk_buff *linuxkpi_build_skb(void *, size_t); void linuxkpi_kfree_skb(struct sk_buff *); -struct sk_buff *linuxkpi_skb_copy(struct sk_buff *, gfp_t); +struct sk_buff *linuxkpi_skb_copy(const struct sk_buff *, gfp_t); /* -------------------------------------------------------------------------- */ @@ -242,6 +244,13 @@ kfree_skb(struct sk_buff *skb) linuxkpi_kfree_skb(skb); } +static inline void +consume_skb(struct sk_buff *skb) +{ + SKB_TRACE(skb); + kfree_skb(skb); +} + static inline void dev_kfree_skb(struct sk_buff *skb) { @@ -276,9 +285,12 @@ build_skb(void *data, unsigned int fragsz) /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ -#define skb_list_walk_safe(_q, skb, tmp) \ - for ((skb) = (_q)->next; (skb) != NULL && ((tmp) = (skb)->next); (skb) = (tmp)) +static inline bool +skb_is_nonlinear(struct sk_buff *skb) +{ + SKB_TRACE(skb); + return ((skb->data_len > 0) ? true : false); +} /* Add headroom; cannot do once there is data in there. */ static inline void @@ -350,12 +362,14 @@ skb_tailroom(struct sk_buff *skb) SKB_TRACE(skb); KASSERT((skb->end - skb->tail) >= 0, ("%s: skb %p tailroom < 0, " "end %p tail %p\n", __func__, skb, skb->end, skb->tail)); + if (unlikely(skb_is_nonlinear(skb))) + return (0); return (skb->end - skb->tail); } -/* Return numer of bytes available at the beginning of buffer. */ +/* Return number of bytes available at the beginning of buffer. */ static inline unsigned int -skb_headroom(struct sk_buff *skb) +skb_headroom(const struct sk_buff *skb) { SKB_TRACE(skb); KASSERT((skb->data - skb->head) >= 0, ("%s: skb %p headroom < 0, " @@ -502,13 +516,10 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, skb->len += size; skb->data_len += size; skb->truesize += truesize; - - /* XXX TODO EXTEND truesize? */ } /* -------------------------------------------------------------------------- */ -/* XXX BZ review this one for terminal condition as Linux "queues" are special. */ #define skb_queue_walk(_q, skb) \ for ((skb) = (_q)->next; (skb) != (struct sk_buff *)(_q); \ (skb) = (skb)->next) @@ -517,12 +528,23 @@ skb_add_rx_frag(struct sk_buff *skb, int fragno, struct page *page, for ((skb) = (_q)->next, (tmp) = (skb)->next; \ (skb) != (struct sk_buff *)(_q); (skb) = (tmp), (tmp) = (skb)->next) +#define skb_list_walk_safe(_q, skb, tmp) \ + for ((skb) = (_q), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL; \ + ((skb) != NULL); \ + (skb) = (tmp), (tmp) = ((skb) != NULL) ? (skb)->next ? NULL) + static inline bool -skb_queue_empty(struct sk_buff_head *q) +skb_queue_empty(const struct sk_buff_head *q) { + SKB_TRACE(q); + return (q->next == (const struct sk_buff *)q); +} +static inline bool +skb_queue_empty_lockless(const struct sk_buff_head *q) +{ SKB_TRACE(q); - return (q->qlen == 0); + return (READ_ONCE(q->next) == (const struct sk_buff *)q); } static inline void @@ -537,7 +559,8 @@ static inline void skb_queue_head_init(struct sk_buff_head *q) { SKB_TRACE(q); - return (__skb_queue_head_init(q)); + __skb_queue_head_init(q); + spin_lock_init(&q->lock); } static inline void @@ -546,11 +569,11 @@ __skb_insert(struct sk_buff *new, struct sk_buff *prev, struct sk_buff *next, { SKB_TRACE_FMT(new, "prev %p next %p q %p", prev, next, q); - new->prev = prev; - new->next = next; - ((struct sk_buff_head_l *)next)->prev = new; - ((struct sk_buff_head_l *)prev)->next = new; - q->qlen++; + WRITE_ONCE(new->prev, prev); + WRITE_ONCE(new->next, next); + WRITE_ONCE(((struct sk_buff_head_l *)next)->prev, new); + WRITE_ONCE(((struct sk_buff_head_l *)prev)->next, new); + WRITE_ONCE(q->qlen, q->qlen + 1); } static inline void @@ -582,53 +605,62 @@ __skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) static inline void skb_queue_tail(struct sk_buff_head *q, struct sk_buff *new) { + unsigned long flags; + SKB_TRACE2(q, new); - return (__skb_queue_tail(q, new)); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_tail(q, new); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * -skb_peek(struct sk_buff_head *q) +skb_peek(const struct sk_buff_head *q) { struct sk_buff *skb; skb = q->next; SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline struct sk_buff * -skb_peek_tail(struct sk_buff_head *q) +skb_peek_tail(const struct sk_buff_head *q) { struct sk_buff *skb; - skb = q->prev; + skb = READ_ONCE(q->prev); SKB_TRACE2(q, skb); - if (skb == (struct sk_buff *)q) + if (skb == (const struct sk_buff *)q) return (NULL); return (skb); } static inline void -__skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +__skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); struct sk_buff *p, *n; - head->qlen--; + SKB_TRACE2(skb, q); + + WRITE_ONCE(q->qlen, q->qlen - 1); p = skb->prev; n = skb->next; - p->next = n; - n->prev = p; + WRITE_ONCE(n->prev, p); + WRITE_ONCE(p->next, n); skb->prev = skb->next = NULL; } static inline void -skb_unlink(struct sk_buff *skb, struct sk_buff_head *head) +skb_unlink(struct sk_buff *skb, struct sk_buff_head *q) { - SKB_TRACE2(skb, head); - return (__skb_unlink(skb, head)); + unsigned long flags; + + SKB_TRACE2(skb, q); + spin_lock_irqsave(&q->lock, flags); + __skb_unlink(skb, q); + spin_unlock_irqrestore(&q->lock, flags); } static inline struct sk_buff * @@ -636,32 +668,47 @@ __skb_dequeue(struct sk_buff_head *q) { struct sk_buff *skb; - SKB_TRACE(q); - skb = q->next; - if (skb == (struct sk_buff *)q) - return (NULL); + skb = skb_peek(q); if (skb != NULL) __skb_unlink(skb, q); - SKB_TRACE(skb); + SKB_TRACE2(q, skb); return (skb); } static inline struct sk_buff * skb_dequeue(struct sk_buff_head *q) { - SKB_TRACE(q); - return (__skb_dequeue(q)); + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue(q); + spin_unlock_irqrestore(&q->lock, flags); + SKB_TRACE2(q, skb); + return (skb); } static inline struct sk_buff * -skb_dequeue_tail(struct sk_buff_head *q) +__skb_dequeue_tail(struct sk_buff_head *q) { struct sk_buff *skb; skb = skb_peek_tail(q); if (skb != NULL) __skb_unlink(skb, q); + SKB_TRACE2(q, skb); + return (skb); +} +static inline struct sk_buff * +skb_dequeue_tail(struct sk_buff_head *q) +{ + unsigned long flags; + struct sk_buff *skb; + + spin_lock_irqsave(&q->lock, flags); + skb = __skb_dequeue_tail(q); + spin_unlock_irqrestore(&q->lock, flags); SKB_TRACE2(q, skb); return (skb); } @@ -677,27 +724,74 @@ __skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) static inline void skb_queue_head(struct sk_buff_head *q, struct sk_buff *skb) { + unsigned long flags; SKB_TRACE2(q, skb); - __skb_queue_after(q, (struct sk_buff *)q, skb); + spin_lock_irqsave(&q->lock, flags); + __skb_queue_head(q, skb); + spin_unlock_irqrestore(&q->lock, flags); } static inline uint32_t -skb_queue_len(struct sk_buff_head *head) +skb_queue_len(const struct sk_buff_head *q) { - SKB_TRACE(head); - return (head->qlen); + SKB_TRACE(q); + return (q->qlen); } static inline uint32_t -skb_queue_len_lockless(const struct sk_buff_head *head) +skb_queue_len_lockless(const struct sk_buff_head *q) +{ + + SKB_TRACE(q); + return (READ_ONCE(q->qlen)); +} + +static inline void +___skb_queue_splice(const struct sk_buff_head *from, + struct sk_buff *p, struct sk_buff *n) { + struct sk_buff *b, *e; - SKB_TRACE(head); - return (READ_ONCE(head->qlen)); + b = from->next; + e = from->prev; + + WRITE_ONCE(b->prev, p); + WRITE_ONCE(((struct sk_buff_head_l *)p)->next, b); + WRITE_ONCE(e->next, n); + WRITE_ONCE(((struct sk_buff_head_l *)n)->prev, e); } +static inline void +skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, (struct sk_buff *)to, to->next); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + +static inline void +skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) +{ + + SKB_TRACE2(from, to); + + if (skb_queue_empty(from)) + return; + + ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); + to->qlen += from->qlen; + __skb_queue_head_init(from); +} + + static inline void __skb_queue_purge(struct sk_buff_head *q) { @@ -713,8 +807,19 @@ __skb_queue_purge(struct sk_buff_head *q) static inline void skb_queue_purge(struct sk_buff_head *q) { + struct sk_buff_head _q; + unsigned long flags; + SKB_TRACE(q); - return (__skb_queue_purge(q)); + + if (skb_queue_empty_lockless(q)) + return; + + __skb_queue_head_init(&_q); + spin_lock_irqsave(&q->lock, flags); + skb_queue_splice_init(q, &_q); + spin_unlock_irqrestore(&q->lock, flags); + __skb_queue_purge(&_q); } static inline struct sk_buff * @@ -729,7 +834,7 @@ skb_queue_prev(struct sk_buff_head *q, struct sk_buff *skb) /* -------------------------------------------------------------------------- */ static inline struct sk_buff * -skb_copy(struct sk_buff *skb, gfp_t gfp) +skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; @@ -738,13 +843,6 @@ skb_copy(struct sk_buff *skb, gfp_t gfp) return (new); } -static inline void -consume_skb(struct sk_buff *skb) -{ - SKB_TRACE(skb); - SKB_TODO(); -} - static inline uint16_t skb_checksum(struct sk_buff *skb, int offs, size_t len, int x) { @@ -774,8 +872,7 @@ static inline size_t skb_frag_size(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (-1); + return (frag->size); } #define skb_walk_frags(_skb, _frag) \ @@ -800,8 +897,7 @@ static inline void * skb_frag_address(const skb_frag_t *frag) { SKB_TRACE(frag); - SKB_TODO(); - return (NULL); + return (page_address(frag->page + frag->offset)); } static inline void @@ -831,50 +927,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); -} - -static inline void -___skb_queue_splice(const struct sk_buff_head *from, - struct sk_buff *p, struct sk_buff *n) -{ - struct sk_buff *b, *e; - - b = from->next; - e = from->prev; - - b->prev = p; - ((struct sk_buff_head_l *)p)->next = b; - e->next = n; - ((struct sk_buff_head_l *)n)->prev = e; -} - -static inline void -skb_queue_splice_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, (struct sk_buff *)to, to->next); - to->qlen += from->qlen; - __skb_queue_head_init(from); -} - -static inline void -skb_queue_splice_tail_init(struct sk_buff_head *from, struct sk_buff_head *to) -{ - - SKB_TRACE2(from, to); - - if (skb_queue_empty(from)) - return; - - ___skb_queue_splice(from, to->prev, (struct sk_buff *)to); - to->qlen += from->qlen; - __skb_queue_head_init(from); + skb->next = NULL; } static inline void @@ -901,25 +954,17 @@ skb_network_header(struct sk_buff *skb) return (skb->head + skb->l3hdroff); } -static inline bool -skb_is_nonlinear(struct sk_buff *skb) -{ - SKB_TRACE(skb); - return ((skb->data_len > 0) ? true : false); -} - static inline int __skb_linearize(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (ENXIO); + return (-ENXIO); } static inline int skb_linearize(struct sk_buff *skb) { - return (skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0); } @@ -953,7 +998,7 @@ skb_header_cloned(struct sk_buff *skb) { SKB_TRACE(skb); SKB_TODO(); - return (false); + return (true); } static inline uint8_t * @@ -996,7 +1041,6 @@ skb_orphan(struct sk_buff *skb) static inline __sum16 csum_unfold(__sum16 sum) { - SKB_TODO(); return (sum); } @@ -1022,7 +1066,8 @@ static inline struct sk_buff * skb_get(struct sk_buff *skb) { - SKB_TODO(); /* XXX refcnt? as in get/put_device? */ + SKB_TRACE(skb); + refcount_inc(&skb->refcnt); return (skb); } @@ -1057,7 +1102,8 @@ skb_list_del_init(struct sk_buff *skb) { SKB_TRACE(skb); - SKB_TODO(); + __list_del_entry(&skb->list); + skb_mark_not_on_list(skb); } static inline void @@ -1088,6 +1134,7 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb) { SKB_TRACE(skb); + /* page_pool */ SKB_TODO(); } diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c index 0522d3fdff41..16a7083123be 100644 --- a/sys/compat/linuxkpi/common/src/linux_skbuff.c +++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c @@ -169,7 +169,7 @@ linuxkpi_build_skb(void *data, size_t fragsz) } struct sk_buff * -linuxkpi_skb_copy(struct sk_buff *skb, gfp_t gfp) +linuxkpi_skb_copy(const struct sk_buff *skb, gfp_t gfp) { struct sk_buff *new; struct skb_shared_info *shinfo;