From nobody Sun Jul 16 01:29:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3SL35GH5z4md7d; Sun, 16 Jul 2023 01:29: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3SL34kfdz3jx2; Sun, 16 Jul 2023 01:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689470955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7hrP8ppGO0jmIyQj2gzhSrxPm8pMKLmchgyimv1okk=; b=qqawLc/OOeGbHbLfvM0YaAifyJmZTQsq5cIIrZx68au5K262ZZjgsoOrH8e9K3ROMrrlTe bbyjep+2+pNoei24pzaoCR577H5Qd4jMM9p8bOV716yYMyikaU4QXeMkfMj7SyUXcD40Ik UgXXo6QjEzXuMk76KzxFbBvG15CX2BLDKLtIe7QVgoubHTju5FQd0XxbdItwJbZ3xqJNki sDqG09uBU4NnFLY94t/Ip3w2qapYHIqY8rYPLFdhhLx+P1aBT693Qrj0g06yfFbM6kvNrX dEIDce/gZciUiojnB4tGx/6ifWhca3GoN6lGPQYF+N5ZZhBSrNE5j/MA1mQ+XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689470955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+7hrP8ppGO0jmIyQj2gzhSrxPm8pMKLmchgyimv1okk=; b=fRvRT16xwimBlOp6XzV6OvPE5Mr+Tnu8HyL4pWqIcP39Oz6Bz2/sbjgWKsxWezVCFXwBM9 bjX9t7fSab+W+aNMrRaVlxWNA2G2L10uC9S5JckIwWbArCZBIGvm7bQFS7ijFAhAzKgrbO d6N1aS0yzhrcNxrm3xE8+J2p5cLazEjVlaM4wTAt/NrHVY3bn8hr3b+NFEuTnjOFTyFSg8 RsMIKWLSEQKjjFXrKemufj3fU+f4Wy+SHVycQyvGiFdJRhRko3zfGnlWQ/M4fGMKMkBF2R Wg1Z/6OulACOeLyNreE0kVVgiPcg9rmM8q5A4jsonSeOPtRJ20i/K+YlVV3msw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689470955; a=rsa-sha256; cv=none; b=ErEmQhmuNu2z6MAbcLKL1twY66SumxHyUlxzXZrzTm/5+V4DBXmoRiA+PMxdYrO+HEdas3 UNofKKssrhG9dL3D6+aoURGT7DlUwFO1RRgsrd87+eECWQS40rfPrmrEzZJsXbsCl6tHTo 6Et/EWJqQ6UlCPttvuJXispiWeox0tXOgP+j/Osx/rUbd6PIrMc6XuHltAZ7pcfJCRShoi ol3IsU5LyYsVIzUuH4wdFBrfYOMcWDYifwsNTGbU9O5cnoVwzmPKA2LAaki/KifhFLOoox EhVSjLOfIhVwpzIDkk7NZlzDCY2L/W2NmCG/AWKL2qODiEYwyd55vZC6PGO2lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3SL33jGRzN31; Sun, 16 Jul 2023 01:29:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36G1TFlJ072686; Sun, 16 Jul 2023 01:29:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36G1T8S4072679; Sun, 16 Jul 2023 01:29:08 GMT (envelope-from git) Date: Sun, 16 Jul 2023 01:29:08 GMT Message-Id: <202307160129.36G1T8S4072679@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: a9490b81b032 - main - Merge LUA 5.4.6 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 commit a9490b81b032b43cdb3c8c76b4d01bbad9ff82c1 Merge: 5ac2a874d070 71944acbe7e5 Author: Warner Losh AuthorDate: 2023-07-15 17:31:04 +0000 Commit: Warner Losh CommitDate: 2023-07-15 17:31:04 +0000 Merge LUA 5.4.6 This is a bug fix to Lua 5.4.4 (5.4.5 was withdrawn due to ABI issues and 5.4.6 is 5.4.5 with those fixed). contrib/lua/Makefile | 4 +- contrib/lua/README | 2 +- contrib/lua/doc/contents.html | 12 +- contrib/lua/doc/lua.1 | 16 +- contrib/lua/doc/manual.html | 311 ++++--- contrib/lua/doc/readme.html | 13 +- contrib/lua/src/Makefile | 5 +- contrib/lua/src/lapi.c | 249 +++--- contrib/lua/src/lapi.h | 17 +- contrib/lua/src/lauxlib.c | 56 +- contrib/lua/src/lcode.c | 137 ++- contrib/lua/src/lcorolib.c | 4 +- contrib/lua/src/ldebug.c | 80 +- contrib/lua/src/ldebug.h | 2 +- contrib/lua/src/ldo.c | 229 ++--- contrib/lua/src/ldo.h | 17 +- contrib/lua/src/ldump.c | 8 +- contrib/lua/src/lfunc.c | 54 +- contrib/lua/src/lfunc.h | 6 +- contrib/lua/src/lgc.c | 106 ++- contrib/lua/src/lgc.h | 19 +- contrib/lua/src/llex.c | 6 +- contrib/lua/src/llimits.h | 21 +- contrib/lua/src/lmathlib.c | 10 +- contrib/lua/src/lmem.c | 68 +- contrib/lua/src/loadlib.c | 9 +- contrib/lua/src/lobject.c | 38 +- contrib/lua/src/lobject.h | 19 +- contrib/lua/src/lopcodes.h | 2 +- contrib/lua/src/loslib.c | 36 +- contrib/lua/src/lparser.c | 31 +- contrib/lua/src/lstate.c | 65 +- contrib/lua/src/lstate.h | 25 +- contrib/lua/src/lstrlib.c | 2 +- contrib/lua/src/ltable.c | 8 +- contrib/lua/src/ltable.h | 1 - contrib/lua/src/ltablib.c | 2 +- contrib/lua/src/ltests.c | 1977 +++++++++++++++++++++++++++++++++++++++++ contrib/lua/src/ltests.h | 151 ++++ contrib/lua/src/ltm.c | 38 +- contrib/lua/src/ltm.h | 5 +- contrib/lua/src/lua.c | 39 +- contrib/lua/src/lua.h | 27 +- contrib/lua/src/luac.c | 6 +- contrib/lua/src/luaconf.h | 13 +- contrib/lua/src/lundump.c | 8 +- contrib/lua/src/lutf8lib.c | 27 +- contrib/lua/src/lvm.c | 235 +++-- contrib/lua/src/lvm.h | 5 + 49 files changed, 3355 insertions(+), 866 deletions(-) diff --cc contrib/lua/Makefile index fef1af4821e6,000000000000..8efa2eb3fdd6 mode 100644,000000..100644 --- a/contrib/lua/Makefile +++ b/contrib/lua/Makefile @@@ -1,106 -1,0 +1,106 @@@ +# Makefile for installing Lua +# See doc/readme.html for installation and customization instructions. + +# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= + +# Your platform. See PLATS for possible values. +PLAT= guess + +# Where to install. The installation starts in the src and doc directories, +# so take care if INSTALL_TOP is not an absolute path. See the local target. +# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with +# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h. +INSTALL_TOP= /usr/local +INSTALL_BIN= $(INSTALL_TOP)/bin +INSTALL_INC= $(INSTALL_TOP)/include +INSTALL_LIB= $(INSTALL_TOP)/lib +INSTALL_MAN= $(INSTALL_TOP)/man/man1 +INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V +INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V + +# How to install. If your install program does not support "-p", then +# you may have to run ranlib on the installed liblua.a. +INSTALL= install -p +INSTALL_EXEC= $(INSTALL) -m 0755 +INSTALL_DATA= $(INSTALL) -m 0644 +# +# If you don't have "install" you can use "cp" instead. +# INSTALL= cp -p +# INSTALL_EXEC= $(INSTALL) +# INSTALL_DATA= $(INSTALL) + +# Other utilities. +MKDIR= mkdir -p +RM= rm -f + +# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= + +# Convenience platforms targets. - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris ++PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris + +# What to install. +TO_BIN= lua luac +TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +TO_LIB= liblua.a +TO_MAN= lua.1 luac.1 + +# Lua version and release. +V= 5.4 - R= $V.4 ++R= $V.6 + +# Targets start here. +all: $(PLAT) + +$(PLATS) help test clean: + @cd src && $(MAKE) $@ + +install: dummy + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) + cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) + cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) + +uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) + cd src && cd $(INSTALL_INC) && $(RM) $(TO_INC) + cd src && cd $(INSTALL_LIB) && $(RM) $(TO_LIB) + cd doc && cd $(INSTALL_MAN) && $(RM) $(TO_MAN) + +local: + $(MAKE) install INSTALL_TOP=../install + +# make may get confused with install/ if it does not support .PHONY. +dummy: + +# Echo config parameters. +echo: + @cd src && $(MAKE) -s echo + @echo "PLAT= $(PLAT)" + @echo "V= $V" + @echo "R= $R" + @echo "TO_BIN= $(TO_BIN)" + @echo "TO_INC= $(TO_INC)" + @echo "TO_LIB= $(TO_LIB)" + @echo "TO_MAN= $(TO_MAN)" + @echo "INSTALL_TOP= $(INSTALL_TOP)" + @echo "INSTALL_BIN= $(INSTALL_BIN)" + @echo "INSTALL_INC= $(INSTALL_INC)" + @echo "INSTALL_LIB= $(INSTALL_LIB)" + @echo "INSTALL_MAN= $(INSTALL_MAN)" + @echo "INSTALL_LMOD= $(INSTALL_LMOD)" + @echo "INSTALL_CMOD= $(INSTALL_CMOD)" + @echo "INSTALL_EXEC= $(INSTALL_EXEC)" + @echo "INSTALL_DATA= $(INSTALL_DATA)" + +# Echo pkg-config data. +pc: + @echo "version=$R" + @echo "prefix=$(INSTALL_TOP)" + @echo "libdir=$(INSTALL_LIB)" + @echo "includedir=$(INSTALL_INC)" + +# Targets that do not create files (not all makes understand .PHONY). +.PHONY: all $(PLATS) help test clean install uninstall local dummy echo pc + +# (end of Makefile) diff --cc contrib/lua/src/ltests.c index 000000000000,7d184c0d8ee1..7d184c0d8ee1 mode 000000,100644..100644 --- a/contrib/lua/src/ltests.c +++ b/contrib/lua/src/ltests.c diff --cc contrib/lua/src/ltests.h index 000000000000,ec520498bde4..ec520498bde4 mode 000000,100644..100644 --- a/contrib/lua/src/ltests.h +++ b/contrib/lua/src/ltests.h From nobody Sun Jul 16 10:44:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3hfm0Pl5z2tv2P; Sun, 16 Jul 2023 10:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3hfl73mhz42sM; Sun, 16 Jul 2023 10:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689504272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wmjW9ZXYupZAtmHNKJDKY8EiIR4F4XEjO3BXnLAqE8Q=; b=gtJ8Yl6kcG3JOZCfaYv9VreEMIRzqsFOZ8gQBCorb1eEl6sISokMjS+FTP+p9zDjPTVayZ 6DtNXiY/T2osLJ0vFJqL2Q+OBO20bxVCii0ZfMuoBeSagNpi4S4OVbENihZRlKnkLdEQ18 H3C5F7aYJ2b7UKZtWS+CbySrnUzb7aWr/c31TrxRx3jr2gWenBTzMJn0dOsJJKkj1COqsB xf8JNh+9OOMLByGaeyiOkRJZZ0pMW3oJcxANGbSOwr9InVLp25ItE124rvN9Ip34ha1nzm 8f9V04Rr/2W3/LHOiK3KY5ojPrJoQD6+CxZgp1GuiurvbQ8EkMaFO+3n164KSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689504272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wmjW9ZXYupZAtmHNKJDKY8EiIR4F4XEjO3BXnLAqE8Q=; b=F61W+yyRnomyre3i5UtPCeB2r+2lAZb/O7mdBuX9Fat1hHSCR3Pu0PQN6DYHNMTFqV+cD6 ggpEPqaCLEexhVT9ZaLRNMq5XEsg0LHeq7gQI+CvXvrgovfabEeytySxT2/Nn34oHVfhab pLA7w1tBC8iwKHdqouW005KnQl2cfbkTq0WJ0VvRpP2tU6ndnj9l/tH7cT1muuVg45oANl PyKaz3hxB0im13uuj1UxzCQteUXj6kiCR5bbWOST64pbw1adMi1t6gfVwvxeaLfVWfTuDA EX3HejYonuQ78jrY3Sbj3pOeLEOh0p8FYaokIZ7vifVPKLRM1LfXo1ytRxenFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689504272; a=rsa-sha256; cv=none; b=iKtytlNMNX2jXRHF0aoJXv0AlTt//s7A3oDoMUxNblmK8M3901ZlS6/9Yhy5EzCdU5Y+9q NhTJU6aWYzKaGhkD9hCwYYhef59G7iSY+Gi7DrzNYv0Djg5kMIe6HWISRkOwNJB/9gt2AL 7sp847jT5RxD8aFjsO8FBteauPgxFbi7twf8KOIzqsU/9vOk74IMAxL2jEYRm307+h3F7x 8Hl9V7YR7J3h8Y0qRmwRBMVuvn75YUHEKeLkxHI+yzdA78iLs1KaJW87OAWg8+oGR4DPf9 rllJlxzoOkmKgbCUttT/BBtPf1iNdB7eq5k6CG2P0jorYAZyA5PSOhfPT5FVwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3hfl674zzfmr; Sun, 16 Jul 2023 10:44:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GAiV4i098669; Sun, 16 Jul 2023 10:44:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GAiVm5098668; Sun, 16 Jul 2023 10:44:31 GMT (envelope-from git) Date: Sun, 16 Jul 2023 10:44:31 GMT Message-Id: <202307161044.36GAiVm5098668@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: b22299c457b2 - stable/13 - netinet*: Fix redirects for connections from localhost List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b22299c457b21d77fc5770b9f1a9043487b25ed9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=b22299c457b21d77fc5770b9f1a9043487b25ed9 commit b22299c457b21d77fc5770b9f1a9043487b25ed9 Author: Doug Rabson AuthorDate: 2023-05-24 13:11:37 +0000 Commit: Doug Rabson CommitDate: 2023-07-14 10:07:58 +0000 netinet*: Fix redirects for connections from localhost Redirect rules use PFIL_IN and PFIL_OUT events to allow packet filter rules to change the destination address and port for a connection. Typically, the rule triggers on an input event when a packet is received by a router and the destination address and/or port is changed to implement the redirect. When a reply packet on this connection is output to the network, the rule triggers again, reversing the modification. When the connection is initiated on the same host as the packet filter, it is initially output via lo0 which queues it for input processing. This causes an input event on the lo0 interface, allowing redirect processing to rewrite the destination and create state for the connection. However, when the reply is received, no corresponding output event is generated; instead, the packet is delivered to the higher level protocol (e.g. tcp or udp) without reversing the redirect, the reply is not matched to the connection and the packet is dropped (for tcp, a connection reset is also sent). This commit fixes the problem by adding a second packet filter call in the input path. The second call happens right before the handoff to higher level processing and provides the missing output event to allow the redirect's reply processing to perform its rewrite. This extra processing is disabled by default and can be enabled using pfilctl: pfilctl link -o pf:default-out inet-local pfilctl link -o pf:default-out6 inet6-local PR: 268717 Reviewed-by: kp, melifaro MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40256 (cherry picked from commit 5ab151574c8a1824c6cd8eded28506cb983284bc) --- sys/netinet/ip_input.c | 22 ++++++++- sys/netinet/ip_var.h | 4 ++ sys/netinet6/ip6_input.c | 19 ++++++++ sys/netinet6/ip6_var.h | 4 ++ tests/sys/netpfil/common/Makefile | 1 + tests/sys/netpfil/{pf => common}/rdr.sh | 84 +++++++++++++++++++++++++++++---- tests/sys/netpfil/common/utils.subr | 4 ++ tests/sys/netpfil/pf/Makefile | 1 - 8 files changed, 127 insertions(+), 12 deletions(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 2cfd3c544c72..50b5b5a00a96 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -140,7 +140,9 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_checkinterface), 0, "Verify packet arrives on correct interface"); -VNET_DEFINE(pfil_head_t, inet_pfil_head); /* Packet filter hooks */ +/* Packet filter hooks */ +VNET_DEFINE(pfil_head_t, inet_pfil_head); +VNET_DEFINE(pfil_head_t, inet_local_pfil_head); static struct netisr_handler ip_nh = { .nh_name = "ip", @@ -328,6 +330,10 @@ ip_init(void) args.pa_headname = PFIL_INET_NAME; V_inet_pfil_head = pfil_head_register(&args); + args.pa_flags = PFIL_OUT; + args.pa_headname = PFIL_INET_LOCAL_NAME; + V_inet_local_pfil_head = pfil_head_register(&args); + if (hhook_head_register(HHOOK_TYPE_IPSEC_IN, AF_INET, &V_ipsec_hhh_in[HHOOK_IPSEC_INET], HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0) @@ -816,6 +822,20 @@ ours: return; #endif /* IPSTEALTH */ + /* + * We are going to ship the packet to the local protocol stack. Call the + * filter again for this 'output' action, allowing redirect-like rules + * to adjust the source address. + */ + if (PFIL_HOOKED_OUT(V_inet_local_pfil_head)) { + if (pfil_run_hooks(V_inet_local_pfil_head, &m, V_loif, PFIL_OUT, NULL) != + PFIL_PASS) + return; + if (m == NULL) /* consumed by filter */ + return; + ip = mtod(m, struct ip *); + } + /* * Attempt reassembly; if it succeeds, proceed. * ip_reass() will return a different mbuf. diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 77b6ee88507a..79a530bca67b 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -248,6 +248,10 @@ VNET_DECLARE(struct pfil_head *, inet_pfil_head); #define V_inet_pfil_head VNET(inet_pfil_head) #define PFIL_INET_NAME "inet" +VNET_DECLARE(struct pfil_head *, inet_local_pfil_head); +#define V_inet_local_pfil_head VNET(inet_local_pfil_head) +#define PFIL_INET_LOCAL_NAME "inet-local" + void in_delayed_cksum(struct mbuf *m); /* Hooks for ipfw, dummynet, divert etc. Most are declared in raw_ip.c */ diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 2423b61e0b36..e77bb9b68e5d 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -194,6 +194,7 @@ SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRDQMAXLEN, intr_direct_queue_maxlen, #endif VNET_DEFINE(pfil_head_t, inet6_pfil_head); +VNET_DEFINE(pfil_head_t, inet6_local_pfil_head); VNET_PCPUSTAT_DEFINE(struct ip6stat, ip6stat); VNET_PCPUSTAT_SYSINIT(ip6stat); @@ -233,6 +234,10 @@ ip6_init(void) args.pa_headname = PFIL_INET6_NAME; V_inet6_pfil_head = pfil_head_register(&args); + args.pa_flags = PFIL_OUT; + args.pa_headname = PFIL_INET6_LOCAL_NAME; + V_inet6_local_pfil_head = pfil_head_register(&args); + if (hhook_head_register(HHOOK_TYPE_IPSEC_IN, AF_INET6, &V_ipsec_hhh_in[HHOOK_IPSEC_INET6], HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0) @@ -895,6 +900,20 @@ passin: return; } + /* + * We are going to ship the packet to the local protocol stack. Call the + * filter again for this 'output' action, allowing redirect-like rules + * to adjust the source address. + */ + if (PFIL_HOOKED_OUT(V_inet6_local_pfil_head)) { + if (pfil_run_hooks(V_inet6_local_pfil_head, &m, V_loif, PFIL_OUT, + NULL) != PFIL_PASS) + return; + if (m == NULL) /* consumed by filter */ + return; + ip6 = mtod(m, struct ip6_hdr *); + } + /* * Tell launch routine the next header */ diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index de7a938a3289..632c3f9774e7 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -329,6 +329,10 @@ VNET_DECLARE(struct pfil_head *, inet6_pfil_head); #define V_inet6_pfil_head VNET(inet6_pfil_head) #define PFIL_INET6_NAME "inet6" +VNET_DECLARE(struct pfil_head *, inet6_local_pfil_head); +#define V_inet6_local_pfil_head VNET(inet6_local_pfil_head) +#define PFIL_INET6_LOCAL_NAME "inet6-local" + #ifdef IPSTEALTH VNET_DECLARE(int, ip6stealth); #define V_ip6stealth VNET(ip6stealth) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 5ea3e7d9b687..99c81de3462e 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -9,6 +9,7 @@ ATF_TESTS_SH+= \ dummynet \ pass_block \ nat \ + rdr \ tos \ fragments \ forward diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/common/rdr.sh similarity index 51% rename from tests/sys/netpfil/pf/rdr.sh rename to tests/sys/netpfil/common/rdr.sh index 983abe054a35..0c2169ce6b28 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/common/rdr.sh @@ -26,17 +26,19 @@ # SUCH DAMAGE. . $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr -atf_test_case "basic" "cleanup" basic_head() { - atf_set descr 'Basic rdr test' + atf_set descr 'Basic IPv4 NAT test' atf_set require.user root } basic_body() { - pft_init + firewall=$1 + firewall_init $firewall + nat_init $firewall epair=$(vnet_mkepair) @@ -48,10 +50,13 @@ basic_body() jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up jexec alcatraz sysctl net.inet.ip.forwarding=1 - # Enable pf! - jexec alcatraz pfctl -e - pft_set_rules alcatraz \ - "rdr pass on ${epair}b proto tcp from any to 198.51.100.0/24 port 1234 -> 192.0.2.1 port 4321" + # Enable redirect filter rule + firewall_config alcatraz ${firewall} \ + "pf" \ + "rdr pass on ${epair}b proto tcp from any to 198.51.100.0/24 port 1234 -> 192.0.2.1 port 4321" \ + "ipfnat" \ + "rdr ${epair}b from any to 198.51.100.0/24 port = 1234 -> 192.0.2.1 port 4321 tcp" + echo "foo" | jexec alcatraz nc -N -l 4321 & sleep 1 @@ -64,10 +69,69 @@ basic_body() basic_cleanup() { - pft_cleanup + firewall=$1 + firewall_cleanup $firewall } -atf_init_test_cases() +local_redirect_head() { - atf_add_test_case "basic" + atf_set descr 'Redirect local traffic test' + atf_set require.user root } + +local_redirect_body() +{ + firewall=$1 + firewall_init $firewall + nat_init $firewall + + bridge=$(vnet_mkbridge) + ifconfig ${bridge} 192.0.2.1/24 up + + epair1=$(vnet_mkepair) + epair2=$(vnet_mkepair) + + vnet_mkjail first ${epair1}b + ifconfig ${epair1}a up + ifconfig ${bridge} addm ${epair1}a + jexec first ifconfig ${epair1}b 192.0.2.2/24 up + jexec first ifconfig lo0 127.0.0.1/8 up + + vnet_mkjail second ${epair2}b + ifconfig ${epair2}a up + ifconfig ${bridge} addm ${epair2}a + jexec second ifconfig ${epair2}b 192.0.2.3/24 up + jexec second ifconfig lo0 127.0.0.1/8 up + jexec second sysctl net.inet.ip.forwarding=1 + + # Enable redirect filter rule + firewall_config second ${firewall} \ + "pf" \ + "rdr pass proto tcp from any to 192.0.2.3/24 port 1234 -> 192.0.2.2 port 4321" \ + "ipfnat" \ + "rdr '*' from any to 192.0.2.3/24 port = 1234 -> 192.0.2.2 port 4321 tcp" + + echo "foo" | jexec first nc -N -l 4321 & + sleep 1 + + # Verify that second can use its rule to redirect local connections to first + result=$(jexec second nc -N -w 3 192.0.2.3 1234) + if [ "$result" != "foo" ]; then + atf_fail "Redirect failed" + fi +} + +local_redirect_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests \ + basic \ + pf \ + ipfnat \ + local_redirect \ + pf \ + ipfnat + diff --git a/tests/sys/netpfil/common/utils.subr b/tests/sys/netpfil/common/utils.subr index 722271981af4..d0028e663c45 100644 --- a/tests/sys/netpfil/common/utils.subr +++ b/tests/sys/netpfil/common/utils.subr @@ -58,12 +58,16 @@ firewall_config() jexec ${jname} pfctl -e jexec ${jname} pfctl -F all jexec ${jname} pfctl -f $cwd/pf.rule + jexec ${jname} pfilctl link -o pf:default-out inet-local + jexec ${jname} pfilctl link -o pf:default-out6 inet6-local elif [ ${fw} == "ipf" ]; then jexec ${jname} ipf -E jexec ${jname} ipf -Fa -f $cwd/ipf.rule elif [ ${fw} == "ipfnat" ]; then jexec ${jname} service ipfilter start jexec ${jname} ipnat -CF -f $cwd/ipfnat.rule + jexec ${jname} pfilctl link -o ipfilter:default-ip4 inet-local + jexec ${jname} pfilctl link -o ipfilter:default-ip6 inet6-local else atf_fail "$fw is not a valid firewall to configure" fi diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d0a17ec40f43..8f6b57797e23 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -21,7 +21,6 @@ ATF_TESTS_SH+= altq \ pass_block \ pfsync \ proxy \ - rdr \ ridentifier \ route_to \ rules_counter \ From nobody Sun Jul 16 10:44:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3hfn2h3Jz2ttwP; Sun, 16 Jul 2023 10:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3hfn1Ws2z42yZ; Sun, 16 Jul 2023 10:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689504273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CZIBQ/yd/9v+nWh/vaNq+lsiUlNyjedooWNbHcGD1w=; b=n7xcYHzEQp0klfUypXZAPuBc0RlydjfbsnzSRqFV+cvVyQIHVOJ1i9TiqvkgRJICVRcbBP nU73g0Ktf8jiHyIgYnS3HOW3OWlo6lKxEusGNFnp4hP5yMWmhmAJGswJ2VA+kBZhzLpPoH qeh3K9nNR3tnAHGsqum40jSRa9cYmQAw69LsWM/GbO2lbhxPpwMu7+TGbtKAS5nYr7gYvk NSyKtQE+LY83p36m2VjkcL2/FbKOwg6oUTELErwN+GIu6rFsrp/U3oZNyp162EIqbe5tT4 e/Cj9TP4UCyqygC5/s3jCWi8HcNra03wgg4Kb15SXCvmTJczdPONqW3SmHv6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689504273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2CZIBQ/yd/9v+nWh/vaNq+lsiUlNyjedooWNbHcGD1w=; b=FHLl50nZs+6eJMiWHJRgZFMZDvlPVUtJTElDmchwJ2DRHpmPADqeaLtcrxKeGFfgcWWpq3 oBKOEPonULmwpfT2US06nOyxS1NNULNpBWRz7fuuGkXpN9pCIYjKgOSWVVC7wDUiAZjv/s vA9fkCYWAnqqgL4qFwUuUfpNH/P4hVCnVIHfxlT5qzkqN0WJLPNXzmT+wDcu0Tw7qNSHiI S6XHIraIJt5BGgJ3yoGBKFXIWnbYkNTbG3o/u2lj280jdqov0FwTc2PsbemHMverkne3iA FZfMDgU0cfVdWJmzqCefYctqOCbfw5rjNYe0LvlZBWm8OZ5AoYceVKFfrgt4Fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689504273; a=rsa-sha256; cv=none; b=LtHuJlxFCtLEmEGRA/2ecN/xd/6xvRBsNxjrQgtTczAe68GlIgBauovsS2IoJTRmD3wucz LXi313tynN6ppxFK4c0TZhzmh0zOhJc/B/CCf3r0DQTlAg/2fNX6gFKRX/MG3srTuueKi3 wCSQ+Lp4wB1cxzaIVHAIfuQ/lWV+PtmooScnzqgl6gQqVAwe6iWG13fBTaRp/ew83ORca+ rhVoUMPywXSyuxmHGXBIF4/kex2zVWuloex28tcRtmLplMnbjAk/Bxr0iraXLi0oUMJYWP PQiggEhfF6eqLw5vvRaEFQxGpgzLXtoqoFkgvEbyfiQ2SdbnSxt+hpv+gjRyKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3hfn00Qyzf7G; Sun, 16 Jul 2023 10:44:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GAiWxA098688; Sun, 16 Jul 2023 10:44:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GAiWh7098687; Sun, 16 Jul 2023 10:44:32 GMT (envelope-from git) Date: Sun, 16 Jul 2023 10:44:32 GMT Message-Id: <202307161044.36GAiWh7098687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Doug Rabson Subject: git: 6dfb2c2dce0f - stable/13 - pf: Add code to enable filtering for locally delivered packets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6dfb2c2dce0ffabd783ec24b8d4d128993363f72 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=6dfb2c2dce0ffabd783ec24b8d4d128993363f72 commit 6dfb2c2dce0ffabd783ec24b8d4d128993363f72 Author: Doug Rabson AuthorDate: 2023-06-20 13:01:58 +0000 Commit: Doug Rabson CommitDate: 2023-07-14 10:07:58 +0000 pf: Add code to enable filtering for locally delivered packets This is disabled by default since it potentially changes the behavior of existing filter rule sets. To enable this extra filter for packets being delivered locally, use: sysctl net.pf.filter_local=1 service pf restart PR: 268717 Reviewed-by: kp MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D40373 (cherry picked from commit 3a1f834b5228986a7c14fd60da13cf2700e80996) --- UPDATING | 12 ++++++++++++ sys/netpfil/pf/pf_ioctl.c | 20 ++++++++++++++++++++ tests/sys/netpfil/common/utils.subr | 3 +-- tests/sys/netpfil/pf/fragmentation.sh | 3 ++- tests/sys/netpfil/pf/killstate.sh | 24 ++++++++++++++++-------- tests/sys/netpfil/pf/map_e.sh | 3 ++- tests/sys/netpfil/pf/pass_block.sh | 3 ++- tests/sys/netpfil/pf/pfsync.sh | 1 + tests/sys/netpfil/pf/route_to.sh | 3 ++- tests/sys/netpfil/pf/set_skip.sh | 2 +- tests/sys/netpfil/pf/table.sh | 6 ++++-- 11 files changed, 63 insertions(+), 17 deletions(-) diff --git a/UPDATING b/UPDATING index 2ca07499ff00..796f2b751b95 100644 --- a/UPDATING +++ b/UPDATING @@ -12,6 +12,18 @@ Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. +20230619: + To enable pf rdr rules for connections initiated from the host, pf + filter rules can be optionally enabled for packets delivered + locally. This can change the behavior of rules which match packets + delivered to lo0. To enable this feature: + + sysctl net.pf.filter_local=1 + service pf restart + + When enabled, its best to ensure that packets delivered locally are not + filtered, e.g. by adding a 'skip on lo' rule. + 20230404: llvm-objump is now always installed as objdump. Previously there was no /usr/bin/objdump unless the WITH_LLVM_BINUTILS knob was used. diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 07463ecbbcf3..5c9b5d2cebb1 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -184,6 +184,12 @@ static MALLOC_DEFINE(M_PFRULE, "pf_rule", "pf(4) rules"); #error PF_QNAME_SIZE must be equal to PF_TAG_NAME_SIZE #endif +VNET_DEFINE_STATIC(bool, pf_filter_local) = false; +#define V_pf_filter_local VNET(pf_filter_local) +SYSCTL_BOOL(_net_pf, OID_AUTO, filter_local, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(pf_filter_local), false, + "Enable filtering for packets delivered to local network stack"); + static void pf_init_tagset(struct pf_tagset *, unsigned int *, unsigned int); static void pf_cleanup_tagset(struct pf_tagset *); @@ -5670,6 +5676,13 @@ hook_pf(void) pla.pa_hook = V_pf_ip4_out_hook; ret = pfil_link(&pla); MPASS(ret == 0); + if (V_pf_filter_local) { + pla.pa_flags = PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR; + pla.pa_head = V_inet_local_pfil_head; + pla.pa_hook = V_pf_ip4_out_hook; + ret = pfil_link(&pla); + MPASS(ret == 0); + } #endif #ifdef INET6 pha.pa_type = PFIL_TYPE_IP6; @@ -5691,6 +5704,13 @@ hook_pf(void) pla.pa_hook = V_pf_ip6_out_hook; ret = pfil_link(&pla); MPASS(ret == 0); + if (V_pf_filter_local) { + pla.pa_flags = PFIL_OUT | PFIL_HEADPTR | PFIL_HOOKPTR; + pla.pa_head = V_inet6_local_pfil_head; + pla.pa_hook = V_pf_ip6_out_hook; + ret = pfil_link(&pla); + MPASS(ret == 0); + } #endif V_pf_pfil_hooked = 1; diff --git a/tests/sys/netpfil/common/utils.subr b/tests/sys/netpfil/common/utils.subr index d0028e663c45..2a2ee0af8ebf 100644 --- a/tests/sys/netpfil/common/utils.subr +++ b/tests/sys/netpfil/common/utils.subr @@ -55,11 +55,10 @@ firewall_config() jexec ${jname} ipfw -q -f flush jexec ${jname} /bin/sh $cwd/ipfw.rule elif [ ${fw} == "pf" ]; then + jexec ${jname} sysctl net.pf.filter_local=1 jexec ${jname} pfctl -e jexec ${jname} pfctl -F all jexec ${jname} pfctl -f $cwd/pf.rule - jexec ${jname} pfilctl link -o pf:default-out inet-local - jexec ${jname} pfilctl link -o pf:default-out6 inet6-local elif [ ${fw} == "ipf" ]; then jexec ${jname} ipf -E jexec ${jname} ipf -Fa -f $cwd/ipf.rule diff --git a/tests/sys/netpfil/pf/fragmentation.sh b/tests/sys/netpfil/pf/fragmentation.sh index ae394324cddc..e62eb141eebd 100644 --- a/tests/sys/netpfil/pf/fragmentation.sh +++ b/tests/sys/netpfil/pf/fragmentation.sh @@ -112,7 +112,8 @@ v6_body() "scrub fragment reassemble" \ "block in" \ "pass in inet6 proto icmp6 icmp6-type { neighbrsol, neighbradv }" \ - "pass in inet6 proto icmp6 icmp6-type { echoreq, echorep }" + "pass in inet6 proto icmp6 icmp6-type { echoreq, echorep }" \ + "set skip on lo" # Host test atf_check -s exit:0 -o ignore \ diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index c2942aab41f2..7b32bacdf82c 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -49,7 +49,8 @@ v4_body() jexec alcatraz pfctl -e pft_set_rules alcatraz "block all" \ - "pass in proto icmp" + "pass in proto icmp" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -121,7 +122,8 @@ v6_body() jexec alcatraz pfctl -e pft_set_rules alcatraz "block all" \ - "pass in proto icmp6" + "pass in proto icmp6" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -189,7 +191,8 @@ label_body() pft_set_rules alcatraz "block all" \ "pass in proto tcp label bar" \ - "pass in proto icmp label foo" + "pass in proto icmp label foo" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -255,7 +258,8 @@ multilabel_body() jexec alcatraz pfctl -e pft_set_rules alcatraz "block all" \ - "pass in proto icmp label foo label bar" + "pass in proto icmp label foo label bar" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -289,7 +293,8 @@ multilabel_body() --replyif ${epair}a pft_set_rules alcatraz "block all" \ - "pass in proto icmp label foo label bar" + "pass in proto icmp label foo label bar" \ + "set skip on lo" # Reestablish state atf_check -s exit:0 -o ignore ${common_dir}/pft_ping.py \ @@ -333,7 +338,8 @@ gateway_body() jexec alcatraz pfctl -e pft_set_rules alcatraz "block all" \ - "pass in reply-to (${epair}b 192.0.2.1) proto icmp" + "pass in reply-to (${epair}b 192.0.2.1) proto icmp" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -475,7 +481,8 @@ interface_body() jexec alcatraz pfctl -e pft_set_rules alcatraz "block all" \ - "pass in proto icmp" + "pass in proto icmp" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all @@ -535,7 +542,8 @@ id_body() pft_set_rules alcatraz "block all" \ "pass in proto tcp" \ - "pass in proto icmp" + "pass in proto icmp" \ + "set skip on lo" # Sanity check & establish state # Note: use pft_ping so we always use the same ID, so pf considers all diff --git a/tests/sys/netpfil/pf/map_e.sh b/tests/sys/netpfil/pf/map_e.sh index cc68fe26be5e..7a2b33069c59 100644 --- a/tests/sys/netpfil/pf/map_e.sh +++ b/tests/sys/netpfil/pf/map_e.sh @@ -66,7 +66,8 @@ map_e_body() pft_set_rules echo "block return all" \ "pass in on ${epair_echo}b inet proto tcp from 198.51.100.1 port 19720:19723 to (${epair_echo}b) port 7" \ "pass in on ${epair_echo}b inet proto tcp from 198.51.100.1 port 36104:36107 to (${epair_echo}b) port 7" \ - "pass in on ${epair_echo}b inet proto tcp from 198.51.100.1 port 52488:52491 to (${epair_echo}b) port 7" + "pass in on ${epair_echo}b inet proto tcp from 198.51.100.1 port 52488:52491 to (${epair_echo}b) port 7" \ + "set skip on lo" i=0 while [ ${i} -lt ${NC_TRY_COUNT} ] diff --git a/tests/sys/netpfil/pf/pass_block.sh b/tests/sys/netpfil/pf/pass_block.sh index 589b89891729..51c8c432038a 100644 --- a/tests/sys/netpfil/pf/pass_block.sh +++ b/tests/sys/netpfil/pf/pass_block.sh @@ -230,7 +230,8 @@ urpf_body() --replyif ${epair_one}a pft_set_rules alcatraz \ - "block quick from urpf-failed" + "block quick from urpf-failed" \ + "set skip on lo" jexec alcatraz pfctl -e # Correct source still works diff --git a/tests/sys/netpfil/pf/pfsync.sh b/tests/sys/netpfil/pf/pfsync.sh index 513280331255..c70d7690c37b 100644 --- a/tests/sys/netpfil/pf/pfsync.sh +++ b/tests/sys/netpfil/pf/pfsync.sh @@ -149,6 +149,7 @@ defer_body() route add -net 203.0.113.0/24 198.51.100.1 # Enable pf + jexec alcatraz sysctl net.pf.filter_local=0 jexec alcatraz pfctl -e pft_set_rules alcatraz \ "set skip on ${epair_sync}a" \ diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index 570d1feb36ff..4edd9a56de3b 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -230,7 +230,8 @@ multiwanlocal_body() "block in" \ "block out" \ "pass out quick route-to (${epair_cl_two}a 203.0.113.129) inet proto tcp from 203.0.113.128 to any port 7" \ - "pass out on ${epair_cl_one}a inet proto tcp from any to any port 7" + "pass out on ${epair_cl_one}a inet proto tcp from any to any port 7" \ + "set skip on lo" # This should work result=$(jexec client nc -N -w 1 192.0.2.2 7 | wc -c) diff --git a/tests/sys/netpfil/pf/set_skip.sh b/tests/sys/netpfil/pf/set_skip.sh index ce7b1900ae00..9e9d5a5322f1 100644 --- a/tests/sys/netpfil/pf/set_skip.sh +++ b/tests/sys/netpfil/pf/set_skip.sh @@ -101,7 +101,7 @@ set_skip_dynamic_body() vnet_mkjail alcatraz jexec alcatraz pfctl -e pft_set_rules alcatraz "set skip on epair" \ - "block" + "block on ! lo" epair=$(vnet_mkepair) ifconfig ${epair}a 192.0.2.2/24 up diff --git a/tests/sys/netpfil/pf/table.sh b/tests/sys/netpfil/pf/table.sh index cc95daba048b..a70c003e71ae 100644 --- a/tests/sys/netpfil/pf/table.sh +++ b/tests/sys/netpfil/pf/table.sh @@ -52,7 +52,8 @@ v4_counters_body() "table counters { 192.0.2.1 }" \ "block all" \ "pass in from to any" \ - "pass out from any to " + "pass out from any to " \ + "set skip on lo" atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 @@ -91,7 +92,8 @@ v6_counters_body() "table counters { 2001:db8:42::1 }" \ "block all" \ "pass in from to any" \ - "pass out from any to " + "pass out from any to " \ + "set skip on lo" atf_check -s exit:0 -o ignore ping -6 -c 3 2001:db8:42::2 From nobody Sun Jul 16 12:34:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l612355z4mYwT; Sun, 16 Jul 2023 12:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3l611crjz3L8f; Sun, 16 Jul 2023 12:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzvkWP3vSdVm9S/D5gkpezREpaTrXpgVvxQJ24G7UGg=; b=ZIZr8eryHDzNSKOKv8YaGWI912aE5vkW+ZZr+Hlvs0KnsQEiHEklB8FtYVEhl3PvYN1Uly 6oQvTVyRZxkxjUNHm+PuAFtNL9t19wv93/xfIX7kqgNkw65olJNfbGAMRXkN4XGhE9Uq6q ScEv6SsGEsORc/gd2zOONHfyhE66qItXRjG/s1GRSkVXtcZLj2zxem1jMIOpz3r5PqeWKu NReE3+NOZtarkMMYeWr9yF9xZcF+FMb7t28ofhPeZvpsenRhYkZUEDnNuSD6TIklsSpEQM kT5kXLzdI1EbQkPJJ8CUNOu7x/fscE51JOPancttFnG1uec7DN+PzB/6HDNy9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510889; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VzvkWP3vSdVm9S/D5gkpezREpaTrXpgVvxQJ24G7UGg=; b=ipZLxG1BAF1AmNnsD/zR14W+T5lK67lOiHNkXd/Gdv0bYg7GuLLIVaYeVaDAgMMETKLyiZ 4nsl1le8JbFTbl2hYK+CageUQsnPTGg3WYrWpXz5UOu/nsbmuLKm7QWJwPNw791FS+Yorn MiaLjPe6ZkYTtC8BCUJI5fwj8BhTo1VSNNrO/C7ZMXXS1NIt3qrwVKfMMM4/FwNV57Sco2 8qQn9tzOzoQjUvs5M2zVmqlxwt4/oWAMOoM1DuO/CJVhFBKum+tTEOZaFoervU/+ggW3qu g1eIYael7fLPbw3GSJpKEohHvK7xTW146bnwfiQS7N3yTFuwJTPVsqCfcY9y1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510889; a=rsa-sha256; cv=none; b=F9OTqbTThwysfAnDeny91grlOMSgVVYn+f0AdZ+o2sn7LiIH///nZnMXLTmtFZXJXBE+P3 LnClLQJEYTqpzS789N4VSzI8NWb2KFZmtr1B6KacrL+Vfs0mvhE39f2OjZdhYI4JgCqZh8 tEX2Ey8mZ9XkW85q/84qk1y5/74ioLl2hGg0NiJisWYxKh3+caWQqbem5dei59NfDq829g OVmCacRACLFpjLfAXF2QohXD0m2Pz1ocDTr6WepgZJ6GrW4ounUzAojUZmOiMAEbTWGF3R SZeYeyJ7KxvLsxEWH2oiL53xpPy0PdhG6oqtYqAzv08SXck1W4n1dzcIMplpWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3l610b48zhZq; Sun, 16 Jul 2023 12:34:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GCYmad082257; Sun, 16 Jul 2023 12:34:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYmEK082256; Sun, 16 Jul 2023 12:34:48 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:48 GMT Message-Id: <202307161234.36GCYmEK082256@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: 80c558849567 - main - libthr: some style in thr_rwlock.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 80c5588495674fc6501700fccb0ed4a37183c89c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=80c5588495674fc6501700fccb0ed4a37183c89c commit 80c5588495674fc6501700fccb0ed4a37183c89c Author: Konstantin Belousov AuthorDate: 2023-07-13 15:55:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:23 +0000 libthr: some style in thr_rwlock.c Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_rwlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 3e8af974fa18..135d565b0d42 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -343,14 +343,14 @@ rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_wrlock(pthread_rwlock_t *rwlock) { - return (rwlock_wrlock_common (rwlock, NULL)); + return (rwlock_wrlock_common(rwlock, NULL)); } int _pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { - return (rwlock_wrlock_common (rwlock, abstime)); + return (rwlock_wrlock_common(rwlock, abstime)); } int From nobody Sun Jul 16 12:34:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l622l90z4mZ7C; Sun, 16 Jul 2023 12:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3l622Fmkz3L6p; Sun, 16 Jul 2023 12:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7joexk35AZovzHlCvIJlgjZ59ihSuuIZuyTTPfW8SUA=; b=nLtTvElrmBqmqBohbVpIGXe45bCgEIczWa75IYlI+TfLVtWD1v0LcwAiWAVGGfT3ddJqKH TL7EvkOGr17j6KLRnxj1CQ5XMWmnRXXlq7O9PRZcgaAoWFmFBLTmrlBVJAbFRJdjviHHqs gGPGwqpNfoZNpLsNmIxewT6R7p+eUcxM/vnPiSD3XfQJFp1CbHFRv0/ajmsrXBU9fDgiuu cyP+rG8zZX9DOSpA3rLeHt9qUpLWMtf1P2yc1wI3fCeCECbfdFbMcmBiqk4qSYcktFOOU1 fR+61v+kJh6mT1M0rgC33uG3grMakqNGlIBkCWswC3ignm3RdqK0+j5MsnjMMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7joexk35AZovzHlCvIJlgjZ59ihSuuIZuyTTPfW8SUA=; b=hcTrQ4EyacJkNVPZqxPI3CxwkXLGaQ8eKxOPN70dSQFGFqDouR2QpAfbGEdm3qlWDoMpfx Vo8g8pLBXK0u9LScYndqbDPmKxlH0D/TByO9pz7YOBlfLDRgZ4ovV0bXTGZW82EGgF/StB VZ6DfNOwU1XqXX3c/H99fnvv89zvkIzAZXRJfpufjnXzzTksac0hSO8Q1hvwdLhOqKNxB8 22kYx43g5S0DlNhNjHLoSRh1OyKoNrty2POT6mtm+uKRlqxYpk2sAKPhkUvlLdBw/jVCBL my6hdQHA/r/9BjSi+gBUVG8EUftxqytPtCLuSv9gXZrwFvHfC/C71saZY7PVcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510890; a=rsa-sha256; cv=none; b=EZ9RJTy4BHlMQeBpeMQa5hPn8lvRMiGPqoiMXzg5tGE6unYm05HWLD9MNDyYPr5Ir4Bhxb lDmhraaKC486VLc8wzpwte7KuprtfFQ+S1vtGl8VhL9USzP8VAmJxFKvf6nWFOexPDgNYQ sQq6xHkES5wfxzdlG+k0KlsBgC0idptxe/pfqdg8Zdi9ncETO28+/UH81epmIGpLzf1Jbw /hPNqIf2y42ss7Wf92jmdOuslrw2zmzdijI7mWA5CK6RSpmvwjjnrZKQTQADzz0S9xMuy1 uAUTXz/ZOLGzaOb19XCo1B86pre/hYN8DxQkMP7M74SJM+WU1YGj7hDuuuEfkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3l620nfpzjN2; Sun, 16 Jul 2023 12:34:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GCYoHb082277; Sun, 16 Jul 2023 12:34:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYoIV082276; Sun, 16 Jul 2023 12:34:50 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:50 GMT Message-Id: <202307161234.36GCYoIV082276@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: ad056b5d35d9 - main - libthr: trigger library initialization on rwlock calls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad056b5d35d9957b1bd023abeb6461601449b725 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ad056b5d35d9957b1bd023abeb6461601449b725 commit ad056b5d35d9957b1bd023abeb6461601449b725 Author: Konstantin Belousov AuthorDate: 2023-07-13 15:56:11 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:34 +0000 libthr: trigger library initialization on rwlock calls Reviewed by: tijl Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libthr/thread/thr_rwlock.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 135d565b0d42..af32b09963d9 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -163,6 +163,7 @@ int _thr_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr) { + _thr_check_init(); *rwlock = NULL; return (rwlock_init(rwlock, attr)); } @@ -231,6 +232,7 @@ rwlock_rdlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_rdlock(pthread_rwlock_t *rwlock) { + _thr_check_init(); return (rwlock_rdlock_common(rwlock, NULL)); } @@ -238,21 +240,24 @@ int _pthread_rwlock_timedrdlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { + _thr_check_init(); return (rwlock_rdlock_common(rwlock, abstime)); } int _Tthr_rwlock_tryrdlock(pthread_rwlock_t *rwlock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; pthread_rwlock_t prwlock; int flags; int ret; + _thr_check_init(); ret = check_and_init_rwlock(rwlock, &prwlock); if (ret != 0) return (ret); + curthread = _get_curthread(); if (curthread->rdlock_count) { /* * To avoid having to track all the rdlocks held by @@ -280,14 +285,16 @@ _Tthr_rwlock_tryrdlock(pthread_rwlock_t *rwlock) int _Tthr_rwlock_trywrlock(pthread_rwlock_t *rwlock) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; pthread_rwlock_t prwlock; int ret; + _thr_check_init(); ret = check_and_init_rwlock(rwlock, &prwlock); if (ret != 0) return (ret); + curthread = _get_curthread(); ret = _thr_rwlock_trywrlock(&prwlock->lock); if (ret == 0) prwlock->owner = TID(curthread); @@ -343,6 +350,7 @@ rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_wrlock(pthread_rwlock_t *rwlock) { + _thr_check_init(); return (rwlock_wrlock_common(rwlock, NULL)); } @@ -350,6 +358,7 @@ int _pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { + _thr_check_init(); return (rwlock_wrlock_common(rwlock, abstime)); } From nobody Sun Jul 16 12:34:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3l6350q1z4mZGM; Sun, 16 Jul 2023 12:34: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3l632vN5z3LCm; Sun, 16 Jul 2023 12:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mj+0OS9O9pHXMmgcnVnFzdD5DgSfUxgJCISMNk4aRAY=; b=XiDnTQ34frT04hJ8sXuT4SUN8OPjZPnQ+UvifNiQ5iznu/00n+vUlZ4FkooeQ6/UoyciwW F0RJgK/6FtRLl8VwWr+9y4sGnJzqTci4a9MmJsVqzRLsC7a05L2UifYklQGqYLEtVOIT4E YZ6XuUY8IJ4hJ911esqqQ91G41LRSPhigc3S2lP3KowyWyn2fHdfMm+nctL/8iEvvzHa8R 0y2ei/iK/+XSLKWnfat+7Y1jotx6zWd2Dspr8FDGHnMEt4tS/DXLeArLa9LX+n9QZYoYMG nislVo4p/jitIycVhEGlLOqaduT4C5b2hMKtKLseAka+vYLqmZu2D/4Mm9CUYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689510891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Mj+0OS9O9pHXMmgcnVnFzdD5DgSfUxgJCISMNk4aRAY=; b=uF9tPAxkz8U7y5DgwxkEE9dQ+GWF0fZSjNZHKZ4Fr24dxM70FKNVrZzaAwakPw/LjcV2wf O1umJ3CnUpAysCMRzoCrJ4p/uVTcT9rEV2Oaqf5rO4UL+W3zqxgY5AUWHEMmHWyfRtea7X YIT16/+WEjKgbcRiaV4sK1eIeej1gnS+I1KCtl9MFHnhMtNk5qqKoveSgOGrITmbxIJBOf xCCb1urqrEewR1mUv9e714+FmHz4A6A9uscYgyK1+6im1X+khmAilLPbSwdCmaqP2TXJO5 fZTmUPKC3XC+0Apb6fdSKXtl9gqeENNZu3GctYHmscIji4940+xhZfv25RrFog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689510891; a=rsa-sha256; cv=none; b=JGGTp4uksQDEEf4tHf0S/50bt0Hkl2r+Gen7w3gdHU249Dql7hPO3OfRP1sPANkisrkmIf ZrsJKBbTjOCI8oZ8K7vZlz076X//gcUcavo8fB4m/Z2zJ5RR/g6Y+u32PV9MLFN8AerXya b2ABEeJVVuhHif+PVeMIUK/Vv5CR7U3Aysjy9upfXFpxFNOzBC64WbJUvGbFPZiokkS70v 4Erf+oUH8lnYdKPFK03mRYG5D/WHz+MdooeYYOsVhbZrU3fcJJpjCSkRbk9Vki+L55gDQB IoQW8NkOal7xJT0pfMh3AgX5cKXhuqokoEwtPcXcXtKb6uI2ChMjS0zT7/YdBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3l631jySzjNd; Sun, 16 Jul 2023 12:34:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GCYpRu082297; Sun, 16 Jul 2023 12:34:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GCYplB082296; Sun, 16 Jul 2023 12:34:51 GMT (envelope-from git) Date: Sun, 16 Jul 2023 12:34:51 GMT Message-Id: <202307161234.36GCYplB082296@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: 1005d3d05362 - main - rtld: fix dlopen() for an object that is already mapped but not yet initialized List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1005d3d05362de368b1ea7aeb8eb20cee993e122 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1005d3d05362de368b1ea7aeb8eb20cee993e122 commit 1005d3d05362de368b1ea7aeb8eb20cee993e122 Author: Konstantin Belousov AuthorDate: 2023-07-14 13:38:03 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-16 12:34:34 +0000 rtld: fix dlopen() for an object that is already mapped but not yet initialized For instance, dso might be mapped as needed but not yet initialized from the other subtree of needed objects, while current object' constructor does dlopen() for the dso. Right now rtld does relocations and other processing based on the arrival of new objects in the global list, which is not happens there. Directly check for the initialization state of the object, for which we would return the handle. One practical use case of this support is e.g. dlopen("libthr.so", RTLD_NOLOAD) by libraries that are threading-aware but happy to live with libc pthread shims if the program is not multithreaded. Reviewed by: tijl Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- libexec/rtld-elf/rtld.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 5c96405be62c..83315d5023ba 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -3714,7 +3714,6 @@ static Obj_Entry * dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, int mode, RtldLockState *lockstate) { - Obj_Entry *old_obj_tail; Obj_Entry *obj; Objlist initlist; RtldLockState mlockstate; @@ -3731,7 +3730,6 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, } GDB_STATE(RT_ADD,NULL); - old_obj_tail = globallist_curr(TAILQ_LAST(&obj_list, obj_entry_q)); obj = NULL; if (name == NULL && fd == -1) { obj = obj_main; @@ -3744,9 +3742,9 @@ dlopen_object(const char *name, int fd, Obj_Entry *refobj, int lo_flags, obj->dl_refcount++; if (mode & RTLD_GLOBAL && objlist_find(&list_global, obj) == NULL) objlist_push_tail(&list_global, obj); - if (globallist_next(old_obj_tail) != NULL) { - /* We loaded something new. */ - assert(globallist_next(old_obj_tail) == obj); + + if (!obj->init_done) { + /* We loaded something new and have to init something. */ if ((lo_flags & RTLD_LO_DEEPBIND) != 0) obj->symbolic = true; result = 0; From nobody Sun Jul 16 15:42:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3qGr2Vqhz4n5X5; Sun, 16 Jul 2023 15:42: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3qGr1ssXz4T0f; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=hsGeawTj5W1UJ+eTf5I6Ayin4hv7e4p4ASTCU9ayBFH+e2294nLccudqnqMT9MHfKkIhhM bIVGZXgjVEJiJA9uzXRKgahk+eGVTap4IV5iFJC1pJ3Iti4lWFSNIWmuLm2kbh84DMBMDZ 7J4yrnxYujKd51Qqzbm6A3rfZfw2fdMWxehP/aIId9avcJjJq1UZEJgIPw0LZVhimKNOtm BqzVR2S0P2pT2NkT2n4bJXjhNdPHRZPU7W4yQta3dkXaUujH0LwhFD4pV9FJi5YUlB42Bx NPtTlHQp6var+YjcKB/Q9uzJNWDvZ2ZLRwEDApMNJBIGQHvKYGRZOFGX+GgMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689522164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=truzyeu59rqPEbKInQl3LMna66AhI+F4336BGlnRZnk=; b=Ixo+MLi26V5JK4BhPi3dKJYUeVzNfxJYeYW8yAVLCOnn1jTvKlTd1xltayX37L5w5QQMfs bq0xOMwKiloiAYR2ONf85UlLtV4XjL0E83zUlQrVMkrZ+UROvthAskeid9noUdgUxCgACl 4fgetgQAgF4qeTNTSUMfKrOjdvemoKeJlAaBJOOEiLP8aWgpx1115PAZQdxhNLsMe1yJmp wdKG5ffIk2MOZ5IIRwKnQjTB3YRZxL7Ne1P+cILcECICy3dIr7EJKhg5wq4g2M4PDfVYmN IL4hh4+SNwR/S+kVZB5cSqZwQiXzj3RAD2c4TwKJZqhBCpnOS6qFB1EWP8VYmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689522164; a=rsa-sha256; cv=none; b=UfGn9dimq9t3btUrzB2/drxeTYwrc5wYbrY/Hc7fEoBDIi0w9XRkdaycXRonnuIOpnP20E 5uW/yrv+Jncf2y7iZdSMVl78FqhQqS5tDNt2iSgkM+POMSD8tAp/oBe2kQOCcG/ZAOFOuo uqv5+WHuHDx3x8STF4TGUNkpj/ey5svOmdUUuUyvxRqQpSxyog/3KreRAHOq7VEB2Md3Tl 17ulFUE+qOt+3bbSJxxPRxz0JEL7rLgZJdZOhFCREHUXCbidFRGKAw4RQsB4f6iof4ov0e S3Ssx/2c9UhrIBh/G80BvXk00BXgp8GWva/8ZA37hq88/t253OtKUzBhc6y0Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3qGr0dkZznvx; Sun, 16 Jul 2023 15:42:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GFgiPv096191; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GFgiFE096190; Sun, 16 Jul 2023 15:42:44 GMT (envelope-from git) Date: Sun, 16 Jul 2023 15:42:44 GMT Message-Id: <202307161542.36GFgiFE096190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: c1e63e352e34 - main - libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1e63e352e34b55ad577011fa4729f0638fb3fdf Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=c1e63e352e34b55ad577011fa4729f0638fb3fdf commit c1e63e352e34b55ad577011fa4729f0638fb3fdf Author: Robert Clausecker AuthorDate: 2023-06-28 17:18:15 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 15:41:55 +0000 libexec/rtld-elf/rtld-libc/Makefile.inc: do not use machdep string functions With ifunc based SIMD dispatch, we cannot use the amd64 assembly implementations of string functions. Modify rtld to instead use the generic functions. To avoid an architecture-specific special case, this change is applied to all architectures. This change is a prerequisite to and formerly part of D40693. Sponsored by: FreeBSD Foundation Approved by: kib See also: D40693 Differential Revision: https://reviews.freebsd.org/D41050 --- libexec/rtld-elf/rtld-libc/Makefile.inc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 99da16d06509..5033b2207e32 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -38,11 +38,21 @@ SRCS+= errlst.c getcwd.c getprogname.c raise.c sigsetops.c sysctlnametomib.c \ # errlst.c needs the errlst.h header from libc: CFLAGS.errlst.c+=-I${LIBC_SRCTOP}/include -# Use the string and memory .o files from libc instead of rebuilding them (they -# might be using optimized assembly and duplicating that logic here is awkward). -_libc_string_objects= bcmp bcopy bzero memset memchr memcmp memcpy memmove \ - stpncpy strcat strchr strchrnul strcmp stpcpy strcpy strcspn strdup \ - strlcat strlcpy strlen strncmp strncpy strrchr strsep strspn strstr strtok +# use generic versions of string functions to avoid potential ifunc dispatch +.PATH: ${LIBC_SRCTOP}/string +SRCS+= bcopy.c bzero.c memchr.c memcmp.c memcpy.c memmove.c memset.c strcat.c \ + strchr.c strchrnul.c strcmp.c strcpy.c strcspn.c strdup.c strlcat.c \ + strlcpy.c strlen.c strncmp.c strncpy.c strrchr.c strsep.c strspn.c \ + strstr.c strtok.c +CFLAGS.memchr.c+=-Wno-cast-qual +CFLAGS.strchr.c+=-Wno-cast-qual +CFLAGS.strchrnul.c+=-Wno-cast-qual +CFLAGS.strcspn.c+=-Wno-sign-compare +CFLAGS.strrchr.c+=-Wno-cast-qual +CFLAGS.strspn.c+=-Wno-sign-compare +CFLAGS.strstr.c+=-Wno-cast-qual -Wno-sign-compare +CFLAGS.strtok.c+=-Wno-cast-qual + # Also use all the syscall .o files from libc_nossp_pic: _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ cerror geteuid getegid sigfastblock munmap mprotect \ @@ -71,7 +81,7 @@ _libc_other_objects+=syncicache # we don't accidentally pull in the interposing table or similar by linking # directly against libc_nossp_pic.a _rtld_libc_objs= -.for _obj in ${_libc_other_objects} ${_libc_string_objects} +.for _obj in ${_libc_other_objects} _rtld_libc_objs+=${_obj}.nossppico CLEANFILES+=${_obj}.nossppico # LDFLAGS+= -Wl,--trace-symbol=${_obj} From nobody Sun Jul 16 17:36:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3spf74Lkz4nBtm; Sun, 16 Jul 2023 17:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3spf6dPmz3tb9; Sun, 16 Jul 2023 17: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=1689529018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhpSAimZHh4DIwVbgZymgVRMi1Ftf27OnOImeDaTz4o=; b=J7X7Dim6zm93LmMpwF9qolmVA31cSSc89ro+55fKHUAhuz4xNnJ4z3j5pud/bv8qtHfgjl LEmKdQGO9GxwIfpEk970oHG8CcCT7F+vv3dtliJi3OnAU+AAun9S0Oa7BzbaH03aFGmIOu L/ScfgqSVpNFJR3qYBRW2LAQMOywSPXme0+ROggx6thOLoxgqSnJvYV6UUO1O5NYkc81J3 Zs5h5gSkM+7ijhIJsl5S8upWYITIJaIXzDn0sqtSjKemq339LLF95qEN/UwPTWneudcx7K nF1YfR6HR6diUONObPMUuIC4Q/+qgRwWmUcK25XrHAnrI6y5vpinqMQXSiUKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689529018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KhpSAimZHh4DIwVbgZymgVRMi1Ftf27OnOImeDaTz4o=; b=EeO8ozPO/+LLW5cvrTKJK6r1Ezc9JHwaOmWaCRFHsACVyJrZ5LcBH7oCtkQnBPPkgjV8B9 CgAWQm8P5LubiOVwokuh+9aJXmow04NAM9d/ArBpgPNfU4jWynsDEhLAKVkuuam7eJVRrE m/W5NOMqf/XmhoWkAuIbD4dCSPFPQyWxGw3Qy5njfXWZhb32aKS+EG4I8A2AFjRcztRWqx 5Z4Uvjlf7GqN8Pi/WBIdEZEAsZu7iUYb1YtavjQQp92SU7d2axxnh4ZARZ9Kcskcp1YTAK A0UYza5RNBPYW1gK7xOIn6m3QT3NGgbraVqsARpOd+W8+TINjOgAwQK+64F+xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689529018; a=rsa-sha256; cv=none; b=ZnfE7P9B2JSALK+XWZ12UhRaQQBmsnRd0vvXljJevRtXVGwHmShUXj2ANkuf8cAqQ3mrw4 X3vrEkCVC0dig7ayecaFu6/N0baedbAacKe+EkQy5Ti/xwoDKIqxFe+Or0ctu4QpbDmPuN kN90j5GvRKKhSrLZmtc9xwyCjE39LSe7+p96a2WDotVJfnoPpZUe5OJcw4Hz0CwVaMsD/a WzL5iYNMAOzNB1KS7jaBBY9FNlFQjSg+9jY8h45r4B3ahTnRtRuCk82QGM4UzVzvzrGZwQ rFbq8N5gYPrFxwIhogxnUfLS5lIB/wdciRcnaOh/gi5tF6mJNpGuI1oCVO//nQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3spf5hJgzrcn; Sun, 16 Jul 2023 17:36:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GHawAn078805; Sun, 16 Jul 2023 17:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GHaw3h078804; Sun, 16 Jul 2023 17:36:58 GMT (envelope-from git) Date: Sun, 16 Jul 2023 17:36:58 GMT Message-Id: <202307161736.36GHaw3h078804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Robert Clausecker Subject: git: 4da7282a1882 - main - lib/libc/string/bcmp.c: fix integer overflow bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4da7282a1882fc03c99591c27d44a2e6dfda364b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=4da7282a1882fc03c99591c27d44a2e6dfda364b commit 4da7282a1882fc03c99591c27d44a2e6dfda364b Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 17:36:17 +0000 lib/libc/string/bcmp.c: fix integer overflow bug bcmp() returned the number of remaining bytes when the main loop exits. In case of a match, this is zero, else a positive integer. On systems where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in the return value may cause the number of remaining bytes to overflow, becoming zero and falsely indicating a successful comparison. Fix the bug by always returning 0 on equality, 1 otherwise. PR: 272474 Approved by: emaste Reviewed by: imp MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41011 --- lib/libc/string/bcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c index 96cd49039eee..c42fe79ddb2f 100644 --- a/lib/libc/string/bcmp.c +++ b/lib/libc/string/bcmp.c @@ -51,7 +51,7 @@ bcmp(const void *b1, const void *b2, size_t length) p2 = (char *)b2; do if (*p1++ != *p2++) - break; + return (1); while (--length); - return (length); + return (0); } From nobody Sun Jul 16 18:46:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3vLN0fgGz4mpKd; Sun, 16 Jul 2023 18:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3vLM5VGcz4FRs; Sun, 16 Jul 2023 18:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689533163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZJ4yuxamjsLW3fVDb69ICmr/dGl1j4IPQohDnAgVc0=; b=puk3OYBp1VNdt25A9QIm0h//Fejjr2P2LyEnK3pI3hwU3VAprIVdewyh8/zGaNQ3MbGwDP E6WOSGqpYQfjBcAQxkkHoU/r+V5HZ3Bv4dUzsXi6FyW9hkSOjj6+wSj9P97D+BvVztyQpn XTNDfAQcy+tmfGgYpoMqy2zjiA1ca4kTT3nYNfazPBfu2zscPIUfWH5EbSVw4ikzM/LMVi 7zNYMhvqyAuhVB9PrX5CZyLs14rA3Lfvu5FPIHPT5q+7tY/aghqI+L6fU6AdZK/VYcWD2z 4pZIU8PJu/FYo1lab3t2DdOmJEwe0dGU+uAPT7Dd/6LG+t0sKp1f1LsVC4L1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689533163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wZJ4yuxamjsLW3fVDb69ICmr/dGl1j4IPQohDnAgVc0=; b=rVOm5yjf0wc5XfDKhvECdW1CT8nzg6VAYDl4t//TbgvlnuMrenLr76qdV7736LPRUNZ+q/ DRXQaBWIe4e4fx/Bwio0B7KlRnMJ9vEvF/wxBJ3t1mv7B8V3B9MzM1KGNOSBkC/0VKiQUJ rUx0/Pw9dkJxzMf8AaYY5s0DKHR3mR66EQza82Izkn8CfEhktVhNR51hydOm3q1qY8JXl+ npNyZmGRmQCloEKPz4tBtIbojfsNNyo3lhE7TQSPVegw4xwyjW8Sz5Qwx6bEFvgUnD1IWO WG44rxTurQlGoiYR3onNc3PRyc01bI/PAeHiwjEe9xGJEOwdcQ0tE1z5nKJLVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689533163; a=rsa-sha256; cv=none; b=L4S1Rx94RLt2GjSLYGpyCYBUkoMvgjBrl+arWHxebjquojB5CyBZKBWFG6vKSFb5Rgufej XCR1C9CN2qiJN4L1clemS+nG1LGDHT1vLv4mNQ3NEOfDuMTJ006cY4MJ956juJgEEnSljA rnx9LRS4xALmgUCnELwmiRaSRhJNb9ndfNqliYk7z5C7wcqBdS3FJkCxToWX3gD9W1LWcJ J2+XGXoUOX34Tb3rBvOzJoLVJo/YeyYTR91fKn4sb2qUhK9jTBgQ3Ys329ws5GgKEA5oMf J5CillYWEExVWD3jb711WcZlEdFQ+yqwfJWLrglfL6/4ZjOyrbElwEEXdGkKNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3vLM4VTYzshB; Sun, 16 Jul 2023 18:46:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GIk3JG095751; Sun, 16 Jul 2023 18:46:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GIk3Yb095750; Sun, 16 Jul 2023 18:46:03 GMT (envelope-from git) Date: Sun, 16 Jul 2023 18:46:03 GMT Message-Id: <202307161846.36GIk3Yb095750@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 881fc203567e - main - Merge commit 8757ce490130 from llvm-project (by Simon Pilgrim): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 881fc203567e85648f2f591a75c4674be2bee0ed Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=881fc203567e85648f2f591a75c4674be2bee0ed commit 881fc203567e85648f2f591a75c4674be2bee0ed Author: Dimitry Andric AuthorDate: 2023-07-16 18:45:29 +0000 Commit: Dimitry Andric CommitDate: 2023-07-16 18:45:29 +0000 Merge commit 8757ce490130 from llvm-project (by Simon Pilgrim): [PowerPC] Replace PPCISD::VABSD cases with generic ISD::ABDU(X,Y) node A move towards using the generic ISD::ABDU nodes on more backends Also support ISD::ABDS for v4i32 types using the existing signbit flip trick PowerPC has a select(icmp_ugt(x,y),sub(x,y),sub(y,x)) -> abdu(x,y) combine that I intend to move to DAGCombiner in a future patch. The ABS(SUB(X,Y)) -> PPCISD::VABSD(X,Y,1) v4i32 combine wasn't legal (https://alive2.llvm.org/ce/z/jc2hLU) - so I've removed it, having already added the legal sub nsw tests equivalent. Differential Revision: https://reviews.llvm.org/D142313 This fixes a "Wasn't expecting to be able to lower this!" fatal error when compiling graphics/opencv for PowerPC. Requested by: pkubaj PR: 271047 MFC after: 1 month --- .../llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 85 ++++------------------ .../llvm/lib/Target/PowerPC/PPCISelLowering.h | 16 ---- .../llvm/lib/Target/PowerPC/PPCInstrVSX.td | 23 +++--- 3 files changed, 24 insertions(+), 100 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 77630cf027fa..cf1cdad3fee6 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1299,6 +1299,11 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM, setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i16, Legal); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i32, Legal); setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::v2i64, Legal); + + setOperationAction(ISD::ABDU, MVT::v16i8, Legal); + setOperationAction(ISD::ABDU, MVT::v8i16, Legal); + setOperationAction(ISD::ABDU, MVT::v4i32, Legal); + setOperationAction(ISD::ABDS, MVT::v4i32, Legal); } if (Subtarget.hasP10Vector()) { @@ -1386,7 +1391,7 @@ PPCTargetLowering::PPCTargetLowering(const PPCTargetMachine &TM, } if (Subtarget.hasP9Altivec()) { - setTargetDAGCombine({ISD::ABS, ISD::VSELECT}); + setTargetDAGCombine({ISD::VSELECT}); } setLibcallName(RTLIB::LOG_F128, "logf128"); @@ -1743,7 +1748,6 @@ const char *PPCTargetLowering::getTargetNodeName(unsigned Opcode) const { case PPCISD::RFEBB: return "PPCISD::RFEBB"; case PPCISD::XXSWAPD: return "PPCISD::XXSWAPD"; case PPCISD::SWAP_NO_CHAIN: return "PPCISD::SWAP_NO_CHAIN"; - case PPCISD::VABSD: return "PPCISD::VABSD"; case PPCISD::BUILD_FP128: return "PPCISD::BUILD_FP128"; case PPCISD::BUILD_SPE64: return "PPCISD::BUILD_SPE64"; case PPCISD::EXTRACT_SPE: return "PPCISD::EXTRACT_SPE"; @@ -16008,8 +16012,6 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N, } case ISD::BUILD_VECTOR: return DAGCombineBuildVector(N, DCI); - case ISD::ABS: - return combineABS(N, DCI); case ISD::VSELECT: return combineVSelect(N, DCI); } @@ -17437,24 +17439,6 @@ SDValue PPCTargetLowering::combineTRUNCATE(SDNode *N, SDLoc dl(N); SDValue Op0 = N->getOperand(0); - // fold (truncate (abs (sub (zext a), (zext b)))) -> (vabsd a, b) - if (Subtarget.hasP9Altivec() && Op0.getOpcode() == ISD::ABS) { - EVT VT = N->getValueType(0); - if (VT != MVT::v4i32 && VT != MVT::v8i16 && VT != MVT::v16i8) - return SDValue(); - SDValue Sub = Op0.getOperand(0); - if (Sub.getOpcode() == ISD::SUB) { - SDValue SubOp0 = Sub.getOperand(0); - SDValue SubOp1 = Sub.getOperand(1); - if ((SubOp0.getOpcode() == ISD::ZERO_EXTEND) && - (SubOp1.getOpcode() == ISD::ZERO_EXTEND)) { - return DCI.DAG.getNode(PPCISD::VABSD, dl, VT, SubOp0.getOperand(0), - SubOp1.getOperand(0), - DCI.DAG.getTargetConstant(0, dl, MVT::i32)); - } - } - } - // Looking for a truncate of i128 to i64. if (Op0.getValueType() != MVT::i128 || N->getValueType(0) != MVT::i64) return SDValue(); @@ -17664,54 +17648,12 @@ isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const { return true; } -// Transform (abs (sub (zext a), (zext b))) to (vabsd a b 0) -// Transform (abs (sub (zext a), (zext_invec b))) to (vabsd a b 0) -// Transform (abs (sub (zext_invec a), (zext_invec b))) to (vabsd a b 0) -// Transform (abs (sub (zext_invec a), (zext b))) to (vabsd a b 0) -// Transform (abs (sub a, b) to (vabsd a b 1)) if a & b of type v4i32 -SDValue PPCTargetLowering::combineABS(SDNode *N, DAGCombinerInfo &DCI) const { - assert((N->getOpcode() == ISD::ABS) && "Need ABS node here"); - assert(Subtarget.hasP9Altivec() && - "Only combine this when P9 altivec supported!"); - EVT VT = N->getValueType(0); - if (VT != MVT::v4i32 && VT != MVT::v8i16 && VT != MVT::v16i8) - return SDValue(); - - SelectionDAG &DAG = DCI.DAG; - SDLoc dl(N); - if (N->getOperand(0).getOpcode() == ISD::SUB) { - // Even for signed integers, if it's known to be positive (as signed - // integer) due to zero-extended inputs. - unsigned SubOpcd0 = N->getOperand(0)->getOperand(0).getOpcode(); - unsigned SubOpcd1 = N->getOperand(0)->getOperand(1).getOpcode(); - if ((SubOpcd0 == ISD::ZERO_EXTEND || - SubOpcd0 == ISD::ZERO_EXTEND_VECTOR_INREG) && - (SubOpcd1 == ISD::ZERO_EXTEND || - SubOpcd1 == ISD::ZERO_EXTEND_VECTOR_INREG)) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(0).getValueType(), - N->getOperand(0)->getOperand(0), - N->getOperand(0)->getOperand(1), - DAG.getTargetConstant(0, dl, MVT::i32)); - } - - // For type v4i32, it can be optimized with xvnegsp + vabsduw - if (N->getOperand(0).getValueType() == MVT::v4i32 && - N->getOperand(0).hasOneUse()) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(0).getValueType(), - N->getOperand(0)->getOperand(0), - N->getOperand(0)->getOperand(1), - DAG.getTargetConstant(1, dl, MVT::i32)); - } - } - - return SDValue(); -} - // For type v4i32/v8ii16/v16i8, transform -// from (vselect (setcc a, b, setugt), (sub a, b), (sub b, a)) to (vabsd a, b) -// from (vselect (setcc a, b, setuge), (sub a, b), (sub b, a)) to (vabsd a, b) -// from (vselect (setcc a, b, setult), (sub b, a), (sub a, b)) to (vabsd a, b) -// from (vselect (setcc a, b, setule), (sub b, a), (sub a, b)) to (vabsd a, b) +// from (vselect (setcc a, b, setugt), (sub a, b), (sub b, a)) to (abdu a, b) +// from (vselect (setcc a, b, setuge), (sub a, b), (sub b, a)) to (abdu a, b) +// from (vselect (setcc a, b, setult), (sub b, a), (sub a, b)) to (abdu a, b) +// from (vselect (setcc a, b, setule), (sub b, a), (sub a, b)) to (abdu a, b) +// TODO: Move this to DAGCombiner? SDValue PPCTargetLowering::combineVSelect(SDNode *N, DAGCombinerInfo &DCI) const { assert((N->getOpcode() == ISD::VSELECT) && "Need VSELECT node here"); @@ -17762,9 +17704,8 @@ SDValue PPCTargetLowering::combineVSelect(SDNode *N, TrueOpnd.getOperand(1) == CmpOpnd2 && FalseOpnd.getOperand(0) == CmpOpnd2 && FalseOpnd.getOperand(1) == CmpOpnd1) { - return DAG.getNode(PPCISD::VABSD, dl, N->getOperand(1).getValueType(), - CmpOpnd1, CmpOpnd2, - DAG.getTargetConstant(0, dl, MVT::i32)); + return DAG.getNode(ISD::ABDU, dl, N->getOperand(1).getValueType(), CmpOpnd1, + CmpOpnd2, DAG.getTargetConstant(0, dl, MVT::i32)); } return SDValue(); diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h index b80479427c2e..1a01cadbeedb 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -440,21 +440,6 @@ namespace llvm { /// and thereby have no chain. SWAP_NO_CHAIN, - /// An SDNode for Power9 vector absolute value difference. - /// operand #0 vector - /// operand #1 vector - /// operand #2 constant i32 0 or 1, to indicate whether needs to patch - /// the most significant bit for signed i32 - /// - /// Power9 VABSD* instructions are designed to support unsigned integer - /// vectors (byte/halfword/word), if we want to make use of them for signed - /// integer vectors, we have to flip their sign bits first. To flip sign bit - /// for byte/halfword integer vector would become inefficient, but for word - /// integer vector, we can leverage XVNEGSP to make it efficiently. eg: - /// abs(sub(a,b)) => VABSDUW(a+0x80000000, b+0x80000000) - /// => VABSDUW((XVNEGSP a), (XVNEGSP b)) - VABSD, - /// FP_EXTEND_HALF(VECTOR, IDX) - Custom extend upper (IDX=0) half or /// lower (IDX=1) half of v4f32 to v2f64. FP_EXTEND_HALF, @@ -1422,7 +1407,6 @@ namespace llvm { SDValue combineFMALike(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineTRUNCATE(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineSetCC(SDNode *N, DAGCombinerInfo &DCI) const; - SDValue combineABS(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineVSelect(SDNode *N, DAGCombinerInfo &DCI) const; SDValue combineVectorShuffle(ShuffleVectorSDNode *SVN, SelectionDAG &DAG) const; diff --git a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td index 3c742075b111..2e52fbd3c333 100644 --- a/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td +++ b/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrVSX.td @@ -76,9 +76,6 @@ def SDT_PPCxxswapd : SDTypeProfile<1, 1, [ def SDTVecConv : SDTypeProfile<1, 2, [ SDTCisVec<0>, SDTCisVec<1>, SDTCisPtrTy<2> ]>; -def SDTVabsd : SDTypeProfile<1, 3, [ - SDTCisVec<0>, SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisVT<3, i32> -]>; def SDT_PPCld_vec_be : SDTypeProfile<1, 1, [ SDTCisVec<0>, SDTCisPtrTy<1> ]>; @@ -105,7 +102,6 @@ def PPCmtvsrz : SDNode<"PPCISD::MTVSRZ", SDTUnaryOp, []>; def PPCsvec2fp : SDNode<"PPCISD::SINT_VEC_TO_FP", SDTVecConv, []>; def PPCuvec2fp: SDNode<"PPCISD::UINT_VEC_TO_FP", SDTVecConv, []>; def PPCswapNoChain : SDNode<"PPCISD::SWAP_NO_CHAIN", SDT_PPCxxswapd>; -def PPCvabsd : SDNode<"PPCISD::VABSD", SDTVabsd, []>; def PPCfpexth : SDNode<"PPCISD::FP_EXTEND_HALF", SDT_PPCfpexth, []>; def PPCldvsxlh : SDNode<"PPCISD::LD_VSX_LH", SDT_PPCldvsxlh, @@ -4808,20 +4804,23 @@ def : Pat<(f128 (uint_to_fp (i32 (PPCmfvsr f64:$src)))), // Any Power9 VSX subtarget that supports Power9 Altivec. let Predicates = [HasVSX, HasP9Altivec] in { -// Put this P9Altivec related definition here since it's possible to be -// selected to VSX instruction xvnegsp, avoid possible undef. -def : Pat<(v4i32 (PPCvabsd v4i32:$A, v4i32:$B, (i32 0))), +// Unsigned absolute-difference. +def : Pat<(v4i32 (abdu v4i32:$A, v4i32:$B)), (v4i32 (VABSDUW $A, $B))>; -def : Pat<(v8i16 (PPCvabsd v8i16:$A, v8i16:$B, (i32 0))), +def : Pat<(v8i16 (abdu v8i16:$A, v8i16:$B)), (v8i16 (VABSDUH $A, $B))>; -def : Pat<(v16i8 (PPCvabsd v16i8:$A, v16i8:$B, (i32 0))), +def : Pat<(v16i8 (abdu v16i8:$A, v16i8:$B)), (v16i8 (VABSDUB $A, $B))>; -// As PPCVABSD description, the last operand indicates whether do the -// sign bit flip. -def : Pat<(v4i32 (PPCvabsd v4i32:$A, v4i32:$B, (i32 1))), +// Signed absolute-difference. +// Power9 VABSD* instructions are designed to support unsigned integer +// vectors (byte/halfword/word), if we want to make use of them for signed +// integer vectors, we have to flip their sign bits first. To flip sign bit +// for byte/halfword integer vector would become inefficient, but for word +// integer vector, we can leverage XVNEGSP to make it efficiently. +def : Pat<(v4i32 (abds v4i32:$A, v4i32:$B)), (v4i32 (VABSDUW (XVNEGSP $A), (XVNEGSP $B)))>; } // HasVSX, HasP9Altivec From nobody Sun Jul 16 20:51:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R3y770sN8z4n072; Sun, 16 Jul 2023 20:51: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R3y7707CJz3nts; Sun, 16 Jul 2023 20:51:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689540691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfKcWwUtNJSX9g9/TytGDMn4seEt3kUNIdHzzRjzR90=; b=MJIGEwk2trX8LJICblMTQ54jMoHGnSiFucc54tMknlaq/NEXplNcBZXSqVNigV8sunsZfc jJWigHTw5/gLCXPY5v3wu7L65vsZOoGyi29bxz8E2n7VcVduKwQXq8SqoBpntxz/lfjDHE QVUD8rbIfzL1SYT6QKkm5hYQ4/tElgHE4lVl93xLPSeKoBto0+fuybgfmCDkAoJU1eY4/0 fEH0p1kEyk7PWAS/h3ViDes97+tYmiA4t1K3ekJYkniSsDJoU57/vaz8U7gIqJW+q7BHxc KaIqYDyW2/NRs+7+D2pZ4zWFUs811kPHy7/ELjWUUNv7gSkwmMc/SQ95mrdzbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689540691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfKcWwUtNJSX9g9/TytGDMn4seEt3kUNIdHzzRjzR90=; b=gY+Tcq8UHSZ4QFC6H5aDqeLn9RlXBv/UqWT6GwqeY4hgxKOowXTAdvDF758J9Fa2jbqyYe PQG29m0APqt7IYqDET6PPkYdF63J9EF5FlX68xdm19IpV/YpHlwDN9RU1+OKElZQaoSOwb l3Vm6Vy7bRb6ExBaLsWRYE3uJfCgux9pJ8ECGzdhxGUY7Aj4FBhNOsVnpne9gkiosmir9l g02SK06PtdaSVrSd19g88rUjG/cIWzRg9VvsuTikAUL54pJp7Kn09Qh27DO1NdJdQ9idzo 5sLUMh7kU0YNalQUvdtGCqhWoVuA6Ol2/Ep5PCs2PB7jbWCaQTWxbZyXdQfNFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689540691; a=rsa-sha256; cv=none; b=r06AvjnnxUHjaTyulRGYaoRyJtOzjmw6/kY9sUTwrCYAz0kEqZxd2yKX/BeDV7j9tZVqGF nTUXpcczCplH0tmbp5v7/52mXhMBiEAjk/DXg5LD8Gg8i9tC7C+FAg78L+aHaph5W0UOWn DwoMTrJHZxCyMVALrgtlkzeH0tuSD44uLisrQ+h3ICF63QQqD61Yo9EleEe8VNL3whdbib wQDcbyPRx/tHEOPNShdC92uy1ObVjIyNk8cEUR+LnY6uPD0092C+ovFqFaY9yoDGDeSi3K sPQfjP9LBCBfzNUkO3/HKh9+ZEETAoJ4Sqq6obZ1JXoFGm35Gr+DbSNOjsvoIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R3y766Jcqzwn6; Sun, 16 Jul 2023 20:51:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36GKpUfC009128; Sun, 16 Jul 2023 20:51:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36GKpUPI009127; Sun, 16 Jul 2023 20:51:30 GMT (envelope-from git) Date: Sun, 16 Jul 2023 20:51:30 GMT Message-Id: <202307162051.36GKpUPI009127@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: b8cc13fa21df - main - riscv pmap: another vm_radix_init List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: b8cc13fa21df6081f11eb845e064ade37172195a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b8cc13fa21df6081f11eb845e064ade37172195a commit b8cc13fa21df6081f11eb845e064ade37172195a Author: Doug Moore AuthorDate: 2023-07-16 20:48:43 +0000 Commit: Doug Moore CommitDate: 2023-07-16 20:48:43 +0000 riscv pmap: another vm_radix_init pmap_pinit0 also needs to initialize a vm_radix, in case vm_radix_init does anything but zeroing fields. Reported by: alc Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D41055 --- sys/riscv/riscv/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 6cada93cdc91..7580f091ad86 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -1327,6 +1327,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_satp = pmap_satp_mode() | (vtophys(pmap->pm_top) >> PAGE_SHIFT); CPU_ZERO(&pmap->pm_active); + vm_radix_init(&pmap->pm_root); pmap_activate_boot(pmap); } From nobody Mon Jul 17 05:25:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R49XK62lvz4n8WT; Mon, 17 Jul 2023 05:25: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R49XK5XMSz3vhl; Mon, 17 Jul 2023 05:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689571537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bH05i4FzFUBNqdX5SSrrGYRQ8Np+YkRo92P9/NbQ3o=; b=ktM7qDqORCsBi8aD6OzaMkd1Q1j+wfWQFE3xo8HCrhz1Kx0UnMX+JcVmfWXtA12e9WrjIa 7temQswvMxBU+fd+tIjP1TCJvkVsfPaueA1UD1DlZvY+QfAbs1+TeVXHlVE1Cf+yly0EPc Ev49dpti2DYOh9vZd1v1/SP/JgST3C33kYkb4Vv25/DL1/Og/hI7mY+kpAUCxdurBe0QX7 Hq4aluUVfzs0fqLlQvwDelEs954Bx+AZnhGE9y7wr8A+UewCLX6jTGlbE+zUTnsm8+pUj0 kZv2aLgrXa6UBZRo3veiXmHP9BSjf6G6sRFeErWKPmNPyUHQhg2T8YJaX3wR9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689571537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/bH05i4FzFUBNqdX5SSrrGYRQ8Np+YkRo92P9/NbQ3o=; b=I/4L0pH605VpbZFW2q1bvX8PXg+DLxslrENMVwpm5ySCU/j+QzY0wKwGE4Tb3rfagcOK53 d/5mtTz6H8Qje4Za8SxKQa2azSGp7yo9IrS7DigOgEBIOuDwEZCtwSPSJTZx+6qF7PhvUT XTG9awnW4gKMmW+rq6Bc8W3kg6DqHq/YMwEjk4BNVLKUypEZ1U5urumN+almbRZ8x/kcd1 PfP+DzA/WVPygrooCTyr4pH/Ozk+RG2LcrdHJHekLsRYtt89BmR8JT0ccMO9BbL1nd1ItH Oal0sn9OhRYXYTGvis7JHD/1XjdsiV9xwYvFrdIwJ8dp3TYRUy0bnO6eCCIw9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689571537; a=rsa-sha256; cv=none; b=lj+bhM+cQreoxEKEeeoMRMnEJB/HTTIb2FGqAGsXtmfqV5FouLC88mzS/zW5AozH2ozWXe OtYBFr51ICslxyPn1ooNFh/2rgvZsTV66FLWr/8Wooc055kpLyu/GldldII87cXIVyQTU9 qX2/H24wAmv6YI1VIVoNC+0PULETI6SGvBWWwcidleUoJ5CV+9x4jqo0F5sV5aXnUOvE3a P9CNxpUWWLin8N3GC+jhCL+j4eZTo5JTdy9Nk9jG0D8IZkOkxXtMyw0yCKoTGPaf1HbRFi mWzCwDY/mbEwAU1qBeiqmvLhHZZj8ZSZsSyBbu+3dvlZS6UIVzlzZbCpJoq97g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R49XK4cTNz1BK7; Mon, 17 Jul 2023 05:25:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36H5PbbR054299; Mon, 17 Jul 2023 05:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36H5PbFo054298; Mon, 17 Jul 2023 05:25:37 GMT (envelope-from git) Date: Mon, 17 Jul 2023 05:25:37 GMT Message-Id: <202307170525.36H5PbFo054298@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: be4c7f273508 - main - libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: be4c7f273508994638b68d2fae742be37d3cb117 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=be4c7f273508994638b68d2fae742be37d3cb117 commit be4c7f273508994638b68d2fae742be37d3cb117 Author: Steve Kargl AuthorDate: 2023-07-17 05:19:28 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-17 05:23:27 +0000 libm: correctly test for for NaN and Infinity in sinpi(), cospi(), and tanpi() The current versions of lib/msun/src/s_cospi.c, s_sinpi.c and s_tanpi.c all exhibit the same defect. After checking for various numeric ranges, they check to see whether the input argument is a NaN or an Infinity. However, the code uses a value of 0x7f80000 instead of the correct value of 0x7ff00000. If you review s_cospif.c, s_sinpif.c, and s_tanpif.c, you will see that the equivalent statements in these functions are accurate and have appropriate source comments. The impact of these defects is to flag some valid input values as invalid and raise a pole error (divide by zero). Reported by: Paul Green PR: 272539 MFC after: 1 week --- lib/msun/src/s_cospi.c | 3 ++- lib/msun/src/s_sinpi.c | 3 ++- lib/msun/src/s_tanpi.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/msun/src/s_cospi.c b/lib/msun/src/s_cospi.c index 860219efd3e4..2e2f92733a86 100644 --- a/lib/msun/src/s_cospi.c +++ b/lib/msun/src/s_cospi.c @@ -138,7 +138,8 @@ cospi(double x) return (j0 & 1 ? -c : c); } - if (ix >= 0x7f800000) + /* x = +-inf or nan. */ + if (ix >= 0x7ff00000) return (vzero / vzero); /* diff --git a/lib/msun/src/s_sinpi.c b/lib/msun/src/s_sinpi.c index 858459a5fcb4..bc3759e567a3 100644 --- a/lib/msun/src/s_sinpi.c +++ b/lib/msun/src/s_sinpi.c @@ -155,7 +155,8 @@ sinpi(double x) return ((hx & 0x80000000) ? -s : s); } - if (ix >= 0x7f800000) + /* x = +-inf or nan. */ + if (ix >= 0x7ff00000) return (vzero / vzero); /* diff --git a/lib/msun/src/s_tanpi.c b/lib/msun/src/s_tanpi.c index 01d4c74367fd..f911d56156b3 100644 --- a/lib/msun/src/s_tanpi.c +++ b/lib/msun/src/s_tanpi.c @@ -163,7 +163,7 @@ tanpi(double x) } /* x = +-inf or nan. */ - if (ix >= 0x7f800000) + if (ix >= 0x7ff00000) return (vzero / vzero); /* From nobody Mon Jul 17 12:54:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MTk50w5z4nBBB; Mon, 17 Jul 2023 12:54: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4MTk4NFlz43xS; Mon, 17 Jul 2023 12:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689598442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K238ZALnd714axJ9ZQw4MN9ZVK/gYCYUE1gLuoIL+HA=; b=Udt5EnQlb7/hrm6QWG8KV8GPiUMTjuQ/b9yTC88C92/k7QjOcJbWX44clc5QygclzeqPKc 6WMkTUufQ6x1lIFoscmSfnyLw7s9a8kR2k/KCqwdF3bTrab7ulaNrAtxopftFcxQryAJh1 wbX8VJkzWT7XkCYhv8sIrkzw+g2Q4ObyW6wuJpWt/T0qFxNlNbaycNha+I8TzeURZhD9vJ Nu9PKSvHdO3rgKgGi0/RqJVytfT3QzvejiGR5PBkUv8J+1gJe5R0h8uV6WNHU7kxuEtq80 fWDmr6qeyDXLvcREepTWLGG6UKccj4e2Qm82SGeLuytgM7XgjGkMbX6IrFD6FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689598442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K238ZALnd714axJ9ZQw4MN9ZVK/gYCYUE1gLuoIL+HA=; b=g5W4ip/MtaENdVVyXQ7lpl+g6CRYPRP4r+u0X5/YLWk8FEfJJ+u0FF8+vV4mJRzc08i6t9 CSrMlUg9yO7wdiSxb2DqgKHNDmURvICfmfCUFAK1ObtTkP+UoyCo7VxD9NJFXqQfAdMj3n LN2wCSlLI8bUPrLgoTrYU+Hz3Ba0JOkDte9D+pG1spq+F2l8VSsByx/TU1b3xgc4zrYzTa BFN7E+y4pPzUiWNfK9WyT4zNtVZAos9qwdFZA8Bdm5J7yWQKdbibCWcEB+WwQWGieHX1i2 Dk9XlkgUJA9UxNu/NM5rxyJsmhKHRoxQfK+hb9b1nup+I7diDzJslDe4w3B2+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689598442; a=rsa-sha256; cv=none; b=XYCDtFqqubQ+laBqABZuwiiZkSfBV4oRxdE4bXqYNjBl5W+HzN02FAwB60qqHF3WQ5UiVJ VxIB0Q3piluQniRDwRCmRr38hIhHPL1SMOceYASqjuBoOFgjcbVJf04Ki+6GYFcXneXqq/ IwKngvbJEM25MUE+Mnj5EU5so1ESaqhTEU4tUjVM/whe4FhZuoDPy2s7dsinUE2mC4/MCR xelWPG16PThaTkml3XMSxItTWutEwWduLa+FXGaSYWpe+jwtz908ZWrx0rFMmeKb0xB0mS SKHx7HDOaXfytX06So1T9tIqsmKa8LHwfI1of/CMo/WJDLKno0qRknFFPggCXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4MTk3S6czPXC; Mon, 17 Jul 2023 12:54:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HCs2RS097836; Mon, 17 Jul 2023 12:54:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HCs21f097835; Mon, 17 Jul 2023 12:54:02 GMT (envelope-from git) Date: Mon, 17 Jul 2023 12:54:02 GMT Message-Id: <202307171254.36HCs21f097835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 73fb7a7a7342 - main - style.Makefile.5: Stop documenting NO_MAN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 73fb7a7a7342bb590ba53e406b564df0d90c3304 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=73fb7a7a7342bb590ba53e406b564df0d90c3304 commit 73fb7a7a7342bb590ba53e406b564df0d90c3304 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 12:50:33 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 12:52:28 +0000 style.Makefile.5: Stop documenting NO_MAN NO_MAN has been an error since 2020 according to UPDATING. PR: 231357 MFC after: 3 days --- share/man/man5/style.Makefile.5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 4ced85704640..575fb0f38d2f 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2021 +.Dd July 17, 2023 .Dt STYLE.MAKEFILE 5 .Os .Sh NAME @@ -66,7 +66,7 @@ order is: .Va PROG Ns / Ns Oo Va SH Oc Ns Va LIB Ns / Ns Va SCRIPTS .Va FILES .Va LINKS -.Oo Va NO_ Oc Ns Va MAN +.Va MAN .Va MLINKS .Va INCS .Va SRCS @@ -88,7 +88,7 @@ order is: .Va INCS .Va FILES .Va LINKS -.Oo Va NO_ Oc Ns Va MAN +.Va MAN .Va MLINKS . .It Omit From nobody Mon Jul 17 13:07:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MnM5L4Rz4nJrd; Mon, 17 Jul 2023 13:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4MnM4wGpz47Xd; Mon, 17 Jul 2023 13:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AcQn8y6IIqzPrJMx9sLKhl8nMIROfYEdkBl37h92x0k=; b=JX69HfD/nOJuWuwoNuPYGgn+TWdwSdNo6hsGwdr2lCE815ocFE3qys4kQK5K+O6nPeJjHK EDullyzMgghNFe87Lq19ow87yvkwLQwP7uwqkI0xewX+Vc3VnxjRLsvr/tCiHnzleTRjSA WftcKHOApIDclsR49karn2tqtAVJTdTJ5FXNwRAkmMhmD5c3S1yIOCLeQW+a2kipShmh3Y H53UJ1E6v5aYne+gJEHSGwdCaXI+q73jbGxhF7vC3BrKGY3WkEbniaJSq7WAnSR6SkDYs3 OHuadTUwjEZwGE+MEfCloneIxTcj5MNZFt7pVOmzFuP+O0zHPu5ASl8pzXlIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599255; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AcQn8y6IIqzPrJMx9sLKhl8nMIROfYEdkBl37h92x0k=; b=qm3ZRfjAagAHCSQQr3MugOMHrx1/XqChNjqJ6KvpJu7yatjrikPiySknGsApz7qNxFGdWj H24EIgO7rmfOAb39ByMf8WP9uYHEHMvCm2vDxQx0QyN73vVtXJgBmaNl8e8s24sRZaO/4g 1hngwdPrPNiiBWOLdOkT7G+tuq0ZgoWvX4zfcPl5abc5Z8AVfvJE7iJTUg/GhEKcpVjFLw PwsS9n2LJKfmnXIsxqXLt43qchVpqaqapRnojUchAJO9V5mmYnt7EKmZ2bpY0D0+fEPJe+ LCOp9O5metSN4x9p8i5kl5Wkrm7OlVEtX0He83Y5T+v3H6TyRuFBygCDjxppwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689599255; a=rsa-sha256; cv=none; b=t3cVVIP5WYUT+em8HGbMfP3K6T3ERrtnG9WUq/9qtSd96ztdjY/Prr27svCVsEDgFREU23 mj98APemfY5q3/5eLFkaXfOSJZokrAML+mJnbXgRjqDXOMCYgIKQwye+vV3ibzQp4L6k37 Ini+5aNbnC5nTm7UcGMqi2lcmWpNPbO/6Kd7T6ZPNUepjxAVSTSA4z/yOJLuTD4Lv3/wza NQZTYSrGVJoYX1f4dHsRIc2eQKYNTm6114sTi+i+XXh9f9C9u15lzVMtZiVz34SBNk734r nlG4Om5Eg1lv+qMY+na7uQ8R5WZkB3Pb2g+AyMlarE+Mg8WV1JrlGI/GIeAAug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4MnM3yjvzPfT; Mon, 17 Jul 2023 13:07:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HD7Zdv016353; Mon, 17 Jul 2023 13:07:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HD7ZO8016352; Mon, 17 Jul 2023 13:07:35 GMT (envelope-from git) Date: Mon, 17 Jul 2023 13:07:35 GMT Message-Id: <202307171307.36HD7ZO8016352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 22faf70d7e13 - main - style.Makefile.5: Remove $FreeBSD$ from examples List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22faf70d7e137f39b6afe7da967679a7cdbe3507 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=22faf70d7e137f39b6afe7da967679a7cdbe3507 commit 22faf70d7e137f39b6afe7da967679a7cdbe3507 Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 13:01:52 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 13:01:52 +0000 style.Makefile.5: Remove $FreeBSD$ from examples MFC after: 3 days --- share/man/man5/style.Makefile.5 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index 575fb0f38d2f..da475420013a 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -243,8 +243,6 @@ The simplest program .Pa Makefile is: .Bd -literal -offset indent -# $FreeBSD\&$ - PROG= foo \&.include @@ -254,8 +252,6 @@ The simplest library .Pa Makefile is: .Bd -literal -offset indent -# $FreeBSD\&$ - LIB= foo SHLIB_MAJOR= 1 MAN= libfoo.3 From nobody Mon Jul 17 13:07:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4MnN6Z4Kz4nJdl; Mon, 17 Jul 2023 13:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4MnN62N1z47YC; Mon, 17 Jul 2023 13:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fy9/WctSyr1u6kCKWcjEDa/Op0gsXVoDHkigdB2bRI0=; b=mZqaayMPLe0Ay1vLf0klWc3uASQJ/a6W5o8qbQsddxAXyw1RJQ0F/tb9sSi8OSNMNnYOCe zwGI4+5jzaF4YBF7CrSvkX0+AEtnRt80lVYs0Ayf+KeWdoCBZxlPj5mMii5v5BETgbHp3s pZBrkX+086rAC3RJceeXBWWQXEkwAggmdrKxQE1ng++ojPODbBnK+U1X68KkwLm/TGH8OS 949iCaFiPVo0HPEIgfcAWGSbtX/X3rUjoTT+gVtGnRaIBlP+Ed5QYxK9XnI99atWhEsSvl 4dZx2kuAF4UhRriog8nzqcQJpYYUP8jxCa2ZU20/7+MQG+ygQ0vmYI2swp7lNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689599256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fy9/WctSyr1u6kCKWcjEDa/Op0gsXVoDHkigdB2bRI0=; b=DVsXL/IqET2inO8GMKk0qfopgoFNkMXyJPRhnUps+Oe9z0XSn780FsuRYeaHVQoVF+/Fmw aPv5Yt2MjrvVeBJBqznFbQByITWCUTU2AE122vjSD7pivFt3+BWWAyVDgCeIjQECeP4GU/ UyaX9A5ZKOfeF/LDAgWdgknq3uuDpUQRuJNqdvO+SzA6VYmGNoAxyKzf5ee9wIVvwfjTN+ KtV26iQCiG/9OVb5kWfRZY7AZ4jlvwZMJQkqKg3HwvZkzxb30rabl4FNXwKi05vvuoFnJc lEuDZJpisAnEvskhREX36+Vae8015lURLXZ/1kiTGox5ENwbKNaDwQGxflcWFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689599256; a=rsa-sha256; cv=none; b=PFaEq7YapMGOPPrJ1KP0CIFNuFpkby8NCNuir9bN4NS7BfY/in3PNPm2v9ZgzIFhJZ3AgI MGPBpFycrM+DHgP0Z1z4xoXJN1rF5rpismLNpn7RhGIqIRAlloYhQnEpY427HxPFsL+CZZ OYYJcUW9kil41N/cJS16SgWSqEnbMK6rDO23yf3bBbcuoC7l3U2+RQHx9Eq0z8VepGNLmr lI3yKhEuZKZPWa2jB7nk2bQ0vtHWRVgOJlyxp42+g3ikSfyu9e5S/hcV+ZzL5f+gc72WW3 okN3KEAJx7S86hqWdXD0pTTVZO64Fs+RoiyeUt/KcRxN6YmV3GwHfTH5AMXnwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4MnN585PzPfV; Mon, 17 Jul 2023 13:07:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HD7a7n016372; Mon, 17 Jul 2023 13:07:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HD7avC016371; Mon, 17 Jul 2023 13:07:36 GMT (envelope-from git) Date: Mon, 17 Jul 2023 13:07:36 GMT Message-Id: <202307171307.36HD7avC016371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 9e850513daf9 - main - style.Makefile.5: Wordsmith .PATH description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e850513daf9cd1db7980f1f38ef7051331293fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp: URL: https://cgit.FreeBSD.org/src/commit/?id=9e850513daf9cd1db7980f1f38ef7051331293fd commit 9e850513daf9cd1db7980f1f38ef7051331293fd Author: Mateusz Piotrowski <0mp@FreeBSD.org> AuthorDate: 2023-07-17 13:06:02 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2023-07-17 13:06:02 +0000 style.Makefile.5: Wordsmith .PATH description MFC after: 3 days Fixes: 1ac5586c6d86 style.Makefile.5: Do not require $FreeBSD$ SCM IDs --- share/man/man5/style.Makefile.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man5/style.Makefile.5 b/share/man/man5/style.Makefile.5 index da475420013a..7cf8bdc53c9d 100644 --- a/share/man/man5/style.Makefile.5 +++ b/share/man/man5/style.Makefile.5 @@ -43,7 +43,7 @@ source tree. .Bl -bullet .It .Cm .PATH : -comes next if needed, and is spelled +comes first if needed, and is spelled .Dq Li ".PATH: " , with a single .Tn ASCII From nobody Mon Jul 17 15:20:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4QkR5Yjjz4nG5R; Mon, 17 Jul 2023 15:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4QkR4DC6z3l10; Mon, 17 Jul 2023 15:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sE+k9yNXOtTiel3Gy2TyS1e7Opf5BmxF0KEnTPT3Kg=; b=TF8YNZ49bH/J+FCO6iNCh8DUnXVOePKp+pZPzQdYXYAZ7woRK5WeooZvD5e3SSEB0gJr6o CbXU48Y27HL+boxVQ3VaiLBLA6j3FTov0cZ3b4FrrT1/VquPc+2T4Ri7M/m5rjnkwWwBPy rVmw8LGMefou1LlBM7ZviGQerF13o7ZLZi9Cl27lrzwj5orGCkLFqqGGkRRvWrVzF29ZJY cb9DfvDxsDiKkjgBJo/p2WfQBRCPdT6qO9TrndK45WhKdGuKWqartPekFhI/h6oju+0Q38 f10vzWxbi0XqvODlk+RxotZuRfd3ZiLpMM1QZqMkIHMVEsK8iRfic+5WcOH0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1sE+k9yNXOtTiel3Gy2TyS1e7Opf5BmxF0KEnTPT3Kg=; b=Bi3z3IfiHZ04YZsLtm20pu7H7AUxSJ9/HyncN8upZCLEFdSnCxMRlCa5/vTtpG/Y3WfLwE qM/INLSwF/231HaB8D+NAXaIXBh9zg2/dmKmcmPJs/e540GWg9Gv8sWVygbi1apGWa78dL +InOVURIPCIhBMkb7AYJ6uaRvTp6vBIV0vFUMN/OrE5L7ci2MyZp31EQmFgWcEOk5jR5Tz oGNsVotWWTMbOQJEtUg/7dFuNw9bqtFPgVrrQpMskINCsjdJL+p1viw+srza6A7LhEdXdl lKrwCIOQSxwIKWTmkppUUkSajkn2D6b47ng0HC7+rIBfsyiL+DC/8NmlJakvWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689607215; a=rsa-sha256; cv=none; b=vSLrzU53x8vM2OMHOWDQ3IepwT9HPttBXS4deHepyg+PJ5n/t0shSpniy/Dqpts439lA7r K+8mph2VMeOg2Ktzsq5HpGs4u4i27mi+o+/iHUQRmDcYjsi/OldhZsG7olSXlTTILgs261 uXGSoK2NCqevo5A45qVE07FBDnV8TawEK0xyj1S2qvBEXrIIgRsjs31Ljtd4UqGw8Dcj8y saj9f7xEBLXDSJj7qQB7qizT2EwO8H91aaINT3PhLGz035b0szJCU6Juoq1YD0TQOnLUi1 4rQp4DYgUJYA0xJXLHZDuSR4LMaubF7GrsN7jtd1MxAeZbaVyZoFJe/puhiYOQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4QkR3BnwzT0t; Mon, 17 Jul 2023 15:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HFKFNK037722; Mon, 17 Jul 2023 15:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFKFFq037715; Mon, 17 Jul 2023 15:20:15 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:20:15 GMT Message-Id: <202307171520.36HFKFFq037715@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: 0855749d296c - main - bhyve: Fix whitespace in bhyverun.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0855749d296c5e91d0eecea4a7871ac86259911f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0855749d296c5e91d0eecea4a7871ac86259911f commit 0855749d296c5e91d0eecea4a7871ac86259911f Author: Mark Johnston AuthorDate: 2023-07-17 15:11:20 +0000 Commit: Mark Johnston CommitDate: 2023-07-17 15:15:49 +0000 bhyve: Fix whitespace in bhyverun.c No functional change intended. MFC after: 1 week --- usr.sbin/bhyve/bhyverun.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 2feb78a0bdf0..2a2a0f028d9d 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -208,7 +208,7 @@ static void usage(int code) { - fprintf(stderr, + fprintf(stderr, "Usage: %s [-AaCDeHhPSuWwxY]\n" " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" " %*s [-G port] [-k config_file] [-l lpc] [-m mem] [-o var=value]\n" @@ -1032,7 +1032,7 @@ fbsdrun_set_capabilities(struct vcpu *vcpu) exit(4); } vm_set_capability(vcpu, VM_CAP_PAUSE_EXIT, 1); - } + } if (get_config_bool_default("x86.x2apic", false)) err = vm_set_x2apic_state(vcpu, X2APIC_ENABLED); @@ -1249,12 +1249,12 @@ main(int argc, char *argv[]) set_config_bool("destroy_on_poweroff", true); break; case 'p': - if (pincpu_parse(optarg) != 0) { - errx(EX_USAGE, "invalid vcpu pinning " - "configuration '%s'", optarg); - } + if (pincpu_parse(optarg) != 0) { + errx(EX_USAGE, "invalid vcpu pinning " + "configuration '%s'", optarg); + } break; - case 'c': + case 'c': if (topology_parse(optarg) != 0) { errx(EX_USAGE, "invalid cpu topology " "'%s'", optarg); @@ -1302,7 +1302,7 @@ main(int argc, char *argv[]) case 'S': set_config_bool("memory.wired", true); break; - case 'm': + case 'm': set_config_value("memory.size", optarg); break; case 'o': From nobody Mon Jul 17 15:20:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4QkS5dT6z4nGLF; Mon, 17 Jul 2023 15:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4QkS4gzLz3l33; Mon, 17 Jul 2023 15:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUPJzSAPftXTco+mgfUbQ9ZKuR2OIM17FbQqlvbDung=; b=nzpUGLrLFrZqY0+FnQ2TC1Wo3JIgeObWQV/URDQtcYeQqLHmlAgca/KQZ9gpo215Kp5JeP dwrb/2pzXPDp3qp764s1MdsHquIkkhVZpOIiWB2NHF4gl46V1yDLqeQ7UBAmOduZ803R+e DHFfYWodyMt98ArVGHFv92jCFacdke48U60RwXl9PCUKwIJfJa0PqhYOnfj96ulAFBmGkP varnqVMcx9fEwXEQKx/BJylbHaNkFwOFSoL6FG8g+7/KJ76UAuZbIMq7YufNTNqlp/OKPP M5snu78mSgmYS++v2cjoAn7WfnWTn2uZe1fIIQh/AUrjYsmQ+RANwrA8LcS88A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689607216; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TUPJzSAPftXTco+mgfUbQ9ZKuR2OIM17FbQqlvbDung=; b=jCE6MAraO+IkW43kzFvQIuwqc/v6rNsWoT/+Ua9ft2BrX/4D/O/DSO/+LOUPE7pR94h6tT XKWrF4t2M5H3mDSQ6iASWZGqFOxTZ+wpSjzpmr2flLkAQ7m3U0ui9FONer2vihI8kq25u/ S+ywm6TZbC0ztNrqDPdZGYwgCLKOYr13NUqlyihzYBYIT3dOFQcCaGIT0EIjxibSsjQYo2 NqzVeDO1e4qpsTS1F6PxXrgP4pb4GkK7ctVJxEE7P6EJjj8CX651oiYdXbBJdUTX/tZ0/j DsvOc/k+0LoaOreNUtHv2Jzd8zRFHjqaX3meCYPUnqR6WT/iJ8Vz+MC43nwinQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689607216; a=rsa-sha256; cv=none; b=SU7hJboTTS/Hmo22khTdOs8zu7UfhFEOBM6U1MMi+BWg91bHbPg762+46whsfdpTQAVUsR 8g2kCFI1gzkgJ5n9pFEzdK7j/AfJkugW3UeuqAxpQ1s3/NWhhTqRCBeozCJEEp3pVyny2x qleE6ZgD/S+vZyZzNO3a93ei04vuT0GSTlA3KmaHPi5ffI9PTKtWVC2AFRNPO5jUAIR+Fw SUhjCbNlQ1RM8UBi1BNwHdooJ5VWkyNA65KXYDng8TVJfZinxHGhCm9oaB/RLXBnb/iqBR TCgSJeQXD/kq/PJzaZaM3PP1ZJZPhrTcGbRk/Kd3bAQJSnjmjDC+YcyPkUVmww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4QkS3jLdzSrY; Mon, 17 Jul 2023 15:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HFKGGY038346; Mon, 17 Jul 2023 15:20:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFKGud038340; Mon, 17 Jul 2023 15:20:16 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:20:16 GMT Message-Id: <202307171520.36HFKGud038340@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: af20d58ef1e2 - main - bhyve: Remove an unneeded vm_get_register() call in main() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af20d58ef1e250f1b207a80834445e39b06fdc48 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=af20d58ef1e250f1b207a80834445e39b06fdc48 commit af20d58ef1e250f1b207a80834445e39b06fdc48 Author: Mark Johnston AuthorDate: 2023-07-05 20:59:20 +0000 Commit: Mark Johnston CommitDate: 2023-07-17 15:15:54 +0000 bhyve: Remove an unneeded vm_get_register() call in main() At one point the RIP value was passed to fbsdrun_addcpu(), but this is no longer the case. No functional change intended. Reviewed by: jhb, corvink Sponsored by: Innovate UK MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40988 --- usr.sbin/bhyve/bhyverun.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 2a2a0f028d9d..9fedab646002 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1218,7 +1218,6 @@ main(int argc, char *argv[]) struct vcpu *bsp; struct vmctx *ctx; struct qemu_fwcfg_item *e820_fwcfg_item; - uint64_t rip; size_t memsize; const char *optstr, *value, *vmname; #ifdef BHYVE_SNAPSHOT @@ -1539,9 +1538,6 @@ main(int argc, char *argv[]) } #endif - error = vm_get_register(bsp, VM_REG_GUEST_RIP, &rip); - assert(error == 0); - /* * build the guest tables, MP etc. */ From nobody Mon Jul 17 15:48:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4RMC0lY1z4nW1T; Mon, 17 Jul 2023 15:48:39 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4RM91lGXz3tQm; Mon, 17 Jul 2023 15:48:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36HFmTs1082668 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jul 2023 18:48:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36HFmTs1082668 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36HFmTLj082667; Mon, 17 Jul 2023 18:48:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 17 Jul 2023 18:48:29 +0300 From: Konstantin Belousov To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Message-ID: References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Result: default: False [-2.93 / 15.00]; NEURAL_HAM_LONG(-0.99)[-0.992]; NEURAL_HAM_MEDIUM(-0.97)[-0.973]; NEURAL_HAM_SHORT(-0.97)[-0.967]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; R_SPF_SOFTFAIL(0.00)[~all]; TO_DN_SOME(0.00)[]; HAS_XAW(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[] X-Rspamd-Queue-Id: 4R4RM91lGXz3tQm X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 > > commit 60381fd1ee8668ea1e4676a6128883d987cab858 > Author: John Baldwin > AuthorDate: 2023-07-14 18:30:31 +0000 > Commit: John Baldwin > CommitDate: 2023-07-14 18:32:16 +0000 > > memdesc: Retire MEMDESC_CCB. > > Instead, change memdesc_ccb to examine the CCB and return a memdesc of > a more generic type describing the data buffer. > diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > index 65a08aeba17c..bfaad30b37d3 100644 > --- a/sys/kern/subr_bus_dma.c > +++ b/sys/kern/subr_bus_dma.c > @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, > @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, > + mem = memdesc_ccb(ccb); > + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, > + flags)); > } This makes kernel not linkable if CAM is not included into it. From nobody Mon Jul 17 15:48:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4RML62B1z4nVwK; Mon, 17 Jul 2023 15:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4RML566yz3thp; Mon, 17 Jul 2023 15:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689608926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfQZVDV60D9ZXPKHe9ESia6OlRaVtc+ykqgCcvmCr20=; b=J0WsAHM2zCghuWqn1cYRPJXvaGK8NBqP5E/jFPmiRwRLXYGjQdRlPjOTFY2jsCycTo1fa3 iFoBBp7GiZo2XymloTd886UliIlEnmgG6HAYAbgsn4k+zy6b6EtxslbTq9JGzZPVZAhtcT DjfT47lubODiQXY87qe7VofB/p1Ch40jOpWGIYGqEkPDHygkWabw/95kfGWMUsQEKi+EyU BNzIdq+cOKq4LfoYygqStIyVSTJQxYhitnp6r0ypeBgP1WH+81xEHJ+r+NdJpQalNtyDmB 1jRAjqsq+wsH/ctOudDz6G36VQPDiGSuny6w/9uSWk18agiNxu2FQROjzskutA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689608926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KfQZVDV60D9ZXPKHe9ESia6OlRaVtc+ykqgCcvmCr20=; b=VUwhU7Nfvv4PNhbDinxFm5gPHIyoawC11ylM8Uq6ZaLfvZXrb4+P/H76cdj3JQZAXSTegh ZSHrZjvMw18F/7MbE3+iAy5nYxZkxtOEsJtQ2GU4v1HwjOU4NF3dc+DGo+eO0YGu3tQ1I7 8kT2jYElXVN43A9G0pebXhv48P8eYldK+bp7MSBwn56mcXrMyRi/aDD2BkUJUAmeXPlWDw AEkGUU6m4OkStuVbr+aORcltRcTK0BnyHNEbWjKFJ4iQIE4J178NtklYM7xByOLytYnlZz 4Bu6gKsnBuYJYHcKRQNDj1Td1pFUvUEKi0I4ggPfU6R1VUrKwl8ToLeZYABn/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689608926; a=rsa-sha256; cv=none; b=glDN9+vbaFh0+nVtL9YU8RxXQoSqEcfjCa2wSmeeRXPeH5DpaJw2okZ0kF+gcru7Pt6THU JScRZ/W5hzXiu+wAnoVIBQGfOnsb7k2geDEFAnG+PgHuirc/0FhkIQSaQDgrRBunH2sYqg Drny930Yteu4XgUh09TsOHyz53+/N5tEj3l8np2u2J4GvNj6p4NDs6Mh0DHP4aWS2jlr5M xgDSGvsaiJ+zOv3nIjlEu6GSmlP+t3LrlXJFfPOwo/CgwxWu4QwITQq8RWJR8ZBHA33KpS PPZ1FPJpCbgUPKF2gmaKRlmHDljmLe82JzQvSj/ww2gHa3zctDT0ie5lHCFgqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4RML43zPzVRw; Mon, 17 Jul 2023 15:48:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HFmk4x079999; Mon, 17 Jul 2023 15:48:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFmkKw079998; Mon, 17 Jul 2023 15:48:46 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:48:46 GMT Message-Id: <202307171548.36HFmkKw079998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d6e837c7225e - stable/13 - login.conf: document how to specify env var values with commas List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6e837c7225e1e4853a186ed42dba183057704b3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d6e837c7225e1e4853a186ed42dba183057704b3 commit d6e837c7225e1e4853a186ed42dba183057704b3 Author: Ed Maste AuthorDate: 2023-06-28 18:50:49 +0000 Commit: Ed Maste CommitDate: 2023-07-17 15:48:28 +0000 login.conf: document how to specify env var values with commas As of f32db406504e quotes may be used to specify login class capabilities that include commas. This is true in general but is particularly relevant for setenv, a comma-separated list of environment variables and values, so mention it there. PR: 236204 Sponsored by: The FreeBSD Foundation (cherry picked from commit ab2f6ae8d1742f57552c37425e9cab8499d2d4ea) --- lib/libutil/login.conf.5 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index 7276863f53a9..cf8787495a18 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2021 +.Dd June 28, 2023 .Dt LOGIN.CONF 5 .Os .Sh NAME @@ -247,6 +247,7 @@ the login session will be terminated. .It "requirehome bool false Require a valid home directory to login." .It "setenv list A comma-separated list of environment variables and" values to which they are to be set. +Values containing commas must be quoted. .It "shell prog Session shell to execute rather than the" shell specified in the passwd file. The SHELL environment variable will From nobody Mon Jul 17 15:48:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4RMM6c4Bz4nW8V; Mon, 17 Jul 2023 15:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4RMM5kbNz3tcw; Mon, 17 Jul 2023 15:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689608927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aSV8fHoRFZNdanEMPKVDWsSclM+szZLIcrI7o6oAHj4=; b=JE7iecSGtsQ48Zq5Z16OZ1M50H6934ZY4vnV19yi0eJEM1D/07q87gAqQjhl03xA86pcV5 JdWeaeqitLKpbL+JvQo/PhcQE84/nBYlgeEQYijwqdUg94lOmpFTAp0WsLayGxV//hxkIQ TEx5hSV9V6S/ONRZY1XDUEkYIUMyvw3YVe307U5eLkjHA+nWlGYWhm9Yjb7TWCThctbEmT qzcErsG7/bOyhnOQaxCtFxKOL5C2H0ji40EegQCJrfFnxO8nA7w5GHUZgklx8AedKM2/MY J0iQYncQ0TFglBBtUGOJPw4/BVQ5f8btI1eu/NALQoqaSL6xo8pemKmWUHpfNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689608927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=aSV8fHoRFZNdanEMPKVDWsSclM+szZLIcrI7o6oAHj4=; b=E/Shcjb8Md890PkW0k+kOiG6sa7R7oEOZTS+sxW/zL23AriqMgpsPSugoyHjoQ34/oh4bw TAknDFckwiOO5C2Uy2LGv2IW6xNEHbw4qvaeL46mfaToQ7c6LoBjdlnEwqCuailpaNa/nC FzfKGer0IYfamWiRfyZzS7zclXKogXe2J6VyRWhYMrxkEzcZeCarsyx7Lf3uxr5/nxSBvq vtxPEln3Mpg63TPK9qdBOBLHKP6MaqES0zEgURYi/YSUzg2BRvMQtvoLcCvgt5KJEIYLPS h44njsr587ey08DbMRIgPEM9EaBQc0ekj3kOVzrupvpC6+yo1aJKB3vDpNEmDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689608927; a=rsa-sha256; cv=none; b=KVEj9pcxZXrLMVlqi55IxGLZGL4X5fUowmb21yNjRHtn4TTM083iHMxnuJor+oPfHMvaQH h5dk/VxdhcHu6OLkYJlYoJTbzQar/8NVOhyHoX+jXQ1ppM/2SEU2dQeAT08sV0XqbNq+wU IYmtuH0K5yYBGiN4q6VAGomyo+XA3hO1tvL2eE6zGy/dz7p0DFh41gJsIZR2CcKVkj2hKN n/O3ESkBx7uzN6wgxmHuwjUOOYA1MeXFKqdHgtUKqVFYqcbpP9DL7IsX8wNWk7GPDmyG9u kyK5bHmQAc8bGfLZzsYxL9Gf0EZup8Itk15j2ryCYB2Ja61KVG4tMNqgzMOy1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4RMM4pC7zVGr; Mon, 17 Jul 2023 15:48:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HFmlpV080018; Mon, 17 Jul 2023 15:48:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HFml3V080017; Mon, 17 Jul 2023 15:48:47 GMT (envelope-from git) Date: Mon, 17 Jul 2023 15:48:47 GMT Message-Id: <202307171548.36HFml3V080017@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: ed942d5a1738 - stable/13 - seq: combine asprintf return value checks List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ed942d5a173870e786fd422c9edfbe5037626b4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=ed942d5a173870e786fd422c9edfbe5037626b4b commit ed942d5a173870e786fd422c9edfbe5037626b4b Author: Ed Maste AuthorDate: 2023-06-19 02:10:32 +0000 Commit: Ed Maste CommitDate: 2023-07-17 15:48:28 +0000 seq: combine asprintf return value checks Error handling is identical for all of these failure cases. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5dae8905a5141e0cba1f4f3f94116440a5ce2abb) --- usr.bin/seq/seq.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index 50c6b6022967..e5350690c703 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -198,13 +198,9 @@ main(int argc, char *argv[]) * equal, it means the exit condition of the loop held true due to a * rounding error and we still need to print 'last'. */ - if (asprintf(&cur_print, fmt, cur) < 0) { - err(1, "asprintf"); - } - if (asprintf(&last_print, fmt, last) < 0) { - err(1, "asprintf"); - } - if (asprintf(&prev_print, fmt, prev) < 0) { + if (asprintf(&cur_print, fmt, cur) < 0 || + asprintf(&last_print, fmt, last) < 0 || + asprintf(&prev_print, fmt, prev) < 0) { err(1, "asprintf"); } if (strcmp(cur_print, last_print) == 0 && From nobody Mon Jul 17 16:49:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4SjX6XGbz4n4FK; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4SjX642bz4J2l; Mon, 17 Jul 2023 16:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z1RCJHjNdk3kEAvA0GjCNJmQxJAtjqFacN5b7tixxks=; b=Hf/L0Es5CHIiWQAp2m38iPcwk/aRKJP9PH876l7FI7xNvRZNJD22zp3ehtkzP4P+mrzlt7 DQvQZGU31cM67RNTTeuOVRumbrB+KmDXD5aRGEpVBXXq2hYONGdvtE9vtTK0pkCRHtHAxB HFtWsrbnUM78DIaKXmunN6b3ij6B2ebN3H+ug3mA1NbGAWnX91vtAhn3kxIoY3zsNlGiKH MXlsejs7jmJr8XDQdnOoaH9Fo9wAEIEyew3rc9j8KyGxcySMR/kKNsJ5sfHV22ov9jCEM0 89sjcBeGf/HzVx98zVBYRnsK3tor1ILSL4ZsS5URZ9RjjfYjFN59K36KRM5kzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Z1RCJHjNdk3kEAvA0GjCNJmQxJAtjqFacN5b7tixxks=; b=IlymLSc4XI5lpXcMSUQw++go0KTqVtJRUk5FcJ91vfIkMnqAZhDad5s9XfpA9lQR90OYiQ FJuspOEm34mBO8uVYOqQ+E5XWGt4OeOlv1OgoTCxIAt+vyi/CLUgS5ZdHtmwoYMa8kI0YT L+yiEiKlny5IkJJTOh3BtQPh0UTT1ospAynJkUBb7TM7dFxZbCx77Mwf5QAnSfbvL7o3R0 HBUhqh6+IbUyTSycrmJsNWhXOQxLQq7Uvn2KeNjXuaPL47GMOKz9jh/rwTHfyxlGePaqDQ Ao2GXuappm3Eq9x+EwPmy2SiWuYj+GkaQe26w2uJ7gdabTOW+bhBAEI2u6L8+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612576; a=rsa-sha256; cv=none; b=Orii2X0nrrcnvtWKVDO9b4cVgMObsLdrT7M7ye4ps78j4SLKPqEqN/y2iOdIuCdCQDA0Az nIMwO7u5/XbS3W12i3sjKvV3v3l71JykFm9ehi4aEqIynwQBak7MyiI7OMEPT2qHU+lrAt cYGBCyfpdM8fANAjasScdoz9+Mbm75m4pgFqI0WF4mhkfx2vo48/4bFr+rQrG4p0L0bXUL hZxmq8qbmEIuY8a6uFjR533muxn0iszj3hf020A5FfuozzMYfMbXVIpsjFLUcsztNqamoF Oy3cJyJ8+atI0xJYzVRhUXe8+ixWHG8Hun+afRBwUyTZrfbgpD0A8AxvXsa1Ag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4SjX57fszWww; Mon, 17 Jul 2023 16:49:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnaJW081314; Mon, 17 Jul 2023 16:49:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGna6W081313; Mon, 17 Jul 2023 16:49:36 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:36 GMT Message-Id: <202307171649.36HGna6W081313@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 3c4860d3eeed - stable/13 - hwpmc: add error for HWPMC_DEBUG without KTR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3c4860d3eeed3ef56be988ec1afdcfb2fba9f3e0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3c4860d3eeed3ef56be988ec1afdcfb2fba9f3e0 commit 3c4860d3eeed3ef56be988ec1afdcfb2fba9f3e0 Author: Mitchell Horne AuthorDate: 2023-06-16 16:38:26 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:45:38 +0000 hwpmc: add error for HWPMC_DEBUG without KTR The option is a no-op otherwise, but this is not necessarily obvious. Failing the compile gives the user a hint. Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40544 (cherry picked from commit 569f89b2f442e2187f750a5892a1662390364cc6) --- sys/sys/pmc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 1983dbb91578..2384a3a13919 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1070,6 +1070,12 @@ extern struct pmc_cpu **pmc_pcpu; extern struct pmc_driverstats pmc_stats; #if defined(HWPMC_DEBUG) + +/* HWPMC_DEBUG without KTR will compile but is a no-op. */ +#if !defined(KTR) || !defined(KTR_COMPILE) || ((KTR_COMPILE & KTR_SUBSYS) == 0) +#error "HWPMC_DEBUG requires KTR and KTR_COMPILE=KTR_SUBSYS -- see ktr(4)" +#endif + #include /* debug flags, major flag groups */ From nobody Mon Jul 17 16:49:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4SjZ0wQcz4n4LG; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4SjZ0BGXz4J7v; Mon, 17 Jul 2023 16:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zV3JR6us/voofn3Sr0l+ROB+6ERQV1Qh96m4+volaGo=; b=vvV7oJ2BX+HS88ktpYwhsx8JZQ0SdADQSYGyMbDmXtyweAeuI1bSpVivqmTTtqn5z0TF2F kurZw97IvOjoprRv8/t+5w7PdRqjqSzI6iaUxkejaIfWxoOdMVW0Cota5+1rAIH+I3Ae/W KljOh7DUqVVbtEMg/cL3SPooCH/Z17BGRZBQUbQJv2Ok9H7RDsZDfCaehvfrQgNYZh2GO2 5VoxFl4bD3xZGCO7JMrAGy477emnHMJL0cWHt1gG6yz9eVMtRWWvdi276QCC7nzNhbj76e AhkwIiuofv+rH3QMrQGutDGviD/BNkHYA+abucU6XTYz31iAhxtjWaEAftTHpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zV3JR6us/voofn3Sr0l+ROB+6ERQV1Qh96m4+volaGo=; b=IcaTFFTfyYEBibl0+0JcN5we58X1q7ciZ/BV8iQrmAsGOQ3IuhRNq11MctWbyJn1kYmuOL pbKD35IHisPSdCYUQ0on2MKxRWHPMJpMBGHq+sPpUENCaipiHjbuTM1vmHyDYN+mP1Ftf0 baltFIuKf4YF2alFG6Tyt08Ru/1ZfrUgC7nY0R4UjXipEfHLe/s+j+1GqA3vBJ7xVlcIK6 XsPZlIwyQ6/v1KQGsuKszW7qiRDI1FnOr+oWRXYeE7Zw9CGw5uscTQXy92uCtTkwDy3Mtg cu927c08IYBVPyDdoAoDQg9YXJlhJqcj6aKxyRBzwAuIgX0nasS1vQ5qNiO/6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612578; a=rsa-sha256; cv=none; b=ibKbB5AwVruMTFBxS4Arq72hfq9JHNyoMFdyPPoSk9PLhN1cMWEC7L9GPjc/ulkIgcCpjN 9EMMEquMNvjIQuh4PN4HmE2YK2ch2l59bHTxRiyfkcdOvIg48CB7Msfb3ycTjLbf2jUIBZ Ljk5otBMW1AcPQMfft5gBb0L7bfjKYsz6N2IniecTJ9LOtfkT/Wmi6nQsUGJ1qRmO165xQ cdvYA88kDSqq9OB5NqJ60e/fs0BJOvsLGgMJDrB1rhSFUY8634y1PfoyjIcUTEGa0iVi4D cGgVANctk/f8cZdkUWLg1u3b7/5Yofvca9qoZuHZK2/raesm97kpKGvUF5o1zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4SjY633zzX2f; Mon, 17 Jul 2023 16:49:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnbVY081341; Mon, 17 Jul 2023 16:49:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnb0M081340; Mon, 17 Jul 2023 16:49:37 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:37 GMT Message-Id: <202307171649.36HGnb0M081340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 35128d197dff - stable/13 - hpwmc: add __pmcdbg_used annotation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35128d197dff2949553f4d321b052024decab6aa Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=35128d197dff2949553f4d321b052024decab6aa commit 35128d197dff2949553f4d321b052024decab6aa Author: Mitchell Horne AuthorDate: 2023-06-14 16:30:32 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:45:38 +0000 hpwmc: add __pmcdbg_used annotation For variables which are only used in PMCDBG* macros. Reviewed by: jkoshy, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40288 (cherry picked from commit 0589e7059bcd238027953d1311137512cc6dddea) --- sys/sys/pmc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 2384a3a13919..12583e67b062 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1078,6 +1078,8 @@ extern struct pmc_driverstats pmc_stats; #include +#define __pmcdbg_used /* unused variable annotation */ + /* debug flags, major flag groups */ struct pmc_debugflags { int pdb_CPU; @@ -1194,6 +1196,7 @@ extern struct pmc_debugflags pmc_debugflags; #define PMC_DEBUG_MIN_CLO 12 /* close */ #else +#define __pmcdbg_used __unused #define PMCDBG0(M, N, L, F) /* nothing */ #define PMCDBG1(M, N, L, F, p1) #define PMCDBG2(M, N, L, F, p1, p2) From nobody Mon Jul 17 16:49:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjb1KGDz4n4Qc; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjb0Zj6z4JGl; Mon, 17 Jul 2023 16:49:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n7JvITqCZrBJ9Ox0lPd5bWRVYJ1Fai6/ial3jkC5iIM=; b=hEsJe0nTqznK/Uw7MqYT8diuGCgLEJ/PPJy9Q0We9c1Pd5SbG3cdibjMpRbpgTOgpuXJfm fp2tD/a0i7ORWBJE8GBpQdEcYnEuKynkc2Byut2zPqYMXpNMHgBrYlJMsDjCh7534XABEg MTuqdD+rjCBQYAGqgDKU3SlwPE5mKxBny9oh3WJ2c8h/Zl7HwsbfSI2XxsQgsHitjQtNVG IqxDo/tS3xNqO+o0meZsRjkkhKSmdTS+LaHIDp1TTZGiZiVinKbnw5suFcPBLDz3gWZE98 eb1/QIOhu4vxx/MFIXDVGJfxXG+oZcfgzHz8FTFUzHVHds/khauvY6W9ES6e3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n7JvITqCZrBJ9Ox0lPd5bWRVYJ1Fai6/ial3jkC5iIM=; b=Dhgnc3JzWE7vZ0klkR+XcNZQ6lNWM2R7Da5hTxwnyCswcT0zZawqgJRqtnlFEsjWyf7p7e qnUKZ9xn+JtPRLI7gmsNwQ8D68d3GhpMrWtWAGAztZx88QkeSYp5YjHNiV8m17UDAeACmZ 24nTZtL+wEaQ0/ZTq+cjZt2s3aRlC93qgn279WNNYvU3WuNi00j765f+78aBbEA3LvU1ef AQYoJ687BresQwIpDrap7zjBqerQWeHqVKHupC4ZmAjh2YneEnyH7gMDZwXKYw/1PWoebc TWld+W7OSzchnDAlPOoj6SaBsDtBHR7L+vlqYzNz8C6mCzellSyosxikcVit4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612579; a=rsa-sha256; cv=none; b=X7+iOBYWRfQ5NFAQVsGv8kbtEvIMNQyYwOPJgnsG/ej3n5QIOftrKy4etBx/r2Msylnu7y DniKs916YmO3o9IngRGNYmBHQ8WK9D8iz7OLxntjIrNIQZGTLDLSxK2AbWso83P/bsY60N UWLtnmq6NPZ+q+IPIKDPHG1YSNHd0CwugM8Z7OIfiMAA2dhLl7SJ8osOC0t6IK3oKdI5Q0 0Zm0ZSXR/svyr04gxLREN/DH47nDrpetzM8Pvuq3zYFNib6GeMGEGR82Oe67DJ2XJYjGni NOyD76tzOeXEgZD/q5pU/i7DkmcV5e2xRHXHw52IQK9nAbGoJhRjoANZInGOwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4SjZ6mWczWlX; Mon, 17 Jul 2023 16:49:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGncQx081360; Mon, 17 Jul 2023 16:49:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGncqK081359; Mon, 17 Jul 2023 16:49:38 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:38 GMT Message-Id: <202307171649.36HGncqK081359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 9ebf3b43bb64 - stable/13 - hwpmc(4): remove paragraph about Pentium Pro handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9ebf3b43bb649fc079f4898ba8bc8c0b4503a078 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=9ebf3b43bb649fc079f4898ba8bc8c0b4503a078 commit 9ebf3b43bb649fc079f4898ba8bc8c0b4503a078 Author: Mitchell Horne AuthorDate: 2023-06-16 16:34:02 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:45:38 +0000 hwpmc(4): remove paragraph about Pentium Pro handling Support for these CPUs was removed in 2018 (e92a1350b50e). Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40541 (cherry picked from commit 0a0c599ab9a578dd175e626144eacdbb4c5ac6bc) --- share/man/man4/hwpmc.4 | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 5b3353ff935d..08edb6a16faf 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -480,28 +480,6 @@ PMCs, then the driver will reject allocation requests for process-private PMCs that request counting of hardware events that cannot be counted separately for each logical CPU. -.Ss Intel Pentium-Pro Handling -Writing a value to the PMC MSRs found in Intel Pentium-Pro style PMCs -(found in -.Tn "Intel Pentium Pro" , -.Tn "Pentium II" , -.Tn "Pentium III" , -.Tn "Pentium M" -and -.Tn "Celeron" -processors) will replicate bit 31 of the -value being written into the upper 8 bits of the MSR, -bringing down the usable width of these PMCs to 31 bits. -For process-virtual PMCs, the -.Nm -driver implements a workaround in software and makes the corrected 64 -bit count available via the -.Dv PMC_OP_RW -operation. -Processes that intend to use RDPMC instructions directly or -that intend to write values larger than 2^31 into these PMCs with -.Dv PMC_OP_RW -need to be aware of this hardware limitation. .Sh DIAGNOSTICS .Bl -diag .It "hwpmc: [class/npmc/capabilities]..." From nobody Mon Jul 17 16:49:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjc6NPbz4n4Qw; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjc1h3xz4JHK; Mon, 17 Jul 2023 16:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upBNkolmLu36qTqJJvn+WZmkXlfpiSM8A3o/uG9VHwY=; b=Dmf+UrSuqcjhWbMQ0s9yzauBKrtTZaI268RZZgXxnF62iRlnYjiCdQx6JXYLxAVzy7YVLe l+HTEdfyxEx8MVdLFFgwzA6qVlEoixpWOwTOFXvhsDr4H1jjQ8COGooVtH5RmjGn5m92w3 1jnRi93QDhUyZ1cJV+/PMvhR9fFN4VntB6wYTrlU9uSUQb6gNpo4v1b5u0dekqFI06p7qE gK56heUapluQadfDiWR0LtYJ9eb9jvcWDOQmD8FtCrA+JXRNLxgrGz8rvTHkDqDEXJy9CG QnZ+PIhvzmNzXsU08EW49qQHUEdpLjr1AM/P7umxMfupLxh5lry9jTwSG68zwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=upBNkolmLu36qTqJJvn+WZmkXlfpiSM8A3o/uG9VHwY=; b=wlfcaQjvOlmugmAykY1HzCVP+g8SUCUAVNrl4sGaA1Ifeu8IhcF8MKcT0bvd+LU6ZEZHfU h6pxTo90D0LTcq3Hsc9E3Jgol3V0V7hGnRu6VmsLwOpXA2ZSXyocD6MrbwJMM0cvl01bwA zoxi/H8PSVS6r7OpeqcfFCus5nJVZj1Y6S55OACXN4+NYlr2GqAxLutzIwOnMnPEL6bXis ztWbWp18phxVSsP2o7bcgHGy4UfgGrX7lDy8FYaoshjIJXfLqQuXKphCuvK02PYW7SsDiZ wqC2Xa6bsq6dGsE0Ii27wuH4iHmY2KXIfBveS4GUIsfOID7i94hOyFHD1+u38g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612580; a=rsa-sha256; cv=none; b=NFU4qSY1JgmreKVCN6Iw4zG2uPtdAirfxC5zrjvbErS93z5eTpK/aPkVS50/0XyXihzujf 59oz6gybuMikeS0I2SipcWatPUJvRQ3WOxiT0mNueUlbUzdB6Yj1IhRdiJrNYmiwJvbZ2L dKEDAgGVtyOFA1oRgOMFbCjw31w3+DXanO3tLsKNSrqkP6nN53+S+tyn0t0EH/vAfxPHZI OLqEiEhreva8tqhqPxXEB9ZqhUNrCtlSIFzxpZ9HImnKVbmSwoeh1+klYY25QhoTrdKqpQ XvXkRk8kY9U8Y/pXYuyaLhFEUb8sVesFPPSqyCKtHkFuxrwfu056x8rB6Hfpew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjc0nMszWKc; Mon, 17 Jul 2023 16:49:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGneD4081379; Mon, 17 Jul 2023 16:49:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnepx081378; Mon, 17 Jul 2023 16:49:40 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:40 GMT Message-Id: <202307171649.36HGnepx081378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 387ee93e0794 - stable/13 - hwpmc(4): more detailed SYNOPSYS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 387ee93e0794d8812e276745de148292bedf8ccc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=387ee93e0794d8812e276745de148292bedf8ccc commit 387ee93e0794d8812e276745de148292bedf8ccc Author: Mitchell Horne AuthorDate: 2023-06-16 16:38:03 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:45:39 +0000 hwpmc(4): more detailed SYNOPSYS Include some boilerplate similar to other section 4 man pages, describing how to load the module at boot-time or include it in the kernel. Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40542 (cherry picked from commit 0a1a48148ccd561464d643c05597cec2ae9e88b8) --- share/man/man4/hwpmc.4 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 08edb6a16faf..6bd5d571793a 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -35,11 +35,27 @@ .Nm hwpmc .Nd "Hardware Performance Monitoring Counter support" .Sh SYNOPSIS +The following option must be present in the kernel configuration file: +.Bd -ragged -offset indent .Cd "options HWPMC_HOOKS" -.Cd "device hwpmc" +.Ed .Pp Additionally, for i386 systems: +.Bd -ragged -offset indent .Cd "device apic" +.Ed +.Pp +To load the driver as a module at boot time, place the +following line in +.Xr rc.conf 5 : +.Bd -literal -offset indent +kld_list="${kld_list} hwpmc" +.Ed +.Pp +Alternatively, to compile this driver into the kernel: +.Bd -ragged -offset indent +.Cd "device hwpmc" +.Ed .Sh DESCRIPTION The .Nm From nobody Mon Jul 17 16:49:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjd3WZFz4n4df; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjd34wtz4JSJ; Mon, 17 Jul 2023 16: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=1689612581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A6APlKOpQjoe6zSviCoWfxp1ELHULMtyHj+cgOG7gbY=; b=IoV2IzwVvKFy7FP1E3703d1AW27BShCmwL1MD104SUx63Te2usJApGWi0YOi5BuP6cCApf v/3wIKMKtbAYrGgHGwkEpWIKP2NeWNyNRv5s6QIU/GQHN50HBxjVMuAPWPI1xRhB8HE+Rz 5ucE2nD9q/cvFwpSX65PPXSBNENwmBbwMvO98Z/S786x+ClXrHHjN3B+n7AT9J1mc/VlRu EV3i/c9Aiek17vluhqEHSBifa3FxlPWbJdl8mXTBBQ2qxZFJlf4XAfxaO9g9dWNZQM5MJ0 4YDTSq6BIXqUcrWGzujGwJ2Leb8EqJSA1tZL2zbbePEHGyQXOZWo6VcRuAT8fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=A6APlKOpQjoe6zSviCoWfxp1ELHULMtyHj+cgOG7gbY=; b=mUMNTZTHcdXl2N+uwR6qD/oLBych1o1uPRP9gI+mjHV9zfG7Zo8wwHcFj0d2rxBFFNMBlh +sTlO0qv40LxzzpSTpqGib9QQOdLweK+9/ba6mRm5/OuwNHi/hEA4dC2e8to+cSl3MZLc8 osRx5XLY9+c8rWVe+SQBbmNk5YWFgO0dqK+sOQ3WesWx1y96HQWr+4Q0dWTfD71j92yhmm fCay7aGYsuNjIE9V+Q4lXJQfURQQnDUA6dXNXMzo2iBnieHBYyBYGnfLsXHLIm8LH5zqA9 0ikY0JgeOZ384j0yXWx7gHFebkdUZ/lTnbQS0sBAt6/F/EeSJguVqNNKDaMDHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612581; a=rsa-sha256; cv=none; b=XtvuhenDWwL8L47nw+BfDmLr7lntlcI0f8di1qlOFw8wTrzqwp5VSTmcAYkaoPnTd/TEAJ MlbQl46nw/HDm8FGYQZmSIjIQJNqZLivl/odo9j4hqoQUJ42+U8lBDIInm2pDpgisfL8ed LVsVgtGb4VJgHx35JuK7LHVX9spNa4x6/JG/FZICxGGwKbsHPWczdQlIIOmbhWn1N1SwC4 8QW9WjvNBhmROKtxRcNTB1wo8znJg9w/63w5KftBxwkg3uR7j/t6SgmmmPeXntGvpNfeIn fQnl1jUUC6OnHUXmEImMDXBe1N+59g5HAPSzI1kFLLHuQNmP5Py/tnuzRaetUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjd1kNCzWKd; Mon, 17 Jul 2023 16:49:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnfYc081400; Mon, 17 Jul 2023 16:49:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnf4a081399; Mon, 17 Jul 2023 16:49:41 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:41 GMT Message-Id: <202307171649.36HGnf4a081399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: f7df2c03753a - stable/13 - pmc: clarify and strengthen statements about API/ABI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f7df2c03753aab249c075f5895df1e6fc591eaf6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=f7df2c03753aab249c075f5895df1e6fc591eaf6 commit f7df2c03753aab249c075f5895df1e6fc591eaf6 Author: Mitchell Horne AuthorDate: 2023-06-16 16:38:19 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:45:39 +0000 pmc: clarify and strengthen statements about API/ABI - Make it clear that applications are not only encouraged to use the pmc(3) library, but use of the hwpmc(4) interface directly is a use-case we do not support - Move the COMPATIBILITY section above PROGRAMMING API in hwpmc(4) - Drop statements about the driver and library being "under development" Reviewed by: jkoshy, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40543 (cherry picked from commit 3977781b987e369a9fe23bb642b9680b0a3887c1) --- lib/libpmc/pmc.3 | 8 ++------ share/man/man4/hwpmc.4 | 27 +++++++++------------------ 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/lib/libpmc/pmc.3 b/lib/libpmc/pmc.3 index 4bf2907db129..8cc7275bc338 100644 --- a/lib/libpmc/pmc.3 +++ b/lib/libpmc/pmc.3 @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 10, 2021 +.Dd June 16, 2023 .Dt PMC 3 .Os .Sh NAME @@ -474,11 +474,7 @@ In order to ease forward compatibility with future versions of the driver, applications are urged to dynamically link with the .Nm pmc library. -.Pp -The -.Nm pmc -API is -.Ud +Doing otherwise is unsupported. .Sh SEE ALSO .Xr pmc.atom 3 , .Xr pmc.core 3 , diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 6bd5d571793a..3a4be77085bc 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 2, 2012 +.Dd June 16, 2023 .Dt HWPMC 4 .Os .Sh NAME @@ -288,14 +288,15 @@ Non-disabled hardware counters in such a row may be used for satisfying system scope allocation requests. No process scope PMCs will use hardware counters in this row. .El -.Sh PROGRAMMING API -The recommended way for application programs to use the facilities of -the -.Nm -driver is using the API provided by the +.Sh COMPATIBILITY +The API and ABI documented in this manual page may change in the future. +This interface is intended to be consumed by the .Xr pmc 3 -library. -.Pp +library; other consumers are unsupported. +Applications targeting PMCs should use the +.Xr pmc 3 +library API. +.Sh PROGRAMMING API The .Nm driver operates using a system call number that is dynamically @@ -526,16 +527,6 @@ The value for tunable .Va kern.hwpmc.nsamples was negative or greater than 65535. .El -.Sh COMPATIBILITY -The -.Nm -driver is -.Ud -The API and ABI documented in this manual page may change in -the future. -The recommended method of accessing this driver is using the -.Xr pmc 3 -API. .Sh ERRORS A command issued to the .Nm From nobody Mon Jul 17 16:49:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjf4pC1z4n4Y3; Mon, 17 Jul 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjf3t41z4JWW; Mon, 17 Jul 2023 16: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=1689612582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=md2QhzK/PuBxe2eSr99ztQgR8/KWzUxj9BhFZhyf5vQ=; b=wCGC8Vi/OUF2e+Zg31f6h4PRwk+LJRQP4tpac88LeTWcpx33mkNS9A4+00AzA1bB4B7Ha0 Nt/UYg2Q4lD+7eIy552zXoM9aXKsYS9aXhN0kmPpnVGqGXL5vyQ0hlHa58v0fi9yY4LR7q KdTrCz0Hxd7fwYSm7//XxRt/SmMgcKqAo1mRKnxqlXrtk59XqaZozbpd3ybTJwy+x6HVir j8Y3T9i/f6pOtLQlP4evlgSJlSGV/JQ/95NNMUqErpuDACWGMhxR8GTBoGYNI68DU7FJb0 U7TMCKvvQ0uFRc+6lu4070t1HB8lhbxY7LCFsctEkLx1dO0muMpoKXRpfQxjXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612582; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=md2QhzK/PuBxe2eSr99ztQgR8/KWzUxj9BhFZhyf5vQ=; b=IzJrA06IZL4DZ5VEo4v6CcYEk+snuObnMZf/nky3UVjVm4NlVh0tD045nO0IAqAxvQu/uJ EExlHaq63bhdHTLb+izf5O3v6EfvaQtQPbdfZx1wzAym4fEd9Dp0wyTgUj+YQh2M8raHGH 3S0YzuAUro4DA8290ihmYlODYP0qXx6OYLuTsXKtfniJqY9btcRiEpy1deGTUAq+3U1jeL u2XX1wg9FnMsvcWZr1fcR9sLGm+IMVNSRqAFMmY32obnmYeoOZSAg104g+IyOOQfstbUuT Y66n1FqA5ADltl3bX7g2D+mfYus2Tr1XP0tOYp/PYcdj2o9nIoThYwmHjcqCEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612582; a=rsa-sha256; cv=none; b=MRUcqnDWoCS/40B/D3+Zxh/zyLAtnXK4oFR3UzJLuoMhrMZSRwg4jXt6uFmV9lFI5hTbn5 sFfaWgj90GE8gMESpG5wV+Vu5VoB82H0QE0PUObEQl+aJ5/IFio2eSKZvBMiIRhBlAf7fP SJF9RUVv0HPUln51QDGA1WRuGfW1S9svzTAHegGEQqG3INKh/QTl9COprel5lysfNHbMRK s42047BGgf2pSFlw32nrBZU51aYTOVaOhXMFLAiIAOAhpeReN53uF2v2QTixIeN0oNVR9P E79C2sNmskxl+8gQw/kvpMOWtY2JMZMDZCve+q8DBWFBCWTxepvp8NTMz35z+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 4R4Sjf2ftxzWwx; Mon, 17 Jul 2023 16:49:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGngBi081421; Mon, 17 Jul 2023 16:49:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGngUL081420; Mon, 17 Jul 2023 16:49:42 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:42 GMT Message-Id: <202307171649.36HGngUL081420@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 11b3648c4cbb - stable/13 - hwpmc(4): document debugging options List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 11b3648c4cbbff70b4e74b9ac43546aece713b60 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=11b3648c4cbbff70b4e74b9ac43546aece713b60 commit 11b3648c4cbbff70b4e74b9ac43546aece713b60 Author: Mitchell Horne AuthorDate: 2023-06-16 16:38:43 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:48 +0000 hwpmc(4): document debugging options The debug options for hwpmc are not documented in detail anywhere, and setting it up was error-prone the first time I had to figure it out (and each time I've had to remember it). Add some explanation of the required options and describe the kern.hwpmc.debugflags sysctl format. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40545 (cherry picked from commit 5fc97cc32553c4073c7dafd67a2d489b8af8563e) (cherry picked from commit 89240e0ab60a29a47c9af9f952a09a7f2e1bb72c) --- share/man/man4/hwpmc.4 | 140 ++++++++++++++++++++++++++++++++++++++++++++++++- sys/sys/pmc.h | 6 ++- 2 files changed, 143 insertions(+), 3 deletions(-) diff --git a/share/man/man4/hwpmc.4 b/share/man/man4/hwpmc.4 index 3a4be77085bc..bf9cb5e9e5e3 100644 --- a/share/man/man4/hwpmc.4 +++ b/share/man/man4/hwpmc.4 @@ -1,10 +1,12 @@ .\" Copyright (c) 2003-2008 Joseph Koshy -.\" Copyright (c) 2007 The FreeBSD Foundation -.\" All rights reserved. +.\" Copyright (c) 2007,2023 The FreeBSD Foundation .\" .\" Portions of this software were developed by A. Joseph Koshy under .\" sponsorship from the FreeBSD Foundation and Google, Inc. .\" +.\" Portions of this documentation were written by Mitchell Horne +.\" under sponsorship from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -56,6 +58,17 @@ Alternatively, to compile this driver into the kernel: .Bd -ragged -offset indent .Cd "device hwpmc" .Ed +.Pp +To enable debugging features +.Po see +.Sx DEBUGGING +.Pc : +.Bd -ragged -offset indent +.Cd "options KTR" +.Cd "options KTR_COMPILE=(KTR_SUBSYS)" +.Cd "options KTR_MASK=(KTR_SUBSYS)" +.Cd "options HWPMC_DEBUG" +.Ed .Sh DESCRIPTION The .Nm @@ -527,6 +540,126 @@ The value for tunable .Va kern.hwpmc.nsamples was negative or greater than 65535. .El +.Sh DEBUGGING +The +.Nm +module can be configured to record trace entries using the +.Xr ktr 4 +interface. +This is useful for debugging the driver's functionality, primarily during +development. +This debugging functionality is not enabled by default, and requires +recompiling the kernel and +.Nm +module after adding the following to the kernel config: +.Bd -literal -offset indent +.Cd options KTR +.Cd options KTR_COMPILE=(KTR_SUBSYS) +.Cd options KTR_MASK=(KTR_SUBSYS) +.Cd options HWPMC_DEBUG +.Ed +.Pp +This alone is not enough to enable tracing; one must also configure the +.Va kern.hwpmc.debugflags +.Xr sysctl 8 +variable, which provides fine-grained control over which types of events are +logged to the trace buffer. +.Pp +.Nm +trace events are grouped by 'major' and 'minor' flag types. +The major flag names are as follows: +.Pp +.Bl -tag -width "sampling" -compact -offset indent +.It cpu +CPU events +.It csw +Context switch events +.It logging +Logging events +.It md +Machine-dependent/class-dependent events +.It module +Miscellaneous events +.It owner +PMC owner events +.It pmc +PMC management events +.It process +Process events +.It sampling +Sampling events +.El +.Pp +The minor flags for each major flag group can vary. +The individual minor flag names are: +.Bd -ragged -offset indent +allocaterow, +allocate, +attach, +bind, +config, +exec, +exit, +find, +flush, +fork, +getbuf, +hook, +init, +intr, +linktarget, +mayberemove, +ops, +read, +register, +release, +remove, +sample, +scheduleio, +select, +signal, +swi, +swo, +start, +stop, +syscall, +unlinktarget, +write +.Ed +.Pp +The +.Va kern.hwpmc.debugflags +variable is a string with a custom format. +The string should contain a space-separated list of event specifiers. +Each event specifier consists of the major flag name, followed by an equal sign +(=), followed by a comma-separated list of minor event types. +To track all events for a major group, an asterisk (*) can be given instead of +minor event names. +.Pp +For example, to trace all allocation and release events, set +.Va debugflags +as follows: +.Bd -literal -offset indent +kern.hwpmc.debugflags="pmc=allocate,release md=allocate,release" +.Ed +.Pp +To trace all events in the process and context switch major flag groups: +.Bd -literal -offset indent +kern.hwpmc.debugflags="process=* csw=*" +.Ed +.Pp +To disable all trace events, set the variable to an empty string. +.Bd -literal -offset indent +kern.hwpmc.debugflags="" +.Ed +.Pp +Trace events are recorded by +.Xr ktr 4 , +and can be inspected at run-time using the +.Xr ktrdump 8 +utility, or at the +.Xr ddb 4 +prompt after a panic with the 'show ktr' command. .Sh ERRORS A command issued to the .Nm @@ -752,8 +885,11 @@ operation is not being monitored by .Xr kenv 1 , .Xr pmc 3 , .Xr pmclog 3 , +.Xr ddb 4 , +.Xr ktr 4 , .Xr kgmon 8 , .Xr kldload 8 , +.Xr ktrdump 8 , .Xr pmccontrol 8 , .Xr pmcstat 8 , .Xr sysctl 8 , diff --git a/sys/sys/pmc.h b/sys/sys/pmc.h index 12583e67b062..153d24ca250f 100644 --- a/sys/sys/pmc.h +++ b/sys/sys/pmc.h @@ -1080,7 +1080,11 @@ extern struct pmc_driverstats pmc_stats; #define __pmcdbg_used /* unused variable annotation */ -/* debug flags, major flag groups */ +/* + * Debug flags, major flag groups. + * + * Please keep the DEBUGGING section of the hwpmc(4) man page in sync. + */ struct pmc_debugflags { int pdb_CPU; int pdb_CSW; From nobody Mon Jul 17 16:49:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjg5bwBz4n4hJ; Mon, 17 Jul 2023 16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjg4gNNz4JZ8; Mon, 17 Jul 2023 16:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hk56VS8n5K3cqrCUg/I4k0Y/8zNsg0LRW01ohEv5VGQ=; b=piNyaplEghLIufqxTLk4Yyow30f3iCYmtlTbA9TUJXLnwDV5HaScbwzkCCfkv1uLxMRrdS pcyVxzFJI5i5dUHgT3U+M/OQz7iW4i0dEN/ZtBEGRVOWYTvHV843FSa48Il+QmCkkzlcIo OFbd1qvUlvd5zgdull/YFqiLGwV2Kj4922s7LnZRPgGsDDyWAGCUIwLaXuRehDG2maxfhF 3GstF5t2reZuwAzQqVnh7FQOnjVuaNSAEorU2mTiZrEri7lwtd+cjfc/ra9tGC/HJTLyuy QKokuh7dceBX3iZKxgQ5ADRzhBEHOnheFg3mAkFrNZOl5E7WjvuU171csztmZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hk56VS8n5K3cqrCUg/I4k0Y/8zNsg0LRW01ohEv5VGQ=; b=f/N70jeM8G83ojcQ2HVzXtjBRHk9ma6UYAoHapT7yK5GzOfkslfN0Z6noFh9MY8wLN/CTD 4a6ZgRwzQGxDiK2sG8V0pmfg3ylwdeCS31KK8dd1U8odipx8r74Ega2RbP34Gf+lMdttsG AEIU+4q068k+tlNAhhiliyRHbYeEGvHektxvnCsyh2apVKkbW0mlYeub/j01tsFRV5+MtD TDlxHhnEhkmpuVOepknhPdL8sVa4Sl1G6dHLbfaY7cRmGdV+ctnwcBKXS/5odgvpxkTvOm 4DSSq1aAayyKYZueVs0adHbCzhmntsqC8/6/RVgYIVOSnOgCp2p1h/pdk7+KLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612583; a=rsa-sha256; cv=none; b=awjHVw6nAYwX1WYVBIGymTTOe/LpIgfNvIS4QkKQoYgg9yFeng2dBcCVZrH2q4OwTR7DOm tmINOWkN5Il17hJNucepUxtCkNx917DHDvQb/5WUjtuq+R5TJ4wTmQhijqKYj+sPZKOUyL AtWXdgwNlujrzsJcbKr01NmBxzn1zbDGzLoup5iPVe3SJB6w3cbR9GyeFSNSqqIPHh86tk kcoLSWsCeJ4dtS7zjHoH3/udpuYAgu2EQDM1Hrj/XbcEurxzCgYGQWySUIaJEnb1EX/3GU rASXFUnP68L3T4BBPtTfyfknPHIL1/vWAVXH4nUstX8kkeQBMFjqk7t4GMuCBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjg3f2mzWjS; Mon, 17 Jul 2023 16:49:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnhZ2081446; Mon, 17 Jul 2023 16:49:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnhas081445; Mon, 17 Jul 2023 16:49:43 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:43 GMT Message-Id: <202307171649.36HGnhas081445@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 5a421cbb9f8e - stable/13 - pmc: clean up remaining Pentium man page references List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a421cbb9f8e4f0b7bf32a939c98b29d253b8f93 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=5a421cbb9f8e4f0b7bf32a939c98b29d253b8f93 commit 5a421cbb9f8e4f0b7bf32a939c98b29d253b8f93 Author: Mitchell Horne AuthorDate: 2023-06-24 17:09:00 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:58 +0000 pmc: clean up remaining Pentium man page references These have been removed. Fixes: d78896e46f1d ("pmc(3): remove Pentium-related man pages...") MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit ba84e87055de71452291e229f8087d612999da40) --- tools/build/mk/OptionalObsoleteFiles.inc | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 21440e6e9560..d099d5bc8850 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -7335,9 +7335,6 @@ OLD_FILES+=usr/share/man/man3/pmc.k7.3.gz OLD_FILES+=usr/share/man/man3/pmc.k8.3.gz OLD_FILES+=usr/share/man/man3/pmc.mips24k.3.gz OLD_FILES+=usr/share/man/man3/pmc.octeon.3.gz -OLD_FILES+=usr/share/man/man3/pmc.p4.3.gz -OLD_FILES+=usr/share/man/man3/pmc.p5.3.gz -OLD_FILES+=usr/share/man/man3/pmc.p6.3.gz OLD_FILES+=usr/share/man/man3/pmc.sandybridge.3.gz OLD_FILES+=usr/share/man/man3/pmc.sandybridgeuc.3.gz OLD_FILES+=usr/share/man/man3/pmc.sandybridgexeon.3.gz From nobody Mon Jul 17 16:49:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjq2b6vz4n4Vs; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjj1rVCz4JP4; Mon, 17 Jul 2023 16:49:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zx1xr7ecINdBN6C4wP8VaKdUTVDfzD22Ha/BGsyaeQE=; b=ew1xp1SbJAqgItZLLsYnMZQ4nAtRUhPCuP0wjh+P2sJzAh5KBoiaQkXPqfmFvWbLBqeAuF 99m9U8X8F3Xy/4qaO0vVEKW7r1n7AYP+G8oTonG4/BXg3kNKh/reVQHs7jzkh3FjpWBZi1 EyPcJT2+7vQ9zPwYaePqo+BfMwnoSdhAjMlE+WThfsrvEMkgf3QQXLVwFQtwp3N0I7X1DK q4k+D2skEtzUNE0WVc9PLDMbsqnRPqJ1T7+WMxZWhycJ1a2iKfmuG+V9Lz5rBnPfmd5C0H 1qAYqbU5F/C8z9PYA6pQEUZq70BPXnMdWsQPyCukyG11Xqts4drVOAl2muqCBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zx1xr7ecINdBN6C4wP8VaKdUTVDfzD22Ha/BGsyaeQE=; b=pZ8y2P6TxLXLp4d1fel3RKHSWmQqpOCPDpBvhHpGoyWJkb9F+aERGdU8Xmitmli6d4Qt9l EfuoFficbEk0gWpuGvVCtfXg+FLvMs0sqb0mSi6r377SKVoG3rmBwV72WtzPUBbSfh+FgQ nGn/ha5gwkV3I6Dw4nzRTPMFnGS0bn7V+gOVWtRSTIcMYzsQCaLdyS2F/S5dGzpIgggEAi +vU8iXn7YEmtM+w3FokOtlCcnyhhS52FyyegC+W9jjcj81Px8qb0jm2ozjFWx9wuqgJLAN hLKQUWXCuRDWs86Aght4EVSWpcHTyJ+e8gtXq1i0A26GgUCkslqfWlx2StkKsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612585; a=rsa-sha256; cv=none; b=IGke4V1MSYA6JASPZp0K/obQrD07W3/RLeA3RPLUMvRCmwRyDx05QnhMTA5D3+Oz/267VL n28g3qhGH8IKf0FwdP4HmANICsyTv0zpsM9Ut6VdR2WBbQ3g5Q28DxZz2BdLyUQVA4Dr9Y CjdMjPNcMxFRcwW6xx5LA7lh5VoTCvFdLa+oIXYi0wRHZiW6MFz1VGK2Fs6nA9nJX1LYSA AcuRXj40mKj3zr+6zDEL1ak6hR4ca88MYRlMLBSCNlAXi5AcP51iyk+bXTOjOM5XUAg7o/ /tDaP1qzD7u73jw9Zbvay8pCKi7YROcfJK5eKweUtmNb/OrUviex+0ACS3Rjrw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjh6JP2zX2g; Mon, 17 Jul 2023 16:49:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnidb081465; Mon, 17 Jul 2023 16:49:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGninR081464; Mon, 17 Jul 2023 16:49:44 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:44 GMT Message-Id: <202307171649.36HGninR081464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: ea59846e314c - stable/13 - Remove GCC 4.2 include dirs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea59846e314c10e2df064fc3321b6b8b88d9e7eb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ea59846e314c10e2df064fc3321b6b8b88d9e7eb commit ea59846e314c10e2df064fc3321b6b8b88d9e7eb Author: Mitchell Horne AuthorDate: 2023-07-10 13:16:13 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:58 +0000 Remove GCC 4.2 include dirs These are present (and empty) on a system installed post-GCC removal. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D40878 (cherry picked from commit 8ab2da68283b7228f2caa7e7df173d6d46a224f9) --- ObsoleteFiles.inc | 2 ++ etc/mtree/BSD.include.dist | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 185349f3ec74..e06cf2cf8d7f 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -4557,6 +4557,8 @@ OLD_FILES+=usr/libexec/cc1plus OLD_FILES+=usr/share/man/man1/gcpp.1.gz OLD_FILES+=usr/share/man/man1/gperf.1.gz OLD_FILES+=usr/share/man/man7/gperf.7.gz +OLD_DIRS+=usr/include/gcc/4.2 +OLD_DIRS+=usr/include/gcc # 20200220: Upgrade of ncurses, shlib bumped to version 9 OLD_LIBS+=lib/libncurses.so.8 diff --git a/etc/mtree/BSD.include.dist b/etc/mtree/BSD.include.dist index d35b85f4249a..e6e061392729 100644 --- a/etc/mtree/BSD.include.dist +++ b/etc/mtree/BSD.include.dist @@ -179,10 +179,6 @@ unionfs .. .. - gcc - 4.2 - .. - .. geom cache .. From nobody Mon Jul 17 16:49:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjv6yZ5z4n4dv; Mon, 17 Jul 2023 16:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjl0QvJz4JTb; Mon, 17 Jul 2023 16:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ig2OIuMxbAq1d34uqoBHGQRv96IswxWLPYP7/MsOcXk=; b=ZkY4rKvFt7Zk0hm+vP5Jx0S59MhapGYeqVDcY7J98UizIwkfUE3UzLbaJ3CfF8G6tYE8qE 9B7jRxajA3QlzLWqQEspOLzECh2QWzznydnXNlBWARLm/e9ZoEmF70LZoyQI3HCbfeQ00y C2xzX8NEQ82btEaF6qbBdrLAxlP6cXfOFMHQ73maR4vud6sgljRF5ukee1LJe+g9gHm4uw 19G2UMg21mYjlWRpjXGH8Vi93wc+FPowtUPcRlklQxWWapYhCVMWq1USMoECEfyc92oiya vs+j2yFgZRCeA4LrhY+uLD8kGAqjn33jXYJjIqpV6AKguCgB1yM1ITE1B9pFaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ig2OIuMxbAq1d34uqoBHGQRv96IswxWLPYP7/MsOcXk=; b=d+Mm+3Qb85+L8BO4wHPKuGNONchd3pyG5AQAyK8Gb+LXVsA+lcaJRxlb4xdL9AVZtCSAiw 7Akqgh8R/7lEP6BhLTwe8rJlUcZlU2HG4E7wwtivvxImKzY3zM9kdC5c1D4Vi4DGTkOm1l xu4DFIzcWt1rgqJ1mvu7LdOEHFPF0YrcWOBzk8r7hYv4p82wJ27M/O7lQR1EE2RcFQmLa4 VliKpvq+s18JQ2z4XfTWCb28WWIFYbJ/pk4cfr81hj2KC/dV+YDoA4W8rV/o3mlUepvWvb WFIJFWxS67xPOi1S0x49XvqMjQwXBOCRXP0syQCnpfLMOw5BWW2MiMRAnsGXJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612587; a=rsa-sha256; cv=none; b=tWhtvkBocstDqbSgVYsI/rCVnn3Wvl5jpuWj6VNmKf4SKHU9rK3tBDnDm4im0wOOQTfiKv vkdFeyJbAK2HJpQvNWZGZLhMXuw7ItbI07UTwzC49IGDyrE5YbD8isyVXIOAIsIotLAFmV dj1XaiFcN8TgnmtfAFJsfScSXFac9DVBpL9CF1SvMFRF+Kj/69MtvXYAoAZ1vUcFBXvPnx Lv7IsfyEy9sirOVqj3G+csF9vIjIm3/ctkXsQ6xf9JcMJzMAx1vgIIRQeYaSti4sVKegyl PcDPz/rXCOSlNq+xx0jw4UKxpOfljMW0QKouvOn7asUGvvnFGhGaVVhT45CXzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjk6Xx2zWtN; Mon, 17 Jul 2023 16:49:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnk8W081504; Mon, 17 Jul 2023 16:49:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnkND081503; Mon, 17 Jul 2023 16:49:46 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:46 GMT Message-Id: <202307171649.36HGnkND081503@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: c6741d6aa703 - stable/13 - pmcstat(8): Drop .Ud List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c6741d6aa7036361a271b2dd68c57092ef096a4b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c6741d6aa7036361a271b2dd68c57092ef096a4b commit c6741d6aa7036361a271b2dd68c57092ef096a4b Author: Mitchell Horne AuthorDate: 2023-07-10 17:23:36 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:58 +0000 pmcstat(8): Drop .Ud This utility has existed for a long time and should not be advertised as "currently under development". While here, fix the one other warning from igor about using a newline for a new sentence. MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit a5b3e56330b07c8163b4d62ec55edf37746c11cf) --- usr.sbin/pmcstat/pmcstat.8 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.sbin/pmcstat/pmcstat.8 b/usr.sbin/pmcstat/pmcstat.8 index b0dae2449cfe..37e003d5b154 100644 --- a/usr.sbin/pmcstat/pmcstat.8 +++ b/usr.sbin/pmcstat/pmcstat.8 @@ -226,8 +226,8 @@ specified in .It Fl T Use a .Xr top 1 Ns -like -mode for sampling PMCs. The following hotkeys -can be used: +mode for sampling PMCs. +The following hotkeys can be used: .Pp .Bl -tag -compact -width "Ctrl+a" -offset 4n .It Ic A @@ -544,8 +544,6 @@ The .Nm utility first appeared in .Fx 6.0 . -It is -.Ud .Sh AUTHORS .An Joseph Koshy Aq Mt jkoshy@FreeBSD.org .Sh BUGS From nobody Mon Jul 17 16:49:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjq2R5dz4n4YJ; Mon, 17 Jul 2023 16:49: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjj6YRkz4JZS; Mon, 17 Jul 2023 16:49:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAFhE4Hv0lM5s2U5rWuyzNI+xbYzmkNdiHVAh0PbzZ8=; b=aiWZelBIUTHYxu/xN9JaK/NpVweR/WoSccT227TGuMaYCr6Gt4iNdQTIlzjTaQ5GyNNEOk qbdG5dVn2S0T/r07FhgWToaj+AiDhJqJYt+PVRUIxOnMwmT8IMJh/vZ3UInUQMeaTZ2Xog Sgcb/SOcsSPPCcgs9DWukUo0ET7SxA2IPOR+D7YID9kmDguBJkEieT9H8Plxjo1ksU5MmQ 7tNru9kK4dkK9oBJZYcRUkJwdhEPAnEGYdNVphkNmeuihttkVy6FPcKa7OVJU1Ya8TxN6X yXlK+8ZpoedrdQ3hJI3vbrIB0Ky1NG5DMultH/7h30T08dWcE+heyQ8opvPHLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nAFhE4Hv0lM5s2U5rWuyzNI+xbYzmkNdiHVAh0PbzZ8=; b=QMK+x0N/krxNkpSHmi5cjfzi9AJep4w2JDwdnLOSt1Pg4i0ozDn9JIG/RQXD+8ZH4Xypt9 h6joPzH+bau1TkhiJyOkvC4k4NtMhIowDg/Tl6UhKsnULJ99DFEkZE6SNj6vKT2LVrlDWt d9Ts/wqKtoISSPZ2/h7KqnJYRk2V/b+jp0Rkb8v+NpT4elxQ78JQPpDAW+r1CAD9PQmmGl QaLYin0iefLNWcgxBEXc0L0RCZbNmcN6guGHdeolwW57IgIHdpyv+WzOAMXKVWvF0uC5/m XukOKNV4buqQgIBWmOWKDlVFOHEMzRY6xNfksqEpc7u7e25vpxjfKir16xwYaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612585; a=rsa-sha256; cv=none; b=aoRgO/WKaJsllSEO6BTRBG6SnC50h1mdcqfogpjyV61QcGVqV8HyqHCmqL5FbyNJ9WaaWj bFwICjRFbYcmF0tgAktE6osr6YMzYO8JcDRno3wyMHvOmNWwUhKiTSnCMfG9Gjf0UjbLfe ewpwMlzziS+Fg+OA4J1JTEx/QQnwJCJD8DxZIHbNqA78D4E5TXWpdXH2sYD52gqVinD7y0 m4Xi5Sy073mTB1FM8Zcwlxweye9RMApLKXYttRuWEr8kgafAB2VrS+NR0s/KwRop7eUVgf 2qlfP9zcAtF//ZuKTE+zvnPUWiFURYyLcRH46yXqq0R96lgeYXDGZsK8gC1BKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjj5PpYzX2h; Mon, 17 Jul 2023 16:49:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnj3G081485; Mon, 17 Jul 2023 16:49:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnjhq081484; Mon, 17 Jul 2023 16:49:45 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:45 GMT Message-Id: <202307171649.36HGnjhq081484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: fbab5263d524 - stable/13 - pmclog(3): Drop .Ud List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fbab5263d5245c8b4df2b2a5195f9f341a96ccf8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=fbab5263d5245c8b4df2b2a5195f9f341a96ccf8 commit fbab5263d5245c8b4df2b2a5195f9f341a96ccf8 Author: Mitchell Horne AuthorDate: 2023-07-10 17:20:54 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:58 +0000 pmclog(3): Drop .Ud This API is stable and should not be advertised as "currently under development". MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit 398fb4a592a3509cc73c3fc99d44712b0505fb7a) --- lib/libpmc/pmclog.3 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/libpmc/pmclog.3 b/lib/libpmc/pmclog.3 index d60e97085831..45bb3bfcc15c 100644 --- a/lib/libpmc/pmclog.3 +++ b/lib/libpmc/pmclog.3 @@ -315,7 +315,5 @@ for a file based parser may fail with any of the errors returned by .Sh HISTORY The .Nm pmclog -API -.Ud -It first appeared in +API first appeared in .Fx 6.0 . From nobody Mon Jul 17 16:49:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Sjv6yV0z4n4dt; Mon, 17 Jul 2023 16:49:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Sjm2yHPz4JTf; Mon, 17 Jul 2023 16:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqeiibOwlDWf8HkZUmuYlY9PKAh26gGA/y78IG7FN/s=; b=kLnCjZaZIUnWoT7SUaCDlwWJH7NTcPqsg1BH7uKVbbrGQEiZiruOQjwaRsveKhGz73Bk0X sR3upFqFti0G2zSvzQ/FAEUpr18pKjj0spt5I3oftaOQFIi/1z5VmKvHylVJfXHsJtMPmN kaw55vOx8XoRRPYaGS9DtMlYYqZP7qApl3NFHFnRn6MrEcFfGjDY5RV5OBHPT66UASHYeq MnVuMa2q59MqtbC9aBTzdXIE4etP4DPVbqc0N6C7U2AgEOwjhlsMhtkp24uJqGFmxqz0oy zqNlzZnC4giuthnIRgue5n3NqB7fPJ3Z5tIHKZ9A1kFkOfpY+iZJEEp4HxzALw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689612588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BqeiibOwlDWf8HkZUmuYlY9PKAh26gGA/y78IG7FN/s=; b=qHaYUstY0dmLJ7+dRD56Td2sfV+8yFM6ozKcSQUzJ6q2gk7/kGhPvY0NRoC/sqXs0Krf8q Tfu0gEAvhyvT5N3QTEFjOFNRTAssZvQkQTALeozQF7eXV3pRcqC9yNxFRNhC3yTNgGuQSf RPPz22KKA3y//LO1GPhXSKtoi23zEEHgCWEiRkHarUk1ETDlTOGpLV22fRuYSb8qQDxBN3 0iMRezQFlUb1xbdFoWmvnXD21v0vo0KWexKd2h1xBUtrK18PDo6Jkv4qfMDDVJTqi74LTy LgYkbBwfg+ZLOzSD2bfvsukImn8AYuPYi+VKK+DtM8KlmDlNp6VNREAAZXuFZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689612588; a=rsa-sha256; cv=none; b=S8fn6687o+KwDBZRzZuzTOx/wj6ixDbRez7uOIk5WzrVe0sxipX9P2+UadM7cHgeEaOzKP 2JrsCatKYKJTA+ERn6aLzPtToVM+70hLP5qUmAQHHxQBkx+oJcaJG+letZkKfDs1ICE2hY 6ZUbEhpJwcryEzVZnh3LPjm1YPBDAxjTPq5nT09K1jXOY93jxlYpXnMsw3E29IAs6PTR8x +SVVQSAoy5DITygBgpdZJHxXCUxBtBbNbiTOgFstyqNYJ36oR1x9/2PRdPq7eb7HOgzT8p LauCn11yh4NmY/Oca8mIs12sjXuuB+XcYST1pqxAPB2EL7cPZW2wSo+dKAhSFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Sjm0gfmzWwy; Mon, 17 Jul 2023 16:49:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HGnllv081524; Mon, 17 Jul 2023 16:49:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HGnlRY081523; Mon, 17 Jul 2023 16:49:47 GMT (envelope-from git) Date: Mon, 17 Jul 2023 16:49:47 GMT Message-Id: <202307171649.36HGnlRY081523@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 24f72101137d - stable/13 - pmc_events.h: update top-level comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 24f72101137d43bd0cf496dcc50b60f85ebbc26a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=24f72101137d43bd0cf496dcc50b60f85ebbc26a commit 24f72101137d43bd0cf496dcc50b60f85ebbc26a Author: Mitchell Horne AuthorDate: 2023-06-26 17:08:56 +0000 Commit: Mitchell Horne CommitDate: 2023-07-17 16:48:58 +0000 pmc_events.h: update top-level comment It points to non-existent documentation. The wiki page still contains a useful overview, so keep this link. MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit f7a217060608b5fa9e7c59724a617b7241a3ee3b) --- sys/dev/hwpmc/pmc_events.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h index 6df2ef4d82d7..5e77443c23c9 100644 --- a/sys/dev/hwpmc/pmc_events.h +++ b/sys/dev/hwpmc/pmc_events.h @@ -32,14 +32,12 @@ #define _DEV_HWPMC_PMC_EVENTS_H_ /* - * Note: Documentation on adding events can be found both in - * the source tree at src/share/doc/papers/hwpmc/hwpmc.ms - * as well as on-line at: + * Note: Documentation on adding events can be found online at: * * https://wiki.freebsd.org/PmcTools/PmcHardwareHowTo * - * Please refer to those resources before you attempt to modify - * this file or the hwpmc driver/subsystem. + * Please refer to this resource before you attempt to modify this file or the + * hwpmc driver/subsystem. */ /* * PMC event codes. From nobody Mon Jul 17 17:15:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4THV0Tx5z4nHcw; Mon, 17 Jul 2023 17:15:34 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4THV04H2z4SSX; Mon, 17 Jul 2023 17:15:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689614134; 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=F3sAUeNTcvmpwvWuezM8fqThkDvxFe2f3JuNsd475Vg=; b=bQKdksoL2rLvy34I/2S+d7ocBhGdf06jk+PyMit4OB1eMf+TKJyEqMi7IK0wFwgHuVVAlI w8Njhbh0ZDJolEtyCr79V1hymv5/RRZA6NkrqxNWDuKkcVqZp9XKrONqbxB2B4pa4dJkvK qMNxMGTNpB0Dbp9nTZLWSXn50GQwR55bqLH4Osk3+lSwmmn/iWAtBh+titnelSxNyAGXkM UxgIsgo6gw1Ifk+XhXvbmo6UL/LHsZ9vvKApZKEKYH0+F8l2udN9ApXDmloZfkl69YReCD FYDY1DbUICE/YZ67ZA28RPQjRV2gaAkstbJ15nOPPb+OD0DsWWKf/l9Ucf4aVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689614134; 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=F3sAUeNTcvmpwvWuezM8fqThkDvxFe2f3JuNsd475Vg=; b=eMibPgdPH4EiU3GavRHVVNoW36WNMghQrUxcCdB4hSEm1gLUzj7JmkSzFf0ya0qQzvyrQN D3Z7aMZFhQGHM2ifUTSe0aZItA0pMBeA4GSHrj0A44avHRBL5F1slKQO434K4h2+dFcfoi CmoIz8xwNPCY2xmo4Me5IMmagF4OWlKoIvUPHSWo8FcyA7yCaDxAFPP1uCRwrDWB4Pp1pq aDimQJA9IT2HVKqsqE6X7G2ey3ke9jC5AOl5ON4RIDQ5xtRhJemQqSRDUn+uqGckILCg3t a3Iny4d32txJ/LyNt+0cwta4K9hsQRWXjBPw5afzFg7inXd4fYWveX/8JVYRkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689614134; a=rsa-sha256; cv=none; b=iu06+dUFvUeqbP8e/xRG/jUmMEWtnU1dAvSXXTygx58NqP7eVxqL8+8L4UlL3Yq0ykS0ng gav/3G5yQr87wJeJanCIAtjsGZvzkqCzbvsxVWx6YGbzIGLdPPKBqbJOcLrJzDYSg+vtyF k6ZrMrhcSxNWYqV2paTYg4R22/gR2O19+oj4GKutzrVYp7l7rQumJZiOGJaypvrcaz6Ula 55uQWjjrhAoSL8wCFeWMhwgrmzztKPXWgS0prqw026pKBYtcGIxl2q0mN/kD6mni2DfS6H NX+cPVMuUFp06w9ltIYb4tpY9PO4qBWewTdZJIbPUF9sFgrrlb4dOS2Fr7HwjQ== Received: from [IPV6:2601:648:8680:16b0:8880:dd2f:6436:cf5] (unknown [IPv6:2601:648:8680:16b0:8880:dd2f:6436:cf5]) (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 4R4THS5RJTz1Mxt; Mon, 17 Jul 2023 17:15:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> Date: Mon, 17 Jul 2023 10:15:31 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 8:48 AM, Konstantin Belousov wrote: > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >> >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >> Author: John Baldwin >> AuthorDate: 2023-07-14 18:30:31 +0000 >> Commit: John Baldwin >> CommitDate: 2023-07-14 18:32:16 +0000 >> >> memdesc: Retire MEMDESC_CCB. >> >> Instead, change memdesc_ccb to examine the CCB and return a memdesc of >> a more generic type describing the data buffer. > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >> index 65a08aeba17c..bfaad30b37d3 100644 >> --- a/sys/kern/subr_bus_dma.c >> +++ b/sys/kern/subr_bus_dma.c >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, bus_dmamap_t map, >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, >> + mem = memdesc_ccb(ccb); >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, >> + flags)); >> } > This makes kernel not linkable if CAM is not included into it. Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern somewhere (like the kern_memdesc.c file in my other pending review), or we can #ifdef this function. It probably doesn't make sense to have a bus_dmamap_load_ccb if you don't have CAM, so I think I prefer the second option. -- John Baldwin From nobody Mon Jul 17 17:29:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Tbf2fwRz4nQYS for ; Mon, 17 Jul 2023 17:29:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Tbd4rwhz4XPZ for ; Mon, 17 Jul 2023 17:29:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-51e344efd75so9877614a12.1 for ; Mon, 17 Jul 2023 10:29:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689614972; x=1692206972; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fg+dJeASVYPiLzg333HImWtRPW+FLdhoPC3yxshm3Dk=; b=DyJvnqEwCtsyKeneU/LczhtHer9xrOdbZVWzBTFSke1vLt5OQTpW0IvweToZYwezC8 yiEb6VgxWyEuy7bYm76GVx4cDn9JovXh1D7+4MJX5+yztJxFTRLrGP9UrjMc1zBgQ0dk Fxg/DpOn+lKcm1uHQQkFfcWTIHowX11r4teLJYME3XB5GNUIoKMDheRmAXvsHSjcauJg l766cmZRwKz/ENfomZNvzsn9pxLBugPL8ytKp834V4uZDw6tC487vMUMwvt52ftqf48n 8rTMOPeBgqqW0lzDxD5ZaVhxPHoJkbqy0xlNg3X7UbHTK8d/yh+sylkRbvqRCgi32LHu ojMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689614972; x=1692206972; 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=fg+dJeASVYPiLzg333HImWtRPW+FLdhoPC3yxshm3Dk=; b=lohVuEL6MckwCdV/ADhJlpQXuroAbGmFXN4Wkq9AQd62mh4aO+xC3z0PaLDr/MaBRU zgLbYU/rJ7MdICSkdlV4V7I+y3Dtys7r+Nr7PEe/0rsmcXPprqm04oSgJiKUXW5sDNRL efiQ8U6mbp92ReYBiRsip+Z+PQV+sb0AHUhR3Vn38cgkcgJrvd5hr7oX+nEs28g/xP+r X1uzfh5ucFebHnlMXiqUK9PwzA3lmsCyKVVwmkhRJLnkkM6uAFQyCvCD089EYc/SFR7l iyMuALxTObay/Ridj+bsndPiDIVetra6aHmp/U0SNy9thVW023h/AR6Zelf3sA93/DS+ Wy3Q== X-Gm-Message-State: ABy/qLYS4ymb5dyrCLF+tF41N9eE8Sd1U/wVr0WNRMTmbCQgGEX4O31i hMdZ6iyXbdVYbau/ZDMq84fWqGJM5YEJd9gmhmFPmQ== X-Google-Smtp-Source: APBJJlENXExmteN8q3vZosf8JqWFiQ+Hq+ew2HVPBDuUWXWVSsiubJQGUxojjbqB2VIETiAtAM5DCps+vYYDug4HrFw= X-Received: by 2002:a05:6402:270a:b0:51d:b184:efd with SMTP id y10-20020a056402270a00b0051db1840efdmr10016526edd.20.1689614971653; Mon, 17 Jul 2023 10:29:31 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> In-Reply-To: <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 11:29:20 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000316b670600b224d2" X-Rspamd-Queue-Id: 4R4Tbd4rwhz4XPZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000316b670600b224d2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >> The branch main has been updated by jhb: > >> > >> URL: > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >> > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >> Author: John Baldwin > >> AuthorDate: 2023-07-14 18:30:31 +0000 > >> Commit: John Baldwin > >> CommitDate: 2023-07-14 18:32:16 +0000 > >> > >> memdesc: Retire MEMDESC_CCB. > >> > >> Instead, change memdesc_ccb to examine the CCB and return a > memdesc of > >> a more generic type describing the data buffer. > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >> index 65a08aeba17c..bfaad30b37d3 100644 > >> --- a/sys/kern/subr_bus_dma.c > >> +++ b/sys/kern/subr_bus_dma.c > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > bus_dmamap_t map, > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > bus_dmamap_t map, union ccb *ccb, > >> + mem =3D memdesc_ccb(ccb); > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > >> + flags)); > >> } > > This makes kernel not linkable if CAM is not included into it. > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > somewhere > (like the kern_memdesc.c file in my other pending review), or we can #ifd= ef > this function. It probably doesn't make sense to have a > bus_dmamap_load_ccb > if you don't have CAM, so I think I prefer the second option. > MINIMAL doesn't have CAM configured, but it is loadable as a module. I'd think we'd want a dummy one fo these with weak symbol binding and have the actual one live in cam somewhere that overrides this symbol. I just hit this in building MINIMAL for other reasons.... Warner --000000000000316b670600b224d2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:15=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On= 7/17/23 8:48 AM, Konstantin Belousov wrote:
> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote:
>> The branch main has been updated by jhb:
>>
>> URL:
http= s://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab= 858
>>
>> commit 60381fd1ee8668ea1e4676a6128883d987cab858
>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> AuthorDate: 2023-07-14 18:30:31 +0000
>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org> >> CommitDate: 2023-07-14 18:32:16 +0000
>>
>>=C2=A0 =C2=A0 =C2=A0 memdesc: Retire MEMDESC_CCB.
>>=C2=A0 =C2=A0 =C2=A0
>>=C2=A0 =C2=A0 =C2=A0 Instead, change memdesc_ccb to examine the CCB= and return a memdesc of
>>=C2=A0 =C2=A0 =C2=A0 a more generic type describing the data buffer= .
>
>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
>> index 65a08aeba17c..bfaad30b37d3 100644
>> --- a/sys/kern/subr_bus_dma.c
>> +++ b/sys/kern/subr_bus_dma.c
>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, b= us_dmamap_t map,
>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_= dmamap_t map, union ccb *ccb,
>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &mem, ca= llback, callback_arg,
>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>=C2=A0 =C2=A0}
> This makes kernel not linkable if CAM is not included into it.

Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sys/kern som= ewhere
(like the kern_memdesc.c file in my other pending review), or we can #ifdef=
this function.=C2=A0 It probably doesn't make sense to have a bus_dmama= p_load_ccb
if you don't have CAM, so I think I prefer the second option.

MINIMAL doesn't have CAM configured, but it = is loadable as a module.

I'd think we'd wa= nt a dummy one fo these with weak symbol binding and have the actual
<= div>one live in cam somewhere that overrides this=C2=A0 symbol.
<= br>
I just hit this in building MINIMAL for other reasons....
=

Warner
--000000000000316b670600b224d2-- From nobody Mon Jul 17 17:35:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Tkt56g1z4nTVc; Mon, 17 Jul 2023 17:35: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Tkt4hrRz4ZRd; Mon, 17 Jul 2023 17:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAon1OZUhZ1cwWClhIpT2Rd4gNpgG4VP2VsYsPejzuE=; b=d2zd95Fl3tYnlg9Hqqe3d0m6gImRVJs6xCY46hY+NkTd2Rdzd8UvGP1wF2eXkJec5uwzGw weVjQdD1JGKRM5wfeF3Ip5No9DJKZ1kBGI9gFlkSb5/RhYiANzKI6GQ20pZ75qjT/9M4yj gx5F/rhMipLTzmwlt/LAFpnLGmvbMzHnxgtJfZWYUIJIH/OaaO70Gnf47kRbhU5KLhCNqC g6RwI8hKuSoG25UrErd+4kmL7rjGJROWTzRriU51OhRjZP5DGHCMaiulda/VMW154Bw2qw kbYsnty3wIfN4MdDGfLuIjGjrMa9z1+3+A3w24A6noaa2YTKI20MwLLzvhTJZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAon1OZUhZ1cwWClhIpT2Rd4gNpgG4VP2VsYsPejzuE=; b=XokUtW8Mt6v8E2gDIbrTLUTDqDIbNWhCs2oq7mCmXZdXrkp+u1TIUvXHICWHTEmcSgvK+K 04nUy8jsfvxF+yKqDUWee3iMjucbq5SU9sbnjdCf8uB4vvOmvPHPWDI0qoVo92xmyXF26Z ITpBuRBHaaEx7ehmbTKNCvBL+ZqyLvIJ4NvaPLA5SNrM59ZAqjM9AVE/vmuPlfngyGrx68 kO4AYCy2hSbT8QilYZ7imyzsGpQWF07SSOAzLPceRzkCfqDm7wPnut5Hb9/LDJOpps5KQG o9YyO1tBT6/WhjtQNwyGoljBt4s5yXOW0293QOSrCst0pv/ifj2V8MY4TTHWKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689615350; a=rsa-sha256; cv=none; b=RPhkPTHVLF44ns3Z0eSKZRwRQvJm4nGADuFUu34tqY/3phTSneVNa5WUyPHEa+7AjwD6+N l1ELF/GSLw8Dq8LIx/jXZ4IbspLlj+2e1JBsXgky+sqZjCKpT1KwHEJkdDajHi4MGB0l5F pULEwHrCtGM4zfzch7oYBzOj2FYLi9nVH+Ts9lP1bzXg2YyDaq8q3brZjdFfyVIqRrPm1G gvS53YS6I0TgsRxIFarqxHsIcASinBSNlm9UXL3Sy1i0DQGBob17ZrmF4NXItFQAzdJXRn s6/il3KeFM7WfYzXvd6CHspL84V2PKk+29lYKzs3dzgGIgpPPwXvRKCGukiOGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Tkt3np9zXK9; Mon, 17 Jul 2023 17:35:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HHZoXM063455; Mon, 17 Jul 2023 17:35:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HHZonv063454; Mon, 17 Jul 2023 17:35:50 GMT (envelope-from git) Date: Mon, 17 Jul 2023 17:35:50 GMT Message-Id: <202307171735.36HHZonv063454@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: d3152ab23e0e - main - tcbpcb: Always define t_osd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d3152ab23e0e7bee5a0f988ecca2a1187ab82057 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d3152ab23e0e7bee5a0f988ecca2a1187ab82057 commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 Author: Warner Losh AuthorDate: 2023-07-17 17:22:45 +0000 Commit: Warner Losh CommitDate: 2023-07-17 17:22:45 +0000 tcbpcb: Always define t_osd Always define t_osd. congestion control modules access it unconditionally. This fixes the build. However, this is, at best, a temporary band-aide until the larger issues are sorted. Sponsored by: Netflix --- sys/netinet/tcp_var.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 587998331fbf..8e89f2aef0f2 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -482,9 +482,7 @@ struct tcpcb { struct mbufq t_inpkts; /* List of saved input packets. */ struct mbufq t_outpkts; /* List of saved output packets. */ #endif -#ifdef TCP_HHOOK struct osd t_osd; /* storage for Khelp module data */ -#endif uint8_t _t_logpoint; /* Used when a BB log points is enabled */ #ifdef TCP_REQUEST_TRK /* Response tracking addons. */ From nobody Mon Jul 17 17:45:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Ty74G0Jz4nZHd; Mon, 17 Jul 2023 17:45:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Ty73pfBz4cnD; Mon, 17 Jul 2023 17:45:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615935; 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=x28pI7KpLvb2jGdNQuXq/LvDrcBSaUX+1AFxfbiPaKw=; b=KVkZRlzrtxQ9GI2zBIkO8K9E+1bo59oYwG1rBEQpb/9ICnK4qiiSQcHa2XAzjI/GQ5vv9q 1LtYPsVqkDgJNqjYNW/9CyOkgN55ka57ogPiYlxJXu2yc2Oj33Gzl0gLOp4tr4Yo2Newz/ 2vjQmKktrTf//z1qAjV+O+Uya5QAKU1K0C5UdYEnGVFUpY8FMSfBruO1FEK7DwPEiPbgmO RkDkxH/qdCI4f23LvYmarT/kH3sByKF7U9HvhIovPQ8Sb/vFU6Lr4RGjQMh6bS7o+vmZQR /6Ln6YVf90XC3nnoSH4+GfwH817lmsm/qT/StKBP45MbCtyo5r2pPWKM/qAkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689615935; 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=x28pI7KpLvb2jGdNQuXq/LvDrcBSaUX+1AFxfbiPaKw=; b=SSmSOhBrUigC+2C77yCNa5DoLGc2vfxGD8l5enRSqXVhfGMwgIJspM1j1kKaYfIHUJyYtW ASLcMLAOLpGVsArE9PofCLSH9jTGNksbjXdflVapFqveULEpMJq2uDK9CXdWoGsBkctEQK Ur4ysMwSGWj4lQelJKRJGwcoYOYAqokPpXIMrJvI05fOT59i0l6UIKww0ZHiQqSs3HE3vU ZuzCt2UbJdXtQyqM46QG9zMfoxpQA4q6Sf7TtpoKCvLxywpYfTEpjcklLQk7Xo9GaPRIgG d1aFz0wFjiS2MAmGCd8jbmy5RqZsLldB+ypywNhQaX3ZaLZOCxHPW++uHs0T/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689615935; a=rsa-sha256; cv=none; b=TcKhqUy06Dkiudm8Pf4qoiLK7Vx+7uDjeWYZpA4MHY9owaktqVJ7Bka2fgmKrg2cE4Q7rG vJciyQBsR/ikLw4yw3KPMDJ+w072LoB6wAt6sZQUbVYB6FwJfVyEdbbrZ7nxb+jK5JGkm4 ohqUm46PZpAO6WkDRFoINe/LgrJj9GP83+KM5/5qL82c7wJz+EuJ5VcC5Zy/U8KG9YRTlK jVqWDxyNQfVYdviKOCBkeA6HWlNiKVxXLTnqRmNf9hhLh50iNnLJw4ByUgjB5/RM/7twjT d1gnUbJioME3EHE16Y1L+9P+LvVG8lINSzAUt7jVEXuXO0MHGQV6p/zubR26vA== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4Ty66GZKz1Mfk; Mon, 17 Jul 2023 17:45:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> Date: Mon, 17 Jul 2023 10:45:33 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:29 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: > >> On 7/17/23 8:48 AM, Konstantin Belousov wrote: >>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >>>> The branch main has been updated by jhb: >>>> >>>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >>>> >>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>> Author: John Baldwin >>>> AuthorDate: 2023-07-14 18:30:31 +0000 >>>> Commit: John Baldwin >>>> CommitDate: 2023-07-14 18:32:16 +0000 >>>> >>>> memdesc: Retire MEMDESC_CCB. >>>> >>>> Instead, change memdesc_ccb to examine the CCB and return a >> memdesc of >>>> a more generic type describing the data buffer. >>> >>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >>>> index 65a08aeba17c..bfaad30b37d3 100644 >>>> --- a/sys/kern/subr_bus_dma.c >>>> +++ b/sys/kern/subr_bus_dma.c >>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, >> bus_dmamap_t map, >>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, >> bus_dmamap_t map, union ccb *ccb, >>>> + mem = memdesc_ccb(ccb); >>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >>>> + flags)); >>>> } >>> This makes kernel not linkable if CAM is not included into it. >> >> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern >> somewhere >> (like the kern_memdesc.c file in my other pending review), or we can #ifdef >> this function. It probably doesn't make sense to have a >> bus_dmamap_load_ccb >> if you don't have CAM, so I think I prefer the second option. >> > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > I'd think we'd want a dummy one fo these with weak symbol binding and have > the actual > one live in cam somewhere that overrides this symbol. > > I just hit this in building MINIMAL for other reasons.... Yeah, I was testing MINIMAL locally (which is still broken due to recent TCP commits) to try out possible fixes. One could possibly move bus_dmamap_load_ccb into cam.ko entirely? Especially this current version doesn't really have any bus_dma-specific knowledge anymore but is just a thin wrapper around bus_dmamap_load_mem: int bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, bus_dmamap_callback_t *callback, void *callback_arg, int flags) { struct ccb_hdr *ccb_h; struct memdesc mem; ccb_h = &ccb->ccb_h; if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { callback(callback_arg, NULL, 0, 0); return (0); } mem = memdesc_ccb(ccb); return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, flags)); } -- John Baldwin From nobody Mon Jul 17 17:52:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V5y3QD2z4ndNd for ; Mon, 17 Jul 2023 17:52:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V5x6Fvqz4lPG for ; Mon, 17 Jul 2023 17:52:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-51e28cac164so12462724a12.1 for ; Mon, 17 Jul 2023 10:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616339; x=1692208339; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GjjyCks/+P0ZDesVVFSCCa3rc4u1l3rfKIb3ELGp3/M=; b=CSXSC3tv+3rxwKVmgHDK37mBgEBa/eBiWi3jFv9p29LEv5CuX2I1xGz3KOXNq1w9t6 IHl7/TzX7tDUftFSo5mSKS06b04a6Js0XGiejRqH9XeBwIroaoQDv1IpAi+M8yBJcau3 YPzhMjl0UzjrrJsfnrWS/OGvFWGmRo2Ilk3rtKNS15Ck+lFMYMqfxJaDGzYO23MtZNIm M7XGuNz5jxmmCAFy5iMoQKCCYKEEV7iTMdS0KYbx6Be1EvX7PrTtQRYB3sCdtx7LYGOL eTy4hCzmUo+9AuR9H28cgXWp3Jt/z/2nxCmhC3w4VZFsQ4i+UjEp1fKnzDKLUnSSTdEH Nnwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616339; x=1692208339; 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=GjjyCks/+P0ZDesVVFSCCa3rc4u1l3rfKIb3ELGp3/M=; b=llLFs6w0fK6TfqFFYxwFGSPQztlclIUZK8s/c9kAxrGDQPqsn1BSYopIwQxNQH11zY dEg/9RMvF7nA6EJa0aK2BGmkhQ5Ojz02FgqiyQCZZJcUR6raEzFsg3wWYW9RB2FdJ09v a+VDJTRoQk7c/DDpqu20DhVojaaNRZv0p+X1FNXQbbjdCyYKm9AbdpigxwBXNIH/kxf5 YTalLz8ppDzjAY1HJlmg8LnnCqlDhO6QCJLmM46OrTI/1wCx9mCekAH0ToqssR8FylyE AED4WbMJpfZs9/RuXmHexv52PsfgdNBuMg7aU8ixk9H+3QCIjb/kTy50PT2NjUkD+IUg VprA== X-Gm-Message-State: ABy/qLZM3iZUbeeKFCz9ll/p6A192O8SibBEVf8/sBi+8r3a6V26Q1Lb nV74B2E+ymWEmaEdIAsENcVL8/p/zNcEYd5cPBBKlQ== X-Google-Smtp-Source: APBJJlEvnLU7u6Pm8d7JAZ0yj8dIXQ8ps8weJaLhSprkarqTBYppST3unPNmmzH4gCcaDjSzIRu662zWrpuH8uzjaiU= X-Received: by 2002:a05:6402:42cc:b0:51f:e0f0:f2cd with SMTP id i12-20020a05640242cc00b0051fe0f0f2cdmr12173297edc.3.1689616338839; Mon, 17 Jul 2023 10:52:18 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> In-Reply-To: <17cd00bb-c6f2-5afa-a1ac-b7e14c3c758e@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 11:52:07 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000aefcf40600b2750f" X-Rspamd-Queue-Id: 4R4V5x6Fvqz4lPG X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000aefcf40600b2750f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:45=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 10:29 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin = wrote: > > > >> On 7/17/23 8:48 AM, Konstantin Belousov wrote: > >>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >>>> The branch main has been updated by jhb: > >>>> > >>>> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >>>> > >>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >>>> Author: John Baldwin > >>>> AuthorDate: 2023-07-14 18:30:31 +0000 > >>>> Commit: John Baldwin > >>>> CommitDate: 2023-07-14 18:32:16 +0000 > >>>> > >>>> memdesc: Retire MEMDESC_CCB. > >>>> > >>>> Instead, change memdesc_ccb to examine the CCB and return a > >> memdesc of > >>>> a more generic type describing the data buffer. > >>> > >>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >>>> index 65a08aeba17c..bfaad30b37d3 100644 > >>>> --- a/sys/kern/subr_bus_dma.c > >>>> +++ b/sys/kern/subr_bus_dma.c > >>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > >> bus_dmamap_t map, > >>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > >> bus_dmamap_t map, union ccb *ccb, > >>>> + mem =3D memdesc_ccb(ccb); > >>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > >> callback_arg, > >>>> + flags)); > >>>> } > >>> This makes kernel not linkable if CAM is not included into it. > >> > >> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > >> somewhere > >> (like the kern_memdesc.c file in my other pending review), or we can > #ifdef > >> this function. It probably doesn't make sense to have a > >> bus_dmamap_load_ccb > >> if you don't have CAM, so I think I prefer the second option. > >> > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > > > I'd think we'd want a dummy one fo these with weak symbol binding and > have > > the actual > > one live in cam somewhere that overrides this symbol. > > > > I just hit this in building MINIMAL for other reasons.... > > Yeah, I was testing MINIMAL locally (which is still broken due to recent > TCP commits) to try out possible fixes. One could possibly move > bus_dmamap_load_ccb into cam.ko entirely? Especially this current versio= n > doesn't really have any bus_dma-specific knowledge anymore but is just a > thin wrapper around bus_dmamap_load_mem: > > int > bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, > bus_dmamap_callback_t *callback, void *callback_arg, > int flags) > { > struct ccb_hdr *ccb_h; > struct memdesc mem; > > ccb_h =3D &ccb->ccb_h; > if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > callback(callback_arg, NULL, 0, 0); > return (0); > } > > mem =3D memdesc_ccb(ccb); > return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > flags)); > } > And who calls bus_dmamap_load_ccb? If this were entirely in cam.ko, then callers of it would need to resolve it. sys/dev/nvme/nvme_qpair.c is not otherwise dependent on cam, and would be unresolved for a minimal + nvme + nvd kernel. Warner --000000000000aefcf40600b2750f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:45=E2=80= =AFAM John Baldwin <jhb@freebsd.org> wrote:
On= 7/17/23 10:29 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <
jhb@freebsd.org> wrote:
>
>> On 7/17/23 8:48 AM, Konstantin Belousov wrote:
>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote:<= br> >>>> The branch main has been updated by jhb:
>>>>
>>>> URL:
>> https://c= git.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858
>>>>
>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858
>>>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.or= g>
>>>> AuthorDate: 2023-07-14 18:30:31 +0000
>>>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.or= g>
>>>> CommitDate: 2023-07-14 18:32:16 +0000
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0memdesc: Retire MEMDESC_CCB.
>>>>
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Instead, change memdesc_ccb to e= xamine the CCB and return a
>> memdesc of
>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0a more generic type describing t= he data buffer.
>>>
>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_d= ma.c
>>>> index 65a08aeba17c..bfaad30b37d3 100644
>>>> --- a/sys/kern/subr_bus_dma.c
>>>> +++ b/sys/kern/subr_bus_dma.c
>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t= dmat,
>> bus_dmamap_t map,
>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dm= at,
>> bus_dmamap_t map, union ccb *ccb,
>>>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>>>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &= ;mem, callback,
>> callback_arg,
>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>>>=C2=A0 =C2=A0 }
>>> This makes kernel not linkable if CAM is not included into it.=
>>
>> Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sys= /kern
>> somewhere
>> (like the kern_memdesc.c file in my other pending review), or we c= an #ifdef
>> this function.=C2=A0 It probably doesn't make sense to have a<= br> >> bus_dmamap_load_ccb
>> if you don't have CAM, so I think I prefer the second option.<= br> >>
>
> MINIMAL doesn't have CAM configured, but it is loadable as a modul= e.
>
> I'd think we'd want a dummy one fo these with weak symbol bind= ing and have
> the actual
> one live in cam somewhere that overrides this=C2=A0 symbol.
>
> I just hit this in building MINIMAL for other reasons....

Yeah, I was testing MINIMAL locally (which is still broken due to recent TCP commits) to try out possible fixes.=C2=A0 One could possibly move
bus_dmamap_load_ccb into cam.ko entirely?=C2=A0 Especially this current ver= sion
doesn't really have any bus_dma-specific knowledge anymore but is just = a
thin wrapper around bus_dmamap_load_mem:

int
bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 int f= lags)
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct ccb_hdr *ccb_h;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct memdesc mem;

=C2=A0 =C2=A0 =C2=A0 =C2=A0 ccb_h =3D &ccb->ccb_h;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 callback(callback_a= rg, NULL, 0, 0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return (0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
}


--000000000000aefcf40600b2750f-- From nobody Mon Jul 17 17:52:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V6242D3z4nd4c; Mon, 17 Jul 2023 17:52:26 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V622tF6z3C2k; Mon, 17 Jul 2023 17:52:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616346; h=from:from:reply-to:subject: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=hkvTB3+nYbvEKxicsSmCKRHbOy8z66ZLkwS/qiEmdTQ=; b=QAFskyscKSqEbCnL3P577iRaZBKV64o9NK1ukNS4LupX9h5/yz/KqvBQqo6ISUC6SWqoP0 HkxtHsJa3nBC9djiXNjljb4t/g6U9/hn6896OTqnR1TY9LkhsFZ14BSVkdL/JIIjaNuusW xD356FrYr6xB35irxeAWWemp4HR943pvmlkNVqJ+RVa+R11WQ//hoXetronXWxfa/1Qxl5 aRn8RjDzRa96UDgEEQc9NZBTZcJnwcOwGVlt+VooNCB/VHGd183IeOIzDyyV7CbHxpqDDa cTFBn1APaq7d7OpkLWF+YeuC22aJ+9xJKFYCd4XVltuSDsOLEoFL534IYw7CLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616346; h=from:from:reply-to:subject: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=hkvTB3+nYbvEKxicsSmCKRHbOy8z66ZLkwS/qiEmdTQ=; b=ZttfuurMgxVMGPc/hztwjmyLf/Mey6o6DWkE3fN7Le4x084rVHU1d2RomAvynt9TkipjTU dNEwHX6eZvtELYlTVbPPlTf6PqArwBHM1mDL4oOdz5IUD+86HSGPzIuR1Ot7KXugIGg5ie sam5kYibaLJCyFLvUXWtEFb2dmkD4+bFrG3HVnkLoK+vcYHk55BD6VFWnlelPtmAEnidau Y7HbkK+k2z6dfb1/5GO+MNW49x8JKIX85FHyShWnz5sEK0w/d+t3qTizoOdDIgFDVTzbPE uXPdcuAk4kM9X0N0XaOWsbFN6otr1q/f0HAe9Q0xVBls/ETlz0u7EiPcXe55HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689616346; a=rsa-sha256; cv=none; b=YpHrr4//M+ASUE9qPwp3ZAWsBL9MGoUscex8UJ/1L8fvtPv4BJdEsBtC7Tkew/jTE9bDpe Hb40EOrdJTAK/xrcI27JmXi1xgZchKxF7ii39MOfTppKPNRu+xL13rrEAcbi7O3vjPspyo dLrcaSgAnwUyC9Hxs1yr8GKzWEloX9iOyyXDbqPINlYQDXKUUibPqDw54H3czhTzELB5t/ /rAbUXjJXUQS8R9bhTqF3EInhOiOuE/KlOOdA1WXOEd8VSrcuAP+147+d1FQKpMh5rVk3B OUIKAP1wlZcBq4SG7PDKecvbrvgR5rbqP7Kr9D7rkZVcUtFZZStln0c2tqNbYg== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4V6165rVz1MSl; Mon, 17 Jul 2023 17:52:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 17 Jul 2023 10:52:24 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd Content-Language: en-US To: Warner Losh , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: <202307171735.36HHZonv063454@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:35 AM, Warner Losh wrote: > The branch main has been updated by imp: > > URL: https://cgit.FreeBSD.org/src/commit/?id=d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > Author: Warner Losh > AuthorDate: 2023-07-17 17:22:45 +0000 > Commit: Warner Losh > CommitDate: 2023-07-17 17:22:45 +0000 > > tcbpcb: Always define t_osd > > Always define t_osd. congestion control modules access it > unconditionally. This fixes the build. > > However, this is, at best, a temporary band-aide until the > larger issues are sorted. > > Sponsored by: Netflix FWIW, I find that #ifdef's based on kernel options in "core" structures like this shared with modules is a recipe for disaster. -- John Baldwin From nobody Mon Jul 17 17:54:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V8G6KWfz4ndxr for ; Mon, 17 Jul 2023 17:54:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V8G1B0wz3D0g for ; Mon, 17 Jul 2023 17:54:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-51e5da802afso6846986a12.3 for ; Mon, 17 Jul 2023 10:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616461; x=1692208461; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=mIrbgHnYsjmoJjRnm1DyOFH1NhKbnvOABJ0PrhVgdHc=; b=DY+r7CmLzoqkCQJ4ExtbZmx8MV9+/VFbpQ3m014LGnzlpPZUpJDpn/j5vF4pkM1L2R XkKhm/fLtZTEJ5yRUnPl5a6Ul+woZ9ZvU2WfUGE1rjEHNClwSSUYtIh33FZJ9gGdRaAh 3Kxay+eHAse4UIgN5/9gJmhZgoAnkycsR23qo13Ypm+TETdsUMW/A3YChsbc7bIUJ7Vy bXU849+DoN6veUZ7yC8GopIzw4bNyMQ5lQJ8RpnSE5oAqk9T//lY3jZdHkPPGIWf67zI EZL67/G79jCFfZjXILymQx/eC4Xx05zbkjw4gMo9sz38Vqudsrb0e0dKbip2vCJIujL3 KS/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616461; x=1692208461; 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=mIrbgHnYsjmoJjRnm1DyOFH1NhKbnvOABJ0PrhVgdHc=; b=iJIgUqpTeQMuOnXBlIGu9ZogeFgX+VJVhWYoH+ONChFEl75d9uh0s/TBo1yGc8Ib9L nD1igpKDHA+nrriaU5ghVlpCzOUKoZ3ThsVhpTKOJhGOdZ0gp4Ocj3A8o4IYKZedxpwg 9FuLJpXiPZPyGIOvvVo+NrPTlvX4awWh7LT0yiVahhlCFPVMV0auXKsQrz+hL0yBAq3x K+r94BRCaIPie2mJPAXYs0jVtkiTPo3h9qIdkl4Bf94wKsKmJCeDuG+/5Z3HlCTR4Tfq 3TtgZVYNllKfyCzqOS+x2gtPuQJaS/xzXORFPR8nXr8cw/p3t+YSLMRv7t+B+iwNnqe+ /rVg== X-Gm-Message-State: ABy/qLYayTJO4eCOaUHemZQHxr+ODDBLnOnxqZXhbZs3DNsIKeYaxmmS 3YqegF6zT6UyidTkFYwZ/duFRciiFUACPgZ96DA2WdaxmI1kNFIyn6w= X-Google-Smtp-Source: APBJJlFm5QvNc8rB1p8emcdEwWVicJNcs+ryWQSM49OeJlg/iYMfZqEQbHaVWAfy0oAd7OyW+2JDfMrUbFYP/Xnbj+4= X-Received: by 2002:aa7:de0a:0:b0:51d:8835:90a1 with SMTP id h10-20020aa7de0a000000b0051d883590a1mr12482922edv.30.1689616460589; Mon, 17 Jul 2023 10:54:20 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Mon, 17 Jul 2023 11:54:09 -0600 Message-ID: Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd To: John Baldwin Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000f1aeb60600b27ccf" X-Rspamd-Queue-Id: 4R4V8G1B0wz3D0g X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000f1aeb60600b27ccf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin wro= te: > On 7/17/23 10:35 AM, Warner Losh wrote: > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a11= 87ab82057 > > > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > Author: Warner Losh > > AuthorDate: 2023-07-17 17:22:45 +0000 > > Commit: Warner Losh > > CommitDate: 2023-07-17 17:22:45 +0000 > > > > tcbpcb: Always define t_osd > > > > Always define t_osd. congestion control modules access it > > unconditionally. This fixes the build. > > > > However, this is, at best, a temporary band-aide until the > > larger issues are sorted. > > > > Sponsored by: Netflix > > FWIW, I find that #ifdef's based on kernel options in "core" structures > like this > shared with modules is a recipe for disaster. > Agreed 100% Just trying to get to closure on that concept with all the concerned parties.... Warner --000000000000f1aeb60600b27ccf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 10:35 AM, Warner Losh wrote:
> The branch main has been updated by imp:
>
> URL:
https://= cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a1187ab82057<= /a>
>
> commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057
> Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2023-07-17 17:22:45 +0000
> Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
> CommitDate: 2023-07-17 17:22:45 +0000
>
>=C2=A0 =C2=A0 =C2=A0 tcbpcb: Always define t_osd
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Always define t_osd. congestion control modules ac= cess it
>=C2=A0 =C2=A0 =C2=A0 unconditionally. This fixes the build.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 However, this is, at best, a temporary band-aide u= ntil the
>=C2=A0 =C2=A0 =C2=A0 larger issues are sorted.
>=C2=A0 =C2=A0 =C2=A0
>=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0Netflix

FWIW, I find that #ifdef's based on kernel options in "core" = structures like this
shared with modules is a recipe for disaster.
--000000000000f1aeb60600b27ccf-- From nobody Mon Jul 17 17:54:14 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4V8J329Rz4nf5F; Mon, 17 Jul 2023 17:54:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4V8H6JChz3CsL; Mon, 17 Jul 2023 17:54:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36HHsETM013111 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jul 2023 20:54:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36HHsETM013111 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36HHsEki013110; Mon, 17 Jul 2023 20:54:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 17 Jul 2023 20:54:14 +0300 From: Konstantin Belousov To: Warner Losh Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Message-ID: References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R4V8H6JChz3CsL X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: > > > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > > >> The branch main has been updated by jhb: > > >> > > >> URL: > > https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 > > >> > > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > > >> Author: John Baldwin > > >> AuthorDate: 2023-07-14 18:30:31 +0000 > > >> Commit: John Baldwin > > >> CommitDate: 2023-07-14 18:32:16 +0000 > > >> > > >> memdesc: Retire MEMDESC_CCB. > > >> > > >> Instead, change memdesc_ccb to examine the CCB and return a > > memdesc of > > >> a more generic type describing the data buffer. > > > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > > >> index 65a08aeba17c..bfaad30b37d3 100644 > > >> --- a/sys/kern/subr_bus_dma.c > > >> +++ b/sys/kern/subr_bus_dma.c > > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > > bus_dmamap_t map, > > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > > bus_dmamap_t map, union ccb *ccb, > > >> + mem = memdesc_ccb(ccb); > > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > > callback_arg, > > >> + flags)); > > >> } > > > This makes kernel not linkable if CAM is not included into it. > > > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > > somewhere > > (like the kern_memdesc.c file in my other pending review), or we can #ifdef > > this function. It probably doesn't make sense to have a > > bus_dmamap_load_ccb > > if you don't have CAM, so I think I prefer the second option. > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > I'd think we'd want a dummy one fo these with weak symbol binding and have > the actual > one live in cam somewhere that overrides this symbol. The symbol resolution does not work this way in kernel. And it cannot made working this way even in theory, because cam.ko is loadable at runtime. I believe the only feasible solution is to move memdesc_ccb() into kernel unconditionally. > > I just hit this in building MINIMAL for other reasons.... From nobody Mon Jul 17 17:58:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VFn3x9Nz4nfpd for ; Mon, 17 Jul 2023 17:59:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VFm5MNnz3DxV for ; Mon, 17 Jul 2023 17:59:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb7769f15aso7701841e87.0 for ; Mon, 17 Jul 2023 10:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689616747; x=1692208747; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6LUpG4c0ikXDgzFkpX7egKXQVV83YcFRAfzVaMLfaqU=; b=sy5fNQOW9de8NaKoJj5NyyQX1duL2UX1x7GkTaJafMPuPQlwLyZuhIb8CN1VP7DHFC NXcA/9/8Kj7+sl7Ke2ohWXBlkOkbpQ/lodtNdAJiH2iK+rEgskUZEc9D8PL1a0oIIGmu TJxJqz+DXnCjlJDEPe/lg3BrTg8yN+xRafjZs8iuGECjmAX/f3QJR3Ibp4EBnOFrqqTW T2bGOUybzLNPyONSLPLh8AZe7+CuE9ys4dlm07uWrwoUYO7vQxm1AZ3mX4bLkHyPFPX3 y2i3Kl9DHegbw9uM45zyjZf/KvAh+WTPrub+ET7ObxNu6rrjUrUHbJjQMJ4qVcgp9iZV W14g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689616747; x=1692208747; 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=6LUpG4c0ikXDgzFkpX7egKXQVV83YcFRAfzVaMLfaqU=; b=OdMKiptXTj0x7zJfNUvypw0thG9QMPDbpLvs1zAYayyO05Hvr0AnOh1KNtJ04ykpBG J+QJPuJY0xQxERa8S96Td1Pmh9FYVvQY2A9Gohm073E1iDrZgHpne8PLrr9UIjaPJ0ga 8wmBSFblaD5/AFpqIm9frrhc2CuhyCcBD7JC9IIm+CJaTx1Vw0xe09WS7/s4Yrctex7k NV/CUwmyzK3GwI+34Pcs+wF+PiJ+zJwSRe2/gHJG/G6k1cRF9/mSfijQYoDeLY8MKBH1 6rT7/xbX64mR/FnVpGqZH3NPuadp1sQcR0gDTxtIWhRAn9dBC+C0QgYVKlLMbAabn3jp /tjA== X-Gm-Message-State: ABy/qLYDRlQAzlmIYI3V5vQFvC9geJL4Skh/Z+6IVfTPh40Lyb2tSpPI pT66S2/fUOt92aRFP1RIJlMw+n1keSls8f9QC4RjFDJMTTHA8tIO57U= X-Google-Smtp-Source: APBJJlHpnRwGHk60z00GXu6MGeGQnaUcXhVF3arG9Xe+IWYul4Rrxs0Cvj981oEUfOVVjXuVUkodYgJg3Wxm3ZOXK8E= X-Received: by 2002:a05:6512:705:b0:4f8:4245:ed57 with SMTP id b5-20020a056512070500b004f84245ed57mr8245485lfs.35.1689616746540; Mon, 17 Jul 2023 10:59:06 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Mon, 17 Jul 2023 11:58:55 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: Konstantin Belousov Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fc0c310600b28d2b" X-Rspamd-Queue-Id: 4R4VFm5MNnz3DxV X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000fc0c310600b28d2b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov wrote: > On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin = wrote: > > > > > On 7/17/23 8:48 AM, Konstantin Belousov wrote: > > > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > > > >> The branch main has been updated by jhb: > > > >> > > > >> URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > > > >> > > > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > > > >> Author: John Baldwin > > > >> AuthorDate: 2023-07-14 18:30:31 +0000 > > > >> Commit: John Baldwin > > > >> CommitDate: 2023-07-14 18:32:16 +0000 > > > >> > > > >> memdesc: Retire MEMDESC_CCB. > > > >> > > > >> Instead, change memdesc_ccb to examine the CCB and return a > > > memdesc of > > > >> a more generic type describing the data buffer. > > > > > > > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > > > >> index 65a08aeba17c..bfaad30b37d3 100644 > > > >> --- a/sys/kern/subr_bus_dma.c > > > >> +++ b/sys/kern/subr_bus_dma.c > > > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > > > bus_dmamap_t map, > > > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > > > bus_dmamap_t map, union ccb *ccb, > > > >> + mem =3D memdesc_ccb(ccb); > > > >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > > > callback_arg, > > > >> + flags)); > > > >> } > > > > This makes kernel not linkable if CAM is not included into it. > > > > > > Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > > > somewhere > > > (like the kern_memdesc.c file in my other pending review), or we can > #ifdef > > > this function. It probably doesn't make sense to have a > > > bus_dmamap_load_ccb > > > if you don't have CAM, so I think I prefer the second option. > > > > > > > MINIMAL doesn't have CAM configured, but it is loadable as a module. > > > > I'd think we'd want a dummy one fo these with weak symbol binding and > have > > the actual > > one live in cam somewhere that overrides this symbol. > The symbol resolution does not work this way in kernel. And it cannot > made working this way even in theory, because cam.ko is loadable at > runtime. > Yea... It could, if we have perfect knowledge of all the places that it is called. But I don't think we do, now that I think about it... so yes, it's good to want things, but in this case my desire cannot exist, I agree. > I believe the only feasible solution is to move memdesc_ccb() into kernel > unconditionally. > Or if it was in cam.h and made a static inline. It's short enough that won't bloat the kernel in the half a dozen places its called, and it would give similar performance to what we have today with the half a dozen nearly identical copies of this routine. And since it's all done with structure dancing, there's no other bits of CAM that would be brought into the kernel. Warner --000000000000fc0c310600b28d2b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <jhb@freebsd.org> wrote:
>
> > On 7/17/23 8:48 AM, Konstantin Belousov wrote:
> > > On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote= :
> > >> The branch main has been updated by jhb:
> > >>
> > >> URL:
> > https://= cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858<= /a>
> > >>
> > >> commit 60381fd1ee8668ea1e4676a6128883d987cab858
> > >> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.= org>
> > >> AuthorDate: 2023-07-14 18:30:31 +0000
> > >> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.= org>
> > >> CommitDate: 2023-07-14 18:32:16 +0000
> > >>
> > >>=C2=A0 =C2=A0 =C2=A0 memdesc: Retire MEMDESC_CCB.
> > >>
> > >>=C2=A0 =C2=A0 =C2=A0 Instead, change memdesc_ccb to exami= ne the CCB and return a
> > memdesc of
> > >>=C2=A0 =C2=A0 =C2=A0 a more generic type describing the d= ata buffer.
> > >
> > >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus= _dma.c
> > >> index 65a08aeba17c..bfaad30b37d3 100644
> > >> --- a/sys/kern/subr_bus_dma.c
> > >> +++ b/sys/kern/subr_bus_dma.c
> > >> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag= _t dmat,
> > bus_dmamap_t map,
> > >> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t = dmat,
> > bus_dmamap_t map, union ccb *ccb,
> > >> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
> > >> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, map, &a= mp;mem, callback,
> > callback_arg,
> > >> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
> > >>=C2=A0 =C2=A0}
> > > This makes kernel not linkable if CAM is not included into i= t.
> >
> > Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine into sy= s/kern
> > somewhere
> > (like the kern_memdesc.c file in my other pending review), or we = can #ifdef
> > this function.=C2=A0 It probably doesn't make sense to have a=
> > bus_dmamap_load_ccb
> > if you don't have CAM, so I think I prefer the second option.=
> >
>
> MINIMAL doesn't have CAM configured, but it is loadable as a modul= e.
>
> I'd think we'd want a dummy one fo these with weak symbol bind= ing and have
> the actual
> one live in cam somewhere that overrides this=C2=A0 symbol.
The symbol resolution does not work this way in kernel.=C2=A0 And it cannot=
made working this way even in theory, because cam.ko is loadable at
runtime.

<= div>=C2=A0
I believe the only feasible solution is to move memdesc_ccb() into kernel unconditionally.

<= div>the kernel in the half a dozen places its called, and it would give sim= ilar performance
--000000000000fc0c310600b28d2b-- From nobody Mon Jul 17 18:02:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VKN206Zz4nhCM; Mon, 17 Jul 2023 18:02:16 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VKN1W3cz3G3W; Mon, 17 Jul 2023 18:02:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616936; 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=dGzdUZ967JcQnT7c+KJ5BUBH0fRYSUH8F2RtydIbrw4=; b=Mj//PGfEvrNCS+vRPnHz3Bog9YpXBtCSdQrgyPBSStqHaFEkEMGEVovVdJOwiWGgB5/MlE WatvduQR4FAvUUP9D18kk7de2FROS265bELORZL0C5UildkFCby3k/8edz4a2J237rRXzo 0UCC8nfFa91jt9ibByeS7KvUkb2pJrTz84JaIPy4OxxjU2B//IZG4Ub6fmG3PEx87kgvTu QFnYMVvB21S8JXuozRYlTy+qOqlhK7FbCyYLSo4eNpMOugasoOQkql1k3m0nnysMDqAG0Q v8bnq20of05aFh/phrexbwa+s8g4nNKxkj84dzKhqFqikCV4y8xvYbEHab9d+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689616936; 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=dGzdUZ967JcQnT7c+KJ5BUBH0fRYSUH8F2RtydIbrw4=; b=VWFWy04o7+6pFOMhCSktETECCXFtpdjGul14lbo4Lgccovo1FVUq+pNM+asSTexv0hBwaF yZ6W/BBhBxvLppelmAynBfk2SfrXklNQWWEBAkxDuuEbl0nG2IF4+g/dCTai8Jv+tVQMLz l/YcgCxElHuMHwQIFM3jqSHcpRDGJ5w+CR/E5DOk/R80ZcKQHe4cqEPilEl3Yqyb5v1PTF jX8w/fnbxhU+rbvBBhJq7WdIe3FN9DvIC2NORqVzB5FrY8upwV6s4xC3/i4f9sexACfjol FJScGd/eg1ETRfu8J6b/1jaL3di70awzvHRtscIv9DsAD576V5K+9AaXGy/VkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689616936; a=rsa-sha256; cv=none; b=kDmMOkOJJ0Tqd8zh/5S6XW+SH1epr0531lKMVYlOkSyAR/PPUeJ3ZxE6pC2o7DArkqEIe2 ZXijRD6YTz0WlLkeuJfH3A9bp0JurV+Oxb/+gbtESauno/gKrdA0s0QrIZgGpf0dn6lPjp h94wT8SCxfoDDvEyDUSyuW+M2ncEAx9QbGHWv2Dte6IDXtnC+pZY/HlBXnlnOt5IhLwjlO yBIP3ZMINYPD4CQ0UH9bqGsTNJBYuGTnHSazfE3UhM1jrllEIbThRpB1z4EHHWrqe40d03 xBfv8GdRbGga8BHv7ECMRPwOuyIJNd22QY/4sdE6ZbM2Nla3A0QO4eo9/miDnQ== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (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 4R4VKM1hzdz1NRH; Mon, 17 Jul 2023 18:02:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> Date: Mon, 17 Jul 2023 11:02:13 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh , Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 10:58 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 11:54 AM Konstantin Belousov > wrote: > >> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: >>> On Mon, Jul 17, 2023 at 11:15 AM John Baldwin wrote: >>> >>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote: >>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: >>>>>> The branch main has been updated by jhb: >>>>>> >>>>>> URL: >>>> >> https://cgit.FreeBSD.org/src/commit/?id=60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> >>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> Author: John Baldwin >>>>>> AuthorDate: 2023-07-14 18:30:31 +0000 >>>>>> Commit: John Baldwin >>>>>> CommitDate: 2023-07-14 18:32:16 +0000 >>>>>> >>>>>> memdesc: Retire MEMDESC_CCB. >>>>>> >>>>>> Instead, change memdesc_ccb to examine the CCB and return a >>>> memdesc of >>>>>> a more generic type describing the data buffer. >>>>> >>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >>>>>> index 65a08aeba17c..bfaad30b37d3 100644 >>>>>> --- a/sys/kern/subr_bus_dma.c >>>>>> +++ b/sys/kern/subr_bus_dma.c >>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, >>>> bus_dmamap_t map, >>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, >>>> bus_dmamap_t map, union ccb *ccb, >>>>>> + mem = memdesc_ccb(ccb); >>>>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >>>> callback_arg, >>>>>> + flags)); >>>>>> } >>>>> This makes kernel not linkable if CAM is not included into it. >>>> >>>> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern >>>> somewhere >>>> (like the kern_memdesc.c file in my other pending review), or we can >> #ifdef >>>> this function. It probably doesn't make sense to have a >>>> bus_dmamap_load_ccb >>>> if you don't have CAM, so I think I prefer the second option. >>>> >>> >>> MINIMAL doesn't have CAM configured, but it is loadable as a module. >>> >>> I'd think we'd want a dummy one fo these with weak symbol binding and >> have >>> the actual >>> one live in cam somewhere that overrides this symbol. >> The symbol resolution does not work this way in kernel. And it cannot >> made working this way even in theory, because cam.ko is loadable at >> runtime. >> > > Yea... It could, if we have perfect knowledge of all the places that it is > called. > But I don't think we do, now that I think about it... so yes, it's good to > want things, > but in this case my desire cannot exist, I agree. > > >> I believe the only feasible solution is to move memdesc_ccb() into kernel >> unconditionally. >> > > Or if it was in cam.h and made a static inline. It's short enough that > won't bloat > the kernel in the half a dozen places its called, and it would give similar > performance > to what we have today with the half a dozen nearly identical copies of > this routine. > And since it's all done with structure dancing, there's no other bits of > CAM that would > be brought into the kernel. I would be happy with an inline actually, I wasn't sure originally if that was too invasive in terms of the header bloat it would entail, in particular if it lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? -- John Baldwin From nobody Mon Jul 17 18:07:18 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VRR1PDQz4nkWH for ; Mon, 17 Jul 2023 18:07:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VRR0rwDz3J4g for ; Mon, 17 Jul 2023 18:07:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-51e48e1f6d1so6472376a12.1 for ; Mon, 17 Jul 2023 11:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689617250; x=1692209250; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CAiGct4Kwgbcxtc8KYL/QbhmHtpv8pkn7Cp/8NCsYYM=; b=y/9RuUO66DM44vNrHsIWK9nIEs6aH3eOdnAA1B7N3dtHBbZPYsbnE1BvL3HUgw8IQF 0M2V2O3sm8b5qrS9xJPXpuiPY4Yzc6piwLQJ5PXwOK1sHYkXPQfLKFDhKGtnPIey17eu DtfBTO7mM9rBDXkqvFoSSO74OqhEKs600SePu394/XX//3iC5WYFyZ14ja1m4rRIa+7F nbwJfh9ssarVFlWraHZiJ39nmtHvYOyH8LBnCemxHBFOC/6wSmnS71Q+Ng3JBvb+Le84 d1moPtalkx8ttcOf1yencFzUT9th18naaS4VSjSCdXl2//Lryvb3EgHGL2UWjV0cGPpu wrwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689617250; x=1692209250; 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=CAiGct4Kwgbcxtc8KYL/QbhmHtpv8pkn7Cp/8NCsYYM=; b=DKdn8MZWUY0UqNrjSqGLGRuxP8Nofz7GIGIkJKcW4mhV4mihT8SWT2CyTwG22ilyH1 dcNU0Rn6UN2kKAVTMsQY1MUg4fvRA5uv45EEjVAT7pz3cPQEbT1W3ro8cdmOqWnOkb7X ogGpreYN+6tkp5GyoQZ5tn6ccPX9p221d1+nwkQfgN/4lZIUYjA3R9W/zZ7sAK0bRNZr h8zKKlswpLNPnelSg7IK74yeVWdqwygP6JLQZe7/rNx8os2/Ez4PVjxCBixEdwArF8F4 MMbywHaxEpZXXyNuf1+2AzeqZkvnGHXTC1qSgRRaq7+ievKmFvYDQu3iqFCiwEh4Ad12 wEfA== X-Gm-Message-State: ABy/qLb+V4l1tyFF9jz6xGcO2dR7Ao350UeSPzTQwPCDfoA9UFnSLq+E gpxCVLcnonTffckZecNIH9wLaNKy3B9SsVnCXgRyJnB4SnoEgqGTuDs= X-Google-Smtp-Source: APBJJlFAINnF7ilTn4NqEaxSlhCZI7kVqq6AgUodzYt7ctOQxnBiATB7Da92bcx5Wv9KRtMCevOX5swLxujyu+QfZe8= X-Received: by 2002:aa7:d418:0:b0:51e:291b:cc66 with SMTP id z24-20020aa7d418000000b0051e291bcc66mr12367417edq.36.1689617249799; Mon, 17 Jul 2023 11:07:29 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> In-Reply-To: <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 12:07:18 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000fb29400600b2abd3" X-Rspamd-Queue-Id: 4R4VRR0rwDz3J4g X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000fb29400600b2abd3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin wro= te: > On 7/17/23 10:58 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov < > kostikbel@gmail.com> > > wrote: > > > >> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote: > >>> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin wrote: > >>> > >>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote: > >>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin wrote: > >>>>>> The branch main has been updated by jhb: > >>>>>> > >>>>>> URL: > >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d= 987cab858 > >>>>>> > >>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 > >>>>>> Author: John Baldwin > >>>>>> AuthorDate: 2023-07-14 18:30:31 +0000 > >>>>>> Commit: John Baldwin > >>>>>> CommitDate: 2023-07-14 18:32:16 +0000 > >>>>>> > >>>>>> memdesc: Retire MEMDESC_CCB. > >>>>>> > >>>>>> Instead, change memdesc_ccb to examine the CCB and return a > >>>> memdesc of > >>>>>> a more generic type describing the data buffer. > >>>>> > >>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > >>>>>> index 65a08aeba17c..bfaad30b37d3 100644 > >>>>>> --- a/sys/kern/subr_bus_dma.c > >>>>>> +++ b/sys/kern/subr_bus_dma.c > >>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_dma_tag_t dmat, > >>>> bus_dmamap_t map, > >>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_tag_t dmat, > >>>> bus_dmamap_t map, union ccb *ccb, > >>>>>> + mem =3D memdesc_ccb(ccb); > >>>>>> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > >>>> callback_arg, > >>>>>> + flags)); > >>>>>> } > >>>>> This makes kernel not linkable if CAM is not included into it. > >>>> > >>>> Hmmm, ok. I can either move the memdesc_ccb routine into sys/kern > >>>> somewhere > >>>> (like the kern_memdesc.c file in my other pending review), or we can > >> #ifdef > >>>> this function. It probably doesn't make sense to have a > >>>> bus_dmamap_load_ccb > >>>> if you don't have CAM, so I think I prefer the second option. > >>>> > >>> > >>> MINIMAL doesn't have CAM configured, but it is loadable as a module. > >>> > >>> I'd think we'd want a dummy one fo these with weak symbol binding and > >> have > >>> the actual > >>> one live in cam somewhere that overrides this symbol. > >> The symbol resolution does not work this way in kernel. And it cannot > >> made working this way even in theory, because cam.ko is loadable at > >> runtime. > >> > > > > Yea... It could, if we have perfect knowledge of all the places that it > is > > called. > > But I don't think we do, now that I think about it... so yes, it's good > to > > want things, > > but in this case my desire cannot exist, I agree. > > > > > >> I believe the only feasible solution is to move memdesc_ccb() into > kernel > >> unconditionally. > >> > > > > Or if it was in cam.h and made a static inline. It's short enough that > > won't bloat > > the kernel in the half a dozen places its called, and it would give > similar > > performance > > to what we have today with the half a dozen nearly identical copies of > > this routine. > > And since it's all done with structure dancing, there's no other bits o= f > > CAM that would > > be brought into the kernel. > > I would be happy with an inline actually, I wasn't sure originally if tha= t > was > too invasive in terms of the header bloat it would entail, in particular > if it > lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? > cam_ccb.h likely is fine, and logically it does belong there more than cam.= h now that you mention it... And only sys/kern/subr_bus_dma.c needs it, since that's the only place that calls if my grep can be believed. Warner --000000000000fb29400600b2abd3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 10:58 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov <
kostikbel@gmail.com= >
> wrote:
>
>> On Mon, Jul 17, 2023 at 11:29:20AM -0600, Warner Losh wrote:
>>> On Mon, Jul 17, 2023 at 11:15=E2=80=AFAM John Baldwin <jhb@freebsd.org> wr= ote:
>>>
>>>> On 7/17/23 8:48 AM, Konstantin Belousov wrote:
>>>>> On Fri, Jul 14, 2023 at 06:41:03PM +0000, John Baldwin= wrote:
>>>>>> The branch main has been updated by jhb:
>>>>>>
>>>>>> URL:
>>>>
>> https://c= git.FreeBSD.org/src/commit/?id=3D60381fd1ee8668ea1e4676a6128883d987cab858
>>>>>>
>>>>>> commit 60381fd1ee8668ea1e4676a6128883d987cab858 >>>>>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@Fr= eeBSD.org>
>>>>>> AuthorDate: 2023-07-14 18:30:31 +0000
>>>>>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@Fr= eeBSD.org>
>>>>>> CommitDate: 2023-07-14 18:32:16 +0000
>>>>>>
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0memdesc: Retire MEMDESC_= CCB.
>>>>>>
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Instead, change memdesc_= ccb to examine the CCB and return a
>>>> memdesc of
>>>>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0a more generic type desc= ribing the data buffer.
>>>>>
>>>>>> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/su= br_bus_dma.c
>>>>>> index 65a08aeba17c..bfaad30b37d3 100644
>>>>>> --- a/sys/kern/subr_bus_dma.c
>>>>>> +++ b/sys/kern/subr_bus_dma.c
>>>>>> @@ -304,94 +304,6 @@ bus_dmamap_load_ma_triv(bus_d= ma_tag_t dmat,
>>>> bus_dmamap_t map,
>>>>>> @@ -566,49 +478,18 @@ bus_dmamap_load_ccb(bus_dma_= tag_t dmat,
>>>> bus_dmamap_t map, union ccb *ccb,
>>>>>> +=C2=A0 =C2=A0 mem =3D memdesc_ccb(ccb);
>>>>>> +=C2=A0 =C2=A0 return (bus_dmamap_load_mem(dmat, m= ap, &mem, callback,
>>>> callback_arg,
>>>>>> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 flags));
>>>>>>=C2=A0 =C2=A0 }
>>>>> This makes kernel not linkable if CAM is not included = into it.
>>>>
>>>> Hmmm, ok.=C2=A0 I can either move the memdesc_ccb routine = into sys/kern
>>>> somewhere
>>>> (like the kern_memdesc.c file in my other pending review),= or we can
>> #ifdef
>>>> this function.=C2=A0 It probably doesn't make sense to= have a
>>>> bus_dmamap_load_ccb
>>>> if you don't have CAM, so I think I prefer the second = option.
>>>>
>>>
>>> MINIMAL doesn't have CAM configured, but it is loadable as= a module.
>>>
>>> I'd think we'd want a dummy one fo these with weak sym= bol binding and
>> have
>>> the actual
>>> one live in cam somewhere that overrides this=C2=A0 symbol. >> The symbol resolution does not work this way in kernel.=C2=A0 And = it cannot
>> made working this way even in theory, because cam.ko is loadable a= t
>> runtime.
>>
>
> Yea... It could, if we have perfect knowledge of all the places that i= t is
> called.
> But I don't think we do, now that I think about it... so yes, it&#= 39;s good to
> want things,
> but in this case my desire cannot exist, I agree.
>
>
>> I believe the only feasible solution is to move memdesc_ccb() into= kernel
>> unconditionally.
>>
>
> Or if it was in cam.h and made a static inline. It's short enough = that
> won't bloat
> the kernel in the half a dozen places its called, and it would give si= milar
> performance
> to what we have today with the half a dozen nearly identical copies of=
> this routine.
> And since it's all done with structure dancing, there's no oth= er bits of
> CAM that would
> be brought into the kernel.

I would be happy with an inline actually, I wasn't sure originally if t= hat was
too invasive in terms of the header bloat it would entail, in particular if= it
lived in sys/memdesc.h, but maybe it could live in cam_ccb.h?

cam_ccb.h likely is fine, and logically it does belo= ng there more than cam.h
now that you mention it...=C2=A0 And onl= y sys/kern/subr_bus_dma.c needs it,
since that's the only pla= ce that calls if my grep can be believed.

Warner
--000000000000fb29400600b2abd3-- From nobody Mon Jul 17 18:11:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VXW56txz4nmNh; Mon, 17 Jul 2023 18:11:55 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VXW4bkFz3KRV; Mon, 17 Jul 2023 18:11:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689617515; 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=KbhjIqneWzFLPAcF8X//2Aneg1LCGMXfm5lTbgwkTqo=; b=BLpMDKhk6SFcHXzo/2qbv41K5H1trQeC7UN1ZC5B1rE/703KN3U7yW3JrwYFVT9umS4aBo jYt57olIOK+PuxrGKk0Z42MeC8zzvOcQuBl5UpISgndRiNBlO8HfdoYVCo+5jVjqGnEMS+ V3SO9RO7CF/ff361nzDox/KNVqIwg7ma8UFS7jfg3X48G0TII04G8HR4Q/snznbhomovg6 wzxi5g2/MfqDYFRzHcDttdrs7hACRatM6zAQ+l9WNbqOY79+n1BDoxJ33dYd5NE8Z5dE/X rNq8oSA41IZziTi5z5+LkB1uL18fMB1sMwIEVUckRHngS9KtoPuN8wI4A2zbBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689617515; 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=KbhjIqneWzFLPAcF8X//2Aneg1LCGMXfm5lTbgwkTqo=; b=OmNhVuMR+p8drpnGYQhFeQjoVwq7c6CjT40hyoxcb5S6WHoNn8Mmu11OgFKF5BnJi22bIk LYPKn/6Ekj5k/gnqck1ubtbBlBu+7wa6s+6kON6WP7AOmYB2dNBL4J4Cel2rTBPMTn/+ec 5+EEbj1RJSqv8WekqzVFvT9whHdtI5gRBbP+Qx73T2T46lz6Yi/ts8Rz5GPhfR89eFm6ef 8HyZ9Ar+BFRiPpQf3FAvxHW6Qc7NnNzHQ2UExVrOWcN4F1Z72dJKgWwqlYrn0MIybqxMp8 2fXqv0LlOQ6w058QXo4t7wxo8cfVcZPcBSWURxhy0yK/04Xo22ZGtPvGqIzrhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689617515; a=rsa-sha256; cv=none; b=iQOXp0Itfoqv2S0cyhWRcdyvLB/ywwQ+GdDejXIAQ+fG0mFM/3XKu0g0ilfVXt3RNNFsLA dwC9cFPPbB74nDKdZIFrejTBpsFIyVIv0eyJ1izWFha9Yj7uCFma6AGjdiP3nkW9zRK2oR mIn0FO3ZDuQtfFyIXV0sj56m6n7HYQ4sOoN2EQRr/DBaGDVd23dSsqXHVKPS2sUabGYbQW J5VRDuPPtM0ZeqQYYz05VHsyWPZfSVWjJtJmaPH2chHrFoXFcD5uqrpbN10X4hUg/rs9SA U+A6Iz8eHBzP0kebXawQ1Mwg8LR51h3fjXuL/zDuwbBJ29vtRNX4gu1BQ68IZw== Received: from [IPV6:2601:648:8680:16b0:2c33:b8f1:d09:3750] (unknown [IPv6:2601:648:8680:16b0:2c33:b8f1:d09:3750]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R4VXW03pPz1Nx7; Mon, 17 Jul 2023 18:11:54 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> Date: Mon, 17 Jul 2023 11:11:54 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. Content-Language: en-US To: Warner Losh Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N On 7/17/23 11:07 AM, Warner Losh wrote: > On Mon, Jul 17, 2023 at 12:02 PM John Baldwin wrote: > >> On 7/17/23 10:58 AM, Warner Losh wrote: >>> On Mon, Jul 17, 2023 at 11:54 AM Konstantin Belousov < >> kostikbel@gmail.com> >>> wrote: >>> Or if it was in cam.h and made a static inline. It's short enough that >>> won't bloat >>> the kernel in the half a dozen places its called, and it would give >> similar >>> performance >>> to what we have today with the half a dozen nearly identical copies of >>> this routine. >>> And since it's all done with structure dancing, there's no other bits of >>> CAM that would >>> be brought into the kernel. >> >> I would be happy with an inline actually, I wasn't sure originally if that >> was >> too invasive in terms of the header bloat it would entail, in particular >> if it >> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? >> > > cam_ccb.h likely is fine, and logically it does belong there more than cam.h > now that you mention it... And only sys/kern/subr_bus_dma.c needs it, > since that's the only place that calls if my grep can be believed. I use it in my NVMeoF host, but that is also already including cam_ccb.h since it needs to know about CCB internals anyway. -- John Baldwin From nobody Mon Jul 17 18:20:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Vk906K8z4nr98 for ; Mon, 17 Jul 2023 18:20:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Vk86lfvz3NpJ for ; Mon, 17 Jul 2023 18:20:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-51cff235226so10001844a12.0 for ; Mon, 17 Jul 2023 11:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689618016; x=1692210016; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GtLHzIGNIexbYaVc7vAE90iDks3XGSLuvIK7UQ7+620=; b=oFP0EYm1+ZIJyl6PVd6/BbhYmzCDPRfIC1CwDEIsdSfoeztdLgv3JRrTZutTeZsupy AcZh3iB4W2IHCqASFV6wXU6WRtSvyNvHhcIYYKX48PRaeicXEN/fbIo+N2fQa3U/XWzz OXChzasnJyagCwxdByif0fGa+0Kd2ES9b9eN/E1ePxuEIY8YiD/vql7n3vG1bA8cZTsY 2s7mbEgyC9gYvemRYk4rwa3nbys4HEGkZSqFIslmYh2nFGWI2a4EZH2uwHUqPObTchqe bsgrK+F2UgEdNqFqsreAZV+6FpaSQ0QFeQSqQpP0ogFKyLTsFeMR5fxC+20P+QfHG1nE iLOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689618016; x=1692210016; 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=GtLHzIGNIexbYaVc7vAE90iDks3XGSLuvIK7UQ7+620=; b=eIPrHkBUtQoa9NjcpDAvIepTuEVZyJ+9lO/6mx4YqbZS8b4069Lv8PqrcfVvsF7OYr ushsAUJHq1ERzxe1eXib/b/dsxBdLbz/rt6t2YwXAuItZpUYWvsNdKJTA4RCCIjwgZVT iGESyRkipN1uvveV33ZPTrEuIcQ69BsjBvtHMpcmLQQlze37uAWL5ZdsHPcHKJu4R3FW QNdoh0f6wh8KDInM6/Z0yPDLMx/juB8rTTbcl+rRQRISlrejRytPbhXZjjlcWeYielrk 7P0XvbyH9kYz/IKuBfQvqISrhFNfCEM4Z4ai86NAgRw/lA7FzF+VeR2GDuHxur2+MXu9 tklg== X-Gm-Message-State: ABy/qLb3FI/tlZy+IQMTTlCLLlZjlMHJgf7MSBCW7juZnf2stClMfuQs hlzqIISRXSGNq+NDMnK1SvTxdK2dBZese66ntB7+lA== X-Google-Smtp-Source: APBJJlEFBnFqRs6Vx5jI/FizuzVrUgJqEOgadoTJooUtcaOpkI4+lyEgrHP6j2N1r5uSAu51Xvv7U3h/yFJf4KSRs0U= X-Received: by 2002:a05:6402:1857:b0:521:7667:3c7a with SMTP id v23-20020a056402185700b0052176673c7amr7698444edy.19.1689618015858; Mon, 17 Jul 2023 11:20:15 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307141841.36EIf3f0019403@gitrepo.freebsd.org> <65d7d8d8-9f98-abd2-1ce3-ae3a2d3bf111@FreeBSD.org> <92656b28-8bfa-23a9-2683-23ccb817b8a7@FreeBSD.org> <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> In-Reply-To: <09687219-240b-c1a5-8e5a-956b231854d5@FreeBSD.org> From: Warner Losh Date: Mon, 17 Jul 2023 12:20:04 -0600 Message-ID: Subject: Re: git: 60381fd1ee86 - main - memdesc: Retire MEMDESC_CCB. To: John Baldwin Cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000a445b00600b2d9d1" X-Rspamd-Queue-Id: 4R4Vk86lfvz3NpJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000a445b00600b2d9d1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jul 17, 2023 at 12:11=E2=80=AFPM John Baldwin wro= te: > On 7/17/23 11:07 AM, Warner Losh wrote: > > On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin = wrote: > > > >> On 7/17/23 10:58 AM, Warner Losh wrote: > >>> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov < > >> kostikbel@gmail.com> > >>> wrote: > >>> Or if it was in cam.h and made a static inline. It's short enough tha= t > >>> won't bloat > >>> the kernel in the half a dozen places its called, and it would give > >> similar > >>> performance > >>> to what we have today with the half a dozen nearly identical copies o= f > >>> this routine. > >>> And since it's all done with structure dancing, there's no other bits > of > >>> CAM that would > >>> be brought into the kernel. > >> > >> I would be happy with an inline actually, I wasn't sure originally if > that > >> was > >> too invasive in terms of the header bloat it would entail, in particul= ar > >> if it > >> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h? > >> > > > > cam_ccb.h likely is fine, and logically it does belong there more than > cam.h > > now that you mention it... And only sys/kern/subr_bus_dma.c needs it, > > since that's the only place that calls if my grep can be believed. > > I use it in my NVMeoF host, but that is also already including cam_ccb.h > since > it needs to know about CCB internals anyway. > Yea, that sounds like 2 copies in memory of a routine that's kinda small and might be worth the performance improvement with fewer function calls (and even if it not, the hundred or so bytes is a small price to fix this issue, and we do way worse for much flimsier reasons elsewhere in the kernel). Warner --000000000000a445b00600b2d9d1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On= 7/17/23 11:07 AM, Warner Losh wrote:
> On Mon, Jul 17, 2023 at 12:02=E2=80=AFPM John Baldwin <
jhb@freebsd.org> wrote:
>
>> On 7/17/23 10:58 AM, Warner Losh wrote:
>>> On Mon, Jul 17, 2023 at 11:54=E2=80=AFAM Konstantin Belousov &= lt;
>> kostikbel= @gmail.com>
>>> wrote:
>>> Or if it was in cam.h and made a static inline. It's short= enough that
>>> won't bloat
>>> the kernel in the half a dozen places its called, and it would= give
>> similar
>>> performance
>>> to what we have today with the half a dozen nearly identical c= opies of
>>> this routine.
>>> And since it's all done with structure dancing, there'= s no other bits of
>>> CAM that would
>>> be brought into the kernel.
>>
>> I would be happy with an inline actually, I wasn't sure origin= ally if that
>> was
>> too invasive in terms of the header bloat it would entail, in part= icular
>> if it
>> lived in sys/memdesc.h, but maybe it could live in cam_ccb.h?
>>
>
> cam_ccb.h likely is fine, and logically it does belong there more than= cam.h
> now that you mention it...=C2=A0 And only sys/kern/subr_bus_dma.c need= s it,
> since that's the only place that calls if my grep can be believed.=

I use it in my NVMeoF host, but that is also already including cam_ccb.h si= nce
it needs to know about CCB internals anyway.

Yea, that sounds like 2 copies in memory of a routine that's kind= a small and might
be worth the performance improvement with fewer= function calls (and even if it not,
the hundred or so bytes is a= small price to fix this issue, and we do way worse for
much flim= sier reasons elsewhere in the kernel).

Warner=C2= =A0
--000000000000a445b00600b2d9d1-- From nobody Mon Jul 17 18:31:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4VzR17vSz4nx5M; Mon, 17 Jul 2023 18:31:47 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4VzQ6GTGz3h3k; Mon, 17 Jul 2023 18:31:46 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:d9af:819d:341a:8c06]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id 049A47120E83E; Mon, 17 Jul 2023 20:31:41 +0200 (CEST) Content-Type: text/plain; charset=utf-8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd From: tuexen@freebsd.org In-Reply-To: Date: Mon, 17 Jul 2023 20:31:41 +0200 Cc: John Baldwin , Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <98645F20-A699-4C32-8485-7ECF4C95E8A6@freebsd.org> References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R4VzQ6GTGz3h3k X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On 17. Jul 2023, at 19:54, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin = wrote: > On 7/17/23 10:35 AM, Warner Losh wrote: >> The branch main has been updated by imp: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a118= 7ab82057 >>=20 >> commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 >> Author: Warner Losh >> AuthorDate: 2023-07-17 17:22:45 +0000 >> Commit: Warner Losh >> CommitDate: 2023-07-17 17:22:45 +0000 >>=20 >> tcbpcb: Always define t_osd >>=20 >> Always define t_osd. congestion control modules access it >> unconditionally. This fixes the build. >>=20 >> However, this is, at best, a temporary band-aide until the >> larger issues are sorted. >>=20 >> Sponsored by: Netflix >=20 > FWIW, I find that #ifdef's based on kernel options in "core" = structures like this > shared with modules is a recipe for disaster. >=20 > Agreed 100% Just trying to get to closure on that concept with all the = concerned > parties.... Just discussed this issue with rrs@. The proposal includes this. Will = bring up a review shortly. I will put you on the reviewers list. Best regards Michael >=20 > Warner=20 From nobody Mon Jul 17 18:46:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4WJt2QnGz4mrBS; Mon, 17 Jul 2023 18:46:54 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mx-out-01.fh-muenster.de (mx-out-01.fh-muenster.de [185.149.214.63]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mx.fh-muenster.de", Issuer "GEANT OV RSA CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4WJt0LwBz3lR0; Mon, 17 Jul 2023 18:46:53 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Authentication-Results: mx1.freebsd.org; none Received: from mail-director-01.fh-muenster.de (mail-director-01.fh-muenster.de [185.149.215.227]) by mx-out-01.fh-muenster.de (Postfix) with ESMTPS id C21352003D; Mon, 17 Jul 2023 20:46:51 +0200 (CEST) Received: from smtpclient.apple (ip4d15f6ca.dynamic.kabel-deutschland.de [77.21.246.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: tuexen) by mail-director-01.fh-muenster.de (Postfix) with ESMTPSA id 24B5D1A004B; Mon, 17 Jul 2023 20:46:51 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A"; protocol="application/pkcs7-signature"; micalg=sha-256 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: d3152ab23e0e - main - tcbpcb: Always define t_osd From: tuexen@fh-muenster.de In-Reply-To: Date: Mon, 17 Jul 2023 20:46:50 +0200 Cc: John Baldwin , Warner Losh , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307171735.36HHZonv063454@gitrepo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3731.600.7) X-Rspamd-Queue-Id: 4R4WJt0LwBz3lR0 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:185.149.212.0/22, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 17. Jul 2023, at 19:54, Warner Losh wrote: >=20 >=20 >=20 > On Mon, Jul 17, 2023 at 11:52=E2=80=AFAM John Baldwin = wrote: > On 7/17/23 10:35 AM, Warner Losh wrote: > > The branch main has been updated by imp: > >=20 > > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd3152ab23e0e7bee5a0f988ecca2a118= 7ab82057 > >=20 > > commit d3152ab23e0e7bee5a0f988ecca2a1187ab82057 > > Author: Warner Losh > > AuthorDate: 2023-07-17 17:22:45 +0000 > > Commit: Warner Losh > > CommitDate: 2023-07-17 17:22:45 +0000 > >=20 > > tcbpcb: Always define t_osd > > =20 > > Always define t_osd. congestion control modules access it > > unconditionally. This fixes the build. > > =20 > > However, this is, at best, a temporary band-aide until the > > larger issues are sorted. > > =20 > > Sponsored by: Netflix >=20 > FWIW, I find that #ifdef's based on kernel options in "core" = structures like this > shared with modules is a recipe for disaster. >=20 > Agreed 100% Just trying to get to closure on that concept with all the = concerned > parties.... Have a look at https://reviews.freebsd.org/D41059 and let us come to an agreement there. Best regards Michael >=20 > Warner=20 --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEfMw ggUSMIID+qADAgECAgkA4wvV+K8l2YEwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAkRFMSsw KQYDVQQKDCJULVN5c3RlbXMgRW50ZXJwcmlzZSBTZXJ2aWNlcyBHbWJIMR8wHQYDVQQLDBZULVN5 c3RlbXMgVHJ1c3QgQ2VudGVyMSUwIwYDVQQDDBxULVRlbGVTZWMgR2xvYmFsUm9vdCBDbGFzcyAy MB4XDTE2MDIyMjEzMzgyMloXDTMxMDIyMjIzNTk1OVowgZUxCzAJBgNVBAYTAkRFMUUwQwYDVQQK EzxWZXJlaW4genVyIEZvZXJkZXJ1bmcgZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMg ZS4gVi4xEDAOBgNVBAsTB0RGTi1QS0kxLTArBgNVBAMTJERGTi1WZXJlaW4gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkgMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMtg1/9moUHN0vqH l4pzq5lN6mc5WqFggEcVToyVsuXPztNXS43O+FZsFVV2B+pG/cgDRWM+cNSrVICxI5y+NyipCf8F XRgPxJiZN7Mg9mZ4F4fCnQ7MSjLnFp2uDo0peQcAIFTcFV9Kltd4tjTTwXS1nem/wHdN6r1ZB+Ba L2w8pQDcNb1lDY9/Mm3yWmpLYgHurDg0WUU2SQXaeMpqbVvAgWsRzNI8qIv4cRrKO+KA3Ra0Z3qL NupOkSk9s1FcragMvp0049ENF4N1xDkesJQLEvHVaY4l9Lg9K7/AjsMeO6W/VRCrKq4Xl14zzsjz 9AkH4wKGMUZrAcUQDBHHWekCAwEAAaOCAXQwggFwMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU k+PYMiba1fFKpZFK4OpL4qIMz+EwHwYDVR0jBBgwFoAUv1kgNgB5oKAia4zV8mHSuCzLgkowEgYD VR0TAQH/BAgwBgEB/wIBAjAzBgNVHSAELDAqMA8GDSsGAQQBga0hgiwBAQQwDQYLKwYBBAGBrSGC LB4wCAYGZ4EMAQICMEwGA1UdHwRFMEMwQaA/oD2GO2h0dHA6Ly9wa2kwMzM2LnRlbGVzZWMuZGUv cmwvVGVsZVNlY19HbG9iYWxSb290X0NsYXNzXzIuY3JsMIGGBggrBgEFBQcBAQR6MHgwLAYIKwYB BQUHMAGGIGh0dHA6Ly9vY3NwMDMzNi50ZWxlc2VjLmRlL29jc3ByMEgGCCsGAQUFBzAChjxodHRw Oi8vcGtpMDMzNi50ZWxlc2VjLmRlL2NydC9UZWxlU2VjX0dsb2JhbFJvb3RfQ2xhc3NfMi5jZXIw DQYJKoZIhvcNAQELBQADggEBAIcL/z4Cm2XIVi3WO5qYi3FP2ropqiH5Ri71sqQPrhE4eTizDnS6 dl2e6BiClmLbTDPo3flq3zK9LExHYFV/53RrtCyD2HlrtrdNUAtmB7Xts5et6u5/MOaZ/SLick0+ hFvu+c+Z6n/XUjkurJgARH5pO7917tALOxrN5fcPImxHhPalR6D90Bo0fa3SPXez7vTXTf/D6OWS T1k+kEcQSrCFWMBvf/iu7QhCnh7U3xQuTY+8npTD5+32GPg8SecmqKc22CzeIs2LgtjZeOJVEqM7 h0S2EQvVDFKvaYwPBt/QolOLV5h7z/0HJPT8vcP9SpIClxvyt7bPZYoaorVyGTkwggWsMIIElKAD AgECAgcbY7rQHiw9MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYDVQQGEwJERTFFMEMGA1UEChM8VmVy ZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYu MRAwDgYDVQQLEwdERk4tUEtJMS0wKwYDVQQDEyRERk4tVmVyZWluIENlcnRpZmljYXRpb24gQXV0 aG9yaXR5IDIwHhcNMTYwNTI0MTEzODQwWhcNMzEwMjIyMjM1OTU5WjCBjTELMAkGA1UEBhMCREUx RTBDBgNVBAoMPFZlcmVpbiB6dXIgRm9lcmRlcnVuZyBlaW5lcyBEZXV0c2NoZW4gRm9yc2NodW5n c25ldHplcyBlLiBWLjEQMA4GA1UECwwHREZOLVBLSTElMCMGA1UEAwwcREZOLVZlcmVpbiBHbG9i YWwgSXNzdWluZyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ07eRxH3h+Gy8Zp 1xCeOdfZojDbchwFfylfS2jxrRnWTOFrG7ELf6Gr4HuLi9gtzm6IOhDuV+UefwRRNuu6cG1joL6W LkDh0YNMZj0cZGnlm6Stcq5oOVGHecwX064vXWNxSzl660Knl5BpBb+Q/6RAcL0D57+eGIgfn5mI TQ5HjUhfZZkQ0tkqSe3BuS0dnxLLFdM/fx5ULzquk1enfnjK1UriGuXtQX1TX8izKvWKMKztFwUk P7agCwf9TRqaA1KgNpzeJIdl5Of6x5ZzJBTN0OgbaJ4YWa52fvfRCng8h0uwN89Tyjo4EPPLR22M ZD08WkVKusqAfLjz56dMTM0CAwEAAaOCAgUwggIBMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0P AQH/BAQDAgEGMCkGA1UdIAQiMCAwDQYLKwYBBAGBrSGCLB4wDwYNKwYBBAGBrSGCLAEBBDAdBgNV HQ4EFgQUazqYi/nyU4na4K2yMh4JH+iqO3QwHwYDVR0jBBgwFoAUk+PYMiba1fFKpZFK4OpL4qIM z+EwgY8GA1UdHwSBhzCBhDBAoD6gPIY6aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9v dC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDBAoD6gPIY6aHR0cDovL2NkcDIucGNhLmRmbi5kZS9n bG9iYWwtcm9vdC1nMi1jYS9wdWIvY3JsL2NhY3JsLmNybDCB3QYIKwYBBQUHAQEEgdAwgc0wMwYI KwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2ZXIvT0NTUDBKBggrBgEF BQcwAoY+aHR0cDovL2NkcDEucGNhLmRmbi5kZS9nbG9iYWwtcm9vdC1nMi1jYS9wdWIvY2FjZXJ0 L2NhY2VydC5jcnQwSgYIKwYBBQUHMAKGPmh0dHA6Ly9jZHAyLnBjYS5kZm4uZGUvZ2xvYmFsLXJv b3QtZzItY2EvcHViL2NhY2VydC9jYWNlcnQuY3J0MA0GCSqGSIb3DQEBCwUAA4IBAQCBeEWkTqR/ DlXwCbFqPnjMaDWpHPOVnj/z+N9rOHeJLI21rT7H8pTNoAauusyosa0zCLYkhmI2THhuUPDVbmCN T1IxQ5dGdfBi5G5mUcFCMWdQ5UnnOR7Ln8qGSN4IFP8VSytmm6A4nwDO/afr0X9XLchMX9wQEZc+ lgQCXISoKTlslPwQkgZ7nu7YRrQbtQMMONncsKk/cQYLsgMHM8KNSGMlJTx6e1du94oFOO+4oK4v 9NsH1VuEGMGpuEvObJAaguS5Pfp38dIfMwK/U+d2+dwmJUFvL6Yb+qQTkPp8ftkLYF3sv8pBoGH7 EUkp2KgtdRXYShjqFu9VNCIaE40GMIIHKTCCBhGgAwIBAgIMJrRClNKRzetB0jc/MA0GCSqGSIb3 DQEBCwUAMIGNMQswCQYDVQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVp bmVzIERldXRzY2hlbiBGb3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUw IwYDVQQDDBxERk4tVmVyZWluIEdsb2JhbCBJc3N1aW5nIENBMB4XDTIyMDUzMDEzMjIxNVoXDTI1 MDUyOTEzMjIxNVowgcQxCzAJBgNVBAYTAkRFMRwwGgYDVQQIDBNOb3JkcmhlaW4tV2VzdGZhbGVu MREwDwYDVQQHDAhNdWVuc3RlcjEUMBIGA1UECgwLRkggTXVlbnN0ZXIxMjAwBgNVBAsMKUZhY2hi ZXJlaWNoIEVsZWt0cm90ZWNobmlrIHVuZCBJbmZvcm1hdGlrMQ8wDQYDVQQEDAZUdWV4ZW4xEDAO BgNVBCoMB01pY2hhZWwxFzAVBgNVBAMMDk1pY2hhZWwgVHVleGVuMIICIjANBgkqhkiG9w0BAQEF AAOCAg8AMIICCgKCAgEA2QZ7Uheto325SEnX2BTxBvYnz7u/BVmzxKlogaR4K0MA8ZcfNIdQkiJU efjL6imq21BSFsr/tXcODFZmPrvx9aIxjntCxmEFr7qFaw3e3mUIxJyj5n6BxjzZ/hyJte8LBDbj zj+e8WPUzXmYbSxtrh9kgw8NMx3+bo3Hslic+PkKEGx9JJp2I2TEs88xD0rHC2Ljwcfk6bS9jC+/ BAuY/TsbJoq+8d64DYSLGiIYbvMMuxM2C8BlpHLIOLx2FaH+uMqdH2dLVvCacZJ9YzHvvZY8O2nQ OBFCG1UMpX5YLHN8g/t02a+IBt+oe97JMdJ/kZsPjolI98dcRdzz0hTXZql2xvp6zlocm9iGTRcv dCSxy+0x4CIZD1EkVX9zCPGpzdTXnrU+zvnz14Uq3Wbfl3GiVgK0Avr1enfZepruAxAy7KGIm2zi /qY3XSkN8fvWJmYnomOjCRjaPtqS/azmnyeodsxlVhqQKbES65u/PbOXjOlhiYAvemS0IbK4iR76 3iSmkpwSNpJt6BCtFJN+w3Y8tztCP66KPPC1Fri1oj27KPaf04J66MkSjlQdpI7POS6lDyN7X2Hw tgZKRVA94h/JvZp4ld7mTzXTEW2tdO5azPILsL9xOYjSS5VIyUFF4MoxSbfZtXWaZFsMC1fXDNNL uRDrISotdwADuU75Fe0CAwEAAaOCAk4wggJKMD4GA1UdIAQ3MDUwDwYNKwYBBAGBrSGCLAEBBDAQ Bg4rBgEEAYGtIYIsAQEECjAQBg4rBgEEAYGtIYIsAgEECjAJBgNVHRMEAjAAMA4GA1UdDwEB/wQE AwIF4DAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwQwHQYDVR0OBBYEFFDbROYIxDr3fvlX tkXqx7T8lihxMB8GA1UdIwQYMBaAFGs6mIv58lOJ2uCtsjIeCR/oqjt0MCAGA1UdEQQZMBeBFXR1 ZXhlbkBmaC1tdWVuc3Rlci5kZTCBjQYDVR0fBIGFMIGCMD+gPaA7hjlodHRwOi8vY2RwMS5wY2Eu ZGZuLmRlL2Rmbi1jYS1nbG9iYWwtZzIvcHViL2NybC9jYWNybC5jcmwwP6A9oDuGOWh0dHA6Ly9j ZHAyLnBjYS5kZm4uZGUvZGZuLWNhLWdsb2JhbC1nMi9wdWIvY3JsL2NhY3JsLmNybDCB2wYIKwYB BQUHAQEEgc4wgcswMwYIKwYBBQUHMAGGJ2h0dHA6Ly9vY3NwLnBjYS5kZm4uZGUvT0NTUC1TZXJ2 ZXIvT0NTUDBJBggrBgEFBQcwAoY9aHR0cDovL2NkcDEucGNhLmRmbi5kZS9kZm4tY2EtZ2xvYmFs LWcyL3B1Yi9jYWNlcnQvY2FjZXJ0LmNydDBJBggrBgEFBQcwAoY9aHR0cDovL2NkcDIucGNhLmRm bi5kZS9kZm4tY2EtZ2xvYmFsLWcyL3B1Yi9jYWNlcnQvY2FjZXJ0LmNydDANBgkqhkiG9w0BAQsF AAOCAQEALubmL854icQMxKxOxQK+deXTjC6CLYnUDwB8MvnDC+BSeh3tUHT37fSgsK1ShNUSNJX0 YF0VYLfZ6+lPyaFYLArVrAIHqvDiVURaulB9NA+3gck/VSuRz4ILYBy61XbcGQQ8Wx+g6TcqsjsF oOhqEBycj5QuITj+EFmX8nvfo0dJtVa2OPDk1N9beLfQBcLhspJ/nv0pKhpNWv5YETG26YqYfsC7 FA/ZNGvRcoOPkjkDhBTtG+qq9DDD75XtGEBZhYXbnG15tn4/UV07B+UyK4/cqQSA+My5FML3YsQw EYrV9klVD/mLMOdZV5+95xt7O8IdYeHrBapVlhANH5bFazGCBJ0wggSZAgEBMIGeMIGNMQswCQYD VQQGEwJERTFFMEMGA1UECgw8VmVyZWluIHp1ciBGb2VyZGVydW5nIGVpbmVzIERldXRzY2hlbiBG b3JzY2h1bmdzbmV0emVzIGUuIFYuMRAwDgYDVQQLDAdERk4tUEtJMSUwIwYDVQQDDBxERk4tVmVy ZWluIEdsb2JhbCBJc3N1aW5nIENBAgwmtEKU0pHN60HSNz8wDQYJYIZIAWUDBAIBBQCgggHPMBgG CSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTIzMDcxNzE4NDY1MFowLwYJ KoZIhvcNAQkEMSIEIP/oF9XLvk/OzGts4pbGpBrr4JCzrfSNvMWEzRuKLIYYMIGvBgkrBgEEAYI3 EAQxgaEwgZ4wgY0xCzAJBgNVBAYTAkRFMUUwQwYDVQQKDDxWZXJlaW4genVyIEZvZXJkZXJ1bmcg ZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMgZS4gVi4xEDAOBgNVBAsMB0RGTi1QS0kx JTAjBgNVBAMMHERGTi1WZXJlaW4gR2xvYmFsIElzc3VpbmcgQ0ECDCa0QpTSkc3rQdI3PzCBsQYL KoZIhvcNAQkQAgsxgaGggZ4wgY0xCzAJBgNVBAYTAkRFMUUwQwYDVQQKDDxWZXJlaW4genVyIEZv ZXJkZXJ1bmcgZWluZXMgRGV1dHNjaGVuIEZvcnNjaHVuZ3NuZXR6ZXMgZS4gVi4xEDAOBgNVBAsM B0RGTi1QS0kxJTAjBgNVBAMMHERGTi1WZXJlaW4gR2xvYmFsIElzc3VpbmcgQ0ECDCa0QpTSkc3r QdI3PzANBgkqhkiG9w0BAQsFAASCAgBDRnt+HzqKV0beo7YRr1d4iu/d6vRazSaWSohCCfvueHNk rfgiLHGxBwRaLaFuioMPWdc3fjwkIJPvZ/EdgVNtHkIZBccf8OsGkvO/pqzK4RIyk5UfV6qt8i9P RKyF9OWHYX5Nk49iAoWw//L9uqVamrJ1vcWde4MwizgDrAobcijHMby18c+EbPePt/ewiH2+y40o UE3ljI3QkrmpkCFiD7c7/tcz9YJ9ccXPXkNb+yLffk2dHz5wsHtWYuPj/mmsXXhgUu0iBM0hlkit Ry0afZ8tHc22iOj5hzFsrCEW/qc9LGxykgpQRqrrbScsYkpTOesQPmbNmB5FjUhO1grCtb69nYrM lHkFqfJD9GPf5ks8pZm1aHDUb5IJQUJY00HqjFS8Gjna87GZWGNkRaeKplzAC3fvBOEuRkoGDLcY XqCxja+6my0nVf4nDC1/h3J/tYOXGB6iTDXhtiCB7dDaykSMpCqInmdqwu0TRugONE6aTycWppng FLIHe+tI/Inch2l5ah+4TqrWKIUrUwv2DWGk7pu7lSZLd+puDq3MwB/pqXlK6ymErxDq4jHmdPYf YZl6uzRbspvI7O1dNx7rMpRk3/dEDgkuEY0mtbSiMRIlpS6Vro3lxqtTEqwHCN7z6jnVMv74Qm3Q 1waOk6xcrWp/1FmG1zB5TdyLnC1FwQAAAAAAAA== --Apple-Mail=_72731636-4149-4BFF-BCD7-A9BF492B7E3A-- From nobody Mon Jul 17 19:04:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4Wj12NNFz4n0Kj; Mon, 17 Jul 2023 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4Wj11sqdz3q38; Mon, 17 Jul 2023 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DUtZoL0EX3VHHEMYKwhxJu2j7g7cUXhypWl+cKMWM=; b=I4PYLcLkrymb/DW2jfshxor1zbLf4c8Gr9WD2vyGfjRy3N9HqQFN6p+HQVq3zFxPjGC8UP 4Pyh0Ec6T68s6dFN+viAHuc24+3bjg/xDEZPnVtVuPn87HUI4hdTJQLFVDMm4skE2uzx+H cYrlZIotOn0TlOalrOr7wRrYA+4U5FvELZda7BZJblli1FBCaA9MJkCB9lpWWelhZ5vx8j J7OQwJXiZSjzN/crHUh6VvV0P9cd3OszVtKTZtFxhDMoviJx+SbEOsatLb0o8KHlP6Bjmk wtbMKB5bRm8qc0L8oytXyjALfvdfs+qsHR+L45BoLfIifvQoqZnIdTOCYVHkfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=g4DUtZoL0EX3VHHEMYKwhxJu2j7g7cUXhypWl+cKMWM=; b=BUHBc2WxuxBcYQtOD9VaRz6vlZfzyYlgvOa24e39PtNBjQ5KwRcHLLPnaTpBBg8nUVahB2 kfZdDlf0CqYIUNDuwhILSMgn61hFlLypbEeL2sVC0BaF7tCGsTm4joFeYduNNjXSNhsTUr g1sWIYSfWWunqOYIFbq4W98A1uW72guWiTmaOPuM1VJ/dVQjMETZM9wZ3hiZ/8t542tZ+L eiN2RCjlDghnCaPc0eUbIRa2rSgTCUnr8TIvoM/kcSP5kEke/wI0G6luc2FTdtNck0UrHj xhjkMkLsEWwtQoaVVxtHrVbRWFRCgi3uQHhEyiXEZXfr7vUQzqqyF7C3+JdLYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689620661; a=rsa-sha256; cv=none; b=sYwo0SEeEkBwZSyBpFwNVkgK6GzlwgnCgJoaG9uQ0tcgNodZwgdi55eBRii45pMUpk4TC0 pn/DBq46bAYvE/dEVp5XrTA/COjaQlJLWvrawVtpOtLkjZxo+opVaow4O6pns38M5GrMiK mXVcPbMP5OTglwDbTvB7RZvYXdsQcsHQvIsysG8lrSm+LYP3u1RYcLIaZKTfYVUcRd5Uaa MG45HhUG0T7P1wp5SYLQd55b4AolPuhVsxTeVQkoT7BVX7aLi2F7BhsY0dS8WW3eKBhbBu O4Ppl9Rp/3i7mBd7QA/+PNlnx2zn7w5aXAt7fWFBVPNhEwaZQSSvqPlKfqNX7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4Wj10rmFzbZT; Mon, 17 Jul 2023 19:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HJ4LtA013462; Mon, 17 Jul 2023 19:04:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HJ4L1l013461; Mon, 17 Jul 2023 19:04:21 GMT (envelope-from git) Date: Mon, 17 Jul 2023 19:04:21 GMT Message-Id: <202307171904.36HJ4L1l013461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Simon J. Gerraty" Subject: git: 89f361f742ae - main - kern.post.mk allow NEWVERS_{ENV,ARGS} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89f361f742aeae11c8b2e28eae3d015882b6c0ee Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=89f361f742aeae11c8b2e28eae3d015882b6c0ee commit 89f361f742aeae11c8b2e28eae3d015882b6c0ee Author: Simon J. Gerraty AuthorDate: 2023-07-17 19:03:35 +0000 Commit: Simon J. Gerraty CommitDate: 2023-07-17 19:03:35 +0000 kern.post.mk allow NEWVERS_{ENV,ARGS} Allow makefiles better control of newvers.sh env and args. Also allow variable overrides on command line. Reviewed by: imp, stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D41012 --- sys/conf/kern.post.mk | 5 +++-- sys/conf/newvers.sh | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/conf/kern.post.mk b/sys/conf/kern.post.mk index c368d5f40df8..45df83e2d16b 100644 --- a/sys/conf/kern.post.mk +++ b/sys/conf/kern.post.mk @@ -444,11 +444,12 @@ config.o env.o hints.o vers.o vnode_if.o: ${NORMAL_C} ${NORMAL_CTFCONVERT} +NEWVERS_ENV+= MAKE="${MAKE}" .if ${MK_REPRODUCIBLE_BUILD} != "no" -REPRO_FLAG="-R" +NEWVERS_ARGS+= -R .endif vers.c: .NOMETA_CMP $S/conf/newvers.sh $S/sys/param.h ${SYSTEM_DEP:Nvers.*} - MAKE="${MAKE}" sh $S/conf/newvers.sh ${REPRO_FLAG} ${KERN_IDENT} + ${NEWVERS_ENV} sh $S/conf/newvers.sh ${NEWVERS_ARGS} ${KERN_IDENT} vnode_if.c: $S/tools/vnode_if.awk $S/kern/vnode_if.src ${AWK} -f $S/tools/vnode_if.awk $S/kern/vnode_if.src -c diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 85346b1cdc29..e21b3f5ce2e2 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -58,13 +58,23 @@ BRANCH="CURRENT" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi -RELEASE="${REVISION}-${BRANCH}" -VERSION="${TYPE} ${RELEASE}" if [ -z "${SYSDIR}" ]; then - SYSDIR=$(dirname $0)/.. + SYSDIR=$(dirname $0)/.. fi +# allow random overrides +while : +do + case "$1" in + *=*) eval "$1"; shift;; + *) break;; + esac +done + +RELEASE="${RELEASE:-${REVISION}-${BRANCH}}" +VERSION="${VERSION:-${TYPE} ${RELEASE}}" + RELDATE=$(awk '/^#define[[:space:]]*__FreeBSD_version/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h}) if [ -r "${SYSDIR}/../COPYRIGHT" ]; then From nobody Mon Jul 17 19:08:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4WpF46XKz4n2Qt; Mon, 17 Jul 2023 19:08: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4WpF3cWgz3r1G; Mon, 17 Jul 2023 19:08:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4P3i5F8eIjmWmJHphUpnx/p1Obqhkq4/eJKEe4WRk4=; b=Ipf5WNhpgacUkqWjQtvKD5v5Q7Qsw1IRd3rkYNfDE6Vgbe+vJXY3ZIrDJJ4S4e6DL/0rrZ 8bUzIH0GsXh8lLvgzcBnmo+WdbJQbf+c5VvhCNBTIeUGF1GWSMz6t+VSvwGiXgNhhv+eX/ PN00Q/cOv3TstOW2qfw6GW9xRZnpOBZV0va69SsNxFWUJIeMCe8KbTtEQcufjQpuUS7u8i JR6i0QF+HMD14VKy/ITF1XgXNmxdM0Zb8QP7XC93cbR0Jgj7mBs5bXKniCISgodPo3Lfja /WfSkTaUh70hIkEsmAov7PxramFOpd5Za8lmveW4cCnhWq8WPlf5HzKAKcwf+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689620933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4P3i5F8eIjmWmJHphUpnx/p1Obqhkq4/eJKEe4WRk4=; b=gfoY4FFLIuWC3/pEfltgrWIgaxpPN5c5XzZ623jri3bhNjC+pDftPD+rPxY0e1GQIcGXdt BoYklnyN9HRezVCuLc33AutRpM5Vb400S8Rz7zxIAaarwF9hNThVE2pk0FRvIvpWcSh12y bItDkY/BP03SK4QXeBx0uurPOjosW0J5sTz8chFR2kEXbVKrzxIhAKLKxtoLlKfvIg6xGY EjtxXcJXMpnAh4Ctfp7KDZLUsBrecOQgdFQrAuX2fwMEsBXesf7R+mK/yaGGcGc/mTU+1G GB82qIDkM6r5On23BzOft97qAsnpeQ9yMUGFcsxcqncSa9gXUZ2XAVtZvgct6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689620933; a=rsa-sha256; cv=none; b=t8Oa794HlVOumCi/r6Vod2J0ShVKoedq+zA6V8MnRvuhcSK5v+ui/K25/MVitLsr4LGeaK 8IiJbGOmkB32LZcEQhivy/bcVix/CvlSbuMEedhoXB9gPZP5faP8tPrGQEZRJ/UQMzQoZF BFT0XjkG+W5Sy8ir3EqcNyP6xDcJxnZd25BzAleTOSze2GBjeLVO4/C4ij9DqG1uru2fgx 5W0jreCbMO9Sdntf9x4DO/HTuZWhzOi2L+1UxjmCgUBCsE5w14JQalfQNE5136f4+qqFhP K4jMz3xHuOLECzW9JicR1ziSGqSBJEoyByWaopaFbowFqRRBOxN1QHyeBMFXvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4WpF2hmFzZxX; Mon, 17 Jul 2023 19:08:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HJ8rpx014213; Mon, 17 Jul 2023 19:08:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HJ8rdL014212; Mon, 17 Jul 2023 19:08:53 GMT (envelope-from git) Date: Mon, 17 Jul 2023 19:08:53 GMT Message-Id: <202307171908.36HJ8rdL014212@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4b426cf3a46a - main - libbe: recursively promote deep BE datasets List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b426cf3a46a429474e2a138d3360acc23411563 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4b426cf3a46a429474e2a138d3360acc23411563 commit 4b426cf3a46a429474e2a138d3360acc23411563 Author: R. Christian McDonald AuthorDate: 2023-07-17 19:06:28 +0000 Commit: Kyle Evans CommitDate: 2023-07-17 19:08:32 +0000 libbe: recursively promote deep BE datasets beadm will recursively promote deep BE datasets. In order to match the beadm behavior, we need to recursively iterate over child filesystems and promote them along the way. This patch further refines the work from D40903, completing the fix for promotion. Reviewed by: kevans, rew Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D40972 --- lib/libbe/be.c | 40 +++++++++++++++++++++++++++++++--------- sbin/bectl/tests/bectl_test.sh | 12 +++++------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/lib/libbe/be.c b/lib/libbe/be.c index 31836c623c4a..e607ab12215b 100644 --- a/lib/libbe/be.c +++ b/lib/libbe/be.c @@ -1266,12 +1266,38 @@ be_deactivate(libbe_handle_t *lbh, const char *ds, bool temporary) return (0); } +static int +be_zfs_promote_cb(zfs_handle_t *zhp, void *data) +{ + char origin[BE_MAXPATHLEN]; + bool *found_origin = (bool *)data; + int err; + + if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof(origin), + NULL, NULL, 0, true) == 0) { + *found_origin = true; + err = zfs_promote(zhp); + if (err) + return (err); + } + + return (zfs_iter_filesystems(zhp, be_zfs_promote_cb, data)); +} + +static int +be_zfs_promote(zfs_handle_t *zhp, bool *found_origin) +{ + *found_origin = false; + return (be_zfs_promote_cb(zhp, (void *)found_origin)); +} + int be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) { - char be_path[BE_MAXPATHLEN], origin[BE_MAXPATHLEN]; + char be_path[BE_MAXPATHLEN]; zfs_handle_t *zhp; int err; + bool found_origin; be_root_concat(lbh, bootenv, be_path); @@ -1297,19 +1323,15 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary) if (zhp == NULL) return (-1); - if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, sizeof(origin), - NULL, NULL, 0, 1) != 0) { - zfs_close(zhp); - break; - } + err = be_zfs_promote(zhp, &found_origin); - err = zfs_promote(zhp); zfs_close(zhp); - if (err) + if (!found_origin) break; + if (err) + return (err); } - if (err) return (-1); } diff --git a/sbin/bectl/tests/bectl_test.sh b/sbin/bectl/tests/bectl_test.sh index 7ca7af8a1abf..75884029d93e 100755 --- a/sbin/bectl/tests/bectl_test.sh +++ b/sbin/bectl/tests/bectl_test.sh @@ -528,7 +528,6 @@ bectl_jail_cleanup() atf_test_case bectl_promotion cleanup bectl_promotion_head() { - atf_set "descr" "Check bectl promotion upon activation" atf_set "require.user" root } @@ -550,7 +549,7 @@ bectl_promotion_body() mount=${cwd}/mnt root=${mount}/root - bectl_create_setup ${zpool} ${disk} ${mount} + bectl_create_deep_setup ${zpool} ${disk} ${mount} atf_check mkdir -p ${root} # Sleeps interspersed to workaround some naming quirks; notably, @@ -560,23 +559,22 @@ bectl_promotion_body() # with the same name, and the promotion will fail. atf_check bectl -r ${zpool}/ROOT rename default A sleep 1 - atf_check bectl -r ${zpool}/ROOT create -e A B + atf_check bectl -r ${zpool}/ROOT create -r -e A B sleep 1 - atf_check bectl -r ${zpool}/ROOT create -e B C + atf_check bectl -r ${zpool}/ROOT create -r -e B C # C should be a clone of B to start with - atf_check -o not-inline:"-" zfs list -H -o origin ${zpool}/ROOT/C + atf_check -o not-inline:"-" zfs list -Hr -o origin ${zpool}/ROOT/C # Activating it should then promote it all the way out of clone-hood. # This entails two promotes internally, as the first would promote it to # a snapshot of A before finally promoting it the second time out of # clone status. atf_check -o not-empty bectl -r ${zpool}/ROOT activate C - atf_check -o inline:"-\n" zfs list -H -o origin ${zpool}/ROOT/C + atf_check -o inline:"-\n-\n" zfs list -Hr -o origin ${zpool}/ROOT/C } bectl_promotion_cleanup() { - bectl_cleanup $(get_zpool_name) } From nobody Mon Jul 17 20:16:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4YJq02h5z4ng1v; Mon, 17 Jul 2023 20:16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4YJp6k7tz48wd; Mon, 17 Jul 2023 20:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689625018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvB3E/xf9yxphlJKEPlKLp4fCxZIC2zGUVREXEFlzYU=; b=C6BHaDJMSMUXma9O1Be6K9Svyb1b9jrwwK1cFSKlev9OfIAOV1TUhpKU/vTp9uYfL0ZpEo YkZOCmnNCt96nGD+IUmDOemWQTtDEE9qSouLe9JXO6BAaPSEgnC4iM1VdPdEJGR7lOhm+z AGPgX5jJSTV1dbaSaOTdB9ZpkTEUqyLB9efQ11mszAJrt/+d1U6bgn60lS/wH0M7VKKXYs wLK9md7ZeUc2jFzS24znysy3e5knUJku+fuig95Y4+bgSY1XRFF9V4l8y2Tj+E+DDXEVsW dxxJPeafPowtZtt5HEgZ3DKA/NxpLvYrgY9HdDOLKY7oo/OU43adbrndocdt6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689625018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvB3E/xf9yxphlJKEPlKLp4fCxZIC2zGUVREXEFlzYU=; b=a47k8+miqOtxGynI9PYQQ3hWagP8+Qg54vRULlk0TLaHkQkv/JCrPsKdj9J9EFKfFaUskF mvVVfHErwi4hjEYDL6eNjSw2wQu+q+RU5QrZWvP5r+1OnMD2+DFmttmuQOfGRsJof2DZYW I1/IaX0hKP48o9970Ow1wbmudX16z2LgbrnuSMUv95/nue+DCAvL2LoKvs3lxTabMX1qhu MI4gLRdJ6/FGpWcL6+lvuwA+sb15wGTLdFuc6v3JshdP2rGjwTuHTMEzaQNhGH8YrGaEbK rQ+q1jPSAK9zAJQQGW0JLzg7SOscRf1+eevWVywtfRiPmWUK66nF3d33w5gPgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689625018; a=rsa-sha256; cv=none; b=SNzgw3qfaBRwTahSJKmy2NJm0IAYKygpBo880BcbNQSn3DfZ1OYTfvN8UyrnOHTJ3tXu5u PodQ0fOImJUjvRwXyFNpziQnayZGosjnUzzCkgkFLFvmAURknPp5GeU9sot4V+mzsdO/Pc xoFevKWZYuI0rreYCsocK54JSQZVNlIHrVQgq7nQIaKY9PgB+/2b3XOVA6zzCUioR5+7Th b4Wwr+LAdNd+FUi/bMA5z5NbbB6L5QkiaNxtYlVWSsF4YxICAPrnp66BVOUCdvoouEQOte VCySPrFpNH4zgLVeGWyBTRxotzc26xjiZrcfUs3cjKeBPJVyUSmpIVFeKPGOFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4YJp5k5Zzd1r; Mon, 17 Jul 2023 20:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36HKGwt9029822; Mon, 17 Jul 2023 20:16:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36HKGwqh029821; Mon, 17 Jul 2023 20:16:58 GMT (envelope-from git) Date: Mon, 17 Jul 2023 20:16:58 GMT Message-Id: <202307172016.36HKGwqh029821@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Glen Barber Subject: git: b24c35b326db - main - release: adjust lang/python* dependencies for GCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b24c35b326dbd355070335e63d02e7c29ee58bf0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=b24c35b326dbd355070335e63d02e7c29ee58bf0 commit b24c35b326dbd355070335e63d02e7c29ee58bf0 Author: Glen Barber AuthorDate: 2023-07-17 20:16:46 +0000 Commit: Glen Barber CommitDate: 2023-07-17 20:16:46 +0000 release: adjust lang/python* dependencies for GCE The lang/python3 port had failed to properly install because it did in fact already exist and FORCE_PKG_REGISTER was not set. So, behaviorally everything here was correct. However, installing lang/python3 is in fact not correct and not needed, so only install the lang/python port to provide symbolic links. PR: 272354 MFC after: 3 days MFC with: 510fd83138001b0a6e45b3fa6a7249377f806171 MFC with: cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957 MFC with: 0ed426276fd52e917506ab87c05a61c6641ae298 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd --- release/Makefile.gce | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index ff364c9287c5..17f4974b1c53 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -46,13 +46,11 @@ gce-check-depends: . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk - env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ - net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk \ + lang/python . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean - env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Tue Jul 18 00:29:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4fw300lgz4ms7M; Tue, 18 Jul 2023 00:29: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4fw240l6z4JXp; Tue, 18 Jul 2023 00:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689640162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnI+KvDs39C2eHPKyU7s8O2NiWcB7wgcz8RQSxa7avk=; b=eLEEsZuUNYyiNdkpPxADv18J5oqHTXa6JwMkRc39u2hOZuUV0MXHEYus5IOv///BhTYgbV v/Epkka5INhSRclac1KRXkXyOTjPdc/YC9nfyzXdvvFnXgixv4xHy/o+Rn+BsEbA4p4/rv UJInHNCrZCvFFGq/jg+oLHP2lHodt8CCDjoU0rjzZVU5gXMIRhSCK+fQfU5lfiXi7IXGP1 nxNhyvom1L+9P64ciXLvRf1KbQM6qp1V0ZbVJTymqWvOh40EZOjpTMVi+T5uY9ex7LpKRi rlxyVw1JCKixIrto0IxDuqN/MkMDkXGdAH6Vd2zCB83Vhp2jBTfChyiebWDu6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689640162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FnI+KvDs39C2eHPKyU7s8O2NiWcB7wgcz8RQSxa7avk=; b=PcSmiaUpDIgK+h0s7XROiJrOvCBsyjDIeIH/r7LtWpgqKIsy9D10zzpM4KzAqe6UdtTZX0 pEzKtTLkieQS9TDJRud2tuWei7qAfOooGpLWtoU+51neHWv8pc7R29z49P0fBQ3lxs1LQx Z9J8OraOMV2QNqQHvEtI8oqZoUv4bWx1tl/HcjxUFVOoqRwi5gGBZ2rXpDsJgVG/QvugyX CZ0IeuJgHOwlZauBuxdag0qhczJA2hMKg+U01i3VSPtH1uf0JPPAbwa10MfLpt4+JWHJZx qUBau06ZaxJLxMmAczlLfNENITCpu+BUGqDF8xf/iI4LIjMb/AyhO5/p+mfLbw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689640162; a=rsa-sha256; cv=none; b=o39jGVbmORCqCBJgPs3SjWjYVRwHVpKTkStejETBMZl1Dpd25Tse64BKZiNNRCVCITpjdF tF+CQdxfkKrtxB2aoZXAQQWYtP1C/x/2JCAUIhsAuH987FN8GHOmllR5qyyEYti3JWZZNF M16YHbgsQ64U0PNFwkcitCIb6KL/eT0vQXG//KlWtEeFxKbmPiexrRdX9U0hcm/OchK9Ls AURlxWoxK5q/IVcb75peXbUBZxuJAYqud32NVNWJJklOaN+5ztrjTtYUE9VQAKVtXDY3qs txqTJCAYjPBdsg3voDp/pAVU7cb/dU57P00dOCTJaZDk4o3CSn8hVqVv58ttwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4fw235xBzkfg; Tue, 18 Jul 2023 00:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I0TMuj042205; Tue, 18 Jul 2023 00:29:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I0TMRh042204; Tue, 18 Jul 2023 00:29:22 GMT (envelope-from git) Date: Tue, 18 Jul 2023 00:29:22 GMT Message-Id: <202307180029.36I0TMRh042204@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: 239597e0309d - main - Text format cleanups. No functional changes intended. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 239597e0309d4d8e84c35929513aa4a2470735ad Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=239597e0309d4d8e84c35929513aa4a2470735ad commit 239597e0309d4d8e84c35929513aa4a2470735ad Author: Kirk McKusick AuthorDate: 2023-07-18 00:28:07 +0000 Commit: Kirk McKusick CommitDate: 2023-07-18 00:29:09 +0000 Text format cleanups. No functional changes intended. MFC-after: 1 week Sponsored-by: The FreeBSD Foundation --- sbin/fsck_ffs/fsck.h | 6 +++--- sbin/fsck_ffs/gjournal.c | 15 ++++----------- sbin/fsck_ffs/globs.c | 24 ++++++++++++------------ sbin/fsck_ffs/main.c | 8 +++++--- sbin/fsck_ffs/pass1.c | 2 +- sbin/fsck_ffs/pass5.c | 34 ++++++++++++++++++++++------------ sbin/fsck_ffs/suj.c | 27 +++++++++++++++------------ 7 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sbin/fsck_ffs/fsck.h b/sbin/fsck_ffs/fsck.h index 3b80169c1e3c..e48f3e0aa692 100644 --- a/sbin/fsck_ffs/fsck.h +++ b/sbin/fsck_ffs/fsck.h @@ -112,7 +112,7 @@ struct inostat { #define FSTATE 0x2 /* inode is file */ #define FZLINK 0x3 /* inode is file with a link count of zero */ #define DSTATE 0x4 /* inode is directory */ -#define DZLINK 0x5 /* inode is directory with a zero link count */ +#define DZLINK 0x5 /* inode is directory with a zero link count */ #define DFOUND 0x6 /* directory found during descent */ /* 0x7 UNUSED - see S_IS_DVALID() definition */ #define DCLEAR 0x8 /* directory is to be cleared */ @@ -297,8 +297,8 @@ struct dups { struct dups *next; ufs2_daddr_t dup; }; -extern struct dups *duplist; /* head of dup list */ -extern struct dups *muldup; /* end of unique duplicate dup block numbers */ +extern struct dups *duplist; /* head of dup list */ +extern struct dups *muldup; /* end of unique duplicate dup block numbers */ /* * Inode cache data structures. diff --git a/sbin/fsck_ffs/gjournal.c b/sbin/fsck_ffs/gjournal.c index f3bdd5a66907..03bf7f08b662 100644 --- a/sbin/fsck_ffs/gjournal.c +++ b/sbin/fsck_ffs/gjournal.c @@ -77,7 +77,6 @@ gjournal_check(const char *filesys) fs = &sblock; /* Are there any unreferenced inodes in this file system? */ if (fs->fs_unrefs == 0) { - //printf("No unreferenced inodes.\n"); sbdirty(); ckfini(1); return; @@ -105,7 +104,6 @@ gjournal_check(const char *filesys) /* Are there any unreferenced inodes in this cylinder group? */ if (cgp->cg_unrefs == 0) continue; - //printf("Analizing cylinder group %d (count=%d)\n", cg, cgp->cg_unrefs); /* * Now go through the list of all inodes in this cylinder group * to find unreferenced ones. @@ -150,20 +148,15 @@ gjournal_check(const char *filesys) inodirty(&ip); irelse(&ip); cgdirty(cgbp); - if (cgp->cg_unrefs == 0) { - //printf("No more unreferenced inodes in cg=%d.\n", cg); + if (cgp->cg_unrefs == 0) break; - } } /* - * If there are no more unreferenced inodes, there is no need to - * check other cylinder groups. + * If there are no more unreferenced inodes, there is no + * need to check other cylinder groups. */ - if (fs->fs_unrefs == 0) { - //printf("No more unreferenced inodes (cg=%d/%d).\n", cg, - // fs->fs_ncg); + if (fs->fs_unrefs == 0) break; - } } /* Write back updated statistics and super-block. */ sbdirty(); diff --git a/sbin/fsck_ffs/globs.c b/sbin/fsck_ffs/globs.c index 7aef7364eeba..22b15186ecaa 100644 --- a/sbin/fsck_ffs/globs.c +++ b/sbin/fsck_ffs/globs.c @@ -60,18 +60,18 @@ ino_t cursnapshot; long dirhash, inplast; unsigned long numdirs, listmax; long countdirs; /* number of directories we actually found */ -int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ -int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ -int setsize[MIBSIZE]; /* MIB command to set inode size */ -int adjndir[MIBSIZE]; /* MIB command to adjust number of directories */ -int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ -int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ -int adjnffree[MIBSIZE]; /* MIB command to adjust number of free frags */ -int adjnumclusters[MIBSIZE]; /* MIB command to adjust number of free clusters */ +int adjrefcnt[MIBSIZE]; /* MIB cmd to adjust inode reference cnt */ +int adjblkcnt[MIBSIZE]; /* MIB cmd to adjust inode block count */ +int setsize[MIBSIZE]; /* MIB cmd to set inode size */ +int adjndir[MIBSIZE]; /* MIB cmd to adjust number of directories */ +int adjnbfree[MIBSIZE]; /* MIB cmd to adjust number of free blocks */ +int adjnifree[MIBSIZE]; /* MIB cmd to adjust number of free inodes */ +int adjnffree[MIBSIZE]; /* MIB cmd to adjust number of free frags */ +int adjnumclusters[MIBSIZE]; /* MIB cmd to adjust number of free clusters */ int adjdepth[MIBSIZE]; /* MIB cmd to adjust directory depth count */ -int freefiles[MIBSIZE]; /* MIB command to free a set of files */ -int freedirs[MIBSIZE]; /* MIB command to free a set of directories */ -int freeblks[MIBSIZE]; /* MIB command to free a set of data blocks */ +int freefiles[MIBSIZE]; /* MIB cmd to free a set of files */ +int freedirs[MIBSIZE]; /* MIB cmd to free a set of directories */ +int freeblks[MIBSIZE]; /* MIB cmd to free a set of data blocks */ struct fsck_cmd cmd; /* sysctl file system update commands */ char snapname[BUFSIZ]; /* when doing snapshots, the name of the file */ char *cdevname; /* name of device being checked */ @@ -91,7 +91,7 @@ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ int ckhashadd; /* check hashes to be added */ int bkgrdcheck; /* determine if background check is possible */ -int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ +int bkgrdsumadj; /* kernel able to adjust superblock summary */ char usedsoftdep; /* just fix soft dependency inconsistencies */ char preen; /* just fix normal inconsistencies */ char rerun; /* rerun fsck. Only used in non-preen mode */ diff --git a/sbin/fsck_ffs/main.c b/sbin/fsck_ffs/main.c index 60a542785541..56883d682ce8 100644 --- a/sbin/fsck_ffs/main.c +++ b/sbin/fsck_ffs/main.c @@ -351,16 +351,18 @@ checkfilesys(char *filesys) * Determine if we can and should do journal recovery. */ if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { - if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { + if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && + skipclean) { sujrecovery = 1; if (suj_check(filesys) == 0) { - printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); + pwarn("\n**** FILE SYSTEM MARKED CLEAN ****\n"); if (chkdoreload(mntp, pwarn) == 0) exit(0); exit(4); } sujrecovery = 0; - printf("** Skipping journal, falling through to full fsck\n\n"); + pwarn("Skipping journal, " + "falling through to full fsck\n"); } if (fswritefd != -1) { /* diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index d328234220ad..5b27cf8cbfbe 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -104,7 +104,7 @@ pass1(void) if (!reply("REBUILD CYLINDER GROUP")) { cgheader_corrupt = 1; if (!nflag) { - printf("YOU WILL NEED TO RERUN FSCK.\n"); + pwarn("YOU WILL NEED TO RERUN FSCK.\n"); rerun = 1; } } else { diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 58143a0e8211..d973183eb36a 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -411,43 +411,53 @@ pass5(void) printf("adjndir by %+" PRIi64 "\n", cmd.value); if (bkgrdsumadj == 0 || sysctl(adjndir, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF DIRECTORIES", cmd.value); + rwerror("ADJUST NUMBER OF DIRECTORIES", + cmd.value); } cmd.value = cstotal.cs_nbfree - fs->fs_cstotal.cs_nbfree; if (cmd.value != 0) { if (debug) - printf("adjnbfree by %+" PRIi64 "\n", cmd.value); + printf("adjnbfree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnbfree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE BLOCKS", cmd.value); + rwerror("ADJUST NUMBER OF FREE BLOCKS", + cmd.value); } cmd.value = cstotal.cs_nifree - fs->fs_cstotal.cs_nifree; if (cmd.value != 0) { if (debug) - printf("adjnifree by %+" PRIi64 "\n", cmd.value); + printf("adjnifree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnifree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE INODES", cmd.value); + rwerror("ADJUST NUMBER OF FREE INODES", + cmd.value); } cmd.value = cstotal.cs_nffree - fs->fs_cstotal.cs_nffree; if (cmd.value != 0) { if (debug) - printf("adjnffree by %+" PRIi64 "\n", cmd.value); + printf("adjnffree by %+" PRIi64 "\n", + cmd.value); if (bkgrdsumadj == 0 || sysctl(adjnffree, MIBSIZE, 0, 0, &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE FRAGS", cmd.value); + rwerror("ADJUST NUMBER OF FREE FRAGS", + cmd.value); } - cmd.value = cstotal.cs_numclusters - fs->fs_cstotal.cs_numclusters; + cmd.value = cstotal.cs_numclusters - + fs->fs_cstotal.cs_numclusters; if (cmd.value != 0) { if (debug) - printf("adjnumclusters by %+" PRIi64 "\n", cmd.value); - if (bkgrdsumadj == 0 || sysctl(adjnumclusters, MIBSIZE, 0, 0, - &cmd, sizeof cmd) == -1) - rwerror("ADJUST NUMBER OF FREE CLUSTERS", cmd.value); + printf("adjnumclusters by %+" PRIi64 "\n", + cmd.value); + if (bkgrdsumadj == 0 || sysctl(adjnumclusters, MIBSIZE, + 0, 0, &cmd, sizeof cmd) == -1) + rwerror("ADJUST NUMBER OF FREE CLUSTERS", + cmd.value); } } } diff --git a/sbin/fsck_ffs/suj.c b/sbin/fsck_ffs/suj.c index 92f786fda38e..eb0d0d682aef 100644 --- a/sbin/fsck_ffs/suj.c +++ b/sbin/fsck_ffs/suj.c @@ -502,7 +502,8 @@ blk_free(ino_t ino, ufs2_daddr_t bno, int mask, int frags) * deallocate the fragment */ for (i = 0; i < frags; i++) - if ((mask & (1 << i)) == 0 && isclr(blksfree, cgbno +i)) { + if ((mask & (1 << i)) == 0 && + isclr(blksfree, cgbno +i)) { freefrags++; setbit(blksfree, cgbno + i); } @@ -1304,8 +1305,8 @@ ino_trunc(ino_t ino, off_t size) return; } if (debug) - printf("Truncating ino %ju, mode %o to size %jd from size %jd\n", - (uintmax_t)ino, mode, size, cursize); + printf("Truncating ino %ju, mode %o to size %jd from " + "size %jd\n", (uintmax_t)ino, mode, size, cursize); /* Skip datablocks for short links and devices. */ if (mode == 0 || mode == IFBLK || mode == IFCHR || @@ -1511,8 +1512,8 @@ blk_check(struct suj_blk *sblk) sino->si_blkadj = 1; } if (debug) - printf("op %d blk %jd ino %ju lbn %jd frags %d isat %d (%d)\n", - brec->jb_op, blk, (uintmax_t)brec->jb_ino, + printf("op %d blk %jd ino %ju lbn %jd frags %d isat %d " + "(%d)\n", brec->jb_op, blk, (uintmax_t)brec->jb_ino, brec->jb_lbn, brec->jb_frags, isat, frags); /* * If we found the block at this address we still have to @@ -2335,8 +2336,8 @@ restart: recsize <= fs->fs_bsize) goto restart; if (debug) - printf("Found invalid segsize %d > %d\n", - recsize, size); + printf("Found invalid segsize " + "%d > %d\n", recsize, size); recsize = real_dev_bsize; jblocks_advance(suj_jblocks, recsize); continue; @@ -2479,7 +2480,8 @@ suj_check(const char *filesys) cg_apply(cg_adj_blk); cg_apply(cg_check_ino); } - if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) + if (preen == 0 && (jrecs > 0 || jbytes > 0) && + reply("WRITE CHANGES") == 0) return (0); /* * Check block counts of snapshot inodes and @@ -2507,10 +2509,11 @@ suj_check(const char *filesys) sbdirty(); ckfini(1); if (jrecs > 0 || jbytes > 0) { - printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", - jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); - printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", - freeinos, freedir, freeblocks, freefrags); + printf("** %jd journal records in %jd bytes for %.2f%% " + "utilization\n", jrecs, jbytes, + ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); + printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd " + "frags.\n", freeinos, freedir, freeblocks, freefrags); } return (0); From nobody Tue Jul 18 05:47:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4nyj5PHcz4nb8B; Tue, 18 Jul 2023 05:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4nyj4zgfz3K28; Tue, 18 Jul 2023 05:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689659229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vy76wAWbD8Xu7TNmMYHabj2xMWdAmATbCBoESeHYM4U=; b=Io69zMkqsb/7bzIwWnM7Ka4H5P6e29kgeoFHuc7zgcRnF3m3cpZcg5dbqWWMK0t72ee5Pj bgTSq0cNYlGizbhNin8C2bwgSf1xzNteCfNDWlXWPniN98m0+045NFPGLQ5y224XqsDg9L tSFSg1JlJcFNhVXJn9CJ3R5dKW11wj1C659JjoWwxkZVDJ85vl5NuQVUaLuwRvjCLAMYTF gikLUkRMaxMxkonPoURIFpbzp6/P4DbR3YPS7o0Jfv6BxgwpIRM5E5yBSkS9PnlhtWmaBI jlkBfld6W6RKLTsrRn1PNkaEwTONYt99hn9LCJhFg3dmBrGnh4pfWACeGYu+oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689659229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vy76wAWbD8Xu7TNmMYHabj2xMWdAmATbCBoESeHYM4U=; b=cm4ir73tI60bWYjIIsbUPeqUg7cugbBVz+iaqnEwaSRjzh8oIALLCO4hV8RfvB7HUTeJlM y6xdpluD7aot3cE/zxpAKt1hBSjDzEHf+91MwJ+3HbZAN35ZzhBe2yev1vOblBDs0+fkA+ 0/07Ed+QyuWvW9ATBBbwGq7RcOD0Cc1U21ts/WOZKAoXaoeTjQkVFbZ9CmlPp4qHVb3n41 7aAQhHYUREuG9o86mdAKqtncndI4/QlsdnmDg6bUxiLxfcMxrgJSbiMZjayT+MbiHk29Qd w+8umaKmHlKMkwarj8sJoou9jl2LaXX9+bCsk0qSz/fGhWpaJSoFeOSZzGJnkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689659229; a=rsa-sha256; cv=none; b=FFkxxorKB3k0jHWviIK+TSn8PnZ+SrvriywFKprqF2izKpiVtppQ6cZvjqzGMmvMUQbFj1 ECyplhCelDiyG7NnLEIQCYo8hMfNsLx3CzBbr1s38yPfBcjl3hX2h5vtCmn+XJz6X57nFY PAEgj/+U6WQ3nsx/98EPcN18i0Tp6rYxWRrQjwwb4OZn/ojHwHwEBordThF7NlWvx1sZQ/ 3QnYUcnz2Mlg+hyDHPva41KtCzIQdVwb019xj3Y/8N5f1wH8K2JQY99a7ks7YwxCWhtqpc gZxytSfP2UXMVi2hsOu2ukFsINVznGz33XnGiiM1758zv1KGY+i45ssnYW8hCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4nyj435mztMP; Tue, 18 Jul 2023 05:47:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I5l9hp072129; Tue, 18 Jul 2023 05:47:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I5l9Zj072128; Tue, 18 Jul 2023 05:47:09 GMT (envelope-from git) Date: Tue, 18 Jul 2023 05:47:09 GMT Message-Id: <202307180547.36I5l9Zj072128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 868f3eadc5e0 - stable/13 - msdosfs: zero partially valid extended cluster List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 868f3eadc5e0b50863c13457074ac1a0b03958dd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=868f3eadc5e0b50863c13457074ac1a0b03958dd commit 868f3eadc5e0b50863c13457074ac1a0b03958dd Author: Konstantin Belousov AuthorDate: 2023-07-06 01:51:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-18 05:46:13 +0000 msdosfs: zero partially valid extended cluster (cherry picked from commit 7e4c6b2163fbed6be92b1e19f0eec4da973cfaec) --- sys/fs/msdosfs/msdosfs_denode.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 59107a6ca2ea..0c58fb4396ce 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -496,6 +496,7 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) struct msdosfsmount *pmp = dep->de_pmp; struct vnode *vp = DETOV(dep); struct buf *bp; + off_t eof_clusteroff; u_long count; int error; @@ -534,13 +535,19 @@ deextend(struct denode *dep, u_long length, struct ucred *cred) * B_CACHE | B_DELWRI but with invalid pages, and cannot be * neither written out nor validated. * - * Fix it by proactively clearing extended pages. + * Fix it by proactively clearing extended pages. Need to do + * both vfs_bio_clrbuf() to mark pages valid, and to zero + * actual buffer content which might exist in the tail of the + * already valid cluster. */ error = bread(vp, de_cluster(pmp, dep->de_FileSize), pmp->pm_bpcluster, NOCRED, &bp); if (error != 0) goto rewind; vfs_bio_clrbuf(bp); + eof_clusteroff = de_cn2off(pmp, de_cluster(pmp, dep->de_FileSize)); + vfs_bio_bzero_buf(bp, dep->de_FileSize - eof_clusteroff, + pmp->pm_bpcluster - dep->de_FileSize + eof_clusteroff); if (!DOINGASYNC(vp)) (void)bwrite(bp); else if (vm_page_count_severe() || buf_dirty_count_severe()) From nobody Tue Jul 18 05:47:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4nyk6Zy0z4nZsJ; Tue, 18 Jul 2023 05:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4nyk5rFqz3K0Z; Tue, 18 Jul 2023 05:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689659230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iUWMhbd8pMFO9loATTXsR7RISbnZPJ3PdGrltCwUnUg=; b=eKrCTxVrtbzxsS9MtizXUCpmi8EUNtle8O/kQ0JgPanKudwa+4L+1x0zryR+5EXyclx1M6 mzlvhREHEDG6R4uzdVSD9qX8cNMmD3BevG2uwQNYxZh+/s/42e0cQZdth9VIEYKYxQEfnr qrAwGbg7JIhcQCOc8WQlFCPILOSw8cQt8Hu6IfZ4S1c1mAcqI1a1zX81gHDviHTq63HAKC yFCU/WYA9f721uxzLZgszuM3JYylZclAjCC/Csb9BvbgLK/ReXxSBP4FJoe/Dx6caqGTUT n6UWO+FUgsAOmJTjrZL1ryLQnKz1zlc4r/AdPrxRRHSzC6Ww05c+uIt50/0t6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689659230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iUWMhbd8pMFO9loATTXsR7RISbnZPJ3PdGrltCwUnUg=; b=NF3WvOOLXdjAlWKlJUAx0mZ38gvTbOrM/U646PfVBF1eFxbQHpZmTmki69lWN24LrUyd1v S6MJAvMeRuXBluZ/FFy7a0KeS+lGvk20aJo2ui+859YHzo3cBEBVk+AXUhw/Ii6Jcifc2r CsUKdKca4hlyb5T2aAbavjZwcC+B27P/+RasAHGOmzTbQi/1uOuwnXd43QP5v/VOhlGpOL Mn3GqB5+vQvuymHFGC2PjRinA6mmT8zNBNvzQvhfhPjPvws+6sq5vU+7EH+d3bS+iSIJCQ EOmyla7cHw6ZsUFbX8GfRZicQQ0WtMNw+WHKl15ujhCWLFQAO5idKSoE9rihTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689659230; a=rsa-sha256; cv=none; b=kxxqlq9fNo/pvSTJklA4Z+lAPBhNo/CAuipdiPLsLvbQO+4mkawApbi2MXdGfSMnNlHrf5 RFxClJPI7M6gGywO4a0AqN5Ew8/jOzHQ0fnV9lWMERSeIHlD08OLITAj7hZViS1TevQoZ4 Q/w7J1+KnDEu2agI7pizJzB8lGXhVIwmJyqHX3OlDONH94SR0Pa+hoeTOKBuCYJrU6QJp1 rce21C88FgxXrJ+XSqh6fCrwHhbsNiZJWjVc1wlYnCnLt09Y3RGDAlswyX9QA27Z+i/7Qx W+UUjOokNreClrgTDKOsapIAhMZd8nKx7bJtbKhj1FcoD1x6r2yWm1oxHoQG6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4nyk4xcxzv2N; Tue, 18 Jul 2023 05:47:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I5lAXo072155; Tue, 18 Jul 2023 05:47:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I5lAAg072154; Tue, 18 Jul 2023 05:47:10 GMT (envelope-from git) Date: Tue, 18 Jul 2023 05:47:10 GMT Message-Id: <202307180547.36I5lAAg072154@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: b81f4ea07deb - stable/13 - libthr: some style in thr_rwlock.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b81f4ea07deb6fd1411635d66d1a501a2b257d86 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=b81f4ea07deb6fd1411635d66d1a501a2b257d86 commit b81f4ea07deb6fd1411635d66d1a501a2b257d86 Author: Konstantin Belousov AuthorDate: 2023-07-13 15:55:50 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-18 05:46:45 +0000 libthr: some style in thr_rwlock.c (cherry picked from commit 80c5588495674fc6501700fccb0ed4a37183c89c) --- lib/libthr/thread/thr_rwlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libthr/thread/thr_rwlock.c b/lib/libthr/thread/thr_rwlock.c index 8457250e60f7..ab10431b9d41 100644 --- a/lib/libthr/thread/thr_rwlock.c +++ b/lib/libthr/thread/thr_rwlock.c @@ -343,14 +343,14 @@ rwlock_wrlock_common(pthread_rwlock_t *rwlock, const struct timespec *abstime) int _Tthr_rwlock_wrlock(pthread_rwlock_t *rwlock) { - return (rwlock_wrlock_common (rwlock, NULL)); + return (rwlock_wrlock_common(rwlock, NULL)); } int _pthread_rwlock_timedwrlock(pthread_rwlock_t * __restrict rwlock, const struct timespec * __restrict abstime) { - return (rwlock_wrlock_common (rwlock, abstime)); + return (rwlock_wrlock_common(rwlock, abstime)); } int From nobody Tue Jul 18 07:59:00 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4rtr5gGmz4nrFk; Tue, 18 Jul 2023 07:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4rtr5BGGz4GVq; Tue, 18 Jul 2023 07:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DTB1jF7Qt1rXn/jvvtzVErHIvQ0IVbcLLoBgWQu47Gk=; b=VBQnCqkfg4t9Kv6cE3B5dFfPzqjVUVKxJe4nOAKUY4ucn8qUukYHyetubXjIbkj4WCsr2x xHfbaELm9MoRcYTlEK9xUB8CpBqJbL1aHAyIy4IBqb7hMx4XqpLblajLcKKzUCYP32KCyo 6m+UjU3713GoZ18vvIIFCT/JtO03oiQk36HuW7D+bQ92IpdQUBpTCCmPy31MZh+IpHqTb9 nQkluM7c++aMob0p/kPcqYy0HVWolQ2UvhTYMulLeGbDvz79vU3oJ3nMxUqDpY1bjqL2Ob iEQUg+Cf9EXp2VpX/lpXeYWTP0d8eYoCSnmEab2gpkOkU6oSCgmg3JQ6FJ0bKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DTB1jF7Qt1rXn/jvvtzVErHIvQ0IVbcLLoBgWQu47Gk=; b=M9P8pfemlYdGixzZ4P2SZuvHfKCGSKO828o/PFBbETk1szZSeJPycnMkbWildlTMjdOBgo yPGMggS/hGlb1Vy91D9I4CnFWKlnRE8JFuupX+tU/EzQBtQhIGfLzOqRdtOA/jD/zPs1Zd 3ryYTEeYCinwdD1d7PXWRKSM3vNgMqNokRlMzZnqKRbVX3immLsxssOioE6EIqWIL1GUwK AJJtMZLUjJ/wQXq0qt5LnHcCuYJGZGnUrVyLnZTyi8Zgzk4YNnDZ0qhWpFyAZj9lXqUiL3 SHUFSfQXkSVWF7NUnEq+tSxb/NC4FfYcpEO3BJnciYN1F8PFy4Vb6wkgR9fnWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689667140; a=rsa-sha256; cv=none; b=j2zb+PIOhz4MkrG54Xq0pLAUuy/GwVpFns/6XnKyUy5BGxyUNYzzt/0r5Dy8v5so9fjhYa JCbD4DYgrp+0IpQGV+fJKNWgeJfbxV99uSQO80UhjbDEooB2W71lWpJQbRCxSiX5q/vnJk MefqacDhF7vohwXQnkAJjz0A1hL3Ti8pZ4Z/oCbZjTbsjqMrS7O0n1P3kS4i8duRbT8bVx xDRUND5zU3zrB+AxaBzgC2w7+4w8wv7g1ccN0nJNQ1EXSC3MIln6ifZ3Y4bd+jNmHkdzvE uVm/tXiY0mMj3CyW/nxAhBCvkTZTElJWGl1hyobLN471gtx1ZHvFbsgH8hE/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 4R4rtr4HwNzxLJ; Tue, 18 Jul 2023 07:59:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I7x0vo087170; Tue, 18 Jul 2023 07:59:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I7x0jF087169; Tue, 18 Jul 2023 07:59:00 GMT (envelope-from git) Date: Tue, 18 Jul 2023 07:59:00 GMT Message-Id: <202307180759.36I7x0jF087169@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: c9d956e36438 - stable/13 - syslog.3: MFC: document ident[N] format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c9d956e36438460fc912cde33576db810c7122bd Auto-Submitted: auto-generated The branch stable/13 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=c9d956e36438460fc912cde33576db810c7122bd commit c9d956e36438460fc912cde33576db810c7122bd Author: Eugene Grosbein AuthorDate: 2023-07-03 12:35:37 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-18 07:57:54 +0000 syslog.3: MFC: document ident[N] format When libc switched to generation of logs as per RFC 5424, that change broke application ability to insert specific process id using ident[N] format, the feature existed for decades. Some processes rely on it (including logger and syslogd). Later the regression was fixed but the feature remained undocumented. This change documents it. (cherry picked from commit 5aee3e14d4914c7c99bce80da17b3100cb1f4490) --- lib/libc/gen/syslog.3 | 7 ++++++- usr.bin/logger/logger.1 | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/syslog.3 b/lib/libc/gen/syslog.3 index 2cb2c0d198b3..73e62997e828 100644 --- a/lib/libc/gen/syslog.3 +++ b/lib/libc/gen/syslog.3 @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 25, 2018 +.Dd July 3, 2023 .Dt SYSLOG 3 .Os .Sh NAME @@ -131,6 +131,11 @@ The .Fa ident argument is a string that will be prepended to every message. +It may be formatted as +.Fa ident[N] +in which case decimal number +.Fa N +replaces the process id within messages. The .Fa logopt argument diff --git a/usr.bin/logger/logger.1 b/usr.bin/logger/logger.1 index 7a64320cfe49..a2774b9e3500 100644 --- a/usr.bin/logger/logger.1 +++ b/usr.bin/logger/logger.1 @@ -28,7 +28,7 @@ .\" @(#)logger.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 5, 2017 +.Dd July 3, 2023 .Dt LOGGER 1 .Os .Sh NAME @@ -73,6 +73,9 @@ tries to send the message to all addresses. .It Fl i Log the process id of the logger process with each line. +This flag is ignored and the process id is always logged. +See also +.Fl t . .It Fl s Log the message to standard error, as well as the system log. .It Fl f Ar file @@ -152,6 +155,10 @@ and Mark every line in the log with the specified .Ar tag rather than the default of current login name. +Use +.Fl t Ar tag[N] +to insert specific decimal process id instead of id of +.Nm . .It Ar message Write the message to log; if not specified, and the .Fl f From nobody Tue Jul 18 08:00:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4rw63Yg9z4nrkT for ; Tue, 18 Jul 2023 08:00: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4rw62wzhz4Gv7; Tue, 18 Jul 2023 08:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CPEplEK6emU4f4ZMuLWLhneDhWiW/W4U1EFZ7j9O9Fs=; b=T/+1Uhbwq6AFLEJWfHD0AF21Z61G52WXRaN+BvfASkymm8ah+4dzG3ih8879oLPQXyYaTf ErnIrzhrxvvSMxSvEKQgS2eWq04B5fZV2SharGQWIk4QbbWdnCruRF5veWPO4p0uJsDHbN EzjGKXNBZbDskOmB2nImeFAEHlKQE1ugWQnxTsaf4TeR7iE2nZrubRvLET1RXyEWJBc8Cu wqjWO7kbMvaaeHH/onUDq5IXBpIqH+wUQ8LC5KRa7MKGonEP3g6/Htc5PyCzkHg4oLfNUB iD1grHmMAmD3Up0UK0zeq0+GwnluGyQcZspDzKKuCIuMlUsEQf7g3zh9mHuEKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CPEplEK6emU4f4ZMuLWLhneDhWiW/W4U1EFZ7j9O9Fs=; b=x+TxcYMdVvkCHa1ntjIIxUuD7B0jNcvBpjEbbKCYVnNnpyv7oj1MzpPI9IKmGN8KQSC3ai EMCucjHNbl/q4RFRiO3jb718fSgBFnOpMB3BeP0p+G70I6m6a7Ag6c58hxme10XFmve3wp 1Rk0m15Pa7VhBrC7KxYo2mVXJJRoRa8s+M+UiUOqtYUZnre/M1DNl9Kg1nRrsxASNRT10s gjoMBirl8SI5w/CdymeBSPMANiubwKzaqK2wiTeFQDcmIq63kfaFklo/Ho+vRRtmOV0Wl2 /JZ1Y7WGDU3Ymgm66wYvFoSEOXwY4MorQFNKQZ9acsU0aXpmYbpRbRO4h6ATtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689667206; a=rsa-sha256; cv=none; b=csw6YnxiQKM4jDmMLZXMZj/QPWt+yMjwMqENYDsLtNryBHRpNj0X21jvG1q/sUmdpSbZ0f DLjW6/t+6tbIkogANokTMFVpAljG16LfDL8iEL5hYiEQuABH3TajTYmp/wAO40YlKYhCkG 01DUCbt3GE5hYY3SWkDEoYDKvmvbSeY68VkdpcOeqIKfMI0mRrBkNjSqDmc9Bm0R1zp0kG wk7x9+1v3wxPQDgQsgy2LAau7tW20SntgvpU+udoweuzI1iKpvuM7sv2fPiGUCWbS9bOyZ pXy4nIy1J74WMN9rjwuX3Cw3jaubcJmjbNzq7ccPGlBPLRZlONV0WSWYUhTa5w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4rw61jQ5zxlq; Tue, 18 Jul 2023 08:00:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I806g0091402; Tue, 18 Jul 2023 08:00:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I806B6091399; Tue, 18 Jul 2023 08:00:06 GMT (envelope-from git) Date: Tue, 18 Jul 2023 08:00:06 GMT Message-Id: <202307180800.36I806B6091399@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 309e35276a04..14b646f7c3f7 - vendor/libarchive - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/vendor/libarchive X-Git-Reftype: branch X-Git-Commit: 14b646f7c3f709cd0de2d59db3691273bc8d6d16 X-Git-Oldrev: 309e35276a045cc5ae7f9414c80765863d4a09c4 X-Git-Newrev: 14b646f7c3f709cd0de2d59db3691273bc8d6d16 Auto-Submitted: auto-generated The branch vendor/libarchive has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=309e35276a04..14b646f7c3f7 14b646f7c3f7 Update vendor/libarchive to libarchive/libarchive@ee4579617 From nobody Tue Jul 18 08:07:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4s4x3krrz4nwJy; Tue, 18 Jul 2023 08:07: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4s4x3GxKz4JrF; Tue, 18 Jul 2023 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zl4cLXusL3DTpSX3Kk4ThN/JQs0ETlvPgwNJXpGFjAA=; b=YQuGyovETyps6NbJCArFPMr3jqhXeLMedUMgTijhuciUsBu9bBtRZLc0wrWPrug8EmYsE6 IVxZv5a4ddFDUbpV/YeXxNoVwJf+JrBeZ+phaokftukOav4qugqOtAWLKqB6CMqgL/5E/X gljRB5UvUa4K2edZNfEPjXDfzUmSHFm5f5hJ8VXGsoXDO4IaiB2W0mM7qnHUm9jBU4ZdYi 1bxCBlBXAVWGvElB+zXF3bByn+hclc0SD2+a6OxaX+XCYJSLQYzBAISemSqnDIpfJq32CF iQmYwgDc1D3H1J/P/iBn3f1ZXwy98UhY8MtJ+d+d3Kd55LrgtSu81ythYonf1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zl4cLXusL3DTpSX3Kk4ThN/JQs0ETlvPgwNJXpGFjAA=; b=PGfxCsskNX3OJAT6cfuyZTAtwtfJ6ki6eyVlTN4xxkR/eNU6zK48ciycExdl6Vduvmy2m7 /io+1QW2hofi1BAR9zDQgvilrhiwlCh1jawMYsH5iSs5DOvFFiFF5/r/Gu6P9bLXs4PreX lKBkyagE6AvS9WN712YOSF8yBOUzvAwkskEy23Hd+mlUWyx7Sa1BCRxTBdF8X3XaECok0K lar9iPib/yubOQoPBvBzAydLc+k0pRtFyyPaiQPAiGGuYvrll/lBcgxccI3dos+2FxZfhs C+adWjJJEf5j59TbI5THsdllwas0h1tgpQd8gqaGO2mmlfOuogZA0Iy2o8/RDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689667665; a=rsa-sha256; cv=none; b=xFi6T0xwWmeo/fYfA32CXt08zVQEHbJr4rfXZJo/fQs9eswpCzIQO+1XewCKIBS1/7vMAU RdO3h7mWAqCt0Uw6j+GgrHjrqYwGSd1/meRYNWf3EvAJ5QEWFZhFMaGUtg1xMGORwPFN9a mXLXs6iHYCyjp2UhOV8zjdpXgyyXk6iuXfvbyHk09WkWe4akZFMxFLcssNZbFHprtqLHTg 09Mb5Mj15honrReozdRGUqOerqzzxsxos+fUXZqOt6aaHuZXOxQGgR4uObH7fZB9w+k/qU e5xpeGTGdvBn1O7tBlgLzInVb2vDElhacEN7Ntm3shR20Ey+tieX5cgZNBcJvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4s4x2JRSzyFs; Tue, 18 Jul 2023 08:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I87jhK004408; Tue, 18 Jul 2023 08:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I87jWB004407; Tue, 18 Jul 2023 08:07:45 GMT (envelope-from git) Date: Tue, 18 Jul 2023 08:07:45 GMT Message-Id: <202307180807.36I87jWB004407@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 829dbdcac20d - stable/12 - logger(1): MFC: fix timestamps in case of long run List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 829dbdcac20d1237ac9693d2e5489857e151754a Auto-Submitted: auto-generated The branch stable/12 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=829dbdcac20d1237ac9693d2e5489857e151754a commit 829dbdcac20d1237ac9693d2e5489857e151754a Author: Eugene Grosbein AuthorDate: 2023-04-27 16:43:16 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-18 07:24:26 +0000 logger(1): MFC: fix timestamps in case of long run An example: ( echo test; sleep 2; echo test2 ) | logger -h /var/run/log Before fix, logger assigned same timestamp to both records. Fixes: 65547fb33db901a9f352aacb0ed45ce68b0bd275 Reported by: Vadim Goncharov (cherry picked from commit 83fd35b3f3fa580d2b99874abd1f67ee61dcb659) --- usr.bin/logger/logger.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c index 936bfc98803c..a99db27f6b1b 100644 --- a/usr.bin/logger/logger.c +++ b/usr.bin/logger/logger.c @@ -175,22 +175,23 @@ main(int argc, char *argv[]) openlog(tag, logflags, 0); (void) fclose(stdout); - (void )time(&now); - (void )ctime_r(&now, tbuf); - tbuf[19] = '\0'; - timestamp = tbuf + 4; - if (hostname == NULL) { hostname = hbuf; (void )gethostname(hbuf, MAXHOSTNAMELEN); *strchrnul(hostname, '.') = '\0'; } + timestamp = tbuf + 4; + /* log input line if appropriate */ if (argc > 0) { char *p, *endp; size_t len; + (void )time(&now); + (void )ctime_r(&now, tbuf); + tbuf[19] = '\0'; + for (p = buf, endp = buf + sizeof(buf) - 2; *argv;) { len = strlen(*argv); if (p + len > endp && p > buf) { @@ -212,9 +213,14 @@ main(int argc, char *argv[]) logmessage(pri, timestamp, hostname, tag, socks, nsock, buf); } else - while (fgets(buf, sizeof(buf), stdin) != NULL) + while (fgets(buf, sizeof(buf), stdin) != NULL) { + (void )time(&now); + (void )ctime_r(&now, tbuf); + tbuf[19] = '\0'; + logmessage(pri, timestamp, hostname, tag, socks, nsock, buf); + } exit(0); } From nobody Tue Jul 18 08:07:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4s4y5V7Vz4nwS4; Tue, 18 Jul 2023 08:07: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4s4y4Z2fz4JbK; Tue, 18 Jul 2023 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yg0ifaFJxgw+ha39gWT6Hl9kK80fS5hl9rdzZMkkI3Q=; b=J+aYOVKgOSgrnHuIXPKtuu7ac142FfjzaVEisk5vOLVaNuArxUhoKVxtsAqblMOR4azPMi 1LQVKs2VwE7qRUQeB/erPjL8mvroaW+WHn73Gk8b6odI/dAzkL1l2PUzw2YtqUCV71YfzV KbtsHCxqklXasZAvaWECRkpf+mKJzbxFVLNjMapF/U2sSr2UWpUtBzdCtvExJ7vSKBXsZP /hH2rWQX3JlQ2RKINQI7s5L+WPyJKUphO2+8KNc1cucla73CIUZpVXjeFqoLqSfnxwsrQe 5aSW6CdKOluVo/37Tlk6GSIs5HIhnOzlpXXi0Ruez9ovB1gOWVYMq2p7n7yMLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yg0ifaFJxgw+ha39gWT6Hl9kK80fS5hl9rdzZMkkI3Q=; b=JC5T17PZQWE9wWQm/aIAU+v5VstI1ZbBo9CGFsasTH5eFlZo+Ep6+EbIFECprIxTICaJ0+ 5qp0gy3psZlUZPM+XUzpYWnfabDKbCcxY0TqUaNKI/bvZ0/WSY638r51U/QSqGGN3+NbTi g+c+eWeFd2dxFpF3c8Px9JE3E/aikR+Vm0G+sx+jdhuYsg7/o4/StnCVcjK3R4ARaRDqUN InY7lOc+CdZyHZqu5grG7gYsCMeGOyeRQDivEhkrMCJzTMCdIwM9GVLgr7sLkuQIMddZ81 8U/KSRvKn7hnJ3mi1/BRDAYClW0La9Bd2ppZaSL2VFFBKujAdoNbLxuyPXKb6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689667666; a=rsa-sha256; cv=none; b=sczWvW0kZU/UW79y74tZ8jQTWfoHUsfTtdqFsj096lk+++NDgxt7RlYw0VS3MRStXx4IVu IWq924UODw1Y7lZEUJAQpxeQXvNO02bxXwitZ8/rUFV9FwC7g8kF5IlmlM4CtJ9Whrax90 3wP6CIrandRNDs3hvdF9oUoNRvJSF97UObJBOpTzASYxfn2pxQRSEEwfcHOIhnG4RdUPNN ZIrimH2pKpFhQzt2LG8Nx1kU0O8dmD45jbq6mdJi4NT3wvSz23wdlCOf18Sd18TL+pTpqK /j864ggs3U5IJ7m1VXxuAe94m4Se1ZSXhrs0cBLKQjF8+NIqFOfNpSfXar5hUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4s4y3PJWzyHM; Tue, 18 Jul 2023 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I87kEU004427; Tue, 18 Jul 2023 08:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I87kFU004426; Tue, 18 Jul 2023 08:07:46 GMT (envelope-from git) Date: Tue, 18 Jul 2023 08:07:46 GMT Message-Id: <202307180807.36I87kFU004426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 85c1418ba1c8 - stable/12 - syslog.3: MFC: document ident[N] format List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 85c1418ba1c827a73c04689fceb4edd1ab0eea64 Auto-Submitted: auto-generated The branch stable/12 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=85c1418ba1c827a73c04689fceb4edd1ab0eea64 commit 85c1418ba1c827a73c04689fceb4edd1ab0eea64 Author: Eugene Grosbein AuthorDate: 2023-07-03 12:35:37 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-18 08:07:04 +0000 syslog.3: MFC: document ident[N] format When libc switched to generation of logs as per RFC 5424, that change broke application ability to insert specific process id using ident[N] format, the feature existed for decades. Some processes rely on it (including logger and syslogd). Later the regression was fixed but the feature remained undocumented. This change documents it. (cherry picked from commit 5aee3e14d4914c7c99bce80da17b3100cb1f4490) --- lib/libc/gen/syslog.3 | 7 ++++++- usr.bin/logger/logger.1 | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/syslog.3 b/lib/libc/gen/syslog.3 index 5738d362bd0c..8a4104ab5f12 100644 --- a/lib/libc/gen/syslog.3 +++ b/lib/libc/gen/syslog.3 @@ -28,7 +28,7 @@ .\" @(#)syslog.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 12, 2018 +.Dd July 3, 2023 .Dt SYSLOG 3 .Os .Sh NAME @@ -130,6 +130,11 @@ The .Fa ident argument is a string that will be prepended to every message. +It may be formatted as +.Fa ident[N] +in which case decimal number +.Fa N +replaces the process id within messages. The .Fa logopt argument diff --git a/usr.bin/logger/logger.1 b/usr.bin/logger/logger.1 index 7a64320cfe49..a2774b9e3500 100644 --- a/usr.bin/logger/logger.1 +++ b/usr.bin/logger/logger.1 @@ -28,7 +28,7 @@ .\" @(#)logger.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 5, 2017 +.Dd July 3, 2023 .Dt LOGGER 1 .Os .Sh NAME @@ -73,6 +73,9 @@ tries to send the message to all addresses. .It Fl i Log the process id of the logger process with each line. +This flag is ignored and the process id is always logged. +See also +.Fl t . .It Fl s Log the message to standard error, as well as the system log. .It Fl f Ar file @@ -152,6 +155,10 @@ and Mark every line in the log with the specified .Ar tag rather than the default of current login name. +Use +.Fl t Ar tag[N] +to insert specific decimal process id instead of id of +.Nm . .It Ar message Write the message to log; if not specified, and the .Fl f From nobody Tue Jul 18 09:21:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4tkB431nz4kPWv; Tue, 18 Jul 2023 09:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4tkB3W9kz3MXp; Tue, 18 Jul 2023 09:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689672098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3WY8bSwFc4VwI7QML9KTFysgTWDN2WjJxwynwYi4xc=; b=hOxXRl6m9btUH+Q2sbfAG87WBF1b53k7aspySIbGhfvcwR7rJHBJv7z7MZdkgG28+3ZJIA iAr8qQrnyoEG1Z5DhJz1Y4AvtXsjL0zC16D3VU2xMMH5xdeEYgJ0L+ba8HC9ZI20vc7kMM 2oq+Qu+8/KQwZ2yIVcSLyD/JAKRGldJ0vR4LLS2y8wfVtbA89grz0SqqMVCacuqzru3VgK uSucAT2P6DZysnTZSiKGlCcGTlAH/6QEjZkyCCbTRKvhX9DnOg8TAHdbS0Ah69g7NkXaCL 9P/BmjTPWX4j3RyVsPmmMtNJSWomNuW7UNz2vkW1oA860a08UJJxSaMMbArWkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689672098; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3WY8bSwFc4VwI7QML9KTFysgTWDN2WjJxwynwYi4xc=; b=w4LoU0QMWuRdXHyZHspC0FLmIdNs6NegOTDWS6oPQoasw+L7/hn5e4jO7bEqNTKHLWe5VY xR1GjtNxTRAQKTrG8+fGgPx8QHEdp307X4gP93kDdmTLFJ9CNon6ETjPZEJ1Oo5L8md1vB y+hCm5lan576kpG7GCFcXV8S5OerAg8oAMY+jFr9MIGMrzq0gj8tVjgR1OH9gCvMrg8niW Y+AO8igdz+lHWkN9nCprBZ0PAFVjypl95495g9whjMcvcit2ViJ+NWgZ0/Z/pzytsy1jOV WW2634G/HZQnAUQYBAnlwu9reCC+h33skzmDJSK4MebRFJUwuEQNnTTBNFEywg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689672098; a=rsa-sha256; cv=none; b=wt2eROGLzT5HzfOPWsga77Hc+nrbkHMEsn3FYKiUSyVhM7yFOAZs5CmedP4oFaghFxTp9P Nx5tcYbYm0S27KGuXVT49i7Ma1m1oJOZ/VTtFycAI0PCYrCFw4HgFspxb7hX9rxKUjsW5a zJpzABkBi5al5Yx0gFGtFjh/1f9SoLZAuyO1bEij2AZXKKmQ4Pe+QWFCEl7JOfwydR6YG1 kL3cn+br4VtJozCRIfP1TXhfV9YZ1aUnDMR43qj/aY9RHw+QsP2tmFzflIXJLsjjvqdBpd k3vqv1vr6YREA98KDgw4ViJR4uJcmCYalnzy3tM/wHyTRXshFh3951Bt/Tq9Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4tkB2YzHz10Zd; Tue, 18 Jul 2023 09:21:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I9LcQk030474; Tue, 18 Jul 2023 09:21:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I9LcWP030473; Tue, 18 Jul 2023 09:21:38 GMT (envelope-from git) Date: Tue, 18 Jul 2023 09:21:38 GMT Message-Id: <202307180921.36I9LcWP030473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: b36f469a15ec - main - zfs: set autotrim default to 'off' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d Auto-Submitted: auto-generated The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d commit b36f469a15ecf508a2fdc2b58a76f0f2b4a0b88d Author: Yuri Pankov AuthorDate: 2023-07-17 09:12:53 +0000 Commit: Yuri Pankov CommitDate: 2023-07-18 09:20:11 +0000 zfs: set autotrim default to 'off' As it turns out having autotrim default to 'on' on FreeBSD never really worked due to mess with defines where userland and kernel module were getting different default values (userland was defaulting to 'off', module was thinking it's 'on'). PR: 264234 Reviewed by: mav (zfs) Differential Revision: https://reviews.freebsd.org/D41056 --- sys/conf/kern.pre.mk | 3 +-- sys/contrib/openzfs/include/sys/spa.h | 6 ------ sys/contrib/openzfs/module/zcommon/zpool_prop.c | 2 +- sys/modules/zfs/Makefile | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index e401a652bf97..8314f4489ca8 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -252,8 +252,7 @@ CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC} # Special flags for managing the compat compiles for ZFS ZFS_CFLAGS+= -I$S/contrib/openzfs/module/icp/include \ ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ - -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \ - -DIN_FREEBSD_BASE + -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP .if ${MACHINE_ARCH} == "amd64" ZFS_CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \ diff --git a/sys/contrib/openzfs/include/sys/spa.h b/sys/contrib/openzfs/include/sys/spa.h index 1fa2044008dc..b90855687411 100644 --- a/sys/contrib/openzfs/include/sys/spa.h +++ b/sys/contrib/openzfs/include/sys/spa.h @@ -723,16 +723,10 @@ typedef enum spa_mode { * Send TRIM commands in-line during normal pool operation while deleting. * OFF: no * ON: yes - * NB: IN_FREEBSD_BASE is defined within the FreeBSD sources. */ typedef enum { SPA_AUTOTRIM_OFF = 0, /* default */ SPA_AUTOTRIM_ON, -#ifdef IN_FREEBSD_BASE - SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_ON, -#else - SPA_AUTOTRIM_DEFAULT = SPA_AUTOTRIM_OFF, -#endif } spa_autotrim_t; /* diff --git a/sys/contrib/openzfs/module/zcommon/zpool_prop.c b/sys/contrib/openzfs/module/zcommon/zpool_prop.c index 459ff62fc996..c4aca04a96bd 100644 --- a/sys/contrib/openzfs/module/zcommon/zpool_prop.c +++ b/sys/contrib/openzfs/module/zcommon/zpool_prop.c @@ -160,7 +160,7 @@ zpool_prop_init(void) "wait | continue | panic", "FAILMODE", failuremode_table, sfeatures); zprop_register_index(ZPOOL_PROP_AUTOTRIM, "autotrim", - SPA_AUTOTRIM_DEFAULT, PROP_DEFAULT, ZFS_TYPE_POOL, + SPA_AUTOTRIM_OFF, PROP_DEFAULT, ZFS_TYPE_POOL, "on | off", "AUTOTRIM", boolean_table, sfeatures); /* hidden properties */ diff --git a/sys/modules/zfs/Makefile b/sys/modules/zfs/Makefile index 2cfdf06f8f01..8964e461cdd2 100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@ -38,7 +38,7 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \ -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ - -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE + -D_SYS_VMEM_H_ .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -D__x86_64 -DHAVE_SSE2 -DHAVE_SSSE3 -DHAVE_SSE4_1 -DHAVE_SSE4_2 \ From nobody Tue Jul 18 13:36:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R50NW623mz4mqKN; Tue, 18 Jul 2023 13:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R50NW05szz3h5h; Tue, 18 Jul 2023 13:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PMRWe4HbwmxjViUqfL18/HSYd1kdPY7oADDOutAVYwg=; b=RP2L85FGn/ey+ivgdoIqPzOXkmy0FSZMvKyPXLGTbmsMkpW6V32V9IM17sTker5ULBxqyh d67cJfMGZp57j1SX/GbN3U2ojoN3Pge4vxt+/5NtVwi2Fz4hDAChqwkOSvlsIGX/QPwa3L IFANY1ygjKO5SshLsSa48QJODa3CdZ67fsso2ss9n6mwGN46WIZCZxwUuFlQuOvkug/I5r t2lDqRJjPxXHDywLJOxx/UL+1TCTB5pSr8MnRW/tuuJ9yYtGTuTOEGWpPRnD3yS5eV+pQe VGyg6/g9MLE2764IB+mfWtnSUcPgEV0AFBmPCE1MoAoiDrox3ixldMV2WpqlGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PMRWe4HbwmxjViUqfL18/HSYd1kdPY7oADDOutAVYwg=; b=E8qfNNb0j5eZ55PjlF/SdNqhFu1nSkad7uSHroxxRyopkdbmS4cFqdWyYSm4koqiO6lFM7 kE6Bbfw6HfeFOhM+BjDPW8X4VZa5xGn+to04rR6lEkIHYGfq7AisoinW54bKNd7Rw7rivX 4XsXjLcZUx1bX7Sf9LzhodOYkvERnKOnt4a9xqWolZ5cww75qmesnTj78yPyCf7+LdMU1R ITFGjAf8C64zKqkG9D3SbPpikQxM/LOUQZ8fiq6jH8VW4aaAckhB4c+B0Ri4PZnmBNxo8D BU3pc8JDXtkmmKBV4/cSAuW3f7SIhJKqekPWxVefd3ubFzbXLpNzWIAyJSZ2Sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689687403; a=rsa-sha256; cv=none; b=ne2VWtAam5ZmGT/abId/h6L3rRlgPdqRQrz0EipKT4xsE0GwNoCiZmJ53o9s4dWAfgU+wj O85m2zFtmUQCyDhY+PTc6fZ814fZdTesMgCv40MPlhYy1zFsgVKOE/DHLnyQKVP9PVW+Yj tXiw4VaJSsBOkcKixfOxgOjpAHxyP787RgaVxrGtYp8oWIld778/8t8G6erQVI475dk12D j7AxquPToE1rwpBT31+iZswN7b+ciSSyBZMXNyRDDJNV4xS+Pcw3mktIW/dmnQRKNu10sC FmD/bFVYU/rqSSpfDm7FLnYVqDnKZx6UJg2Uznpw7taERRzs22pjYbmQxkipOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R50NV5HS4z16yC; Tue, 18 Jul 2023 13:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IDagKM049887; Tue, 18 Jul 2023 13:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IDag1H049886; Tue, 18 Jul 2023 13:36:42 GMT (envelope-from git) Date: Tue, 18 Jul 2023 13:36:42 GMT Message-Id: <202307181336.36IDag1H049886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 97092573d5d4 - stable/13 - man(1): use gzcat for .gz files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97092573d5d41c665034aaa93ae6779ff04c2638 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97092573d5d41c665034aaa93ae6779ff04c2638 commit 97092573d5d41c665034aaa93ae6779ff04c2638 Author: Mohamed Akram AuthorDate: 2023-07-03 15:20:51 +0000 Commit: Mark Johnston CommitDate: 2023-07-18 13:36:06 +0000 man(1): use gzcat for .gz files POSIX zcat appends the .Z suffix to file arguments causing the command to fail with .gz files. Signed-off-by: Mohamed Akram Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/789 (cherry picked from commit b35ea9bac974a5650dcc234c06b3dc41d127f1d7) --- usr.bin/man/man.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index cf90b64f7991..60b329810734 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -894,7 +894,7 @@ setup_cattool() { case "$1" in *.bz) cattool='/usr/bin/bzcat' ;; *.bz2) cattool='/usr/bin/bzcat' ;; - *.gz) cattool='/usr/bin/zcat' ;; + *.gz) cattool='/usr/bin/gzcat' ;; *.lzma) cattool='/usr/bin/lzcat' ;; *.xz) cattool='/usr/bin/xzcat' ;; *.zst) cattool='/usr/bin/zstdcat' ;; From nobody Tue Jul 18 13:36:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R50Nc0kYJz4mqRg; Tue, 18 Jul 2023 13:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R50NX0DYKz3h5j; Tue, 18 Jul 2023 13:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l15IdGYb6o2vDh3qrnl3T4tKXVlMTy89YHUD5Jen82w=; b=DeNdQ8unLDKWjjidYGazU8aPsIQkf6ooBvaAd55XKSynCPNXzzMi1H1hK3Ei78WASj9ooC HGr9GRqRSRwF/GFhXgpdCZ8WlmsMq34+gUbtxN/XQQtLiNFcMqkDrkWUIGhmF3rSaKeQnT KmQpiqHEUk5cUmW9aVsCisMDQUpFnWs5wjEVtnie0sa+cNCMriJCzavA0HoQjju1pmCg9V j3gUDaPX2JK3lSB+ix+Cb0vXh8pQRXwf8BkrVzPtlHQQdgPHlukdiO5vGObEZFXsYSd4tw pvXmxlWiEQ/5bew9uUhDO/jQbvptG2LP3BZazsQjNBJZ2xAjikyE2wo18pNBMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l15IdGYb6o2vDh3qrnl3T4tKXVlMTy89YHUD5Jen82w=; b=Cg6Ed3FOmZOe+3yydCzcfFGLfWGyKqTDBoXyPi5Tq6NMChevMBI4ugW1iMUiv0+ohi95Zx tKIWg2ezWxdzV9P8TAHH1ksUgKy1H1l8xQetn7gHANtPN7n+i3be7q8w7iN2cDEr0SK6QG KAObpRQVjM3FBMkbZkD8rT1otcw3ms65gNB9O/4U+P+d0hlvljvUHIewE/iDiYV5O0Ko0g /SHa1fg609wKTZwVUitK8+PZlxFX5Fv98Ant+JF4S72Ddv4CVazZkeOrbEZdTfpqmauSd6 +D8jO9oVe6BZkzrGy6e7rapzzCYHQo1OJr3dhjDtD7q7RexmpxQrGTrHjQnsAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689687404; a=rsa-sha256; cv=none; b=UO7HM/Fe4/d+frKEyB+yoZonbZFI6qb4CHKqC9NADa11kh8DIshLDfNUGEiaMrMQ3iX8mO O5FCroH5AaoiTcdjYgyAgiQFkjOy2i3nZXDMAuRgJWw8X7vVbJ0ODRJYqlGtgQKEc+RquE iNi/dzeBaCzuzYRiKzfm1Jo0Tj372gtQIFxXECXa5LK1bWG7/CZt4gMhq2jeCH+mzg/r3I rpkxRGNUOArvV77Un7Seev81KS694x9yB97Jad4utjqkG7wCocLloIs9CRnEkgCO2/XATO L5lyanNgeIpa+OTwqAzmSGKPN/7i0ME1Zk99/eqHu/G6Pe6HO0IBKgLiK9gFxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R50NW65WPz16gK; Tue, 18 Jul 2023 13:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IDahwf049906; Tue, 18 Jul 2023 13:36:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IDahGY049905; Tue, 18 Jul 2023 13:36:43 GMT (envelope-from git) Date: Tue, 18 Jul 2023 13:36:43 GMT Message-Id: <202307181336.36IDahGY049905@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3bc6020f3024 - stable/13 - ure(4): add support for Thinkpad Hybrid USB-C with USB-A dock List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3bc6020f3024eccd1c876bbc2ca5499fc7df07f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3bc6020f3024eccd1c876bbc2ca5499fc7df07f1 commit 3bc6020f3024eccd1c876bbc2ca5499fc7df07f1 Author: Joerg Pulz AuthorDate: 2023-07-04 16:08:13 +0000 Commit: Mark Johnston CommitDate: 2023-07-18 13:36:14 +0000 ure(4): add support for Thinkpad Hybrid USB-C with USB-A dock Add support for LAN port found on Thinkpad Hybrid USB-C with USB-A dock. While here fix a small typo - s/UBS/USB/ Sponsored by: Technical University of Munich Reviewed by: markj MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/791 (cherry picked from commit 53a03e312cf27fca9b672c22d9b1687a66785cfb) --- sys/dev/usb/net/if_ure.c | 1 + sys/dev/usb/usbdevs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 9a421f02732e..106182959575 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -106,6 +106,7 @@ static const STRUCT_USB_HOST_ID ure_devs[] = { URE_DEV(LENOVO, RTL8153_04, URE_FLAG_8153), URE_DEV(LENOVO, USBCLAN, 0), URE_DEV(LENOVO, USBCLANGEN2, 0), + URE_DEV(LENOVO, USBCLANHYBRID, 0), URE_DEV(MICROSOFT, WINDEVETH, 0), URE_DEV(NVIDIA, RTL8153, URE_FLAG_8153), URE_DEV(REALTEK, RTL8152, URE_FLAG_8152), diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index bab6d835d417..41386c7b2665 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -2830,7 +2830,8 @@ product LENOVO RTL8153_04 0x720c USB 3.0 Ethernet product LENOVO TBT3LAN 0x3069 LAN port in Thinkpad TB3 dock product LENOVO USBCLAN 0x3062 LAN port in Thinkpad USB-C dock product LENOVO TBT3LANGEN2 0x3082 LAN port in Thinkpad TB3 dock gen2 -product LENOVO USBCLANGEN2 0xa387 LAN port in Thinkpad UBS-C dock gen2 +product LENOVO USBCLANGEN2 0xa387 LAN port in Thinkpad USB-C dock gen2 +product LENOVO USBCLANHYBRID 0xa359 LAN port in Thinkpad Hybrid USB-C with USB-A dock /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader From nobody Tue Jul 18 13:36:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R50Nc0ldHz4mqVQ; Tue, 18 Jul 2023 13:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R50NY0hbBz3hD0; Tue, 18 Jul 2023 13:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ycIPmmC7AHmV3YyQ6C03rWINV1W2qPBA243VSHjnssE=; b=WAUJ5I+ov+c2eD/9DelaIzCedbezP/JZeaGnGK8FP6DZcSbQf4RznpOBa/hLJnNMZyKUeH Pu6cHvkyXxlxEcZ28SyN1BsbIYC2/O4curP3wL07c7dGCWPYY2PUcES/TwpqVA0QDv27ZW KpwHu7T40b8tnx9eMwcGkBEYfjgW7abaR6qRMBXehiojCMjxbQyQjSCOYu3jymcMVHYj5j jI3WL/HAHbD8hzb72ms6cZV/+AURSHdTsLSUCEc5+r5cFbAOhZXk8pPqijEu3z/kZyJp2n LE1UoBR3fg4xJaT1AZu2G6QZV8YPciKC7EcaKHXkqu8ZWa1zjroKfcvc52aWiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689687405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ycIPmmC7AHmV3YyQ6C03rWINV1W2qPBA243VSHjnssE=; b=D+pz56pGY/SoWg1MfC8hLhcsQ5pQq+DVsK8QYYPVzzjnKkjQvF+gGLsBhqRFkL5dmrajbx xZEkPgIQbjdia8+TPOut508qfSBDAkxdpzpwYmdrliJWObvsO+TZn2qcNkeVQS3pNiPphr 1PhRDncSwKWhYCt+1a5VxrE7X20HSFh7iUn3GOV+2SPamWuoA6pcTYWXrhGAXTgdQhV50O PIrIVr3szRpjH5YyVnd/Nm8p4ckt6KHy+TCcj3nhdar9ykQI+HfQTwcqwilagy4Do5T3Pr NywfHRSRd1ECSjBayqL5KWzEcWHIOpeIt0ysfHEL5CBqQV9vRpsELv+SXM6lGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689687405; a=rsa-sha256; cv=none; b=RstHrAP0VZQeUTpipb5g1FspPgeKaAVHYi5KM5tbfVdn5KJKuW/BYYb3dJ40oXHe9tufML qGy0cUJXsllXFytwSwbnbhxFNvJxStQ7IW5/+ZVo/XFrLSrJ/DBwO9rf8QO58SBGQZoTrN Zh1TcApXJ4LZr43890XSYdZrlLfM26UWul2IIdKsBFDjPmRtzlp2/lqZLri2PB4TfowZDL Uq2s6O25CmgBZyLVzusXvBX1Qg6aftQPeZYg9XbWIprOoZNsJnh/joHo4vyY7UF+eZN6LS qcw5cYX1cDuHW75992waVjklW9PTH/onmln0YKC3NIaAuO57DtgifiAgHmWN8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R50NX6gdFz178v; Tue, 18 Jul 2023 13:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IDai1K049925; Tue, 18 Jul 2023 13:36:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IDaitY049924; Tue, 18 Jul 2023 13:36:44 GMT (envelope-from git) Date: Tue, 18 Jul 2023 13:36:44 GMT Message-Id: <202307181336.36IDaitY049924@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a710a3f13da3 - stable/13 - bhyve: Deduplicate some code in modify_bar_registration() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a710a3f13da34aa5fd26eb9c6b33381aff6f38b8 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a710a3f13da34aa5fd26eb9c6b33381aff6f38b8 commit a710a3f13da34aa5fd26eb9c6b33381aff6f38b8 Author: Mark Johnston AuthorDate: 2023-07-11 19:22:37 +0000 Commit: Mark Johnston CommitDate: 2023-07-18 13:36:25 +0000 bhyve: Deduplicate some code in modify_bar_registration() No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40877 (cherry picked from commit 0dea4f064dfcd0725d02b9b2d02b2494ca866857) --- usr.sbin/bhyve/pci_emul.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 34ce3cb7d49a..2b73d82be025 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -606,9 +606,6 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) error = register_inout(&iop); } else error = unregister_inout(&iop); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_MEM32: case PCIBAR_MEM64: @@ -624,21 +621,18 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration) error = register_mem(&mr); } else error = unregister_mem(&mr); - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; case PCIBAR_ROM: error = 0; - if (pe->pe_baraddr != NULL) - (*pe->pe_baraddr)(pi, idx, registration, - pi->pi_bar[idx].addr); break; default: error = EINVAL; break; } assert(error == 0); + + if (pe->pe_baraddr != NULL) + (*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr); } static void From nobody Tue Jul 18 13:49:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R50gN3JkSz4mxTN; Tue, 18 Jul 2023 13:49:36 +0000 (UTC) (envelope-from jhibbits@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R50gN2mQ9z3ldK; Tue, 18 Jul 2023 13:49:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689688176; 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=3ejVLOQIXh+dPXa1Sy31TIDFFs8XY4bLwd02rgTzEjQ=; b=vGzUxPEiaq2/W0U4+ER++bovQZSsQPs4rf0T5N5D63eRwduo46hrfd6EK9AHgY0mNg+ofX kpPgKunnoFhPd2gQEOswwVz2JSPPE1JZYfKTwIVTKYyi9BqvDvSOjbnrE3Xo+82iiHbVwb tdmgcNb/CO/UXkNLxkZ2RamMZ4fsioC8F+ke5lUaYQ+hdod6+KYbts/esOl0EnGMmgcbJA A+MLdLVOMzR2NLDSClb/H0yIrLoYm4AvKI91j1KS6k2+P3UKOVLoVGFsofaFZa0STTg7Pk eK3vGum4sxuOdM4e3eRNBOu9IItXGvfadB8wFggNkUMoZeuk++D/E5KFCpZd6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689688176; 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=3ejVLOQIXh+dPXa1Sy31TIDFFs8XY4bLwd02rgTzEjQ=; b=x96J3LyXxBLhFihvMkEVZFcO7Y4ZZ6Cx6jT8c7KeKfb6bHIk0US4ggZzY/g9qDxaiApvb5 UpEoKHb40/iSIPga2jUAEdOVjZhG4egkO1ib9pneQETQLizytNYQWrSkY388xJhFz7pPfj 9CyCRthB58TNQ99xwbjOF0oVFH+ExszE73GUjnlvVvWTK9kmuxoJUsAAaKfnOCpSmXSEii +mMMk6owD1s2Js6tmr012i67WvCEa/Nq9qv58xU7dtUPgj5zZRJv6mMvzHZA9iU8UtPVXH b4zl/mNgVjAB0IEYnwBuAATt4p60EWzcoMeZzC+VVxsKBPK31b6RC1zbbdQULw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689688176; a=rsa-sha256; cv=none; b=BuCO4wS0LTwko/IfpShgon4gHDoaPCQdS7R/sjiaKGC2epi1mbpS3Lg7p2XZDnQIGMHccS MS1C6k4jZmSNzu3tADpLTgLxsv6hnGutDnwa0uYdccohoUz5uET7IBn1mdfWnPtoChnOOy hZnfK13g9xYXZK3tIf5UH5BP71xIHWhUlY3QoBpzL0OPPKj8n7sSjE2DRYA/bpMAdg4UOw BP1onBJ5xBJP93P62eyIl4dXnRBcSZpKFk7Ke1n9tME9ctxhDhXmc9cmV92vborE4N9Lbv meJVenznnx/WGxfS++UMyZA7bYltjS5vdjpL+7+ODjJicUXrqWFWQ03WJefWyA== Received: from ralga.knownspace (ip-163-182-7-56.dynamic.fuse.net [163.182.7.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhibbits) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R50gM6xJwzWTl; Tue, 18 Jul 2023 13:49:35 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Date: Tue, 18 Jul 2023 09:49:27 -0400 From: Justin Hibbits To: Jessica Clarke Cc: Ka Ho Ng , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 034c0856018c - main - modules: fix freebsd32_modstat on big endian platforms Message-ID: <20230718094927.1474f972@ralga.knownspace> In-Reply-To: References: <202307070424.3674OBaa074389@gitrepo.freebsd.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; powerpc64le-unknown-linux-gnu) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 7 Jul 2023 18:59:41 +0100 Jessica Clarke wrote: > On 7 Jul 2023, at 05:24, Ka Ho Ng wrote: > >=20 > > The branch main has been updated by khng: > >=20 > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3D034c0856018ccf73c0f2d6140825f= 3edf43f47b2 > >=20 > > commit 034c0856018ccf73c0f2d6140825f3edf43f47b2 > > Author: Ka Ho Ng > > AuthorDate: 2023-07-07 04:21:01 +0000 > > Commit: Ka Ho Ng > > CommitDate: 2023-07-07 04:22:59 +0000 > >=20 > > modules: fix freebsd32_modstat on big endian platforms > >=20 > > The layout of modspecific_t on both little endian and big endian > > are as follows: > > |0|1|2|3|4|5|6|7| > > +-------+-------+ > > |uintval| | > > +-------+-------+ > > |ulongval | > > +-------+-------+ > >=20 > > For the following code snippet: > > CP(mod->data, data32, longval); > > CP(mod->data, data32, ulongval); > > It only takes care of little endian platforms that it truncates > > the highest 32bit automatically. However on big endian platforms it > > takes the highest 32bit instead. This eventually returns a garbage > > syscall number to the 32bit userland. =20 >=20 > This fixes the case where uintval is the active member, but breaks the > case where ulongval is the active member, since it=E2=80=99ll take bytes = 0, 1, > 2 and 3 which are the high bytes for BE, not the low bytes. This is an > intrinsic issue with BE; LE is very permissive when you access the > wrong union member for different-width integer types, but BE is not > and you have to access the right one. How does userspace know which > member to access, anyway? The kernel needs to repeat that and copy > the right member based on that information, otherwise it is > inherently impossible to have both cases work on BE. >=20 > > Since modspecific_t's usage currently is for the use of syscall > > modules, we only initialize modspecific32_t with uintval. =20 >=20 > Is this saying that uintval is always the active member, never > ulongval? If so, there need to be comments, both in freebsd32_modstat > to justify this and on the type to say =E2=80=9CDO NOT USE (u)longval=E2= =80=9D, > otherwise there is a significant risk someone will start using > (u)longval and we=E2=80=99ll be stuck. Perhaps (u)longval should even be > renamed to be ABI-compatibility padding (and aligning). >=20 > Jess A better solution is to make these fields fixed size, so we don't run into this problem again. Is this feasible, factoring in any other consumers? - Justin >=20 > > Now on both BE and LE > > 64-bit platforms it always pick up the first 4 bytes. > >=20 > > Sponsored by: Juniper Networks, Inc. > > Reviewed by: markj > > Differential Revision: https://reviews.freebsd.org/D40814 > > MFC after: 1 week > > --- > > sys/kern/kern_module.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > >=20 > > diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c > > index 40e47868481c..d4edc64a5ce4 100644 > > --- a/sys/kern/kern_module.c > > +++ b/sys/kern/kern_module.c > > @@ -520,10 +520,9 @@ freebsd32_modstat(struct thread *td, struct > > freebsd32_modstat_args *uap) id =3D mod->id; > > refs =3D mod->refs; > > name =3D mod->name; > > - CP(mod->data, data32, intval); > > + _Static_assert(sizeof(data32) =3D=3D sizeof(data32.uintval), > > + "bad modspecific32_t size"); > > CP(mod->data, data32, uintval); > > - CP(mod->data, data32, longval); > > - CP(mod->data, data32, ulongval); > > MOD_SUNLOCK; > > stat32 =3D uap->stat; > > =20 From nobody Tue Jul 18 16:27:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R549F1gxJz4dVYy; Tue, 18 Jul 2023 16:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R549F1FjPz3KpH; Tue, 18 Jul 2023 16:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689697633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWok5OqVYIvuenSXZcT+R9CkjIlXPpz08iNxyPto5Ns=; b=J/bzaxtwDQ4j5M2+vTjQrUr/NTL3D6XgllZdADIIjpfjtItd4HsdqztV4O8tzvKVE1PlO3 oiRX+a5qM5wvcmaVOwVRlP5wGQ33FHNLp147tKjOyDA5Z9ax2M/ZqnCnxXLhtk6l8Vm80p ev3ODO7WpBx62C+Ku5AQ+i55nMyUJ5S7pGeEwCBBae3iVeDEoCR9EVjojQuKkzSq+TAZcQ +mZI6Z5G+/wp7CJ3Mi4aaNP7q97bB/7gCmrnG6iQSjYL/NzUQA8f0raRr2DafhK9ttr7AQ EQplKTeaYHRedy3XRmsc89hv+onDSgbsKUcNx0IZGD7ntjrGWuOJI1NFqBVkxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689697633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWok5OqVYIvuenSXZcT+R9CkjIlXPpz08iNxyPto5Ns=; b=WlvS2vm6liq0xxxY1Eiulh3I6vCaYMx+kIyz528FFLFYCFF5pqXkJVBI2zYqE0gQaQd5k/ 5Gwndw8bTnZ8+q3hgezh/GeYiLyuM8xIrZYxoWQBwn47wLEW7TMoUVC6p1fhiJRB3wvv1S wglsaQzp22zPHtIimr/N6ufand/N3U76uS5OQX18XW+SLzuHmmuvYmfO12C7ex6slvc4Km VPnG2s5MkiH1nNxhhC534JaiY+PQB9l7VAw6WFPdhjHDhlilzdT6mi+sSBT5Uv0MVv950+ I2xyGkj/Ic88T7/n6sWqTbNl5zQGUjWEaOfsMmwVkkQV6r3/JUYNjQbK9714Vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689697633; a=rsa-sha256; cv=none; b=K4eR5Nvx8x+HvTqxvNQe3BvONMUKQyNUBZzrCIAtOBhFcnE4ucGSYn/kaLTt8fhiBPU3XZ 5yioXPohAbEl4gMo/7KAL5TfVSJZOZU7z1ErOvrQRw7ll6NmzYGnbnN5rGHGJbZAGuxA4L PWe6uEz2DA6eXzAKb2fdW4LECMfvrnVW8qQ7ubF9kOWdL5HdUNUbbypFRHmzH0tFkareyF F9b621w285E4Ee6KWeGYuOZqZ99bM3bhgum4SAc6IxgNjvZOTIzP97YiLL9VIuvq0xTzGp 9oOqso7/ZXbLkhM/jFIOBM3WY3Cr5g+V0pHkIHOLW3zwFMGhNcsAZvurhhZbqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R549F0Bwsz1BdN; Tue, 18 Jul 2023 16:27:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IGRC1o031601; Tue, 18 Jul 2023 16:27:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IGRCqF031600; Tue, 18 Jul 2023 16:27:12 GMT (envelope-from git) Date: Tue, 18 Jul 2023 16:27:12 GMT Message-Id: <202307181627.36IGRCqF031600@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: d5e2d0f140ce - main - openssh: document a locally-applied workaround List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d5e2d0f140cef6d09c4ddeb594cee027642366a7 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d5e2d0f140cef6d09c4ddeb594cee027642366a7 commit d5e2d0f140cef6d09c4ddeb594cee027642366a7 Author: Ed Maste AuthorDate: 2023-07-18 16:23:31 +0000 Commit: Ed Maste CommitDate: 2023-07-18 16:27:02 +0000 openssh: document a locally-applied workaround We have a local hacky workaround for an issue caused by a hacky upstream autoconf test. Reported upstream on the OpenSSH mailing list: https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html PR: 209441 Sponsored by: The FreeBSD Foundation --- crypto/openssh/FREEBSD-upgrade | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crypto/openssh/FREEBSD-upgrade b/crypto/openssh/FREEBSD-upgrade index caf9597b0d6b..905b65ec4e3d 100644 --- a/crypto/openssh/FREEBSD-upgrade +++ b/crypto/openssh/FREEBSD-upgrade @@ -187,6 +187,14 @@ recognize and ignore the configuration options to avoid breaking existing configurations. +12) 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 + option altogether. There is a hacky SKIP_DISABLE_LASTLOG_DEFINE=yes to + skip setting DISABLE_LASTLOG which we've applied for FreeBSD, but the + autoconf machinery really ought to be reworked. Reported upstream at + https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-May/040242.html This port was brought to you by (in no particular order) DARPA, NAI From nobody Tue Jul 18 17:04:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R54zm0nXzz4nKJN; Tue, 18 Jul 2023 17:04: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R54zm0JDfz3nKk; Tue, 18 Jul 2023 17:04:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689699844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQGbv65GJmk8xaxfPdc+OpJNkBGgK6TNxJAb5GJUVeA=; b=cTmie3NpbKFAyLYe9y3OkIUaesEep9HIY+CCraq212yRkr8dQ3eFr0XIP2cAYc3wg9FVDO bw4ZAC0SIq+jtN8qktUnamplYFQCoOn0Tz68K7bODQWi67WhURZP7vs0rYn1sFdLv2tSry 7uS1J97qS0FqBUEap3+OORArRaJXnnhjmG4ycT2IpNm82QAnTPDCKvwbF0y164vqfosDCw h6WPd/KlzYpsOAfIOGz+/LU1lmo7DVYZWhwm4JGBGo1kt74FhuLAp/nIaDId4fb23n2n7V tE6K6EaAi02Zuav0PkJW+eDaYD/qK3cO4pvDc7N8g1ZGYrzZgh0zFzLVor9jsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689699844; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mQGbv65GJmk8xaxfPdc+OpJNkBGgK6TNxJAb5GJUVeA=; b=vubP5exbx/v6bQDZjvkNlY5efXPUGiFuTAFTd02ejl20mQaVdlLg4wWMmCnHlEuEX05M+n 8CnbiDDrRuhy5LwvVXfKRruE/296V8RGAWE+OTQLczJp/aDdBf5H6TQe0GNbrOzfA5JInq H7EVxykr6wq7iJg2J06N+Gzwt/Q0vHWZ3TCDCSfr2tXRdu58vGhCiBbSLadBQTZfRTrcnZ Gjh3/aF3jhGCPqosuXf6zAaQTx6eXClSco+tP1xvyo/uCuJT1JcrrvQMmhy3e1cpLnIZyn /mJFFmgfhAtQAEwdmwfJSu5AQ9k9QUMxzI5lr+r6dgMYaIKkhknUE+D1C5UFFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689699844; a=rsa-sha256; cv=none; b=S+qoZQK6fB/zv15q6O0LSSSk6kM6C6BGgKhKy6tbMtJ+OjSMWvUHOKL5l1VR9B3RyDHAki uU2N+dT+sMDFpRg7320Eb0Abm7pYHDftKDLdL0W3hZLDqvHlL4dKfySrFhq8evLECWi035 stEkFu+MD6qWJCu51qb7S6rzVcDxwUuCVBhfLQvoqtBYM51EEQGJqN49//w/MqYasHWiJf U5ng0Kn95THligvF7DoCHAj8vO/dJVoWz25v2VijjwpS1od9HW7y1WagXnnXjawQUJ2xJz nTjtF0lumuxXtgb7vM+9a4CuwkNNhYTY0i/Wpw768R9pTYftwl57gt2TLFTxEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R54zl6BfVz1Ctg; Tue, 18 Jul 2023 17:04:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IH43Rk097909; Tue, 18 Jul 2023 17:04:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IH43FZ097908; Tue, 18 Jul 2023 17:04:03 GMT (envelope-from git) Date: Tue, 18 Jul 2023 17:04:03 GMT Message-Id: <202307181704.36IH43FZ097908@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: 3bfbb521fef5 - main - ls: Improve POSIX compatibility for -g and -n. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3bfbb521fef5764ecabc2bf3fdc76f47258171f8 commit 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 Author: Minsoo Choo AuthorDate: 2023-07-18 16:49:59 +0000 Commit: John Baldwin CommitDate: 2023-07-18 17:03:09 +0000 ls: Improve POSIX compatibility for -g and -n. - Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) to use POSIX semantics of implying -l but omitting the owner's name. - Change -n to imply -l. The -o option remains unchanged (POSIX defines -o as a complement to -g that implies -l but omits group names whereas BSD defines -o to add file flags to -l). This compromise is the same used by both NetBSD and OpenBSD. PR: 70813 Reviewed by: jhb, Pau Amma Co-authored-by: John Baldwin Differential Revision: https://reviews.freebsd.org/D34747 --- bin/ls/ls.1 | 11 +++-------- bin/ls/ls.c | 10 +++++++++- bin/ls/ls.h | 1 + bin/ls/print.c | 8 +++++--- bin/ls/tests/ls_tests.sh | 19 ++++++++++--------- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index fb1b4f6ba606..b3563eb38921 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd October 31, 2022 +.Dd July 18, 2023 .Dt LS 1 .Os .Sh NAME @@ -301,14 +301,9 @@ and .Fl s options. .It Fl g -This option has no effect. -It is only available for compatibility with -.Bx 4.3 , -where it was used to display the group name in the long +Display the long .Pq Fl l -format output. -This option is incompatible with -.St -p1003.1-2008 . +format output without the file owner's name or number. .It Fl h When used with the .Fl l diff --git a/bin/ls/ls.c b/bin/ls/ls.c index bd7bd283c317..b027e34afc2c 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -144,6 +144,7 @@ static int f_singlecol; /* use single column output */ static int f_sizesort; int f_slash; /* similar to f_type, but only for dirs */ int f_sortacross; /* sort across rows, not down columns */ + int f_sowner; /* disable showing owner's name */ int f_statustime; /* use time of last mode change */ static int f_stream; /* stream the output, separate with commas */ int f_thousands; /* show file sizes with thousands separators */ @@ -402,7 +403,11 @@ main(int argc, char *argv[]) f_listdir = 1; f_recursive = 0; break; - case 'g': /* Compatibility with 4.3BSD. */ + case 'g': + f_longform = 1; + f_singlecol = 0; + f_stream = 0; + f_sowner = 1; break; case 'h': f_humanval = 1; @@ -421,6 +426,9 @@ main(int argc, char *argv[]) break; case 'n': f_numericonly = 1; + f_longform = 1; + f_singlecol = 0; + f_stream = 0; break; case 'o': f_flags = 1; diff --git a/bin/ls/ls.h b/bin/ls/ls.h index 410246ec9903..1f19858720bf 100644 --- a/bin/ls/ls.h +++ b/bin/ls/ls.h @@ -56,6 +56,7 @@ extern int f_sectime; /* print the real time for all files */ extern int f_size; /* list size in short listing */ extern int f_slash; /* append a '/' if the file is a directory */ extern int f_sortacross; /* sort across rows, not down columns */ +extern int f_sowner; /* disable showing the owner's name */ extern int f_statustime; /* use time of last mode change */ extern int f_thousands; /* show file sizes with thousands separators */ extern char *f_timeformat; /* user-specified time format */ diff --git a/bin/ls/print.c b/bin/ls/print.c index 5e8a54ca0620..b01b2e1e61db 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -234,9 +234,11 @@ printlong(const DISPLAY *dp) strmode(sp->st_mode, buf); aclmode(buf, p); np = p->fts_pointer; - (void)printf("%s %*ju %-*s %-*s ", buf, dp->s_nlink, - (uintmax_t)sp->st_nlink, dp->s_user, np->user, dp->s_group, - np->group); + (void)printf("%s %*ju ", buf, dp->s_nlink, + (uintmax_t)sp->st_nlink); + if (!f_sowner) + (void)printf("%-*s ", dp->s_user, np->user); + (void)printf("%-*s ", dp->s_group, np->group); if (f_flags) (void)printf("%-*s ", dp->s_flags, np->flags); if (f_label) diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index 117156b5cb0e..a85e43ecb938 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -525,18 +525,19 @@ f_flag_body() atf_test_case g_flag g_flag_head() { - atf_set "descr" "Verify that -g does nothing (compatibility flag)" + atf_set "descr" "Verify that -g implies -l but omits the owner name field" } g_flag_body() { - create_test_inputs2 - for file in $files; do - atf_check -e empty -o match:"$(ls -a $file)" -s exit:0 \ - ls -ag $file - atf_check -e empty -o match:"$(ls -la $file)" -s exit:0 \ - ls -alg $file - done + atf_check -e empty -o empty -s exit:0 touch a.file + + mtime_in_secs=$(stat -f "%m" -t "%s" a.file) + mtime=$(date -j -f "%s" $mtime_in_secs +"%b[[:space:]]+%e[[:space:]]+%H:%M") + + expected_output=$(stat -f "%Sp[[:space:]]+%l[[:space:]]+%Sg[[:space:]]+%z[[:space:]]+$mtime[[:space:]]+a\\.file" a.file) + + atf_check -e empty -o match:"$expected_output" -s exit:0 ls -g a.file } atf_test_case h_flag @@ -689,7 +690,7 @@ n_flag_body() atf_check -e empty \ -o match:'\-rw\-r\-\-r\-\-[[:space:]]+1[[:space:]]+'"$nobody_uid[[:space:]]+$daemon_gid"'[[:space:]]+.+a\.file' \ - ls -ln a.file + ls -n a.file } From nobody Tue Jul 18 17:08:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R555042Ynz4nMfx; Tue, 18 Jul 2023 17:08:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R55503cGSz3prl; Tue, 18 Jul 2023 17:08:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689700116; h=from:from:reply-to:subject: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=y1kDniyYLiFCzmswFdtQBZW+ucvr88RE33WpSNSkw8g=; b=BROFClAQmzpfX0MfkDOEAIAIUqJKaKJGDL/LvI3R9TqJ/y33oc93hGnTRGtUxkwmOq23rM bsargrLZZToisYsxHi7pOS5vUfF29n46KxFTvsMxjqFBtxEy5F3PVO0lIhsQjkemtOMld1 H9dZOEMfazT2ErdLomcQcpPvBEzUHck0ufOmX18VceUUEt5zlqGRir66zW6FrIAK/YsTbn wqr3q4wbLtAN13u+SWypnehMKm24gcCegfKU0pNFm3/KOe9/+D9SlVS29wOrFFMnsCSbzt LYDcxi9KCA7uvLeikp9YhD7yAfgKqv5aYRuX8ySeq7LD/Fn5cEN7MXxhK9or4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689700116; h=from:from:reply-to:subject: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=y1kDniyYLiFCzmswFdtQBZW+ucvr88RE33WpSNSkw8g=; b=G4WSZq122pj7FVVLoVSYPIKTb732dGhlZ/jF6LG0gV57G139TM1VXnlEplVe/61ouGfnK5 sueLrXegU+s1f1JUNkf52a5K3goCIBdGrxx5Z3vDViCZYerbvS9SA5+eiloc3/0iKq2g4r D2vm9R4ocqJnhWQZ9mfauu2Xx5DAccjJwpeoBrnTFG8ndjGOVfFpP9mgCsK8R+3B0a4iwr X6R5X73W/TwIba5Ou7CkyrY729FqGP6zwxGzFHvndgC2zI+ZiwvSHz0EF9c4c1TMo/dUSG f4IphYoRyXwLN74TOMq48f5W+w78Dh8Vu573sFshRPVOhKBrm7WvAKGUj9nKPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689700116; a=rsa-sha256; cv=none; b=lii3V+oL+AfIOkDRP9NzwegETdsX60jouUUkdMfE8NdYQf0RF/wWkNrRmXA7wWgXo46OIj XuCtxdPq5MFzLVFuGNP8/XhAjD1qHi9bMrsrIfMkch2kKu18acJf4VLUiIKLPT1omlSwW/ 0Pymbv+b4iPzYPSaxoxyoQDcV6+h1xIwRy8eW1QKGFEVQbScIqj/KhJW4RZNX1nh0iMT0x ay4HtBf2zyad9Fd1o3Btce1zTCLR8YsA8SLET8i5BFt/Yrc+IABMTMBkHCuSnFA44QKx9D fV/166vyGYIHU3vBy0QorMt7pN9drbkbPxeyohqtzcHAKk4ejQ9LMAjgNp49xA== Received: from [IPV6:2601:648:8680:16b0:3089:8f56:4b42:5b7b] (unknown [IPv6:2601:648:8680:16b0:3089:8f56:4b42:5b7b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R554z75g3zbCK; Tue, 18 Jul 2023 17:08:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <5c74c6a9-32bc-f965-f407-6cd68b550b07@FreeBSD.org> Date: Tue, 18 Jul 2023 10:08:34 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: 3bfbb521fef5 - main - ls: Improve POSIX compatibility for -g and -n. Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307181704.36IH43FZ097908@gitrepo.freebsd.org> In-Reply-To: <202307181704.36IH43FZ097908@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/23 10:04 AM, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3bfbb521fef5764ecabc2bf3fdc76f47258171f8 > > commit 3bfbb521fef5764ecabc2bf3fdc76f47258171f8 > Author: Minsoo Choo > AuthorDate: 2023-07-18 16:49:59 +0000 > Commit: John Baldwin > CommitDate: 2023-07-18 17:03:09 +0000 > > ls: Improve POSIX compatibility for -g and -n. > > - Change -g (ignored for BSD 4.3 compatibility since BSD 4.4) > to use POSIX semantics of implying -l but omitting the owner's > name. > > - Change -n to imply -l. > > The -o option remains unchanged (POSIX defines -o as a complement to > -g that implies -l but omits group names whereas BSD defines -o to add > file flags to -l). This compromise is the same used by both NetBSD > and OpenBSD. > > PR: 70813 > Reviewed by: jhb, Pau Amma > Co-authored-by: John Baldwin > Differential Revision: https://reviews.freebsd.org/D34747 FWIW, macOS uses '-O' to display file flags instead of '-o' (which has POSIX semantics there). Currently there is no way to get the equivalent of POSIX -o output from ls, but breaking compatability for -o seems too large (as noted in discussion in the review) vs this compromise that matches NetBSD and OpenBSD. -- John Baldwin From nobody Tue Jul 18 17:39:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R55mc24cJz4ngqk; Tue, 18 Jul 2023 17:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R55mc1gdGz40W8; Tue, 18 Jul 2023 17:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=i0Qrj7fRcCrUpPtaFc5QNAJlrIIfSeLIMqM7r0RiURoP1F04ghWSfWRkujBmubBZuXkd+8 PjWGkmixRMZ3BItM1QdxBzFiIX42eMwn5oKO1zQAPFMbEPuM6koGjfKAhZ/aBmyIbQL6/B hrgDYTZIfdn7nttREnUu0UUQC+jhdJA/6DLKhBz3COq/UgDqeoRu2h7HkzEVvAPRk/o8Ml Fv5mte6KRFhCTILzmmYomOAPNHBHC1TM4Bj/0uIaeewC70a+1bvu8/bw7b+b9LOuzkKz+t 8T62q3DgGwpTQ4TxEYr8vz3DS58oJvesOYipEYYhWxgBIHN23dE5qZvB/GV0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689701968; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0f1GZdGCoS0ztcArfqM0qWitLzwrgF67IwBItHaOonE=; b=yDMu3KbMBWYuVbKP/czji+PESjOgHn6UTxEumB6zHT5UbFMZH0ZKxwKVmZGCxT1d0SGYxY Ya7q3ncU7pnSh5TX3MBvz057qHbznSVb82N1CBUbsyPR+hZubWXbGzKLP5qdHVErZBqss+ Tmfu8j36E3jsAzKd/WyCq5qFQ/c8tCQnPQk9s8H4zD/SqMP15KhgxaadXsmglHnnumD2Jp c0B34esD1bHMouyTdmGGyErmRXkLeafnBMPM7gIatOZLh34goRp83H4aRRDpE8qPElbKIu 0Ybklfq6CkS9kD136LT57HBWX1nuViz1rzfixiS+LZcGfrMESpniZOJ4pYlFxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689701968; a=rsa-sha256; cv=none; b=X7XgE/6feTeNmmGW2xBIvIkegB80QBDeffGvklTXOAZd3yA1X/OWISgKF9+8SkKz7nmKXP SFkKcZo51bBJmqRjcA/4cEShjt5q+QjFwNBouo+azsaW8nndLjYEcnEH/9ImXTN9UhKjdJ IoPrUXNk8dbvj4BDbCHU11z08zPjDo0I0U3Fs9Xo5tJXj7qE52GYv4PiJQTizR8jA/Llv1 vuoLRbIOF8opa23K4qZG4Q8v0XkwaFYZnKalbSXfexT/g8N+TYVfOGHwaCNIsNF8ABytKU OikjZQGuq5aaj23FC2GLOuNdztf5pO6IgE4YZGVp1EVk95/XkDfA4BsmhwTuxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R55mc0bNCzFN9; Tue, 18 Jul 2023 17:39:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36IHdRnG048242; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36IHdRfU048241; Tue, 18 Jul 2023 17:39:27 GMT (envelope-from git) Date: Tue, 18 Jul 2023 17:39:27 GMT Message-Id: <202307181739.36IHdRfU048241@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: 9efad6f9e108 - main - add defaults for adduser.sh (OK? [yes] & additional user [no]) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9efad6f9e1084e97dd6e2599562e7db0bd31a4ab commit 9efad6f9e1084e97dd6e2599562e7db0bd31a4ab Author: Sven Ruediger AuthorDate: 2023-07-18 17:37:48 +0000 Commit: John Baldwin CommitDate: 2023-07-18 17:37:48 +0000 add defaults for adduser.sh (OK? [yes] & additional user [no]) Event: Kitchener-Waterloo Hackathon 202305 Differential Revision: https://reviews.freebsd.org/D40157 --- usr.sbin/adduser/adduser.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/usr.sbin/adduser/adduser.sh b/usr.sbin/adduser/adduser.sh index fb4b51fc23e3..75db900c4524 100644 --- a/usr.sbin/adduser/adduser.sh +++ b/usr.sbin/adduser/adduser.sh @@ -657,6 +657,8 @@ input_interactive() { _usepass="yes" _logingroup_ok="no" _groups_ok="no" + _all_ok="yes" + _another_user="no" case $passwdtype in none) _emptypass="yes" @@ -817,8 +819,11 @@ input_interactive() { printf "%-10s : %s\n" "Shell" "$ushell" printf "%-10s : %s\n" "Locked" "$_disable" while : ; do - echo -n "OK? (yes/no): " + echo -n "OK? (yes/no) [$_all_ok]: " read _input + if [ -z "$_input" ]; then + _input=$_all_ok + fi case $_input in [Nn][Oo]|[Nn]) return 1 @@ -1030,11 +1035,14 @@ else input_interactive while : ; do if [ -z "$configflag" ]; then - echo -n "Add another user? (yes/no): " + echo -n "Add another user? (yes/no) [$_another_user]: " else - echo -n "Re-edit the default configuration? (yes/no): " + echo -n "Re-edit the default configuration? (yes/no) [$_another_user]: " fi read _input + if [ -z "$_input" ]; then + _input=$_another_user + fi case $_input in [Yy][Ee][Ss]|[Yy][Ee]|[Yy]) uidstart=`get_nextuid $uidstart` From nobody Tue Jul 18 21:44:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCp4KKWz4dTNs; Tue, 18 Jul 2023 21:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCp3vtBz421V; Tue, 18 Jul 2023 21:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=B9TInihoGHrGOnjss1h5ToRz31fbWEeCL7RJ+KMv4UOsoGMLugPbw3Vvcc9/ePrmGHC0GX A2rGQ+oRePynALciAQlUZpjDf1xqnzUV9Im4h1o4c2thFpgGNSh27qLFosCSsLalJwFZ8i 25jWtzhpE9XBSiOL3b+sw/fAP9Zain4rAd9/rnhLj5IivmUtxF7i0mbxK40EJGc+NMEoeh 95kXDX66mdZcJvDBH8AJgEDBQkUFpBOQ1lh3CtAMPiTmrGU42ZRbEwdU9Zn0gyVUNbrVob hlsyddfTbWIlIMivfceGCptXm7prrpRY/BPw0TuNL9cCXvz+mor7mJ+DsU12cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=JEGMll3+TVmA2bRtQoQVoKd8C94F89vwByMcmpAW+nkmygBoCSVdnfmiEjpWQg5i34MLhT ZKzE/DWNd6dPziPx0F7J8404KauhOPtdLbmIFfKu4Xl/fhLBMqXEJvLC57y1wLHbuUZDFK h6s5PUgEdAXSuw/x6goVGxiFa8RnYhzADCfmm8Hk7kCyXzDd9KdkaYmnsf7VUg5PLfIIFX 9muL71xrel+z6/VzwQDvSGChkdlrDMDCxvI9LaUU/mcumrq1JcHDzU1q9kIvGNoWegYjk/ XzLIZn5XKB+OnWrnITob3hIGGGAcycNeKPiglQkskNaSdm4ejDC6GYTQaCWaFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716694; a=rsa-sha256; cv=none; b=KbfGolJcsF+oZM6qBWY02C60Cq53zHziG1ljmdyUaguMLmcojF6vgqLXfkkdSgTKP43iNp NZoYnnp78ivKs25iaatOvTCXlHIT1Yo6rcmkCrCRreAlpu42jGoEO0L7fEztNOaWesGfgF DMndBnITprXWgV42+x8AtiEeUNFPwxh9jIToaENeg2fxu5WE79xfJlBvxjkgYcvFOR9XZE G0w0BB4vT65pm8Nmf3RRi4DjRe/1xiUr/hNvqp/D5pjSINIZTH4DQP1kAJ24n9rVlm9h62 zRAKCMSYO9X8G2PdsoQhUkuJ/oVBEMS7jqp8KdkIm3vWLCqSxYwTBoE6ZGQ1WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCp2zv6zMKG; Tue, 18 Jul 2023 21:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILisso061790; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILisGM061789; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:54 GMT Message-Id: <202307182144.36ILisGM061789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: fc1c787aa015 - main - linux(4): Properly allocate buffer for kern_getdirentries in readdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fc1c787aa0157090e765ebba484e6e290e99f177 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fc1c787aa0157090e765ebba484e6e290e99f177 commit fc1c787aa0157090e765ebba484e6e290e99f177 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Properly allocate buffer for kern_getdirentries in readdir Looks like prior to ino64 project the size of the struct linux_dirent was greater (or equal) to the size of the native struct dirent so the native dirent fit into the buffer. After ino64 project the size of the native struct dirent has increased. Spotted by gcc12. MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 4e8c3f435261..a5b8a4270dc0 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct l_dirent *linux_dirent; int buflen, error; - buflen = LINUX_RECLEN(LINUX_NAME_MAX); + buflen = sizeof(*bdp); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, From nobody Tue Jul 18 21:44:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCq5GX9z4dTNt; Tue, 18 Jul 2023 21:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCq4cJDz41q2; Tue, 18 Jul 2023 21:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbO0zBruuhr50lyTw+9hPmfaYRvkmnz4BSepTg7q1hw=; b=JKOv+DgEpLPRSwNdLaHzNfP1zMFBhi4i15BqK9UTn/odSvkNpd8EI6hV4JHhisbyZG7Udj 8rjfoxA/6U62lN9wXhd5RGvLB9VyFQc8UZBcWIH/M3+4tLgBVr33xurVuETHV0aTALTppx hinNWf1s9l94eSlevYSEOwntEmyzASrhaiKrJNcwXKwe/vzVTju47x+7DHaI++aGLkHr9u urm74+3I5eMOn39jjsWStb4ibbfeVLAliFJNRuwVV3tg/imJ/gZY+Tr7l+yP6fD3AZOIlx DYm4QN03BJxbXoNWy+AMv/xTG0DydjATX515TOlzuJq5K4asO6UBEDl2fWu2Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mbO0zBruuhr50lyTw+9hPmfaYRvkmnz4BSepTg7q1hw=; b=bGTak2OXgdKMMSAwG/gDctjvLL9MDIHjxMCnRupuEUn2dOKVwlr1dLh1CfhpINa+dvMjyf L73D23IPOiGhadpbkq28sXjtCRllwfq7uf6lEPGI5cvS7YR09NoxF1WB092G9suHWzYEtl pCtbR7bOnWEJI5YBelDCxB5GAc/Smo4iHPUuXbfUfzbwXTz4ip+FTxNuHZihjw/iOIADxy S0T5cXAEVeoPV3J4kYjJ7GMoIUR5gtZs5m0GyNxU6xIUSP/K+jLvN6r+/XgbJwlzfCoflh M2hnOgormvZMeMGrvGGRaDuPbY1ouJIITrsqSfmeaTPJcFF8cYwW2k/3DWNFxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716695; a=rsa-sha256; cv=none; b=iJL3a2UPRxiH0oeg8GOuTuCkYvrp2mfJGPWnxOClhJG/DHaAymCJiPui1u6+oAg9Qyr83C B7W1oAUSQx8i2C0n2P9EuCV0yxQzqjQzg7tC028vT7Uzf8qKHTuUcMCiIgMGgN9pa4Yogy 5JYi40TS6SGO4UPAG/sBd0HoxKmbEk/2wmcGjBtJB8imSoePxPqt3j84Qhx+I3jEhyGgBu rJSLCDu3VgY7zUOx4uy889XowRQ8xiILguELCTo6s1EKMLEbAhewIblxGx6SavQv/pbJQx wZgAAQq0UYLdJIoGl81meOIV8QJ9ffY759rRUKnof3yZ1inCGPRbKBcnQ2xTrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCq3h7xzMNY; Tue, 18 Jul 2023 21:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILitXj061809; Tue, 18 Jul 2023 21:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILit3d061808; Tue, 18 Jul 2023 21:44:55 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:55 GMT Message-Id: <202307182144.36ILit3d061808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: fffb2e8de691 - main - linux(4): Delete a useless variable in readdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fffb2e8de691ba6677616f7e0e5c442f4e7e722a Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fffb2e8de691ba6677616f7e0e5c442f4e7e722a commit fffb2e8de691ba6677616f7e0e5c442f4e7e722a Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Delete a useless variable in readdir MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a5b8a4270dc0..951ea852ae44 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -555,9 +555,8 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct dirent *bdp; caddr_t buf; /* BSD-format */ int linuxreclen; /* Linux-format */ - caddr_t lbuf; /* Linux-format */ off_t base; - struct l_dirent *linux_dirent; + struct l_dirent *linux_dirent; /* Linux-format */ int buflen, error; buflen = sizeof(*bdp); @@ -572,12 +571,12 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; linuxreclen = LINUX_RECLEN(bdp->d_namlen); - linux_dirent = (struct l_dirent*)lbuf; linux_dirent->d_ino = bdp->d_fileno; linux_dirent->d_off = bdp->d_off; linux_dirent->d_reclen = bdp->d_namlen; @@ -587,7 +586,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(lbuf, M_TEMP); + free(linux_dirent, M_TEMP); out: free(buf, M_TEMP); return (error); From nobody Tue Jul 18 21:44:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCr6MSYz4dTZJ; Tue, 18 Jul 2023 21:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCr5k6nz424x; Tue, 18 Jul 2023 21:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnRNyxTElgh989GBLMDaCF+cjsCBj50QcCyWz+5gZz0=; b=yq4PzcNggAx81/tj9N/+aBM/ckNTcuXtucQ3cEuqEIugtGLW8/Z6CDbEiLIHfXliqfCFWj vv1MK3zc/25vHMljiQ90Q6ZatImddUGH9FVApvNaiPaRNGKKl/VCnhtQ5zy3nDSlY72pyr D5iD28JRsrNe+kQyaOLCOSoSeijYzgqnJyO0TuoBh79UN4gMXGAQIsm+KwSqLBvlpGk6g1 OqMeGU+LHTGnLEtN6IY+D3YzjqLV89NoQZHt4rhYqNNIrFskpE3QhGVj8zJUMe7GQuCg0K ER5Cu390OV+RaZsbLJ1LBeOexDHFwKd74ck/ll7nSruqwQuIY18XFZzWsCYODQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716696; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QnRNyxTElgh989GBLMDaCF+cjsCBj50QcCyWz+5gZz0=; b=tC90M7W/ZLwr0AhBoIhUxV6HC/URHBKTKD9Uofes80bH4WLjq72M8rXKQzGGoEOodg3HHm QxSbrv4AjSZfxXNllGc8NHzxnxXhUl52Mu51HGDOcDiADzqFwgMVP4hanpbwLGKYSIMXxn eLxtLDcXgWzTzrTJBlkrNy0HsBvtyHBNYUXnzrNgdwrORsgr3aLe9uIaNaLNqG4WxT/n0J tJcH9gLOzcA7XCPtwoHuGMGzqJD4JXfkswyXdEzB2V8ndKHRv8MEgf3eHx9KUs++NsVuHn pNPFeuk56TAmITqiD1hHK9KA8ckd4ajUa2MC1LM82PSLbZA9FJ/qp3mJHcCMHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716696; a=rsa-sha256; cv=none; b=E6XPc9N8/wWugLG1YsZa/hNC0b8KclqaHjimL9K/TXzdfdAkxDNIAxdERZAD0gKJUhFv94 otnOuSdC6C5I6li8eXFXekzmnhokIZvX+8WXG9Xsgt2FUvr0M4m6vsXbp4MqUd51ciWJqi 6ZY9ncaOc5hmNGA0oplXmiRKEllviNqe0TTTKdNp/CIBZn340iwO2ym18Iv764FbHyQfso LnAv7ssPhrsijLR/z0UygJaLJJ6aG41oFzQVXBrYKkpmBDgSdnFqczWZ2CxQ0mqmaBDQ7t MV5YnjrJ8zitaz+qlIEVWv1ER0nLz0sIwgynGu+RbArXoqtOZsI5xAgJg7Qvaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCr4pzlzMXr; Tue, 18 Jul 2023 21:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILiumV061835; Tue, 18 Jul 2023 21:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILiuXM061834; Tue, 18 Jul 2023 21:44:56 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:56 GMT Message-Id: <202307182144.36ILiuXM061834@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 13d049ab8dd7 - main - linux(4): Use M_LINUX for malloc type in readdir List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d049ab8dd718d0723229d54062c91b2fc68fda Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=13d049ab8dd718d0723229d54062c91b2fc68fda commit 13d049ab8dd718d0723229d54062c91b2fc68fda Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +0000 linux(4): Use M_LINUX for malloc type in readdir MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 951ea852ae44..37a06dd81c67 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) int buflen, error; buflen = sizeof(*bdp); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -571,7 +571,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; @@ -586,9 +586,9 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(linux_dirent, M_TEMP); + free(linux_dirent, M_LINUX); out: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ From nobody Tue Jul 18 21:44:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCt2bQ5z4dTjs; Tue, 18 Jul 2023 21:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCs6Mjqz42TS; Tue, 18 Jul 2023 21:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqfyzufFiflMxCBOw9fd3nyo6wehYcalVVrR2iLAFM8=; b=JjYeIrF2lhtE8ljAoq+/DL188poprxxmBl5TSZLWO85cuSR0vOkpewqGI7ZxBeMV2Gxrf8 KxbWeuI7aAPhYnsRrNp9jXBSorOHlOBlub3+fNH0PHEJcJzV7O42+TZzXUDeNKJPo+6NbT MllnQ29H2Tyjuy1pbwQP44T/14tZhHT3J0KK9LNlc+D1x/au+9PCCcjaBNVg+NVhz2uZhh QVAhKdg9tcqPF8XqBwWyVAFMSd7Vg8ygOikKoG43DUvu8xek+I/9/UbVLu/TpxGdJCIejC jxxUHKG8ULIDUPRTZsLYLVBFgPL0EiIbf+Y1E2HWM9xR8MdJMMWoeUuZgfZ9eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716697; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zqfyzufFiflMxCBOw9fd3nyo6wehYcalVVrR2iLAFM8=; b=nCBaenNkpiJu0rcSKZRY0b+TQKUqqifBuUiVzKQ7FjITKPTYbnCje/X+ndHzDEq3R3QcTB Wgaz4qR+ln0LIhGL7BUWB0hAye7uni9sht+Tvj+w9RbK8ElfvDKxobRymHT7/2x54FCPGB bVTC6D0srUunU5lEN9dfq3NTmlo+yFJ466R3I4B0n4uBtoLq5ZWyCQ3uuPSHYglYC+v4uN 0Rcath2t1u2nfm+qaqKLlPLGGFwYn9JnZjYvYBEJw67PRFB8MRsizgI7f9po0MTfFaN3La TFJWHcvWazj5jlCaWVO8Q0x274KkbKMhLWgmPRtcizYC8Mzw9hGVN1Qp01legw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716697; a=rsa-sha256; cv=none; b=psz7LAC9A3RpW39gg6G/7hh2+4vWNUUART8QvulKY8+BZAKdYa+dXC9Kx047m0S0/FHs/k 0PPIQ1nltzrmdqOoQLR04FUUPkcySLK+0bo1+1ysBf4uC6YCPIbvUw/nxiIa4R+MdHT2zF /q7oGd/xharU4OsNE01FWsnUs/4Gv1BJ5vPrX3N/L8K3gKy7xWnAxWtcKx9rYwO+rR3IB9 zg+Kphu63PunRoMP23nFyauA7fhE/C+93he6St37jrz7XGnpDBGAHHBAczA2dk+De3RfSC 9mCTPfb/BAnVYHNffzmMXtQOHpqSenxcwtWeW7HstPjBYrXg6wG17Rpi/1i+dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCs5TN5zLyc; Tue, 18 Jul 2023 21:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILivs4061854; Tue, 18 Jul 2023 21:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILivKP061853; Tue, 18 Jul 2023 21:44:57 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:57 GMT Message-Id: <202307182144.36ILivKP061853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: b27f3237c82b - main - linux(4): Delete a useless variable in getdents64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b27f3237c82bde866cb24f7299eaa356e8b29eb2 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b27f3237c82bde866cb24f7299eaa356e8b29eb2 commit b27f3237c82bde866cb24f7299eaa356e8b29eb2 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Delete a useless variable in getdents64 MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 37a06dd81c67..d186daa493f4 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -483,7 +483,6 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) int len, reclen; /* BSD-format */ caddr_t outp; /* Linux-format */ int resid, linuxreclen; /* Linux-format */ - caddr_t lbuf; /* Linux-format */ off_t base; struct l_dirent64 *linux_dirent64; int buflen, error; @@ -499,7 +498,8 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out1; } - lbuf = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, + M_WAITOK | M_ZERO); len = td->td_retval[0]; inp = buf; @@ -520,7 +520,6 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out; } - linux_dirent64 = (struct l_dirent64*)lbuf; linux_dirent64->d_ino = bdp->d_fileno; linux_dirent64->d_off = bdp->d_off; linux_dirent64->d_reclen = linuxreclen; @@ -542,7 +541,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) td->td_retval[0] = retval; out: - free(lbuf, M_TEMP); + free(linux_dirent64, M_TEMP); out1: free(buf, M_TEMP); return (error); From nobody Tue Jul 18 21:44:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCv146Lz4dTnJ; Tue, 18 Jul 2023 21:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCv0W1Nz42Lg; Tue, 18 Jul 2023 21:44:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgGCg6gZDnFYk7EtyYZIG1wSLTgLqyOs2Bx433ppmmo=; b=s/H9UEeegWZPgjMxBDpBfJ62H8P7kck1DQf8AUy9q9jWlaF4sNb+ckulwSqEVNUSGbC+w9 5KCOgEJ7UxJM+BS8Yg6X7rLhQ/EyHwzRyCo2ftrwg6mb61/FKXBErOxhc8NpRF95EceOHS g81xHaNGzUpYph9Kd0rUywYuEu8sTCKBHN5Q2yQS8/i9cpW/VQAxtWK1Z3CKgWoI8AQ4on YYDtf3+mPuNV4rx9XEJkTQvMVAg76KHHbKu/XykRgokF2TBKLzWEGPk5v1HBaOvweoST1W fTG1ajouoUXtW0s+UVY+GK45KpcSt0U/voOd1VwX65+qiy/g/wuNQoHwmKfuzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716699; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dgGCg6gZDnFYk7EtyYZIG1wSLTgLqyOs2Bx433ppmmo=; b=QjenNSbKOQIBWHNE451AzT1jmnI3SkzLZOAWg5kDW5JfDFmi72Jss9YFcPKAwZ5WVB+hIU NwlgYczKdL/UVWsipEAXoUod555hphZ+Dxw0d/OTlsafPG0kSzB8l335rqDvkJOD3gV0a9 2FrxjaLvtUx+ZE1TpLGdtj+5rhNRlHN/AFFi4Qp0DBvNV1PCovhqr3HMqUIC11kGWOToxI E2KQHliplEzn4h+Dap/xpfCQn5YJ1/uupQlhgDgXV/6gbqOOBud/IshUZ6+524OJucb4y4 /KAZOdr5/MbPPk5Alyng3d8bmDIGOhbAz4j7Mfwvmdk4zrInP58Z+tZqONFOwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716699; a=rsa-sha256; cv=none; b=JD+cd1gzCIdJy7kX3Ja2R0Pr2Uqqb44eF2/cLh/qwJ7/gQNrq8zC1GK9/wX3ZD+x+DRC5S zCee3YoW4BYqv8PUrVxZG8Frq7B5P6v7hbJ39rPvgZjvnnFSe3cbDu0wxUt4EpFORoDFy/ +SZsegOs2yFgrsmn80wGYb0GeMkEll+3N5ZlnzJRdrpe6yItVhK5OVjLGP2wFtOCsxVqRv 2+069+6QttV+/p1WEzyFcPcJltDAa+ZXK1/AiWA3pPGGH+Ju7aJw32sj81HF7TkmjZDZh6 nX+rKbrzf5jPIAWlJPpHj1N9tpS+n5AyUNe/LkCVZGeSr1bhbGJrUkXZXtQF2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCt6g1zzLqD; Tue, 18 Jul 2023 21:44:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILiwx7061875; Tue, 18 Jul 2023 21:44:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILiwOx061874; Tue, 18 Jul 2023 21:44:58 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:58 GMT Message-Id: <202307182144.36ILiwOx061874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e27e3fa71c8f - main - linux(4): Use M_LINUX for malloc type in getdents64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e27e3fa71c8f31304efa5e065876a34ee603a388 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e27e3fa71c8f31304efa5e065876a34ee603a388 commit e27e3fa71c8f31304efa5e065876a34ee603a388 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Use M_LINUX for malloc type in getdents64 MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index d186daa493f4..0538fdd12b73 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -489,7 +489,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) size_t retval; buflen = min(args->count, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -498,7 +498,7 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) goto out1; } - linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_TEMP, + linux_dirent64 = malloc(LINUX_RECLEN64(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); len = td->td_retval[0]; @@ -541,9 +541,9 @@ linux_getdents64(struct thread *td, struct linux_getdents64_args *args) td->td_retval[0] = retval; out: - free(linux_dirent64, M_TEMP); + free(linux_dirent64, M_LINUX); out1: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } From nobody Tue Jul 18 21:44:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCw2g6rz4dTk5; Tue, 18 Jul 2023 21:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCw1Hc3z42MM; Tue, 18 Jul 2023 21:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiYGQfsJULTaPkZ64UI+kLAbDRAoWzBtHAPFVIvz4b4=; b=glJ7zRojCzB5JYFpjDDpohVwlRagBY9Qx2knauWNIc18iq93NM3vEGI3YIkOBWvjuZTlZ2 JPcWuRuKoHKVwBz+nf3sM6dZqJ3g6SYV5v5TbMdpAdvF01Ta4a6lp5DwaIdbQD/CtJFh5H T6pAEbJ9YMHTIRVlQ1NRCFTdIcQMA0qpSoGp/JAOUR1UKemafiBKJOM5YWuRJKFQcPNW3r QYxfGOn96hp750ySiNrOLdl1Om+F/03yJS/DQRxGHWULNuod+AU/EE//JROGkF1H8AZBUb rfXcmAOL6UpuZ9HJiXbckwWAunXuSYUu7y33wmYTbSmNX9g6YXU8ozyhK73d4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XiYGQfsJULTaPkZ64UI+kLAbDRAoWzBtHAPFVIvz4b4=; b=B0Ua63Ydec5+o9ffnIJ/Hn+QZzJQD1Ol8Z1OCfXB4IFbkjome9eM7LanbeaE09UrZ7Fqpx reW2XEYnmkxNcQu8FDv/Kiu+UNLswKcfLSDOM41Ks9hFkU5hHJZL+Tce0K2OrWGoR8jXTO wZpY2w+l/pI1QIcSsAognLXUtPsBtHsBBgJeEh0nf5HSpxHdyQhK4vnSidfjivYSqbHpr/ ZA+0JCORDvP/ub3vrPao2C6VL/Wp/gLdo35pdraL8a1vufJJ6MxyrmrGKRd7fYnswlURpS w1fQYcCxOAjLTEzipfN2qm4yXRporC9GAo8HkhFtdWrHZhNoR7slvvzUnzhWRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716700; a=rsa-sha256; cv=none; b=Nn4iyqo0Gp8ZGW4dv3y47nBNj3M9n5fQ+uhyzVLSXQOtb97jpBUTBgoyqe09zlFUDN2aGt dRpWs8uVPX1XD8OwhKhzRqTjkvp4xBRpmDpU/sXIrWaJsWjYbZ9s7cCbud9QgLEUfq+dql YhrVm3NEdITefAGo4Ig0Ya5/TGEEE9y50jZ2mNfR1naV7E57Q54aDnDVpJDbyTJf4mD1tZ Uk6jTnZZAZlz2NA9f9OoB1Fa+T/5pYe0iQHnhyB/8pbqE+M5/nOyqfI7o5MMsRrKh6tcM1 nR99ykI9Ozhj6JpvlPM42zWku4HnQNODdoSVCBfPW1P/PK7r5WCpGANE2TnxmQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCw0CMWzMKH; Tue, 18 Jul 2023 21:45:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILix6p061895; Tue, 18 Jul 2023 21:44:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILix3M061894; Tue, 18 Jul 2023 21:44:59 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:59 GMT Message-Id: <202307182144.36ILix3M061894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 772946778167 - main - linux(4): Use M_LINUX for malloc type in getdents List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7729467781670a84059d50c4726dc94cbf4500e9 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7729467781670a84059d50c4726dc94cbf4500e9 commit 7729467781670a84059d50c4726dc94cbf4500e9 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:16 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:16 +0000 linux(4): Use M_LINUX for malloc type in getdents MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 0538fdd12b73..33b357f222b2 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -413,7 +413,7 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) size_t retval; buflen = min(args->count, MAXBSIZE); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -422,7 +422,7 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) goto out1; } - lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); len = td->td_retval[0]; inp = buf; @@ -468,9 +468,9 @@ linux_getdents(struct thread *td, struct linux_getdents_args *args) td->td_retval[0] = retval; out: - free(lbuf, M_TEMP); + free(lbuf, M_LINUX); out1: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } #endif From nobody Tue Jul 18 21:45:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5CCx2pQtz4dTqj; Tue, 18 Jul 2023 21:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5CCx275Sz42XG; Tue, 18 Jul 2023 21:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYSz5W4kK8v02QNxd2la0isw3z+C3JkIb7FLzgR/D1g=; b=lSY+pDP/gMf1oKc9i4r+QkwSKQou1RggghI/GRQp6IhA3LpR6V/cQnq2q3ZeETAlOos1Wo 6EYKg/nz11NpNG5OQjxbCuX+x6nNkYue98FgRB92G96xIY20az49ndUIoTFynsYrxhWJHO m0Opr379eY7Ocq0NbpGo/3jks7wJIoR4xS85Gy3qabnrLHxPO2UDFZwbnSSEfrwELQWgRM WemTb3MnZKgW5IBzptG6OQdZHOO0TRYqPEonYkaFGS7YldCtQ11439pPBPGvoNDSbA4oN8 u44BOF6POYnS27IcS7kNjHEYP8o9EAeNmfkN9iX88BvcY06u1N5t8IJbVpOCNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YYSz5W4kK8v02QNxd2la0isw3z+C3JkIb7FLzgR/D1g=; b=RFJ6D7ulFBa4n3nnfrU/tAeG+4TF49E9H5DNsQzYQ7UxkJxbYDEHibAYTW0V2EgKeWev4Q Y6Z2S7Or8GpLg5s+PLn5YOJfrmxOrYM8OCHDGIt31T2vfmBAuyEdooa9KUcFKWHc1rpU2P 0okiNVl6oMKG80EYdZXI4EGou3+HiWFZ7TzwhFSleoDTn513REvVXqn9VIZEjWs1C6YO3C L1rM9qx7PxgIKA77aOh7Az6x7vnJ8sHPuMq6F+m1Ehu8+7KOxep5ZJqBEHCiZocZUtwKpO CyIe5VQzSbxJMUJVNfHEiBh+wzXkMToGOb4//BAabaOwE2nxEr3xazVxRg12ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716701; a=rsa-sha256; cv=none; b=b53SP09Vs66+o7QoUEulAPoTT9lH68jAdBGUprzft1WWgGplv3vn/PpxLzZ2He5rOShBEV MmSwkJGYYKpt4/TQRaWD7AIkl/4M7ONy2hKIe3NRAP5fOLeh7l8UrmFl7JYEQRZ2KzIklW kntjqmiwuhDizzrdM2NaA3OVk2CNeBPUdTNckwxfFpo2LodnE+bsw+Ran/qdi4M+Ei1Pl+ sVSx3pjl2JSz09yf12TRcXvY4VbtykR85qyvdIuhHsyZhXcinCwKwDpayY5aDwfTuaMF6/ fMZVWywBPTdbjNuk1vlArRGxXnbxS2u3B5of8MoJw49KAANteFSPjk9Ytaa81w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5CCx0yNQzMXs; Tue, 18 Jul 2023 21:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36ILj1U9061930; Tue, 18 Jul 2023 21:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILj1xL061929; Tue, 18 Jul 2023 21:45:01 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:45:01 GMT Message-Id: <202307182145.36ILj1xL061929@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: b834497c6d0c - main - linux(4): Use M_LINUX for malloc type of proc emuldata List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b commit b834497c6d0cccaeebad8d94a32c8dd3ec0d3f9b Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:17 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:17 +0000 linux(4): Use M_LINUX for malloc type of proc emuldata MFC after: 2 weeks --- sys/compat/linux/linux_emul.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index 6a2ea1f26fe5..8384d6a42962 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -147,7 +147,7 @@ linux_proc_init(struct thread *td, struct thread *newtd, bool init_thread) p = newtd->td_proc; /* non-exec call */ - em = malloc(sizeof(*em), M_TEMP, M_WAITOK | M_ZERO); + em = malloc(sizeof(*em), M_LINUX, M_WAITOK | M_ZERO); if (init_thread) { LINUX_CTR1(proc_init, "thread newtd(%d)", newtd->td_tid); @@ -250,7 +250,7 @@ linux_common_execve(struct thread *td, struct image_args *eargs) p->p_emuldata = NULL; PROC_UNLOCK(p); - free(em, M_TEMP); + free(em, M_LINUX); free(pem, M_LINUX); } return (EJUSTRETURN); @@ -328,7 +328,7 @@ linux_thread_dtor(struct thread *td) LINUX_CTR1(thread_dtor, "thread(%d)", em->em_tid); - free(em, M_TEMP); + free(em, M_LINUX); } void From nobody Tue Jul 18 22:50:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5Dgv57hkz4nNS3; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5Dgv4Y56z4NrR; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689720651; 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=gMC9lmmvajP5iUlr9ec7qHWXb69139Gvlw5EEPQFxOs=; b=sJ5h6hDWCft+AwR+amJw82lasw4uoWjmDsq+Z/Xa4Bru2ABlgsXNQoq3KGoh7b+8OLp0ne UQwiwi+2C5Mn/V4EOYiqafmyt0ntR7yzxxOH7ntZmW07CkZm8gR/baZx7bS4xBjyE04sR4 GCBJ5ffHTbpsAyQ9RyhWhOxDjrsKeCdXLukjCoDRlYefaI2bD+bpKXCAXZEixQmjQ/3/4O /QSnPf7H81xB0l+iQ8I/1Rmg5g/4e63UvGtgF8lsDhCnSgtlLcpZgRqUogB3pxkkBfPLqS zQnx5UhB7RFm7bnTndhUkT+0S0wyUX804CsMwgudqkHomELd25/XX70lXLSGBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689720651; 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=gMC9lmmvajP5iUlr9ec7qHWXb69139Gvlw5EEPQFxOs=; b=qb4aDkGd2yqJKmEqQWzFGqQwHdp08G/Sfv1BU8XJ1YSiifnw+sfS9fSf4AD+Om1CtrtNS4 /0aY9UFDtrWvf4xJvXYgv3qZDZGbNaKO8Equ91Hby+KZmK+rjXcAAsn2olhCwPctQ4OlLI eykdNZJWe7KVeu5vYYaQHqi+SpBcz52FEuC3kGyUchsPw6gJw57ly9WSVCTmNjx1Il/k12 Ii+9pX1ZJm28FS8B9IcgFalA4jBWoMpLJawQ3WnOmaxcxhk5qgr9oOZ0jE1pYlNAQx3Tnc i/ztQOLpbXJZSB3f9BbuliRbpDGme6DJzKD7hjL8bn6P8Yf0gT43pcCo/xseXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689720651; a=rsa-sha256; cv=none; b=UtbPBDv6m/Hxn52TXi3VKIwVTjUVmoZSDc/rd1criI2/karYbPqPpARa6x2J8tYRzfF8xf l6jUz9iD+B7GmtvYYjOk8FkpKeVlkHDTSapg7l4o5JIHUEmtJ8H2G60XwNrm/WjHAIbN3s 7BGsZB5nc7NJWMEUtteBPE7/I9N6a5zScCGbs3S+C+P/MZTGPI6F6BnfPdVIAasXQxky+9 KvHfbPSBn49p4MXfkNFCDd/XqRQfpMiIoJVPi0pnzF6mPrVnFr51d6b0gUEqWVAZ5oE/g9 0/+78rjoCHLzZ7O2PcfcMCewOgP99WaLlTqkNlI8/aHjb9BJrpbyDPhA7O14MQ== Received: from ubertino.local (unknown [73.4.221.34]) (using TLSv1.3 with cipher TLS_AES_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: matteo/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5Dgv27y9zhrx; Tue, 18 Jul 2023 22:50:51 +0000 (UTC) (envelope-from matteo@freebsd.org) Date: Tue, 18 Jul 2023 18:50:44 -0400 From: Matteo Riondato To: Doug Rabson , Kristof Provost Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3a1f834b5228 - main - pf: Add code to enable filtering for locally delivered packets Message-ID: <7vbajkgkvsxkbsl2am3wnpn2ogh6tsty6tquurko2we22rjcjm@ilb45u4llxsv> X-PGP-Key: http://rionda.to/files/matteogpg.asc References: <202306201435.35KEZtHN062484@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dcahvzwmiwrnfdrr" Content-Disposition: inline In-Reply-To: --dcahvzwmiwrnfdrr Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2023-06-20 at 11:57 EDT, Matteo Riondato wrote: >On 2023-06-20 at 10:35 EDT, Doug Rabson wrote: > >>The branch main has been updated by dfr: >> >>URL: https://cgit.FreeBSD.org/src/commit/?id=3D3a1f834b5228986a7c14fd60da= 13cf2700e80996 >> >>commit 3a1f834b5228986a7c14fd60da13cf2700e80996 >>Author: Doug Rabson >>AuthorDate: 2023-06-20 13:01:58 +0000 >>Commit: Doug Rabson >>CommitDate: 2023-06-20 14:34:01 +0000 >> >> pf: Add code to enable filtering for locally delivered packets >> >> This is disabled by default since it potentially changes the behavior = of=20 >> existing filter rule sets. To enable this extra filter for packets bei= ng=20 >> delivered locally, use: >> >> sysctl net.pf.filter_local=3D1 >> service pf restart >> >> PR: 268717 >> Reviewed-by: kp >> MFC-after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D40373 >>--- >>UPDATING | 12 ++++++++++++ >>sys/netpfil/pf/pf_ioctl.c | 20 ++++++++++++++++++++ >>tests/sys/netpfil/common/utils.subr | 3 +-- >>tests/sys/netpfil/pf/fragmentation_compat.sh | 3 ++- >>tests/sys/netpfil/pf/fragmentation_pass.sh | 3 ++- >>tests/sys/netpfil/pf/killstate.sh | 24=20 >>++++++++++++++++-------- >>tests/sys/netpfil/pf/map_e.sh | 3 ++- >>tests/sys/netpfil/pf/pass_block.sh | 3 ++- >>tests/sys/netpfil/pf/pfsync.sh | 1 + >>tests/sys/netpfil/pf/route_to.sh | 3 ++- >>tests/sys/netpfil/pf/set_skip.sh | 2 +- >>tests/sys/netpfil/pf/table.sh | 6 ++++-- >>12 files changed, 65 insertions(+), 18 deletions(-) >> >>diff --git a/UPDATING b/UPDATING >>index 1980411c1853..f4e13d97006d 100644 >>--- a/UPDATING >>+++ b/UPDATING >>@@ -27,6 +27,18 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW: >> world, or to merely disable the most expensive debugging=20 >> functionality >> at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> >>+20230619: >>+ To enable pf rdr rules for connections initiated from the host, pf >>+ filter rules can be optionally enabled for packets delivered >>+ locally. This can change the behavior of rules which match packets >>+ delivered to lo0. To enable this feature: >>+ >>+ sysctl net.pf.filter_local=3D1 >>+ service pf restart > >It seems a bit weird to suggest an action that is not permanent (does=20 >not survive reboot). See proposed rewording below. > >>+ >>+ When enabled, its best to ensure that packets delivered locally are not > >s/its/it is/ > >>+ filtered, e.g. by adding a 'skip on lo' rule. > >TBH, I find the phrasing a bit confusing: "to enable pf rdr rules for=20 >connections =E2=80=A6, pf filter rules can *optionally* be enabled for=20 >packets delivered locally". That "optionally" makes it sound as if it=20 >is not *required* to enable pf filter rules for packets delivered=20 >locally in order to enable pf rdr rules for connections etc etc., but,=20 >given this change, I assume it is. > >Perhaps a better phrasing (assuming I understand the feature) would be: > >"The new sysctl net.pf.filter_local controls whether PF filter rules=20 >are enabled for packets originating from localhost and delivered=20 >locally. > >This feature can be useful for, e.g., enabling rdr rules for=20 >connections initiated from localhost and redirected to a different=20 >port on localhost. Setting the sysctl to 1 may change the behavior of=20 >rules which match packets delivered to lo0, so it may be necessary to=20 >add enable the "skip on lo" option." > >Note that "skip on" is not a rule, even if it is translated to a pair=20 >of rules: it's part of the options, and requires "set" before it, per=20 >pf.conf(5). Also, I'm assuming (and mention in the rewording) we are=20 >talking about rdr rules for port remapping, not rdr rules that=20 >redirect to other destinations, but please confirm or adjust. > >More generally, this new feature should likely also be documented=20 >somewhere else (pf(4) ? pfctl(8)? pf.conf(5)?). > >But apart from the above, I'm a little puzzled: does it mean that=20 >until now (and continuing to do so, unless one sets the sysctl to 1),=20 >packets originating locally and destined locally were not filtered by=20 >pf? I.e., that filtering rules on lo0 had no effect on incoming=20 >traffic from localhost? Hi Doug and Kristof, A ping about what I said below, as I think there is a need to better=20 document this sysctl. Additionally, I'm also a little worried about the name of the sysctl,=20 which seems extremely generic, while its use may be much more specific.=20 If the name could be made more specific, that should probably be done=20 before 14 is branched. Thanks, Matteo --dcahvzwmiwrnfdrr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJHBAABCgAxFiEEa9uKZL0hP4E8Nl5vGwL9SVQlVQEFAmS3FzsTGGhrcHM6Ly9w Z3AubWl0LmVkdQAKCRAbAv1JVCVVAQv2EACPHxidWvhTdzuSrm4tt/HgNC474rjG OJ6zPG+Io2Z6GMIfyanZWjnaXX5pzDsA0ggjNE8qp+15I+jJEMnsaqHAC0LHyWQI zz7fSp7K+CPjs4GJvmK81JB0ntuZgOb2/++ZiQtcfFxWnhgMGxjHyc7A5S+QEFao RilE6E8yh4OaFFroq6rfM+DhOpxQC3PH184ZuBKGsBItPu1eJBRHd6izKiwFidhs SxTh+RVhm1WuqHMREWo7d+snSJBNsIPKHxDHmOZX5uDjURwfd/sUqU8s0wVm7CQX y+po+5NPdaFBFQ8gyvrLZ3aLpeIprqrMAsTTaNlYWWJ5LMOGNbi1KlM1x/2Is3FH MOjFpStZ1EteMQB7/jCCl6eDq4Ps39WASPJ3YEXpZjo9kNOwQYi9MdEfYiCgX3Fv MtxGGvqzl7dZlFEGw68LHFOvL/XoF82Rtmg3pU79hc5VS8rLdOd4cTP9wB7hj4NH 0SdD8R9j3aKYRn5DbiALK6zh68cr6ovLS2mf1n/vic+H9ooWYf6+lXkX090oiITG U/jcxz06YakFIzi0mvKnZ7NbKMfzn82lUSSrxBIBNU1fvVIoBB/toXiHc4kPqhCd vJyl5OuxQqaPi/4gsjW4udBskH4gMIMz1yA07ClBzPRuNR/IUXNalvE6cG+e5AXC 6Ir3vpW/Gx2zSw== =NHyY -----END PGP SIGNATURE----- --dcahvzwmiwrnfdrr-- From nobody Wed Jul 19 01:20:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5J012g3nz4dbTs; Wed, 19 Jul 2023 01:20: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5J0129t8z4DKS; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=shsnryYdXbDbFrVaEardrfx+N4Njtn+nvhNIbCDKZqUTjfF/+0cDJ0nLkMZBWu6zDGZfvH mpmKFOVqXCdntxT0QNxokkvh5qex3LnI/nLw3gHS5V/rS4mV6kkVb3YTHmmjjmw30OyJ+E k5AUQ7ahgJfUV8eeTQEJ/EYAt7TAK8ujdIv9szzg3EhqUkjMkCSeQsg31LJdmDFSvqBwu+ fqCSG99YyjLibnajdtt9qrrlWpKtmosvDhnwFqDzTuPLtJKc4enP9hN2MrhdWy2CDqzZKw clJpmTk785sihDmWZZpQrczigzpTMWph52T1GkTSQwQs9f+UL3c8Ou6hwo/B+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689729601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GD3Nozf51W0n/1Kq9lD9hw4tZGg06NGBeItr0eQ3Bq8=; b=RZi/U2zrEfD8pleztQsfhDABlvPm9hRF30uNgcamSiRPMk/90cO7NNR88qdpUKOVIgp28y F/810uc5zVJZ4ciz9hwWzLrHUYXpY2KFxDgGuCOlFTaG3BE+/x+P3hqWoXh8UGWKEx29oP VhS0+fqdiNQ+F9u0S0ZjT+NX76kuIKHFHrDVa44Sj+ShC/lN/CK84iOd1KlCrT/lUurC5l sb1RtLcdnIoIyaoRhgxrv41K1h5ZZ3YuNV0Nf3AakYGBSGa7vFuhoZbNfalhD107FU+WhF lNrsGsQd3o+BdxEryLq+7VEujSx99DmEWb4k/9yrYf2CJ+dlh5f/zgvx1vHM8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689729601; a=rsa-sha256; cv=none; b=YY6KuRYrmaYYgJEiW/GvkKntZOjwx4+YTgsg1CMAgDoReTroSJiwhdqVz57MOGPg9+Enir 3rt6AALqsJziaOLbTb+fIYxHIKXIEtBt6slcymT1VQLin6myxcsarxKnxRNt0V9pTTx0eW UWBitnLesoMkn9263Iw+LFwfVm1+lZlWXl6L+Pxpvi3mm4FNi5xGZN8oF9MUHCYUSrwgpK l8dDNQLXaf0GRVFGvUK9VIraFMOBYdYgUg1kL3wLWqfEkjhLn4jhptIp8GlSVcbzE2OLcW A/vfGzQWo09k57BY6vzcQlrpTkQ01Ts5jNR/kt/dYJ/PEHjPUWXgvMghlXZf+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 4R5J011FkBzSKk; Wed, 19 Jul 2023 01:20:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J1K1O1011421; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J1K1mQ011397; Wed, 19 Jul 2023 01:20:01 GMT (envelope-from git) Date: Wed, 19 Jul 2023 01:20:01 GMT Message-Id: <202307190120.36J1K1mQ011397@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: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f Author: John Baldwin AuthorDate: 2023-07-19 01:19:27 +0000 Commit: John Baldwin CommitDate: 2023-07-19 01:19:27 +0000 cam: Move bus_dmamap_load_ccb into cam.c. This routine is specific to CAM and no longer assumes any internal bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem. Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41058 --- sys/cam/cam.c | 20 ++++++++++++++++++++ sys/kern/subr_bus_dma.c | 19 ------------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sys/cam/cam.c b/sys/cam/cam.c index ce7dc81b3495..7d9d8602d009 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #ifdef _KERNEL #include +#include #include #include @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) panic("%s: flags 0x%X unimplemented", __func__, ccb_h->flags); } } + +int +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, + bus_dmamap_callback_t *callback, void *callback_arg, + int flags) +{ + struct ccb_hdr *ccb_h; + struct memdesc mem; + + ccb_h = &ccb->ccb_h; + if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { + callback(callback_arg, NULL, 0, 0); + return (0); + } + + mem = memdesc_ccb(ccb); + return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, + flags)); +} #endif diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c index da7a2ee4cdc9..683b41d0047c 100644 --- a/sys/kern/subr_bus_dma.c +++ b/sys/kern/subr_bus_dma.c @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio, return (error); } -int -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb, - bus_dmamap_callback_t *callback, void *callback_arg, - int flags) -{ - struct ccb_hdr *ccb_h; - struct memdesc mem; - - ccb_h = &ccb->ccb_h; - if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) { - callback(callback_arg, NULL, 0, 0); - return (0); - } - - mem = memdesc_ccb(ccb); - return (bus_dmamap_load_mem(dmat, map, &mem, callback, callback_arg, - flags)); -} - int bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bio, bus_dmamap_callback_t *callback, void *callback_arg, From nobody Wed Jul 19 01:44:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5JXN3nnJz4nJCk for ; Wed, 19 Jul 2023 01:44:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5JXN1wjXz4Lc4 for ; Wed, 19 Jul 2023 01:44:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-52166c7f77cso7533479a12.2 for ; Tue, 18 Jul 2023 18:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689731074; x=1692323074; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uCY2iLvxJQ7R7H/8GFV90s6FgishoJFgEqh1Nq6fVbE=; b=HKtCtM8+pVKXGW8VaKBZQ2K3ztN3g7Zo0ajNfuvqpwzjYi4haCPciFzY/+2XVa7lpq kAM0nNQEjsLgoNkpIb4GPaGIGQ+t4ATr94fOv3hC+YVJ/UPkdfAfVMxYKy6Zhz2DERmB 7Px1AFJ/a+g6pSCohfZ+2V3QFPoWhLUGH3rfIwL/I2bkuRwfWdPIdhtS8Vhc+XBxvYTW zVUpHePZY2I/lLHg5VwOZZ5IOZZRHdDuuKuWwxHCVtqM+uPpAHhupO9Zb9uhM7tQj9r3 19WdBgGrpH9lAHBr7JYvaTr1pqqBdyf36ezXUA2TsL4VJ9OlbiZL15fCrhw7myKpG+F/ qLKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689731074; x=1692323074; 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=uCY2iLvxJQ7R7H/8GFV90s6FgishoJFgEqh1Nq6fVbE=; b=YAyZBQVcPEpBAGNh43PlW4Sa0yu3Phzbzbvxws94e0m/5gSv768EoqyBXa/2iWwmEZ OdsxhNL3l0VDB1c7Y1/MOVFbuzoYAnC8SavCiU5r17nIIoVgWrln0g7jpBuvzENSjJge wHMdVmQhMpJdpTwJR39AEkJg/dx6PEaqcPt6Ikl+H9mIcqspXKXm590ALLbouWH7zJ+k Y5bw+O31V/RNZ3Vs2eMEApZ+JNqCCFPhUSmCCJlAHUheQ+MCZj/wlpTqftWr/ZX8tsAW TLgvHgrRbcOumfq/o6GUmJDNKikaIJGz73L8flnshyil7zHNJdBxSfRymcCOiKSzHhAL O2kg== X-Gm-Message-State: ABy/qLYTL0s7r/kqxEbn5Da3uX7Qqtsyr1H2sf2L3u+ZYE0KKnlhy8ip 9Ut0oZSx8bYpleA1Ne1bFcfE7ehepivuVcNdlvHdHL4oK359M9r/8o4HNg== X-Google-Smtp-Source: APBJJlELcwSAQd3/BAKFlfR4Cj376T9WCdz7RpIMk6mjUjFirDRrZAANAnt4gk+4E4RugJg2NumPM/lH5pJBhYP2/p4= X-Received: by 2002:a05:6402:1849:b0:51e:3bb0:aa4e with SMTP id v9-20020a056402184900b0051e3bb0aa4emr1200144edy.15.1689731074471; Tue, 18 Jul 2023 18:44:34 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> In-Reply-To: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> From: Warner Losh Date: Tue, 18 Jul 2023 19:44:24 -0600 Message-ID: Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="00000000000075cc400600cd2ca2" X-Rspamd-Queue-Id: 4R5JXN1wjXz4Lc4 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --00000000000075cc400600cd2ca2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable As predicted in the review, this is broken: -- command output -- linking kernel.full ld: error: undefined symbol: bus_dmamap_load_ccb >>> referenced by nvme_qpair.c:1209 (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) >>> nvme_qpair.o:(_nvme_qpair_submit_request) _ from using sys/amd64/conf/EX include MINIMAL device nvme device nvd This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull anything in for the static kernel case. Please, lets' do this in the header with a static inline like I suggested to get around this issue. Warner On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Baldwin wrot= e: > The branch main has been updated by jhb: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca0= 6d6b6e24f > > commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f > Author: John Baldwin > AuthorDate: 2023-07-19 01:19:27 +0000 > Commit: John Baldwin > CommitDate: 2023-07-19 01:19:27 +0000 > > cam: Move bus_dmamap_load_ccb into cam.c. > > This routine is specific to CAM and no longer assumes any internal > bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem. > > Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. > Reviewed by: kib > Differential Revision: https://reviews.freebsd.org/D41058 > --- > sys/cam/cam.c | 20 ++++++++++++++++++++ > sys/kern/subr_bus_dma.c | 19 ------------------- > 2 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/sys/cam/cam.c b/sys/cam/cam.c > index ce7dc81b3495..7d9d8602d009 100644 > --- a/sys/cam/cam.c > +++ b/sys/cam/cam.c > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > > #ifdef _KERNEL > #include > +#include > #include > #include > > @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) > panic("%s: flags 0x%X unimplemented", __func__, > ccb_h->flags); > } > } > + > +int > +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb= , > + bus_dmamap_callback_t *callback, void *callback_arg, > + int flags) > +{ > + struct ccb_hdr *ccb_h; > + struct memdesc mem; > + > + ccb_h =3D &ccb->ccb_h; > + if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > + callback(callback_arg, NULL, 0, 0); > + return (0); > + } > + > + mem =3D memdesc_ccb(ccb); > + return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > + flags)); > +} > #endif > diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c > index da7a2ee4cdc9..683b41d0047c 100644 > --- a/sys/kern/subr_bus_dma.c > +++ b/sys/kern/subr_bus_dma.c > @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t > map, struct uio *uio, > return (error); > } > > -int > -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb= , > - bus_dmamap_callback_t *callback, void *callback_arg, > - int flags) > -{ > - struct ccb_hdr *ccb_h; > - struct memdesc mem; > - > - ccb_h =3D &ccb->ccb_h; > - if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { > - callback(callback_arg, NULL, 0, 0); > - return (0); > - } > - > - mem =3D memdesc_ccb(ccb); > - return (bus_dmamap_load_mem(dmat, map, &mem, callback, > callback_arg, > - flags)); > -} > - > int > bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio *bi= o, > bus_dmamap_callback_t *callback, void *callback_arg, > --00000000000075cc400600cd2ca2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As predicted in the review, this is = broken:

-- command output --
linking kernel.ful= l
ld: error: undefined symbol: bus_dmamap_load_ccb
>>> refer= enced by nvme_qpair.c:1209 (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme= _qpair.c:1209)
>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 nvme_qpair.o:(_nvme_qpair_submit_request)
_
from using = sys/amd64/conf/EX
include MINIMAL
device nvme
device nvd

This has to= be in the header file. The MODULE_DEPENDS stuff doesn't pull anything = in for the
static kernel case.

Please, lets' do = this in the header with a static inline like I suggested to get around this= issue.

= Warner

On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Bal= dwin <jhb@freebsd.org> wrote:<= br>
The branch main = has been updated by jhb:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-07-19 01:19:27 +0000
Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-07-19 01:19:27 +0000

=C2=A0 =C2=A0 cam: Move bus_dmamap_load_ccb into cam.c.

=C2=A0 =C2=A0 This routine is specific to CAM and no longer assumes any int= ernal
=C2=A0 =C2=A0 bus_dma knowledge as it is simple wrapper around bus_dmamap_l= oad_mem.

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 60381fd1ee86 memdesc= : Retire MEMDESC_CCB.
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D41058
---
=C2=A0sys/cam/cam.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 20 ++++++++++= ++++++++++
=C2=A0sys/kern/subr_bus_dma.c | 19 -------------------
=C2=A02 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index ce7dc81b3495..7d9d8602d009 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");

=C2=A0#ifdef _KERNEL
=C2=A0#include <sys/libkern.h>
+#include <machine/bus.h>
=C2=A0#include <cam/cam_queue.h>
=C2=A0#include <cam/cam_xpt.h>

@@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic("%s: fla= gs 0x%X unimplemented", __func__, ccb_h->flags);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0}
+
+int
+bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
+}
=C2=A0#endif
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
index da7a2ee4cdc9..683b41d0047c 100644
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t m= ap, struct uio *uio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (error);
=C2=A0}

-int
-bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
-}
-
=C2=A0int
=C2=A0bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio = *bio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
--00000000000075cc400600cd2ca2-- From nobody Wed Jul 19 02:42:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5KqZ4FDgz4ntDb for ; Wed, 19 Jul 2023 02:42:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5KqX5Pw0z3NfZ for ; Wed, 19 Jul 2023 02:42:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20221208.gappssmtp.com header.s=20221208 header.b=kNyltHFh; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2a00:1450:4864:20::133) smtp.mailfrom=wlosh@bsdimp.com; dmarc=none Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4fdd31bf179so1196087e87.2 for ; Tue, 18 Jul 2023 19:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1689734567; x=1692326567; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Yzk2Nf2nbtsTTGPYD5nqapnJVziAE/3S0vvkhWXh0yI=; b=kNyltHFhg5ceYHnLHK96gSMEZ2aqA1dkG41TMP8Wsjr56Psv5KEqLOyGt7OaS3xWeE IOfMmCRnEX6uzi4Y5Vo1bw2F3IUHgX6G/Ca7oqllu2PGJ5sSLlt3OmMp1kw5PBRzvTJp +I0bNFx3p1gUGnLLSf3R5cKmtNzLg0UDGLmhbqEw5jLNMFySHL0lWNcYoOWj2Eh0MCbw sbSYz1ox8q9Dx31XmJw00WYZ9Bb4jqxP3nwsbJAtqg+8I6H6DA6UyoKikGgLKzTwSzCS xekdnibnYDIVukX/FnxioCEBdwTbXTInLg2MU6lJ7rJqMP05TfUzx+it3k9YuwaA/2Es u2jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689734567; x=1692326567; 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=Yzk2Nf2nbtsTTGPYD5nqapnJVziAE/3S0vvkhWXh0yI=; b=deIRyM+qtGt+fiZS82qmDUTUoKG6BF/594TrIYr5tCs3LVvUj0S3dwBJeEdQAl23A/ 6mAaYnrH8liSTHAQJ1SSlOdrbXG4ZFDl57Yrb5jPCIU5uZnmQx6lkhsF1s2QZeBZGEIA N5EgVGYMCsZCxNhjL+PmlF9n48xivS+FOc7wklNNWT5enGfZnsumkGj7TyVjZsrvFNP3 RAeeJuZF+6EYzjEF0xg2b52zSxSqnfFLCwgsEy03A2bu5exQc+bn+pbALF+mIG8n5hYd VZ+dIIgBb1cMDs4HBRye7bvZj/u8kS5ITKdExqSDQtxiYOxWq40ow7N0x83WfUd1Wpo2 YCKg== X-Gm-Message-State: ABy/qLa2pPdTvv91zLpTPicNc5d1JnzOSPBYaoTDO9uo3fuDFySj+65A gsoYSJrn6ciugul7qRfkb8+/A25LVhiR7wadFDgr0Q== X-Google-Smtp-Source: APBJJlFEH4hZFrllTV42JkeOrSwdVJqNPvCLEz/mtGX3S5doeJrZL1lr4Mps7TO048SByd0Q1LwL3h5B7Q74RRBI1jc= X-Received: by 2002:a19:5f11:0:b0:4fd:c771:ed76 with SMTP id t17-20020a195f11000000b004fdc771ed76mr734519lfb.38.1689734566679; Tue, 18 Jul 2023 19:42:46 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Tue, 18 Jul 2023 20:42:36 -0600 Message-ID: Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000009cb26d0600cdfc44" X-Spamd-Result: default: False [-2.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.96)[-0.964]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20221208.gappssmtp.com:s=20221208]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; R_SPF_NA(0.00)[no SPF record]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::133:from]; BLOCKLISTDE_FAIL(0.00)[2a00:1450:4864:20::133:server fail]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20221208.gappssmtp.com:+]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[bsdimp.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com] X-Rspamd-Queue-Id: 4R5KqX5Pw0z3NfZ X-Spamd-Bar: -- --0000000000009cb26d0600cdfc44 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sorry for the top post. Two ways forward that I see: Two proposed fixes https://reviews.freebsd.org/D41077 which makes loading the dma for a nvme request a function pointer (and keeps all ccb knowledge in nvme_sim.c) https://reviews.freebsd.org/D41078 which moves renames memdesc_ccb to cam_memdesc_ccb and moves it to cam_cch.h '78 is ready to commit as is. I think it's fine, but don't like the dependency graph. '77 likely needs some polish before it's pushed in, especially with naming. I like its dependency graph, but don't like the extra call through a function pointer for all nvme requests. Warner P.S. Sorry if I sounded too grumpy in other replies... it's been a frustrating day in $REAL_LIFE and I let that infect those replies. On Tue, Jul 18, 2023 at 7:44=E2=80=AFPM Warner Losh wrote: > As predicted in the review, this is broken: > > -- command output -- > linking kernel.full > ld: error: undefined symbol: bus_dmamap_load_ccb > >>> referenced by nvme_qpair.c:1209 > (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) > >>> nvme_qpair.o:(_nvme_qpair_submit_request) > _ > from using sys/amd64/conf/EX > include MINIMAL > device nvme > device nvd > > This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull > anything in for the > static kernel case. > > Please, lets' do this in the header with a static inline like I suggested > to get around this issue. > > Warner > > On Tue, Jul 18, 2023 at 7:20=E2=80=AFPM John Baldwin wr= ote: > >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca= 06d6b6e24f >> >> commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f >> Author: John Baldwin >> AuthorDate: 2023-07-19 01:19:27 +0000 >> Commit: John Baldwin >> CommitDate: 2023-07-19 01:19:27 +0000 >> >> cam: Move bus_dmamap_load_ccb into cam.c. >> >> This routine is specific to CAM and no longer assumes any internal >> bus_dma knowledge as it is simple wrapper around bus_dmamap_load_mem= . >> >> Fixes: 60381fd1ee86 memdesc: Retire MEMDESC_CCB. >> Reviewed by: kib >> Differential Revision: https://reviews.freebsd.org/D41058 >> --- >> sys/cam/cam.c | 20 ++++++++++++++++++++ >> sys/kern/subr_bus_dma.c | 19 ------------------- >> 2 files changed, 20 insertions(+), 19 deletions(-) >> >> diff --git a/sys/cam/cam.c b/sys/cam/cam.c >> index ce7dc81b3495..7d9d8602d009 100644 >> --- a/sys/cam/cam.c >> +++ b/sys/cam/cam.c >> @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); >> >> #ifdef _KERNEL >> #include >> +#include >> #include >> #include >> >> @@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb) >> panic("%s: flags 0x%X unimplemented", __func__, >> ccb_h->flags); >> } >> } >> + >> +int >> +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *cc= b, >> + bus_dmamap_callback_t *callback, void *callback_arg, >> + int flags) >> +{ >> + struct ccb_hdr *ccb_h; >> + struct memdesc mem; >> + >> + ccb_h =3D &ccb->ccb_h; >> + if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { >> + callback(callback_arg, NULL, 0, 0); >> + return (0); >> + } >> + >> + mem =3D memdesc_ccb(ccb); >> + return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >> + flags)); >> +} >> #endif >> diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c >> index da7a2ee4cdc9..683b41d0047c 100644 >> --- a/sys/kern/subr_bus_dma.c >> +++ b/sys/kern/subr_bus_dma.c >> @@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_= t >> map, struct uio *uio, >> return (error); >> } >> >> -int >> -bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *cc= b, >> - bus_dmamap_callback_t *callback, void *callback_arg, >> - int flags) >> -{ >> - struct ccb_hdr *ccb_h; >> - struct memdesc mem; >> - >> - ccb_h =3D &ccb->ccb_h; >> - if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D CAM_DIR_NONE) { >> - callback(callback_arg, NULL, 0, 0); >> - return (0); >> - } >> - >> - mem =3D memdesc_ccb(ccb); >> - return (bus_dmamap_load_mem(dmat, map, &mem, callback, >> callback_arg, >> - flags)); >> -} >> - >> int >> bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio >> *bio, >> bus_dmamap_callback_t *callback, void *callback_arg, >> > --0000000000009cb26d0600cdfc44 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry for the top post. Two ways for= ward that I see:


=
'78 is ready to commit as is. I think it's fine, but don't= like the dependency graph.
'77 likely needs some polish befo= re it's pushed in, especially with naming. I like its dependency graph,= but don't like the extra call through a function pointer for all nvme = requests.

Warner

P.S. Sor= ry if I sounded too grumpy in other replies... it's been a frustrating = day in $REAL_LIFE and I let that infect those replies.


On Tue, Jul 18, 2023 at 7:44=E2=80=AFPM Warner Losh <imp@bsdimp.com> wrote:
As = predicted in the review, this is broken:

-- comman= d output --
linking kernel.full
ld: error: undefined symbol: bus_dmam= ap_load_ccb
>>> referenced by nvme_qpair.c:1209 (/usr/home/imp/= git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209)
>>> =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nvme_qpair.o:(_nvme_qpair_submit_req= uest)
_
from using sys/amd64/conf/EX
include MINIMAL
de= vice nvme
device nvd

This has to be in the header file. The MODULE_DEPENDS = stuff doesn't pull anything in for the
s= tatic kernel case.

Please, lets' do this in the header with a static inline lik= e I suggested to get around this issue.

=
Warner

On Tue, Jul 18, = 2023 at 7:20=E2=80=AFPM John Baldwin <jhb@freebsd.org> wrote:
The branch main has been updated by jhb:<= br>
URL: https://cgit.= FreeBSD.org/src/commit/?id=3Dc5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
commit c5312bd79e66ce8ef50655ce7f3eca06d6b6e24f
Author:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-07-19 01:19:27 +0000
Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-07-19 01:19:27 +0000

=C2=A0 =C2=A0 cam: Move bus_dmamap_load_ccb into cam.c.

=C2=A0 =C2=A0 This routine is specific to CAM and no longer assumes any int= ernal
=C2=A0 =C2=A0 bus_dma knowledge as it is simple wrapper around bus_dmamap_l= oad_mem.

=C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 60381fd1ee86 memdesc= : Retire MEMDESC_CCB.
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 kib
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D41058
---
=C2=A0sys/cam/cam.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 20 ++++++++++= ++++++++++
=C2=A0sys/kern/subr_bus_dma.c | 19 -------------------
=C2=A02 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/sys/cam/cam.c b/sys/cam/cam.c
index ce7dc81b3495..7d9d8602d009 100644
--- a/sys/cam/cam.c
+++ b/sys/cam/cam.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");

=C2=A0#ifdef _KERNEL
=C2=A0#include <sys/libkern.h>
+#include <machine/bus.h>
=C2=A0#include <cam/cam_queue.h>
=C2=A0#include <cam/cam_xpt.h>

@@ -642,4 +643,23 @@ memdesc_ccb(union ccb *ccb)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 panic("%s: fla= gs 0x%X unimplemented", __func__, ccb_h->flags);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0}
+
+int
+bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
+}
=C2=A0#endif
diff --git a/sys/kern/subr_bus_dma.c b/sys/kern/subr_bus_dma.c
index da7a2ee4cdc9..683b41d0047c 100644
--- a/sys/kern/subr_bus_dma.c
+++ b/sys/kern/subr_bus_dma.c
@@ -449,25 +449,6 @@ bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t m= ap, struct uio *uio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return (error);
=C2=A0}

-int
-bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,<= br> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bus_d= mamap_callback_t *callback, void *callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0int f= lags)
-{
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct ccb_hdr *ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0struct memdesc mem;
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0ccb_h =3D &ccb->ccb_h;
-=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((ccb_h->flags & CAM_DIR_MASK) =3D=3D= CAM_DIR_NONE) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0callback(callback_a= rg, NULL, 0, 0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (0);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0}
-
-=C2=A0 =C2=A0 =C2=A0 =C2=A0mem =3D memdesc_ccb(ccb);
-=C2=A0 =C2=A0 =C2=A0 =C2=A0return (bus_dmamap_load_mem(dmat, map, &mem= , callback, callback_arg,
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags));
-}
-
=C2=A0int
=C2=A0bus_dmamap_load_bio(bus_dma_tag_t dmat, bus_dmamap_t map, struct bio = *bio,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bus_d= mamap_callback_t *callback, void *callback_arg,
--0000000000009cb26d0600cdfc44-- From nobody Wed Jul 19 07:27:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5S8F5pM0z4dPgv; Wed, 19 Jul 2023 07:27: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5S8F4bsSz3JR2; Wed, 19 Jul 2023 07:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNRMRsZPa49mZ7zEaptyRr2ztNZgBDb+iEJt2zgPw/U=; b=A26Nxv2iIYq+YNdAZO0kiwpjaHGkKR6gNUGXDK5HO4y79zS31g7q9p/GqAJl2FTIqAunKx vl3h8U0gkpqfxMIB9JXH1StntIqy9iZwvyBsNysYjwl3R+zlB3zKdtKJunzMy48laeyY3c jUWziLbdlS7MMUonRhFhndt9PrrnGb/062Vm4Y4Ar3sy1srUg8TicIFysFvJwqp4Aym4Sd N4BGdCGwsC4KmzNzriNnXoRc/x5lFhXTN5+RYi7/rjgLsumyQ2ncK3V98YRTA35irLZa1b zW+RyTmUFzfPsTEsOf3xbtd58dZroPfoKoqtSLxRqUGFxzk22HNEIHtvdLAnXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751661; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNRMRsZPa49mZ7zEaptyRr2ztNZgBDb+iEJt2zgPw/U=; b=rmMVu2K65rw+oRB825YTA928iVNdd06LI6r4QpZVqTzCzoRxTSX/43Imjf+9Qzqy/gvRqx 8L6RbDrOZRrVQdAMM2yVn8GjNHELMYohh9Y0SPP0HghEDrGGgwML9N3Vg7fg70edIvosJr xeYp/tA/G53Cz9Aa2P2cDK4BtWNyApFA14j0PvpyqiHi1ALm6FJgykJjTgkkdvVqJS9Vw0 qfLwERgEPDbwgHjN/Du4qHMBKa+LXsS6O2So517P/D7fO8MSEgr7tmTVgPYqV5C/pTxAQq AZgyACbb5SdBjUDMR9tdPGsuyskUTfOMe2q/ZGVmkmzxjAfjh2Fzln9ERHpAfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689751661; a=rsa-sha256; cv=none; b=W4NX5wQSnHVsEkQVNkrGsvvYsMeQmc3Sc7L39XsJaY0qubxcV+1506H+ZQBPu+f20ka/+3 9QdcmUkuZpPPqWqmZkNtaUfMkJ/lOH8zDn8Bj0lEgTD5/LqswRsmcj5F4x2Tf1ipqnJ4mT oE7yW24OONu2RBvDiNLuZBtsknqiB4NCxquaxhMkxza99gv2sq44U0dZsIsHx44WQmbc6b iGwAW5Cgh+iLzlcilJKPP/MjCuq/CLsVbmYTocz1+lZuliBC+FfDWBq0Y+ItWKrXiU2WkO WpCozZxYvJ+jOBgEKuL9BrgUhcAwktlawRF4E3vSOp4XHn0xZZhbwxBbGdP+bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5S8F3G7nzf1R; Wed, 19 Jul 2023 07:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J7Rffl020753; Wed, 19 Jul 2023 07:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J7RfWi020752; Wed, 19 Jul 2023 07:27:41 GMT (envelope-from git) Date: Wed, 19 Jul 2023 07:27:41 GMT Message-Id: <202307190727.36J7RfWi020752@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 73a079021a69 - stable/13 - pf: fix pfi_kif definition in the man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 73a079021a6921ac3ff8ea4b2baca5ddb13de645 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=73a079021a6921ac3ff8ea4b2baca5ddb13de645 commit 73a079021a6921ac3ff8ea4b2baca5ddb13de645 Author: Kristof Provost AuthorDate: 2023-07-12 09:43:43 +0000 Commit: Kristof Provost CommitDate: 2023-07-19 07:26:59 +0000 pf: fix pfi_kif definition in the man page PR: 272455 Submitted by: alex@inferiorhumanorgans.com MFC after: 1 week (cherry picked from commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141) --- share/man/man4/pf.4 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 133e4d300043..8f25b7c7aebd 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2021 +.Dd July 12, 2023 .Dt PF 4 .Os .Sh NAME @@ -1094,20 +1094,18 @@ The data is returned in the structure described below: .Bd -literal struct pfi_kif { - RB_ENTRY(pfi_kif) pfik_tree; char pfik_name[IFNAMSIZ]; + union { + RB_ENTRY(pfi_kif) pfik_tree; + LIST_ENTRY(pfi_kif) pfik_list; + }; u_int64_t pfik_packets[2][2][2]; u_int64_t pfik_bytes[2][2][2]; u_int32_t pfik_tzero; - int pfik_flags; - struct pf_state_tree_lan_ext pfik_lan_ext; - struct pf_state_tree_ext_gwy pfik_ext_gwy; - TAILQ_ENTRY(pfi_kif) pfik_w_states; - void *pfik_ah_cookie; + u_int pfik_flags; struct ifnet *pfik_ifp; struct ifg_group *pfik_group; - int pfik_states; - int pfik_rules; + u_int pfik_rulerefs; TAILQ_HEAD(, pfi_dynaddr) pfik_dynaddrs; }; .Ed From nobody Wed Jul 19 07:27:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5S8G1l6Sz4dPm7; Wed, 19 Jul 2023 07:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5S8G0KfVz3JFk; Wed, 19 Jul 2023 07:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYbKQiDCW964VtqCIUjPBk+WNUuQ2ski8S+ZCVbU6fU=; b=g9WtfFauLhHJZEPOT59yrKF1L0tws0CcLGqiRO4HI4cxPwYyr5GoOJ9+o4vDFARar6CV/b s83CKkn9LNfbc7UcEYAtd5uceEv3RdfeCPdY0A2CEBbwLwDBJ9LPT9u//Kmv6KA3hijlAT ueApcnQVxtAUSRv9gE1xL+bhYxpoUXLQT6Hpqz0JFe61J3LItmMbCDMAcyfUKxxoQKAbIl uuSZPEI6JZgXOvl8gb1CDHpDhDQtMIQgv+aMFYwOM3YzLyf/dUpXIPROhay/g5S7j0uH/P r7AwVil+/H1vm+1H01cRnSkQJYkvfKkIqEjsWOm9cJ27Hl81tA66swmFyZdcFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rYbKQiDCW964VtqCIUjPBk+WNUuQ2ski8S+ZCVbU6fU=; b=koikn/42mFEMQghj4Ld1yKuNdBHuFCwwUiN73eOEddttRuQT4gODfgtod+2FV8KQ5pJo9i +vqhzQ795II1h/YwL0yE7CPHbzHl0O4rdTEa68hKgCX7w/MPIbaVhgjK0KLvqUm6mmIWeg fgyUhlj9RmtlY/h97CBdQQCgaJsKl85Db+xpoWZmD/flQ4TbNxYlj2DTrZbvu5dEYVqMJ8 r2Al7LclXVvEX8ULdviU+U//G+I0l0zkU3lb7FScpQFUl5Sq3FdGAh3dVESNDdcWGbIndH ixWNWUq0gHgtHLYeKRUMcMTcrpHEZt2tT83xhDEfC02W5ZUShi+XbVeK78NI2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689751662; a=rsa-sha256; cv=none; b=wSzbvE4ebpWLnpti9geSZlhtdjHM8BEcjUxvJyNobB/ul0VJCcvscfZPaahwRM8K5LR8hS qFL6jJTdJZMfdO146G3R6vagYESOd1Vx34lFw3pFAcjRr+i9JPZ3ZxLitvsKADrmTi1SfR mdRUmJgsR29yV8p3FaxlEgekw29eMN/6MyIKhUw1lM8mqReCHXi+wZkbvXhRH/NQwtfSr5 SLuE57k8CoZjKfYdSAHsEFHC27B8XWKWNhNOc+q/Zn5Y5rGnrggCbBy52SJ0oGeIuMAq/k h+DTbTDcjgAJ0qc8WGy+ko/yd/tNcy4AX5V2Wom7YNHBaYL8hqyvI4jAbiIt5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5S8F6VRgzdxq; Wed, 19 Jul 2023 07:27:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J7RfjG020834; Wed, 19 Jul 2023 07:27:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J7RfLR020833; Wed, 19 Jul 2023 07:27:41 GMT (envelope-from git) Date: Wed, 19 Jul 2023 07:27:41 GMT Message-Id: <202307190727.36J7RfLR020833@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e14a1e002991 - stable/12 - pf: fix pfi_kif definition in the man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e14a1e0029916cc99787ad93fe22dfe304c9d56a Auto-Submitted: auto-generated The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e14a1e0029916cc99787ad93fe22dfe304c9d56a commit e14a1e0029916cc99787ad93fe22dfe304c9d56a Author: Kristof Provost AuthorDate: 2023-07-12 09:43:43 +0000 Commit: Kristof Provost CommitDate: 2023-07-19 07:26:55 +0000 pf: fix pfi_kif definition in the man page PR: 272455 Submitted by: alex@inferiorhumanorgans.com MFC after: 1 week (cherry picked from commit 64b30b7aeb6d0dc48d038b3df033328c8d8c3141) --- share/man/man4/pf.4 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 133e4d300043..8f25b7c7aebd 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2021 +.Dd July 12, 2023 .Dt PF 4 .Os .Sh NAME @@ -1094,20 +1094,18 @@ The data is returned in the structure described below: .Bd -literal struct pfi_kif { - RB_ENTRY(pfi_kif) pfik_tree; char pfik_name[IFNAMSIZ]; + union { + RB_ENTRY(pfi_kif) pfik_tree; + LIST_ENTRY(pfi_kif) pfik_list; + }; u_int64_t pfik_packets[2][2][2]; u_int64_t pfik_bytes[2][2][2]; u_int32_t pfik_tzero; - int pfik_flags; - struct pf_state_tree_lan_ext pfik_lan_ext; - struct pf_state_tree_ext_gwy pfik_ext_gwy; - TAILQ_ENTRY(pfi_kif) pfik_w_states; - void *pfik_ah_cookie; + u_int pfik_flags; struct ifnet *pfik_ifp; struct ifg_group *pfik_group; - int pfik_states; - int pfik_rules; + u_int pfik_rulerefs; TAILQ_HEAD(, pfi_dynaddr) pfik_dynaddrs; }; .Ed From nobody Wed Jul 19 07:27:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5S8G5rf6z4dPdY; Wed, 19 Jul 2023 07:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5S8G4lcfz3JFt; Wed, 19 Jul 2023 07:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFLpqGcX/gu2eVLZKDq0D0FdqzHrKEWt8bLttzfF0Gc=; b=gjceH//+VSwC5iVj+JQ8BoEY2InNHWULVokepxmjVb9Akbe7q3KMr2SXKCfZ3oQ+LzO0MZ f4zwDa9A8t2JcYM+1sGVsqMojz+tLVKAzKnBsd+MALMPhmgoROcAHEWt1jPHTls5TT24sD Nq+2JYaZnZ4po0iblVwncECwFVtT836P0qfPFhKjD73d0Tld3FuITrQS0N152M4pkYanzz SXjZePVBu1c2NsXhnPtLRlcLrfDFcnszMDA97lICd6hNE1T/zOxQrZDfMxTP7vlwrDkO5h IKvEid3wb5WN2E39+kIsNWVphHgMT+IUNBeUS36M8FIXtJ+PoIVJwk4wdfVV3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vFLpqGcX/gu2eVLZKDq0D0FdqzHrKEWt8bLttzfF0Gc=; b=YDUHq+CJtLGwttbxmVMn2bCnB5IIaRK3gosGxKI57QSBg8es74UWY6x1pq0gGKx2Ex6kQH P9lCizpblq1rFv1nC8B7GdN2PxqLvRpbvhyTyzEcgP1WvZF5Nav0xlt72qRcFLie+GWvIZ EJrdF4Ai6Mn3OSJu4cHu3fM4/v1xByQ7ZvsHcYNSLJMXdp/DPPyjaxJonrIpv+FmQFA+Ny VVKCsmAwMSqym1HlPFqmoi/5Gv7pLj9M+nwwhjJ1/d2sOlPk2z9ulkfEiEoU1unw9+V2Lj P0giY7uUOkZGW3YIhPw7Mb6ySAQZWCDVzyG/Y2y3y/kjjB04z+P2AdyT+at2Ag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689751662; a=rsa-sha256; cv=none; b=QtWb1hfLzK0aQ+49L4djeTnzXc8VnpfnIAZYbciZ1ojdehC1Vj6EE/cdUGFChjfyGJy67Z EgkMs9qXjhtViL+AWXBhk49+fNVansPYPvc5HA7WEz+w1o0/VUz937Zhx5LruMAGj97qMe y75zgisigiFiNgkXzho0cAt8/+LatBN2eYvbpAYO2DgUVV575/UNURrQHTupvCarhCZgkI uuNdlWzi+XegSUuj0VxWe+jtgRxpEugpBmeG2VwXOCT3y92Pymx1aC3q7TcJLBqGZAycJS 1850oQDeJNujhCHP10Dj6B5OatOKeY7CLnr1hI/Tpg60fbRrxMRUaxA8LzrPdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5S8G3sCkzdxr; Wed, 19 Jul 2023 07:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J7Rgc3020853; Wed, 19 Jul 2023 07:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J7Rgv4020852; Wed, 19 Jul 2023 07:27:42 GMT (envelope-from git) Date: Wed, 19 Jul 2023 07:27:42 GMT Message-Id: <202307190727.36J7Rgv4020852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 504ddc193214 - stable/13 - pf: fix error descriptions in the man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 504ddc1932149318c094bd890229dca297a4874f Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=504ddc1932149318c094bd890229dca297a4874f commit 504ddc1932149318c094bd890229dca297a4874f Author: Kristof Provost AuthorDate: 2023-07-12 11:17:14 +0000 Commit: Kristof Provost CommitDate: 2023-07-19 07:27:06 +0000 pf: fix error descriptions in the man page PR: 272459 Submitted by: alex@inferiorhumanorgans.com MFC after: 1 week (cherry picked from commit df56c8069a4c920392ac9fec0adfcc03d9607abc) --- share/man/man4/pf.4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 8f25b7c7aebd..3b3237cb9295 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -302,8 +302,10 @@ calls. Nested anchors, since they are not directly attached to the given anchor, will not be included. This ioctl returns -.Er EINVAL -if the given anchor does not exist. +.Er ENOENT +if the parent anchor given at +.Va path +does not exist. .It Dv DIOCGETRULESET Fa "struct pfioc_ruleset *pr" Get a ruleset (i.e., an anchor) .Va name @@ -315,10 +317,14 @@ the maximum number of which can be obtained from a preceding .Dv DIOCGETRULESETS call. This ioctl returns -.Er EINVAL -if the given anchor does not exist or +.Er ENOENT +if the parent anchor given by +.Va path +does not exist or .Er EBUSY -if another process is concurrently updating a ruleset. +if the index passed in by +.Va nr +is greater than the number of anchors. .It Dv DIOCADDSTATE Fa "struct pfioc_state *ps" Add a state entry. .Bd -literal From nobody Wed Jul 19 07:27:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5S8H2RTVz4dPq8; Wed, 19 Jul 2023 07:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5S8H1DVkz3JTT; Wed, 19 Jul 2023 07:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jcOCmWDhNMuXEzhWh/UjbGyqBTpM5GmVdbRBVSFr04=; b=gJSRLW6CP5fYY59Jg1l4bdCgET58PHxLaQOyItFwbBTOKmTvq89YEKNrQgDugSSf69wJWe WZcPcjBJHwcju2Fg7ovHYBF8dgo1+rR8FERaUxhAvzUPiOot9yb00plof1Rz4FIpwVx9/d vPrV8hmnm5o7PcZbqzLizkFRJrw9NTKnTqZ4heFB9JtHMnYX7jV3eY1hhMnPgGntHxZDq/ mxSWW0iBq+OPJaVza81rqhO917N8UMAxMmNm7rk/h6B4tNrAZOYYUmgDyMtrDb6iuOrxYk WHaCldF98hbyN1sb5RT21xnkMGF5tf7zavBaVXxrO25kQdFKPIKEbPGbf3isBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689751663; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4jcOCmWDhNMuXEzhWh/UjbGyqBTpM5GmVdbRBVSFr04=; b=ap1Fe8Om7pgKSzWW83TNf5YKUBYhbDqBZioeJKC3EweQoSNfSjZ+w0NmhXjj9gu6wOQyz7 V5ysTkuudT3dnvTzNgxwDVDshkL8NPUNG0tSh8+oT1e/C+yFSvY8CrD+AIDO3NTI9cYY8p +GTBDfaD/vRqDXD0UtdCJkuxrdvtG1eGCrmwquwhkGuwPo5JH9VgE7Fonh2ccrvYw6LU0B nFM9sPZcTqzZwe39oyxpBEtpYwYj0VyQ+NxCUEXQmTdtBCdsy2adCs8cECS3m+m8UjJmWz +xGpc96oq/TW+/bQsWqflH/9sM6CLATSxzT7wqz5DRbr95sXUsuwHGPPbGY53Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689751663; a=rsa-sha256; cv=none; b=Xmc2wR3SCGrSF5k2IwTJ8xuKi8EIiweX5CGTnMbb28FDo4cAEBHyKJfl6WWX+L/lzqcZ0j E96uH3ftMqJrhPM5Ddm68jwWGnrx/rjtnBNDsu7cljU0wiCM0eK0nFfEFnR2Rz6mdXLKWf 0ry2okvxkMqlYc+r+AcT89OJuMTgR36ZGuE1d9CWUqqZnq3KPHRI08/1Cflwi9+d4vLfxu ywAQ2GXMt5hQPeJ4+EEo/PLhneJ2SscRl6xbz+fFqf7dnRIHuFx+1k5N4r2LttkN4BRyd5 xqfziSFm0iz5+JJXjZzBDedHToyyd8jfzHsNhsG7b7aYh/pfsypZ3/CTpm8WWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5S8H06lHzdcR; Wed, 19 Jul 2023 07:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36J7RgE5020872; Wed, 19 Jul 2023 07:27:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36J7RgqI020871; Wed, 19 Jul 2023 07:27:42 GMT (envelope-from git) Date: Wed, 19 Jul 2023 07:27:42 GMT Message-Id: <202307190727.36J7RgqI020871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d84a5e90185c - stable/12 - pf: fix error descriptions in the man page List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d84a5e90185ccb06c7230381bb425a0fa8170672 Auto-Submitted: auto-generated The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d84a5e90185ccb06c7230381bb425a0fa8170672 commit d84a5e90185ccb06c7230381bb425a0fa8170672 Author: Kristof Provost AuthorDate: 2023-07-12 11:17:14 +0000 Commit: Kristof Provost CommitDate: 2023-07-19 07:27:08 +0000 pf: fix error descriptions in the man page PR: 272459 Submitted by: alex@inferiorhumanorgans.com MFC after: 1 week (cherry picked from commit df56c8069a4c920392ac9fec0adfcc03d9607abc) --- share/man/man4/pf.4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/share/man/man4/pf.4 b/share/man/man4/pf.4 index 8f25b7c7aebd..3b3237cb9295 100644 --- a/share/man/man4/pf.4 +++ b/share/man/man4/pf.4 @@ -302,8 +302,10 @@ calls. Nested anchors, since they are not directly attached to the given anchor, will not be included. This ioctl returns -.Er EINVAL -if the given anchor does not exist. +.Er ENOENT +if the parent anchor given at +.Va path +does not exist. .It Dv DIOCGETRULESET Fa "struct pfioc_ruleset *pr" Get a ruleset (i.e., an anchor) .Va name @@ -315,10 +317,14 @@ the maximum number of which can be obtained from a preceding .Dv DIOCGETRULESETS call. This ioctl returns -.Er EINVAL -if the given anchor does not exist or +.Er ENOENT +if the parent anchor given by +.Va path +does not exist or .Er EBUSY -if another process is concurrently updating a ruleset. +if the index passed in by +.Va nr +is greater than the number of anchors. .It Dv DIOCADDSTATE Fa "struct pfioc_state *ps" Add a state entry. .Bd -literal From nobody Wed Jul 19 12:50:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5bK00j5sz4nXny; Wed, 19 Jul 2023 12:50: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5bJz5jTzz449T; Wed, 19 Jul 2023 12:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689771043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA4K97P0zjN6EnzrbyoqmmCR4cysOf6pH5slqYJ+PkM=; b=FzD4Bx8jg+YeIZwCxoJjkP80Ml6xPBPVbeK91tQklBhFZWFbrZflppvz9AJcxvpURKgcgr KwU2GrRAK2z/LH0T5ipwOGK1su7/dcxRDuYuPVvXljWNmqapKEMp5YkLosQoRbNBpe/thg 7GifUChWLEp3w60uOgWYaDI3qN9qJAn0k5x/NwuQA+jSB+J5MvIPm9lsYqGwwZL6QnL0OD FLX4qaGggdM2l4evHLDze7NJKRh3K6ak7RMsyMYfBpDZeU0IjMsEM2hoU0mbLsvOhsxHr+ Nzxd70RXWEWg8g0kD92x8yL8JrC2HTdwnC3LHov4pgbsAaitJ4TO3SK7+2Wp5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689771043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA4K97P0zjN6EnzrbyoqmmCR4cysOf6pH5slqYJ+PkM=; b=XjW5EZi/fxgkV9Vtx0ilPx5TM8UhofqxXKo19SSGRiVo/Gbp8GXT2dofgZWdCPVSDRcr+E rTj3cGA/KfYYCr+Eq7rOsraaY9xbh56GVhBof+KEirB5P9ltfYxJ44f4PTjU+uvD1hX7qn qnZTHSx1bRKOzYpRYZE5PRKXCqe3aI7SJL7qNDj9sdhXSAmP1J2iMjG62Ux7POMHqOXT6I Jv4ZaUZ9glRVQhju+GUzbOIlGO6ZPFXL6tYuCFVtslFS+kGXL7UfoOT2oZ9+DYGdg1fyL6 I/oiNmXYLlk7Mjis1AJeprtwdjaRuJhDLOV0Lj/uNchcdMu3O7uOT8bDrQtfrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689771043; a=rsa-sha256; cv=none; b=cJ/rha9VI1rR4NB/a+heBwQx1jqyJQCYLk+gCihUSyHsyfwvaFER80jt41jit6ujm+qBkZ Z3mTdksKgcNMuxYCDS7SQt/hATA/d4yJryjoUpCxS1k4PzvzXxPM5XN2NFI/DRI4aWsHZS JTZossjw9D1Uit5a2QM2Sx3jkO9CvZq6eqlVBuLgFo1yEV91GUGeztZISooacm66itzkFf CMhAlpwxgZQoD4GZFNUMFRfWE6UHYU91RaizIDmHPKDYqJOO5P7BuDhSXxLkq81nBHaYth FJEQFt00SLS997qD8Mm64pp2kYdro7luwAwPRLQOLk9V7gu5O9PwvHdgmTq+Lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5bJz4VLYznxx; Wed, 19 Jul 2023 12:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JCohLW060534; Wed, 19 Jul 2023 12:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JCohNt060533; Wed, 19 Jul 2023 12:50:43 GMT (envelope-from git) Date: Wed, 19 Jul 2023 12:50:43 GMT Message-Id: <202307191250.36JCohNt060533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e4a873bf10b7 - main - tcp: improve layout of struct tcpcb List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4a873bf10b7cc8fa67087a7291a640d09e430f2 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e4a873bf10b7cc8fa67087a7291a640d09e430f2 commit e4a873bf10b7cc8fa67087a7291a640d09e430f2 Author: Michael Tuexen AuthorDate: 2023-07-19 12:47:36 +0000 Commit: Michael Tuexen CommitDate: 2023-07-19 12:47:36 +0000 tcp: improve layout of struct tcpcb Put optional fields at the end to minimize run time problems in case CC modules are build from within its directory. Reviewed by: cc, gallatin, glebius, imp Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D41059 --- sys/netinet/tcp_var.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8e89f2aef0f2..0f57fec74865 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -442,15 +442,6 @@ struct tcpcb { const char *t_output_caller; /* Function that called tcp_output */ struct statsblob *t_stats; /* Per-connection stats */ /* Should these be a pointer to the arrays or an array? */ -#ifdef TCP_ACCOUNTING - uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; - uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS]; -#endif -#ifdef TCP_REQUEST_TRK - uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */ - uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */ - uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */ -#endif uint32_t t_logsn; /* Log "serial number" */ uint32_t gput_ts; /* Time goodput measurement started */ tcp_seq gput_seq; /* Outbound measurement seq */ @@ -478,10 +469,6 @@ struct tcpcb { uint8_t t_end_info_bytes[TCP_END_BYTE_INFO]; uint64_t t_end_info; }; -#ifdef TCPPCAP - struct mbufq t_inpkts; /* List of saved input packets. */ - struct mbufq t_outpkts; /* List of saved output packets. */ -#endif struct osd t_osd; /* storage for Khelp module data */ uint8_t _t_logpoint; /* Used when a BB log points is enabled */ #ifdef TCP_REQUEST_TRK @@ -489,8 +476,19 @@ struct tcpcb { uint8_t t_tcpreq_req; /* Request count */ uint8_t t_tcpreq_open; /* Number of open range requests */ uint8_t t_tcpreq_closed; /* Number of closed range requests */ + uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */ + uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */ + uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */ struct tcp_sendfile_track t_tcpreq_info[MAX_TCP_TRK_REQ]; #endif +#ifdef TCP_ACCOUNTING + uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; + uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS]; +#endif +#ifdef TCPPCAP + struct mbufq t_inpkts; /* List of saved input packets. */ + struct mbufq t_outpkts; /* List of saved output packets. */ +#endif }; #endif /* _KERNEL || _WANT_TCPCB */ From nobody Wed Jul 19 13:39:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cPd2Qwqz4nyDf; Wed, 19 Jul 2023 13:39: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cPb4HTpz4JRP; Wed, 19 Jul 2023 13:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689773987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0b/2DIZ9YAXKTkbLM4m29MjtAbvBbtJC90HXo6zxpg=; b=H7xXJr7KWklcLSCNbuo7T052+QhC1BsPgMLbOnyDCTNevtLaNEQ23FeHiW5VGFu56lWFp3 aSfUalNDamulOLO/M4V2Ql5yDVJ8IWIom5k4FnzBrNdv8a3O2PeOHIfhv/xWJaRQIHopvh 5xl6mkPnXAU2i2HukO6I34UhPmQ8NBGdUrM3qgrIbr60sAZ1uH55uXJe+0j2wtKPUf4Y7v f9z9Ht/KMgZFOQHHO7jGH3OXpdLX3Urc+MmMJ92Z4fyqlCdfr+d0OhEJKlWDonFzI7E/4I xg8btYYTk/P4VpyEscPTZqtlNgjEibUZXw8FWHldHSHOHq/2kXUZLV69/kM8dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689773987; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C0b/2DIZ9YAXKTkbLM4m29MjtAbvBbtJC90HXo6zxpg=; b=Urjwft38GEBa42wtuhM9lqckGuSf+30jlkCbKy+/Zzh60SW0neqbxa4xp6viOXDfGx6Hs6 +OTwRlcM0Dv6LbdauuDxftmV3jXpo2vMjVbjDv+vE2/w61BECSWpq1IMz97qpjgJ3cuE4w WFbpkPrPMP3g3lA0D08tYLwIXtodRBaIpWvLADiJKgFJhpEOgrt7saOfEUvdW1i8CZQEmi UeZr1A0FvboJEaB7TtNvYd9pNyfmmTTEeJXPB33e8rwVbSekXqF9AwoiRP6wkuKErKxHEW RTSmpoL8FgGoDH6tAwOBF5P9ttIaR1mBxynKnFk1xrKKKTtfM7qta9CUdQhQgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689773987; a=rsa-sha256; cv=none; b=WtwKNKcYkXMg1+W3WM08iIdkX06YCXdYXzDf9biAYiSXV1BCE+SFcdxsVW1jQuMYepaaKc 6WRMESDwdGIkgSx/el/zlTgWeFqQYhRNYMTim5GJx3gYcaYBAPt7TkUG2yqw43y0CkDpoZ 3ftU11r7ntyj4qJRbvy/d+56Ri/XKakuSHiVrebCR0S5zArZAoCbsaBE1cy/bU647QB7AX Mwy96TpYhJu7UQXoHFLREvVCtkyNipNguKLYofuIXbOjK/jGgzbhhWQ+5Gzo9DzUwfrk0k kHdPXJlNXHz+w+0CmpI3DewHGLyfaNg0ejL09tLv1pTlqePvL3NV3M6tNit7Lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5cPb07ljzq87; Wed, 19 Jul 2023 13:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JDdk2b034074; Wed, 19 Jul 2023 13:39:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDdkUX034073; Wed, 19 Jul 2023 13:39:46 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:39:46 GMT Message-Id: <202307191339.36JDdkUX034073@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 17839f45d86e - main - pw: Ensure group membership is not duplicated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17839f45d86e79065a65ad3e2522dd69b29a652c Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=17839f45d86e79065a65ad3e2522dd69b29a652c commit 17839f45d86e79065a65ad3e2522dd69b29a652c Author: Naman Sood AuthorDate: 2023-07-19 12:44:21 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:36:09 +0000 pw: Ensure group membership is not duplicated Fix the following problem: 1. A nonexistent user, someuser, is added to somegroup in /etc/group. 2. someuser is then created with membership in somegroup. The entry for somegroup in /etc/group will then contain somegroup:*:12345:someuser,someuser With this fix, the entry will be somegroup:*:12345:someuser PR: 238995 Reviewed by: bapt, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41076 --- usr.sbin/pw/pw.h | 2 ++ usr.sbin/pw/pw_group.c | 2 +- usr.sbin/pw/pw_user.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pw/pw.h b/usr.sbin/pw/pw.h index fb1ba9a44f84..6eb5a25e56ec 100644 --- a/usr.sbin/pw/pw.h +++ b/usr.sbin/pw/pw.h @@ -114,3 +114,5 @@ extern const char *Which[]; uintmax_t strtounum(const char * __restrict, uintmax_t, uintmax_t, const char ** __restrict); + +bool grp_has_member(struct group *grp, const char *name); diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 277763041f0a..48f999d3e1d3 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -418,7 +418,7 @@ pw_group_del(int argc, char **argv, char *arg1) return (EXIT_SUCCESS); } -static bool +bool grp_has_member(struct group *grp, const char *name) { int j; diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index bea248c802ed..9029069c6a9f 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -1408,6 +1408,9 @@ pw_user_add(int argc, char **argv, char *arg1) if (cmdcnf->groups != NULL) { for (i = 0; i < cmdcnf->groups->sl_cur; i++) { grp = GETGRNAM(cmdcnf->groups->sl_str[i]); + /* gr_add doesn't check if new member is already in group */ + if (grp_has_member(grp, pwd->pw_name)) + continue; grp = gr_add(grp, pwd->pw_name); /* * grp can only be NULL in 2 cases: From nobody Wed Jul 19 13:41:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cS248pbz4nyhJ; Wed, 19 Jul 2023 13:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cS23J48z4KKB; Wed, 19 Jul 2023 13:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fHnCHgbXU3EnZQTPTntIv3DjsJUdrN6NUgI/QEqHEI8=; b=awP8gBDFkj/isujrZeamrYO3VDfpiaWa0wqT22CQcmYWyxEcPPoRdwhDqw8bKvq+IjKW2c fmNu+umciYBgk8u1Pa4MBU4yW11AGAkZI06FOCMXNfJMjinpMp7JUC8GNDTy5wCiadSpBQ pJSEA4sPafcl2XyZurHKywgzEhjhzN/GvgWNHXNaPNJ96ZJrhX4V7W54g/PpJpUv1uPkyz Fxy1L+NDiB0W/I/BBhgb20z4pSyg/tcypUvWRWxOaUNiHdW8pW0Jpdx9J9TmYv9GktJquU kk7PoBh6jVF3BIdSNMLLaLhqJ0tAixNlXtgK3AU6RUX6mhPxDS498Dt5s8JmVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774114; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fHnCHgbXU3EnZQTPTntIv3DjsJUdrN6NUgI/QEqHEI8=; b=Bo/3GgS6muOfRSXWXec64ii353xP9K3VY9oWeF75quFPbhU569bEuHcGmbPVybhdPcmqr3 azti7Qc/LAFJ32SXBUxw1U1jPyXO3sRMYdaSWWTMsP1B2T5IXLxzndBMjUO6b3Jne7IamC 6P9871AqLMWnZB1YjYjkxbJHFTygCxPgSqp/1N0jR4QBmmOyFKAFxv/qKX1+VMs/VSH422 GPyKygRjPYyw5J2FkQIBxhHwnwkTHSxB7+8wA3aokD7mVgHemL6AM/ODyzLRd1HDjAwC7c NdRMxEcZG9DdObplnuUN4M4e5SmMDDasF/+mW7KW6dsZbHW2mYeuWDRBw7MVhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774114; a=rsa-sha256; cv=none; b=R8PcT9pPF39v6vF3bCbAHqd+sncS9V3ZXNEuanKOgESxp1xH0vh2DR5d1N+HNpVY97Vp8m 5YvGf1IIZmzKPvJ1klVl/UrkxF7+kZjKT0/54IeWdDcCi8S0G5W+gfjzctO3p/QUKRus6J RKOliCEf/RCn9v9yoIoY37/aHXop+fCrUo5EzlWB4udiFIHUVopwBdzyKcc4+fKwrpPN5T +NMMt7idkrqbxIj5YegtOAlrxZHFPgEocKbQNrsrTYJ++o5z/VFKKd3ID0NZuAIHWvAVDJ EEeAPtrcnEUYPYj+OzZRE3iAGdpQZBVGFxkFOcjgdDA7SCTFNgH/EBlJTSQIAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5cS22BDVzqC5; Wed, 19 Jul 2023 13:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JDfsTZ045354; Wed, 19 Jul 2023 13:41:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDfs6j045347; Wed, 19 Jul 2023 13:41:54 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:41:54 GMT Message-Id: <202307191341.36JDfs6j045347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 1a8d37b8cffc - main - pw: Use existing group entry, even if it already has members List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a8d37b8cffc805626a3954496845b7a14a45bea Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=1a8d37b8cffc805626a3954496845b7a14a45bea commit 1a8d37b8cffc805626a3954496845b7a14a45bea Author: Naman Sood AuthorDate: 2023-07-19 13:06:06 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:40:53 +0000 pw: Use existing group entry, even if it already has members Fix the following problem: 1. A nonexistent user, someuser, is added to /etc/group as someuser:*:12345:someuser. 2. someuser is then created with the default login group. A second group entry for someuser will be created. someuser:*:12345:someuser someuser:*:12346: With this fix, the existing group entry will be used. PR: 238995 Reviewed by: bapt, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41057 --- usr.sbin/pw/pw_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 9029069c6a9f..3e5a9841c5f3 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -378,8 +378,7 @@ pw_gidpolicy(struct userconf *cnf, char *grname, char *nam, gid_t prefer, bool d grp = GETGRGID(gid); } gid = grp->gr_gid; - } else if ((grp = GETGRNAM(nam)) != NULL && - (grp->gr_mem == NULL || grp->gr_mem[0] == NULL)) { + } else if ((grp = GETGRNAM(nam)) != NULL) { gid = grp->gr_gid; /* Already created? Use it anyway... */ } else { intmax_t grid = -1; From nobody Wed Jul 19 13:46:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cY8675cz4p1Gm; Wed, 19 Jul 2023 13:46: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cY84mQzz4LvY; Wed, 19 Jul 2023 13:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvybD3KIoiLYLaYCIFVtGZiben1n6f80ATC6IVR3jeA=; b=tc010b/pPzXaqGiUvkNE09VpwupLRecoNbjZfWaPUqofYupLyt4WYUKMVYpjYNY8URPLOv DSF40NCNSuzQDgOPtZR2nEu73X6oYzYElCLYaNro7vJhN05r3d4RQtslhG1/DExf+CrIbN t2g6Gqm6fx1tY1yOmzUHPpmODHadg7+paZhP1dQGOAVbRsdoAk2NTfCOx9IhkIXDjTCnP5 LHp4H05/aVri2+405jshDJoZe2dFZ99/AXcfmIjupN43BdNiRfRHafvVSRkrpAs4JaZsl2 9uhqiaHHqQft3NKOCW4+48tklz48jK9BDR32IxJVQjYi9avxqRME3DaMAu0zNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CvybD3KIoiLYLaYCIFVtGZiben1n6f80ATC6IVR3jeA=; b=seYzI+nWcbav7EhdHIjsl06Xr3R0Hl7x0p7F0jqtDzzx+sSTsipUmEzJQHsbxiydhePfMD /g/XFY6uyoNm58LvxFiLHJm4tuSgjtFhG6G04sYXW2GM80Yk6IxyWcerAkC791TqSY4eDJ MVGU+jjpZDGSa8CMh9OHiscG/J3+euXcW1CDoXcc+tB3KaiAGMvwP4G0TbsIZfq011Xykw CHBuWA+wrI5Gf1Y4zjCYhyWvVwjrMv8cC4W5OvCxv6et3F5vh1RZHw6Jpgvdnq27r+WBM6 bR1QDtBAXCmMZ56EQcvvcv9psJ5RZF6doOQaV6QFEdIqgPmNgUqtg+iu13Dx1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774380; a=rsa-sha256; cv=none; b=HEwHO2n4Q5wUMdSu9u84B9crHzLpJz6Lj9fPGiT/CnO7guXzHnnMle32WOLU6Si5botvMb E6l7MhN3DS/9uWroUGuR082ifsR+WQXzRv9/4z24zQsR5RBPCNxVoip4LkXXv8fQOMIk8o /bKWTXB644+6VL9kz3QFUBNi9CGsPZTHNjGhqxDiTXcRbUsJIItJJ0SrEfIgLaumyNB5tO B21tEBOWHO1gfya3VuesJ8k0oAWrxXNkF7uvKgvFlNEN96+F/C+66qRceU6iAXIv/OvPbw tKYnIC1l/0V/YJisAcSSbfIoVHDLFWNGZldNVCgzKlaZ5mgCbaEHuTExWO4caQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5cY83sF2zq5X; Wed, 19 Jul 2023 13:46:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JDkKaH050983; Wed, 19 Jul 2023 13:46:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDkK7W050982; Wed, 19 Jul 2023 13:46:20 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:46:20 GMT Message-Id: <202307191346.36JDkK7W050982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Joseph Mingrone Subject: git: 181692ab0896 - main - pw: Add regression tests for useradd bug fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 181692ab0896637bc174ab3e1ef319991dfa371f Auto-Submitted: auto-generated The branch main has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=181692ab0896637bc174ab3e1ef319991dfa371f commit 181692ab0896637bc174ab3e1ef319991dfa371f Author: Naman Sood AuthorDate: 2023-07-19 13:27:14 +0000 Commit: Joseph Mingrone CommitDate: 2023-07-19 13:43:12 +0000 pw: Add regression tests for useradd bug fixes PR: 238995 Reviewed by: jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41080 --- usr.sbin/pw/tests/pw_useradd_test.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index e9d0a3aa20af..ac24b0df6693 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -463,6 +463,29 @@ user_add_conf_defaultpasswd_body() grep defaultpasswd ${HOME}/pw.conf } +atf_test_case user_add_existing_login_group +user_add_existing_login_group_body() +{ + populate_etc_skel + + atf_check -s exit:0 ${PW} groupadd testuser + atf_check -s exit:0 ${PW} useradd user1 -G testuser + atf_check -s exit:0 ${PW} useradd testuser + atf_check -o match:"1" \ + sh -c "grep testuser ${HOME}/group | wc -l" +} + +atf_test_case user_add_already_in_group +user_add_already_in_group_body() +{ + populate_etc_skel + + echo "testgroup:*:4242:testuser" >> ${HOME}/group + atf_check -s exit:0 ${PW} useradd testuser -G testgroup + atf_check -o not-match:"testuser,testuser" \ + grep testuser ${HOME}/group +} + atf_init_test_cases() { atf_add_test_case user_add atf_add_test_case user_add_noupdate @@ -503,4 +526,6 @@ atf_init_test_cases() { atf_add_test_case user_add_defaultgroup atf_add_test_case user_add_conf_defaultpasswd + atf_add_test_case user_add_existing_login_group + atf_add_test_case user_add_already_in_group } From nobody Wed Jul 19 13:52:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5cgp2Whtz4dQDJ; Wed, 19 Jul 2023 13:52: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5cgn6kV5z4Ng0; Wed, 19 Jul 2023 13:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFbfhXX60PKQzJQsjYEzRYWX00Ucp91wgCYnuvf9GiM=; b=x6OwRP7+03MPT/DIHsIVqlEhxYt+m5pXi7Xllynl9pLiHBTEqudpigHH8vbkNhN/JbF55O aFrtn72+Bi4F0S5plDvpTiGTeKfdO7gempE5/zSlLmm1Ze6vKBkuvsODLXL4g0AwiK1eSe K02WsNIbr/IUocso/LjToN4SLPgfU3Jz/s/OjNxqL8tbgjS3evdL+qOdrVsOmu6eWq17jx wWnEsNHcRNcYfWr9p6tXgQnrg5QQXwiUrp/skPSUyPv4f8bK8wqTxFW6cd9L5SAgGp3T9M AA46bipnL7Lj88iagcX82K60YWbb9RrPCYVKQNUGB704AF3Oa9YVsx1+UMrhEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689774725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RFbfhXX60PKQzJQsjYEzRYWX00Ucp91wgCYnuvf9GiM=; b=DzGky5mzgN9O3CUjd6yrYY2qoH20Gj8sXw6rhGlBRd3WhNCdyUsikl8dfjvSach6tT/qm4 4YAS91VNZFpkHzcTfFLjomSZSZ42dLa377LuKIuI9n/WOwImcz2dbvSCT2HuKr4HgXbfz4 tYvcPW/1Mdq8RzgecFKn+++qarD6y9NA/cVIaCngdKACKEUxmB5HSYG8OmVEHp2vfHKZIA eiBtJ4ZDtAWF3JMwgtUao40kcSYXNoVeoHnKUF2o48D8yce3QsqIFhZQs1OiWhWNk1NDcD SOoQkOlb3FN6HMouEJHpQPbkCdsPuaQtvVoB3NI2MgdrU38VmvvxlR08gQQg6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689774725; a=rsa-sha256; cv=none; b=tjadDXX1wtAAiqAmr6HCf4i/njkxoB5lb00ve3p2Rb384JkjIweFqAhZoN+uSQJyY/dFAU w/9ZVj/K1OZxNVgT/hFKTWSM3yntWwz3BOLkQvRVXpsRumw9soYjzAWVpRUhh3QO1/AyEF qQBqfJ2RBuT4SGnAJ1YJCuD3Uln+h4gnmrLk8e1CuAtQPerKYATbbTkBcFAcrs9oQtTo2z vGgIYIeu9JCjtiOGN+yx5IaopuMo/SRreOfJDURWzjcgm9ky9PCoqabsi6+z6/UP1ROOBA nufNf1jS51mHMM9QmACQz9HfUSVM+LXLEN6iE0xS01hErl//5+wOR7NpCYuaqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5cgn5p2gzqVM; Wed, 19 Jul 2023 13:52:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JDq5nA066118; Wed, 19 Jul 2023 13:52:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JDq5Gb066117; Wed, 19 Jul 2023 13:52:05 GMT (envelope-from git) Date: Wed, 19 Jul 2023 13:52:05 GMT Message-Id: <202307191352.36JDq5Gb066117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: e38c634b77de - main - vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e38c634b77dec76c03613bd84b37ae22d3bb5699 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=e38c634b77dec76c03613bd84b37ae22d3bb5699 commit e38c634b77dec76c03613bd84b37ae22d3bb5699 Author: Dmitry Chagin AuthorDate: 2023-07-19 13:51:07 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-19 13:51:07 +0000 vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41070 --- sys/kern/vfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 41a80da75a4f..83e95731d7c4 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -4028,9 +4028,9 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, { int error; - MPASS((lkflags1 & LK_SHARED) != 0 ^ (lkflags1 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags1 & LK_SHARED) != 0) ^ ((lkflags1 & LK_EXCLUSIVE) != 0)); MPASS((lkflags1 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); - MPASS((lkflags2 & LK_SHARED) != 0 ^ (lkflags2 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags2 & LK_SHARED) != 0) ^ ((lkflags2 & LK_EXCLUSIVE) != 0)); MPASS((lkflags2 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); if (vp1 == NULL && vp2 == NULL) From nobody Wed Jul 19 14:45:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5dsF2WJfz4nMYm; Wed, 19 Jul 2023 14:45: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5dsF1QJ8z3R4J; Wed, 19 Jul 2023 14:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689777921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHQQomC+jud4je8H2wP9zU2PTArOvu3pbI55FlONRyo=; b=fuVEz59Zjvjpxg3Zh4r5BVJilDQhDVbTN/tXFxK8PtyYB7QZNgbtvtQ+7h5p2b0wicTAm5 Cg2FfAt59lIxjnyWAFjJty+z5aQ5T+8IjiZmclNNQ+u9alvH2R95cvZImA51gTjvxug/Wi hsnFnuGaY6Uqevv6veAzz6B59i95knXL2rF0Z3SQvgUB6C1kGJq4QGJtXP3Cpg0Fpibisu oKc1TquLLum5GGViP0UVbgiglnVwhNHAFmbJlfZyoKBFYIySDGLrgHznxEiKzkT12GiCTz H3/P4xDpxqWiZj7nH5gP1oD/3+KrzMBPc2G1FPdQgdAx4r7evBfHiJNxb8U9Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689777921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EHQQomC+jud4je8H2wP9zU2PTArOvu3pbI55FlONRyo=; b=vgE/8CU1WIGAjgw3fLECCn/vSDElekRXyP1MuEglJ3dxh0I0nPV0GNyRQ67Umls5UQssMY cn9+MOPJ4tUff1Z925NPeWRi5im3+QE4OoGKjYJwzhzkiRSs1kLJ+IA084XhWsc26iCQmM HibR48kb6hwmVFpNOr2k0S2aulM3kgIVeRYOi88o1/P0yQ+D9Jdg2jSU4kl9Uk9mCcQ5Sz TcYK4xxNZV+UqkY5lkrDiV+2NaZ2lrQ4vt6qRPpT8vmn9vnsS6XjHFxkKy5I5KhYhOpSeV fjWS9Cm8LkAmiAGsQEXD6Juiwu5OKf/LFkEC/om1wEMNazOtp1++qBNxYWCGiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689777921; a=rsa-sha256; cv=none; b=n2xCRS5Gk+HnMe6QVIC4E/fb/VGJXV3g/O78RUpCHAcAOmjjdNhIFkq+e6VvEiq7fJfe0T LX1I0xXsR1aVJL3p5ua5zJVV5HTENxyJfhtMz4uhZrwv5efG8ERr/7+Pfl5y2BgmNU5ZgA BQjl+yDGnhXgJqW+1DxR5f5sABqekASRAUKrR9OKgxe+Q4Oo0PTTys/c6VRhyHs+C5+g+g iyUqTHqdhSIhdp4fxWAGZiBk8IYmDoWVcP5Ddx5ycjX7/JFKsijgA4fV5hF3hS+uYN4Ysg iSniE3CAcmJIvuCTUUx6zWE4VCIaUXvsoWEveNJ3IHuCtkQ8zD5YnliKPQlrJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5dsF0VVJzrGT; Wed, 19 Jul 2023 14:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JEjLLD049968; Wed, 19 Jul 2023 14:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JEjLsT049967; Wed, 19 Jul 2023 14:45:21 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:45:21 GMT Message-Id: <202307191445.36JEjLsT049967@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: 6f251ef228e6 - main - radix_trie: simplify ge, le lookups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 6f251ef228e6ea3891cd7364c1e6d161297a2f90 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6f251ef228e6ea3891cd7364c1e6d161297a2f90 commit 6f251ef228e6ea3891cd7364c1e6d161297a2f90 Author: Doug Moore AuthorDate: 2023-07-19 14:43:31 +0000 Commit: Doug Moore CommitDate: 2023-07-19 14:43:31 +0000 radix_trie: simplify ge, le lookups Replace the implementations of lookup_le and lookup_ge with ones that do not use a stack or climb back up the tree, and instead exploit the popmap field to quickly identify the place to resume searching if the straightforward indexed search fails. The code size of the original functions shrinks by a combined 160 bytes on amd64, and the cumulative cycle count per invocation of the two functions together is reduced 20% in a buildworld test. Reviewed by: alc, markj Tested by: pho Differential Revision: https://reviews.freebsd.org/D40936 --- sys/kern/subr_pctrie.c | 290 ++++++++++++++++++++----------------------------- sys/vm/vm_radix.c | 285 +++++++++++++++++++----------------------------- 2 files changed, 228 insertions(+), 347 deletions(-) diff --git a/sys/kern/subr_pctrie.c b/sys/kern/subr_pctrie.c index ae8408a6e1ef..4cd7f4b085ba 100644 --- a/sys/kern/subr_pctrie.c +++ b/sys/kern/subr_pctrie.c @@ -472,211 +472,151 @@ pctrie_lookup_unlocked(struct pctrie *ptree, uint64_t index, smr_t smr) } /* - * Look up the nearest entry at a position bigger than or equal to index, - * assuming access is externally synchronized by a lock. + * Returns the value with the least index that is greater than or equal to the + * specified index, or NULL if there are no such values. + * + * Requires that access be externally synchronized by a lock. */ uint64_t * pctrie_lookup_ge(struct pctrie *ptree, uint64_t index) { - struct pctrie_node *stack[PCTRIE_LIMIT]; + struct pctrie_node *node, *succ; uint64_t *m; - struct pctrie_node *child, *node; -#ifdef INVARIANTS - int loops = 0; -#endif - unsigned tos; int slot; + /* + * Descend the trie as if performing an ordinary lookup for the + * specified value. However, unlike an ordinary lookup, as we descend + * the trie, we use "succ" to remember the last branching-off point, + * that is, the interior node under which the least value that is both + * outside our current path down the trie and greater than the specified + * index resides. (The node's popmap makes it fast and easy to + * recognize a branching-off point.) If our ordinary lookup fails to + * yield a value that is greater than or equal to the specified index, + * then we will exit this loop and perform a lookup starting from + * "succ". If "succ" is not NULL, then that lookup is guaranteed to + * succeed. + */ node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - if (node == NULL) - return (NULL); - else if (pctrie_isleaf(node)) { - m = pctrie_toval(node); - if (*m >= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the smallest key - * in the current node (if the owner is greater than the - * search key). - */ - if (pctrie_keybarr(node, index)) { - if (index > node->pn_owner) { -ascend: - KASSERT(++loops < 1000, - ("pctrie_lookup_ge: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - node = stack[--tos]; - } while (pctrie_slot(index, - node->pn_clev) == (PCTRIE_COUNT - 1)); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is less than PCTRIE_COUNT - 1. - */ - index = pctrie_trimkey(index, - node->pn_clev); - index += PCTRIE_UNITLEVEL(node->pn_clev); - } else - index = node->pn_owner; - KASSERT(!pctrie_keybarr(node, index), - ("pctrie_lookup_ge: keybarr failed")); - } - slot = pctrie_slot(index, node->pn_clev); - child = pctrie_node_load(&node->pn_child[slot], NULL, - PCTRIE_LOCKED); - if (pctrie_isleaf(child)) { - m = pctrie_toval(child); + succ = NULL; + while (node != NULL) { + if (pctrie_isleaf(node)) { + m = pctrie_toval(node); if (*m >= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the first set bit beyond the first slot+1 bits. */ - slot = ffs(node->pn_popmap & (-2 << slot)) - 1; - if (slot < 0) { + break; + } + if (pctrie_keybarr(node, index)) { /* - * A value or edge greater than the search slot is not - * found in the current node; ascend to the next - * higher-level node. + * If all values in this subtree are > index, then the + * least value in this subtree is the answer. */ - goto ascend; + if (node->pn_owner > index) + succ = node; + break; } - child = pctrie_node_load(&node->pn_child[slot], - NULL, PCTRIE_LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in node %p", - __func__, slot, node)); - if (pctrie_isleaf(child)) - return (pctrie_toval(child)); - index = pctrie_trimkey(index, node->pn_clev + 1) + - slot * PCTRIE_UNITLEVEL(node->pn_clev); -descend: - KASSERT(node->pn_clev > 0, - ("pctrie_lookup_ge: pushing leaf's parent")); - KASSERT(tos < PCTRIE_LIMIT, - ("pctrie_lookup_ge: stack overflow")); - stack[tos++] = node; - node = child; + slot = pctrie_slot(index, node->pn_clev); + + /* + * Just in case the next search step leads to a subtree of all + * values < index, check popmap to see if a next bigger step, to + * a subtree of all pages with values > index, is available. If + * so, remember to restart the search here. + */ + if ((node->pn_popmap >> slot) > 1) + succ = node; + node = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); } + + /* + * Restart the search from the last place visited in the subtree that + * included some values > index, if there was such a place. + */ + if (succ == NULL) + return (NULL); + if (succ != node) { + /* + * Take a step to the next bigger sibling of the node chosen + * last time. In that subtree, all values > index. + */ + slot = pctrie_slot(index, succ->pn_clev) + 1; + KASSERT((succ->pn_popmap >> slot) != 0, + ("%s: no popmap siblings past slot %d in node %p", + __func__, slot, succ)); + slot += ffs(succ->pn_popmap >> slot) - 1; + succ = pctrie_node_load(&succ->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + + /* + * Find the value in the subtree rooted at "succ" with the least index. + */ + while (!pctrie_isleaf(succ)) { + KASSERT(succ->pn_popmap != 0, + ("%s: no popmap children in node %p", __func__, succ)); + slot = ffs(succ->pn_popmap) - 1; + succ = pctrie_node_load(&succ->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + return (pctrie_toval(succ)); } /* - * Look up the nearest entry at a position less than or equal to index, - * assuming access is externally synchronized by a lock. + * Returns the value with the greatest index that is less than or equal to the + * specified index, or NULL if there are no such values. + * + * Requires that access be externally synchronized by a lock. */ uint64_t * pctrie_lookup_le(struct pctrie *ptree, uint64_t index) { - struct pctrie_node *stack[PCTRIE_LIMIT]; + struct pctrie_node *node, *pred; uint64_t *m; - struct pctrie_node *child, *node; -#ifdef INVARIANTS - int loops = 0; -#endif - unsigned tos; int slot; + /* + * Mirror the implementation of pctrie_lookup_ge, described above. + */ node = pctrie_root_load(ptree, NULL, PCTRIE_LOCKED); - if (node == NULL) - return (NULL); - else if (pctrie_isleaf(node)) { - m = pctrie_toval(node); - if (*m <= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the largest key - * in the current node (if the owner is smaller than the - * search key). - */ + pred = NULL; + while (node != NULL) { + if (pctrie_isleaf(node)) { + m = pctrie_toval(node); + if (*m <= index) + return (m); + break; + } if (pctrie_keybarr(node, index)) { - if (index > node->pn_owner) { - index = node->pn_owner + PCTRIE_COUNT * - PCTRIE_UNITLEVEL(node->pn_clev); - } else { -ascend: - KASSERT(++loops < 1000, - ("pctrie_lookup_le: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - node = stack[--tos]; - } while (pctrie_slot(index, - node->pn_clev) == 0); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is greater than 0. - */ - index = pctrie_trimkey(index, - node->pn_clev); - } - index--; - KASSERT(!pctrie_keybarr(node, index), - ("pctrie_lookup_le: keybarr failed")); + if (node->pn_owner < index) + pred = node; + break; } slot = pctrie_slot(index, node->pn_clev); - child = pctrie_node_load(&node->pn_child[slot], NULL, + if ((node->pn_popmap & ((1 << slot) - 1)) != 0) + pred = node; + node = pctrie_node_load(&node->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + if (pred == NULL) + return (NULL); + if (pred != node) { + slot = pctrie_slot(index, pred->pn_clev); + KASSERT((pred->pn_popmap & ((1 << slot) - 1)) != 0, + ("%s: no popmap siblings before slot %d in node %p", + __func__, slot, pred)); + slot = fls(pred->pn_popmap & ((1 << slot) - 1)) - 1; + pred = pctrie_node_load(&pred->pn_child[slot], NULL, + PCTRIE_LOCKED); + } + while (!pctrie_isleaf(pred)) { + KASSERT(pred->pn_popmap != 0, + ("%s: no popmap children in node %p", __func__, pred)); + slot = fls(pred->pn_popmap) - 1; + pred = pctrie_node_load(&pred->pn_child[slot], NULL, PCTRIE_LOCKED); - if (pctrie_isleaf(child)) { - m = pctrie_toval(child); - if (*m <= index) - return (m); - } else if (child != NULL) - goto descend; - - /* Find the last set bit among the first slot bits. */ - slot = fls(node->pn_popmap & ((1 << slot) - 1)) - 1; - if (slot < 0) { - /* - * A value or edge smaller than the search slot is not - * found in the current node; ascend to the next - * higher-level node. - */ - goto ascend; - } - child = pctrie_node_load(&node->pn_child[slot], - NULL, PCTRIE_LOCKED); - if (pctrie_isleaf(child)) - return (pctrie_toval(child)); - index = pctrie_trimkey(index, node->pn_clev + 1) + - (slot + 1) * PCTRIE_UNITLEVEL(node->pn_clev) - 1; -descend: - KASSERT(node->pn_clev > 0, - ("pctrie_lookup_le: pushing leaf's parent")); - KASSERT(tos < PCTRIE_LIMIT, - ("pctrie_lookup_le: stack overflow")); - stack[tos++] = node; - node = child; } + return (pctrie_toval(pred)); } /* diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c index f6bdda70539b..6504d5031460 100644 --- a/sys/vm/vm_radix.c +++ b/sys/vm/vm_radix.c @@ -513,205 +513,146 @@ vm_radix_lookup_unlocked(struct vm_radix *rtree, vm_pindex_t index) } /* - * Look up the nearest entry at a position greater than or equal to index. + * Returns the page with the least pindex that is greater than or equal to the + * specified pindex, or NULL if there are no such pages. + * + * Requires that access be externally synchronized by a lock. */ vm_page_t vm_radix_lookup_ge(struct vm_radix *rtree, vm_pindex_t index) { - struct vm_radix_node *stack[VM_RADIX_LIMIT]; + struct vm_radix_node *rnode, *succ; vm_page_t m; - struct vm_radix_node *child, *rnode; -#ifdef INVARIANTS - int loops = 0; -#endif - int slot, tos; + int slot; + /* + * Descend the trie as if performing an ordinary lookup for the page + * with the specified pindex. However, unlike an ordinary lookup, as we + * descend the trie, we use "succ" to remember the last branching-off + * point, that is, the interior node under which the page with the least + * pindex that is both outside our current path down the trie and more + * than the specified pindex resides. (The node's popmap makes it fast + * and easy to recognize a branching-off point.) If our ordinary lookup + * fails to yield a page with a pindex that is greater than or equal to + * the specified pindex, then we will exit this loop and perform a + * lookup starting from "succ". If "succ" is not NULL, then that lookup + * is guaranteed to succeed. + */ rnode = vm_radix_root_load(rtree, LOCKED); - if (rnode == NULL) - return (NULL); - else if (vm_radix_isleaf(rnode)) { - m = vm_radix_topage(rnode); - if (m->pindex >= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the smallest key - * in the current node (if the owner is greater than the - * search key). - */ - if (vm_radix_keybarr(rnode, index)) { - if (index > rnode->rn_owner) { -ascend: - KASSERT(++loops < 1000, - ("vm_radix_lookup_ge: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - rnode = stack[--tos]; - } while (vm_radix_slot(index, - rnode->rn_clev) == (VM_RADIX_COUNT - 1)); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is less than VM_RADIX_COUNT - 1. - */ - index = vm_radix_trimkey(index, - rnode->rn_clev); - index += VM_RADIX_UNITLEVEL(rnode->rn_clev); - } else - index = rnode->rn_owner; - KASSERT(!vm_radix_keybarr(rnode, index), - ("vm_radix_lookup_ge: keybarr failed")); - } - slot = vm_radix_slot(index, rnode->rn_clev); - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - if (vm_radix_isleaf(child)) { - m = vm_radix_topage(child); + succ = NULL; + while (rnode != NULL) { + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); if (m->pindex >= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the first set bit beyond the first slot+1 bits. */ - slot = ffs(rnode->rn_popmap & (-2 << slot)) - 1; - if (slot < 0) { + break; + } + if (vm_radix_keybarr(rnode, index)) { /* - * A page or edge greater than the search slot is not - * found in the current node; ascend to the next - * higher-level node. + * If all pages in this subtree have pindex > index, + * then the page in this subtree with the least pindex + * is the answer. */ - goto ascend; + if (rnode->rn_owner > index) + succ = rnode; + break; } - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in rnode %p", - __func__, slot, rnode)); - if (vm_radix_isleaf(child)) - return (vm_radix_topage(child)); - index = vm_radix_trimkey(index, rnode->rn_clev + 1) + - slot * VM_RADIX_UNITLEVEL(rnode->rn_clev); -descend: - KASSERT(rnode->rn_clev > 0, - ("vm_radix_lookup_ge: pushing leaf's parent")); - KASSERT(tos < VM_RADIX_LIMIT, - ("vm_radix_lookup_ge: stack overflow")); - stack[tos++] = rnode; - rnode = child; + slot = vm_radix_slot(index, rnode->rn_clev); + + /* + * Just in case the next search step leads to a subtree of all + * pages with pindex < index, check popmap to see if a next + * bigger step, to a subtree of all pages with pindex > index, + * is available. If so, remember to restart the search here. + */ + if ((rnode->rn_popmap >> slot) > 1) + succ = rnode; + rnode = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); + } + + /* + * Restart the search from the last place visited in the subtree that + * included some pages with pindex > index, if there was such a place. + */ + if (succ == NULL) + return (NULL); + if (succ != rnode) { + /* + * Take a step to the next bigger sibling of the node chosen + * last time. In that subtree, all pages have pindex > index. + */ + slot = vm_radix_slot(index, succ->rn_clev) + 1; + KASSERT((succ->rn_popmap >> slot) != 0, + ("%s: no popmap siblings past slot %d in node %p", + __func__, slot, succ)); + slot += ffs(succ->rn_popmap >> slot) - 1; + succ = vm_radix_node_load(&succ->rn_child[slot], LOCKED); } + + /* + * Find the page in the subtree rooted at "succ" with the least pindex. + */ + while (!vm_radix_isleaf(succ)) { + KASSERT(succ->rn_popmap != 0, + ("%s: no popmap children in node %p", __func__, succ)); + slot = ffs(succ->rn_popmap) - 1; + succ = vm_radix_node_load(&succ->rn_child[slot], LOCKED); + } + return (vm_radix_topage(succ)); } /* - * Look up the nearest entry at a position less than or equal to index. + * Returns the page with the greatest pindex that is less than or equal to the + * specified pindex, or NULL if there are no such pages. + * + * Requires that access be externally synchronized by a lock. */ vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index) { - struct vm_radix_node *stack[VM_RADIX_LIMIT]; + struct vm_radix_node *pred, *rnode; vm_page_t m; - struct vm_radix_node *child, *rnode; -#ifdef INVARIANTS - int loops = 0; -#endif - int slot, tos; + int slot; + /* + * Mirror the implementation of vm_radix_lookup_ge, described above. + */ rnode = vm_radix_root_load(rtree, LOCKED); - if (rnode == NULL) - return (NULL); - else if (vm_radix_isleaf(rnode)) { - m = vm_radix_topage(rnode); - if (m->pindex <= index) - return (m); - else - return (NULL); - } - tos = 0; - for (;;) { - /* - * If the keys differ before the current bisection node, - * then the search key might rollback to the earliest - * available bisection node or to the largest key - * in the current node (if the owner is smaller than the - * search key). - */ - if (vm_radix_keybarr(rnode, index)) { - if (index > rnode->rn_owner) { - index = rnode->rn_owner + VM_RADIX_COUNT * - VM_RADIX_UNITLEVEL(rnode->rn_clev); - } else { -ascend: - KASSERT(++loops < 1000, - ("vm_radix_lookup_le: too many loops")); - - /* - * Pop nodes from the stack until either the - * stack is empty or a node that could have a - * matching descendant is found. - */ - do { - if (tos == 0) - return (NULL); - rnode = stack[--tos]; - } while (vm_radix_slot(index, - rnode->rn_clev) == 0); - - /* - * The following computation cannot overflow - * because index's slot at the current level - * is greater than 0. - */ - index = vm_radix_trimkey(index, - rnode->rn_clev); - } - index--; - KASSERT(!vm_radix_keybarr(rnode, index), - ("vm_radix_lookup_le: keybarr failed")); - } - slot = vm_radix_slot(index, rnode->rn_clev); - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - if (vm_radix_isleaf(child)) { - m = vm_radix_topage(child); + pred = NULL; + while (rnode != NULL) { + if (vm_radix_isleaf(rnode)) { + m = vm_radix_topage(rnode); if (m->pindex <= index) return (m); - } else if (child != NULL) - goto descend; - - /* Find the last set bit among the first slot bits. */ - slot = fls(rnode->rn_popmap & ((1 << slot) - 1)) - 1; - if (slot < 0) { - /* - * A page or edge smaller than the search slot is not - * found in the current node; ascend to the next - * higher-level node. - */ - goto ascend; + break; } - child = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); - KASSERT(child != NULL, ("%s: bad popmap slot %d in rnode %p", - __func__, slot, rnode)); - if (vm_radix_isleaf(child)) - return (vm_radix_topage(child)); - index = vm_radix_trimkey(index, rnode->rn_clev + 1) + - (slot + 1) * VM_RADIX_UNITLEVEL(rnode->rn_clev) - 1; -descend: - KASSERT(rnode->rn_clev > 0, - ("vm_radix_lookup_le: pushing leaf's parent")); - KASSERT(tos < VM_RADIX_LIMIT, - ("vm_radix_lookup_le: stack overflow")); - stack[tos++] = rnode; - rnode = child; + if (vm_radix_keybarr(rnode, index)) { + if (rnode->rn_owner < index) + pred = rnode; + break; + } + slot = vm_radix_slot(index, rnode->rn_clev); + if ((rnode->rn_popmap & ((1 << slot) - 1)) != 0) + pred = rnode; + rnode = vm_radix_node_load(&rnode->rn_child[slot], LOCKED); + } + if (pred == NULL) + return (NULL); + if (pred != rnode) { + slot = vm_radix_slot(index, pred->rn_clev); + KASSERT((pred->rn_popmap & ((1 << slot) - 1)) != 0, + ("%s: no popmap siblings before slot %d in node %p", + __func__, slot, pred)); + slot = fls(pred->rn_popmap & ((1 << slot) - 1)) - 1; + pred = vm_radix_node_load(&pred->rn_child[slot], LOCKED); + } + while (!vm_radix_isleaf(pred)) { + KASSERT(pred->rn_popmap != 0, + ("%s: no popmap children in node %p", __func__, pred)); + slot = fls(pred->rn_popmap) - 1; + pred = vm_radix_node_load(&pred->rn_child[slot], LOCKED); } + return (vm_radix_topage(pred)); } /* From nobody Wed Jul 19 14:47:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5dw31cqdz4nNnH; Wed, 19 Jul 2023 14:47: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5dw308Wrz3hKB; Wed, 19 Jul 2023 14:47:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B8qOsge/rSMeVraufGPBGhEqzFIzT5ViYsba3UBhuY=; b=wtDI1JHJNPA3+bE7kBlPMYGHhxfibzYVZk9FhTmQ373em6xHRRV5Gvx8z20X2AuOnN2iWh xwC0rjURMTFnX/otct0lyOJsjPsuBvyjviSeIfQo9kyfjywrTWZKESgJ3KvmTkxNYNOk8m lh0LYVu98Hxb73Rtzd5VsmiTGbfOZeJ8+iDFlvxDZEoLchfe14d0q2T+3Yd2+JWklkyaRH 5uLJ0h441ZnjujVK5Ddnwaohmdo5DXo+ExVHUAKcXnTbdb2lounuM+Ng0j5JltoJwG3Fo2 tD42CWBzzEY3r4kNjpibLQRyMilQktqB4Vnd+PAaLo9h56BpiYedhRMLzhLiZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7B8qOsge/rSMeVraufGPBGhEqzFIzT5ViYsba3UBhuY=; b=F0M8A6HyNB/4KisuYJ+7Re+yVo/MDTef69tVRNQ/HkcD63cpe3ZP/mUEmBQRedlipRaTUC OpUUMNZ3UfAkPy8y8Rf/7qSuNvL73wY4U1YoPtzOaGoEfTjAj4SBMylM1qmVLMR2jOVvay pKJzOWVF6Knbh7s9Ueqaw/ODf/bIjEy+IRZU6mRhR66dMeZ+4JseaGdrmzdRmXbYU/QCOs MvAUWyf4OdzBTnWtAYeKubRojTwR97TQo8/1qVim3BFa7LVKXm5DDeRRva0/ZUFO2kvz1P 3gZ7aSPZFAWl9XnQmyQsxHh1rV38KJRJ+qszoMxBTKbtuN9Q2UN2QyCsafMvnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778067; a=rsa-sha256; cv=none; b=nro/F9NyRYQifSCpob28D9XC6yXahcmJ8fZJQ22KSbzzcasWLn0ALa7UAsHYM5mImUfaMU qepm/fpY/O1ggWtN1MSP6tfPzswHNc9lsyDault2oL08gfA3uAZELzr28NtP73NcXBbbGd 7cRSY3wEFF+x3fUWF74MCDOKw4T3Y7K5zCm7AEZ2LOibKPqLWpX+NH5slb45/1C8O835JR omk8r/wozbYTnisLABqeLl/2TXEnKyjVdTz8JYJ5i7nxI9UGS89aaXgCaBkkeJsWpug9kW 2OrJ19cVbtVUr1YXIKY3fqx2z/KvBIOZy+qZkYuvQs+ETohrqgo218dyUTa4Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5dw26KD1zqwD; Wed, 19 Jul 2023 14:47:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JElkXm050423; Wed, 19 Jul 2023 14:47:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JElkmF050422; Wed, 19 Jul 2023 14:47:46 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:47:46 GMT Message-Id: <202307191447.36JElkmF050422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: a122c3c49278 - main - unifdef: Fix case where a multiline comment follows a directive. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a122c3c49278f8247296fdc1c097129e4862e472 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a122c3c49278f8247296fdc1c097129e4862e472 commit a122c3c49278f8247296fdc1c097129e4862e472 Author: Dag-Erling Smørgrav AuthorDate: 2023-07-19 14:25:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-07-19 14:47:23 +0000 unifdef: Fix case where a multiline comment follows a directive. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41026 --- usr.bin/unifdef/tests/Makefile | 1 + usr.bin/unifdef/tests/unifdef_test.sh | 22 ++++++++++++++++++++++ usr.bin/unifdef/unifdef.c | 5 +++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.bin/unifdef/tests/Makefile b/usr.bin/unifdef/tests/Makefile index ddcfbdc6146e..a27c58285c20 100644 --- a/usr.bin/unifdef/tests/Makefile +++ b/usr.bin/unifdef/tests/Makefile @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH= unifdef_test NETBSD_ATF_TESTS_SH= basic_test ${PACKAGE}FILES+= d_basic.in diff --git a/usr.bin/unifdef/tests/unifdef_test.sh b/usr.bin/unifdef/tests/unifdef_test.sh new file mode 100644 index 000000000000..98adef3adfdc --- /dev/null +++ b/usr.bin/unifdef/tests/unifdef_test.sh @@ -0,0 +1,22 @@ +# +# Copyright (c) 2023 Klara, Inc. +# +# SPDX-License-Identifier: BSD-2-Clause +# + +atf_test_case hash_comment +hash_comment_head() { + atf_set descr "multiline comment follows directive" +} +hash_comment_body() { + cat >f < To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 8ada3f78e68f - main - kinst.h: reorder function declarations based on implementation file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 commit 8ada3f78e68fe8827d6c84e9fd5f808f93984ca7 Author: Christos Margiolis AuthorDate: 2023-07-19 14:50:24 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:50:24 +0000 kinst.h: reorder function declarations based on implementation file Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41032 --- sys/cddl/dev/kinst/kinst.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index d2ccac50595c..0a47eb4f3583 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -50,23 +50,26 @@ extern struct kinst_probe_list *kinst_probetab; struct linker_file; struct linker_symval; +/* kinst.c */ volatile void *kinst_memcpy(volatile void *, volatile const void *, size_t); bool kinst_excluded(const char *); -bool kinst_md_excluded(const char *); +void kinst_probe_create(struct kinst_probe *, struct linker_file *); + +/* arch/kinst_isa.c */ int kinst_invop(uintptr_t, struct trapframe *, uintptr_t); +void kinst_patch_tracepoint(struct kinst_probe *, kinst_patchval_t); int kinst_make_probe(struct linker_file *, int, struct linker_symval *, void *); -void kinst_patch_tracepoint(struct kinst_probe *, kinst_patchval_t); -void kinst_probe_create(struct kinst_probe *, struct linker_file *); +int kinst_md_init(void); +void kinst_md_deinit(void); +bool kinst_md_excluded(const char *); +/* trampoline.c */ int kinst_trampoline_init(void); int kinst_trampoline_deinit(void); uint8_t *kinst_trampoline_alloc(int); void kinst_trampoline_dealloc(uint8_t *); -int kinst_md_init(void); -void kinst_md_deinit(void); - #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_KINST); #endif /* MALLOC_DECLARE */ From nobody Wed Jul 19 14:59:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5f9y20Dyz4nTh0; Wed, 19 Jul 2023 14:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5f9x6kBYz3mPK; Wed, 19 Jul 2023 14:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVEU1qaprwaIDKYo3ahxXr0n5/BXwBWKOEafAfkjjrU=; b=TfMy7m5EZT7Z/9GZhgYdSydFw/8MTmjln0nUJleJPqtrxYveXuj9uhXCbBqQyANX3/4/HW gxnaZYfHmnuSfeMvbtsdZ+q06FpVXROldjMWPgnMqreLNlpuQwIgXGMfoDqURNRkh/Lv1s 1kpSJykCUbugLsxk8XyMisTlPzTY2kbX7MmzHRcRceVas/5ln1EdSWpdiR8hLziqFnCo/T a3zULWoXvcJP3SUQbGSPEgCV0aidSRQ+einlaVe6jLkkHkFCWgBDuGfDks861klZB+m3n6 pl3DaHI3/oe7yHwIBmHCqJ1vrIOWd2OsSI73G5+SJaKyFpUXVt8RlHTMRVh9sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RVEU1qaprwaIDKYo3ahxXr0n5/BXwBWKOEafAfkjjrU=; b=AU7xk0WS7Mv7aCHuDjRppsousE4bc6NvC2kyztQuGxA/urzEOapN1QRQEPpA2eHejZtetx z51DzYsP+TBHiH4dAfRmWIr+j2DIwshIKKlTHy5IrYZjXAyYjsq9kJA23cpoL4IlYeChWv ax0uxPdyjr2Vnf3bGlBMRpdxzXJudo3gyNNDPz93/PnNmlDN7Vv1YLGHrdVc80UDhpX5/t QUcH6BbrFH1VK1U1zXisWQ2Ds7rDIVIiVbvMgXKnTzMJu5SdOX6Yhgy9rNE9X1lmRuAHg1 Cagvcef5Y/RMgG0im+2VYCdwVA9mei06w4853uGF4ZVbRQY4S8tVHUjGoD39yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778789; a=rsa-sha256; cv=none; b=nWwk/EywZdviBcSu/212yPyi299I6keG+WWnlmCAYm067zTqI5Hmu1jQZWWjhxk2MqeTrs 8FcLHfiRzzNWkBmSG15uWvFx3tO3S309THUro6L72FUzorkCyklStA4/duIdpah27JdUGo Lq6VzkSCGbAvF8QzO/49xM7EAORztpecwBrQsaj2ZbRCaThKlML8WYGubnaE4e0xZbvuPy M0Hj85ja6HiDJM/fkg05e2ST3/P1XoRiW/ELCcNQLirMXgbzBjN1xnq+ptuxjporAPvB0e 8KozcjoupUInEbZiyhfh2eLyUNmQXU0kDbeXO4d8UQM+QBCAr5mdLC9FNFuBYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5f9x5QDXzrh6; Wed, 19 Jul 2023 14:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExn7M067548; Wed, 19 Jul 2023 14:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExn2c067547; Wed, 19 Jul 2023 14:59:49 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:49 GMT Message-Id: <202307191459.36JExn2c067547@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: ea89133dbc5f - main - kinst: check for 'push %rbp' anywhere in the function List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e commit ea89133dbc5f29cbb8db48ecc09a47ea22d8aa9e Author: Christos Margiolis AuthorDate: 2023-07-19 14:53:08 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:53:08 +0000 kinst: check for 'push %rbp' anywhere in the function Currently kinst checks if only the first instruction is 'push %rbp', essentially excluding functions that do push RBP, but not in the first instruction. This patch modifies kinst to check for 'push %rbp', as well, as a following 'pop %rbp', anywhere in the function. This behavior also matches that of FBT. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40283 --- sys/cddl/dev/kinst/amd64/kinst_isa.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c index 908dc79e9247..398f30a281c0 100644 --- a/sys/cddl/dev/kinst/amd64/kinst_isa.c +++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c @@ -22,6 +22,7 @@ #include "kinst.h" #define KINST_PUSHL_RBP 0x55 +#define KINST_POPL_RBP 0x5d #define KINST_STI 0xfb #define KINST_POPF 0x9d @@ -500,7 +501,8 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, dtrace_kinst_probedesc_t *pd; const char *func; int error, instrsize, n, off; - uint8_t *instr, *limit; + uint8_t *instr, *limit, *tmp; + bool push_found, pop_found; pd = opaque; func = symval->name; @@ -515,12 +517,21 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, return (0); /* - * Ignore functions not beginning with the usual function prologue. - * These might correspond to exception handlers with which we should not - * meddle. This does however exclude functions which can be safely - * traced, such as cpu_switch(). + * Refuse to instrument functions lacking the usual frame pointer + * manipulations since they might correspond to exception handlers. */ - if (*instr != KINST_PUSHL_RBP) + tmp = instr; + push_found = pop_found = false; + while (tmp < limit) { + if (*tmp == KINST_PUSHL_RBP) + push_found = true; + else if (*tmp == KINST_POPL_RBP) + pop_found = true; + if (push_found && pop_found) + break; + tmp += dtrace_instr_size(tmp); + } + if (!push_found || !pop_found) return (0); n = 0; From nobody Wed Jul 19 14:59:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5f9z4Cm9z4nTrg; Wed, 19 Jul 2023 14:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5f9z0RC1z3mGw; Wed, 19 Jul 2023 14:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSnmx454LLSwzoQykkb2JmPYYG/owJK1XDfiBLWU6go=; b=RCWobkb7N6gTPua71la5Z9J9dr/hnBRJTJ2co+qyMsTtaVier5ZpVn3z3hkPqKPDxD1YMS UbTNELkHiTUIFhg+E/T8SWENH1bPDPlMVYnlMTxg3tKmSl4m7klxrz87yb4aoFjiLYNyaO YyX98jw4Z97///C398hOdklZebj7sfsrENneVII8Uy3H7fazzo75mftDWUwDptRWU/EvGT KGOAdPTr0fOhgDHC5qw6uP/FsjIk4/L9L6sXkzEUfIq7wohke35vWyhZdtjo1+yw8NQUue KLRyVumlYsl6QjtbDHR+wJK2apZpEHc1XrIx5J4LNvd9LDTeY+6LZgs+GSaGvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sSnmx454LLSwzoQykkb2JmPYYG/owJK1XDfiBLWU6go=; b=k/w11jROki3T8FoLeXMYGggkJz070DIxGvWI97UuYSf+vxJdwhDuK6iRFkzhheR+tJ5s9+ c5n4STmQU4JeNn4bEnSjEA5W72aPxkgH0TlWdQzWD2W74ss7ikTu/YriY0xa1MXU7QwbKU aWgP1+HCcnTrUytVKm5X2RMhptRrQadbmASQgBDmeftf60i7KSZWmyo0pRnE9bp1Vcfzdz bb6SOTR6S2eupAaMiAHoC/i4WJzsl9rjDPv4eWrZBk144Ef57hWH3icH0FlQQrAk3/N1pp H3zL8CfCy93VaTrP/ajS5yr1VHQcFtmTCsZKCf6gBxDBnOXksPObDOngyyVFMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778791; a=rsa-sha256; cv=none; b=vrOhNl9UPOcjgsSWBSjbY5wFy4nHtdXR52l2WjD4ntGlJZ9PW3DTpQd+sHWNc+XoYsVQRp cWmRyTTnZsb3UkEmcfR4CECfzUzZfEFITOgLtONZx97omZCiRgNDu7goJ4pzvRes2ja6Gf Wgffg59/aokHEAOKumDOHiqXfdniuszeEez5FcReaKM4m5BGLX9KdIazz4uwoPQXENLyiS eJsYyYSP/foqqo5fuBU0oA5MOMFIXGOKSJQInrr0HL4eZD62Ihdg9KAmUkob1edhdL1Tqr EXAzsGXtTVIRMMepfuFRdjKi5xiGrVP4S8yd+jSIXT3PjaXA8UXdLCT6k2Nwkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5f9y6MK8zrwR; Wed, 19 Jul 2023 14:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExo8f067567; Wed, 19 Jul 2023 14:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExoaw067566; Wed, 19 Jul 2023 14:59:50 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:50 GMT Message-Id: <202307191459.36JExoaw067566@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: eb1413c9a6c7 - main - kinst: exclude cpu_switch List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb1413c9a6c785920421664dedd8e5c23fd89834 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=eb1413c9a6c785920421664dedd8e5c23fd89834 commit eb1413c9a6c785920421664dedd8e5c23fd89834 Author: Christos Margiolis AuthorDate: 2023-07-19 14:56:29 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:56:29 +0000 kinst: exclude cpu_switch Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40985 --- sys/cddl/dev/kinst/kinst.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 1c5b4372055d..4bd3047f49db 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -96,6 +96,13 @@ kinst_excluded(const char *name) if (kinst_md_excluded(name)) return (true); + /* + * cpu_switch() can cause a crash if it modifies the value of curthread + * while in probe context. + */ + if (strcmp(name, "cpu_switch") == 0) + return (true); + /* * Anything beginning with "dtrace_" may be called from probe context * unless it explicitly indicates that it won't be called from probe From nobody Wed Jul 19 14:59:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB02PSjz4nTkF; Wed, 19 Jul 2023 14:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5fB01Dfgz3mN1; Wed, 19 Jul 2023 14:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhWSKzhZ5cgUmfAgm+55T1ACqrZgbmXcwp6anuwaaiI=; b=aBnZIGPawlhbNiKTUaG+dqR37Aq8bVXtSlbXuRrMrM3seSDuKAAccjZiZ8qbuwWwQq9hxC LpJqVK5enbCT+qsoHiqPAwpMrdqbtt1oChAxGJTQ0pLmID3aQoyfAys/WZt4YxAe0cI1gt 4on2+0UE5feopvHEwu62Q5ZGvH9+Gjpvv+iMvkXBcWh8PSApl02zJbaJXCFmON1yPwee+Q huMuZUId/gvkCUR2jbIAtHBWcLuBQ+Mnay03mEnS5JNF4BjrvG9qmFgdQF/5TC7o/bic6M 8xLfX+1Kn6yoet0+bSR3mRwf/6SaKmRFNsP4pSHgA6zydQkxSDZHJbX2d6TfUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhWSKzhZ5cgUmfAgm+55T1ACqrZgbmXcwp6anuwaaiI=; b=pJXgni6z/Tf7mvd3NCSj4Rol4tj69E7RxTfEs/uj3aa2Mx1nUCwxdY5aI9GqXRr2EIeaer W3Z2pBfCmUaUaXLudh1YytSP5I2o174SnhfKUeiyyN65bkC+PKWWlypc/kdyYAGPoubLxw byQ8pCZdGEU3UNjS/Smjq4wNxCI+toAv9lh6+rMmHIYg/EFQUIJLrAlrEtAj05pGPxYV2G XGJXVrdR7Xr7cym9ELGrVIZZqLXgAd2ZEfg/p2QQabF51dzqDFXxvfwqo62GjxZ1uLTQDF jFe1ZfizBtw6Zdh6fSIXmSxWqO1vzkdQ870VXE1W2BxcpLx0yfZm5JBoSLzxXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778792; a=rsa-sha256; cv=none; b=rXMSU0phZllOQ+D7CLhy7toDt9t1GCe30p707VKXFsjmNofFD3/UTYVhZa0yD0diTvymJJ xfImvYjU060IphpRcQQq1Z+leHhWQx+Ybby399th10RnNZJNmOK46G+yG1CXI0XnZYgLBO /n8CxevJ+kENYXroQtBS/1z/FMhToiBWsRfyg59RLxFkqERQQ5EsXGjzEkniYJNTcOuM8K uY146qmF47lQLwGHdlK7iTpdaf6R/cqNB+Rv2ljgpuVrHrtmazz16mT0bEkwVIyCFbaJMD PuIeiRs2k55gYmJQFk7rNvAn3rDaqUlI4zY6v/yEF/fipepBnuYN39Ihajco5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5fB00B9Szs6s; Wed, 19 Jul 2023 14:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExpeC067586; Wed, 19 Jul 2023 14:59:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExpHT067585; Wed, 19 Jul 2023 14:59:51 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:51 GMT Message-Id: <202307191459.36JExpHT067585@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: 5b701ed19c2e - main - kinst: start moving towards per-probe trampolines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b701ed19c2ed439457b0177681472aac21fde94 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5b701ed19c2ed439457b0177681472aac21fde94 commit 5b701ed19c2ed439457b0177681472aac21fde94 Author: Christos Margiolis AuthorDate: 2023-07-19 14:57:21 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:57:21 +0000 kinst: start moving towards per-probe trampolines Using per-CPU and per-thread trampolines is expensive and error-prone, since we're rewriting the same memory blocks constantly. Per-probe trampolines solve this problem by giving each probe its own block of executable memory, which more or less remains the same after the initial write. What this patch does, is get rid of the initialization code which allocates a trampoline for each thread, and instead let each port of kinst allocate a trampoline for each new probe created. It also sets up the infrastructure needed to support the new trampoline scheme. This change is not currently supported on amd64, as the amd64 port needs further changes to work, so this is a temporary/gradual patch to fix the riscv and arm64 ports. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40962 --- sys/cddl/dev/kinst/kinst.c | 3 +++ sys/cddl/dev/kinst/kinst.h | 28 ++++++++++++++++++++++++++++ sys/cddl/dev/kinst/trampoline.c | 35 ++++++++++++++++++++++++++++++----- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c index 4bd3047f49db..60400a452b95 100644 --- a/sys/cddl/dev/kinst/kinst.c +++ b/sys/cddl/dev/kinst/kinst.c @@ -228,6 +228,9 @@ kinst_destroy(void *arg, dtrace_id_t id, void *parg) struct kinst_probe *kp = parg; LIST_REMOVE(kp, kp_hashnext); +#ifndef __amd64__ + kinst_trampoline_dealloc(kp->kp_tramp); +#endif free(kp, M_KINST); } diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index 0a47eb4f3583..390a2d1c13bf 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -35,10 +35,38 @@ struct kinst_probe { kinst_patchval_t kp_patchval; kinst_patchval_t kp_savedval; kinst_patchval_t *kp_patchpoint; + uint8_t *kp_tramp; struct kinst_probe_md kp_md; }; +struct kinst_cpu_state { + /* + * kinst uses a breakpoint to return from the trampoline and resume + * execution. To do this safely, kinst implements a per-CPU state + * machine; the state is set to KINST_PROBE_FIRED for the duration of + * the trampoline execution (i.e from the time we transfer execution to + * it, until we return). Upon return, the state is set to + * KINST_PROBE_ARMED to indicate that a probe is not currently firing. + * All CPUs have their state initialized to KINST_PROBE_ARMED when + * kinst is loaded. + */ + enum { + KINST_PROBE_ARMED, + KINST_PROBE_FIRED, + } state; + /* + * Points to the probe whose trampoline we're currently executing. + */ + struct kinst_probe *kp; + /* + * Because we execute trampolines with interrupts disabled, we have to + * cache the CPU's status in order to restore it when we return from + * the trampoline. + */ + uint64_t status; +}; + LIST_HEAD(kinst_probe_list, kinst_probe); extern struct kinst_probe_list *kinst_probetab; diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 87c01e39745b..adc4eaa7fceb 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -49,8 +49,10 @@ static TAILQ_HEAD(, trampchunk) kinst_trampchunks = TAILQ_HEAD_INITIALIZER(kinst_trampchunks); static struct sx kinst_tramp_sx; SX_SYSINIT(kinst_tramp_sx, &kinst_tramp_sx, "kinst tramp"); +#ifdef __amd64__ static eventhandler_tag kinst_thread_ctor_handler; static eventhandler_tag kinst_thread_dtor_handler; +#endif /* * Fill the trampolines with KINST_TRAMP_FILL_PATTERN so that the kernel will @@ -150,12 +152,14 @@ kinst_trampoline_alloc_locked(int how) if ((how & M_NOWAIT) != 0) return (NULL); - /* - * We didn't find any free trampoline in the current list, - * allocate a new one. If that fails the provider will no - * longer be reliable, so try to warn the user. - */ if ((chunk = kinst_trampchunk_alloc()) == NULL) { +#ifdef __amd64__ + /* + * We didn't find any free trampoline in the current + * list, allocate a new one. If that fails the + * provider will no longer be reliable, so try to warn + * the user. + */ static bool once = true; if (once) { @@ -164,6 +168,7 @@ kinst_trampoline_alloc_locked(int how) "kinst: failed to allocate trampoline, " "probes may not fire"); } +#endif return (NULL); } off = 0; @@ -220,6 +225,7 @@ kinst_trampoline_dealloc(uint8_t *tramp) sx_xunlock(&kinst_tramp_sx); } +#ifdef __amd64__ static void kinst_thread_ctor(void *arg __unused, struct thread *td) { @@ -240,10 +246,12 @@ kinst_thread_dtor(void *arg __unused, struct thread *td) */ kinst_trampoline_dealloc(tramp); } +#endif int kinst_trampoline_init(void) { +#ifdef __amd64__ struct proc *p; struct thread *td; void *tramp; @@ -296,12 +304,21 @@ retry: out: sx_xunlock(&kinst_tramp_sx); sx_sunlock(&allproc_lock); +#else + int error = 0; + + sx_xlock(&kinst_tramp_sx); + TAILQ_INIT(&kinst_trampchunks); + sx_xunlock(&kinst_tramp_sx); +#endif + return (error); } int kinst_trampoline_deinit(void) { +#ifdef __amd64__ struct trampchunk *chunk, *tmp; struct proc *p; struct thread *td; @@ -324,6 +341,14 @@ kinst_trampoline_deinit(void) TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp) kinst_trampchunk_free(chunk); sx_xunlock(&kinst_tramp_sx); +#else + struct trampchunk *chunk, *tmp; + + sx_xlock(&kinst_tramp_sx); + TAILQ_FOREACH_SAFE(chunk, &kinst_trampchunks, next, tmp) + kinst_trampchunk_free(chunk); + sx_xunlock(&kinst_tramp_sx); +#endif return (0); } From nobody Wed Jul 19 14:59:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB12jktz4nTrq; Wed, 19 Jul 2023 14:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5fB11k5pz3mVs; Wed, 19 Jul 2023 14:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uT3jS0eyj8/neeZRFzOHMtVKF6XaNb2kIjVDRs5xnOU=; b=YWKPJC6rjPg0o6Kk5sqXd4lVSjkMQFYNi0qFqIzuMeHEDuLf5PWCN1BbDo0P850pbh6WuU 07fdUGxAHa8ufu+5RrurAcGkNLrjMmlgWzgOgr1h//sy+E10VNiYVXbEDlyU1R+KNSSQNP eB5PP5kWUNKwpdLefbfLqXP7Jaw/HDoPHBYV7QkCboIkgIojB3b6NzhJduvV3zTzLEjrAb p39fE6/uEMl8uEN2Bp/QipXp8xhDI42iRJ+T1ne1z6xT3rgloNvzqdt1PJ6KYkc4Wwp6kx e2A6hR4wvQsjHC+FOBAL9GtXY9/bpWpamvyknviO8kAmy4dXX+mdBCMdTEeu9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uT3jS0eyj8/neeZRFzOHMtVKF6XaNb2kIjVDRs5xnOU=; b=TVWvxA64fFyJTV/HqsVFrsAgpd8S0DxQpICQVLUzJ7JOfb/H/YF3nrHA6SrCvcGbjAa/jb JcFd+zd1+fKD+WsbymemIyYaepFTixqBUQVuu8L+iGD+z5GNUBbs2LiB8HGkLjkW++gLLr J5YQs2lgi8Z/2gLB2QGZrvch5QUcmGym3CGktM8gv0IgbJd4N46LmaKNklVq1iuf8MAC58 P0ffRGtHwmdump+yRnTW4w1yhz1JWhVpSrHz/MrnD4ofnw2KIY7rgf2dvhNYntJBLErYeS pmbM+r+QKEt71eyjnkeY9Y0VyOUX49Cauqu2pIiM0AM7LLcCuGzhF5BJRiSgAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778793; a=rsa-sha256; cv=none; b=gQK63FL5LStsw5z8BNjOyAt95Ln30wrczZBm7u14YUaJjoI+5xPqu2uRk/5+wI2CKF7wK/ ToOe841wGLV5rvbTq6S+OgSZbHj+Br81jNH5nnuOlFDRjYbNVXPFDANfQf31cwSwU0VnsA mSnTiOpiW4c5MKMwPfJLU2td2W1r9P5UzAby5J+X4wm1MCLP6bwTP/pf2P2FiwZF+/+CE9 QDZL5xMXC/4NiUut64T9keXKBQLUmpjfm7yEWuF53qnS48+Ntb4dTlg+c9ZNwIawCCvIf6 xXM0I8SOPmp/n3aCGnXCrrpVVW+P9skJwkoqEx30tIFTuZ8coY1YFTBAq3yK+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 4R5fB10pzBzrkH; Wed, 19 Jul 2023 14:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExrSs067605; Wed, 19 Jul 2023 14:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExr0H067604; Wed, 19 Jul 2023 14:59:53 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:53 GMT Message-Id: <202307191459.36JExr0H067604@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: 2517b2085b58 - main - kinst: use per-probe trampolines in riscv List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2517b2085b58e0ca4837faecd94b91ad80872547 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2517b2085b58e0ca4837faecd94b91ad80872547 commit 2517b2085b58e0ca4837faecd94b91ad80872547 Author: Christos Margiolis AuthorDate: 2023-07-19 14:57:59 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:57:59 +0000 kinst: use per-probe trampolines in riscv Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40963 --- sys/cddl/dev/kinst/riscv/kinst_isa.c | 113 +++++++++++++---------------------- 1 file changed, 42 insertions(+), 71 deletions(-) diff --git a/sys/cddl/dev/kinst/riscv/kinst_isa.c b/sys/cddl/dev/kinst/riscv/kinst_isa.c index 8bd4449a027a..9c1f4a239f83 100644 --- a/sys/cddl/dev/kinst/riscv/kinst_isa.c +++ b/sys/cddl/dev/kinst/riscv/kinst_isa.c @@ -14,20 +14,7 @@ #include "kinst.h" -/* - * Per-CPU trampolines used when the interrupted thread is executing with - * interrupts disabled. If an interrupt is raised while executing a trampoline, - * the interrupt thread cannot safely overwrite its trampoline if it hits a - * kinst probe while executing the interrupt handler. - */ -DPCPU_DEFINE_STATIC(uint8_t *, intr_tramp); - -/* - * The double-breakpoint mechanism needs to save the current probe for the next - * call to kinst_invop(). As with per-CPU trampolines, this also has to be done - * per-CPU when interrupts are disabled. - */ -DPCPU_DEFINE_STATIC(struct kinst_probe *, intr_probe); +DPCPU_DEFINE_STATIC(struct kinst_cpu_state, kinst_state); #define _MATCH_REG(reg) \ (offsetof(struct trapframe, tf_ ## reg) / sizeof(register_t)) @@ -78,7 +65,7 @@ kinst_c_regoff(struct trapframe *frame, int n) #undef _MATCH_REG static int -kinst_emulate(struct trapframe *frame, struct kinst_probe *kp) +kinst_emulate(struct trapframe *frame, const struct kinst_probe *kp) { kinst_patchval_t instr = kp->kp_savedval; register_t prevpc; @@ -244,23 +231,23 @@ kinst_emulate(struct trapframe *frame, struct kinst_probe *kp) } static int -kinst_jump_next_instr(struct trapframe *frame, struct kinst_probe *kp) +kinst_jump_next_instr(struct trapframe *frame, const struct kinst_probe *kp) { - frame->tf_sepc = (register_t)((uint8_t *)kp->kp_patchpoint + + frame->tf_sepc = (register_t)((const uint8_t *)kp->kp_patchpoint + kp->kp_md.instlen); return (MATCH_C_NOP); } static void -kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) +kinst_trampoline_populate(struct kinst_probe *kp) { static uint16_t nop = MATCH_C_NOP; static uint32_t ebreak = MATCH_EBREAK; int ilen; ilen = kp->kp_md.instlen; - kinst_memcpy(tramp, &kp->kp_savedval, ilen); + kinst_memcpy(kp->kp_tramp, &kp->kp_savedval, ilen); /* * Since we cannot encode large displacements in a single instruction @@ -273,9 +260,9 @@ kinst_trampoline_populate(struct kinst_probe *kp, uint8_t *tramp) * Add a NOP after a compressed instruction for padding. */ if (ilen == INSN_C_SIZE) - kinst_memcpy(&tramp[ilen], &nop, INSN_C_SIZE); + kinst_memcpy(&kp->kp_tramp[ilen], &nop, INSN_C_SIZE); - kinst_memcpy(&tramp[INSN_SIZE], &ebreak, INSN_SIZE); + kinst_memcpy(&kp->kp_tramp[INSN_SIZE], &ebreak, INSN_SIZE); fence_i(); } @@ -306,27 +293,26 @@ int kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) { solaris_cpu_t *cpu; - struct kinst_probe *kp; - uint8_t *tramp; + struct kinst_cpu_state *ks; + const struct kinst_probe *kp; - /* - * Use per-CPU trampolines and probes if the thread executing the - * instruction was executing with interrupts disabled. - */ - if ((frame->tf_sstatus & SSTATUS_SPIE) == 0) { - tramp = DPCPU_GET(intr_tramp); - kp = DPCPU_GET(intr_probe); - } else { - tramp = curthread->t_kinst_tramp; - kp = curthread->t_kinst_curprobe; - } + ks = DPCPU_PTR(kinst_state); /* * Detect if the breakpoint was triggered by the trampoline, and * manually set the PC to the next instruction. */ - if (addr == (uintptr_t)(tramp + INSN_SIZE)) - return (kinst_jump_next_instr(frame, kp)); + if (ks->state == KINST_PROBE_FIRED && + addr == (uintptr_t)(ks->kp->kp_tramp + INSN_SIZE)) { + /* + * Restore interrupts if they were enabled prior to the first + * breakpoint. + */ + if ((ks->status & SSTATUS_SPIE) != 0) + frame->tf_sstatus |= SSTATUS_SPIE; + ks->state = KINST_PROBE_ARMED; + return (kinst_jump_next_instr(frame, ks->kp)); + } LIST_FOREACH(kp, KINST_GETPROBE(addr), kp_hashnext) { if ((uintptr_t)kp->kp_patchpoint == addr) @@ -343,26 +329,16 @@ kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) if (kp->kp_md.emulate) return (kinst_emulate(frame, kp)); - if (tramp == NULL) { - /* - * A trampoline allocation failed, so this probe is - * effectively disabled. Restore the original - * instruction. - * - * We can't safely print anything here, but the - * trampoline allocator should have left a breadcrumb in - * the dmesg. - */ - kinst_patch_tracepoint(kp, kp->kp_savedval); - frame->tf_sepc = (register_t)kp->kp_patchpoint; - } else { - kinst_trampoline_populate(kp, tramp); - frame->tf_sepc = (register_t)tramp; - if ((frame->tf_sstatus & SSTATUS_SPIE) == 0) - DPCPU_SET(intr_probe, kp); - else - curthread->t_kinst_curprobe = kp; - } + ks->state = KINST_PROBE_FIRED; + ks->kp = kp; + + /* + * Cache the current SSTATUS and clear interrupts for the + * duration of the double breakpoint. + */ + ks->status = frame->tf_sstatus; + frame->tf_sstatus &= ~SSTATUS_SPIE; + frame->tf_sepc = (register_t)kp->kp_tramp; return (MATCH_C_NOP); } @@ -427,6 +403,9 @@ kinst_instr_dissect(struct kinst_probe *kp, int instrsize) break; } } + + if (!kpmd->emulate) + kinst_trampoline_populate(kp); } static bool @@ -556,6 +535,10 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, kp->kp_patchval = KINST_PATCHVAL; else kp->kp_patchval = KINST_C_PATCHVAL; + if ((kp->kp_tramp = kinst_trampoline_alloc(M_WAITOK)) == NULL) { + KINST_LOG("cannot allocate trampoline for %p", instr); + return (ENOMEM); + } kinst_instr_dissect(kp, instrsize); kinst_probe_create(kp, lf); @@ -571,14 +554,12 @@ cont: int kinst_md_init(void) { - uint8_t *tramp; + struct kinst_cpu_state *ks; int cpu; CPU_FOREACH(cpu) { - tramp = kinst_trampoline_alloc(M_WAITOK); - if (tramp == NULL) - return (ENOMEM); - DPCPU_ID_SET(cpu, intr_tramp, tramp); + ks = DPCPU_PTR(kinst_state); + ks->state = KINST_PROBE_ARMED; } return (0); @@ -587,16 +568,6 @@ kinst_md_init(void) void kinst_md_deinit(void) { - uint8_t *tramp; - int cpu; - - CPU_FOREACH(cpu) { - tramp = DPCPU_ID_GET(cpu, intr_tramp); - if (tramp != NULL) { - kinst_trampoline_dealloc(tramp); - DPCPU_ID_SET(cpu, intr_tramp, NULL); - } - } } /* From nobody Wed Jul 19 14:59:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB23tQ0z4nThW; Wed, 19 Jul 2023 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5fB22fTQz3mkd; Wed, 19 Jul 2023 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFKVei4bXd+wBNcybx2Gwbm4iwkJMeP351Y8qeFUKYs=; b=jL7lQBTkmFSQjXahxW+W0g8zy7W3HMtAgxQw69v42FBMygCXuopvpjpX5SwhGqqYicXN3Q A08nlZpZi+g2ClD6FeNAh3PoI2XSWcvr5Zq6u+ooIO0Q8A4m5BdCjjGHcjnSv3ptF0MQof otCQ8qKbZNfFi0aZkBb8t1mnEwGzrUFiPonAHgAzBwexwwNweMYU5OWt1TwhjFM6BaXM+7 iELAp4PqwpzgCNvt/QE7LvjOeLTNV94M8eI4YzkPbV4pzrWVm5FYnoioHgLN+bLi4PJTtP tQFaTXMoZf6nXZnX3PImE/89k9rrnaDLcp2XZwhh20PuJHUey2htWIFnGmcX/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFKVei4bXd+wBNcybx2Gwbm4iwkJMeP351Y8qeFUKYs=; b=XceWer4iAV1xY103m8pDFvpInV1J0y0Ji+YrWnXcM11a7P1ekVl7yuE39r7GZC6Y+eW9rZ 7B/y6jaUVXHpcJwjdfxJ0g2UdVFqnh2/ihQT8VaAPoOH/oBTYuTdrvdjphKphUkRt9rXEB 9ApLRXZi+nLfzJTbwWc1IY38a5Nthytb8q+z4LGbmGnQ4xkgz3fpGvY5eeli6enKb+Y/PU 39XE9xW5US9ZyiR7HaYbIpfH56Vl+wbfgSf0LE+xvL2qeMtCggoxDg39UmR5mP2MsuYN6r WbbwS2IArZR9x3UUQ+F/1DJa2sxghUG67cUBIVJz5wG3uFF24D+daYrzzitB1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778794; a=rsa-sha256; cv=none; b=XD7iMlqMIDD9yjrtViD6tvZCRhrJpm6jZwt0ghaRa6zmsmKZZ9GEUVkXfrCgtwISNBPeec jpzkiMpwPE6BhjFbOYRMi1X8QlkeShvd/Qgg1vhCu+pillVTTGJO4OOepMy8RsTLMTBS47 R1y35xLo25bI6u/mHGmoqPBPwAMve83xRYrFp5MtT1l9G7pQFh40HVZQbw1s1OiJ6XxyR8 N7v/l44n5T/Rx/iPfKgHdSqIH8jXtbZ0jLg7ZR6wNKuPtf6tn41imJCrcR3++acYLHQUY/ LMcNOgFO4man7942OzhKYINqeemUwAzdD7Tt6frDmJ/YZx07ZDWKQwr5CCh2Qg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5fB21lYtzrh7; Wed, 19 Jul 2023 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExstZ067624; Wed, 19 Jul 2023 14:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExsm8067623; Wed, 19 Jul 2023 14:59:54 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:54 GMT Message-Id: <202307191459.36JExsm8067623@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: 07864a8a2466 - main - kinst: port to arm64 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 commit 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 Author: Christos Margiolis AuthorDate: 2023-07-19 14:58:18 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:58:18 +0000 kinst: port to arm64 Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40337 --- sys/cddl/dev/kinst/aarch64/kinst_isa.c | 455 +++++++++++++++++++++++++++++++++ sys/cddl/dev/kinst/aarch64/kinst_isa.h | 26 ++ sys/modules/dtrace/Makefile | 2 +- 3 files changed, 482 insertions(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/aarch64/kinst_isa.c b/sys/cddl/dev/kinst/aarch64/kinst_isa.c new file mode 100644 index 000000000000..bf3ab1d35de3 --- /dev/null +++ b/sys/cddl/dev/kinst/aarch64/kinst_isa.c @@ -0,0 +1,455 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright (c) 2022 Christos Margiolis + * Copyright (c) 2022 Mark Johnston + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + */ + +#include + +#include +#include + +#include "kinst.h" + +DPCPU_DEFINE_STATIC(struct kinst_cpu_state, kinst_state); + +static int +kinst_emulate(struct trapframe *frame, const struct kinst_probe *kp) +{ + kinst_patchval_t instr = kp->kp_savedval; + uint64_t imm; + uint8_t cond, reg, bitpos; + bool res; + + if (((instr >> 24) & 0x1f) == 0b10000) { + /* adr/adrp */ + reg = instr & 0x1f; + imm = (instr >> 29) & 0x3; + imm |= ((instr >> 5) & 0x0007ffff) << 2; + if (((instr >> 31) & 0x1) == 0) { + /* adr */ + if (imm & 0x0000000000100000) + imm |= 0xfffffffffff00000; + frame->tf_x[reg] = frame->tf_elr + imm; + } else { + /* adrp */ + imm <<= 12; + if (imm & 0x0000000100000000) + imm |= 0xffffffff00000000; + frame->tf_x[reg] = (frame->tf_elr & ~0xfff) + imm; + } + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 26) & 0x3f) == 0b000101) { + /* b */ + imm = instr & 0x03ffffff; + if (imm & 0x0000000002000000) + imm |= 0xfffffffffe000000; + frame->tf_elr += imm << 2; + } else if (((instr >> 24) & 0xff) == 0b01010100) { + /* b.cond */ + imm = (instr >> 5) & 0x0007ffff; + if (imm & 0x0000000000040000) + imm |= 0xfffffffffffc0000; + cond = instr & 0xf; + switch ((cond >> 1) & 0x7) { + case 0b000: /* eq/ne */ + res = (frame->tf_spsr & PSR_Z) != 0; + break; + case 0b001: /* cs/cc */ + res = (frame->tf_spsr & PSR_C) != 0; + break; + case 0b010: /* mi/pl */ + res = (frame->tf_spsr & PSR_N) != 0; + break; + case 0b011: /* vs/vc */ + res = (frame->tf_spsr & PSR_V) != 0; + break; + case 0b100: /* hi/ls */ + res = ((frame->tf_spsr & PSR_C) != 0) && + ((frame->tf_spsr & PSR_Z) == 0); + break; + case 0b101: /* ge/lt */ + res = ((frame->tf_spsr & PSR_N) != 0) == + ((frame->tf_spsr & PSR_V) != 0); + break; + case 0b110: /* gt/le */ + res = ((frame->tf_spsr & PSR_Z) == 0) && + (((frame->tf_spsr & PSR_N) != 0) == + ((frame->tf_spsr & PSR_V) != 0)); + break; + case 0b111: /* al */ + res = 1; + break; + } + if ((cond & 0x1) && cond != 0b1111) + res = !res; + if (res) + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 26) & 0x3f) == 0b100101) { + /* bl */ + imm = instr & 0x03ffffff; + if (imm & 0x0000000002000000) + imm |= 0xfffffffffe000000; + frame->tf_lr = frame->tf_elr + INSN_SIZE; + frame->tf_elr += imm << 2; + } else if (((instr >> 25) & 0x3f) == 0b011010) { + /* cbnz/cbz */ + cond = (instr >> 24) & 0x1; + reg = instr & 0x1f; + imm = (instr >> 5) & 0x0007ffff; + if (imm & 0x0000000000040000) + imm |= 0xfffffffffffc0000; + if (cond == 1 && frame->tf_x[reg] != 0) + /* cbnz */ + frame->tf_elr += imm << 2; + else if (cond == 0 && frame->tf_x[reg] == 0) + /* cbz */ + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } else if (((instr >> 25) & 0x3f) == 0b011011) { + /* tbnz/tbz */ + cond = (instr >> 24) & 0x1; + reg = instr & 0x1f; + bitpos = (instr >> 19) & 0x1f; + bitpos |= ((instr >> 31) & 0x1) << 5; + imm = (instr >> 5) & 0x3fff; + if (imm & 0x0000000000002000) + imm |= 0xffffffffffffe000; + if (cond == 1 && (frame->tf_x[reg] & (1 << bitpos)) != 0) + /* tbnz */ + frame->tf_elr += imm << 2; + else if (cond == 0 && (frame->tf_x[reg] & (1 << bitpos)) == 0) + /* tbz */ + frame->tf_elr += imm << 2; + else + frame->tf_elr += INSN_SIZE; + } + + return (0); +} + +static int +kinst_jump_next_instr(struct trapframe *frame, const struct kinst_probe *kp) +{ + frame->tf_elr = (register_t)((const uint8_t *)kp->kp_patchpoint + + INSN_SIZE); + + return (0); +} + +static void +kinst_trampoline_populate(struct kinst_probe *kp) +{ + static uint32_t bpt = KINST_PATCHVAL; + + kinst_memcpy(kp->kp_tramp, &kp->kp_savedval, INSN_SIZE); + kinst_memcpy(&kp->kp_tramp[INSN_SIZE], &bpt, INSN_SIZE); + + cpu_icache_sync_range((vm_offset_t)kp->kp_tramp, + (vm_size_t)KINST_TRAMP_SIZE); +} + +/* + * There are two ways by which an instruction is traced: + * + * - By using the trampoline. + * - By emulating it in software (see kinst_emulate()). + * + * The trampoline is used for instructions that can be copied and executed + * as-is without additional modification. However, instructions that use + * PC-relative addressing have to be emulated, because ARM64 doesn't allow + * encoding of large displacements in a single instruction, and since we cannot + * clobber a register in order to encode the two-instruction sequence needed to + * create large displacements, we cannot use the trampoline at all. + * Fortunately, the instructions are simple enough to be emulated in just a few + * lines of code. + * + * The problem discussed above also means that, unlike amd64, we cannot encode + * a far-jump back from the trampoline to the next instruction. The mechanism + * employed to achieve this functionality, is to use a breakpoint instead of a + * jump after the copied instruction. This breakpoint is detected and handled + * by kinst_invop(), which performs the jump back to the next instruction + * manually (see kinst_jump_next_instr()). + */ +int +kinst_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch) +{ + solaris_cpu_t *cpu; + struct kinst_cpu_state *ks; + const struct kinst_probe *kp; + + ks = DPCPU_PTR(kinst_state); + + /* + * Detect if the breakpoint was triggered by the trampoline, and + * manually set the PC to the next instruction. + */ + if (ks->state == KINST_PROBE_FIRED && + addr == (uintptr_t)(ks->kp->kp_tramp + INSN_SIZE)) { + /* + * Restore interrupts if they were enabled prior to the first + * breakpoint. + */ + if ((ks->status & PSR_I) == 0) + frame->tf_spsr &= ~PSR_I; + ks->state = KINST_PROBE_ARMED; + return (kinst_jump_next_instr(frame, ks->kp)); + } + + LIST_FOREACH(kp, KINST_GETPROBE(addr), kp_hashnext) { + if ((uintptr_t)kp->kp_patchpoint == addr) + break; + } + if (kp == NULL) + return (0); + + cpu = &solaris_cpu[curcpu]; + cpu->cpu_dtrace_caller = addr; + dtrace_probe(kp->kp_id, 0, 0, 0, 0, 0); + cpu->cpu_dtrace_caller = 0; + + if (kp->kp_md.emulate) + return (kinst_emulate(frame, kp)); + + ks->state = KINST_PROBE_FIRED; + ks->kp = kp; + + /* + * Cache the current SPSR and clear interrupts for the duration + * of the double breakpoint. + */ + ks->status = frame->tf_spsr; + frame->tf_spsr |= PSR_I; + frame->tf_elr = (register_t)kp->kp_tramp; + + return (0); +} + +void +kinst_patch_tracepoint(struct kinst_probe *kp, kinst_patchval_t val) +{ + vm_offset_t addr; + + if (!arm64_get_writable_addr((vm_offset_t)kp->kp_patchpoint, &addr)) + panic("%s: Unable to write new instruction", __func__); + *(kinst_patchval_t *)addr = val; + cpu_icache_sync_range((vm_offset_t)kp->kp_patchpoint, + (vm_size_t)INSN_SIZE); +} + +static void +kinst_instr_dissect(struct kinst_probe *kp) +{ + struct kinst_probe_md *kpmd; + kinst_patchval_t instr = kp->kp_savedval; + + kpmd = &kp->kp_md; + kpmd->emulate = false; + + if (((instr >> 24) & 0x1f) == 0b10000) + kpmd->emulate = true; /* adr/adrp */ + else if (((instr >> 26) & 0x3f) == 0b000101) + kpmd->emulate = true; /* b */ + else if (((instr >> 24) & 0xff) == 0b01010100) + kpmd->emulate = true; /* b.cond */ + else if (((instr >> 26) & 0x3f) == 0b100101) + kpmd->emulate = true; /* bl */ + else if (((instr >> 25) & 0x3f) == 0b011010) + kpmd->emulate = true; /* cbnz/cbz */ + else if (((instr >> 25) & 0x3f) == 0b011011) + kpmd->emulate = true; /* tbnz/tbz */ + + if (!kpmd->emulate) + kinst_trampoline_populate(kp); +} + +static bool +kinst_instr_ldx(kinst_patchval_t instr) +{ + if (((instr >> 22) & 0xff) == 0b00100001) + return (true); + + return (false); +} + +static bool +kinst_instr_stx(kinst_patchval_t instr) +{ + if (((instr >> 22) & 0xff) == 0b00100000) + return (true); + + return (false); +} + +int +kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, + void *opaque) +{ + struct kinst_probe *kp; + dtrace_kinst_probedesc_t *pd; + const char *func; + kinst_patchval_t *instr, *limit, *tmp; + int n, off; + bool ldxstx_block, found; + + pd = opaque; + func = symval->name; + + if (kinst_excluded(func)) + return (0); + if (strcmp(func, pd->kpd_func) != 0) + return (0); + + instr = (kinst_patchval_t *)(symval->value); + limit = (kinst_patchval_t *)(symval->value + symval->size); + if (instr >= limit) + return (0); + + tmp = instr; + + /* + * Ignore any bti instruction at the start of the function + * we need to keep it there for any indirect branches calling + * the function on Armv8.5+ + */ + if ((*tmp & BTI_MASK) == BTI_INSTR) + tmp++; + + /* Look for stp (pre-indexed) operation */ + found = false; + + /* + * If the first instruction is a nop it's a specially marked + * asm function. We only support a nop first as it's not a normal + * part of the function prologue. + */ + if (*tmp == NOP_INSTR) + found = true; + for (; !found && tmp < limit; tmp++) { + /* + * Functions start with "stp xt1, xt2, [xn, ]!" or + * "sub sp, sp, ". + * + * Sometimes the compiler will have a sub instruction that is + * not of the above type so don't stop if we see one. + */ + if ((*tmp & LDP_STP_MASK) == STP_64) { + /* + * Assume any other store of this type means we are + * past the function prolog. + */ + if (((*tmp >> ADDR_SHIFT) & ADDR_MASK) == 31) + found = true; + } else if ((*tmp & SUB_MASK) == SUB_INSTR && + ((*tmp >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*tmp >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) + found = true; + } + + if (!found) + return (0); + + ldxstx_block = false; + for (n = 0; instr < limit; instr++) { + off = (int)((uint8_t *)instr - (uint8_t *)symval->value); + + /* + * Skip LDX/STX blocks that contain atomic operations. If a + * breakpoint is placed in a LDX/STX block, we violate the + * operation and the loop might fail. + */ + if (kinst_instr_ldx(*instr)) + ldxstx_block = true; + else if (kinst_instr_stx(*instr)) { + ldxstx_block = false; + continue; + } + if (ldxstx_block) + continue; + + /* + * XXX: Skip ADR and ADRP instructions. The arm64 exception + * handler has a micro-optimization where it doesn't restore + * callee-saved registers when returning from exceptions in + * EL1. This results in a panic when the kinst emulation code + * modifies one of those registers. + */ + if (((*instr >> 24) & 0x1f) == 0b10000) + continue; + + if (pd->kpd_off != -1 && off != pd->kpd_off) + continue; + + /* + * Prevent separate dtrace(1) instances from creating copies of + * the same probe. + */ + LIST_FOREACH(kp, KINST_GETPROBE(instr), kp_hashnext) { + if (strcmp(kp->kp_func, func) == 0 && + strtol(kp->kp_name, NULL, 10) == off) + return (0); + } + if (++n > KINST_PROBETAB_MAX) { + KINST_LOG("probe list full: %d entries", n); + return (ENOMEM); + } + kp = malloc(sizeof(struct kinst_probe), M_KINST, + M_WAITOK | M_ZERO); + kp->kp_func = func; + snprintf(kp->kp_name, sizeof(kp->kp_name), "%d", off); + kp->kp_patchpoint = instr; + kp->kp_savedval = *instr; + kp->kp_patchval = KINST_PATCHVAL; + if ((kp->kp_tramp = kinst_trampoline_alloc(M_WAITOK)) == NULL) { + KINST_LOG("cannot allocate trampoline for %p", instr); + return (ENOMEM); + } + + kinst_instr_dissect(kp); + kinst_probe_create(kp, lf); + } + if (ldxstx_block) + KINST_LOG("warning: unterminated LDX/STX block"); + + return (0); +} + +int +kinst_md_init(void) +{ + struct kinst_cpu_state *ks; + int cpu; + + CPU_FOREACH(cpu) { + ks = DPCPU_PTR(kinst_state); + ks->state = KINST_PROBE_ARMED; + } + + return (0); +} + +void +kinst_md_deinit(void) +{ +} + +/* + * Exclude machine-dependent functions that are not safe-to-trace. + */ +bool +kinst_md_excluded(const char *name) +{ + if (strcmp(name, "handle_el1h_sync") == 0 || + strcmp(name, "do_el1h_sync") == 0) + return (true); + + return (false); +} diff --git a/sys/cddl/dev/kinst/aarch64/kinst_isa.h b/sys/cddl/dev/kinst/aarch64/kinst_isa.h new file mode 100644 index 000000000000..7e1fd8d123e9 --- /dev/null +++ b/sys/cddl/dev/kinst/aarch64/kinst_isa.h @@ -0,0 +1,26 @@ +/* + * SPDX-License-Identifier: CDDL 1.0 + * + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * under sponsorship from the FreeBSD Foundation. + */ + +#ifndef _KINST_ISA_H_ +#define _KINST_ISA_H_ + +#define KINST_PATCHVAL DTRACE_PATCHVAL + +/* + * The trampoline contains [instruction, brk]. + */ +#define KINST_TRAMP_SIZE 8 + +typedef uint32_t kinst_patchval_t; + +struct kinst_probe_md { + bool emulate; /* emulate in sw */ +}; + +#endif /* _KINST_ISA_H_ */ diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile index e38e2687e8a7..73bbbff80640 100644 --- a/sys/modules/dtrace/Makefile +++ b/sys/modules/dtrace/Makefile @@ -21,7 +21,7 @@ SUBDIR+= fasttrap systrace_linux SUBDIR+= systrace_linux32 SUBDIR+= kinst .endif -.if ${MACHINE_CPUARCH} == "riscv" +.if ${MACHINE_CPUARCH} == "riscv" || ${MACHINE_CPUARCH} == "aarch64" SUBDIR+= kinst .endif .if ${MACHINE_CPUARCH} == "powerpc" From nobody Wed Jul 19 14:59:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5fB34ZZGz4nTf2; Wed, 19 Jul 2023 14:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5fB33YR9z3mcQ; Wed, 19 Jul 2023 14:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR73p0vKXrA8KeKG4f4KHgoffnfXopKfrq04uzO0fS8=; b=JamImZFJ9fuTcfOcIWaIWVbwv0zsFJWzeCr/HM92ojLJvfqb1714TocHnnfWsWSzzG8DdY repf9vpqvq+p5m39xptDVXdkZl70tnq7ODWIX8x/RoAewhcoKGZnwzTRNwpeQgg97Qfp5E w7GbcpqM0d+5sUrUoXYONWdoCYR6Rx2oonMpUAdsFCCTLkhsJfvJ9nLD9g7Dz9p5ViNi4A nRsyZGvPivfowYmlrHvcDVBfe05bhLLQfj8RHk3b8CzDOV08T1CBPOW//K63rrmZI8q3r/ ahmY1xI07yWqwURd6b49p2fenZ3b022H7FyP0A5dhv30dJC7FfgH9m/aJNzjvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689778795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GR73p0vKXrA8KeKG4f4KHgoffnfXopKfrq04uzO0fS8=; b=k20jWc6YIxrYDR8qoSRk4ObkFs7EFZ1FA6Qg8xa+AXJ70yUg93dhuojN+VJnA5iStoo4C4 RaxZ8XccIb0dpTvSdRUkNzvlDsp7hoOMXmNX1bBQk028DogwRZrd8W/NPocw3zp0bGo6fy QaWh2oCJdcpuqnkZmUMwIL+HmsUeNHKVktF7yRFqWLkTPwk9qtko/vvlund7pCKi1Q824G BKCi94KE9vjf+G5dY5/VvQ6xYZPuHuCmYlZ7lnoa2rfs5P7taA4Ea5wa0WD35BTMQ5yOU+ ln/zRX6Ubj1XgrPLkawfU3se8XmQL7YxSGTNQo2cc2IP8fNvdFScVHq3CQe8OA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689778795; a=rsa-sha256; cv=none; b=jr53wfR+fvj/YDmTeiUP+kg4s1QfIdsYZ4T1eecBm9GuaRLs2Es3yMKLHP8qjngYdBBHMy jI++3qgllH68lu3XYERRhALPyKixoLsJ+6WIRZI7zOm7qC+//pA/grUmokKh7gRqjEI2+x W58S6jYxsob5ewGMi1r52/+CrlYbOYCmLMOHFV8BxxWBLz6EL8H1Vs/whgc6otg4jsV+9x 6XOD4QKS2Ig3Ue/tKp0zwkCeFDPYv8XXO7n7+DsBvqXFwVeOZPF0FKKPeHzYOvWZyqkraR yANgct21zD/87dvqcYvCph9PaWlTlpjnHGzoBItOuRDU2WZyIbNRCkQPZExZaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5fB32gV2zs51; Wed, 19 Jul 2023 14:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JExtTV067649; Wed, 19 Jul 2023 14:59:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JExt3J067647; Wed, 19 Jul 2023 14:59:55 GMT (envelope-from git) Date: Wed, 19 Jul 2023 14:59:55 GMT Message-Id: <202307191459.36JExt3J067647@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: e967a9a5d5da - main - Revert "dtrace: cache current probe in kdtrace_thread_t" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 commit e967a9a5d5da7762a0c6832ea36b8ccfe3b33ca2 Author: Christos Margiolis AuthorDate: 2023-07-19 14:58:49 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 14:58:49 +0000 Revert "dtrace: cache current probe in kdtrace_thread_t" This reverts commit 22508c8b6c284ad9ad1385c703e224e1ed3fbd7c. The t_kinst_curprobe field is no longer needed by kinst. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41031 --- sys/cddl/dev/dtrace/dtrace_cddl.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/cddl/dev/dtrace/dtrace_cddl.h b/sys/cddl/dev/dtrace/dtrace_cddl.h index 6a4aba15bfab..720c231bfca8 100644 --- a/sys/cddl/dev/dtrace/dtrace_cddl.h +++ b/sys/cddl/dev/dtrace/dtrace_cddl.h @@ -89,7 +89,6 @@ typedef struct kdtrace_thread { uint64_t td_fasttrap_tp_gen; /* Tracepoint hash table gen. */ struct trapframe *td_dtrace_trapframe; /* Trap frame from invop. */ void *td_kinst_tramp; - void *td_kinst_curprobe; } kdtrace_thread_t; /* @@ -120,7 +119,6 @@ typedef struct kdtrace_thread { #define t_fasttrap_tp_gen td_dtrace->td_fasttrap_tp_gen #define t_dtrace_trapframe td_dtrace->td_dtrace_trapframe #define t_kinst_tramp td_dtrace->td_kinst_tramp -#define t_kinst_curprobe td_dtrace->td_kinst_curprobe #define p_dtrace_helpers p_dtrace->p_dtrace_helpers #define p_dtrace_count p_dtrace->p_dtrace_count #define p_dtrace_probes p_dtrace->p_dtrace_probes From nobody Wed Jul 19 16:05:06 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5gdG2w0xz4ms1h for ; Wed, 19 Jul 2023 16:05: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5gdG1v6fz49s3; Wed, 19 Jul 2023 16:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689782706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DXXMzm+rELAqBR+XR/RgQQe6gbcG3InfA651jz/QX0=; b=O6vCZZl1APpT4iQ9HGkhC3WtX0T1WN8JA9aufrJegrXdTMnzcGOK3qHAfqvBt12per/7uw B8bHuIevtUlfOv+LQMudSMqImztP+jQI7xOAh1rnzJMXFVmL6ASEdQ5eVliHY+oLlWXY7R GWuUUKYreW1CoCcGKKnIZBlhNhleUh/AcR/WEslp9Pe5SgPGcm4MpJCTBlN8ij6g+I3FP3 V1XrwfqxdjzJzEcS7DflF7/+K/tvMr/MXvcXUqB7VgShyw4suQqlU4OWEDgTvfH5oPKQxv wcgSs9QHdRswD3S8iqTIOqdxhU09e38KVbFwsQVgSs1xB8cCILsCDGrJlPgSqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689782706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7DXXMzm+rELAqBR+XR/RgQQe6gbcG3InfA651jz/QX0=; b=vFSch0J0UbiraHxIxI40mZpuikJZ5ibU+05/0FD0Hu+ssEN2aY0eYIa6jh0NEITfUNY5Lz CKTlTCy4xwH+QCkAB1c2dq24A7hx/Jw+z8LSqsWnG6dpeHbJ3lf8aqWOKniKKUtF03m18E 58EcmbxRSpzWA6bCByTzCT47JMZJ+v5Pwh3g5mahwbORi6gcaSLtz9uXlmvQ+a22fFI0sx w2+3OewHCD93tdjHeKHx5ti3ymbb1ls7nRWaE63LNVjSLyQTUC0CdVQR7Uwt7NXEmU6qGs AjGWxZgmDScS+AgZ/6J77m+yhgVsov8sALh+9NlAApJkyN3lynXgnmAER5MUsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689782706; a=rsa-sha256; cv=none; b=D0SCpgzc0kwpz+PNkxzJGPCAGgMbxX/2INol2pALrw8rSMh8qxMLyFSiP5myT4vfTtoR2t elGxHbTOUV+lciZ4jQ3EgRtk3YDE9AZm6gUF7fMicIw8uZzSMUZ47P8v557rPvgRTYESOB xVCZksQtV/TA50LKdBlZV7yxiKZgTqFpfBRo3vIAh/gWwBMl6xrH8+3xSwsW+Oseetq2fD 7JiGxH28vxDZV3HQVL1rV6kt2FWVF6JoBbHd1VmKOB3c7tg5/9mGJJ10y5Qz8jspIabwl6 AanNRRTBYhsqXDBTsjyBgDn2qwOOPE+TrFLryDyPHAx+EQLaOvqFDP6FsOY8Jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5gdG0gz9zvDZ; Wed, 19 Jul 2023 16:05:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JG56in084516; Wed, 19 Jul 2023 16:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JG55ut084515; Wed, 19 Jul 2023 16:05:06 GMT (envelope-from git) Date: Wed, 19 Jul 2023 16:05:06 GMT Message-Id: <202307191605.36JG55ut084515@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 36b354d74be5..e524ba4db420 - vendor/openssh - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openssh X-Git-Reftype: branch X-Git-Commit: e524ba4db420aa72d11792aa317da381eb32fcce X-Git-Oldrev: 36b354d74be5adbb73d7dcd2ceb49b5105145d02 X-Git-Newrev: e524ba4db420aa72d11792aa317da381eb32fcce Auto-Submitted: auto-generated The branch vendor/openssh has been updated by emaste: URL: https://cgit.FreeBSD.org/src/log/?id=36b354d74be5..e524ba4db420 e524ba4db420 Vendor import of OpenSSH 9.3p2 From nobody Wed Jul 19 16:05:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5gdN4tDdz4mrwR for ; Wed, 19 Jul 2023 16:05: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5gdN43PQz4BQh; Wed, 19 Jul 2023 16:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689782712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eajCbeUkteSaut6unmFKK06km1r2stebctGn4tCTiM=; b=lB3FUBT6dy8qZ+kSOlXB/I2PDBwC2RDuy0/2B6gQj4E/d8xLajpKg54DLfKJbnTqyOvK9t XIxJHxNtBf3L8Abx8ZGykNF7GQBFIkPSrUkFweHIOeKleBiwlWBhB3g4Sbe7s3S/eD+Q1z MGNX/AN0DaXvDhHJusC+/vsgaNoIMdMiPIEAbj6obDBRUTUzkmBo0qnuJbUdsy53L8wTLI WOlm0YW+mB3oFE5hnWuMfTCAn1XkdWidxlcxek1zF1BhlBD/nNJ+mF33ymc1NOXd9aKdLn 0trXkIfor9ESy+5xsv7+CYti3xHhnauA1IpHKxbbq2eWRsfKJj6hnIGc4ALm3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689782712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eajCbeUkteSaut6unmFKK06km1r2stebctGn4tCTiM=; b=TEBf/phhRStQ+FqyOIJMdxN22bsZpbvFlGeY5Coyi8rVHmR8nlOV2HgM9vZ2fm37JLQD6a pRNT1bdW4vl6b9RKbLHyPDCwc0EYYaxz+aabNbEY9oJE/I4WWuNoFYnlhFDoF+NBATw8A3 +kbjVH7K6ZjGS4S8dpN7apWEfI+dRlukNE/IKrG3fotAUIQaYRksst0G1/jZxzSLdl1Bwk x74W/QiiCXsWXoM8waC7RwXaszFJ9f7Uh4GMvbtxJHro7zfekKb6+Cbs5YimaGktVTAXs2 /j7sC1d8SbJyfpFDaMBuNbfTsux1zMJQUcMo/8U7Id+hy7lK+scECIFoGrPWEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689782712; a=rsa-sha256; cv=none; b=R7LFbxgFuiSczpQf8YobR/PHpitlGzf5mTjMYhhhuGXmPmAdKuRm1tAJaTA5zlujDrGnzV XeOECzJ9iKgzPt7HgDyX6pCC24lNbaBqkaBmrR03bpW2cbs0s5/XJ5ivE1k9bMa+bHpFhA bGH0yKwBaU+8RPnbSxoXwuCM4bqm7ZcIkj0rJ1dCfDJGg8xGwj8SaG4Q4vFLLWbUYJph7i qXJp5mZEjz+fxFwpdIxEnPTltr3ubn8i1C1YKAOpb9/eYUCymuZ6hAd1v5ZjDl54ukRGYT aYIO08JkDFZXw3F6l3W+FGiLU7FYzNPAIzsaxYefbdbqTTAollCy79Y9TtiVuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5gdN30J1zvDb; Wed, 19 Jul 2023 16:05:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JG5CqL084617; Wed, 19 Jul 2023 16:05:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JG5CW9084616; Wed, 19 Jul 2023 16:05:12 GMT (envelope-from git) Date: Wed, 19 Jul 2023 16:05:12 GMT Message-Id: <202307191605.36JG5CW9084616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Ed Maste Subject: git: 54a8a86f843e - Create tag vendor/openssh/9.3p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/tags/vendor/openssh/9.3p2 X-Git-Reftype: annotated tag X-Git-Commit: 54a8a86f843e1db5a76207376f9bfb81465cbfc0 Auto-Submitted: auto-generated The annotated tag vendor/openssh/9.3p2 has been created by emaste: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/openssh/9.3p2 tag vendor/openssh/9.3p2 Tagger: Ed Maste TaggerDate: 2023-07-19 15:52:30 +0000 Tag OpenSSH 9.3p2 commit e524ba4db420aa72d11792aa317da381eb32fcce Author: Ed Maste AuthorDate: 2023-07-19 15:49:33 +0000 Commit: Ed Maste CommitDate: 2023-07-19 15:49:33 +0000 Vendor import of OpenSSH 9.3p2 From nobody Wed Jul 19 16:44:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hVl24TWz4nSrp; Wed, 19 Jul 2023 16:44:31 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hVk62Ycz4MjZ; Wed, 19 Jul 2023 16:44:30 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:c1c3:905:51d0:8c41]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id 9304271BCEB81; Wed, 19 Jul 2023 18:44:26 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 From: tuexen@freebsd.org In-Reply-To: <202307191459.36JExsm8067623@gitrepo.freebsd.org> Date: Wed, 19 Jul 2023 18:44:26 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> To: Christos Margiolis X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R5hVk62Ycz4MjZ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated > On 19. Jul 2023, at 16:59, Christos Margiolis = wrote: >=20 > The branch main has been updated by christos: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D07864a8a2466b8ab3d6fa6623a7eaaf0= 834c0b51 >=20 > commit 07864a8a2466b8ab3d6fa6623a7eaaf0834c0b51 > Author: Christos Margiolis > AuthorDate: 2023-07-19 14:58:18 +0000 > Commit: Christos Margiolis > CommitDate: 2023-07-19 14:58:18 +0000 >=20 > kinst: port to arm64 >=20 > Reviewed by: markj > Approved by: markj (mentor) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40337 > --- > sys/cddl/dev/kinst/aarch64/kinst_isa.c | 455 = +++++++++++++++++++++++++++++++++ > sys/cddl/dev/kinst/aarch64/kinst_isa.h | 26 ++ > sys/modules/dtrace/Makefile | 2 +- > 3 files changed, 482 insertions(+), 1 deletion(-) >=20 This doesn't compile on my system: =3D=3D=3D> dtrace/kinst (all) cc -target aarch64-unknown-freebsd14.0 = --sysroot=3D/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/tmp = -B/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/tmp/usr/bin -O2 = -pipe -fno-common -D_SYS_VMEM_H_ -D__KERNEL__ -nostdinc -DSMP = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/spl = = -I/usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/zfs = -I/usr/home/tuexen/freebsd-src/sys/cddl/compat/opensolaris = -I/usr/home/tuexen/freebsd-src/sys/cddl/contrib/opensolaris/uts/common = -include = /usr/home/tuexen/freebsd-src/sys/contrib/openzfs/include/os/freebsd/spl/sy= s/ccompile.h -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE = -DKLD_TIED -nostdinc -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst = -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64 = -I/usr/home/tuexen/freebsd-src/sys/cddl/dev/dtrace/aarch64 = -DHAVE_KERNEL_OPTION_HEADERS -include = /usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP/opt_global.h = -I. -I/usr/home/tuexen/freebsd-src/sys = -I/usr/home/tuexen/freebsd-src/sys/contrib/ck/include -fno-common -g = -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC = -fdebug-prefix-map=3D./machine=3D/usr/home/tuexen/freebsd-src/sys/arm64/in= clude -I/usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP = -mstack-protector-guard=3Dsysreg -mstack-protector-guard-reg=3Dsp_el0 = -mstack-protector-guard-offset=3D0 -MD -MF.depend.kinst_isa.o = -MTkinst_isa.o -mgeneral-regs-only -ffixed-x18 -ffreestanding -fwrapv = -fstack-protector -Wall -Wstrict-prototypes -Wmissing-prototypes = -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign = -D__printf__=3D__freebsd_kprintf__ -Wmissing-include-dirs = -fdiagnostics-show-option -Wno-unknown-pragmas = -Wno-error=3Dtautological-compare -Wno-error=3Dempty-body = -Wno-error=3Dparentheses-equality -Wno-error=3Dunused-function = -Wno-error=3Dpointer-sign -Wno-error=3Dshift-negative-value = -Wno-address-of-packed-member -Wno-format-zero-length -std=3Dgnu99 = -include = /usr/home/tuexen/freebsd-src/sys/cddl/compat/opensolaris/sys/debug_compat.= h -c /usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64/kinst_isa.c = -o kinst_isa.o = /usr/home/tuexen/freebsd-src/sys/cddl/dev/kinst/aarch64/kinst_isa.c:223:9:= error: assigning to 'struct kinst_probe *' from 'const struct = kinst_probe *' discards qualifiers = [-Werror,-Wincompatible-pointer-types-discards-qualifiers] ks->kp =3D kp; ^ ~~ 1 error generated. *** Error code 1 Stop. make[5]: stopped in = /usr/home/tuexen/freebsd-src/sys/modules/dtrace/kinst *** Error code 1 Stop. make[4]: stopped in /usr/home/tuexen/freebsd-src/sys/modules/dtrace *** Error code 1 Stop. make[3]: stopped in /usr/home/tuexen/freebsd-src/sys/modules *** Error code 1 Stop. make[2]: stopped in = /usr/obj/usr/home/tuexen/freebsd-src/arm64.aarch64/sys/TCP 3.00 real 1.97 user 1.07 sys *** Error code 1 Stop. make[1]: stopped in /usr/home/tuexen/freebsd-src *** Error code 1 Stop. make: stopped in /usr/home/tuexen/freebsd-src Best regards Michael= From nobody Wed Jul 19 16:54:48 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hkr3vlyz4nZb6; Wed, 19 Jul 2023 16:55:00 +0000 (UTC) (envelope-from christos@freebsd.org) Received: from margiolis.net (mail.margiolis.net [95.179.159.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA512) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hkq58XFz4RNM; Wed, 19 Jul 2023 16:54:59 +0000 (UTC) (envelope-from christos@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=default; bh=C16BGI7fOZjJ vII6R0JsxG3MIz/PZU6b3e1n5wAsHWE=; h=in-reply-to:references:subject:cc: to:from:date; d=margiolis.net; b=RYLu26bObXNleUnU3qRBQYxzrNnK0S0KHmmwp LF4TlQ1m9Ud0XxVhy+JdkOA6apzzTevNjaJ3LcrdClvjrxcC5PyUyb8rgV/gMXzgA3AdE4 Om2GinYr9ysKGm0A+hL65EbxOOrFEV4jbjK0BB9Ib+/qOWx1awPBpJF7Yu22o1BI= Received: from pleb (ppp-94-66-59-15.home.otenet.gr [94.66.59.15]) by margiolis.net (OpenSMTPD) with ESMTPSA id 72060a1c (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Wed, 19 Jul 2023 16:54:50 +0000 (UTC) Date: Wed, 19 Jul 2023 19:54:48 +0300 From: Christos Margiolis To: tuexen@freebsd.org Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 Message-ID: <20230719165448.f45hbzqgg44v4ns3@pleb> References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4R5hkq58XFz4RNM X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:20473, ipnet:95.179.144.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated tuexen@freebsd.org wrote: > This doesn't compile on my system: > [...] Forgot to bring over a recent change to kinst.h from my local branch. Pushing the fix now. Thanks for letting me know and sorry for the inconvenience. Christos From nobody Wed Jul 19 16:57:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hpH17Rhz4nbxk; Wed, 19 Jul 2023 16:57: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hpG6s1sz4SGk; Wed, 19 Jul 2023 16:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689785879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DqFIKuKFd17aV2Fq7TsfRQ/g8dRw2SJaGx12Gfq3hg=; b=k7hETLMEoD4xx3EDQda9ZuSlcgGaZzn9sBLya6smvKDty8d+riHrAHNZcAmn3nR44s94gx djuMR6026cjRqKq3/927LEpJaqUvMUYj8RP2XPmrAy+CjnU7SzhR1hLOU5fj416es1pM/Z zq7l1FBFqLcGcbgzAgt+kr9aVpZzeoS3bOYNXkUXXiW4bTF2ohLuodPjBElsGlJBIHur6+ FkQ+v8zQPTW3OEC8mJVKArV1Iz0MdCE65P7CopdRZwGWmlvRI31BXDu4iwaWXrS9hydO9R 1QjV5lnTOxq5gvWnEl7a72mwXcSamnkT2JKF9UU/0DW60l5dD5KCusHHUrjrwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689785879; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6DqFIKuKFd17aV2Fq7TsfRQ/g8dRw2SJaGx12Gfq3hg=; b=o2lsXx6aPrcGpZ9WpVgMJx3k8ocDxOv8z2Xpc+X1R87ASEjApjVRAPLb4KMn9MV5gVoTTv 3MtR0Z1WbgWZGyVVvp6yWnt0idoVEID4f7ltYM1bkudncMj5oGFUsO/hYlAtG1Fe+W5XzY 2RZTMk+FVO2Cy5EFX/XlKMcM7AGW+cVnGPQyYvE5T+QQMEtkE4lSMNEe8Ccw4Kn7nrf8zP Zu/F+mW899wBcpEq+XkzaTpm0ruJ19H4V3tEVw/+Qm/sJVCYAzn+5EsC88jc/qpaFMBojw 0Lj+fg1nxCgsXpUaLxZkFsz0RIwmHDvtURKQkFGKET4AkWYWofURQ+CFpiKetQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689785879; a=rsa-sha256; cv=none; b=kXUByqbSYe/RQVpoDW+OA52ZxIiCa+y9R50UyCmawlprPg2DsM3Mdzt+m9Ac+R2QSkey8v 6NgXZj9gY3imBTwHA4OwiYpF0oHnX8KeTtDoxeBmsTMv/GSxTlcLcjvk0skhZ0N0DDZ1xE I7wqcrBwPJw85E9CQTHGmlWzhWile+aKgzbvw2Mla4ln8uQX2cg/5CGjmxtj6KVpkqkZYl 9Wr7FghASkmPh3+76bI37Cdmp/EjNOnFWBbLHYXUD7tPL7vBt1B+XWMo3C90SUbKzu0Yij urS4CN+cJmtKRcGJYZjpG2imeCHFlVJWCQieiQY+4JBKH6L9ZBQPPP55mVL1CQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5hpG5w2BzwGr; Wed, 19 Jul 2023 16:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JGvwOh066705; Wed, 19 Jul 2023 16:57:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JGvwUN066704; Wed, 19 Jul 2023 16:57:58 GMT (envelope-from git) Date: Wed, 19 Jul 2023 16:57:58 GMT Message-Id: <202307191657.36JGvwUN066704@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: 02402ec88896 - main - kinst.h: make pointer to probe in kinst_cpu_state const List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02402ec88896eda56be4ae41779ddc719f6b0e9d Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=02402ec88896eda56be4ae41779ddc719f6b0e9d commit 02402ec88896eda56be4ae41779ddc719f6b0e9d Author: Christos Margiolis AuthorDate: 2023-07-19 16:56:10 +0000 Commit: Christos Margiolis CommitDate: 2023-07-19 16:57:44 +0000 kinst.h: make pointer to probe in kinst_cpu_state const Fixes: 5b701ed19c2e ("kinst: start moving towards per-probe trampolines") Sponsored by: The FreeBSD Foundation --- sys/cddl/dev/kinst/kinst.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h index 390a2d1c13bf..f0811a4a88d8 100644 --- a/sys/cddl/dev/kinst/kinst.h +++ b/sys/cddl/dev/kinst/kinst.h @@ -58,7 +58,7 @@ struct kinst_cpu_state { /* * Points to the probe whose trampoline we're currently executing. */ - struct kinst_probe *kp; + const struct kinst_probe *kp; /* * Because we execute trampolines with interrupts disabled, we have to * cache the CPU's status in order to restore it when we return from From nobody Wed Jul 19 17:01:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5htD0Pdpz4ndN2; Wed, 19 Jul 2023 17:01: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5htC6bqfz4Td7; Wed, 19 Jul 2023 17:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMSQbDIlUIIlfYPhnKcNIFC6xndMZ8ajTIZHxPxY3Do=; b=O69SuUacbDCxXkT3lnoiSLGDKPh2cCmfAKq3f6v3siKBLB0WaVVIG3XVQ2mChw3XEp0dwv FF9e+RPH6kDaE+B7adB+yVAo6i7MFrVEVS5qQLTiY0on2B/kCpekKvqjC074LCYKIidfR/ 5MTM3laZoF5oNPjlZ7jGm1bKv9Y1vK98UdXT7iYavOuwwIIkIVBMRJL1vldwAHIFmMIS1Q liFzQATa0gdmz5SqLmEoCgMH0hi/H/vBYJqUnkuXiHJ23WxuMLzlWtd3IiUcuaF7XjJMok ltSvcSp6JK4hqA3krKGCRdTbbrYFHJuSfDhRU33lP5pGh2J6JiMNZ95FKsLKLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dMSQbDIlUIIlfYPhnKcNIFC6xndMZ8ajTIZHxPxY3Do=; b=iaPp7dbj/P6jl1NqNR4nrF45FQA0P54QMhyrC/RL9sz29KnvhI70shtTVBNdFDXQbvKkJY E2aNVmvU5ywIWvsXAUHD2LKmrFo9EM8My4ADTyoGrc/obpwsqsis1gCvp+EPkkm1ToDCSK O3haEFMimV6jUSXDJnPfOeTe3zyv5fEWjc7nW4G/McqKIf+xXk7Q4/8FKGNFZiCpiuUBqP Xk2rWRhekx7gvdOOhiS0JTi8MFX0dR57pXVBUxbHooLmlBqw2pDrgxRt59CU6QrMz/mCEb VuLjY10T3YLJT4IS/xeXZZUmlzfDYv5RJ+/xnHiLgO4wcTC8SwsJXBH6yJKX+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786083; a=rsa-sha256; cv=none; b=GVpu3NkgayGfbdtNcvOaS5UREw+8v9vZJlS8ALGEcmojmlNdbKxpDtktobShNPMsWr2L4X V46fp/3RaMcifNde7aFoHmV2PZHoY7jtol6h5kON39BcKwzJgH4Xn8cOUqgPCs2Mhh+V0+ QnhQO5oZDj0XnRvQCu05JybsIFmImGN/fjhH6LbmxYqd1Bu0ROu4kdxlU0DfL+gW4Z0v8D leQMjQJQQlpno2CZ8BOgI/WIVgwHFh8L04UOOdXcPWSXqbm2iKCEhI5KcfdiuZM1y2GygM cFce6KXU/aFYPDqElik6rtVXOy4fZm+6Noqt9/BLMXZzVa0EZAIeCc3UdScFLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5htC5dHGzwKD; Wed, 19 Jul 2023 17:01:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JH1NnM080191; Wed, 19 Jul 2023 17:01:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JH1Nwg080190; Wed, 19 Jul 2023 17:01:23 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:01:23 GMT Message-Id: <202307191701.36JH1Nwg080190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 13d1f5cb62d7 - main - enic(4): Remove unused dupe prototype List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 13d1f5cb62d796397312e87ce93b6aff36f9b75d Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=13d1f5cb62d796397312e87ce93b6aff36f9b75d commit 13d1f5cb62d796397312e87ce93b6aff36f9b75d Author: Marius Strobl AuthorDate: 2023-07-16 07:43:13 +0000 Commit: Marius Strobl CommitDate: 2023-07-19 16:58:51 +0000 enic(4): Remove unused dupe prototype --- sys/dev/enic/if_enic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/enic/if_enic.c b/sys/dev/enic/if_enic.c index 537e613efa2d..a386191a51ef 100644 --- a/sys/dev/enic/if_enic.c +++ b/sys/dev/enic/if_enic.c @@ -1029,8 +1029,6 @@ enic_update_admin_status(if_ctx_t ctx) enic_link_status(softc); } -uint32_t iflib_get_flags(if_ctx_t ctx); - static void enic_txq_timer(if_ctx_t ctx, uint16_t qid) { From nobody Wed Jul 19 17:01:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5htF1V6mz4ndV8; Wed, 19 Jul 2023 17:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5htF05jxz4Tfy; Wed, 19 Jul 2023 17:01:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ke0cDudMAYF3cIXnGO/y7+TwEqFL08pGiglyO06FnKQ=; b=e4QrRjzWtNn86zoNYF2tu7/FeWwFsSZ23su1pxImahUdU0/8WVOf1EL+sZ+xdkIPYCmNAU Z/fMAs5fheCtWrRhusa5OeRoBCvyiDDvRN+T7TBA5LLkwyJfZHug5Hl7A0PhLF1wQMYgS4 MuBpCQ9PqedsbGkKRh73kJzFc0Uh1JLuST5khx67xksdTy7QjI9Y4WzSBYqtiVUaSKH9oI JuvPVdLv0RPOTTbs5O3RQsgRbZIg04AD0N7GSwvRpntsDPUEO8mtY73hnUk9ziAbjk2y34 inihAhXu8HJd88UWqxzy3IUDuNAPnguxjgYYydCjUggKdd6zU7TP2rZ9x7quMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786085; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ke0cDudMAYF3cIXnGO/y7+TwEqFL08pGiglyO06FnKQ=; b=oQ86neRrCuHfXCQMK870RZzIQL3J7l+l0u08bNvwMZ/sB/liIek/z8aARlbrPwfVOAYazL ZCDndETcIw7+iJtitxfRWcA3fO3RFWtvqGbcLxIM6TBvMjYEMn0Se7n/wukhNQ/aloiOhW g5lv3UfwqJOOrPVzzgwWy7jhUF9mHbjgDLph8sY4FyZnaNTCQunLBgWjPm/OFGSL35XVgk 2MD8h5lu/0fcvz+5lYOE/7GwbQ//mkXtJcJNr35jfaADkL1tjAwFPd6z7lfQQrllxV5hat UYISARKGw6YBvu7sP73VKXrlzh9zL1PkJRilFCQnx4lUiCUtdkxaTaT8OgcHAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786085; a=rsa-sha256; cv=none; b=coHVydYXlNTO94hseS4cbMLYUN2+72K1b58+09FjUSntfDKcGZliJEG9CMfeyMrYWd3M2p hGkn4joAxgI9+6Sqd3v/GXrsvaYCVb/ME08FmqWmfylybzDPt0+4HaQuw0vxgRsDoDjSdh aA9/mmUcx2jp5YS4xhudS+v9KuY4wsd+vFCs4OHOdtSE4reECBJ7ok7uMv3G5z8Sy16277 NjtfzFbQQhN0vemSQf1J5ZIgIBoQb7kQETHfHZd+QZ7fdgjMUxFvtrleWtu1C3rg9IkRX1 jpUNinxCZ33lMYnXeYskcw2TxhM1AbmJunZqRVHU30nFnT1FAEOXW3Dn74XOJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5htD6JYNzwH9; Wed, 19 Jul 2023 17:01:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JH1Oph080210; Wed, 19 Jul 2023 17:01:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JH1OsP080209; Wed, 19 Jul 2023 17:01:24 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:01:24 GMT Message-Id: <202307191701.36JH1OsP080209@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marius Strobl Subject: git: 37eec7f68a79 - main - ObsoleteFiles.inc: Remove leading slash from 20230714 entry List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37eec7f68a79d100d8f5d439138acc21cd8b4efa Auto-Submitted: auto-generated The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/src/commit/?id=37eec7f68a79d100d8f5d439138acc21cd8b4efa commit 37eec7f68a79d100d8f5d439138acc21cd8b4efa Author: Marius Strobl AuthorDate: 2023-07-19 16:56:35 +0000 Commit: Marius Strobl CommitDate: 2023-07-19 17:00:14 +0000 ObsoleteFiles.inc: Remove leading slash from 20230714 entry Fixes: c3f58005d92e signal: Remove gsignal references from manuals --- ObsoleteFiles.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ccc57c3406c3..80e106d63db8 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -53,7 +53,7 @@ # done # 20230714: gsignal -OLD_FILES+=/usr/share/man/man9/gsignal.9.gz +OLD_FILES+=usr/share/man/man9/gsignal.9.gz # 20230626: Only install sys/dev/nvme/nvme.h to /usr/include OLD_FILES+=usr/include/dev/nvme/nvme_private.h From nobody Wed Jul 19 17:02:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hvj6Y0Pz4nfKL; Wed, 19 Jul 2023 17:02:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (mail-n.franken.de [193.175.24.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hvj52Y1z4Vkk; Wed, 19 Jul 2023 17:02:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple (ip4d15f6ca.dynamic.kabel-deutschland.de [77.21.246.202]) (Authenticated sender: micmac) by mail-n.franken.de (Postfix) with ESMTPSA id DAC2881546F22; Wed, 19 Jul 2023 19:02:39 +0200 (CEST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: git: 07864a8a2466 - main - kinst: port to arm64 From: tuexen@freebsd.org In-Reply-To: <20230719165448.f45hbzqgg44v4ns3@pleb> Date: Wed, 19 Jul 2023 19:02:39 +0200 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202307191459.36JExsm8067623@gitrepo.freebsd.org> <20230719165448.f45hbzqgg44v4ns3@pleb> To: Christos Margiolis X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4R5hvj52Y1z4Vkk X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:680, ipnet:193.174.0.0/15, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated > On 19. Jul 2023, at 18:54, Christos Margiolis = wrote: >=20 > tuexen@freebsd.org wrote: >> This doesn't compile on my system: >> [...] >=20 > Forgot to bring over a recent change to kinst.h from my local branch. > Pushing the fix now. >=20 > Thanks for letting me know and sorry for the inconvenience. No problem. I can confirm that the push fixed actually fixes the issue = for me. Thanks for the quick response. Best regards Michael >=20 > Christos From nobody Wed Jul 19 17:04:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5hxf43YDz4nfyY; Wed, 19 Jul 2023 17:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5hxf1xtvz4WPB; Wed, 19 Jul 2023 17:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyX/m4lCUXXrNKCrStaIu94HU6oXiZBFgdL1B0CRNb4=; b=bw0tRZuE40sLUB167ntMSiCQ8/QEjcxX/CF30EoaKE9Mm9NG3lR1It6XUgKTzBxv1nWJrb riLZ/pmmaYsmKR19AI+a7koJR02o8hXt3CTuXoOqTo0bi5fo/MclgMqRIpLRyf8LsDQ/4A CCBUhUbYMNnmblVFNo8i0lSCEkTU5cLw0OtFj1nkm9JelPigo9wHdv+Dt3qcZtjs1K9TjQ WNANzMLPju4yeQJWjBe0UaIiC+n9denUyKn9Ij3rU7ZvtWZYG3ljsZzq0FBWY190S9VLXy 4PypsoqcDhDQXU619mpfyIq7RGXGotynCaDvL1C3LRhZTq25daAuBOkd/8k4XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oyX/m4lCUXXrNKCrStaIu94HU6oXiZBFgdL1B0CRNb4=; b=LvEHzpxFFCY2UIO5Gyn0Jrvugtrct3Qj1VenXeE60YX7gfCAqjpeRw4PxRwumd+i9FxHaj yBC13rk7oi5AXS6V0Q64PmNqK0CTQaOnafTofv0I0Lqfjok3RhcWEldTH5eLWXjd8Mjz1c hkXY3bvGqsinplEZfZMwBraOhfvJzNVrcjyqXa9o6W1bOlu1zVQWrbAWhNFZXEtE6jk+Hs DxJMxjzN2DqsWDjGYhcJucpgb/tlJzNrCLt5WPwaq5cvtSzzqJfRE55UtHZrAbRXS7i+Wy kdHuY8Veqhx93whhZrkHYGs4H2tYErkjUB1nNIIXVbcsagZvepJYzP5S9u+3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786262; a=rsa-sha256; cv=none; b=tmiqx/RUEDmEi6Wx5lU2WKlKZiCxo2qbsnzqhwQ5DdxBpcBi6IeTfv/DA23NTBLBkM1Mu1 52rdpYwZowsO3nDzFGj+Mo+537EHd065clDoVcaRtqYqQ3CLQrolfbqwbqZiipe7Z2/psI fI+8iblwrEPpMOpsqIS/zDPW9BaqQO2k8jqVy7719gcZdhC53BEjMbkGXBFKvoeDAlvwP5 m4Xo5qJF5kKFQcHalBBAN5BYvBQYVGCJ7P+dbu1DQPVg5MOq3hORbkb5RtIxteCZ1KwaOD 40vTq7owv3MpkbYTwt9jYKjIAo/u1lx05CnMsslxybGzAFO08NXgRGUZu/GOYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5hxf12D0zwm2; Wed, 19 Jul 2023 17:04:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JH4MLX083570; Wed, 19 Jul 2023 17:04:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JH4Lip083569; Wed, 19 Jul 2023 17:04:21 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:04:21 GMT Message-Id: <202307191704.36JH4Lip083569@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: 66fd12cf4896 - main - ssh: Update to OpenSSH 9.3p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 66fd12cf4896eb08ad8e7a2627537f84ead84dd3 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=66fd12cf4896eb08ad8e7a2627537f84ead84dd3 commit 66fd12cf4896eb08ad8e7a2627537f84ead84dd3 Merge: 37eec7f68a79 e524ba4db420 Author: Ed Maste AuthorDate: 2023-07-19 17:02:33 +0000 Commit: Ed Maste CommitDate: 2023-07-19 17:02:33 +0000 ssh: Update to OpenSSH 9.3p2 From the release notes: Changes since OpenSSH 9.3 ========================= This release fixes a security bug. Security ======== Fix CVE-2023-38408 - a condition where specific libaries loaded via ssh-agent(1)'s PKCS#11 support could be abused to achieve remote code execution via a forwarded agent socket if the following conditions are met: * Exploitation requires the presence of specific libraries on the victim system. * Remote exploitation requires that the agent was forwarded to an attacker-controlled system. Exploitation can also be prevented by starting ssh-agent(1) with an empty PKCS#11/FIDO allowlist (ssh-agent -P '') or by configuring an allowlist that contains only specific provider libraries. This vulnerability was discovered and demonstrated to be exploitable by the Qualys Security Advisory team. In addition to removing the main precondition for exploitation, this release removes the ability for remote ssh-agent(1) clients to load PKCS#11 modules by default (see below). Potentially-incompatible changes -------------------------------- * ssh-agent(8): the agent will now refuse requests to load PKCS#11 modules issued by remote clients by default. A flag has been added to restore the previous behaviour "-Oallow-remote-pkcs11". Note that ssh-agent(8) depends on the SSH client to identify requests that are remote. The OpenSSH >=8.9 ssh(1) client does this, but forwarding access to an agent socket using other tools may circumvent this restriction. CVE: CVE-2023-38408 Sponsored by: The FreeBSD Foundation crypto/openssh/ChangeLog | 1867 +--------------------------- crypto/openssh/README | 2 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/ssh-agent.1 | 22 +- crypto/openssh/ssh-agent.c | 21 +- crypto/openssh/ssh-pkcs11.c | 6 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/version.h | 4 +- 10 files changed, 82 insertions(+), 1848 deletions(-) diff --cc crypto/openssh/sshd_config index e3228f94f94a,36894ace503d..767024db5209 --- a/crypto/openssh/sshd_config +++ b/crypto/openssh/sshd_config @@@ -104,8 -100,7 +104,8 @@@ AuthorizedKeysFile .ssh/authorized_key #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none -#VersionAddendum none +#UseBlacklist no - #VersionAddendum FreeBSD-20230316 ++#VersionAddendum FreeBSD-20230719 # no default banner path #Banner none diff --cc crypto/openssh/sshd_config.5 index 9bd447e47863,9a1578f75e86..d960bbda5e0f --- a/crypto/openssh/sshd_config.5 +++ b/crypto/openssh/sshd_config.5 @@@ -1927,10 -1900,7 +1927,10 @@@ The default i Optionally specifies additional text to append to the SSH protocol banner sent by the server upon connection. The default is - .Qq FreeBSD-20230316 . -.Cm none . ++.Qq FreeBSD-20230719 . +The value +.Cm none +may be used to disable this. .It Cm X11DisplayOffset Specifies the first display number available for .Xr sshd 8 Ns 's diff --cc crypto/openssh/version.h index 24c778283020,000000000000..7132fd7b0780 mode 100644,000000..100644 --- a/crypto/openssh/version.h +++ b/crypto/openssh/version.h @@@ -1,8 -1,0 +1,8 @@@ +/* $OpenBSD: version.h,v 1.97 2023/03/15 21:19:57 djm Exp $ */ + +#define SSH_VERSION "OpenSSH_9.3" + - #define SSH_PORTABLE "p1" ++#define SSH_PORTABLE "p2" +#define SSH_RELEASE SSH_VERSION SSH_PORTABLE + - #define SSH_VERSION_FREEBSD "FreeBSD-20230316" ++#define SSH_VERSION_FREEBSD "FreeBSD-20230719" From nobody Wed Jul 19 17:15:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5jB94Ztwz4nlN9; Wed, 19 Jul 2023 17:15:11 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5jB66nxKz4Z0x; Wed, 19 Jul 2023 17:15:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786911; 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=BHS6qVGZWKnTxtxmMKEep7C21HDFqSP0xtnNO8WEdyQ=; b=ytd4lfzaBmFonWbCtwjoLF32LauvL25+X7P37wfknGz/yyxw1yjoHtn9Y4IwZWwuFslkD6 iYj54u89HiWT2GdHVppDHVgsS5paA2JW98loKxExtZxa4otrljG3QTzU7hxQbgEpi7C47n +2Rz8qTnqmRjs+BKkNA7IDZbliwzJl6m68XG85gTESOsKw7lPiVfCxQF//8X5+NTDRKkWG wAg/ncvasLsdJPh0KJcWH5GMu7SGu9r3pcY/NWP+CKC15oIK6y9IXw/Kn4KXkPtnHvrDyj XQvLkGfI1tlmJlhx03PwNUzj6unsCN+nJKMSoVjr9A5eMtzVkMg7/NCqEgmd4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689786911; 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=BHS6qVGZWKnTxtxmMKEep7C21HDFqSP0xtnNO8WEdyQ=; b=DBpw6CTwwMt+MCaEvmTbH1RFIjykAZUCiIxy9FXQmAby/e9mZlPwKm8PxOjNBaSYuG8UG4 5DbcekLOlA9XIdBRh+xZJRGOlW2nwyhHcWAQpOXmw8qxqiiE0QSA6FnvryEED8KnvVrIJ2 c80g+bWWdLeWFo1UtyxyicS9XBSYq93SpfgmH0fkOnDogaAeX1UXI3qB4a9HGU3PLYAnRA t9ejZY2VQnm9rFe4p6UWv4YRsiZ/3WVXPByKCB9RUHQJQmy2EPR9vynP6pNYqDVRA5zfZg k/ZIoS3lfZIhPAMKtAcN4BPv11xlvHWH/QrG1U4oYNclxycCRNhmKt60tjvXow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689786911; a=rsa-sha256; cv=none; b=XPOycmQbf9E7BL9vrlx2OWs2FiRtTLMubQ93KzTHSV0AvCDU2BgwyIdYnaWZintBo5z+zl H8TWiyGufsSE2uV7o319bB3JrgOwIqQmL83JWDUqwnvXoBl0DeBBzNDfWKUKXB6soqKxNb bamTWksafh70Og1Mvxq4e6/y90Z23XuH75WTA0pZ0+vtXthNhxhMr+3+PJMCYOnajAWUzL hy8GBh5+b3FslaQbo51RLB+CIASScnG+JbhibI1BziiSZaLfA2IsvMuUPchzazOT6k5IhL s922KJUDeq1kpQ7cKMePSR/BmU7jwSosdoz5/4u2DSX7PqMYwDbZWkwe1Q+ieQ== Received: from [IPV6:2601:648:8680:16b0:c91:7cca:6422:a0ad] (unknown [IPv6:2601:648:8680:16b0:c91:7cca:6422:a0ad]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5jB46sjTz151G; Wed, 19 Jul 2023 17:15:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <95cf4d0b-218f-aa25-a038-484d340bd622@FreeBSD.org> Date: Wed, 19 Jul 2023 10:15:05 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: git: c5312bd79e66 - main - cam: Move bus_dmamap_load_ccb into cam.c. Content-Language: en-US To: Warner Losh Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202307190120.36J1K1mQ011397@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/23 6:44 PM, Warner Losh wrote: > As predicted in the review, this is broken: > > -- command output -- > linking kernel.full > ld: error: undefined symbol: bus_dmamap_load_ccb >>>> referenced by nvme_qpair.c:1209 > (/usr/home/imp/git/freebsd/src/sys/dev/nvme/nvme_qpair.c:1209) >>>> nvme_qpair.o:(_nvme_qpair_submit_request) > _ > from using sys/amd64/conf/EX > include MINIMAL > device nvme > device nvd > > This has to be in the header file. The MODULE_DEPENDS stuff doesn't pull > anything in for the > static kernel case. > > Please, lets' do this in the header with a static inline like I suggested > to get around this issue. I only committed it because kib@ requested it to fix the build. I'm still happy to make memdesc_ccb an inline function. However, it's also true that this case (a storage driver with both CAM and non-CAM frontends) is very unique and is not something we probably intend to support long term. Requesting those folks to add 'device scbus' to their kernel is not the worst tradeoff for this unusual case (esp. given we are defacto deprecating it by making nda the default in 14.0) -- John Baldwin From nobody Wed Jul 19 17:33:23 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5jb76HLlz4ntVT; Wed, 19 Jul 2023 17:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5jb759h3z3CdS; Wed, 19 Jul 2023 17:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689788003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JT7xsILXoDLRWFH1v5WYQDIPGfC1OivFWDe00Yznu48=; b=aQ3pvXhS40q+HyFUpcdCdATlLOosRE6CwO0rWdRcXzKdSdxSxYCig/p83lSqRYoafdv5dV PJy1LnbGgHsAxcjDOnedTVHWoDduU+Gh48v5QvHcwFAjN9smRZO3+8G5jJtkfwByRr5+gE N5f4KoduOuzTFyX1nA1wt0Y7Qon0TN9c/XCPtXl0//+KFouUqZigNa1o7anMTo8LTrwq7y rqIXzNr2p9ZHIs6k9q4ydgpoJ1BcxuH4zpYFd6HXz7cELAFYVKlBpv4qNW7TgYjmNLat4z SjznXwGCFo7oCW1AsF9N0eeQ0v5bFWWPWHK8+Nu0OnqZs2jgxhujl0tsBYyCag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689788003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JT7xsILXoDLRWFH1v5WYQDIPGfC1OivFWDe00Yznu48=; b=B0xGPic5M+a+Mm5O4H+lIOCnlynfQghOVRUWwyFpQTl1wRAkiOQS5a/Cv3VWlo5UJP3Ebn PcbzpQwj30YIFCf2t1hh3hQPDyhW/c6EgzjA736dGyHcBAku9/5JfCilRosOaO/2FVKfw9 q2dhpldvV69KPdYX2Y+66clwVO4PiIkrNdisMzJZj7QLe6zw0KWfFsXhI2chAoArjXraeL CouBkklcQ99Qa8xlq8sGTTmrOrM+1kGx1Unw4XoFzcgh41bWcmEB7sCDcxRgmNT1UOMpMk hzm1T2ayZXl/pnFXDfBj19S8BgQFAc3w1s2ufAD2ZF0B2j1OPMWs5dkZ3tY2Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689788003; a=rsa-sha256; cv=none; b=ODPHHqBnBczgOjCrLRUPO2dyIOEslJ8nmimCponhIK5xf0ZmSE9+ChdHiICirsiBPROv6o MVdswqqwtihYWnhMZgzxG0CqMODKWKzYYD7zUtFPmWUfWiZxZpSZ2+kN5Vjdnpc+r32s/i XR6Eo4KygNTBdo831DKabV0qoTNrOUhJCaS1m2shwVZqXxeeEFUuD+NTNmzSHvBXEbWkO0 hHOwabvhGJCjYcRKbezvwhGmGwewnh+CmIk6E/vvpLeB/OsT9btXX84Xsy6U4Zd/zHMxE2 iYIkZap4Qx9RriVolXspCtLQjlp0Lz8HZhv0AQlHfTIs6qzSoqn2O3v56qye8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5jb74FbFzx7X; Wed, 19 Jul 2023 17:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JHXNJG033084; Wed, 19 Jul 2023 17:33:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JHXNXj033083; Wed, 19 Jul 2023 17:33:23 GMT (envelope-from git) Date: Wed, 19 Jul 2023 17:33:23 GMT Message-Id: <202307191733.36JHXNXj033083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 8d0cab8800e1 - main - Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 commit 8d0cab8800e19cddc56d4a532abdbe9f0ac6c620 Author: Dimitry Andric AuthorDate: 2023-07-19 09:18:50 +0000 Commit: Dimitry Andric CommitDate: 2023-07-19 17:14:23 +0000 Merge commit 9ca395b5ade1 from llvm-project (by Haojian Wu): [clang][AST] Propagate the contains-errors bit to DeclRefExpr from VarDecl's initializer. Similar to the https://reviews.llvm.org/D86048 (it only sets the bit for C++ code), we propagate the contains-errors bit for C-code path. Fixes https://github.com/llvm/llvm-project/issues/50236 Fixes https://github.com/llvm/llvm-project/issues/50243 Fixes https://github.com/llvm/llvm-project/issues/48636 Fixes https://github.com/llvm/llvm-project/issues/50320 Differential Revision: https://reviews.llvm.org/D154861 This fixes an assertion ('Assertion failed: ((LHSExpr->containsErrors() || RHSExpr->containsErrors()) && "Should only occur in error-recovery path."), function BuildBinOp') when building parts of dtrace in certain scenarios. Reported by: dstolfa PR: 271047 MFC after: 1 month --- contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp index eb9afbdb1c87..b5c783b07d92 100644 --- a/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp +++ b/contrib/llvm-project/clang/lib/AST/ComputeDependence.cpp @@ -489,7 +489,7 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // more bullets here that we handle by treating the declaration as having a // dependent type if they involve a placeholder type that can't be deduced.] if (Type->isDependentType()) - return Deps | ExprDependence::TypeValueInstantiation; + Deps |= ExprDependence::TypeValueInstantiation; else if (Type->isInstantiationDependentType()) Deps |= ExprDependence::Instantiation; @@ -525,13 +525,13 @@ ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { // - it names a potentially-constant variable that is initialized with an // expression that is value-dependent if (const auto *Var = dyn_cast(Decl)) { - if (Var->mightBeUsableInConstantExpressions(Ctx)) { - if (const Expr *Init = Var->getAnyInitializer()) { - if (Init->isValueDependent()) - Deps |= ExprDependence::ValueInstantiation; - if (Init->containsErrors()) - Deps |= ExprDependence::Error; - } + if (const Expr *Init = Var->getAnyInitializer()) { + if (Init->containsErrors()) + Deps |= ExprDependence::Error; + + if (Var->mightBeUsableInConstantExpressions(Ctx) && + Init->isValueDependent()) + Deps |= ExprDependence::ValueInstantiation; } // - it names a static data member that is a dependent member of the From nobody Wed Jul 19 18:17:12 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5kYj0k1Rz4mpRS; Wed, 19 Jul 2023 18:17:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5kYh5c4Hz3Pp7; Wed, 19 Jul 2023 18:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDB+Jll5TxJYx+WpMYlycvk2F9brrxXXNKYlr2P8vJo=; b=Mi83FNvj5ifN3NcFco5JcM/kLw/SjAba1DOJcoeNxoES6wH3MJrGQ2QJhGzeBYshvBprE5 cv3dwuNIhgDZdL6YEZg3Dm2Zzc2TGQEe/js2pagYV04YCy7nIlgaX1sSgAX/HMheNrj9Sr 67rfhYDnIvvi+jpi3IKfiTLHD7h9BFdqluvh877lcgmVMoyuUvAwOrKL+gG68GUUDoQ2iJ rC27YV9IsZfCzRnBjNcsRLX2Dd4MgdNiGJWt50xCeWZbjpkWECoop3Dy6xD7EfNA8L9NQM pu2yvMj0Ui+dZQK2b+8psOeKUh41T5+tf7Pm/uuZAUKcqUyNWrlimdEj+isvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gDB+Jll5TxJYx+WpMYlycvk2F9brrxXXNKYlr2P8vJo=; b=gljZT2Z6c7vgkoDjW+KLhAkJzVAMCXboXWQXF28P/dB12lZ1g37vr3U6vTYlPDs+lG71hG eax5QIRjLKGD9VoruFp3vH009BK8pq2yZeIAYy2XrmjSydtH5nk0T9OPTQvaCKzHAsD9Do Jj1W3+16Xo23XbrFRJrAMsxdRRqGnSyVgSV7/yXCya+H63YeoDj3KbDrtaENyX0AsVQl2L 0dq36z/zSTTMaBdYJXthQull7eqt9y6AMqXAS8GWmTu4ijRaaKQ9XCocmVft0YwliaCfBq ZY6yaK2nA8y3MV7l1DulEIM0/jdpeAq1kZYvpCJtf0bVGMPp2Qf1RZHxVqAdZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689790632; a=rsa-sha256; cv=none; b=af8RFvTpIrpj6Kv38lrTC9iClrBGmXhD7Y24IW23Cz+jYedN7CxYxM+u/TUT3pc+CoAok+ qTnPHVu7H/J9rrNo8jxH+qwbVdA6757NfOW87NRM9xYUCzPoKdLqcDBLy3smpCx2A9d2W4 lKLYhSUGCvlY50E3B+07plW4r86UF5XBTngJtSdgJN7CAQIp0+VG51bV5zU252SFfpSkWM bsjHMzC76LiS5RT/yvvdeocu0y9jaFA5iIHKCPf7x1avWKpIuYuU9WySthjB3FW2zyCMad eM0m7PVWVZpbcyI1eEbystE3cCyzkLqD1c+HqvCbPRCBNGYXSIgvjahxkYUnFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5kYh4WnpzyXQ; Wed, 19 Jul 2023 18:17:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JIHCFo000232; Wed, 19 Jul 2023 18:17:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JIHCk7000231; Wed, 19 Jul 2023 18:17:12 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:17:12 GMT Message-Id: <202307191817.36JIHCk7000231@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: c721694a1ca8 - main - ktls_alloc_rcv_tag: Fix capability checks for RXTLS4/6. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c721694a1ca8c1649b32a1ea6faa79a606cd19a6 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c721694a1ca8c1649b32a1ea6faa79a606cd19a6 commit c721694a1ca8c1649b32a1ea6faa79a606cd19a6 Author: Navdeep Parhar AuthorDate: 2023-07-19 17:56:03 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-19 18:12:14 +0000 ktls_alloc_rcv_tag: Fix capability checks for RXTLS4/6. IFCAP2_* has the bit position and not the shifted value. Reviewed by: kib@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D41100 --- sys/kern/uipc_ktls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index df4fe4b77c04..750e612cb273 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -993,12 +993,12 @@ ktls_alloc_rcv_tag(struct inpcb *inp, struct ktls_session *tls, INP_RUNLOCK(inp); if (inp->inp_vflag & INP_IPV6) { - if ((if_getcapenable2(ifp) & IFCAP2_RXTLS6) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS6)) == 0) { error = EOPNOTSUPP; goto out; } } else { - if ((if_getcapenable2(ifp) & IFCAP2_RXTLS4) == 0) { + if ((if_getcapenable2(ifp) & IFCAP2_BIT(IFCAP2_RXTLS4)) == 0) { error = EOPNOTSUPP; goto out; } From nobody Wed Jul 19 18:21:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5kfm71vcz4ms79; Wed, 19 Jul 2023 18:21: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5kfm6HzHz3R3s; Wed, 19 Jul 2023 18:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dyJxVXaTh9WptHk1/gmuuPy3UO8ZTnJNiA9x9O8Cg4=; b=CqWIQt8S/ot7Ril02tjNO4OWCjTawUn4O7+Mk72GN0a9b+9WOVP/rlmbYoZ78f0kKKYUL5 EjZgVfj+c6MGAcIJo2OkAH29XYqjQWOz5yiOVI3jW8FTY5v07TUQwtMBWQ8Qw+P1Mn0AC/ N6zabbDm6eboduznhdBPAwZGLYLsaUZPieXhkjxMqFHYSTDnxwDZd76YltAP2hZh7DjVFb fYHTjX4eaNvykoqt7VkE+FtKo2WOsU2hM4LA9c4IoV751dXewDtytpByHAL+fNaYC+4oU/ i7YJOmZE6TqWzPaNlimfcg/WWN1h5uYS0GSdha4zgL/N90Krvc2r29MX3EL7QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689790896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2dyJxVXaTh9WptHk1/gmuuPy3UO8ZTnJNiA9x9O8Cg4=; b=TxSjjpgvUge8HFvZYAJMkeyP/Ac1h5qWhLi0d74x887+ryFCqiZehs2KbvU9ZTcI+5bgHx 30duwZv40PeC8b9/e3/jw+P+ntvBEMK/2nHlJg3BFAEGwdYNh5EG64XDBoajzdQPgFkqBZ zZ666vTpo1I1ouv+pDhWtIIa+xr73nHHlhFH+CN7mHp0IOm5HB8pkQDLRGTfLhV79EL4Ga Tr1tYqY8QJ3nq4QvytO7dofg2Ky20PLEFhhTDIv5RWNaPDm8waSws1bTQ5erpIx4Hcw+zN mI0FuxapbcIPtT3wyKQaTe7k5GHA3/6Fx/noxdS8pBlmfiR1PE7Rm3m1OxXOZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689790896; a=rsa-sha256; cv=none; b=Bnl2UV3E6XrSN+vGOF9qyF06JhqnCkW38yqQrkUCU2H2PZi32fGG2Y1xk5YVrq0Yt4SYi3 el2EmDzXmsDFKPGSjmAO1fhOkmwBe0I9wM1m7nA/U1WrdzIDHoCzeMXIev5TcIRKxz8z7X 1jkArjLt4Phv9rELgQQkU9L0NnUxPcdRcb1IxnfspzFsQ1LrcMUNyyZ/yM4fNwBzsK5e7R mBNcCM+LODYrzUfbr8Vs6Ez/7o+mqJNiKyZ/OTkeVp8+tU++goIkxJ4UYnIxiBmW3y1DGf I7y7IGhpOGoREQoJoiGVgAxThVqPoLIRzrUprw/IPQ82nvplB9McYw46KpTJ+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 4R5kfm5Pb0zydT; Wed, 19 Jul 2023 18:21:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JILas0009338; Wed, 19 Jul 2023 18:21:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JILaDo009337; Wed, 19 Jul 2023 18:21:36 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:21:36 GMT Message-Id: <202307191821.36JILaDo009337@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: c84617e87a70 - main - i386: Switch to PIC kernel modules List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c84617e87a70f4aea5df46fa521835aefa7d8163 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 commit c84617e87a70f4aea5df46fa521835aefa7d8163 Author: Dmitry Chagin AuthorDate: 2023-07-19 18:21:04 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-19 18:21:04 +0000 i386: Switch to PIC kernel modules It seems since the last llvm project update, the lld linker has started creating a PLT dependent kernel module object files. Reviewed by: kib, jhb, emaste Differential Revision: https://reviews.freebsd.org/D41088 --- sys/conf/kmod.mk | 2 +- sys/i386/i386/elf_machdep.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 246af5ba1e81..a83d64eb8bf7 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" CFLAGS+= -fPIC .endif diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c index d8b7ab9c586b..5d8b41a16672 100644 --- a/sys/i386/i386/elf_machdep.c +++ b/sys/i386/i386/elf_machdep.c @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, break; case R_386_GLOB_DAT: /* S */ + case R_386_JMP_SLOT: /* S */ error = lookup(lf, symidx, 1, &addr); if (error != 0) return (-1); From nobody Wed Jul 19 18:53:58 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lN65SFlz4nRH2; Wed, 19 Jul 2023 18:53: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5lN64sJFz3qZD; Wed, 19 Jul 2023 18:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689792838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo+68o4ae1OMN8arfg5JHB36jy3Jb+xa6AVl9hf+sH8=; b=t9GqfmOrEtxq1prkKSmejAkoKkcUyvLdfVqovWR3dPBLp8vbbdDkBU+p1yQgBEXb3YQSU7 wT18XjperzaIBC0832lJ9L+cfb8gykx8IuTdwVH4d9iW+nABVutcx0DY7tOyonqYbi/TqO 5O6szaPGQbL1Xo8nQ80FVFeKc8Mrx5HrPSvpqIhI1KQA9khUZJxMFLMxij5PdTAlFG0RgE mjF6ZawnCCDvzIAMiNH9KtIGCTCURySZyyb1PNNCY375OLBhW6DrqtWbmsF/5GzSSca6xj 2P6FjFZbEeDP0rkJvJ4+KoRmevGeydJt5DIh7ZvKCMsqFjjnS7WJcOwJBK7akg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689792838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vo+68o4ae1OMN8arfg5JHB36jy3Jb+xa6AVl9hf+sH8=; b=oDxppGX8NubZF5XjWgQzZHcUF52CXeOkemAwS1I1dfaM3c4TtsYGDSKPeZ+eqsoaY1hu9d FtbWlFuyOdudYVbbp9NfrKUfdonDOouLL8Sw3IaAn+SGm+5P/x2378MAr2LO+Hz7wgi33l zU62lQy70X09nStLv2NPXnFoy7SUcv3hhfRLIrrTLF6ve69fxhbYaZPfifXgu/2pyVwDj1 IUBkUl+DtOzN/Y7RiB9C++YmGLXfpzs5Lb7vtKqoehNvYyfSoNjJhA9EtpUHHe9ikkJv4s +vTyvEom1xMXktsXAcqBL5ldrhGD2aZjGM+YyMN3PSUNlUU0gVgZBPSlD3fAJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689792838; a=rsa-sha256; cv=none; b=mov87pNKtx0IugvR9IahywWN92h7l70vBztVk9wpGgxTjdq9s02rFasAV1LbOfefmRo3Wy RAG2aFUotdBX9dwZ8colrNUIJOyTbLBAe06m7bCukg7LD++tL6z+A/GuRGtX2HU7WWuUPs PQKvzX4uPNAMkDwa7bEjIpZbSUANDNK3/tYF2QETkVaFSLDII179y7AHlIiq+vxQZhN1Ll RsLpHn6G6FAc3zhSv5Dpt/4HtdA9GnC5EL/TkIf7aeiVdgw7zJKXtdVhc5QXt0yjqfhtNZ rr6TxcBiNLgQYck6E7Y9Zg+fyPxD8S+tLOhtjhOrlnWRudYpAqVzgn8bAnF65Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5lN63vklz10Dt; Wed, 19 Jul 2023 18:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JIrwuR065409; Wed, 19 Jul 2023 18:53:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JIrwV0065408; Wed, 19 Jul 2023 18:53:58 GMT (envelope-from git) Date: Wed, 19 Jul 2023 18:53:58 GMT Message-Id: <202307191853.36JIrwV0065408@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: e5c4737955d5 - main - amd64 crt1: Explicitly use a PLT entry for main in the PIC case. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e5c4737955d54d868e73a22beae7e8bb15703779 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=e5c4737955d54d868e73a22beae7e8bb15703779 commit e5c4737955d54d868e73a22beae7e8bb15703779 Author: John Baldwin AuthorDate: 2023-07-19 18:53:33 +0000 Commit: John Baldwin CommitDate: 2023-07-19 18:53:33 +0000 amd64 crt1: Explicitly use a PLT entry for main in the PIC case. This ensures GNU as generates a R_X86_64_PLT32 relocation instead of R_X86_64_32. Reviewed by: kib Fixes: c969310c992a csu: Implement _start using as to satisfy unwinders on x86_64 Differential Revision: https://reviews.freebsd.org/D41101 --- lib/csu/amd64/crt1_s.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/csu/amd64/crt1_s.S b/lib/csu/amd64/crt1_s.S index 0c1c3b960bda..f7ea076d94f1 100644 --- a/lib/csu/amd64/crt1_s.S +++ b/lib/csu/amd64/crt1_s.S @@ -60,10 +60,11 @@ _start: addq %rax, %rdx /* env += argc */ #ifdef PIC /* - * XXX. %rip relative addressing does not intended to use in the - * large memory model due to offset from %rip is limited to 32 bits. + * XXX. %rip relative addressing is not intended for use in the + * large memory model due to the offset from %rip being limited + * to 32 bits. */ - leaq main(%rip), %r8 + leaq main@plt(%rip), %r8 #else movabsq $main, %r8 #endif From nobody Wed Jul 19 19:02:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lZK6n0vz4nXcf; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5lZK65Cyz3tZJ; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689793369; 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=tbDqXrIevHDURYRlUxtw+E+8sGFdH3L6r3XoLTGTY5E=; b=hJFU0mOvvHlkZt4p4ORnGarMFaKZgzIzyvj0qZMc7pRCBeg4Lb/K7cJpt+MEUQfzsIqYLT qDB4laFUIWrTJjFMuLvT62t3XvzkeiVZhVnXt1LYR3J9becwjdQFKFiCqXZCPgM4ASuiv9 BIUOIa5HpzI2EtlLuLBrMl8EPmijQLifyv9aeOcMUbijkYY0JQ8MvYhiENGPbVKhEyYYx2 fCgxqovwnqo3kS7idlwhmNlSqyAms5iVeiV0ueCUNNi8JvYcWzB7MJ0h4MVtsqgMMbkwiN lA0fhoyseiuUka+MJibElQJsrUT6ewnqRO2aTV/YRTH26C6CvV9q+roL/10ijA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689793369; 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=tbDqXrIevHDURYRlUxtw+E+8sGFdH3L6r3XoLTGTY5E=; b=Weaq5pzXoH8S80ULeO75kRVXC+PAVoPo0CU7de2b+0EYzIxfG7eStMTrzRMSU1tJGybIXZ br33PiPmo2xA8nmO+Zy3unY6wO2xgoZ3/3zdCwmLuA4EZtqq8la28Gk0O4eG8e6g0SBPpr gOISzy8Z9FlwS7svdz4p0LsUJY6fi+1p/X0QSW2mukoFFxnFz684gLWhaMC79ZMn0LbT8j Pt8E4IgNjA0O0Z3f2a+HxoILvidDDpeDzwRPL2yW0PMmssFxPBiSNAQ0z3garOrN1hSlhm E54dnkdPK4c4EUpuV4CXAR0bpOUms1/3/n+8GlKFDEgBHe4oBq2aj0hSyKOn9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689793369; a=rsa-sha256; cv=none; b=wap2/xkb0HbhmNEU3W/9hNquAgcbSLu6AAn6hoqZ3fHkgOorYg0CTb1GGhQBI0Vly0vnA4 NaSo2a191Hq+9RYBiCOqOyyV+TOX9THLFYpjxeYCdvAQzvgmrkAV1BSGtA349VcdKRUDNR YpF+yRR57+PqNVBujhm5pCyZflTOYhkPbHnHixesw3UkyADw6wpdI1Pdph+nFBazJoUJSj H6Ilj8wdMK/8C1fJx3AFH9X5h7Ohu4qnxlaFyZ8F/H/bjneV/5kGEfRDGd9YpqQ1mR3LGy ZuyryIgMMLPbsoHoOLVyzOlLUF3Ou/4QqQzEWd9mX2qbeKjkEP3ByF4hq2jXjw== Received: from hal.tijl.coosemans.org (unknown [IPv6:2a02:a03f:894b:4700:8583:8045:5320:f61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: tijl) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R5lZK13pJz16bf; Wed, 19 Jul 2023 19:02:49 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Wed, 19 Jul 2023 21:02:46 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Dmitry Chagin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c84617e87a70 - main - i386: Switch to PIC kernel modules Message-ID: <20230719210246.30bf78b8@hal.tijl.coosemans.org> In-Reply-To: <202307191821.36JILaDo009337@gitrepo.freebsd.org> References: <202307191821.36JILaDo009337@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 19 Jul 2023 18:21:36 GMT Dmitry Chagin wrote: > The branch main has been updated by dchagin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 > > commit c84617e87a70f4aea5df46fa521835aefa7d8163 > Author: Dmitry Chagin > AuthorDate: 2023-07-19 18:21:04 +0000 > Commit: Dmitry Chagin > CommitDate: 2023-07-19 18:21:04 +0000 > > i386: Switch to PIC kernel modules > > It seems since the last llvm project update, the lld linker has started > creating a PLT dependent kernel module object files. > > Reviewed by: kib, jhb, emaste > Differential Revision: https://reviews.freebsd.org/D41088 > --- > sys/conf/kmod.mk | 2 +- > sys/i386/i386/elf_machdep.c | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk > index 246af5ba1e81..a83d64eb8bf7 100644 > --- a/sys/conf/kmod.mk > +++ b/sys/conf/kmod.mk > @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > .endif > > .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ > - ${MACHINE_CPUARCH} == "powerpc" > + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" > CFLAGS+= -fPIC > .endif > > diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c > index d8b7ab9c586b..5d8b41a16672 100644 > --- a/sys/i386/i386/elf_machdep.c > +++ b/sys/i386/i386/elf_machdep.c > @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, > break; > > case R_386_GLOB_DAT: /* S */ > + case R_386_JMP_SLOT: /* S */ > error = lookup(lf, symidx, 1, &addr); > if (error != 0) > return (-1); Is it this bug: https://bugs.llvm.org/show_bug.cgi?id=51736 ? From nobody Wed Jul 19 19:20:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5lz72Twxz4njGp; Wed, 19 Jul 2023 19:20:51 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Received: from heemeyer.club (heemeyer.club [195.93.173.158]) (using TLSv1.3 with cipher TLS_AES_256_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 4R5lz636Gzz42sN; Wed, 19 Jul 2023 19:20:50 +0000 (UTC) (envelope-from dchagin@heemeyer.club) Authentication-Results: mx1.freebsd.org; none Received: from heemeyer.club (localhost [127.0.0.1]) by heemeyer.club (8.17.2/8.16.1) with ESMTP id 36JJKf7w003638; Wed, 19 Jul 2023 22:20:41 +0300 (MSK) (envelope-from dchagin@heemeyer.club) Received: (from dchagin@localhost) by heemeyer.club (8.17.2/8.16.1/Submit) id 36JJKfUD003637; Wed, 19 Jul 2023 22:20:41 +0300 (MSK) (envelope-from dchagin) Date: Wed, 19 Jul 2023 22:20:41 +0300 From: Dmitry Chagin To: =?utf-8?Q?T=C4=B3l?= Coosemans Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c84617e87a70 - main - i386: Switch to PIC kernel modules Message-ID: References: <202307191821.36JILaDo009337@gitrepo.freebsd.org> <20230719210246.30bf78b8@hal.tijl.coosemans.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230719210246.30bf78b8@hal.tijl.coosemans.org> X-Rspamd-Queue-Id: 4R5lz636Gzz42sN X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:61400, ipnet:195.93.173.0/24, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Wed, Jul 19, 2023 at 09:02:46PM +0200, Tijl Coosemans wrote: > On Wed, 19 Jul 2023 18:21:36 GMT Dmitry Chagin wrote: > > The branch main has been updated by dchagin: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=c84617e87a70f4aea5df46fa521835aefa7d8163 > > > > commit c84617e87a70f4aea5df46fa521835aefa7d8163 > > Author: Dmitry Chagin > > AuthorDate: 2023-07-19 18:21:04 +0000 > > Commit: Dmitry Chagin > > CommitDate: 2023-07-19 18:21:04 +0000 > > > > i386: Switch to PIC kernel modules > > > > It seems since the last llvm project update, the lld linker has started > > creating a PLT dependent kernel module object files. > > > > Reviewed by: kib, jhb, emaste > > Differential Revision: https://reviews.freebsd.org/D41088 > > --- > > sys/conf/kmod.mk | 2 +- > > sys/i386/i386/elf_machdep.c | 1 + > > 2 files changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk > > index 246af5ba1e81..a83d64eb8bf7 100644 > > --- a/sys/conf/kmod.mk > > +++ b/sys/conf/kmod.mk > > @@ -166,7 +166,7 @@ CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer > > .endif > > > > .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" || \ > > - ${MACHINE_CPUARCH} == "powerpc" > > + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "i386" > > CFLAGS+= -fPIC > > .endif > > > > diff --git a/sys/i386/i386/elf_machdep.c b/sys/i386/i386/elf_machdep.c > > index d8b7ab9c586b..5d8b41a16672 100644 > > --- a/sys/i386/i386/elf_machdep.c > > +++ b/sys/i386/i386/elf_machdep.c > > @@ -244,6 +244,7 @@ elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, > > break; > > > > case R_386_GLOB_DAT: /* S */ > > + case R_386_JMP_SLOT: /* S */ > > error = lookup(lf, symidx, 1, &addr); > > if (error != 0) > > return (-1); > > Is it this bug: https://bugs.llvm.org/show_bug.cgi?id=51736 ? I think this is it From nobody Wed Jul 19 23:37:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5sgk1z2kz4nt0v; Wed, 19 Jul 2023 23:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5sgk0LXqz4LwX; Wed, 19 Jul 2023 23:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689809874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ86NUyN2zHvdNk8kCdkkXN5ngfOHOfsocdFHOtdzCQ=; b=IAdYqAegQzbkz7o21v4xrL57AcSHoLn+wkYINfdNSBd3dLvXE63kmNdpXfGAGN01uPxBtO B6gDn6vX2kQxACCTTtxO21H9niZyUZoIhcoottGU9r9urGL4jTyKkj/I18YOh9Yd/rviSt uBT0+0jDnVZeU+lynkvDtkcpyC5bKPpRacpKftrcUKE9iB3h2z752aG05553CVOIypcVgV 6lDrXN32EODjMlI5oawPJe/493S9gHTL4elQTOKm8nmmk/KkiN43sPyiWU8l1TDCTWwMVe O9hY9Tw1QSbr14dy27C7cekBdt0S6Kx5U2JzntaingFfeU+lxPc+pfEV+nXy9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689809874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gZ86NUyN2zHvdNk8kCdkkXN5ngfOHOfsocdFHOtdzCQ=; b=gJwcUtY7IdPmcoZwOt28uuWAFq3cw/FHJnPCS6nwW0EOCS6Z0UQQNj916gGhYnQyH/pYhc PcKpBbQXhD38PgkMDXjcjlplbP/Q14XZ8X/iI/IWOUZ44xZZecyS/7ueHvV4WN3JHUvdxM 0U7vuw0dbUsdC/XfV17yr6QPF5eklAtU8Sg3za5aH7AYC//mKFzmKiZBs2/8X6UVNmobXJ yLIQs5WSprxyR8UMDvsqRkd969yL1RjhgUjfW9bF9qE5TFEsznRK8NhPXFiQIbk6UbdXJG QPv2nimUcKwakVQWVaQBcKNWH7Tavw1N2T7xZ6jptkmv6ARSTjbkmedq2DxQ/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689809874; a=rsa-sha256; cv=none; b=WXUGv4k4B+igQGSqrNUjiSgMNZUyYQUI5cEbFT+0NnL/OHMc3znH2xhWPd4BbLhv20IIUT TLvmQULUH6WoXwEobFmvREylY3xIsdFFBiaGzd/cFDBX3DCOrZ6tYi4fElfrJb0gME6Rj8 JvhEmi7cCi5YsnU+L6ZaQT41Wd/fktaVZTVP+TDzKTG1XhzzU4x2cVQ3r71TxCsZtV++us R7shsO0cYfkj1m0Rpb1JDfPrXHR0vWhZ1qF1NCzE7MxsOyjJlMxT4XvKnVmDz0MZPVlDs0 OAWz6dUPn7xn7Sk8iSDfzvHDMfqujAHt6JPv3q6SbqLH+6I8EnhWfkpQnD681g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5sgj6Xz3z17C3; Wed, 19 Jul 2023 23:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36JNbrx1031273; Wed, 19 Jul 2023 23:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36JNbrLi031272; Wed, 19 Jul 2023 23:37:53 GMT (envelope-from git) Date: Wed, 19 Jul 2023 23:37:53 GMT Message-Id: <202307192337.36JNbrLi031272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: a52f23f4c49e - main - iflib: Unlock ctx lock around call to ether_ifattach() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d Author: Eric Joyner AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner CommitDate: 2023-07-19 22:51:26 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner PR: 271768 Reviewed by: erj@, jhb@ MFC after: 1 day Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 --- sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index d056570d9a99..9f433481afda 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5386,7 +5386,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct goto fail_queues; } + /* + * It prevents a double-locking panic with iflib_media_status when + * the driver loads. + */ + CTX_UNLOCK(ctx); ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); From nobody Thu Jul 20 01:32:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wD30wgSz4nVTd; Thu, 20 Jul 2023 01:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wD25SPkz3mmR; Thu, 20 Jul 2023 01:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bx2s3iDPVQVQLGozjpoqWDiiOLvPI1qhQx5/DsdfamE=; b=vZzTRPwBJApSy6EyTN6g4JidTkOtSX48QR3jF/2MuQRE7QIOzNo2DmQMwKJdl6QYwuAruB FXJBKvfqAvccu6OSJ27wlzsIy6uXrFBimAdgveazOtxUBEfYhi8TKu8tehmZ+EGQb/rJ9p IWOu1bDlZzlG2YVazsp9ai0PVHmgzBas2hLIsc8jM0kI70TJAXzuzwPWOg+V8yVRrnkzBK R2ts0WHP0/pXKJL9H7ExADK3UqM8LeObD5DUDU4P4B/W28x4vYoxQbM6KcYvYLVsTiuCWf fmMHXtnrgPyfkm6BxoB5GN4HpV4WzU0NTa3D6lcAldjRvMV21OhWl887lyoMWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bx2s3iDPVQVQLGozjpoqWDiiOLvPI1qhQx5/DsdfamE=; b=Vf+WGxHgpyv+p33fTKKcDlrm5ckTnPq55nys206Q6M2Tkt6ZEmruHyZLaStNtEwXN+2nui O2mOKGWbhm0Lhr8oFBswxIEAgNWFU5XhF4wmky4UAQ5UDNA89QzFHITCqBKXXMPQCGzjAe OkgrkzM+oPHRp3SYFlb0p4eIP2LMWltYrh50jNdPt882YtepsWRM+QzlNQVpkXKFlhnrIg 7k6gC0K3FCDxY6Q6pC7+zrLDX/j2zcKg1mQu+k7Cu5au0b4B5mwR8M/2QVdy/mtNt3l+O1 ZMogpzNdBfVkdsEI1zKGrpw/wCKYPz4FHWvZ7rwokEjyaFyj6dMIn6s/46Y8aA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689816754; a=rsa-sha256; cv=none; b=FwXrEE2PsHSXr6SRpgAi9xn2RdZdtWvRuWVfD5rGckCXwKQK7WvgDASjj/NaK2ZFcUWfXc xKp7rA3cj4qknjJNGWMBZJqRqRaBfW4fNMPcAT9zDxstMdRKSkbllOSbo5xIz6a7xaPuGZ UeDCsO30cpnCRKtDHSt+RCfFiAG+TKEz6dSTxLz7EnlEDojRGDBkr4f9EpanEWdsCMdb8e M/fF+wG0wSXpIBzgTF/ith3D308w9EBO5Kt4bvTJ81DhaH2ATgvCrPTklQLQlA9N4LAP8K yXNohz9greTSZl/+QovKzWuRX7qihrRD6AwllGmRkuxTQNaBlJ9Vv7pw4E6M8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wD24YDgz1BBM; Thu, 20 Jul 2023 01:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1WYs1028916; Thu, 20 Jul 2023 01:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1WYm6028915; Thu, 20 Jul 2023 01:32:34 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:32:34 GMT Message-Id: <202307200132.36K1WYm6028915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: af8d597af0c1 - stable/13 - release: ensure gce-check-depends installs lang/python{,3} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af8d597af0c12d46e80467964144d255bee7756a Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=af8d597af0c12d46e80467964144d255bee7756a commit af8d597af0c12d46e80467964144d255bee7756a Author: Glen Barber AuthorDate: 2023-07-12 20:08:40 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:30:20 +0000 release: ensure gce-check-depends installs lang/python{,3} PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 0ed426276fd52e917506ab87c05a61c6641ae298) --- release/Makefile.gce | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index 106804de61e3..ff260726a844 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -48,7 +48,9 @@ gce-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk . else - make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Thu Jul 20 01:32:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wD40qV0z4nVTn; Thu, 20 Jul 2023 01:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wD40Bgkz3mqJ; Thu, 20 Jul 2023 01:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnUeG4SfZw20Z45LibXbH3HwTPKRGAinPLqiJEQqZHI=; b=P1shWtK83rNC2TkIxcEV+n861E7i2m8ol4TKjQZwCH4AkvB4sZsLgZufSAZqZ0x88bh1J0 njq9OCE95bU/C6hY51YZD0N1t8DwKK1yI5fkvkRSCujXvJ1AclekWGirL0sYbF1W5A+iBe IerLb3yW/fRJ/W6L/dTwaQwYfaRAEDDWkSwtgCNeqnGpnU7rGnwK0yEt2EcE4tCCkJy+5p 1gnTy8FJmtBUeGhzAp2LGlrWvSGyRXib/VCk0H++q95ocBqBXtyChKWXIsZEsnT6vsb12W Wfq+pacP6KPFcatRZKa/8QKdu5lIOLLdlBNZhV6sL8/fBVmsHz13QLQpBmZ6Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TnUeG4SfZw20Z45LibXbH3HwTPKRGAinPLqiJEQqZHI=; b=UEAA4qch+smvgFBv8cqyvUqutSCDoWbL5C+iyq8G5ICu9SUh4V9TmdorNu87tnGpI0ay0L qpezBTp+mM7KAGxyT5h3mKNECIDh5ISj/4T8buW794j+oBA/q/eZ4tRC/72/ryKnizBCa0 0PILNzgnhzY8s+V3D81dPP+Tlk2+lo95blaxdyM3iaDxTNjHd6+B1pXxJgODlo1I8PGeEL 0K0vijcNkGmeXkylq49IsCB8vjlSxKN+dFnt3l2liy9xWbJ37SnVu6StC1N5hbhexjesFK fL4eJ/0yC/TH+y/+C17RIzz6DqS1G1mWG8SpMI7zobTkd0FB0QTAOuvDqeR3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689816756; a=rsa-sha256; cv=none; b=T92yvjavKKh4awbSSL9dRRy0+umtU6iXVTOcTOxubCV+cHbePwx4mC1vWarV+OHqR/2SYQ aGPKK1XNXHBvkAROqjhMyaGI5ZeOpiExVTYIboNo37ChRLL47Cenub8EDF/SdEbpEWTzFr kShmQfeExK5+jYAo8amlKJjUgtYlRVqHl1D98NTu12cqo6dQlisyqeAlq+xvhRJRTq2O4i i9u/B4BQoRKZoGQmOPZGocSLiliGmdjtGsdp+SGPRfvZgXnUqE5Oo7mJu5QA8+EHqsU139 ccO7woSAtPTLivklLopznchRs5Qj6Yx/+el50DhN6P3RB1phzM3Lwkry/UCpMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wD35T4vz1BbJ; Thu, 20 Jul 2023 01:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1WZ2w028939; Thu, 20 Jul 2023 01:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1WZ1I028938; Thu, 20 Jul 2023 01:32:35 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:32:35 GMT Message-Id: <202307200132.36K1WZ1I028938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 119b44c2b2f0 - stable/13 - release: follow-up to previous commit to install lang/python{,3} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 119b44c2b2f0ea9141777fe6774e5f9a3d47a2d6 Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=119b44c2b2f0ea9141777fe6774e5f9a3d47a2d6 commit 119b44c2b2f0ea9141777fe6774e5f9a3d47a2d6 Author: Glen Barber AuthorDate: 2023-07-12 20:49:53 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:30:53 +0000 release: follow-up to previous commit to install lang/python{,3} PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957) --- release/Makefile.gce | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/Makefile.gce b/release/Makefile.gce index ff260726a844..ff364c9287c5 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -47,6 +47,8 @@ gce-check-depends: env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ + net/google-cloud-sdk . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean From nobody Thu Jul 20 01:32:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wD50rGGz4nVjD; Thu, 20 Jul 2023 01:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wD474Bsz3mcW; Thu, 20 Jul 2023 01:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kosq+OMJ1VK+TJN3oz5IEoIkS/+80bNn3iEw/YERYyk=; b=p3RbgrLPLXSCqqMdb3ev1YOm144xc7faxItVLT7IbJDKdqnGOI03KIe9428woxj/sfdvxF mbL1wCoWnUkJHGIGpCPs9CZcvLRbgxUOJkbTpQtErs4wL+ScvJsLcBG2VJI4ef67L/+09O nygjXYsgDf+vA4ZVNI7lkWvXN+UDzkl0uZ9/rzS23/yIZ3AJz6QN7/ymR9siVdps6Owm5F jDXK2OFvVgdctpdcyCpcUuMFqpSiP1PiD/iRiP+81/t5Fp/xvV8epvLNewKraZ3FkIZ35H 5Z5beLLlxz0QEyLATjOjMGaLeykQK8nl21V4yD3IX+jlnQYEJTe+6edrzkou4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816757; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Kosq+OMJ1VK+TJN3oz5IEoIkS/+80bNn3iEw/YERYyk=; b=ot5cz3rJ/8UHxiS9xSuV6xk6UmNCqJUJDU++etTtcOL+018wOxwEdCFYYigviQqnoc1N1f uZ8l+NgSUU0rnQYQEAWpwgw6jETromrU/nisv9FT5MBBzVecRARIjJu2KoCfNwxOA2wt79 /TExGN1REhnqcsrIIGAyxfxwfjn/ACt/HyFr+DwaZwWY7PnxfkATN578HkERmFSig+hpwA WgHb7BNtti6nx+GzAtiRVn2p+POr6zrPegTw/wZfzGa/t6aA7Ie4LfkpuZTFewGxtPylNd DZfeFR/tBCE3b5Yfe8MFIbK+bnI9CT0P9HX28jMu1pMcRhxgEF9PGN6QJAN0BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689816757; a=rsa-sha256; cv=none; b=asRVhQItNMvP9puwdUL801t8B/7o/gFieGbMUJj8xhPCwqDAAyVVjt1bNunJRPsN10x5mD ObsJovSfdIj11xiPNwuD7upo1r/1SpmGJ6rwhI/LuaX7BxfKanT1o8sZk/c7L72Qy23WkA Hu/6daWNujvY4QV9+iorf1ZfgB4BmOtrYw7eUMURDVyQLNvomerIH/GSQN9kuJIZ3C21lt BSZLGWC12IASlJ4qJnFX6uZQsexSaNajJuH/MSIZyowtx6x6YjQ4CFijvuHHysXymEkwGz IyALAmcXfoNeLVYkZhImbZKeYeDeHi8SkPW62dulqVdo8HD32BAz1ZfmV6jJrg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wD468TNz1BVT; Thu, 20 Jul 2023 01:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1WaRw028958; Thu, 20 Jul 2023 01:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1WaRK028957; Thu, 20 Jul 2023 01:32:36 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:32:36 GMT Message-Id: <202307200132.36K1WaRK028957@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: ca7d3085f1f4 - stable/13 - release: remove a stray backslash List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ca7d3085f1f407df504ea7216c74526bef4727b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=ca7d3085f1f407df504ea7216c74526bef4727b4 commit ca7d3085f1f407df504ea7216c74526bef4727b4 Author: Glen Barber AuthorDate: 2023-07-12 20:57:57 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:31:22 +0000 release: remove a stray backslash PR: 272354 (related) Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 510fd83138001b0a6e45b3fa6a7249377f806171) --- release/tools/gce.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/gce.conf b/release/tools/gce.conf index 725709e3f335..48f95a82b3c8 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -8,7 +8,7 @@ export VMSIZE=20g # Set to a list of packages to install. export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update \ - firstboot-pkgs \ google-cloud-sdk panicmail sudo \ + firstboot-pkgs google-cloud-sdk panicmail sudo \ sysutils/py-google-compute-engine lang/python \ lang/python3" From nobody Thu Jul 20 01:32:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wD61xPXz4nVnR; Thu, 20 Jul 2023 01:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wD61Bplz3n08; Thu, 20 Jul 2023 01:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNA7Nat+7Hug3ISASE3XAQVqgAQcDhwAtYVQ4rc2eVo=; b=LZ1kGPgW7ecqvlMXk7MZu3aiL6K7xZ3cqUs8A8BfjaYEPetLr4KGempe1zoV1kAI+ABDqS SeMfywVSBYxtCRPG2Su/cn33ojPbiUfvYMluS7RdtnxELZcuvYzujc4mgSbmX4pQDHQy5O T4v4bVT5PJGSSGYLiyGcSfskEtdLhf5YLYNZStRJwfObMDiic75Fl7Ik1YxRYEfWbXVq6u 8PO9YOe6XWLgCr/nESEaeaVYcQAQXn9EYuz7ohbzY2hEZolr6vcHEsH4esWgBreCbUXOH3 vf/d2uyb84jgGa4s1Mo0AOxUGrC+J8fHZscxYJqKJ51Uxw0V6X1vIv7L4BvjSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689816758; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jNA7Nat+7Hug3ISASE3XAQVqgAQcDhwAtYVQ4rc2eVo=; b=akpCWZsHYvuyVaTXcBzVbQb4YzzMtWf40/OjQWXgB1wNQ6dHlcsf96H74bY/oT1SP5i298 oiEkADNiuEkpUyfrxIzcfwxecnONJZnKXP68/zRWzyK+KIT8aJDEyBAoUTQ2RrLd4rHKha 0MRimIJztoICWNieXdAJImeazKKBrTTxZ1xbQvbalPo9Jqw1iGzZX7BTio7WGOpxl3PJHl yc5tCci7iZYV6rw1tvkFpWMC0FUy8j6oT/EB1Ju8oA39D+7TarhVZ6I6hsyN3BhMuECaQa NL1VCNQ9rSlxxWxHgWdZ/tz0DMOljwd5FB/XmfzoiXAm4U48kbndnfUfmwLpVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689816758; a=rsa-sha256; cv=none; b=j+8zn9PLIvg1+veGQfaATCO0aIBNRf7bx69bGuOLp/O6r+QQqJXnotGQjp7MK9x3jpcOM1 2ie6vSPqXxtr0DOWf4/kNM4muRetfpsuRaavGBU/FN8WwmVlVyCfWlnAXXxYtMGE0wj5jo JUgz93u0l1R+oNJZp3z6EYdCu5RkT+5RLiq37qKzttqwIgYMhqYY4J98jlltpBiaqmmnAp da5iJLp/9nXs2SbsfRrWPFTjAyz1/MFcso4GCjq43Nkb5V5JNlmupAlcancMFMgE+uBrxa P3X5FMNcFKQuDS69oNXUEta9Sczl4OFVZoFHokwOKuoJrk59m2ha++tEvQCsug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wD60Bs9z1BKH; Thu, 20 Jul 2023 01:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1WbNd028984; Thu, 20 Jul 2023 01:32:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1WbUD028983; Thu, 20 Jul 2023 01:32:37 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:32:37 GMT Message-Id: <202307200132.36K1WbUD028983@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 3e94b6a23808 - stable/13 - release: adjust lang/python* dependencies for GCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e94b6a238081a1178f2e6448cb9d91028784bf2 Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=3e94b6a238081a1178f2e6448cb9d91028784bf2 commit 3e94b6a238081a1178f2e6448cb9d91028784bf2 Author: Glen Barber AuthorDate: 2023-07-17 20:16:46 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:31:52 +0000 release: adjust lang/python* dependencies for GCE The lang/python3 port had failed to properly install because it did in fact already exist and FORCE_PKG_REGISTER was not set. So, behaviorally everything here was correct. However, installing lang/python3 is in fact not correct and not needed, so only install the lang/python port to provide symbolic links. PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit b24c35b326dbd355070335e63d02e7c29ee58bf0) --- release/Makefile.gce | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index ff364c9287c5..17f4974b1c53 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -46,13 +46,11 @@ gce-check-depends: . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk - env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ - net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk \ + lang/python . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean - env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Thu Jul 20 01:36:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wJn5YRbz4nXF3; Thu, 20 Jul 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wJn4jGZz3pY4; Thu, 20 Jul 2023 01:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dhD2aSKk7Sr3K46eH8CpyOna9mpHybVptCgE1dLC7VE=; b=cBq/SjBcfMlZyLbc5aCvYyG9U3lFxup/9XKsGqSrFsJYi6nu36dCoItlc92hieTzez7ZRy A/FngUTG07FqqCvbr+nMZZbas75HESGFQJP1K4s9sGr222492g4NfnNk4GprH8p+WFQvu9 1Wy8ls02JFEczK1hImDMCFD6pYFzLiE8wWlcN8piBHzvHhhXRjm6SuNJUNWsh5bCChSKji 9ICJ/8ydyaMet6/ICFHJ1LVCa5dhw3JAG/FTTTxQpK9xQsRwrpUNrceG4dmrVpf/nnxkcQ 1ZYf9a66QLPvpjwNZKAiwaKmDnn2UuznvmkD5OukFNY52cJs2R2hYtg8IA1gtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817001; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dhD2aSKk7Sr3K46eH8CpyOna9mpHybVptCgE1dLC7VE=; b=G4q92BoMWvAFVhJC+Xw+nqI9Xewwc9nyHsRlSNne2nv7t2LXZJB61YSa6idzW1Yb3Yze1Y KJKsTyhoxY08S90MKndkvCbrMRNc+5fPaiSUftRdEWAHggHsUL6RUl5j3dczCZRVh14gQF wBM5W1/J2TirN9YcvwVpJ3ePjtaCEmfQ3EOjabq9769dwiaxFdhsPJTQ6ONlOj+uSPy63L 0mfGtVZ/8HIze1EbCXA3Ia1EL+93awP1c7TqFDFCFEJAZhArC9q7eAFOeWzWJvCuY50DCa tObbiseKmugP01jD/l07MbgjxibRiN4+kVS/W0sWOLUfkebT+G3MjNQd7J/oVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689817001; a=rsa-sha256; cv=none; b=f8D1wnZw4E1Ig0+h3Wji8FRDOAo5EJj0pfFOAuq9fxO+GVnsCkJ3zEB2Pp3DwcQrYkIPgL CkJ99uYFTZEwmWWJD4VIDgOYCTYSux7hpAa9wTi3Eylj3370X3V/YvaeZ700d5ZOBHiopw X+2n9ZNjWK9RBAt9uP/6655NbPrila7LL5/MzoJOnN9qFy7I9PTZ3o0VR1MRWTh6jHA4Ke aELOQsN1s+S2boTAeLKCtLfv92imHWGmpF+1yxMu+WoRe9ICa7QjwvEJ0l3S6AmDQcxJdq xjub1sXNFxcTKSZwDmSKYYmovrNqRrSQcC6Kf5R8WQRINSCy72Gt5tYgRHsUPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wJn3X6Pz1BBW; Thu, 20 Jul 2023 01:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1afCp029711; Thu, 20 Jul 2023 01:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1afG1029710; Thu, 20 Jul 2023 01:36:41 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:36:41 GMT Message-Id: <202307200136.36K1afG1029710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: e7ee4c09f789 - stable/12 - release: ensure gce-check-depends installs lang/python{,3} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e7ee4c09f7890f2cd8ed4a0ce27d56583d6ac74f Auto-Submitted: auto-generated The branch stable/12 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=e7ee4c09f7890f2cd8ed4a0ce27d56583d6ac74f commit e7ee4c09f7890f2cd8ed4a0ce27d56583d6ac74f Author: Glen Barber AuthorDate: 2023-07-12 20:08:40 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:34:49 +0000 release: ensure gce-check-depends installs lang/python{,3} PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 0ed426276fd52e917506ab87c05a61c6641ae298) --- release/Makefile.gce | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index e466f9a323bd..0d835a1cb0a2 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -49,7 +49,9 @@ gce-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk . else - make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Thu Jul 20 01:36:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wJq1ldCz4nXF7; Thu, 20 Jul 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wJp6w8bz3pQy; Thu, 20 Jul 2023 01:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j5C4XYKcw5DGFmQtl9th7Nc3m51UDErb1OwJPwBcBa4=; b=iefWTv7B2h5l66FO8E6rpaTWuzuh43MqokfvC2rrsChGIZBqMBK3+uBSkJJu/68flTYUpc 3qymzvuxOVmaG4ojjDfciat6I9dO3p7khCd6UNTV7ena6/O0OfAF63rSmi0a/DoUEk9eyN 3AdSzyeKttJdCbo6Uj7Oga3UulKAqwwQ/ylN4zlJ+3bg9lANJKA3wi/Hpf6w7NYGV+auwd Adh5QbXiIINXs4IGY08zsDNbKoqTPlfcnIJJc028wNZz+SxTTBj5riQbHid4CuqA6p7RZT 2vJgEsg3WoNKNZ6BAhiMfLNKdbMr4eJ72HpX4KaNsuN1aWyBCrNgAIEsouZnrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=j5C4XYKcw5DGFmQtl9th7Nc3m51UDErb1OwJPwBcBa4=; b=XXmzXzt2rAH/l8Lyw2JovU4DBR0i+a7KX8ke0URGKXfpiDU8NRlx5ofuB1HsT9YZ129ZEP SotxChNH+QWUbsx8fQxp6NuszyB2b/Gs6B5QIch2YLuapQ8xAs9vTTlMpieB4teQqEEGYG zGyyhEUT4DScdXZ/xO+srDI8Xk8Jx5WrksL26mEc8/DHnX0v7WFmDIdieXCUGlczEjaRtg LoUMYTdC7B7nVLK3rok9vDUC1a45cc4z8j3OrxL6Xd1qOk/jdYUxAq526bqRIYB8Yorscd 396zNACGJIyul4HLplJniXOKavLzxw8xuBmw9oL7L8KYSWrLy8Mlf8nn63EjyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689817003; a=rsa-sha256; cv=none; b=dFfz470g0+qn9MWN4vYrYvqgnhi5rq19w9d2PZIXnzUfLUpMRXYqjET7N7LAvXX6DnMnps vQ1SwEacV2O2DGg+mhwk1PavsAMcNUmm/64h+OMJMoFIYHl6w5F7+OI7ak7cPYZuMnPXZv L/MKusOWbW87Dycpowo10Ga1Wzm0y9CSABmaE04UdBmyKmFmqbM16u2+axVj06llLhKEQG eQHvBmDS1XKjeQ+Kei8aKY0B4wRrohjoGrV/vHjP0/3bpZYW94bLxcwPe9dkdv1N4TQhtS FXPWinJ07LVtKPtZuMTp4ArZ1iDX+0dIlHPlcm9f7UJcQkH0I/OSeGgMlIpM1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wJp4PxQz1B7W; Thu, 20 Jul 2023 01:36:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1agDN029738; Thu, 20 Jul 2023 01:36:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1agnu029737; Thu, 20 Jul 2023 01:36:42 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:36:42 GMT Message-Id: <202307200136.36K1agnu029737@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 7815d3738acf - stable/12 - release: follow-up to previous commit to install lang/python{,3} List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7815d3738acfeb85f71c0ad714b5262dea5b1d53 Auto-Submitted: auto-generated The branch stable/12 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=7815d3738acfeb85f71c0ad714b5262dea5b1d53 commit 7815d3738acfeb85f71c0ad714b5262dea5b1d53 Author: Glen Barber AuthorDate: 2023-07-12 20:49:53 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:35:14 +0000 release: follow-up to previous commit to install lang/python{,3} PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit cd8cad0ef5cd534dc7ae1dd9a470cac2057ed957) --- release/Makefile.gce | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/Makefile.gce b/release/Makefile.gce index 0d835a1cb0a2..2eb6c8f46c29 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -48,6 +48,8 @@ gce-check-depends: env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ + net/google-cloud-sdk . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean From nobody Thu Jul 20 01:36:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wJs4Vjhz4nX49; Thu, 20 Jul 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wJs0l9tz3pYm; Thu, 20 Jul 2023 01:36:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzbYQtJKxFmfBXOQcYmpEiG5cfbBR/LOifqW9W7UBeY=; b=mXTpC9Sfuz3gSjKFkO4q93r6wszBUoGxoLMh+7u03bEl0bhUvDwseY9VE2WxnvRBAr8Snt XSOo6zbeF7S0XAsKDV8PbG6jqljrfcggqLMx+UDjirT0MxFupqux75lBDRs/3t+ehNJqHM m/UjrWaiQOk5BRpNoMASXTAl9FPSwOO3jgkfDPIDYxoxXETjqIFQqd2ouSJM0IV0/2vxGJ QkBRPRYdvfYm1QO8v3cPPFOkSHGljJzQXUOyMHY7OfMeOyzAPxe2fNiLlDk0aaSIoRYdoW lM5rv/tkPAf8dEOVfEsGf3CGLXN43lM/oimMTyA7YK6fGhzrlHtb2hx5Ipa18A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kzbYQtJKxFmfBXOQcYmpEiG5cfbBR/LOifqW9W7UBeY=; b=KAt1z2Lmqbr4XkifoijzQKeP45i12qTwH39KzTSuwHcdwl6CnHasbmBXBwBOEvPHqavLOp jOEe0a8tbjKt6eaw2R0urF2y6LLrp7cosM4aLrVJkMfv9+QlUmn0uTLzHN/ITfA9EyLRCs sn6oC5p1aOPPy3f6zAMCCyQvAZzFccOmcIuaUOfNUaWYxu+NxsDhNCxake19qkN7QwBIoY 3PahZyHIXVVjoiZaRO55GQ24CQCa5QEseIMAmPpD4FgIVSp9coPTe9hpmaVxw6YAWA4+Wn Sq8VmSMsHQR0Jt6Y0vOBNsMabZnrS3rVLiF502gj5hYKPvoPIq7sDQQqVk9Ujw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689817005; a=rsa-sha256; cv=none; b=o5vI34AKkzW99iP3Fk38FqEPD+i1k5TxKdBFBcQuniTcHhDiP0gqIr/LUEfnjdVJJ+q1B5 x5yj3WY2l6WDZVITMWN7PZKvdaJFcLQBPLRAoCOQ3WCVF9ym224EWa2W60FovCKMRnaJzD A1TuaPiZSur2KZ8wrImMjLcKxFAqHvjE+BwaA+JgJIonaFgp9oEV3PeBMULXXP2NYp5yg/ EzsZj76v6wYXhrtbjrt+GHu0CHS+kTCOW4rMUA3cZO8Wq7T+yJ0NVdhHtJFR226rI06vau mDihBp6yynjWuuhSmcDrSf2jaXR116NRPGI4hxOx6yCIkAmRcCWj73QMyJ9WBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wJr6PGFz1BVd; Thu, 20 Jul 2023 01:36:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1ai7U029779; Thu, 20 Jul 2023 01:36:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1aiN9029778; Thu, 20 Jul 2023 01:36:44 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:36:44 GMT Message-Id: <202307200136.36K1aiN9029778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 58bc084de5a2 - stable/12 - release: adjust lang/python* dependencies for GCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 58bc084de5a2155f34ffbd5fd3812fb432e1a72e Auto-Submitted: auto-generated The branch stable/12 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=58bc084de5a2155f34ffbd5fd3812fb432e1a72e commit 58bc084de5a2155f34ffbd5fd3812fb432e1a72e Author: Glen Barber AuthorDate: 2023-07-17 20:16:46 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:36:06 +0000 release: adjust lang/python* dependencies for GCE The lang/python3 port had failed to properly install because it did in fact already exist and FORCE_PKG_REGISTER was not set. So, behaviorally everything here was correct. However, installing lang/python3 is in fact not correct and not needed, so only install the lang/python port to provide symbolic links. PR: 272354 Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit b24c35b326dbd355070335e63d02e7c29ee58bf0) --- release/Makefile.gce | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/release/Makefile.gce b/release/Makefile.gce index 2eb6c8f46c29..4a574e6e26ac 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -47,13 +47,11 @@ gce-check-depends: . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf . endif - env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk - env ASSUME_ALWAYS_YES=yes pkg install -y lang/python lang/python3 \ - net/google-cloud-sdk + env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk \ + lang/python . else env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python BATCH=1 all install clean - env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/lang/python3 BATCH=1 all install clean . endif .endif From nobody Thu Jul 20 01:36:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R5wJs4Vhsz4nXBv; Thu, 20 Jul 2023 01:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R5wJq6bZjz3pWW; Thu, 20 Jul 2023 01:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HdeijKZ87Jiun8mKm7k/P0cp2JrvfIm6RFodqutC1I8=; b=CILW9TYCaJrT34qAjr5ipvV5lMG1fv9kJomimDdjYvaNO4aXA/r8EcLcW9OLzOtD0i0fFR 5N+DHW9tHRfCwy5eI2DkkpKWes+LRy79aT5RdoIhH6kaVxgoQkcawAyIBTo2jHEOTQasYa sIt82zdd3tctYxdxzZXU3kLlcT3mwEufWfmclWCzuZgYtpCaPpvFxfxStD5yQcfISQ7mWo kOw6Yp+nDRXpEqFhleZ9u32U5/AE3BnGL2B4t03dCXBlDAByAq0HIM2w+KEcl4axoTcOdJ vh9GNgqcjRT9xnRv0wdM2zL7VqzPROwe1qG3kuw7PLXbgBvza2Z4KbSRWbY9Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689817003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HdeijKZ87Jiun8mKm7k/P0cp2JrvfIm6RFodqutC1I8=; b=mSWHEm09ocZ4DXNGKHim+b6Zjy9o+r4tgmVr3R0ghvh0tBINUIqvIJb+bLqvWWyJ7PdJ3r duUt6gF+4lJqWt1nVJ9/PX+zGPXrS/66Ixv6VyXqTUcMRzEtgwty3uDpZDeXK/5WIshcrm leiJJS+KhaRHzXhzPZSXFFGxXgLt3ECWo9PskyM617AGsjsafoMb41yc0UdDoMje8ygf1S mlHPXCO6eWes6pllAcdZeNNAXdPuinNJoEkjT8k0jHIep1r+qQzMyKLPpKwwTE3qygYAbQ KVmU1IE1bIFfRa4eSt7jmzuJW+dzySGpLEZBbmXk475sFBuSzWHZKpvuli9hPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689817003; a=rsa-sha256; cv=none; b=oVqN7By0hPnPQ4ffy5TeCNxOPJzG2bMxR6F1UEIrZ8pkZZho9UbMnl/bSSo8gnPqUgV0Hy s944MA2KCH+Vjidu20fg9oeKBW/DgZeNshQXwnGJoY3Ib9h9dJA4YLMmJuBScOQ00sUiZK BawYPdufzSzBUxHTwITfij+XaFFDYbThA3Jj1/NGcVfk2WAoOgYyiqWBmHYHtwzk2V1+3t k9U2iLEFPZfAwbXunzwgnFKqVS4R6uTyIG1igpziw287hHMSO2nQXBfuOxKbY0fp/T/7tF rRHPAWIaAO/+16X6AwjtSVgUVWs0mAUAv2YFDf03RweyImrzcxUrM6ZZeGBYCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R5wJq5Kjjz1Bdy; Thu, 20 Jul 2023 01:36:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36K1ah4g029760; Thu, 20 Jul 2023 01:36:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36K1ahHT029759; Thu, 20 Jul 2023 01:36:43 GMT (envelope-from git) Date: Thu, 20 Jul 2023 01:36:43 GMT Message-Id: <202307200136.36K1ahHT029759@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: ad6773477b56 - stable/12 - release: remove a stray backslash List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ad6773477b566bb901a4fca31bcb004dc11b319f Auto-Submitted: auto-generated The branch stable/12 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=ad6773477b566bb901a4fca31bcb004dc11b319f commit ad6773477b566bb901a4fca31bcb004dc11b319f Author: Glen Barber AuthorDate: 2023-07-12 20:57:57 +0000 Commit: Glen Barber CommitDate: 2023-07-20 01:35:39 +0000 release: remove a stray backslash PR: 272354 (related) Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 510fd83138001b0a6e45b3fa6a7249377f806171) --- release/tools/gce.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/tools/gce.conf b/release/tools/gce.conf index cfadbaf9413b..474cf53de8be 100644 --- a/release/tools/gce.conf +++ b/release/tools/gce.conf @@ -8,7 +8,7 @@ export VMSIZE=20G # Set to a list of packages to install. export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update \ - firstboot-pkgs \ google-cloud-sdk panicmail sudo \ + firstboot-pkgs google-cloud-sdk panicmail sudo \ sysutils/py-google-compute-engine lang/python \ lang/python3" From nobody Thu Jul 20 12:43:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6C5n2hKVz4nsbP; Thu, 20 Jul 2023 12:43: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6C5n29NPz4CMJ; Thu, 20 Jul 2023 12:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq5GyMkhhhfV+CzEIJ9mx6BzEJinMcC2V680VoStIME=; b=LT3QCssP28Emq+PZS/uOu1v39OfyrXf+Ok3pNPgfsH4vbEXnMY1kwjDLb6y2HaFyO0t/t6 ID4g7kP8kXEVWSGL9+hEVN3VLjhX+RnZvTghXfUOpye3nNL2LYBaIjYGSupJgb7JGNGD0p 9beZwJSS/exZmtEO/wsm6+3ogX109xORMmZjQluD3B1kwloYbhL31yYH94ynmRcFKYYR/u bjJZwonfDqBGT5AV7W+lFEP4IXSlYnWR9IwqmiiY2aSIPU8H+UtbD8vCSnQwYiJ0YNhJ+n hUjRJEVC05uanG/WtaPTl/yybPiYz0U9IwRPpVtTHDZLoT/FhA10TCoRKJL5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856989; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iq5GyMkhhhfV+CzEIJ9mx6BzEJinMcC2V680VoStIME=; b=LfQtaHP4hqJu9cT7NoPhlzWGV9ZCyHmKMXhCtvCiOx6bl4gx6z1JermQtSNGaJVd+BIG1N lQYbVjmNVAdr7WmPPovn0GSOhEZajBJE7g4JHHFyR9x+dSBCGZ045wGv3yafpUy56XXdnz 1oRtwRkL+XiP/RxklKB00LLHy/f+lzefjyClGvCrQBmr64BlhYvJ4yIVawhVnOgBvZUUMZ 354CpaNJ+DSjgTzYV+myQTRYl8oAHVM7kILKlaHIWZOkTMhfabhNrPFLxPAWahceMy4Icb ZVwv4uu90zDK1FWFQ4hL2aKnPwQ/IgxeHp85JY6pht54wc4yUd3b9lloTZr3kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689856989; a=rsa-sha256; cv=none; b=Px99Lly0DBSPUiaUJLYPeT4tJwyd1A8Eyqo5AwKPUauAs8kusijGBl/iASffQ4U5Fjra5b ztSwPk8HSnrVrDNPZe8op9jJhdVC14outgLZaGmUNtqUt7DX9LZFHM9AzeFElTBlXbTSjx 9ekHcH0SJZCCwlx0sJhasHqlyomkMmH37Kf/Bx3XHAMG8e3q3iDA8TQc9smKYrE1Ul22Eh U9lT/unvgiBf23fCanpj5wSsdS50FeZCYVFODn42i9tKw9UqseGwq7QU6Y4BlYAqEGSbm8 wpwBrMvjbRTIcToNT58gMHI7Q7vyXGNNLG6jC+dq4V8KdX9Eq8fx/ApjipkdBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6C5n1CtVzWWQ; Thu, 20 Jul 2023 12:43:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KCh99N039176; Thu, 20 Jul 2023 12:43:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KCh9eY039175; Thu, 20 Jul 2023 12:43:09 GMT (envelope-from git) Date: Thu, 20 Jul 2023 12:43:09 GMT Message-Id: <202307201243.36KCh9eY039175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 08a1dd9ad110 - stable/13 - Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08a1dd9ad11090df27c4271d7205fb05b8ff62a9 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=08a1dd9ad11090df27c4271d7205fb05b8ff62a9 commit 08a1dd9ad11090df27c4271d7205fb05b8ff62a9 Author: Konstantin Belousov AuthorDate: 2023-07-11 04:58:06 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 12:20:09 +0000 Revert "VFS: Remove VV_READLINK flag" and "fdescfs: improve linrdlnk mount option" (cherry picked from commit 9c3bfe2ad07170cd7d3645a7c24f4d80a509c2b7) --- sys/fs/fdescfs/fdesc_vnops.c | 3 +-- sys/kern/vfs_subr.c | 4 +++- sys/kern/vfs_syscalls.c | 2 +- sys/sys/vnode.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index b2ae6964551e..522009550986 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -469,8 +469,7 @@ fdesc_getattr(struct vop_getattr_args *ap) break; case Fdesc: - vap->va_type = (VFSTOFDESC(vp->v_mount)->flags & - FMNT_LINRDLNKF) == 0 ? VCHR : VLNK; + vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK; vap->va_nlink = 1; vap->va_size = 0; vap->va_rdev = makedev(0, vap->va_fileid); diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index dd742277a98f..21061984bcc3 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4263,9 +4263,11 @@ vn_printf(struct vnode *vp, const char *fmt, ...) strlcat(buf, "|VV_MD", sizeof(buf)); if (vp->v_vflag & VV_FORCEINSMQ) strlcat(buf, "|VV_FORCEINSMQ", sizeof(buf)); + if (vp->v_vflag & VV_READLINK) + strlcat(buf, "|VV_READLINK", sizeof(buf)); flags = vp->v_vflag & ~(VV_ROOT | VV_ISTTY | VV_NOSYNC | VV_ETERNALDEV | VV_CACHEDLABEL | VV_VMSIZEVNLOCK | VV_COPYONWRITE | VV_SYSTEM | - VV_PROCDEP | VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ); + VV_PROCDEP | VV_NOKNOTE | VV_DELETED | VV_MD | VV_FORCEINSMQ | VV_READLINK); if (flags != 0) { snprintf(buf2, sizeof(buf2), "|VV(0x%lx)", flags); strlcat(buf, buf2, sizeof(buf)); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index b7cdac8540da..7f7836450811 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -2660,7 +2660,7 @@ kern_readlink_vp(struct vnode *vp, char *buf, enum uio_seg bufseg, size_t count, if (error != 0) return (error); #endif - if (vp->v_type != VLNK) + if (vp->v_type != VLNK && (vp->v_vflag & VV_READLINK) == 0) return (EINVAL); aiov.iov_base = buf; diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index e79bd1c9ddba..fdf3b8f0e5fd 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -271,7 +271,7 @@ struct xvnode { #define VV_DELETED 0x0400 /* should be removed */ #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ -#define VV_UNUSED01 0x2000 /* was: fdescfs linux vnode */ +#define VV_READLINK 0x2000 /* fdescfs linux vnode */ #define VV_UNREF 0x4000 /* vunref, do not drop lock in inactive() */ #define VV_UNLINKED 0x8000 /* unlinked but stil open directory */ From nobody Thu Jul 20 12:43:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6C5q5M2Cz4nshj; Thu, 20 Jul 2023 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6C5p3bRqz4CT6; Thu, 20 Jul 2023 12:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hTvzyQ6QVppoPTTyk5sxsCDO5PXrRDoLKQIYepzxlR0=; b=gulk2iiLnuvLkBn26N0VIdVG7pYvlaWq2uUTEqXjysbAwLENFSrEKvGGB1pLJZLp49wXgD KSqmTidahfLl5ajBTf+IAMHeMuTQ39mwejcnZhJYxbGTTm2c89Eb7eEYC8zrwLyoGjTb31 kThwnBEAgEkuuSBx4c/o+Ilxy5z8p2m7VScFfjKgPibrkS9+kc3qx3Bgt8uc2BlyDTUNmu EAj91wWAokCOCXJBiEjY7vkksXDDl1XuF9syu2phwJ78SYcsG4OdVXEjG/OofJvuXPZXi/ sjfZ2mboXXWk2+nJxUqumbN2b4kr8epDuarxe7s2BvdCajuBqZbuN4G8V2dZZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hTvzyQ6QVppoPTTyk5sxsCDO5PXrRDoLKQIYepzxlR0=; b=jsc7je2ybpYrV7/veQ7ulwEUaqn65KO7n2+Nil1pePhN24T/fxqz4lo2W8pAPB2J2IxlaJ qpL8Konx33phMF9EwQjY8cH3CAilcdVJp4p2H9+AGkyaNuNsgTdthnvr+k/pRW9uK6M+5Q DrmioSQC1vSjZA/FOtZi7M1VaCJpmZ9pYIaIqbW1HQUso7YrZuVrUs5g7z1SKmcsK0tCo/ bgVl3SU45wdlyl2MoF6Dr8z3k1mHFnEO9du9+997V6H3KzkiBj+Fl+qeDADDT5U/asa/hy EMuCQQXT7QEKCFuetXjy7dnAV8NxSwLkm/l8XjQfMuDGl1/ou0qFWmU2eFCfNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689856990; a=rsa-sha256; cv=none; b=fQp4xBuGmQTb6OrevWjJ9kxOdG+jRpkfGSbebDlxDToxnKj7L46N/VBHGLaq3qnkwS3JiB U6lx+tYa+A/2COP++2pFNI5bAWeQKxgTC6uDA+Bk37Jc8x+ZHGF5lkhHOH77NkNPVIWJ6M hblCq8WRqwEtZYrZNUv1nZcj+VQej8rLX3mymNeKtuT61kcZZAgNBFcLUBFSySzAYHI1PP xEA9YJM74AGdfWw29I8NU3/vPboqBW6WUFccOHt7aLmxcjHjxHEdWs0OdWf7jETL+CNZ5+ sZ74oxhFKYoxIO5l2WOkt6nXM2ANlyUQF9+95PTkUZk4VoZoeBn6t4nMpThsDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6C5p29NYzWH2; Thu, 20 Jul 2023 12:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KChA8Z039196; Thu, 20 Jul 2023 12:43:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KChAr7039195; Thu, 20 Jul 2023 12:43:10 GMT (envelope-from git) Date: Thu, 20 Jul 2023 12:43:10 GMT Message-Id: <202307201243.36KChAr7039195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: da56eae4404d - stable/13 - fdescfs: add a mount option rdlnk List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: da56eae4404d4d273cc4a8b7d8f05547bb188599 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=da56eae4404d4d273cc4a8b7d8f05547bb188599 commit da56eae4404d4d273cc4a8b7d8f05547bb188599 Author: Konstantin Belousov AuthorDate: 2023-07-11 05:03:49 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 12:20:09 +0000 fdescfs: add a mount option rdlnk PR: 272127 (cherry picked from commit 3905309dfeeb89f03b09c347f7ac0a863faa3975) --- sys/fs/fdescfs/fdesc.h | 1 + sys/fs/fdescfs/fdesc_vfsops.c | 2 ++ sys/fs/fdescfs/fdesc_vnops.c | 16 ++++++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/fs/fdescfs/fdesc.h b/sys/fs/fdescfs/fdesc.h index 94682f42cdb3..b51ac9f32ac1 100644 --- a/sys/fs/fdescfs/fdesc.h +++ b/sys/fs/fdescfs/fdesc.h @@ -43,6 +43,7 @@ #define FMNT_UNMOUNTF 0x01 #define FMNT_LINRDLNKF 0x02 #define FMNT_NODUP 0x04 +#define FMNT_RDLNKF 0x08 struct fdescmount { struct vnode *f_root; /* Root node */ diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 2961c3bf6224..d0d518245e92 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -100,6 +100,8 @@ fdesc_mount(struct mount *mp) fmp->flags = 0; if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0) fmp->flags |= FMNT_LINRDLNKF; + if (vfs_getopt(mp->mnt_optnew, "rdlnk", NULL, NULL) == 0) + fmp->flags |= FMNT_RDLNKF; if (vfs_getopt(mp->mnt_optnew, "nodup", NULL, NULL) == 0) fmp->flags |= FMNT_NODUP; error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 522009550986..13937dcbc6b5 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -204,9 +204,12 @@ loop: fd->fd_type = ftype; fd->fd_fd = fd_fd; fd->fd_ix = ix; - /* Cannot set v_type to VCHR */ - if (ftype == Fdesc && (fmp->flags & FMNT_LINRDLNKF) != 0) - vp->v_type = VLNK; + if (ftype == Fdesc) { + if ((fmp->flags & FMNT_RDLNKF) != 0) + vp->v_type = VLNK; + else if ((fmp->flags & FMNT_LINRDLNKF) != 0) + vp->v_vflag |= VV_READLINK; + } error = insmntque1(vp, mp, fdesc_insmntque_dtr, NULL); if (error != 0) { *vpp = NULLVP; @@ -469,7 +472,8 @@ fdesc_getattr(struct vop_getattr_args *ap) break; case Fdesc: - vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK; + vap->va_type = (VFSTOFDESC(vp->v_mount)->flags & + (FMNT_RDLNKF | FMNT_LINRDLNKF)) == 0 ? VCHR : VLNK; vap->va_nlink = 1; vap->va_size = 0; vap->va_rdev = makedev(0, vap->va_fileid); @@ -587,8 +591,8 @@ fdesc_readdir(struct vop_readdir_args *ap) break; dp->d_namlen = sprintf(dp->d_name, "%d", fcnt); dp->d_reclen = UIO_MX; - dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? - DT_CHR : DT_LNK; + dp->d_type = (fmp->flags & (FMNT_RDLNKF | + FMNT_LINRDLNKF)) == 0 ? DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; dirent_terminate(dp); break; From nobody Thu Jul 20 12:43:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6C5s5jj1z4nsdm; Thu, 20 Jul 2023 12:43:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6C5q6rfMz4CdX; Thu, 20 Jul 2023 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X9c5KMBEiZCfA/eVcHGNvSQFbmygC2fJikz3nU2vQGU=; b=bKQtd1HHzhStX46Hrk6Qh4DX13A1DccHPDPlRdQN+1rEn6ccA7R98HtFQYRxakro5E8jxA xLCjtcs7dHNXgWi59L///wPWVcaEEnplmu80qIdkOc77oszHop7i8+m9Kr7r3FQ98SQ+pH 7kQx6W05BvJChymhhvHYKlDRLa252+LC8KbbgXloWYdy9ZMz7r1hq+Eom1QJN02NmqaBD8 t1oh4w9/w1ZC4gDP0LIcubDpJ6jlUSFy2CU1xlC/5ZHteLxLZ5Uxy3s+M9ZxqD94LmPd9/ l87gAVGaz9qDt/xtePL9+B/SEdnlZ0HGo7/Ydv928VqABTLJZKiLMHeqfnZooA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689856992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X9c5KMBEiZCfA/eVcHGNvSQFbmygC2fJikz3nU2vQGU=; b=obKZ8dtDaUjbB9rdhfyGWATgrnqJNbCjX3C+6CG2RKKiZoXr/neA8ncBdDy5u447ENSWoy R9IwRKpbuo4RnIvhm/wBRc07nHS76HWdf+xGsbzQpQKQLqi985JYX2z4mYWOOWJsNahLmc qA7R3dbJVF2QBJClbpuZcAv3ebyIJr1/tTcijsT7jaouHvuv4bUWFusrEBA3tu3BqyGwAr TzoaiLXDUXlFLmSlY8bSwzDiq0lTXmGUaFJwbow4r+LOmRl3n6Vr/szxjwy68YkffMosqF q9WZghScxcRiqFNEfBgxWJ0TSjmbpZtPxtXxufWh9G4rp0Tdi+nPkTluBrUdJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689856992; a=rsa-sha256; cv=none; b=vSqp8p/lOxSmB9FFz12z+VeZFkQSn/GKMv/EkCVj1/ZtU715ft1SYU48CWeVq4itgyK+zn hKLzpK0txqzXcL9NIlRJ6jAWMcnuNuIEZZbUW+lE+vpt6Vu1z3Hyh6Lz+Bmy+4BivnZcas 0Hy2PjXa7sCQp+QiGyBXTavt61nvcSCEz4Q9B7IjWncMwFApsHAWTuzAHDRxzcaaAAjM4z f/HonBu4cAypIVdQFLgsdhP0udBqs2oJdFWiJ2SjmOinrdqyLtdMG/zGzt53AuqCl/KFsa 4zJspmAGTNVi0mQZ/Bd7AIC4nI2NakwKOIDERSTw9mbMymgLbZXJqoEtNzgQ9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6C5q4NM5zWH3; Thu, 20 Jul 2023 12:43:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KChBhU039222; Thu, 20 Jul 2023 12:43:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KChB34039221; Thu, 20 Jul 2023 12:43:11 GMT (envelope-from git) Date: Thu, 20 Jul 2023 12:43:11 GMT Message-Id: <202307201243.36KChB34039221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c2fbdd8efdfe - stable/13 - Document fdescfs mount option "rdlnk" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c2fbdd8efdfe463b3d91ea403177f3b714de17fb Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c2fbdd8efdfe463b3d91ea403177f3b714de17fb commit c2fbdd8efdfe463b3d91ea403177f3b714de17fb Author: Konstantin Belousov AuthorDate: 2023-07-11 05:09:11 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 12:20:09 +0000 Document fdescfs mount option "rdlnk" (cherry picked from commit 7cd7a3204153fc8ddf7d06cd0d924d5c3ef5ff35) --- share/man/man5/fdescfs.5 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/share/man/man5/fdescfs.5 b/share/man/man5/fdescfs.5 index f2abda2bb4c2..6355951eb714 100644 --- a/share/man/man5/fdescfs.5 +++ b/share/man/man5/fdescfs.5 @@ -40,7 +40,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2021 +.Dd Jul 11, 2023 .Dt FDESCFS 5 .Os .Sh NAME @@ -94,6 +94,18 @@ ABI compatibility mount volume with the .Cm linrdlnk option. +.It Cm rdlnk +Treat +.Nm +vnodes as symbolic links consistently, in particular, follow +the resolved name for the name lookups. +This option is strictly stronger than the +.Cm linrdlnk +option, it changes not only the type returned by +.Xr stat 2 , +but also causes the +.Nm +files to behave as symlinks. .El .Pp For From nobody Thu Jul 20 14:12:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6F4Y5Zkyz4nqjM; Thu, 20 Jul 2023 14:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6F4Y3y0Xz3R2L; Thu, 20 Jul 2023 14:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689862333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uU1BW/5atvujpVPuQQsFahOcwaLwgquIjeOvmw0r/G4=; b=YShh8c4cM6ppRfJGL7Q1kwMdimBhBE4cDYno/Ivua/9O+T/7kb/lIjDBay25md1KOv2vZV EgYTGN5uQ53PBx8CXZ6fXPsfeh/DsIhby8x6uFo0AJVVcReL/mdeq7SiBAdP1lNPYPRHHd N3DEN+r2ZJ10oWByPK6X9nOF4BCsTeo2VXvrYbnl/7wK0YVFlYo6gpE0SP4l647GOBZi7X JE57AHxS8uRAwvSFZb1Oaciqe5TOGum6jaAgRbO3Wz9xSDFdJRTbsloJclQT+jpuEMfPwK bDYI0yXozFq6TpfYvjaDbxDqHY0aBTgjt00CKwfaOuAbHYGWMy5bLwlRnbpZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689862333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uU1BW/5atvujpVPuQQsFahOcwaLwgquIjeOvmw0r/G4=; b=s1k52jTNAiE5etv2yW+UdoSSWZdQ90gaod6gYOpTDvCrp+dPKgOqhjg1jcvxaogfFFLAkH xcorvkOvnvXZF05WXlAnIMuy0PdP4OYbPJb4nyduLyqmXJkY/eRLswDlxaI8jlzLm/i1j1 edSl0wE2sDV7IkldfGOtq2dNJszAhLYZElq0WZRHGLhDIBQ2jVsjmP8Mvi8X51KNLeYlvy 67xDtij4ZnjAo8auZiVuUXmGK4afF1Pb8lKP4H5X8m5wH8sTagzht/d3rDN7J/9E2+B6zi p5d2h79lQm4swwcpdHDdfv2InE8hi/+YHwBgyotQoUOYicU//RilkCff26vfGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689862333; a=rsa-sha256; cv=none; b=BpUnslLWcsuSEjlBSR6YlYkwnlOVk6HtR3PrJ9oQ8DrSaTHnsJJ8bbxIJA0elgw0sM/3XF taUYSiC/98TWeVM3quic0hpfAIgG0JB/WXoJw1Ztg4prWVHc1d5nG6msVe1t1ld/f26E9c 5lPGL9Tc8MZjUdPYyJBdtuMWB/JQjH4qg183ekyJK1mm8flWQ/KF7xlBpcCsHnzTuDqbDn FG/Wch7LgK9UymUAW7dAGTP32Yv0wR144ozNTv4eHm7C0bwkwtox85Jvn2Px9XaiM/JeF0 fmjHvXJZzOjeEbqMZwXfM90gZn5fwUy7lcaVOQ3H7lsYHJ2/OkWX2Z7YI6q+/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 4R6F4Y31dLzYgl; Thu, 20 Jul 2023 14:12:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KECDko084919; Thu, 20 Jul 2023 14:12:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KECDSU084918; Thu, 20 Jul 2023 14:12:13 GMT (envelope-from git) Date: Thu, 20 Jul 2023 14:12:13 GMT Message-Id: <202307201412.36KECDSU084918@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: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21e45c30c35c9aa732073f725924caf581c93460 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 commit 21e45c30c35c9aa732073f725924caf581c93460 Author: Konstantin Belousov AuthorDate: 2023-07-19 11:05:32 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 14:11:42 +0000 mmap(MAP_STACK): on stack grow, use original protection If mprotect(2) changed protection in the bottom of the currently grown stack region, currently the changed protection would be used for the stack grow on next fault. This is arguably unexpected. Store the original protection for the entry at mmap(2) time in the offset member of the gap vm_map_entry, and use it for protection of the grown stack region. PR: 272585 Reported by: John F. Carr Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41089 --- sys/vm/vm_map.c | 24 ++++++++++++++++-------- sys/vm/vm_map.h | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index a02107b5e64d..997a49111a59 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4493,7 +4493,7 @@ static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { - vm_map_entry_t new_entry, prev_entry; + vm_map_entry_t gap_entry, new_entry, prev_entry; vm_offset_t bot, gap_bot, gap_top, top; vm_size_t init_ssize, sgp; int orient, rv; @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, * read-ahead logic is never used for it. Re-use * next_read of the gap entry to store * stack_guard_page for vm_map_growstack(). + * Similarly, since a gap cannot have a backing object, + * store the original stack protections in the + * object offset. */ - if (orient == MAP_STACK_GROWS_DOWN) - vm_map_entry_pred(new_entry)->next_read = sgp; - else - vm_map_entry_succ(new_entry)->next_read = sgp; + gap_entry = orient == MAP_STACK_GROWS_DOWN ? + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry); + gap_entry->next_read = sgp; + gap_entry->offset = prot; } else { (void)vm_map_delete(map, bot, top); } @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map_entry_t gap_entry) struct ucred *cred; vm_offset_t gap_end, gap_start, grow_start; vm_size_t grow_amount, guard, max_grow; + vm_prot_t prot; rlim_t lmemlim, stacklim, vmemlim; int rv, rv1 __diagused; bool gap_deleted, grow_down, is_procstack; @@ -4739,6 +4743,12 @@ retry: } if (grow_down) { + /* + * The gap_entry "offset" field is overloaded. See + * vm_map_stack_locked(). + */ + prot = gap_entry->offset; + grow_start = gap_entry->end - grow_amount; if (gap_entry->start + grow_amount == gap_entry->end) { gap_start = gap_entry->start; @@ -4751,9 +4761,7 @@ retry: gap_deleted = false; } rv = vm_map_insert(map, NULL, 0, grow_start, - grow_start + grow_amount, - stack_entry->protection, stack_entry->max_protection, - MAP_STACK_GROWS_DOWN); + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN); if (rv != KERN_SUCCESS) { if (gap_deleted) { rv1 = vm_map_insert(map, NULL, 0, gap_start, diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index fd8b606e8ddc..c4ed36ce57ba 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -97,6 +97,10 @@ union vm_map_object { * a VM object (or sharing map) and offset into that object, * and user-exported inheritance and protection information. * Also included is control information for virtual copy operations. + * + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN + * or UP), the next_read member is reused as the stack_guard_page + * storage, and offset is the stack protection. */ struct vm_map_entry { struct vm_map_entry *left; /* left child or previous entry */ From nobody Thu Jul 20 16:32:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6JBW0C1Cz4p2cS; Thu, 20 Jul 2023 16:32:35 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.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 4R6JBV59qfz4Sjf; Thu, 20 Jul 2023 16:32:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4003a.ext.cloudfilter.net ([10.228.9.183]) by cmsmtp with ESMTP id MSWbqYx0t6NwhMWZtqRVR6; Thu, 20 Jul 2023 16:32:33 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MWZsqoyTrcyvuMWZsqaCWh; Thu, 20 Jul 2023 16:32:33 +0000 X-Authority-Analysis: v=2.4 cv=VbHkgXl9 c=1 sm=1 tr=0 ts=64b961a1 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=AgNmJdvoGADqlrMAvFoA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id BD0831F4; Thu, 20 Jul 2023 09:32:31 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B1D4277; Thu, 20 Jul 2023 09:32:31 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <202307201412.36KECDSU084918@gitrepo.freebsd.org> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> Comments: In-reply-to Konstantin Belousov message dated "Thu, 20 Jul 2023 14:12:13 +0000." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 09:32:31 -0700 Message-Id: <20230720163231.B1D4277@slippy.cwsent.com> X-CMAE-Envelope: MS4xfCyzJH2+ea3LaynOo/eHGeChIdKRBnjqQ/RuZnsNlgd8pHX0uUbtqrzXkBodnTB5ad6glSyq1ME4iPQNNataUzJxvowp2+t9dtzBhqEyGXG5juwAXjzy d859/2FX5Ibj/jmCKbqTC8i0eHClRWtS8z0Ji/vevcmxeK4dBrEj0k5FHu7MfI8iSMCUkU7+issw2bAOhRWF1fWYTBT9WRYMSz3jubysGB93yXse5vqD8mZ3 WU1jhf3gtCvHczqS/sOI2yIxTK9bFIxqgc9nL+QxvzfLdxKTupxNm/yqdGIlUIX9z/csCCHxRcOcQ3yq6zeaZzfMehxjEcSdkXUCE3dZkd4= X-Rspamd-Queue-Id: 4R6JBV59qfz4Sjf X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin Belous ov writes: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf5 > 81c93460 > > commit 21e45c30c35c9aa732073f725924caf581c93460 > Author: Konstantin Belousov > AuthorDate: 2023-07-19 11:05:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2023-07-20 14:11:42 +0000 > > mmap(MAP_STACK): on stack grow, use original protection > > If mprotect(2) changed protection in the bottom of the currently grown > stack region, currently the changed protection would be used for the > stack grow on next fault. This is arguably unexpected. > > Store the original protection for the entry at mmap(2) time in the > offset member of the gap vm_map_entry, and use it for protection of the > grown stack region. > > PR: 272585 > Reported by: John F. Carr > Reviewed by: alc, markj > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D41089 > --- > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > sys/vm/vm_map.h | 4 ++++ > 2 files changed, 20 insertions(+), 8 deletions(-) > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index a02107b5e64d..997a49111a59 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4493,7 +4493,7 @@ static int > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > { > - vm_map_entry_t new_entry, prev_entry; > + vm_map_entry_t gap_entry, new_entry, prev_entry; > vm_offset_t bot, gap_bot, gap_top, top; > vm_size_t init_ssize, sgp; > int orient, rv; > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos > , vm_size_t max_ssize, > * read-ahead logic is never used for it. Re-use > * next_read of the gap entry to store > * stack_guard_page for vm_map_growstack(). > + * Similarly, since a gap cannot have a backing object, > + * store the original stack protections in the > + * object offset. > */ > - if (orient == MAP_STACK_GROWS_DOWN) > - vm_map_entry_pred(new_entry)->next_read = sgp; > - else > - vm_map_entry_succ(new_entry)->next_read = sgp; > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > ; > + gap_entry->next_read = sgp; > + gap_entry->offset = prot; > } else { > (void)vm_map_delete(map, bot, top); > } > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map > _entry_t gap_entry) > struct ucred *cred; > vm_offset_t gap_end, gap_start, grow_start; > vm_size_t grow_amount, guard, max_grow; > + vm_prot_t prot; > rlim_t lmemlim, stacklim, vmemlim; > int rv, rv1 __diagused; > bool gap_deleted, grow_down, is_procstack; > @@ -4739,6 +4743,12 @@ retry: > } > > if (grow_down) { > + /* > + * The gap_entry "offset" field is overloaded. See > + * vm_map_stack_locked(). > + */ > + prot = gap_entry->offset; > + > grow_start = gap_entry->end - grow_amount; > if (gap_entry->start + grow_amount == gap_entry->end) { > gap_start = gap_entry->start; > @@ -4751,9 +4761,7 @@ retry: > gap_deleted = false; > } > rv = vm_map_insert(map, NULL, 0, grow_start, > - grow_start + grow_amount, > - stack_entry->protection, stack_entry->max_protection, > - MAP_STACK_GROWS_DOWN); > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > ; > if (rv != KERN_SUCCESS) { > if (gap_deleted) { > rv1 = vm_map_insert(map, NULL, 0, gap_start, > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > index fd8b606e8ddc..c4ed36ce57ba 100644 > --- a/sys/vm/vm_map.h > +++ b/sys/vm/vm_map.h > @@ -97,6 +97,10 @@ union vm_map_object { > * a VM object (or sharing map) and offset into that object, > * and user-exported inheritance and protection information. > * Also included is control information for virtual copy operations. > + * > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN > + * or UP), the next_read member is reused as the stack_guard_page > + * storage, and offset is the stack protection. > */ > struct vm_map_entry { > struct vm_map_entry *left; /* left child or previous entry */ > This commit has caused screen (sysutils/screen) to display the following error when opening a new screen window (ctrl-A c): pid 28473 comm screen-4.9.0 has trashed its stack, killing -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 16:41:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6JP85J9qz4p6WW; Thu, 20 Jul 2023 16:41:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.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 4R6JP81d27z4W0v; Thu, 20 Jul 2023 16:41:48 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.33) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=none Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id MSWmqYx1s6NwhMWipqRXw9; Thu, 20 Jul 2023 16:41:47 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MWinquOqLHFsOMWioqzT1d; Thu, 20 Jul 2023 16:41:47 +0000 X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=64b963cb a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=oCdtv4dIwIuyiO_v0G0A:9 a=CjuIK1q_8ugA:10 a=QHqjWXHE9tEA:10 a=UJ0tAi3fqDAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 378CB28A; Thu, 20 Jul 2023 09:41:45 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 0CF1311F; Thu, 20 Jul 2023 09:41:44 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720163231.B1D4277@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 09:32:31 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 09:41:44 -0700 Message-Id: <20230720164145.0CF1311F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfA4WLVKtnj8DUxFtsNRozpGV97JXkXFE19dYRXM/h5rlj4WiasnMkQDu+7P7EYTiZo060CRSscQPRDRT5EqGcrhoEqQ1zbsxZxqp8EJ+Mb06yLLOHQdv +b8yBS/NyruwpUWHqQhis4Yq9bIlHL9jycFmOFiBAhEJtI6I6Bx27ZUqqTM1MNb1DiddEuPXWxK8EeFCoB4u6RTKbM46c+3ClT4LHTR4TEyiJxvJOUk5FUdd UK205CuM4O24tHBX/S1ymmPpKN80IKLNUevQ62V14o34pKankiwAuu9zyWbLmqx+cmde87z7LhsQ7KZoc8GI7N6z4vS/D5KJTVqy5hJGG2E= X-Spamd-Result: default: False [-1.70 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[cschubert.com]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4R6JP81d27z4W0v X-Spamd-Bar: - In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > Belous > ov writes: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924ca > f5 > > 81c93460 > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > Author: Konstantin Belousov > > AuthorDate: 2023-07-19 11:05:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > If mprotect(2) changed protection in the bottom of the currently grown > > stack region, currently the changed protection would be used for the > > stack grow on next fault. This is arguably unexpected. > > > > Store the original protection for the entry at mmap(2) time in the > > offset member of the gap vm_map_entry, and use it for protection of the > > grown stack region. > > > > PR: 272585 > > Reported by: John F. Carr > > Reviewed by: alc, markj > > Sponsored by: The FreeBSD Foundation > > MFC after: 1 week > > Differential revision: https://reviews.freebsd.org/D41089 > > --- > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > sys/vm/vm_map.h | 4 ++++ > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index a02107b5e64d..997a49111a59 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -4493,7 +4493,7 @@ static int > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize > , > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > { > > - vm_map_entry_t new_entry, prev_entry; > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > vm_offset_t bot, gap_bot, gap_top, top; > > vm_size_t init_ssize, sgp; > > int orient, rv; > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrb > os > > , vm_size_t max_ssize, > > * read-ahead logic is never used for it. Re-use > > * next_read of the gap entry to store > > * stack_guard_page for vm_map_growstack(). > > + * Similarly, since a gap cannot have a backing object, > > + * store the original stack protections in the > > + * object offset. > > */ > > - if (orient == MAP_STACK_GROWS_DOWN) > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > - else > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > ; > > + gap_entry->next_read = sgp; > > + gap_entry->offset = prot; > > } else { > > (void)vm_map_delete(map, bot, top); > > } > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_m > ap > > _entry_t gap_entry) > > struct ucred *cred; > > vm_offset_t gap_end, gap_start, grow_start; > > vm_size_t grow_amount, guard, max_grow; > > + vm_prot_t prot; > > rlim_t lmemlim, stacklim, vmemlim; > > int rv, rv1 __diagused; > > bool gap_deleted, grow_down, is_procstack; > > @@ -4739,6 +4743,12 @@ retry: > > } > > > > if (grow_down) { > > + /* > > + * The gap_entry "offset" field is overloaded. See > > + * vm_map_stack_locked(). > > + */ > > + prot = gap_entry->offset; > > + > > grow_start = gap_entry->end - grow_amount; > > if (gap_entry->start + grow_amount == gap_entry->end) { > > gap_start = gap_entry->start; > > @@ -4751,9 +4761,7 @@ retry: > > gap_deleted = false; > > } > > rv = vm_map_insert(map, NULL, 0, grow_start, > > - grow_start + grow_amount, > > - stack_entry->protection, stack_entry->max_protection, > > - MAP_STACK_GROWS_DOWN); > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > ; > > if (rv != KERN_SUCCESS) { > > if (gap_deleted) { > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > --- a/sys/vm/vm_map.h > > +++ b/sys/vm/vm_map.h > > @@ -97,6 +97,10 @@ union vm_map_object { > > * a VM object (or sharing map) and offset into that object, > > * and user-exported inheritance and protection information. > > * Also included is control information for virtual copy operations. > > + * > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DOWN > > + * or UP), the next_read member is reused as the stack_guard_page > > + * storage, and offset is the stack protection. > > */ > > struct vm_map_entry { > > struct vm_map_entry *left; /* left child or previous entry */ > > > > This commit has caused screen (sysutils/screen) to display the following > error when opening a new screen window (ctrl-A c): > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory and in the email cc'd to me. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 17:06:24 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Jxc2Jsqz4dQL7; Thu, 20 Jul 2023 17:06:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.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 4R6Jxb25K6z4dyS; Thu, 20 Jul 2023 17:06:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.33) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MPsKqYs7c6NwhMX6gqRf19; Thu, 20 Jul 2023 17:06:26 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MX6fqGyBCyAOeMX6gq85aq; Thu, 20 Jul 2023 17:06:26 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b96992 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=8ToWh4kbUNh_1jlTTwUA:9 a=CjuIK1q_8ugA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=UJ0tAi3fqDAA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id C809E2CB; Thu, 20 Jul 2023 10:06:24 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id B8F28DB; Thu, 20 Jul 2023 10:06:24 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720164145.0CF1311F@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 09:41:44 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 10:06:24 -0700 Message-Id: <20230720170624.B8F28DB@slippy.cwsent.com> X-CMAE-Envelope: MS4xfBzyki60zrg9DC8yLCVPdAvqggsm/4Nna7+sDZeZEXFgr+lba53MsAsOTFRuGEIN40ibsaR65CRjTU5eV3Kpk4VKPdmlxdnsXzgeNUV4c7N5iW0A9CQg Prr5JN5WKAFvE4X41IUolennSubfvfnOBBw6RCTqTbPq2gj72Sbnv0X3H4wZiN7w+Pdp5V14OkIZatKEpGdFsmvmUWDULITLDLNMkyQr/3M/AJe9gFkVTu58 iFW4sGJMncL1E3fQfs3vWE2kJr3sfIao9J4TcRd8iQhwTl1uTNWVRBd+A/OyCqr3UNSlRC2pp/IjPnCwITyEOjLFVzHTt4WFJ59TRGD8g4I= X-Spamd-Result: default: False [-1.67 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.967]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.33:from]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org,dev-commits-src-all@freebsd.org]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; R_SPF_NA(0.00)[no SPF record]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[cschubert.com]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4R6Jxb25K6z4dyS X-Spamd-Bar: - In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > Belous > > ov writes: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924 > ca > > f5 > > > 81c93460 > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > Author: Konstantin Belousov > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > If mprotect(2) changed protection in the bottom of the currently grow > n > > > stack region, currently the changed protection would be used for the > > > stack grow on next fault. This is arguably unexpected. > > > > > > Store the original protection for the entry at mmap(2) time in the > > > offset member of the gap vm_map_entry, and use it for protection of t > he > > > grown stack region. > > > > > > PR: 272585 > > > Reported by: John F. Carr > > > Reviewed by: alc, markj > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 1 week > > > Differential revision: https://reviews.freebsd.org/D41089 > > > --- > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > sys/vm/vm_map.h | 4 ++++ > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > index a02107b5e64d..997a49111a59 100644 > > > --- a/sys/vm/vm_map.c > > > +++ b/sys/vm/vm_map.c > > > @@ -4493,7 +4493,7 @@ static int > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssi > ze > > , > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > { > > > - vm_map_entry_t new_entry, prev_entry; > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > vm_offset_t bot, gap_bot, gap_top, top; > > > vm_size_t init_ssize, sgp; > > > int orient, rv; > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t add > rb > > os > > > , vm_size_t max_ssize, > > > * read-ahead logic is never used for it. Re-use > > > * next_read of the gap entry to store > > > * stack_guard_page for vm_map_growstack(). > > > + * Similarly, since a gap cannot have a backing object, > > > + * store the original stack protections in the > > > + * object offset. > > > */ > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > - else > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > > ; > > > + gap_entry->next_read = sgp; > > > + gap_entry->offset = prot; > > > } else { > > > (void)vm_map_delete(map, bot, top); > > > } > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm > _m > > ap > > > _entry_t gap_entry) > > > struct ucred *cred; > > > vm_offset_t gap_end, gap_start, grow_start; > > > vm_size_t grow_amount, guard, max_grow; > > > + vm_prot_t prot; > > > rlim_t lmemlim, stacklim, vmemlim; > > > int rv, rv1 __diagused; > > > bool gap_deleted, grow_down, is_procstack; > > > @@ -4739,6 +4743,12 @@ retry: > > > } > > > > > > if (grow_down) { > > > + /* > > > + * The gap_entry "offset" field is overloaded. See > > > + * vm_map_stack_locked(). > > > + */ > > > + prot = gap_entry->offset; > > > + > > > grow_start = gap_entry->end - grow_amount; > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > gap_start = gap_entry->start; > > > @@ -4751,9 +4761,7 @@ retry: > > > gap_deleted = false; > > > } > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > - grow_start + grow_amount, > > > - stack_entry->protection, stack_entry->max_protection, > > > - MAP_STACK_GROWS_DOWN); > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > > ; > > > if (rv != KERN_SUCCESS) { > > > if (gap_deleted) { > > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > --- a/sys/vm/vm_map.h > > > +++ b/sys/vm/vm_map.h > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > * a VM object (or sharing map) and offset into that object, > > > * and user-exported inheritance and protection information. > > > * Also included is control information for virtual copy operation > s. > > > + * > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > WN > > > + * or UP), the next_read member is reused as the stack_guard_page > > > + * storage, and offset is the stack protection. > > > */ > > > struct vm_map_entry { > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > error when opening a new screen window (ctrl-A c): > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > and in the email cc'd to me. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > Sometimes this occurs at screen start. Then it hangs. slippy$ screen pid 7275 comm screen-4.9.0 has trashed its stack, killing -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 17:28:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KRF6gnsz4nJD7; Thu, 20 Jul 2023 17:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6KRF69Plz3GPq; Thu, 20 Jul 2023 17:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zReqWmLwc+FfHcwGuMr2gLeDc2LZjLbOP/Oz7siNWg0=; b=KQY6v3M0kQD8a5xaCqKAQ6YBFpxY5BM7oswVXb9MxgXIK65vTHG6ty3Nq2m694eZvwMY// Axay4oKlV+ajwmZ8D7O73A/JkFN9oliO9oGGKMMMinpXGdlsRO+5oU0hu2TelsnjP1SitD wWsyQ52JyJj5xmZrHDMNPvwAto/Kqa3oFrkbx1UlQjmTT2ld8oExfg+2hShuaTM35u8cp4 2yzE32SAbeZTOepxFJbZLsHIKHnlEe4//46HcP+UiM6bQHMsC5aB9OOl0n1B43wHYiyijc vqPFgZvJpRNEi1jKavsaE/NuTaU9siOdZLh/FWLg26PKzc2qDbqkcUYvRDQtyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zReqWmLwc+FfHcwGuMr2gLeDc2LZjLbOP/Oz7siNWg0=; b=GcDyKn3spQLhRo8gFmtPiklMLLWY0oQM12SrkBzTMcKKJfuGcXJ3szvBPvyshKdHTrbq0G iEdk+IrfIbNgoziBvPcWgZF61uLke+Rf4VtCSFq/Kt1Ln+lHQxBaa4D4NZyNqbws//vd+E 6Btq3UO9wNfsfVrk0o9k/WZo7Mhp9X7n6v4dkxnaQYP9W90C3/GqSsLXTQN8QxMWcfszkx A3Jh+jPg9n92d8CcrpoxgRsCoXiZ3jMu5PgjvRCcmkwEqvRKLPCAJUUNPIGEzPmjNzUwnL UlUtUkt2QOzaHsADzl6Ng4MlDEcoZAI/GjwdalC1rlrarzXTHAdv9yCuo8agmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874121; a=rsa-sha256; cv=none; b=eWKbSGmMuQiNbAIrJWWokP4n0rEIrrGAXM0Q28TucY0AzE2Ta5dAqu2rxVkQKk1jIc6kv6 km35vJsWs35Mfr7dEeszGSPo2+v1/i0kpnJKRWVvWhz7xhNrMakwplOdL/XZ+nUliW+Tdj yQonn59j3z0HDaZ8Juwnk9zJfPhJOLHoNdTz5HW9rY5MDXDC68w4jZQka/m3pdBxQsLsTO EoS7MD4jyFEJ4ZeslRwPQGNHZoVfJmX7ucVLwmYcqJE3gbPtajR/rtjP0v4X4M433kHR2q VG3orvv+21b5I4Y7Vn8FngsjT8CPVLCooKsnDn2S3qDvj5wS4HVx8S0rZADFAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6KRF5Cq6zfW0; Thu, 20 Jul 2023 17:28:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KHSfK0004577; Thu, 20 Jul 2023 17:28:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHSf65004576; Thu, 20 Jul 2023 17:28:41 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:28:41 GMT Message-Id: <202307201728.36KHSf65004576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 47b1fef6fb22 - main - ifconfig: Fix the display of capabilities in the netlink based code. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d commit 47b1fef6fb2299e5d1d7878c412f1dbd3effbc3d Author: Navdeep Parhar AuthorDate: 2023-07-20 01:05:12 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:26:18 +0000 ifconfig: Fix the display of capabilities in the netlink based code. The capabilities in if_capabilities2/if_capenable2 are reported in the second 32b and were not being displayed correctly. v does not need to be advanced because v[i / 32] is the correct 32b value already. Sponsored by: Chelsio Communications Reviewed by: kib@ Differential Revision: https://reviews.freebsd.org/D41107 --- sbin/ifconfig/ifconfig_netlink.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index f09023c1477c..0f449b7aae44 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -89,8 +89,6 @@ print_bits(const char *btype, uint32_t *v, const int v_count, for (int i = 0; i < v_count * 32; i++) { bool is_set = v[i / 32] & (1 << (i % 32)); - if (i == 31) - v++; if (is_set) { if (num++ == 0) printf("<"); From nobody Thu Jul 20 17:33:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KYH3wNFz4nMBN; Thu, 20 Jul 2023 17:33: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6KYH2PbNz3J2S; Thu, 20 Jul 2023 17:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rxyz8jqxSdCPoRQ6AcpNgaBIi7CuqVW/TnGk89w7FNk=; b=mQkMlQ9l/reIwi+6tSNfOivfkDxwAZCHZn+453q/VyywxDzq83iZcWrSbBVNjaDTcvEW4/ 74rEzLTE9V6vf1Z3D7As1VfQmVIwVgSwaCi+kLhXzlqf2C/JmoMv8Ralfd6bVtMgab88dE yakh/bB3OQ/taWcOFc/k8yamPY8hmVkZ1IEsff76lmeUArPYvTxjeB875dK6LsYtCjhi02 82Ads7JHeVnSpsnFw8uxuCOJr+HqtSPMzeORCUlzdeeVOQ+H2N3nKJVw4Jh1gKBMsGhPxR Df/zonzxzk+PLFZwREgqnX101GSEzPGNAHNAxoU+SJhTVrud8tCVCSRtY4TbQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rxyz8jqxSdCPoRQ6AcpNgaBIi7CuqVW/TnGk89w7FNk=; b=Uz4Jm0S2to+zNl0DdlL1ZB5ICAmWe4e+yTvzAWC6/BdX5DIREwOJtur5piIdOH22gyzt8+ n/qCcc03tbMKYk6JW7+EWxXKrvleY0f+G8wz5yJCfhpyHrnSFHch0W7iYaNRT8WErecOe8 zyvg2cc0vA350NKE9rkbYi0Obws5zC6UvPbCnladhM3H8nkWHBVWmAVQZscwdLKSE/bSgQ 44v+/SWRx+gdEDfzZ/bHU5KEewkILvK5xRdyPSgcKmgAhCCQLyP7pK615NFriLNgOACCUk xqYqfy5/RKWlrFsVLShkkmkuS65VIz9wG+W1hS4nxw+yuJ2CXqE/tRLIGT/V9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874435; a=rsa-sha256; cv=none; b=LQPZ7A3BnBCXWdXoOMFHPdV/ViZLwuw2aKppH3m6ea9hNocvkoJirSyceAr6ulrHo+x+tY I4FAg6oBjhviNZEqdWaKU7+oJZXDaCcsPxsV0nwLeEAHnXqliHErRimK6CS3W/iT1diyUR OzqNGzZN73+N0EmM0R8JL8TgXjOpupBi4SaRXLO9kfRuWyxNxYv77jD0Qp0noD9N8vyY8W eZiFFfFOEbW1pSZSB5q0mfeXc6SkARPy7ZDjOAlpm4/53WQR0uxLTFjQUQhZk3Nvt007vu Qtyn59Sr4tnhxFlSpY9d35xUAzFbOvT0ugF4VbvLGnlojNAJruMDz7REVz/o4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6KYH1TD2zfxg; Thu, 20 Jul 2023 17:33:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KHXtvl020086; Thu, 20 Jul 2023 17:33:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHXtvk020085; Thu, 20 Jul 2023 17:33:55 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:33:55 GMT Message-Id: <202307201733.36KHXtvk020085@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: 0c3eaa06b3cb - main - Remove perforce tools and references List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c3eaa06b3cb6e310491f69620fd20a142c7b116 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0c3eaa06b3cb6e310491f69620fd20a142c7b116 commit 0c3eaa06b3cb6e310491f69620fd20a142c7b116 Author: Minsoo Choo AuthorDate: 2023-07-20 17:28:18 +0000 Commit: Ed Maste CommitDate: 2023-07-20 17:33:39 +0000 Remove perforce tools and references Perforce has been retired since 2019 (commit feea78990c2f), so there is no need anymore to keep perforce tools. Plus, there is no need to mention perforce admin. Reviewed by: emaste, Olivier Certner Differential Revision: https://reviews.freebsd.org/D41106 --- share/misc/organization.dot | 2 -- tools/tools/perforce/awkdiff | 42 --------------------------------------- tools/tools/perforce/p4diffbranch | 19 ------------------ 3 files changed, 63 deletions(-) diff --git a/share/misc/organization.dot b/share/misc/organization.dot index d888ff420b1c..6658a7855d89 100644 --- a/share/misc/organization.dot +++ b/share/misc/organization.dot @@ -48,7 +48,6 @@ bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nallanjude, brd,\ndhw, gavin,\ngjb, peter,\nsbruno, simon,\nzi"] dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nclusteradm"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nclusteradm,\nkuriyama"] -perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, krion, ler, philip, pi, rea, remko, zi"] webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] @@ -68,7 +67,6 @@ _admin -> bugmeister _admin -> clusteradm _admin -> dnsadm _admin -> mirroradmin -_admin -> perforceadmin _admin -> postmaster _admin -> webmaster diff --git a/tools/tools/perforce/awkdiff b/tools/tools/perforce/awkdiff deleted file mode 100755 index 380d6fa26f93..000000000000 --- a/tools/tools/perforce/awkdiff +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/awk -f -# -# $FreeBSD$ -# - -BEGIN { - #parentpath = "//depot/vendor/freebsd/src/sys/" - #childpath = "//depot/projects/opencrypto/" -} -$1 == "====" { - last_line = $0 - last_filename = $2 - #gsub(parentpath, "", last_filename) - gsub(/#[0-9]*$/, "", last_filename) - did_sub = 0 -} -$1 == "====" && $2 == "" { - new_file = $4 - gsub(childpath, "", new_file) - gsub(/#[0-9]*$/, "", new_file) - cmd = "p4 print \"" $4 "\" | sed '/^\\/\\/depot/d' | diff -u /dev/null /dev/stdin | sed s@/dev/stdin@" new_file "@" - #print "x" cmd "x" - system(cmd) -} -$1 == "====" && $4 == "" { - del_file = $2 - gsub(parentpath, "", del_file) - gsub(/#[0-9]*$/, "", del_file) - cmd = "p4 print \"" $2 "\" | sed '/^\\/\\/depot/d' | diff -u /dev/stdin /dev/null | sed s@/dev/stdin@" del_file "@" - #print "x" cmd "x" - system(cmd) -} -$1 != "====" { - if (!did_sub && (($1 == "***************") || ($1 == "@@"))) { - print "--- ", last_filename ".orig" - print "+++ ", last_filename - print $0 - did_sub = 1 - } else { - print $0 - } -} diff --git a/tools/tools/perforce/p4diffbranch b/tools/tools/perforce/p4diffbranch deleted file mode 100755 index 9d29f23c5019..000000000000 --- a/tools/tools/perforce/p4diffbranch +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# -# $FreeBSD$ -# - -if [ x"$#" != x"2" ]; then - echo "Usage: $0 " - exit 1 -fi - -basescript="$(realpath "$0")" -awkdiff="${basescript%/*}/awkdiff" - -branch="$1" -changenum="$2" - -p4 branch -o "$branch" | - awk ' /^View:/ { doview = 1; next; } /^[^ ]/ {doview = 0; next; } $1 && $2 && doview == 1 { system("p4 diff2 -du " $1 "@" changenum " " $2) }' changenum="$changenum" | - "$awkdiff" From nobody Thu Jul 20 17:34:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6KZH2bThz4nMpd; Thu, 20 Jul 2023 17:34:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6KZG6hyKz3JFq; Thu, 20 Jul 2023 17:34:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36KHYZpg050630 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 20 Jul 2023 20:34:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36KHYZpg050630 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36KHYZFX050629; Thu, 20 Jul 2023 20:34:35 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Jul 2023 20:34:35 +0300 From: Konstantin Belousov To: Cy Schubert Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230720170624.B8F28DB@slippy.cwsent.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R6KZG6hyKz3JFq X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > > Belous > > > ov writes: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924 > > ca > > > f5 > > > > 81c93460 > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > If mprotect(2) changed protection in the bottom of the currently grow > > n > > > > stack region, currently the changed protection would be used for the > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > Store the original protection for the entry at mmap(2) time in the > > > > offset member of the gap vm_map_entry, and use it for protection of t > > he > > > > grown stack region. > > > > > > > > PR: 272585 > > > > Reported by: John F. Carr > > > > Reviewed by: alc, markj > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > --- > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > sys/vm/vm_map.h | 4 ++++ > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > index a02107b5e64d..997a49111a59 100644 > > > > --- a/sys/vm/vm_map.c > > > > +++ b/sys/vm/vm_map.c > > > > @@ -4493,7 +4493,7 @@ static int > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssi > > ze > > > , > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > { > > > > - vm_map_entry_t new_entry, prev_entry; > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > vm_size_t init_ssize, sgp; > > > > int orient, rv; > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t add > > rb > > > os > > > > , vm_size_t max_ssize, > > > > * read-ahead logic is never used for it. Re-use > > > > * next_read of the gap entry to store > > > > * stack_guard_page for vm_map_growstack(). > > > > + * Similarly, since a gap cannot have a backing object, > > > > + * store the original stack protections in the > > > > + * object offset. > > > > */ > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > - else > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entry) > > > > ; > > > > + gap_entry->next_read = sgp; > > > > + gap_entry->offset = prot; > > > > } else { > > > > (void)vm_map_delete(map, bot, top); > > > > } > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm > > _m > > > ap > > > > _entry_t gap_entry) > > > > struct ucred *cred; > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > vm_size_t grow_amount, guard, max_grow; > > > > + vm_prot_t prot; > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > int rv, rv1 __diagused; > > > > bool gap_deleted, grow_down, is_procstack; > > > > @@ -4739,6 +4743,12 @@ retry: > > > > } > > > > > > > > if (grow_down) { > > > > + /* > > > > + * The gap_entry "offset" field is overloaded. See > > > > + * vm_map_stack_locked(). > > > > + */ > > > > + prot = gap_entry->offset; > > > > + > > > > grow_start = gap_entry->end - grow_amount; > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > gap_start = gap_entry->start; > > > > @@ -4751,9 +4761,7 @@ retry: > > > > gap_deleted = false; > > > > } > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > - grow_start + grow_amount, > > > > - stack_entry->protection, stack_entry->max_protection, > > > > - MAP_STACK_GROWS_DOWN); > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOWN) > > > > ; > > > > if (rv != KERN_SUCCESS) { > > > > if (gap_deleted) { > > > > rv1 = vm_map_insert(map, NULL, 0, gap_start, > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > --- a/sys/vm/vm_map.h > > > > +++ b/sys/vm/vm_map.h > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > * a VM object (or sharing map) and offset into that object, > > > > * and user-exported inheritance and protection information. > > > > * Also included is control information for virtual copy operation > > s. > > > > + * > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > WN > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > + * storage, and offset is the stack protection. > > > > */ > > > > struct vm_map_entry { > > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > > error when opening a new screen window (ctrl-A c): > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > > and in the email cc'd to me. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > Sometimes this occurs at screen start. Then it hangs. > > slippy$ screen > pid 7275 comm screen-4.9.0 has trashed its stack, killing Can you check this? diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8c864c943f5d..4c5f1c08954d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4202,7 +4202,8 @@ vm_map_copy_entry( src_entry->start); } else { dst_entry->object.vm_object = NULL; - dst_entry->offset = 0; + if ((dst_entry->eflags & MAP_ENTRY_GUARD) == 0) + dst_entry->offset = 0; if (src_entry->cred != NULL) { dst_entry->cred = curthread->td_ucred; crhold(dst_entry->cred); From nobody Thu Jul 20 17:36:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Kbv2qhcz4nNWj; Thu, 20 Jul 2023 17:36:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.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 4R6Kbv168hz3Jtq; Thu, 20 Jul 2023 17:36:11 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MRcgqYvD46NwhMXZSqRmfr; Thu, 20 Jul 2023 17:36:10 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MXZQqH7CuyAOeMXZRq8Aq5; Thu, 20 Jul 2023 17:36:10 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b9708a a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=1Rrndl_ikATqP_Wnm9AA:9 a=CjuIK1q_8ugA:10 a=btS-jjpKxVEA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id AB7EA7E; Thu, 20 Jul 2023 10:36:08 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 8EF0B185; Thu, 20 Jul 2023 10:36:08 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720170624.B8F28DB@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 10:06:24 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 10:36:08 -0700 Message-Id: <20230720173608.8EF0B185@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKp3ITMuS7R84XZyTMP7ZtR1uipQBb3lVgxKEMFHd/PcEhfAbZcekkUl/goGkQJPTyCU34TUa5lYJRWUSbyKd27m0INYh/AYihBcUtCRVOIT8w92EBX2 TCCtpDKzNCcKerEBU3qN2cZ++3Lhgq4WwKR5VKabJA90JwhPUl+VulbdVj1qSFXXKjhoX6wlkOMk8sVuRT5bnDctfM08RxbwFyNclzE0kk2NNrieUeYiHqLo xLw2YdaDx1G8qTlPHBHeyATmJ2qEF0LsfMSnDpn+qm+4BBlq8TQ3dULMkR6vqy6f/yqeEwDg0742L9vtDzou1u3puqMPHIklIEuL63s/89A= X-Rspamd-Queue-Id: 4R6Kbv168hz3Jtq X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated Sorry for spamming everyone again. pkg fails on a segfault: slippy# pkg upg Updating prod repository catalogue... pkg: No SRV record found for the repo 'prod' Fetching meta.conf: 0% Fetching packagesite.pkg: 0% prod repository is up to date. All repositories are up to date. Checking for upgrades (6 candidates): 100% 6 B 0.0kB/s 00:01 Processing candidates (6 candidates): 0%Child process pid=8051 terminated abnormally: Segmentation fault slippy# Reverting this revision, locally, has restored functionality to pkg and screen. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <20230720170624.B8F28DB@slippy.cwsent.com>, Cy Schubert writes: > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes: > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstantin > > > Belous > > > ov writes: > > > > The branch main has been updated by kib: > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f7259 > 24 > > ca > > > f5 > > > > 81c93460 > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > If mprotect(2) changed protection in the bottom of the currently gr > ow > > n > > > > stack region, currently the changed protection would be used for th > e > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > Store the original protection for the entry at mmap(2) time in the > > > > offset member of the gap vm_map_entry, and use it for protection of > t > > he > > > > grown stack region. > > > > > > > > PR: 272585 > > > > Reported by: John F. Carr > > > > Reviewed by: alc, markj > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > --- > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > sys/vm/vm_map.h | 4 ++++ > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > index a02107b5e64d..997a49111a59 100644 > > > > --- a/sys/vm/vm_map.c > > > > +++ b/sys/vm/vm_map.c > > > > @@ -4493,7 +4493,7 @@ static int > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_s > si > > ze > > > , > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > { > > > > - vm_map_entry_t new_entry, prev_entry; > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > vm_size_t init_ssize, sgp; > > > > int orient, rv; > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t a > dd > > rb > > > os > > > > , vm_size_t max_ssize, > > > > * read-ahead logic is never used for it. Re-use > > > > * next_read of the gap entry to store > > > > * stack_guard_page for vm_map_growstack(). > > > > + * Similarly, since a gap cannot have a backing object, > > > > + * store the original stack protections in the > > > > + * object offset. > > > > */ > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > - else > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > w_entry) > > > > ; > > > > + gap_entry->next_read = sgp; > > > > + gap_entry->offset = prot; > > > > } else { > > > > (void)vm_map_delete(map, bot, top); > > > > } > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, > vm > > _m > > > ap > > > > _entry_t gap_entry) > > > > struct ucred *cred; > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > vm_size_t grow_amount, guard, max_grow; > > > > + vm_prot_t prot; > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > int rv, rv1 __diagused; > > > > bool gap_deleted, grow_down, is_procstack; > > > > @@ -4739,6 +4743,12 @@ retry: > > > > } > > > > > > > > if (grow_down) { > > > > + /* > > > > + * The gap_entry "offset" field is overloaded. See > > > > + * vm_map_stack_locked(). > > > > + */ > > > > + prot = gap_entry->offset; > > > > + > > > > grow_start = gap_entry->end - grow_amount; > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > gap_start = gap_entry->start; > > > > @@ -4751,9 +4761,7 @@ retry: > > > > gap_deleted = false; > > > > } > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > - grow_start + grow_amount, > > > > - stack_entry->protection, stack_entry->max_protectio > n, > > > > - MAP_STACK_GROWS_DOWN); > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > WS_DOWN) > > > > ; > > > > if (rv != KERN_SUCCESS) { > > > > if (gap_deleted) { > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > tart, > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > --- a/sys/vm/vm_map.h > > > > +++ b/sys/vm/vm_map.h > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > * a VM object (or sharing map) and offset into that object, > > > > * and user-exported inheritance and protection information. > > > > * Also included is control information for virtual copy operation > > s. > > > > + * > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > WN > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > + * storage, and offset is the stack protection. > > > > */ > > > > struct vm_map_entry { > > > > struct vm_map_entry *left; /* left child or previous entry > */ > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the following > > > error when opening a new screen window (ctrl-A c): > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent directory > > and in the email cc'd to me. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > e^(i*pi)+1=0 > > > > > > Sometimes this occurs at screen start. Then it hangs. > > slippy$ screen > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > > -- > Cheers, > Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > e^(i*pi)+1=0 > > From nobody Thu Jul 20 17:39:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Kgw22Bnz4nQNR; Thu, 20 Jul 2023 17:39: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Kgw1cPjz3L3l; Thu, 20 Jul 2023 17:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O5e5FXu2MI8SLArLTSHfHeUvWLe1r65Ow0xRPF2Elzs=; b=QgAqrgrxT6uOZBwfuRTcLknh1nO3igtmyvqw18L4OaQAHC8PigolgrqxoQxa+SZzf4eczw PjfHipQtjGdpfvuFt53taz+2Sa2qh8/PoGlFfGxeiaph/71iUrQXS2PO0uY90jiwmk5YyI 67PT/TtW7Kcj2zcTt6DokZczi8Ye5JRBAKSAttL1ahdI3BSr6j05vL61slPxMGbLbOztMv tgjWeDCyGW57jaEm+eh1ZzViNCc27Bx6JxSFrJMOlWJys5LHr6GZbzmQGNR5AyF4H7rdnq 3+GfhBEz+HIUpJakYDBA5P6dDKCoY3R7kpB+4MMqOUb/Dc8FNYpJqZz/7jAETg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689874780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O5e5FXu2MI8SLArLTSHfHeUvWLe1r65Ow0xRPF2Elzs=; b=UrIuHkGNJ9KWwy+sMN5SIQzJLHA+tSyqYgajVJnVhJXH4PHM5MUXikb14Q1gxFe8n3VS0G 3G3/sg/7SbzUqlZTo0ro/Reg7LAZ5zfrRpndL2Lb7Y1PBI3vOFuq4zF9Bja6tO/1HDzoaq NcwwN66R0W+sNyGNE3tLpG83ZTUPDb7AAlI+N9nFwJCbwHOvlElRhJJPwRYDqgqW88PiTK R3ahVK/whNTiVM55S//o0is3PRjlH0LlyEvOHBeDjDEt5SjQI+3U6Pq4w01oOM+UIta70/ c0etnoAN69J1T21XFaTZLh6/Fo8nNEvEaZESewcF9mRD2h902OjwD5W9BLnYfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689874780; a=rsa-sha256; cv=none; b=MZmJ/bYZowtUcFy0sbcmGcxUuf8eZ7KR2lo1YqujOqvVoOB7L7gCEY2kYPHbIHLZ79EtAI pLLOsFvlLk+g4buGiZ1FCgSp9vVedppYK4/u0q0OsjvePo5NLeMlBtg9fjpqqDzjapReED p2/llJMT+Y9hAFWjrUN+uKdldqNF+YjiytkAuvhYogtjbbui1kDrsUrgTSSmowfkEWo7U7 ARFF0nJddl9+lbuSaUSYY8wmmZ2pE0SYEpQg3TpLFjY0tJT9z1oNY92Ry3ksxKUmCW6uTY I5LMz2Ze0PZ7bSx4Augj7+el/JKKVn+H4SRbCKHdwixRk/Zoo1e+D/oD7r9bZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6Kgw0ZNCzgD7; Thu, 20 Jul 2023 17:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KHddG3021047; Thu, 20 Jul 2023 17:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHddue021046; Thu, 20 Jul 2023 17:39:39 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:39:39 GMT Message-Id: <202307201739.36KHddue021046@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: e0a63d875eeb - main - pciconf: add PCIe 5.0 and PCIe 6.0 link speeds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0a63d875eeb630092034808b0795a935d5c0934 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e0a63d875eeb630092034808b0795a935d5c0934 commit e0a63d875eeb630092034808b0795a935d5c0934 Author: Ed Maste AuthorDate: 2023-06-21 20:23:18 +0000 Commit: Ed Maste CommitDate: 2023-07-20 17:39:17 +0000 pciconf: add PCIe 5.0 and PCIe 6.0 link speeds Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40710 --- usr.sbin/pciconf/cap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c index 3d28fe9bc331..9cae4bc49e03 100644 --- a/usr.sbin/pciconf/cap.c +++ b/usr.sbin/pciconf/cap.c @@ -396,6 +396,10 @@ link_speed_string(uint8_t speed) return ("8.0"); case 4: return ("16.0"); + case 5: + return ("32.0"); + case 6: + return ("64.0"); default: return ("undef"); } From nobody Thu Jul 20 17:56:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6L2x3Jyqz4nZK9; Thu, 20 Jul 2023 17:56: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6L2x0Q8dz3hXF; Thu, 20 Jul 2023 17:56:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y0plXdmvFmBPj/4TnyfXMh1vDLQRo9Db59qzCrUduXc=; b=UlGquRUEpVQLnTdVdx02YkTwMjTbQA4fyGOtul1xAHrdgQmdb8hPTna2PXEZZbyEKeczEC PeWzmud2tgXGmGPCY719f1KQ8zeQceGIxny6glz5jqdpY/YzV2/vt1tRR/W5nXye76wrE/ p6326aRK10XZ0vEaHSuBmZnoEmo0JEmbjwcP1/McfWopQzIDDfrnLIS2FUNFBonssBeI/q 53l3slyDHuauta8u24TZbOQwZ9gkMKy4jv9hub9A+o4jpoqTjmwL9bJm/7LfEQEHroRhG3 sQawKeeAsoQFzOa47GCAlKnUeb1/OrryScRK9AA/Myx+MyjToTFAFK8VqzEyFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875769; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y0plXdmvFmBPj/4TnyfXMh1vDLQRo9Db59qzCrUduXc=; b=E0KKDOF1OURvrakNO0bxjuM10pvwmJ1wtK/7xqpD8+DvBRDVcEAevclNBwnKSVnax3Q8kR 2lw3uI2OOLc8wYcubnOAen6PLBB4kIjOnIktjm8pvFSOV6Kz6zNubhCSNAL8gMXgI2BCa0 LH3Yh/cfgL7bZxsGYGnfUufhEfFf1hg23vP6XGW6VMt6tgfGE9JJpk7a3jq3qwroJJpqq/ wcErBLJ2FL67achSBYYF6wuIdyohbfyAW6l6RQh8ByjIEF9ki4xl1aXDQtyK64MwmIz60C ZvckzQVfA66CJdmPwep+nArMcTZnel8/x+Z8QQKiYXKm6nyJKbVh47JPQLRlSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689875769; a=rsa-sha256; cv=none; b=dR0N4KBK4dPCqOgSejtyT23p8Aa41VgoYN+AyZhrdo9FaNdl2WUHqfUHWKd8ZeaaJ1q9aM mKYi0AArzL02dQC2Bo/U0Vgbd4EuU09ulb1qyHtrMZq14cr+XL7/hhoCUCR6tTt2nB7rR2 8fUiiywvHWqw3VPQTc59iEK28yPTSMXaAlNr/kIeQe75rgraR1HFjha5CY5MPrFkQ6uo1k xqE5zfqzsAfEfq/KobvDiAA03WANMSTCJ4imw3MTlDIktR6kgf3he9WsHCE1MZY0g0WGWE 2xCrNJm3MA97D+cYZkwtadcx7yYAohtzmpFvnN8ve4b2c2T8wONqiXn3aQ8eSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6L2w6ZVyzgCc; Thu, 20 Jul 2023 17:56:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KHu834054298; Thu, 20 Jul 2023 17:56:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHu8Ge054297; Thu, 20 Jul 2023 17:56:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:56:08 GMT Message-Id: <202307201756.36KHu8Ge054297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 88284368fa6b - main - ifconfig: Shift unsigned value to avoid UB. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88284368fa6b25b9f7b601876794a9f5304ae59f Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=88284368fa6b25b9f7b601876794a9f5304ae59f commit 88284368fa6b25b9f7b601876794a9f5304ae59f Author: Navdeep Parhar AuthorDate: 2023-07-20 17:42:15 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:54:56 +0000 ifconfig: Shift unsigned value to avoid UB. Reported by: kib@ --- sbin/ifconfig/ifconfig_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index 0f449b7aae44..d2e3863079e7 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -88,7 +88,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count, int num = 0; for (int i = 0; i < v_count * 32; i++) { - bool is_set = v[i / 32] & (1 << (i % 32)); + bool is_set = v[i / 32] & (1U << (i % 32)); if (is_set) { if (num++ == 0) printf("<"); From nobody Thu Jul 20 17:56:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6L2y2H4nz4nZX7; Thu, 20 Jul 2023 17:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6L2y1HnVz3hg5; Thu, 20 Jul 2023 17:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8spWTE6YzgDsFEZtjrF32RlxunYE3lHLtos/kU77/s=; b=Pq2OVVdmQlOLNVafvZkQ/tE0PUAG7THcLl5XlDWBR8Zf1xqCw0fP12iPXOMgNdovR+rZK8 YepXqFtNwaZeUJ7eujnX5xIg3WBD6512/upAWKxcSc2tjyuH1rNmGDWEV1qDXv3H9Nbpts Zsz3c7/eXSyjpuUo3Hu2xA3dMk62yOScFwTgEtBzj0fFD6SE9D93WdqvpNrdoroGiT31Ou CmbZ86YLcm1cmvlc7NBfv6ZVgf55iY6qwC6mBWnS+k8yTQKpFd25bNdIiYsUhVP6hPGbb0 Kkm3mGpmCNIwKH3JgQyo1nFUPfJjYrstDfzrw8SNApfHoWGPbU7lTsDdBn1CpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689875770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8spWTE6YzgDsFEZtjrF32RlxunYE3lHLtos/kU77/s=; b=mhsYN9NYt8vhgB8yIIe5w1jyZh/yz00pE00d5eOqSWp1WVVE8YdAePaJSmKA3mu4VmIQ3R Zb5YHN/GVlUpg/Dab+glQpx0g+Lw4oVEKFqVDtCRrlNamJi61BMiUZORrqeXEp9GKOP0VR L9FGdfMobMSC9Vkoy0wTIrZ4eDmMdrvtH47+MWDgh7q+PighfKBivXcmXYP5q302Rrtjf1 IhtOpcXXcOTcRLouqojgPudd9hNRqL9szVETvj3c460L106cbiMWgESp7Iq2Z4xq68jHOd BFOtvGeOvEnJ6cf432w6DSyp9Pcunp/qm2uQWIxgAsAd7SByFsr4w0rMp9jrLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689875770; a=rsa-sha256; cv=none; b=qrdjoQdM4Vtlv6CB4qnoIyq/ybbElpyU23Vv111rGKMjj03IHX4uGxoNy4A7pXa8jrZ75I oGNjfE5YuYBg4+hU4aRNiGCi964eRelMMT+oItA3uMjicGIX8N53BdInGmUCqYWzi4utos zT8g7z0w54Oj5FHL3nCmVnFZV3eqbxxuEC+JR1TG96N4O2NUGXGTQJIL371SHKekGvH1H1 eUYVsHbJdd/Jj0JRg+LGlk9NSno/4Oe48wq7d+UpNgJoZUZDJR01mTtC2bKQo3+8O8CFUX +f9hEoutJjJVyT/bDCE6jHv6dnWpyWTac3LEMlQbvfSn9M6F8OWpqRxtgR5vFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6L2y0NR5zgHn; Thu, 20 Jul 2023 17:56:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KHu9Tv054324; Thu, 20 Jul 2023 17:56:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KHu9Cf054323; Thu, 20 Jul 2023 17:56:09 GMT (envelope-from git) Date: Thu, 20 Jul 2023 17:56:09 GMT Message-Id: <202307201756.36KHu9Cf054323@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: a29916a6f8f5 - main - ifconfig_netlink.c: whitespace cleanup. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a29916a6f8f54e264279c990884b545b4048bb47 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=a29916a6f8f54e264279c990884b545b4048bb47 commit a29916a6f8f54e264279c990884b545b4048bb47 Author: Navdeep Parhar AuthorDate: 2023-07-20 17:47:34 +0000 Commit: Navdeep Parhar CommitDate: 2023-07-20 17:54:56 +0000 ifconfig_netlink.c: whitespace cleanup. No functional change. --- sbin/ifconfig/ifconfig_netlink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c index d2e3863079e7..76dd99307f31 100644 --- a/sbin/ifconfig/ifconfig_netlink.c +++ b/sbin/ifconfig/ifconfig_netlink.c @@ -102,7 +102,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count, } if (num > 0) printf(">"); -} +} static void nl_init_socket(struct snl_state *ss) @@ -287,7 +287,7 @@ match_iface(struct ifconfig_args *args, struct iface *iface) }; return (match_ether(&sdl)); } - + for (struct ifa *ifa = iface->ifa; ifa != NULL; ifa = ifa->next) { if (args->afp->af_af == ifa->addr.ifa_family) return (true); @@ -421,7 +421,7 @@ static int get_local_socket(void) { int s = socket(AF_LOCAL, SOCK_DGRAM, 0); - + if (s < 0) err(1, "socket(family %u,SOCK_DGRAM)", AF_LOCAL); return (s); From nobody Thu Jul 20 18:02:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LBK06k8z4nf3p; Thu, 20 Jul 2023 18:02:33 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LBJ6RTDz3kbG; Thu, 20 Jul 2023 18:02:32 +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 ESMTP id MQSBqfqWaLAoIMXyyqcAoH; Thu, 20 Jul 2023 18:02:32 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MXywqunJRHFsOMXyxqzhIv; Thu, 20 Jul 2023 18:02:32 +0000 X-Authority-Analysis: v=2.4 cv=XZqaca15 c=1 sm=1 tr=0 ts=64b976b8 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=1Rrndl_ikATqP_Wnm9AA:9 a=CjuIK1q_8ugA:10 a=8k-k-Cn0ORkA:10 a=QHqjWXHE9tEA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 2229C1BC; Thu, 20 Jul 2023 11:02:30 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 18BDF11F; Thu, 20 Jul 2023 11:02:30 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Konstantin Belousov cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Comments: In-reply-to Konstantin Belousov message dated "Thu, 20 Jul 2023 20:34:35 +0300." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 11:02:30 -0700 Message-Id: <20230720180230.18BDF11F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfNi5bUawf+GpY0IsDgDlGtrqTUMHsJzA0zYZ1o8JMCSlHEgN3fWUu7AnN2bLie7oJYV2ZAHi/yg8yIaxccbmno8YsnhkrVBcKlvlMWNeX4htK8nYHUEP QQ4mbfVbgMwLt5eHokHGsKOsN5q0X+TM2M3NDgD4y68K4cq1chDUYst3bZQ5eTTgPUGvyf32tmZguwEHRMFM+0wA5/sfSFYfjq2piQUYOwS6Wx9EOKO6oOwa CgsbJX/NHCHSS5xZOA5WhL1Dlo592mvTDa1uwTn/TH+eAOi/NFkeosycs/eHFwx9b9nNowGu9dCaadUm1wH71oXjuOPu7MbCxKniGGcFcKA= X-Rspamd-Queue-Id: 4R6LBJ6RTDz3kbG X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message , Konstantin Belousov writes: > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert writes: > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writes > : > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstanti > n > > > > Belous > > > > ov writes: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f72 > 5924 > > > ca > > > > f5 > > > > > 81c93460 > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > If mprotect(2) changed protection in the bottom of the currently > grow > > > n > > > > > stack region, currently the changed protection would be used for > the > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > Store the original protection for the entry at mmap(2) time in th > e > > > > > offset member of the gap vm_map_entry, and use it for protection > of t > > > he > > > > > grown stack region. > > > > > > > > > > PR: 272585 > > > > > Reported by: John F. Carr > > > > > Reviewed by: alc, markj > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > --- > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > --- a/sys/vm/vm_map.c > > > > > +++ b/sys/vm/vm_map.c > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max > _ssi > > > ze > > > > , > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > { > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > vm_size_t init_ssize, sgp; > > > > > int orient, rv; > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t > add > > > rb > > > > os > > > > > , vm_size_t max_ssize, > > > > > * read-ahead logic is never used for it. Re-use > > > > > * next_read of the gap entry to store > > > > > * stack_guard_page for vm_map_growstack(). > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > + * store the original stack protections in the > > > > > + * object offset. > > > > > */ > > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > > - else > > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > w_entry) > > > > > ; > > > > > + gap_entry->next_read = sgp; > > > > > + gap_entry->offset = prot; > > > > > } else { > > > > > (void)vm_map_delete(map, bot, top); > > > > > } > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr > , vm > > > _m > > > > ap > > > > > _entry_t gap_entry) > > > > > struct ucred *cred; > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > + vm_prot_t prot; > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > int rv, rv1 __diagused; > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > } > > > > > > > > > > if (grow_down) { > > > > > + /* > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > + * vm_map_stack_locked(). > > > > > + */ > > > > > + prot = gap_entry->offset; > > > > > + > > > > > grow_start = gap_entry->end - grow_amount; > > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > > gap_start = gap_entry->start; > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > gap_deleted = false; > > > > > } > > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > > - grow_start + grow_amount, > > > > > - stack_entry->protection, stack_entry->max_protectio > n, > > > > > - MAP_STACK_GROWS_DOWN); > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > WS_DOWN) > > > > > ; > > > > > if (rv != KERN_SUCCESS) { > > > > > if (gap_deleted) { > > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > tart, > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > --- a/sys/vm/vm_map.h > > > > > +++ b/sys/vm/vm_map.h > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > * a VM object (or sharing map) and offset into that object, > > > > > * and user-exported inheritance and protection information. > > > > > * Also included is control information for virtual copy operation > > > s. > > > > > + * > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > > WN > > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > > + * storage, and offset is the stack protection. > > > > > */ > > > > > struct vm_map_entry { > > > > > struct vm_map_entry *left; /* left child or previous entry > */ > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the followin > g > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent director > y > > > and in the email cc'd to me. > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=0 > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > slippy$ screen > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > Can you check this? > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index 8c864c943f5d..4c5f1c08954d 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > src_entry->start); > } else { > dst_entry->object.vm_object = NULL; > - dst_entry->offset = 0; > + if ((dst_entry->eflags &> + dst_entry->offset = 0; > if (src_entry->cred != NULL) { > dst_entry->cred = curthread->td_ucred; > crhold(dst_entry->cred); Yes, this fixes the screen and pkg regressions. Thanks for the patch. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 18:09:26 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LLK2DRLz4nhQ0; Thu, 20 Jul 2023 18:09:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LLK1cXgz3mC4; Thu, 20 Jul 2023 18:09:29 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id MOdFqfnXuLAoIMY5gqcCod; Thu, 20 Jul 2023 18:09:28 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MY5eqHGq1yAOeMY5fq8GAY; Thu, 20 Jul 2023 18:09:28 +0000 X-Authority-Analysis: v=2.4 cv=e5oV9Il/ c=1 sm=1 tr=0 ts=64b97858 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=VxmjJ2MpAAAA:8 a=NCkSDawCeJ8rtZbfAdsA:9 a=CjuIK1q_8ugA:10 a=MpzTSJa1xHYA:10 a=8k-k-Cn0ORkA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 476DF173; Thu, 20 Jul 2023 11:09:26 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 29987BC; Thu, 20 Jul 2023 11:09:26 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Konstantin Belousov , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: <20230720180230.18BDF11F@slippy.cwsent.com> References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> Comments: In-reply-to Cy Schubert message dated "Thu, 20 Jul 2023 11:02:30 -0700." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 11:09:26 -0700 Message-Id: <20230720180926.29987BC@slippy.cwsent.com> X-CMAE-Envelope: MS4xfO4JWDjgG6K3S9M0e2kXt2B0vcbRCW/NXNiA0+nl9djz9zp3g6KypH0W5POqJG+SWkgUrUXMZRSX+9RNzvchjoBQZyyhRTP7Exi32GSQS1Unnv8B1rv2 qwQeVLaz48C04HKiO3fdSVSiy8usiScWm7UqdPaeXc2CeekznDb5ViR1Bk33Zh0wfvLrWxxMERyEYSGyjA6IRBS4LR24BCEFl3avu1yrkVdIH5H7U69+fXDh ADpV72wye5GHcocRaqYdrybLPE0Q5F14z4NyA6D/YHwdXJZ/gsv6G2XoCBZ5I2W29X7GgIgVXwS65LAS+B0SsBhpv9OsxSfO47p8JgzNz+0= X-Rspamd-Queue-Id: 4R6LLK1cXgz3mC4 X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated This email appears truncated. My original reply was, Yes, this fixes the screen and pkg regressions. Thanks for the patch. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 In message <20230720180230.18BDF11F@slippy.cwsent.com>, Cy Schubert writes: > In message , Konstantin Belousov writes: > > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert write > s: > > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert writ > es > > : > > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Konstan > ti > > n > > > > > Belous > > > > > ov writes: > > > > > > The branch main has been updated by kib: > > > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f > 72 > > 5924 > > > > ca > > > > > f5 > > > > > > 81c93460 > > > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > > Author: Konstantin Belousov > > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > > Commit: Konstantin Belousov > > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > > > If mprotect(2) changed protection in the bottom of the currentl > y > > grow > > > > n > > > > > > stack region, currently the changed protection would be used fo > r > > the > > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > > > Store the original protection for the entry at mmap(2) time in > th > > e > > > > > > offset member of the gap vm_map_entry, and use it for protectio > n > > of t > > > > he > > > > > > grown stack region. > > > > > > > > > > > > PR: 272585 > > > > > > Reported by: John F. Carr > > > > > > Reviewed by: alc, markj > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > MFC after: 1 week > > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > > --- > > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > > --- a/sys/vm/vm_map.c > > > > > > +++ b/sys/vm/vm_map.c > > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t m > ax > > _ssi > > > > ze > > > > > , > > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > > { > > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > > vm_size_t init_ssize, sgp; > > > > > > int orient, rv; > > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_offset > _t > > add > > > > rb > > > > > os > > > > > > , vm_size_t max_ssize, > > > > > > * read-ahead logic is never used for it. Re-use > > > > > > * next_read of the gap entry to store > > > > > > * stack_guard_page for vm_map_growstack(). > > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > > + * store the original stack protections in the > > > > > > + * object offset. > > > > > > */ > > > > > > - if (orient == MAP_STACK_GROWS_DOWN) > > > > > > - vm_map_entry_pred(new_entry)->next_read = sgp; > > > > > > - else > > > > > > - vm_map_entry_succ(new_entry)->next_read = sgp; > > > > > > + gap_entry = orient == MAP_STACK_GROWS_DOWN ? > > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(ne > > w_entry) > > > > > > ; > > > > > > + gap_entry->next_read = sgp; > > > > > > + gap_entry->offset = prot; > > > > > > } else { > > > > > > (void)vm_map_delete(map, bot, top); > > > > > > } > > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t ad > dr > > , vm > > > > _m > > > > > ap > > > > > > _entry_t gap_entry) > > > > > > struct ucred *cred; > > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > > + vm_prot_t prot; > > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > > int rv, rv1 __diagused; > > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > > } > > > > > > > > > > > > if (grow_down) { > > > > > > + /* > > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > > + * vm_map_stack_locked(). > > > > > > + */ > > > > > > + prot = gap_entry->offset; > > > > > > + > > > > > > grow_start = gap_entry->end - grow_amount; > > > > > > if (gap_entry->start + grow_amount == gap_entry->end) { > > > > > > gap_start = gap_entry->start; > > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > > gap_deleted = false; > > > > > > } > > > > > > rv = vm_map_insert(map, NULL, 0, grow_start, > > > > > > - grow_start + grow_amount, > > > > > > - stack_entry->protection, stack_entry->max_protectio > > n, > > > > > > - MAP_STACK_GROWS_DOWN); > > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GRO > > WS_DOWN) > > > > > > ; > > > > > > if (rv != KERN_SUCCESS) { > > > > > > if (gap_deleted) { > > > > > > rv1 = vm_map_insert(map, NULL, 0, gap_s > > tart, > > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > > --- a/sys/vm/vm_map.h > > > > > > +++ b/sys/vm/vm_map.h > > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > > * a VM object (or sharing map) and offset into that object, > > > > > > * and user-exported inheritance and protection information. > > > > > > * Also included is control information for virtual copy operation > > > > s. > > > > > > + * > > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS_DO > > > > WN > > > > > > + * or UP), the next_read member is reused as the stack_guard_page > > > > > > + * storage, and offset is the stack protection. > > > > > > */ > > > > > > struct vm_map_entry { > > > > > > struct vm_map_entry *left; /* left child or previous entry > > */ > > > > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the follow > in > > g > > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > > > > -- > > > > > Cheers, > > > > > Cy Schubert > > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > > NTP: Web: https://nwtime.org > > > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh> or > > y > > > > and in the email cc'd to me. > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=0 > > > > > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > > > slippy$ screen > > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > > > Can you check this? > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > index 8c864c943f5d..4c5f1c08954d 100644 > > --- a/sys/vm/vm_map.c > > +++ b/sys/vm/vm_map.c > > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > > src_entry->start); > > } else { > > dst_entry->object.vm_object = NULL; > > - dst_entry->offset = 0; > > + if ((dst_entry->eflags & From nobody Thu Jul 20 18:35:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LyB0FR6z4p0cb; Thu, 20 Jul 2023 18:37:06 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Ly94T47z3tjb; Thu, 20 Jul 2023 18:37:05 +0000 (UTC) (envelope-from marck@rinet.ru) Authentication-Results: mx1.freebsd.org; none Received: from localhost (woozle.rinet.ru [195.54.192.68]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id 36KIZdSR004096; Thu, 20 Jul 2023 21:35:41 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Thu, 20 Jul 2023 21:35:39 +0300 (MSK) From: Dmitry Morozovsky To: Cy Schubert cc: Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-Reply-To: <20230720180926.29987BC@slippy.cwsent.com> Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> <20230720180926.29987BC@slippy.cwsent.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-ID: 6B691B03 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [195.54.192.68]); Thu, 20 Jul 2023 21:35:41 +0300 (MSK) X-Rspamd-Queue-Id: 4R6Ly94T47z3tjb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8331, ipnet:195.54.192.0/19, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023, Cy Schubert wrote: > This email appears truncated. My original reply was, > > Yes, this fixes the screen and pkg regressions. > > Thanks for the patch. FWIW, copy to the list was complete; maybe it's you local dellivery agent trouble -- Sincerely, D.Marck [MCK-RIPE] [ FreeBSD committer: marck@FreeBSD.org ] --------------------------------------------------------------------------- *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- woozle@woozle.net *** --------------------------------------------------------------------------- From nobody Thu Jul 20 18:38:03 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6LzQ1b1Cz4p1NC; Thu, 20 Jul 2023 18:38:10 +0000 (UTC) (envelope-from garyj@gmx.de) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6LzP5Cwgz3vS2; Thu, 20 Jul 2023 18:38:09 +0000 (UTC) (envelope-from garyj@gmx.de) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1689878284; x=1690483084; i=garyj@gmx.de; bh=FZeElCvFs0bGg9K8gbIoOxxtK4fSUNX+tq59CqCpPus=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References:Reply- To; b=bBILZsew9+IDZeHKiU+WmR7IIZrH7AwosvZwGq3Zx267OLtwMPpYIemU6ZrIfKIZCtZytuZ nWCDc2DIqbUk5FZ2ZEDCqgwbRx8/AoxS5xUfncl6lFcH/13N+hA7y9A0yKdkCHga8ex1vBH9Z lHDssah7fWDamfN1YX40/pWkJG2hoTNpAYuu7EwpUwzLW9tQRfCvhyrl92uytOChT5a7D84xJ /tB5s14wtG+ZtAa+081XpvDNkFcx26la8kvAvwo0MhN5ihCgOxrcbejk5yo0dbQmFr+K1RQaX e/KRBKVlRhJjbFPW0hqtzJaik69LHglzO0VHYpmTPScRG7sf6VeA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ernst.home ([91.2.50.110]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUj2-1q5ZgU0FMo-00rcIx; Thu, 20 Jul 2023 20:38:04 +0200 Date: Thu, 20 Jul 2023 20:38:03 +0200 From: Gary Jennejohn To: Konstantin Belousov Cc: Cy Schubert , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: <20230720203803.5af13f1d@ernst.home> In-Reply-To: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> Reply-To: garyj@gmx.de X-Mailer: Claws Mail 3.19.0 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SUaDsaYvdHbEoKhSwzkl/zPbG9sDsJ0y3dw2KCmgj4AsYH6A/0/ 7OmEigb3dtA+V/l7nK6r8lJfa4vohKhL6CnxeOUz05t7dN0+S/1VrephA61Z94gcgV03yJS kJeUzOXMCJeUBCwQCTZuV0Gb7LVi8IjCqwlBtGYY6eKaF0RGVDHsT6zLmSha+dKbpy7Ybbu TFYEH1Cw/E4JcgGdZoj7w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:E98sdG7LiG0=;2vDE57DyQ3HUMrTKJLvQc+BptzL 4jgxS6vZJFRStKzmPvPD3d6sx9LlXcyIiDBC5vQ/rTTDZGaoEuIB/W44Co4Fv1Auis+OZ7A/b MKDCqRjfvrV9c4yjct0Ta1yHp7Ko8SpKOC/o5KtKXuWPR4JzDJOAOOl2NZn/COwDmgp/mRc3t YaVpsl/fJwS0N3eyU6fL9fdJ6pAgJpe/pwLHouPVNAyjDdmT2JEFpRJjOhL7ngyAGpVItGUed Osuxv26SkakKbEFAz7aeQwY1mjYXv4ClVqhIXnxBNy6eWUK2FZp/MaKtIip/UoNRbe/zDts+y 6DREms6Opv8ApMGWcaiePmsSov1OMdxIG/KMbDG+3fhE1ae+CfoxPzu/v9FuZ99INcvAdNgBd p53HY0iIeX0NGGBaa2JNvbmeo+slOAKbGWWgo+4diGhugs/jC3jV8NImqqBbqM+rYYsFXWxGa niDfb+vCpIG1Hzk87R3vkpa08eRnhFzmHukBwSJfDmnQ8zilKNPQVZqhrhKE8k9Ze1Tuj9Iho TsI1CxvRVkpj7y62P8HzCRXM8rDXxKpc20zuVaakZhixHRcVBeNivTlgOuXbVqYlvKgxhMOr7 qIJkT5HwT23zx85iIjYhL3stUKVAQPzwX5UcLcH/Gc7ZzkQvg8w7SXzjfhJ2YK2lTiPahdC4L 4ORqveR0zT42lcXCkjiCjwpgTtluyNhrs+uP8Yu56vYc2DSfSa2wZSbFDhYFq4lVZgu2wC7/o dkV8pcBrTsS95Nr+UEvJMDGkPe42h/KIaw3P3pL4MvAPK1hFqT515OEfS7TvXpIDZv4NqlcN3 kcZJtPbBSBNczopuskAgr99SHuUq/PmiGM46Zh9d7SnR5gzAkZk09zwOmN/IQfPp8TCb+gF0a N4myr7W8KjLukzpdKc8LUYGm6ovbXcHtUjW9ngIENs4JiJMUf6C6g5pwU471RRlGqCuA+kS3V mbvxwzxQAHlyr4EA6N707md5Bc0= X-Rspamd-Queue-Id: 4R6LzP5Cwgz3vS2 X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023 20:34:35 +0300 Konstantin Belousov wrote: > On Thu, Jul 20, 2023 at 10:06:24AM -0700, Cy Schubert wrote: > > In message <20230720164145.0CF1311F@slippy.cwsent.com>, Cy Schubert wr= ites: > > > In message <20230720163231.B1D4277@slippy.cwsent.com>, Cy Schubert w= rites: > > > > In message <202307201412.36KECDSU084918@gitrepo.freebsd.org>, Kons= tantin > > > > Belous > > > > ov writes: > > > > > The branch main has been updated by kib: > > > > > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D21e45c30c35c9aa73= 2073f725924 > > > ca > > > > f5 > > > > > 81c93460 > > > > > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > > > Author: Konstantin Belousov > > > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > > > Commit: Konstantin Belousov > > > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > > > > > If mprotect(2) changed protection in the bottom of the curre= ntly grow > > > n > > > > > stack region, currently the changed protection would be used= for the > > > > > stack grow on next fault. This is arguably unexpected. > > > > > > > > > > Store the original protection for the entry at mmap(2) time = in the > > > > > offset member of the gap vm_map_entry, and use it for protec= tion of t > > > he > > > > > grown stack region. > > > > > > > > > > PR: 272585 > > > > > Reported by: John F. Carr > > > > > Reviewed by: alc, markj > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 1 week > > > > > Differential revision: https://reviews.freebsd.org/D41089 > > > > > --- > > > > > sys/vm/vm_map.c | 24 ++++++++++++++++-------- > > > > > sys/vm/vm_map.h | 4 ++++ > > > > > 2 files changed, 20 insertions(+), 8 deletions(-) > > > > > > > > > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > > > > > index a02107b5e64d..997a49111a59 100644 > > > > > --- a/sys/vm/vm_map.c > > > > > +++ b/sys/vm/vm_map.c > > > > > @@ -4493,7 +4493,7 @@ static int > > > > > vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_= t max_ssi > > > ze > > > > , > > > > > vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) > > > > > { > > > > > - vm_map_entry_t new_entry, prev_entry; > > > > > + vm_map_entry_t gap_entry, new_entry, prev_entry; > > > > > vm_offset_t bot, gap_bot, gap_top, top; > > > > > vm_size_t init_ssize, sgp; > > > > > int orient, rv; > > > > > @@ -4575,11 +4575,14 @@ vm_map_stack_locked(vm_map_t map, vm_off= set_t add > > > rb > > > > os > > > > > , vm_size_t max_ssize, > > > > > * read-ahead logic is never used for it. Re-use > > > > > * next_read of the gap entry to store > > > > > * stack_guard_page for vm_map_growstack(). > > > > > + * Similarly, since a gap cannot have a backing object, > > > > > + * store the original stack protections in the > > > > > + * object offset. > > > > > */ > > > > > - if (orient =3D=3D MAP_STACK_GROWS_DOWN) > > > > > - vm_map_entry_pred(new_entry)->next_read =3D sgp; > > > > > - else > > > > > - vm_map_entry_succ(new_entry)->next_read =3D sgp; > > > > > + gap_entry =3D orient =3D=3D MAP_STACK_GROWS_DOWN ? > > > > > + vm_map_entry_pred(new_entry) : vm_map_entry_succ(new_entr= y) > > > > > ; > > > > > + gap_entry->next_read =3D sgp; > > > > > + gap_entry->offset =3D prot; > > > > > } else { > > > > > (void)vm_map_delete(map, bot, top); > > > > > } > > > > > @@ -4599,6 +4602,7 @@ vm_map_growstack(vm_map_t map, vm_offset_t= addr, vm > > > _m > > > > ap > > > > > _entry_t gap_entry) > > > > > struct ucred *cred; > > > > > vm_offset_t gap_end, gap_start, grow_start; > > > > > vm_size_t grow_amount, guard, max_grow; > > > > > + vm_prot_t prot; > > > > > rlim_t lmemlim, stacklim, vmemlim; > > > > > int rv, rv1 __diagused; > > > > > bool gap_deleted, grow_down, is_procstack; > > > > > @@ -4739,6 +4743,12 @@ retry: > > > > > } > > > > > > > > > > if (grow_down) { > > > > > + /* > > > > > + * The gap_entry "offset" field is overloaded. See > > > > > + * vm_map_stack_locked(). > > > > > + */ > > > > > + prot =3D gap_entry->offset; > > > > > + > > > > > grow_start =3D gap_entry->end - grow_amount; > > > > > if (gap_entry->start + grow_amount =3D=3D gap_entry->end) { > > > > > gap_start =3D gap_entry->start; > > > > > @@ -4751,9 +4761,7 @@ retry: > > > > > gap_deleted =3D false; > > > > > } > > > > > rv =3D vm_map_insert(map, NULL, 0, grow_start, > > > > > - grow_start + grow_amount, > > > > > - stack_entry->protection, stack_entry->max_protection, > > > > > - MAP_STACK_GROWS_DOWN); > > > > > + grow_start + grow_amount, prot, prot, MAP_STACK_GROWS_DOW= N) > > > > > ; > > > > > if (rv !=3D KERN_SUCCESS) { > > > > > if (gap_deleted) { > > > > > rv1 =3D vm_map_insert(map, NULL, 0, gap_start, > > > > > diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h > > > > > index fd8b606e8ddc..c4ed36ce57ba 100644 > > > > > --- a/sys/vm/vm_map.h > > > > > +++ b/sys/vm/vm_map.h > > > > > @@ -97,6 +97,10 @@ union vm_map_object { > > > > > * a VM object (or sharing map) and offset into that object, > > > > > * and user-exported inheritance and protection information. > > > > > * Also included is control information for virtual copy operat= ion > > > s. > > > > > + * > > > > > + * For stack gap map entries (MAP_ENTRY_GUARD | MAP_ENTRY_GROWS= _DO > > > WN > > > > > + * or UP), the next_read member is reused as the stack_guard_pa= ge > > > > > + * storage, and offset is the stack protection. > > > > > */ > > > > > struct vm_map_entry { > > > > > struct vm_map_entry *left; /* left child or previous entry */ > > > > > > > > > > > > > This commit has caused screen (sysutils/screen) to display the fol= lowing > > > > error when opening a new screen window (ctrl-A c): > > > > > > > > pid 28473 comm screen-4.9.0 has trashed its stack, killing > > > > > > > > > > > > -- > > > > Cheers, > > > > Cy Schubert > > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > > NTP: Web: https://nwtime.org > > > > > > > > e^(i*pi)+1=3D0 > > > > > > > > > > > > > > I'm also seeing artifacts in emails by nmh (mail/nmh) in my sent dir= ectory > > > and in the email cc'd to me. > > > > > > > > > -- > > > Cheers, > > > Cy Schubert > > > FreeBSD UNIX: Web: https://FreeBSD.org > > > NTP: Web: https://nwtime.org > > > > > > e^(i*pi)+1=3D0 > > > > > > > > > > Sometimes this occurs at screen start. Then it hangs. > > > > slippy$ screen > > pid 7275 comm screen-4.9.0 has trashed its stack, killing > > Can you check this? > > diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c > index 8c864c943f5d..4c5f1c08954d 100644 > --- a/sys/vm/vm_map.c > +++ b/sys/vm/vm_map.c > @@ -4202,7 +4202,8 @@ vm_map_copy_entry( > src_entry->start); > } else { > dst_entry->object.vm_object =3D NULL; > - dst_entry->offset =3D 0; > + if ((dst_entry->eflags & MAP_ENTRY_GUARD) =3D=3D 0) > + dst_entry->offset =3D 0; > if (src_entry->cred !=3D NULL) { > dst_entry->cred =3D curthread->td_ucred; > crhold(dst_entry->cred); > > Works for me. I tested with both pkg and screen and saw no errors. =2D- Gary Jennejohn From nobody Thu Jul 20 19:01:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MVX3qlRz4nJHk; Thu, 20 Jul 2023 19:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.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 4R6MVX1wVCz44J0; Thu, 20 Jul 2023 19:01:40 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id MSWeqYx196NwhMYuBqS59Q; Thu, 20 Jul 2023 19:01:39 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPA id MYu9qvqCb3fOSMYuAqANyW; Thu, 20 Jul 2023 19:01:39 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=64b98493 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=kj9zAlcOel0A:10 a=ws7JD89P4LkA:10 a=4-q2EoJHAAAA:8 a=6I5d2MoRAAAA:8 a=DWP2sRc5AAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=F9ei1Uno-P_GoJFZxeQA:9 a=CjuIK1q_8ugA:10 a=fpfIJvRr2csibeS0vtzw:22 a=IjZwj45LgO3ly-622nXo:22 a=Tv02OOKAekTIK8191DnM:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id A4422DF; Thu, 20 Jul 2023 12:01:37 -0700 (PDT) Received: by slippy.cwsent.com (Postfix, from userid 1000) id A0421191; Thu, 20 Jul 2023 12:01:37 -0700 (PDT) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.8+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Dmitry Morozovsky cc: Cy Schubert , Konstantin Belousov , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection In-reply-to: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> <20230720163231.B1D4277@slippy.cwsent.com> <20230720164145.0CF1311F@slippy.cwsent.com> <20230720170624.B8F28DB@slippy.cwsent.com> <20230720180230.18BDF11F@slippy.cwsent.com> <20230720180926.29987BC@slippy.cwsent.com> Comments: In-reply-to Dmitry Morozovsky message dated "Thu, 20 Jul 2023 21:35:39 +0300." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Jul 2023 12:01:37 -0700 Message-Id: <20230720190137.A0421191@slippy.cwsent.com> X-CMAE-Envelope: MS4xfEgtEggqXfFMkEZ99KxW2dQFr8c/ba+X2g7XMhgy1xK+EuFBdt2P3eYLOTqpzQG+CxbfeEs9V965dy/QK63q2ZTS0h3zjOpo68TXes83CVsfxpnCKCM2 IvKeHExsxAJC3yqJ7vGnmd6VVDdunPTFX5e40v8nrc/b8fGLo+EXsN21uqfQRdQYpa9ZlCjE4H/On0Jd+uprdqYTnQLBNxAOUjd1ROPwp2lQtkvB9s+KrY/2 qhlfi0g+0/fmrdmAW3I9qG5OHyKjoj7X5bx9QnWkdjYbWDqWI4SFUpm8giNQTvGt/5sTJkupQC0FJT/ygkinjkomEocb0skR8gXSn/qtTKbE2rnpmgXu1y8v B/vK9Sq6 X-Rspamd-Queue-Id: 4R6MVX1wVCz44J0 X-Spamd-Bar: ---- 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-Pre-Result: action=no action; module=replies; Message is reply to one we originated In message , Dmitry Morozo vsky writes: > On Thu, 20 Jul 2023, Cy Schubert wrote: > > > This email appears truncated. My original reply was, > > > > Yes, this fixes the screen and pkg regressions. > > > > Thanks for the patch. > > FWIW, copy to the list was complete; maybe it's you local dellivery agent > trouble Not local delivery agent. The copy delivered to my laptop never went beyond the postfix on my laptop. The cc delivered to me on one of my servers downstairs shows the cc email hitting cloudflare (I have to use my ISP as a smarthost because they block port 25 egress), mx1.freebsd.org, and finally my mail gateway. Both copies which traversed separate paths had the same problem. The copy stored by nmh on local disk does have the full email. I think the first place to look would be the postfix on my laptop. A zpool scrub should be the first order of business. > > > -- > Sincerely, > D.Marck [MCK-RIPE] > [ FreeBSD committer: marck@FreeBSD.org ] > --------------------------------------------------------------------------- > *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- woozle@woozle.net *** > --------------------------------------------------------------------------- -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0 From nobody Thu Jul 20 19:04:25 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MYj61XYz4nLR9; Thu, 20 Jul 2023 19:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6MYj5c28z45JL; Thu, 20 Jul 2023 19:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689879865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1IZ0/RiS+fJ6Jrr1WiP9B4l2mVnhN0q2iXZ5ndwC8=; b=F4rWiiO+RivHLeBnnwmbrbYbQvn3uAZ3lMrKDEGXX6jpAp11OhoJkYjdnBK6ElPPwpFTiK 57cMo8cg/TYXeYUDe8QwiDmVroQg9BLptr14NDQAT3ep1E6hv6CoNlPZNBz0Jcq0Sza5Bi Vqwt5sAo1bP7UMVPZyb5nuhSIIXYXeGYum1dqCpbT5CFgIxh5GwaUqS5RmBNOIydMKQ7e6 qazjXH90VJAuVOTi60R994SyWQgdMmCDwjaBMeVruQajxXXm4nR2L9c3u93pBAv/3umj+T sW8nHQ6v0e+Tjv+1FXEIRnp4IE6GzXLda+FQCbO40usErDA2T5HkZyKlaA2krA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689879865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zo1IZ0/RiS+fJ6Jrr1WiP9B4l2mVnhN0q2iXZ5ndwC8=; b=niCYn3z+nSNQF7WozQRm5WeBW5ce6YN+6P24qVjqf/0Pljc/HImNFUcmSWobxTuyVzbKi+ hNwzo7AL/ckAmDcPEEyJ3GURZGEBW7rxztFMA9mH7VDoluzzuQcO9zrgmNfcAyQjFnDZOp jY3/5fEcUW0Pk1YigOLMbBi5+UdWFsBvhe2989eoylyaVckYpABKG88IC6gk8TIeaaPzMG vVZJSYKiEVVDehAltvKf3PN81WzZ6KkhRW7oblS51qgoAeURSwpEUKCUaZYh8o5iP0kyhi 78vUj5ID7B2LwSjO15gxIHsSVPC5TRyHKH/FQzhVSp7VF3hnNvitPL91INM9Kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689879865; a=rsa-sha256; cv=none; b=MvEaX1vNXQcBg05fBo1ZzIJ22bgQP28x6baGT+NyhLGZmqLsCpC8Vthw7EvsUJuk3HgLU0 e756G6itWEtnLbbLq3J97P6KnBSOA9NyX/j057hQMgJxN6pK9VVnjOxogmyeKz6D/Ch/rm qmkbSIYkKXH3x+bcW2fFNiM472JoYe9Zzxv1JH5NFs6lUH+W1a3vbIBOWiHYjyHTUn2sgq 6nWV5sAPztj6CrF3u3avp8c/FiKK67Hd700x8KjTATBJAm7jRGUZxtGeXcfT+CSmlDECnP mW2XPhn4St4tS2XFxhklLrUxmw5LiUpppKTBbLZDY3bzfcXJpibdPwVyMgzz5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6MYj4h1szjPd; Thu, 20 Jul 2023 19:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KJ4Plc070512; Thu, 20 Jul 2023 19:04:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KJ4PoX070511; Thu, 20 Jul 2023 19:04:25 GMT (envelope-from git) Date: Thu, 20 Jul 2023 19:04:25 GMT Message-Id: <202307201904.36KJ4PoX070511@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: db6c7c7f8d87 - main - vmspace_fork(): do not override offset for the guard entries List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 commit db6c7c7f8d870f377fcd1cc98e4832681bb5bdf0 Author: Konstantin Belousov AuthorDate: 2023-07-20 17:45:01 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-20 19:04:03 +0000 vmspace_fork(): do not override offset for the guard entries The offset field contains protection for the stack guards. Reported by: cy Fixes: 21e45c30c35c9aa732073f725924caf581c93460 MFC after: 1 week --- sys/vm/vm_map.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 997a49111a59..444e09986d4e 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -4181,7 +4181,8 @@ vm_map_copy_entry( src_entry->start); } else { dst_entry->object.vm_object = NULL; - dst_entry->offset = 0; + if ((dst_entry->eflags & MAP_ENTRY_GUARD) == 0) + dst_entry->offset = 0; if (src_entry->cred != NULL) { dst_entry->cred = curthread->td_ucred; crhold(dst_entry->cred); From nobody Thu Jul 20 19:16:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6MqN4d1gz4nTXT; Thu, 20 Jul 2023 19:16: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6MqN3mg2z489B; Thu, 20 Jul 2023 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689880576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RF4+8X2E2hQkE90H+3segIRULTwyHbG3UmmNNEOKOn8=; b=nwrevky6458LIFK5y78IqasdTJNBW1kchsZkbAdYhr1roA7xXZFV+fAP71FMg3wTGMQFQn X+PatNUp+E2YUbS6DpMiOCpkmt8lWgcwulfoZy3ZlnV2+HRFKcdr8x9o18G5KtvoMD1LGe Q5fq5MUuVudAmUEyObor1x3OwUCNkTe1/JmAxnrqjzFYJURwVj8lWf20SWPaaS42+Lypow PmnBjKOydNWfAXEa/ZHKCOg6QzarN+3HWFkHI/dpfpvIPv/L5JMUZd6R1DLbsoee/ac/wE lGBR/RwOLkyswk3hGlEg+AUxjA9FO5FGiVpPqFTdMhxeaJxeLy0lpPolvw5ZGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689880576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RF4+8X2E2hQkE90H+3segIRULTwyHbG3UmmNNEOKOn8=; b=wf3bIkkIZYPtVQ66VKbi7MQ6pkif2TZiae30pbB5LZe3jd0l2zvQ9/sEuX42IABkfK/wyz 9U+TgWLL5T0Mm7IcV1CHOPAH9/5LMy08oYZgGDH591hky55sGW9bDfZcCLzXY1RFeNsjWP upwmEmqkVBHJvQ+FVZB2OgAE1x+7WgcTPD9JpCRrb31w7sUomLBXl/hu8WtuGCOiX4HvgQ a/ZHwoKcZssDsjG9BB/iG4HFy9k66C6dL8TrgtLK3ATBtGFqEpFMHDXivzw8GEJ52kwGIT LQPR1WrpKaDsxdNXot072MDTfI20A/Vw6zdVXzJIMnMXZ/ymm+NeCvoLb7LdCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689880576; a=rsa-sha256; cv=none; b=p1EVV+9wjjwRHA5KtmZI8E3Wsz3QhHLuryh5QZS+nSyx9Da3tc/PHwDcCTWNd9qN8N+sdQ g2Kz8Ed6xfo8Bq3azcXysVbR0Pvz16/KunOGHkS/hZUX81dt5fMo2CH03GprVBLWUQ37Bl pQcn01yTu+ftBrUdwE4m/3uQS1XtK2wevIOxXVqu6xrdo9JwmsJRYNGRcaL0clHJ0zfW4Y ylrv7fQj0fO18DkIO6fnNaAP3ZwBWBrzZC9kVdLrOXbuHOc9qZ8C3sgQRiBQJHTu++a3h4 O4m8CpjSEuUO3QVnniHjYCD7ejFx/7u46oVVHuMPhAZJPFh8urHsW3dTwprzpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6MqN2jLyzj9J; Thu, 20 Jul 2023 19:16:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KJGG7Y087159; Thu, 20 Jul 2023 19:16:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KJGGWE087158; Thu, 20 Jul 2023 19:16:16 GMT (envelope-from git) Date: Thu, 20 Jul 2023 19:16:16 GMT Message-Id: <202307201916.36KJGGWE087158@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: 1c42ed54bfe2 - main - libcrypto: add missing symbols to the FIPS provider List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c42ed54bfe2d3255ab4df4245de4b97c1064e40 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1c42ed54bfe2d3255ab4df4245de4b97c1064e40 commit 1c42ed54bfe2d3255ab4df4245de4b97c1064e40 Author: Pierre Pronchery AuthorDate: 2023-07-20 18:16:14 +0000 Commit: Ed Maste CommitDate: 2023-07-20 19:05:12 +0000 libcrypto: add missing symbols to the FIPS provider The fips.so provider module exposing FIPS-validated algorithms was still missing a number of symbols. PR: 272454 Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41018 --- secure/lib/libcrypto/modules/fips/Makefile | 73 ++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/secure/lib/libcrypto/modules/fips/Makefile b/secure/lib/libcrypto/modules/fips/Makefile index c8b79e3badfd..d41e3bcfe294 100644 --- a/secure/lib/libcrypto/modules/fips/Makefile +++ b/secure/lib/libcrypto/modules/fips/Makefile @@ -32,6 +32,28 @@ SRCS+= ppccpuid.S ppccap.c SRCS+= mem_clr.c .endif +# crypto/aes +SRCS+= aes_cbc.c aes_cfb.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c +.if defined(ASM_aarch64) +SRCS+= aes_core.c aesv8-armx.S vpaes-armv8.S +ACFLAGS.aesv8-armx.S= -march=armv8-a+crypto +.elif defined(ASM_amd64) +SRCS+= aes_core.c aesni-mb-x86_64.S aesni-sha1-x86_64.S aesni-sha256-x86_64.S +SRCS+= aesni-x86_64.S vpaes-x86_64.S +.elif defined(ASM_arm) +SRCS+= aes-armv4.S aesv8-armx.S bsaes-armv7.S +.elif defined(ASM_i386) +SRCS+= aes_core.c aesni-x86.S vpaes-x86.S +.elif defined(ASM_powerpc) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.elif defined(ASM_powerpc64) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.elif defined(ASM_powerpc64le) +SRCS+= aes_core.c aes-ppc.S vpaes-ppc.S aesp8-ppc.S +.else +SRCS+= aes_core.c +.endif + # crypto/bn SRCS+= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c \ bn_mod.c bn_conv.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ @@ -57,6 +79,20 @@ SRCS+= bn_ppc.c bn-ppc.S ppc-mont.S SRCS+= bn_asm.c .endif +# crypto/buffer +SRCS+= buffer.c + +# crypto/cmac +SRCS+= cmac.c + +# crypto/des +SRCS+= set_key.c ecb3_enc.c +.if defined(ASM_i386) +SRCS+= crypt586.S des-586.S +.else +SRCS+= des_enc.c fcrypt_b.c +.endif + # crypto/dh SRCS+= dh_lib.c dh_key.c dh_group_params.c dh_check.c dh_backend.c dh_gen.c \ dh_kdf.c @@ -109,12 +145,38 @@ SRCS+= ffc_params.c ffc_params_generate.c ffc_key_generate.c \ ffc_params_validate.c ffc_key_validate.c ffc_backend.c \ ffc_dh.c +# crypto/hmac +SRCS+= hmac.c + # crypto/lhash SRCS+= lhash.c +# crypto/modes +SRCS+= cbc128.c ctr128.c cfb128.c ofb128.c gcm128.c ccm128.c xts128.c +SRCS+= wrap128.c +.if defined(ASM_aarch64) +SRCS+= ghashv8-armx.S aes-gcm-armv8_64.S +ACFLAGS.ghashv8-armx.S= -march=armv8-a+crypto +.elif defined(ASM_amd64) +SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S +.elif defined(ASM_arm) +SRCS+= ghash-armv4.S ghashv8-armx.S +.elif defined(ASM_i386) +SRCS+= ghash-x86.S +.elif defined(ASM_powerpc) +SRCS+= ghashp8-ppc.S +.elif defined(ASM_powerpc64) +SRCS+= ghashp8-ppc.S +.elif defined(ASM_powerpc64le) +SRCS+= ghashp8-ppc.S +.endif + # crypto/property SRCS+= property_string.c property_parse.c property_query.c property.c defn_cache.c +# crypto/rand +SRCS+= rand_lib.c + # crypto/rsa SRCS+= rsa_ossl.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_pk1.c \ rsa_none.c rsa_oaep.c rsa_chk.c rsa_pss.c rsa_x931.c rsa_crpt.c \ @@ -143,6 +205,9 @@ SRCS+= keccak1600-ppc64.S sha_ppc.c sha1-ppc.S sha256-ppc.S sha512-ppc.S sha256p SRCS+= keccak1600.c .endif +# crypto/stack +SRCS+= stack.c + # common SRCS+= capabilities.c bio_prov.c digest_to_nid.c \ securitycheck.c provider_seeding.c @@ -243,17 +308,25 @@ SRCS+= record/tls_pad.c s3_cbc.c .endif .PATH: ${LCRYPTO_SRC}/crypto \ + ${LCRYPTO_SRC}/crypto/aes \ ${LCRYPTO_SRC}/crypto/bio \ ${LCRYPTO_SRC}/crypto/bn \ + ${LCRYPTO_SRC}/crypto/buffer \ + ${LCRYPTO_SRC}/crypto/cmac \ + ${LCRYPTO_SRC}/crypto/des \ ${LCRYPTO_SRC}/crypto/dh \ ${LCRYPTO_SRC}/crypto/dsa \ ${LCRYPTO_SRC}/crypto/ec \ ${LCRYPTO_SRC}/crypto/evp \ ${LCRYPTO_SRC}/crypto/ffc \ + ${LCRYPTO_SRC}/crypto/hmac \ ${LCRYPTO_SRC}/crypto/lhash \ + ${LCRYPTO_SRC}/crypto/modes \ ${LCRYPTO_SRC}/crypto/property \ + ${LCRYPTO_SRC}/crypto/rand \ ${LCRYPTO_SRC}/crypto/rsa \ ${LCRYPTO_SRC}/crypto/sha \ + ${LCRYPTO_SRC}/crypto/stack \ ${LCRYPTO_SRC}/providers/fips \ ${LCRYPTO_SRC}/providers/common/der \ ${LCRYPTO_SRC}/providers/implementations/asymciphers \ From nobody Thu Jul 20 20:15:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6P7Z0nD6z4p5Nc; Thu, 20 Jul 2023 20:15:22 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_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 4R6P7Y4n5Jz3GpJ; Thu, 20 Jul 2023 20:15:21 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 55EC13C0199; Thu, 20 Jul 2023 20:15:15 +0000 (UTC) Date: Thu, 20 Jul 2023 20:15:15 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202307201412.36KECDSU084918@gitrepo.freebsd.org> X-Rspamd-Queue-Id: 4R6P7Y4n5Jz3GpJ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > commit 21e45c30c35c9aa732073f725924caf581c93460 > Author: Konstantin Belousov > AuthorDate: 2023-07-19 11:05:32 +0000 > Commit: Konstantin Belousov > CommitDate: 2023-07-20 14:11:42 +0000 > > mmap(MAP_STACK): on stack grow, use original protection > > If mprotect(2) changed protection in the bottom of the currently grown > stack region, currently the changed protection would be used for the > stack grow on next fault. This is arguably unexpected. > > Store the original protection for the entry at mmap(2) time in the > offset member of the gap vm_map_entry, and use it for protection of the > grown stack region. It occured to me to wonder how this interacts with __enable_execute_stack(). I think it's ok so long as the compiler always emits __enable_execute_stack() for each trampoline and doesn't depend on extentions to the stack being executable from the first trampoline creation, but I don't know where to look to verify that's the case. -- Brooks From nobody Thu Jul 20 20:23:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6PK75nYTz4p9nZ; Thu, 20 Jul 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6PK75KvNz3K0j; Thu, 20 Jul 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gxQ8pOqqlhpI5mh9BvnzrTpZ6oQhMvFzlRFWeO9s+w=; b=MOBhpDab/svSArOgureNyF9TaLg54gGrz9P5i10SnXH+tMFHY2Ccv/IpQb0X8rAvKiV8+m PC5Kus5pxTYQ4TvqWGx/gVUWcvPTCMbf6uamWlsCnQ+4AKEfyP3pzTCPn10iMgaThyetOY h8ahbLQKYqrdQQ62e+mnQc6qUd8q4++jaKhvhvVYSAQazZavAM/op1e5Uo7cGhyUjsr3ZU 1FWFACoHx2nh9mjulwwG31NmJdDZEwnURVwvKVBTDaKdyn/I5Hf44QMIroXTsMO4u5ZCvj MDkjD8E5ctG1+qUdcMDK55IJFrUcz4HY1aclswYX0LiaWh0tE7na5ggPIOESPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+gxQ8pOqqlhpI5mh9BvnzrTpZ6oQhMvFzlRFWeO9s+w=; b=om6egItIsU2HWadqm/5R7uCWHRPmRg5KMUE45pg39CxB4g6N/mX4FShcwIrhcoSkPk3P/j wgwFFuwY0qtD5SrYNA5Ne1D9u96J2rzs9tRiA1N8zUZwOC7eUVJ17o0RHuJIRHtwg2CE+l thDkIHuAxg1kH/7hWSXPdxZES+5yX9MU1G51jTaquWAIGQUM5zMybzUt48fFQRTSYfkFiE 8Syp9bxucAGVxPN3LJa2XbwCrYdflihnM/cbjLfACfZ/PowX/AqyuHncWeeA3IXM0dIiHM iTKaqxK1D+MYQhBn5Buuw/eC1KZJCNr69mwXeEWzDYlhU6JtvrGKTk5y9NQyWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689884619; a=rsa-sha256; cv=none; b=JfdZSF7ZYcYQRTNplV3YcWZRkBoLOGB0u71g4vfvV36PZrsd+jxmWmlkCGhHvwiE59pFXJ Vbdu/3ekxjUQU3YlggdicyMeR5rFQZlxY+fErYXrvQteXzHazyxWjH0RxHJRAEcBUq8yUR hgLyJyE4m2UI+bvxHpLgm+jO6dnzt6zpY839/G+KDU+KDG6qPR1YP6o+1wcXWUaFQ4g6pY LmOLt26lbep5ARlYRIe8WlFCWuNwVHgT8M0NeMOnjUQgETL08IzgkQuL69gcqngtANNrb7 f5MQMJqp0ptnCJlvOUjWNWnXecDez2NqZMozaj+RkxGRyeUZeX0MhSH2kHmYVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6PK74PMyzl32; Thu, 20 Jul 2023 20:23:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KKNdSf002722; Thu, 20 Jul 2023 20:23:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKNdNp002721; Thu, 20 Jul 2023 20:23:39 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:23:39 GMT Message-Id: <202307202023.36KKNdNp002721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 273a307d0b80 - main - tftpd: introduce new option -S List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 273a307d0b80743fb08e23237b3f74dc94a8fa2a Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=273a307d0b80743fb08e23237b3f74dc94a8fa2a commit 273a307d0b80743fb08e23237b3f74dc94a8fa2a Author: Eugene Grosbein AuthorDate: 2023-07-20 20:11:33 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-20 20:23:35 +0000 tftpd: introduce new option -S Historically, tftpd disallowed write requests to existing files that are not publicly writable. Such requirement is questionable at least. Let us make it possible to run tftpd in chrooted environment keeping files non-world writable. New option -S enables write requests to existing files for chrooted run according to generic file permissions. It is ignored unless tftpd runs chrooted. MFC after: 1 month Requested by: marck Differential: https://reviews.freebsd.org/D41090 (based on) --- libexec/tftpd/tftpd.8 | 22 ++++++++++++++++++---- libexec/tftpd/tftpd.c | 14 +++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/libexec/tftpd/tftpd.8 b/libexec/tftpd/tftpd.8 index e4f5ab94a2fe..a984cdc32c94 100644 --- a/libexec/tftpd/tftpd.8 +++ b/libexec/tftpd/tftpd.8 @@ -28,7 +28,7 @@ .\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 2, 2020 +.Dd July 20, 2023 .Dt TFTPD 8 .Os .Sh NAME @@ -72,7 +72,11 @@ Files containing the string or starting with .Dq Li "../" are not allowed. -Files may be written only if they already exist and are publicly writable. +Files may be written only if they already exist (unless the +.Fl w +option is used) and are publicly writable (unless chrooted and the +.Fl S +option is used). Note that this extends the concept of .Dq public to include @@ -191,6 +195,12 @@ to change its root directory to After doing that but before accepting commands, .Nm will switch credentials to an unprivileged user. +.It Fl S +If +.Nm +runs chrooted, the option allows write requests according to generic +file permissions, skipping requirement for files to be publicly writable. +The option is ignored for non-chrooted run. .It Fl u Ar user Switch credentials to .Ar user @@ -275,12 +285,16 @@ the .Fl c option was introduced in .Fx 4.3 , -and the +the .Fl F and .Fl W options were introduced in -.Fx 7.4 . +.Fx 7.4 , +and the +.Fl S +option was introduced in +.Fx 13.3 . .Pp Support for Timeout Interval and Transfer Size Options (RFC2349) was introduced in diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index b25e8b0c762f..9ae7575f3d23 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -100,6 +100,7 @@ static struct dirlist { static int suppress_naks; static int logging; static int ipchroot; +static int check_woth = 1; static int create_new = 0; static const char *newfile_format = "%Y%m%d"; static int increase_name = 0; @@ -141,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:u:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:sS:u:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; @@ -181,6 +182,9 @@ main(int argc, char *argv[]) case 's': chroot_dir = optarg; break; + case 'S': + check_woth = -1; + break; case 'u': chuser = optarg; break; @@ -361,7 +365,11 @@ main(int argc, char *argv[]) tftp_log(LOG_ERR, "setuid failed"); exit(1); } + if (check_woth == -1) + check_woth = 0; } + if (check_woth == -1) + check_woth = 1; len = sizeof(me_sock); if (getsockname(0, (struct sockaddr *)&me_sock, &len) == 0) { @@ -704,7 +712,7 @@ validate_access(int peer, char **filep, int mode) if ((stbuf.st_mode & S_IROTH) == 0) return (EACCESS); } else { - if ((stbuf.st_mode & S_IWOTH) == 0) + if (check_woth && ((stbuf.st_mode & S_IWOTH) == 0)) return (EACCESS); } } else { @@ -734,7 +742,7 @@ validate_access(int peer, char **filep, int mode) if ((stbuf.st_mode & S_IROTH) != 0) break; } else { - if ((stbuf.st_mode & S_IWOTH) != 0) + if (!check_woth || ((stbuf.st_mode & S_IWOTH) != 0)) break; } err = EACCESS; From nobody Thu Jul 20 20:28:27 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6PQg5MvLz4pCv9; Thu, 20 Jul 2023 20:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6PQg4vn5z3LXM; Thu, 20 Jul 2023 20:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPkiumZVMnCLFyhK1k8G1KOI8jy58KfrlFv7YrkKUzk=; b=yE3WC9T+v74PokR+LKw1Hb7xT7ufWB8diJA52u0fJ0KQpRB09EVAMyrq2Bhw77Uu0Ilgg0 l1NSpVJB6tAprFI/841BYJgQ60tIGsaZNeyppxECyg0hS0fx203ZMi7dbfxQtPp0k3AXgO S7Wq9rr6cMdMhM+4F/OAXBH0y5LOZEAM2fQ1Tikluud31dMCBqQFBK24+dW594ulv0WH9+ xDQ5EjiKmxXjr8me1beL2lUcCdZLlM9amQmmdOtdPo/U6BYC0i9VsZWCf6pPwKhep/Hkl0 au5rxU4wSR90eKJePwHuIn80ulCVNBxo6i+5eaAHb9SJvsuEENittL69htMP5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689884907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wPkiumZVMnCLFyhK1k8G1KOI8jy58KfrlFv7YrkKUzk=; b=VACupiksdTxQrxqYR3Ry9BalCMeVyuMk/3Su8JLOGO2BOy4mP/7S05F9AMuP/3dsm484Mv Ercz6iBATdK0K3P0v8YKCCCgGfQDwTIgoGjwhar0yGp3Yj5mYiTaoKJmTml9jk/XAXRoiz TW5uP+tRqO1STLgqn3GhTLduvRpANtWFCZhZMLXXORr71+i8/YYCVamD7ECEej1yPmcK7K YgjS/PCQiIitWzv2ZpHYJgLTmVZHa8BwR4Piapr8RtvKNjTR0HmVJiPGeEsIzGxzABj1B/ 6LGHQJjAxd+voACR5JLDxoDuTd5Kmj7ehr+UtXxVOVH3Ep/F8y+4gj+Nh7dpQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689884907; a=rsa-sha256; cv=none; b=cG8mC/hMzr3NBAZOU3heR28dxeizgY7sP43SbRv08/Oh0vpSRfZetY5fWh7AySkNQm/EDD puGOclFdANf++7qQjHPodlVfJFchaVY1JzRnZIe30TB2yTBocv5Xf5+PK0TcfDhSEuI2p5 pPB5CR98ybak0OL0y3roMQU/2Ipdbv3Fh9T6B1iKvadlOYHiOFO6zmnER84vRigkRS81U/ P8XY44A96z8dy3gQAxEZNkcrJ8aDEGpyZROdcOzJgCchzgoVVEZbcRa9kqveAEEeONf7zt Tx6/F6EVo01zbP4L8+ab90EketLvL+/moOgUS4coqkUZuAghGBIdLIRjyDvh7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6PQg3zvWzkrN; Thu, 20 Jul 2023 20:28:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KKSRTE003447; Thu, 20 Jul 2023 20:28:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKSRww003446; Thu, 20 Jul 2023 20:28:27 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:28:27 GMT Message-Id: <202307202028.36KKSRww003446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eugene Grosbein Subject: git: 03c2616dc530 - main - tftpd: unbreak getopt() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03c2616dc530e5b23f06f9aa421012154590e578 Auto-Submitted: auto-generated The branch main has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=03c2616dc530e5b23f06f9aa421012154590e578 commit 03c2616dc530e5b23f06f9aa421012154590e578 Author: Eugene Grosbein AuthorDate: 2023-07-20 20:26:32 +0000 Commit: Eugene Grosbein CommitDate: 2023-07-20 20:26:32 +0000 tftpd: unbreak getopt() Unbreak getopt() broken by recent commit. Fixes: 273a307d0b80743fb08e23237b3f74dc94a8fa2a MFC after: 1 month --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 9ae7575f3d23..1c04cd113932 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:sS:u:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 20:44:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Pnh0dBnz4dVgY; Thu, 20 Jul 2023 20:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Png5KrDz3QgF; Thu, 20 Jul 2023 20:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5rw2Wt08nn/MwqyRHjadRUI9aOFtw3Gtd8qLC1+zPyQ=; b=SPVHzjFzNnWvW1X6L4RiogCFbz1938DiPhmjCqNYqJXu+JgIFu1md9/K1lXAOCWgfo+Lys 3uk6O01uZrbx8zBgrokBG+gXVI2DiiMqSprHYiMfZ1r03iZBh9vv++f0G1jZAauF3no0os 8f984QEePG0SpAcWLi6fxN9yLSHjHT/PJK7GtzDyNymmBLgBg2czrDcmQOMIJ/+NajHBRW wZUMpu8SQongaWmAkvzXBRel6SmH9xjsSnK98QgpcWfXdHJu/4Ud2D8Os4KlVqjBERFV8Y i9sKMLvzzi+Y0lKv0slze8D2PXgisDgmKMnBm9oqvA83mpYfLBX7vOLzc0zchg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5rw2Wt08nn/MwqyRHjadRUI9aOFtw3Gtd8qLC1+zPyQ=; b=ehIZgBgWDl+19kzDymi2wDLD8TD5EPM1J+zed7dvwwHobgB1+Ej5wtjW2+wIRf6pCr2GPf 8i8HWYKq2feZo7F5cD4A59r4COq7wR6NcgwzTC9WoQDccSAY0Isjfq186Sw1knFW/gpn56 TylfC4b4omhFrKeBh0AA5mR4k7jzST3tY3SDu8sbsbjZlT8AhdrhY274cKyVTOQwYViB/J mN9I+mrDdOP7Z7KRNg9ZRI0AJrI+39+5sHPQJ74qKcflpAERT8+/yRN4wQdq9o4tyG9l7B 4sWJysZ2/Vf33FwvFM6fexDXsfm+M0Hp5uNXVPfxjiElmZ397HX9MxbM2+hhAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689885895; a=rsa-sha256; cv=none; b=ckw3akga7AH4L7vkNaqFDc27GZgIsqbYws85A4Frrx2b/0LDQnQpUTx5CmCTAjdBSnJVGh ytVK0iV84Pm6SoRHcNdBZRJNCc1BsQLhjGi74AN7KyQr7dGnewjPKyfXOnhiYGXjWRiarm Gf/9mahz8sm5BFJ1nhTjskRk+Tc0O+e7lOVC8i4rE2tWT/8y5XKNb2oY3mIHu1pM/XQPTm U98V4nsJAtLTGB8UNhXDYOBvwS6nYva9wwPkAafUs5V5THGJDoBqTapSlogbX70YmohQHJ u6sLd1ykkCG9POfO5Q6zp2d3eAvlpcErdW6Is8gEaKW0CBiCsyEXfTqtQ4WFhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6Png4G9gzlGv; Thu, 20 Jul 2023 20:44:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KKitXR035770; Thu, 20 Jul 2023 20:44:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKitrI035769; Thu, 20 Jul 2023 20:44:55 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:44:55 GMT Message-Id: <202307202044.36KKitrI035769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 9e752dae4ce1 - stable/13 - oce(4): Don't directly access usespace List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9e752dae4ce125d873f12fde993e0466ed42b54c Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=9e752dae4ce125d873f12fde993e0466ed42b54c commit 9e752dae4ce125d873f12fde993e0466ed42b54c Author: Brooks Davis AuthorDate: 2023-06-14 17:55:41 +0000 Commit: Brooks Davis CommitDate: 2023-07-20 20:41:14 +0000 oce(4): Don't directly access usespace Replace direct stores to userspace addresses (never safe and broken on modern CPUs) with a copyout. Use a static assert on the size to ensure we don't overflow the field. Reviewed by: markj, jhb Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D40519 (cherry picked from commit 758927a982db0ae3ebb02c05aec8a53bcc0c20cb) --- sys/dev/oce/oce_if.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 1127565282c1..2d089344e844 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -2250,7 +2250,6 @@ oce_handle_passthrough(struct ifnet *ifp, caddr_t data) uint32_t req_size; struct mbx_hdr req; OCE_DMA_MEM dma_mem; - struct mbx_common_get_cntl_attr *fw_cmd; if (copyin(priv_data, cookie, strlen(IOCTL_COOKIE))) return EFAULT; @@ -2282,17 +2281,25 @@ oce_handle_passthrough(struct ifnet *ifp, caddr_t data) goto dma_free; } - if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size)) + if (copyout(OCE_DMAPTR(&dma_mem,char), ioctl_ptr, req_size)) { rc = EFAULT; + goto dma_free; + } /* firmware is filling all the attributes for this ioctl except the driver version..so fill it */ if(req.u0.rsp.opcode == OPCODE_COMMON_GET_CNTL_ATTRIBUTES) { - fw_cmd = (struct mbx_common_get_cntl_attr *) ioctl_ptr; - strncpy(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str, - COMPONENT_REVISION, strlen(COMPONENT_REVISION)); + struct mbx_common_get_cntl_attr *fw_cmd = + (struct mbx_common_get_cntl_attr *)ioctl_ptr; + _Static_assert(sizeof(COMPONENT_REVISION) <= + sizeof(fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str), + "driver version string too long"); + + rc = copyout(COMPONENT_REVISION, + fw_cmd->params.rsp.cntl_attr_info.hba_attr.drv_ver_str, + sizeof(COMPONENT_REVISION)); } dma_free: From nobody Thu Jul 20 20:44:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Pnj1Bkdz4dVRQ; Thu, 20 Jul 2023 20:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Pnh6xd4z3QSQ; Thu, 20 Jul 2023 20:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3jZlZ4FZabi1UANpekMZzwBMF5/CC4E4CF3pY9QwiKk=; b=eDfhsAqMliaAkmmGH+LEZO2CdLhhb0Cj+k+ak6r600dA7iJVPST/QXZpH9ZAyUHQz1cU47 RwRGEI/KsSWjE9MhFI5sED24VlbpjM+qUnwLrNiVgdAlw0CN5EAAPn8Ivv26xUdXych5L9 cwVXP4yiUwDQSNuldujlVXgEwimB8viKE0D3sffuTYoSNvKE3wWtXdHzVDOpHBJd5/Obc3 I3V6ChG6AR7LbHy+udrZE0FtYpnifWQYiZoC1NIKBXZP5+6OGghn5EL3Gg0z59QBHJ6ul/ xGQQaeTJrICPxIuHZ7uSzIGsIhDFx0J6wzlPX9HDhAvl8w+ulnnaylSs1/MRfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3jZlZ4FZabi1UANpekMZzwBMF5/CC4E4CF3pY9QwiKk=; b=LcwVnStosfb3J+pcEFayZXRfR+PB7ynht7VeIB63MTdb1Rc79eTemMtDrhi0RarnW9gVPl Lxnu3dThQ0gPYP6/cab86/cwAfBeyZVHCkRSz498ugBkD/0sg84YiMlnMONeGSu9HHIZYk HbCw47GS3RS5akC1HFO4WFNLop+rQ44GJn++gMJMJbq8F4tgMH6IvdLb/ezn0LJfcXiJ6K I50CvL7U3XAQDMYmZwPgJF2nsUttHKJVSftiPjB0DUakWiHknRjBe0nzluYm0/mao2fTja 6eL1r64jAAYcmwgP5Y2nDo4fTfxcShO32Z3zZiXL+0mi2oopYpxWYV9GZqHdzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689885897; a=rsa-sha256; cv=none; b=fyS087rHHRrBxs5eU44ZwD5zgz4ufIhUOHentggfCc6r8gKFhE2V+goh8Y4vB7lfSiY52x OEZkTSaCzD9PWh2u7ox9UTqxZFXEaZ8TEMokYLiOL44SWh1BQnt998oDO9CnzloATAQmuB bgdJiC91Q5OMKF4b2l+P565mIUKqIOu4fGi/ap13ZvT7gASNjDROEXs4kfSl+OERLB+xJ1 pySBFZCkHjzl+JsRTVQJpvz0wbu/oeI3rXiamy4z6XFY78H4EhjcVhx1I5YvmDDpaMMFMc 0GfAKHjvIOBdSW7hy5W3nHwzaxtn/iWyY+gtV8htCvqiAJpap9dJ/Czd2yod+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 4R6Pnh51hKzlZ1; Thu, 20 Jul 2023 20:44:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KKiuiM035789; Thu, 20 Jul 2023 20:44:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKiuQW035788; Thu, 20 Jul 2023 20:44:56 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:44:56 GMT Message-Id: <202307202044.36KKiuQW035788@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 84019c6c0052 - stable/13 - oce(4): deprecate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 84019c6c005255851bdb7f5e71ad0da3d50ce0f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=84019c6c005255851bdb7f5e71ad0da3d50ce0f1 commit 84019c6c005255851bdb7f5e71ad0da3d50ce0f1 Author: Brooks Davis AuthorDate: 2023-06-14 17:55:54 +0000 Commit: Brooks Davis CommitDate: 2023-07-20 20:41:18 +0000 oce(4): deprecate The Emulex OneConnect NIC driver hasn't seen any commits other than ioctl bug fixes (some severe) and sweeping commits since 2016. There is no indication of new parts since 2014 or earlier. As such, deprecate the driver with the aim of removing it prior to FreeBSD 15. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40531 (cherry picked from commit 4591322980a37d6ee38a3ed70569366e16ca71f6) --- share/man/man4/oce.4 | 8 +++++++- sys/dev/oce/oce_if.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man4/oce.4 b/share/man/man4/oce.4 index c5022833e8b5..4dfa8e15aaaf 100644 --- a/share/man/man4/oce.4 +++ b/share/man/man4/oce.4 @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2012 +.Dd June 13, 2023 .Dt OCE 4 .Os .Sh NAME @@ -57,6 +57,12 @@ module at boot time, place the following line in .Bd -literal -offset indent if_oce_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver may not be present in +.Fx 15.0 +and later. .Sh DESCRIPTION Emulex OneConnect adapters come in various skews and with different combinations of NIC, FCoE and iSCSI functions. diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 2d089344e844..3385546cf1a6 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -375,6 +375,8 @@ oce_attach(device_t dev) } softc_tail = sc; + gone_in_dev(dev, 15, "relatively uncommon 10GbE NIC"); + return 0; stats_free: From nobody Thu Jul 20 20:44:57 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Pnk00WPz4dVcZ; Thu, 20 Jul 2023 20:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Pnj6ZDtz3QbG; Thu, 20 Jul 2023 20:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJNbvMOoxU2tGVHyhi+TzGKQ9FCbRyB7EyPWkRXnUSY=; b=tc4oYriueVv571qqQ++MFX0djpdvgyj524a8KCxXS93bqkQ8JSxCKKLr9YDBiCcJ7zEAEl Bct4+TWAPhrHiDPYmPdHQE3LNpLi+NC1DroBFIegvSX9EuQUcM5X0gj0vplfxUX5bDmsgV O2jhtm9M0q9DMuWqhFRxu1itJzfm4BDFxpi0vfq9NIZJ03mG90g3KPoIqw3iCiNp3aWrgn +/ROtR4CzAVY6Nae1eWN7PRvJoZgIYqjacdSaOQRh11PfLGwkzahadMh73D+BvSqjV5Q+E Q9V4gLyVrITHtIx7ffvNVCP2us2IDjZd8wDii6ER40h8k0EA4TvKK1QKOiT/4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689885897; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VJNbvMOoxU2tGVHyhi+TzGKQ9FCbRyB7EyPWkRXnUSY=; b=dOM59vCucTKaQD2YZam6mnbD5CLSYDb3tUxI9ZzgzE/JsuEbbxX0fsgfB18fbgjbq9AHgp mBujeha9BXXD0fw7Gz92Fi6RRsJGPkq+dn7DZS7qaEaKXHqe7TxYAk2ow4VTTgb7eAt0pa KIgu9u9wxOdh96dNlvHDY5iw1oLr5UxSxEMMOkaEx1X3h9LSf7kmPi4lX4DV3jde+qxWMK +/kVsWwmVGOXOsuV5X0IzCKif5m64HOONZI92GHbzmrVUd0bjYi01ZayyqjdcqQALejH4z 0UcDFy+WVQMgiDLzKD2PwHw4oUWV1bRO3K1Qn4XzFgKiL0FWY3TUGOjVjLSLQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689885897; a=rsa-sha256; cv=none; b=bbBb2iW40TjVp1a3r/5+ZEnQJS/wkxcHKLc/FBdsKbDgMjG6+WNbUWgfm0PNMdAhi9Y3Sh LjL4T/cpcsGmpauMng75cpsSQaSRuOwkczi3tiR/czgq2fccJvdz9mVELCSmvLHnCKCdwe JOv1ciFo5Un1U4I4CGJljgyl9CmpfY6Kc3iG6gmimA1mam9hOyeIop+W61NayURfHVx0mn 1eDEsjFaHX2YG4FCKk7ri6INlkzO2LWLAqGa5WgiwS2Jx7TnIOxi5/hittf0lKVYOa7+lu HRwqFac3mDTgLj0w9Cd6UPGT0zeonGXFqlc9KxAzFb+pNJlo8tLezlzQmiyLng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6Pnj5VhBzlnW; Thu, 20 Jul 2023 20:44:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KKivSI035820; Thu, 20 Jul 2023 20:44:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KKivoo035819; Thu, 20 Jul 2023 20:44:57 GMT (envelope-from git) Date: Thu, 20 Jul 2023 20:44:57 GMT Message-Id: <202307202044.36KKivoo035819@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Brooks Davis Subject: git: 67835f14aa68 - stable/13 - le(4): deprecate and mark for removal before 15.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 67835f14aa6839b3bc321ecbbfa2e74e389b2879 Auto-Submitted: auto-generated The branch stable/13 has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=67835f14aa6839b3bc321ecbbfa2e74e389b2879 commit 67835f14aa6839b3bc321ecbbfa2e74e389b2879 Author: Brooks Davis AuthorDate: 2023-06-21 23:50:12 +0000 Commit: Brooks Davis CommitDate: 2023-07-20 20:41:24 +0000 le(4): deprecate and mark for removal before 15.0 We kept le(4) in the pre-12.0 purge because it was needed for Qemu/MIPS (virtio networking didn't work) but the MIPS port has been removed. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D40683 (cherry picked from commit b95d2237af403049d48c23229aa8bace3594970e) --- share/man/man4/le.4 | 8 +++++++- sys/dev/le/lance.c | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/share/man/man4/le.4 b/share/man/man4/le.4 index 2c7f9cc3e55e..58a6826bb03f 100644 --- a/share/man/man4/le.4 +++ b/share/man/man4/le.4 @@ -36,7 +36,7 @@ .\" from: @(#)le.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 26, 2020 +.Dd June 21, 2023 .Dt LE 4 .Os .Sh NAME @@ -64,6 +64,12 @@ numbers have to be specified in .Cd hint.le.0.port="0x280" .Cd hint.le.0.irq="10" .Cd hint.le.0.drq="0" +.Sh DEPRECATION NOTICE +The +.Nm +driver may not be present in +.Fx 15.0 +and later. .Sh DESCRIPTION The .Nm diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index e4ff97b824e2..18786dd919a0 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -202,6 +202,8 @@ lance_attach(struct lance_softc *sc) ifp->if_hdrlen = sizeof(struct ether_vlan_header); ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; + + gone_in(15, "le: 10/100 NIC no longer needed for Qemu/MIPS"); } void From nobody Thu Jul 20 20:49:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Ptx23nvz4dWBp; Thu, 20 Jul 2023 20:49:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Ptw5DcWz3h5H; Thu, 20 Jul 2023 20:49:28 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 36KKnLiY097890 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 20 Jul 2023 23:49:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 36KKnLiY097890 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 36KKnL6x097889; Thu, 20 Jul 2023 23:49:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 20 Jul 2023 23:49:21 +0300 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4R6Ptw5DcWz3h5H X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 08:15:15PM +0000, Brooks Davis wrote: > On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > Author: Konstantin Belousov > > AuthorDate: 2023-07-19 11:05:32 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > If mprotect(2) changed protection in the bottom of the currently grown > > stack region, currently the changed protection would be used for the > > stack grow on next fault. This is arguably unexpected. > > > > Store the original protection for the entry at mmap(2) time in the > > offset member of the gap vm_map_entry, and use it for protection of the > > grown stack region. > > It occured to me to wonder how this interacts with > __enable_execute_stack(). I think it's ok so long as the compiler > always emits __enable_execute_stack() for each trampoline and doesn't > depend on extentions to the stack being executable from the first > trampoline creation, but I don't know where to look to verify that's the > case. Even on first trampoline creation, compiler cannot know how much was the stack grown already. So the generated code cannot be sure that it changing the protection for the bottom stack page. Then, it cannot work even for more usual stack grow organization. From nobody Thu Jul 20 21:28:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Qlg3F09z4nYFW; Thu, 20 Jul 2023 21:28: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Qlg2pXzz3smV; Thu, 20 Jul 2023 21:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXvfPsCb072rFw0Rxql81r3oMTE9PX3WpDBEGuqi5Qo=; b=Dm5atOOHdF1OdeEYgqlTYZX8S2CKCGuE8FDClODL2VB7D8qFwSVbS5i19xK6CW9fRkgpXe mWl6g4Sdj26IDDSVSgGWrE1p+BYGWN9KF/CO1i9mWzb6acAYSh0hL3Av1JmIJuPL4aABwc vrS9ffh2L2i84xJp7EpcEHanT9MoCKyCKdcHoHcaPGf5Yn773akviqRJoqhyW3jw/hHWuo A3EixLim9oW9maOfpoHvIOPcoxjDIiXURWFbjeJGyYE6Q1BM5r3FPd6BoU/DnFODxndiI9 aEj8eFy8IrmDLzKyrM24qSauiJnB+6TVoUxwAQ3G3SunSIFq2NUBJEfWgQcGuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888495; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uXvfPsCb072rFw0Rxql81r3oMTE9PX3WpDBEGuqi5Qo=; b=AhX1VifBZVv9oStftXXA7kXvXkbTi3OWwFy13DDoY9q5Sb+JkSeemCuYfv7aszxCd4MWDJ BYxi957YWIw8FB7gX0FF3i7YRTc7C5AA2En2zKOgM1jFbGRewcGZbHfGGU6oi5z7Go1Q1S bSWwdfhAZZpql1a7+bvueaIrXuC3NaDnV9VladNP8ZOo2xA2Hj/LmrX1TJrEeFFBOHb3rv uoKpcnDfUmg7+GNcPLwl62J0kozSI9TruKPmjdJAl+rKeiAiLCflD0CYYM+dv5WHOYp1so CMEXr+tDmFftxdsK112B2w0uszEEUSiH/fgKve93YYrK6Av9NuovXsE7Dlf6HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689888495; a=rsa-sha256; cv=none; b=CsFUNxRe3mpwuC/E1N9sv5Yx1Ltqy41CG/2Kc0KcS9aNZhRWfZx0WiUoHczgbYzM/lDjdO oTgw57E8WXZM8fLafoZSVIxKzo351yMWgoZTt+c2cDLWPdQxx+is8hVwNXC/oKHrcokleC yDn1GWpaH7YMHzmrw6BU9MfQ07JNZ2VnVljZCBcTmWjHKSSQ4kPvR2s+7OHPu/MVxgBAjv gBHol6HNbATUwubAfh6Z0SnaacvKd07SaY5HrlHeN9N7zWZtMfEpZRtZqKzcPEytRmPY6v 5tF35UZHK+3/L1S4UhCLUS9VOZL3+1+RD5Qhi+UJX3CEKbiLVrqECJpH7lqKSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6Qlg1thSzmDy; Thu, 20 Jul 2023 21:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KLSFrW002923; Thu, 20 Jul 2023 21:28:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLSFbX002922; Thu, 20 Jul 2023 21:28:15 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:28:15 GMT Message-Id: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Morozovsky Subject: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3cbc8e752b92442c784306731e94fd904de3373c Auto-Submitted: auto-generated The branch main has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c commit 3cbc8e752b92442c784306731e94fd904de3373c Author: Dmitry Morozovsky AuthorDate: 2023-07-20 21:24:28 +0000 Commit: Dmitry Morozovsky CommitDate: 2023-07-20 21:24:28 +0000 tftpd: fix double-colon typo in option string MFC after: 1 month X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 1c04cd113932..27bb7cb4cc67 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 21:34:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Qtk4hMCz4ncxh; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Qtk3HpNz3vY9; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888862; h=from:from:reply-to:subject: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=oCmU1OHmg59tstFQXNvAlL4y0kvVxqE98RtcExdHJz8=; b=R+qh5cfAZUPgfEzFvkElXW+w/2KOAxqgM70Hs+dqVO5W1Gtk0UeGhCWwi435NOnBQK2qSE FPyqTESqXF1eTuvOVL+mbY8JCPR/8bY5QkKSMStdil8S0bcNz40JEBF2hk2slVATO/JQ8w /VTEbCVDruJjmmmASbSgn48w+jHLHtqHJJZm2I5tlw1huz44NgJ0kUzfgiyiQUESygiADD WoZuAMI8/pJ6sA1SiC6FKdBAaaw193TH4/UQxCtm8J2No6Ce1zQcfBWBkg7AVE+wnUl0US OAUkHgRIEYQp5Cii3VlyMiEo1epLC+7P64QVMHPwZoJ0MuWPmYTg2ziuEWRXIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689888862; h=from:from:reply-to:subject: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=oCmU1OHmg59tstFQXNvAlL4y0kvVxqE98RtcExdHJz8=; b=VE8/++fgn60WoDAwdLkWU5AEUmJB+mH1L9AxmY/EdAz1E46Krj1/4IGMTtQSjJVeSwN61e vQZZW4wJJg8KMNhMGWjtd7Li362IFII9UFdAShGW89bYRzmeQ8evSuMJ9d0RuiIJ0CUUsb 9bkXpFuKf7y16I9XdxQXktyZnessuuQv8zuTCHIuZFIEMTMmKZBpwYiH6keKao4X+reGGK HIipPzJ5qOdWlT4tvCEMzTI8DVMmIn0wb+YzK/oFZTFd9kcNFtELqqNQX1b9H54Kag6deg bdYazMjghuwXikBDHA7/LGsJsGBKvEqkRgi0QzLJkBsq3HMORhTeDMeL5FQ4PA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689888862; a=rsa-sha256; cv=none; b=btD06MuQV7KuKD79K4St11ytuuF9IlJgT1lcVXBcU+DIMEIbZXiS9g07G0Uyl/kNYwiPnh X3SgeTtPIroY8jZzC1qzBV6v90NPuFNjLvW9qvqGgJFSI4M/RX+GM2nZCXDajU6sMr/pyh 0OaRGz/CvMAwR2Iq1mSw3qh/HmGobENJw+TmNqec4F4kK8tBuD0Z+MZNZhaDTQ/QsphTTk rQwBeD4e9DCnM9/rzAmQXjHn0pT8h4k6sl61uDOBc/GnbwFBx5YgNRKEzCMsSr4P55SoEq U+aNPwkjnOojK5/8Uz9eebnfd/RWW/06ePXQI8887THo1Z4tJg9CXZGCQ+uKQw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R6Qtk0ctxzf5M; Thu, 20 Jul 2023 21:34:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> Date: Thu, 20 Jul 2023 16:34:20 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string Content-Language: en-US To: Dmitry Morozovsky , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> From: Kyle Evans In-Reply-To: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/23 16:28, Dmitry Morozovsky wrote: > The branch main has been updated by marck: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c > > commit 3cbc8e752b92442c784306731e94fd904de3373c > Author: Dmitry Morozovsky > AuthorDate: 2023-07-20 21:24:28 +0000 > Commit: Dmitry Morozovsky > CommitDate: 2023-07-20 21:24:28 +0000 > > tftpd: fix double-colon typo in option string > > MFC after: 1 month > X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a > X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 Er, this wasn't a bug. -d takes an optional argument, which is indicated with a double colon. Thanks, Kyle Evans > --- > libexec/tftpd/tftpd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c > index 1c04cd113932..27bb7cb4cc67 100644 > --- a/libexec/tftpd/tftpd.c > +++ b/libexec/tftpd/tftpd.c > @@ -142,7 +142,7 @@ main(int argc, char *argv[]) > acting_as_client = 0; > > tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); > - while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { > + while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { > switch (ch) { > case 'c': > ipchroot = 1; From nobody Thu Jul 20 21:39:01 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R061wH0z4ngJp; Thu, 20 Jul 2023 21:39:02 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_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 4R6R061XJkz3wgQ; Thu, 20 Jul 2023 21:39:02 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Authentication-Results: mx1.freebsd.org; none Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id ACC593C0199; Thu, 20 Jul 2023 21:39:01 +0000 (UTC) Date: Thu, 20 Jul 2023 21:39:01 +0000 From: Brooks Davis To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 21e45c30c35c - main - mmap(MAP_STACK): on stack grow, use original protection Message-ID: References: <202307201412.36KECDSU084918@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4R6R061XJkz3wgQ X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, Jul 20, 2023 at 11:49:21PM +0300, Konstantin Belousov wrote: > On Thu, Jul 20, 2023 at 08:15:15PM +0000, Brooks Davis wrote: > > On Thu, Jul 20, 2023 at 02:12:13PM +0000, Konstantin Belousov wrote: > > > The branch main has been updated by kib: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=21e45c30c35c9aa732073f725924caf581c93460 > > > > > > commit 21e45c30c35c9aa732073f725924caf581c93460 > > > Author: Konstantin Belousov > > > AuthorDate: 2023-07-19 11:05:32 +0000 > > > Commit: Konstantin Belousov > > > CommitDate: 2023-07-20 14:11:42 +0000 > > > > > > mmap(MAP_STACK): on stack grow, use original protection > > > > > > If mprotect(2) changed protection in the bottom of the currently grown > > > stack region, currently the changed protection would be used for the > > > stack grow on next fault. This is arguably unexpected. > > > > > > Store the original protection for the entry at mmap(2) time in the > > > offset member of the gap vm_map_entry, and use it for protection of the > > > grown stack region. > > > > It occured to me to wonder how this interacts with > > __enable_execute_stack(). I think it's ok so long as the compiler > > always emits __enable_execute_stack() for each trampoline and doesn't > > depend on extentions to the stack being executable from the first > > trampoline creation, but I don't know where to look to verify that's the > > case. > Even on first trampoline creation, compiler cannot know how much was the > stack grown already. So the generated code cannot be sure that it changing > the protection for the bottom stack page. Then, it cannot work even for > more usual stack grow organization. That makes sense. Thanks for the clarification. -- Brooks From nobody Thu Jul 20 21:40:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R1N3Sljz4ngmD; Thu, 20 Jul 2023 21:40: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6R1N336Nz3xNt; Thu, 20 Jul 2023 21:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689889208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evkFVQeJ0BcMfzSoMUAPFFX3kRr/Lx+gu924e28ptSI=; b=HCYyEiwGU2zwMgDZ+zzqndGUROjEWRjyrbpqY62mPiTbop+7UW6eG8hL5HaPnZXhgYZYg4 yMTOpK1y0snl87X/ZEIM1LacnVSPuUueyKJnKeU/nNi1Zwjo4JkdUeyHMMBJlKJZ9YAzHY I17KBoJzrItk3zBUqLLlxQjqjnQ6J7X1AnbOu0bQNNbQulBaawmdblUJftGtA4agJwT0KM pRHsUaii/Qe5G3vN58Slk6o0S4C3vaKI9Mp1sNlEgZAQuJ1HqauL6mPn4F0Yd3rJAVu02w kWqBJKn10ab4AejmeJsdl71lYDt1zGXeFQknQOENt3w3q0seTkAz8G7tmUw9Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689889208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=evkFVQeJ0BcMfzSoMUAPFFX3kRr/Lx+gu924e28ptSI=; b=N+K4tmKeIoxRrmI+rBNNR+Hjp1aeu9ntQ4rS6+/C6HeOGYpWcWGN6EJPgOz8JjJwNSc5XP iihbQhTYzcEY2tpTcGCVWZW+89w6lgADHLzp8lgMIC2jzS+PainavYLUSfUHOQEYCdm56u BAIUmVom/7rMUqmBEExfWDxh0Xj7Zx1P8WDvt59MYZ4y85Hk3XENqg1r0hJE36Us5IPOti Z/KAICQvAfUTwOPYO+/wycC9FMe3jHVeemp203RdVIM0/gCLfENUwDVQC1EaLUHzKTtVXG UBltkD8ZJwqJ2qY51AEuoygZ4F26IGHu1Niy7yEQeAHqbRYQ8PFEcgct8Sj+VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689889208; a=rsa-sha256; cv=none; b=dMvOsk5IG07cYlD1UcP0XFVPMWQIMniCqrzgguCp6GQtdpBpWEqzaXt2oFvyfQKMcoUsar a9KkfWVo3Ve8o9QKpVIxEWj2LiTYH0zeClUilpDf0K2yI1B5nOIejb5Q2Bl0dHmEsUpQFr pRWgo9PT4VwoM8ENT7iB+O40ZYU9kkP6f0iVP6hfQZ4iw/IMCCbzyl5N08pMIdL+caXg9t h7v4PSw3vRtCQwCZQM5T5MT4kW9EaZOYCe+dYPdHam1pzGANA7ZtcJL65nc8MHZystNtEz 6wp1sAkCTO6DyDdpx2RcF/xFlGpQwUT8P6/QS+5j4su5V1kHZcG8eAaHTleI7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6R1N277vzmw9; Thu, 20 Jul 2023 21:40:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KLe8uL022894; Thu, 20 Jul 2023 21:40:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLe81O022891; Thu, 20 Jul 2023 21:40:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:40:08 GMT Message-Id: <202307202140.36KLe81O022891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Morozovsky Subject: git: 615d167cb88c - main - Revert "tftpd: fix double-colon typo in option string" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marck X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 615d167cb88ca895278a26b22052f663c5228407 Auto-Submitted: auto-generated The branch main has been updated by marck: URL: https://cgit.FreeBSD.org/src/commit/?id=615d167cb88ca895278a26b22052f663c5228407 commit 615d167cb88ca895278a26b22052f663c5228407 Author: Dmitry Morozovsky AuthorDate: 2023-07-20 21:38:30 +0000 Commit: Dmitry Morozovsky CommitDate: 2023-07-20 21:38:30 +0000 Revert "tftpd: fix double-colon typo in option string" It was not a typo: -d takes an optional argument, which is indicated with a double colon. This reverts commit 3cbc8e752b92442c784306731e94fd904de3373c. Spotted by: kevans --- libexec/tftpd/tftpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 27bb7cb4cc67..1c04cd113932 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -142,7 +142,7 @@ main(int argc, char *argv[]) acting_as_client = 0; tftp_openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP); - while ((ch = getopt(argc, argv, "cCd:F:lnoOp:s:Su:U:wW")) != -1) { + while ((ch = getopt(argc, argv, "cCd::F:lnoOp:s:Su:U:wW")) != -1) { switch (ch) { case 'c': ipchroot = 1; From nobody Thu Jul 20 21:40:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6R1f1pMXz4ngkK; Thu, 20 Jul 2023 21:40:22 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6R1d5t54z3xbc; Thu, 20 Jul 2023 21:40:21 +0000 (UTC) (envelope-from marck@FreeBSD.org) Authentication-Results: mx1.freebsd.org; none Received: from localhost (woozle.rinet.ru [195.54.192.68]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id 36KLeHvn005851; Fri, 21 Jul 2023 00:40:19 +0300 (MSK) (envelope-from marck@FreeBSD.org) Date: Fri, 21 Jul 2023 00:40:17 +0300 (MSK) From: Dmitry Morozovsky X-X-Sender: marck@woozle.rinet.ru To: Kyle Evans cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string In-Reply-To: <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> Message-ID: References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-ID: 6B691B03 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [195.54.192.68]); Fri, 21 Jul 2023 00:40:19 +0300 (MSK) X-Rspamd-Queue-Id: 4R6R1d5t54z3xbc X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8331, ipnet:195.54.192.0/19, country:RU] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Thu, 20 Jul 2023, Kyle Evans wrote: > On 7/20/23 16:28, Dmitry Morozovsky wrote: > > The branch main has been updated by marck: > > > > URL: > > https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c > > > > commit 3cbc8e752b92442c784306731e94fd904de3373c > > Author: Dmitry Morozovsky > > AuthorDate: 2023-07-20 21:24:28 +0000 > > Commit: Dmitry Morozovsky > > CommitDate: 2023-07-20 21:24:28 +0000 > > > > tftpd: fix double-colon typo in option string > > MFC after: 1 month > > X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a > > X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 > > Er, this wasn't a bug. -d takes an optional argument, which is indicated with > a double colon. Ah I see now, overlooked somehow. Will revert, sorry for the noise -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] --------------------------------------------------------------------------- *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@FreeBSD.org *** --------------------------------------------------------------------------- From nobody Thu Jul 20 21:58:08 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQ84Mgcz4nqLM; Thu, 20 Jul 2023 21:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQ83szbz43H7; Thu, 20 Jul 2023 21:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+I/wMKRknuxZWEWzReSG9BHJjeF4eMM3teT5wHKmP8=; b=osYo8EQ+ALOsTLFqVacbrg2VwQCw/gjhhJOCOpvysitsPLJNdEGaiepMW1cKvaC7mY+cIn eO+keszbskqMuOorKa6io2+ZMZcb83aY3y0+C9IDLbGJxBxeVZoD85MNQbtFg8XLywlF7g DEkP5jYAm4iMKfylFVZElYYtXuO1gfLXNVtGZoZKupALykr6bGMdfCeH4o3efid5Tj0i/+ 3VvR2s5dz7VMDddzSqlzgKzHiN/aoyF3cvTtGqLfdD9ve30rfEA93S6/mxgVNod+YJgTfo ZPPQp2NeNkxl61eSpAK6h/IAeLI7Pefne0to3saWKg3oyHiJLvsM7DvhJXdiQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890288; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y+I/wMKRknuxZWEWzReSG9BHJjeF4eMM3teT5wHKmP8=; b=U5bPd/3hak7hwvk3cBQwaUeU40Vc50r3ylgqQlUIoBsiBskDQTjKSwOQs9dLUOFlH2x8rr 5g6Jp3wLHIrlynBrx0WIDm91H2mYCJCndv94TYB3BeqCRR7NyMyh04G+m0zlPEGYTeQSiy EPZaLwmMhnSXMRJsvK5K6uDYHTLOJCEmeuVuxaJ9ymqhhRuHEY7OG3CdFC6L3IVGoTlGke mWvaf4pLHXn1814arCcrKmhI66+Khhs088qUqO2Zrh6QBAnWS6gq/PEeTVwzOs2RgtENSI u/NpNjEqlwbfoManlUcEFkYC1AqE4gcyVJ2ce4l+EFZJTFlMeGg2syzolNbrEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890288; a=rsa-sha256; cv=none; b=Nu2ZkyzsYM9lj7oIwdMSTARFRXhXJhkLU/QkG0U0IPwJKEouwRMepC6Imf2ZoWsLYyNSEy ipoJAuNKyoQHbki2pX4XytQnTDEUqYPrGETft41ZAS9ZD0SPWNMM8y3Qjm11AZiQQcqHfv peyIut35dCVfubtS0XCGzsGF6SeuQYr23OHrRMdO/R+c7OGj+jwR+0jAKOEVEkw3DjIljd GA4gg/eYYSap0xd1ius4UXyiXciWTmlqzpgOW3OyVNousKLheoRgosfSu118sAAaMmkkdc tzNgvPfymyek8+DYa9e/7IS9sEQdGs9qFiW6KmVbgyf8lgnPRFqKJ9V6HmeGWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6RQ82s9MznSt; Thu, 20 Jul 2023 21:58:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KLw8nm052182; Thu, 20 Jul 2023 21:58:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLw8ba052181; Thu, 20 Jul 2023 21:58:08 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:08 GMT Message-Id: <202307202158.36KLw8ba052181@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: 90f10db8a996 - main - sshd: remove unneeded initialization of libwrap logging severities List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 90f10db8a99659d1baea7b2609d9256c331f61ae Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=90f10db8a99659d1baea7b2609d9256c331f61ae commit 90f10db8a99659d1baea7b2609d9256c331f61ae Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 sshd: remove unneeded initialization of libwrap logging severities This part of ca573c9a177 proved to be unnecessary. As the removed comment says, we set them merely for logging syntax errors, as we log refusals ourselves. However, inside the libwrap the parser logs any syntax errors with tcpd_warn() which has hardcoded LOG_WARNING inside. Reviewed by: philip, emaste Differential revision: https://reviews.freebsd.org/D40068 --- crypto/openssh/sshd.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 620a7efe7797..ce8db54a2b72 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -142,8 +142,6 @@ #ifdef LIBWRAP #include #include -extern int allow_severity; -extern int deny_severity; #endif /* LIBWRAP */ /* Re-exec fds */ @@ -1303,7 +1301,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) * exactly. sshguard, and supposedly lots * of custom made scripts rely on it. */ - syslog(deny_severity, + syslog(LOG_WARNING, "refused connect from %s (%s)", eval_client(&req), eval_hostaddr(req.client)); @@ -2112,14 +2110,6 @@ main(int ac, char **av) /* Reinitialize the log (because of the fork above). */ log_init(__progname, options.log_level, options.log_facility, log_stderr); -#ifdef LIBWRAP - /* - * We log refusals ourselves. However, libwrap will report - * syntax errors in hosts.allow via syslog(3). - */ - allow_severity = options.log_facility|LOG_INFO; - deny_severity = options.log_facility|LOG_WARNING; -#endif /* Avoid killing the process in high-pressure swapping environments. */ if (!inetd_flag && madvise(NULL, 0, MADV_PROTECT) != 0) debug("madvise(): %.200s", strerror(errno)); From nobody Thu Jul 20 21:58:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQ95TN8z4nqTh; Thu, 20 Jul 2023 21:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQ94cTkz43Df; Thu, 20 Jul 2023 21:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNhqxRwkt40fsorc81XCK1qjV/RBado7dJpQPdXBERE=; b=wqvrRWpDuxFa7gZzpK1tJw9eooPbWf/a3GUbWEnKTb3rNAC0n2AXzgwK6tPlP53tHHmOTq eMcrQKtMpEruT6dJf8wGA8HBQzYXX0joLgbmYNVXSos4V4K+VyenDA5Kqe6VQtIkr4MtJY /r3/t2dJHwztU1ECfmQqMglx6UaXqeu5eCumit2EGCavV81l0iMrCWWlTfw6HiGjgbgQdw komM0sDRFefzrWSG94Y5or3lRzA3U56h3VD6Unm2g8wi0nVfQywW+SlOsOIuAmk4gDUu28 D70U93Bmcq8TdlDwOq1jzGmw2Zf6/MZpsNdziCF94xB2myCdz8wmJDSW7n3L7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890289; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KNhqxRwkt40fsorc81XCK1qjV/RBado7dJpQPdXBERE=; b=JjW0tKrZm2mQpUogFASGvtjZPykPhT2qvu7nv7wxM22p8D2i8k6LmTc9J2HpQsi7nnbb0m 93icMgjLKPoGOWTcyl3ZUXuCIH0uvaJlJKgnpwqd0mYe8DSpqUhTHKzZGgrjE6c9xh7cf+ Hyj4BwUPUj7xEUOCmn4AvHwQFZ+i3ZLyAkn8dAvMiiyGq4OhGKG06B5aaGA90Vwj1cb1uH szgGCqXQ09glZkUkZTtyglEOvqQ/PLYPEoHFi++ctjKftFQnAhLpb3XGSZNbd1Hj63bqwI ojH7mwUaaFlrpH+lBwhDvEfLovrUVkTLpw21Wv1XDHgMTWV2Q5qSJIk3kn/G9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890289; a=rsa-sha256; cv=none; b=JbLThsPr/OWhH7830x3f0UsbUROWz0fGnHO/L9Cr6gINFn5zICWy4l0p7RmssWE5tIWBCz vA4pHa5fyVXm7WirlbAq/8CalCtJFgX96MBOwpPoeYy+ZicmPOxsOC1HDLyB1bnqCin9xt n4SyTodlP8mIygDCaO4DVvjYbxvbFWPFuQR/73o2dILmTXdyCE6XkaZUEuTZK6MuP+9nPv v+3GpxLTZrsdXx2VTzwidNs/JEQNLZllWWEYHuECkF0byPHkn2l6Tdx8Fx/5GE2AVrVYET IqJjzxYjYmGspl+RDzWCnYQiAncIHUxJ2zSVUUNmiNrT9CF3NYqhe8xRDkHZzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6RQ93XTFzmvt; Thu, 20 Jul 2023 21:58:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KLw91D052201; Thu, 20 Jul 2023 21:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLw9PG052200; Thu, 20 Jul 2023 21:58:09 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:09 GMT Message-Id: <202307202158.36KLw9PG052200@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: 9ff45b8ed847 - main - sshd: do not resolve refused client hostname List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 commit 9ff45b8ed847f9cb7e1cd401278c7f6b30fe8225 Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 sshd: do not resolve refused client hostname This is a compromise between POLA and practical reasoning. We don't want to block the main server loop in an attempt to resolve. But we need to keep the format of the logged message as is, for sake of sshguard and other scripts. So let's print just the IP address twice, this is what libwrap's refuse() would do if it failed to resolve. Reviewed by: philip PR: 269456 Differential revision: https://reviews.freebsd.org/D40069 --- crypto/openssh/sshd.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index ce8db54a2b72..a82b82d08c14 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -1297,13 +1297,24 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) SO_LINGER, &l, sizeof(l)); (void )close(*newsock); /* - * Mimic message from libwrap's refuse() - * exactly. sshguard, and supposedly lots - * of custom made scripts rely on it. + * Mimic message from libwrap's refuse() as + * precisely as we can afford. The authentic + * message prints the IP address and the + * hostname it resolves to in parentheses. If + * the IP address cannot be resolved to a + * hostname, the IP address will be repeated + * in parentheses. As name resolution in the + * main server loop could stall, and logging + * resolved names adds little or no value to + * incident investigation, this implementation + * only repeats the IP address in parentheses. + * This should resemble librwap's refuse() + * closely enough not to break auditing + * software like sshguard or custom scripts. */ syslog(LOG_WARNING, "refused connect from %s (%s)", - eval_client(&req), + eval_hostaddr(req.client), eval_hostaddr(req.client)); debug("Connection refused by tcp wrapper"); continue; From nobody Thu Jul 20 21:58:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RQC3QDfz4nqNq; Thu, 20 Jul 2023 21:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RQB5Ynlz43F7; Thu, 20 Jul 2023 21:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNlCfSb+A9fksd58p+rPXlwFHgFWWPpYhqOZ0KXEAOY=; b=o+XHWeAPoCkLVTk1Kwbc1jwyw7VUm0+dXnH2OR89D9GU+wNByuQIC3z72ckcgThsdI6K6n Q37T+/KdhAC8JftUww8Oywc+ky2Qgs7OE5MRLs/DEak0xsJlEfNOMV+0dWm8esbp8TFq4u KR9ejDyZbeS3tAMLx6oWp8ZpWp55XPeB5wZ+nH+3ecf9ycBwlNGbvRFGKDtOA2cfMGowZW +RTTu3nWvHzRgML8H/UUhmcr716y7moow8wiBrp+umUVXZzbIbl/GTSxb4QLG5MSyBPsap pPLqCTdJ30f43Rqm1erpJoEzGKckKM4jT/kr/YfOwI4CJHKC1zxN8HhTyTRzvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VNlCfSb+A9fksd58p+rPXlwFHgFWWPpYhqOZ0KXEAOY=; b=azTukA3c/SrSJa7eBH1wPEIo8OkTGLTlEjU9rPT9vZ6pM14Pa3W+qLo8KjFmMRbwId0QIK dQg5uwhHaYnH4oj8ca0Ltzpzogs68BgGgBtJpydiDoM2QctWOc37YTEnaJmNUYV9/cZ0A/ 98BPq4mLLjM7O5hJCD9WUkkJRB9z15xpp0XD5LxnUeAcqVcwyV+ZdFOPITwRF8VokqS01U wmXcFsOPvNOiI/+Xql1QH1am3u0NsRTv+NMiUt1/l0qAqm49XzG+1KcyBcx/agutLwsyHi DrRY9Ijj5fJcFJht06z9zBSCFz5oRysrVVSGQVg4Z3rsojzqFLpg8JRs2cFh9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890290; a=rsa-sha256; cv=none; b=LwpCe6ySA2Q01hWQ3v9GdB/psK7qgBe28FggwOLoDtQpEg3nFnmKOMZT84WrF2O8aOIvZ9 5j2pziNAindtdS0cRL+7dNaRr2DYxgFPmxzyvfXrkGClipXSs9XhoBsVZgtmTeRfI2O9T0 ovKK8TMEV3m3b85FLxvfbKDw0bLq3OpNCqmDNHs/81z9eBqH/UFQXGEEHJ/sb7eq3sjmjb CylPBDOT61MX7VEio4Qz7KD/sur4a/8J7uax0OG2fu7uHHcSE8+bqqztIc89IRcSXBDhQD JxwvKpxX+6njVo/bfJblv2Jf5CMcgcthanZkwuoXfLGvfraIPgK7WbL2Xj3jbQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6RQB4QnCzmvv; Thu, 20 Jul 2023 21:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KLwAPY052220; Thu, 20 Jul 2023 21:58:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KLwA4T052219; Thu, 20 Jul 2023 21:58:10 GMT (envelope-from git) Date: Thu, 20 Jul 2023 21:58:10 GMT Message-Id: <202307202158.36KLwA4T052219@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: 1d9722de6f90 - main - tcp_wrappers: recognize IPv6 addresses/prefixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: 1d9722de6f90c3edf286b077938bfa696e728d6c Auto-Submitted: auto-generated The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=1d9722de6f90c3edf286b077938bfa696e728d6c commit 1d9722de6f90c3edf286b077938bfa696e728d6c Author: Gleb Smirnoff AuthorDate: 2023-07-20 21:56:20 +0000 Commit: Gleb Smirnoff CommitDate: 2023-07-20 21:56:20 +0000 tcp_wrappers: recognize IPv6 addresses/prefixes Intentionally or not, but the libwrap was written in such manner that if your /etc/hosts.allow doesn't have any domain names, neither smart keywords like LOCAL or KNOWN, then it will not try to resolve the client address during the hosts check. This was achieved with the NOT_INADDR() check that matched IPv4 addresses/prefixes. Extend this to also skip resolve if client list token looks like IPv6. Reviewed by: philip, emaste PR: 269456 Differential revision: https://reviews.freebsd.org/D40070 --- contrib/tcp_wrappers/hosts_access.c | 3 ++- contrib/tcp_wrappers/tcpd.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tcp_wrappers/hosts_access.c b/contrib/tcp_wrappers/hosts_access.c index 05c62d194091..e55f3f34dd20 100644 --- a/contrib/tcp_wrappers/hosts_access.c +++ b/contrib/tcp_wrappers/hosts_access.c @@ -315,7 +315,8 @@ static int host_match(char *tok, struct host_info *host) return (masked_match(tok, mask, eval_hostaddr(host))); } else { /* anything else */ return (string_match(tok, eval_hostaddr(host)) - || (NOT_INADDR(tok) && string_match(tok, eval_hostname(host)))); + || (NOT_INADDR(tok) && NOT_INADDR6(tok) + && string_match(tok, eval_hostname(host)))); } } diff --git a/contrib/tcp_wrappers/tcpd.h b/contrib/tcp_wrappers/tcpd.h index 1078073c8e3a..194cde378c1c 100644 --- a/contrib/tcp_wrappers/tcpd.h +++ b/contrib/tcp_wrappers/tcpd.h @@ -70,6 +70,7 @@ extern char paranoid[]; #define HOSTNAME_KNOWN(s) (STR_NE((s),unknown) && STR_NE((s),paranoid)) #define NOT_INADDR(s) (s[strspn(s,"01234567890./")] != 0) +#define NOT_INADDR6(s) (strchr(s, ':') == NULL) /* Global functions. */ From nobody Thu Jul 20 22:01:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6RTt2dBJz4nrjP; Thu, 20 Jul 2023 22:01:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6RTt1sLZz44qh; Thu, 20 Jul 2023 22:01:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890482; 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=dKuVVU4Qeq29RyntSfR1qnENW4+1cyVcFnLz475rd2U=; b=BzS3qhFwwmXpHpIGSsUx6rfztMVsTkoDzpp2m4oHsdwa5zTuGC/tjQE0aj11IOVUb9DKrD lmnn3USWAiqyXJnaiJxltG06OR5+UPGq6rea0o9IcjLEVZSlVBqrc46CTKblDBWDzGl2Ii SPEdtOVJxoalwjPdyeNrZbEdsqzVoYOVa+idMASC+1B2lxy8gKj06utdZrgiw4tLsSAS9D mQdC3cjdwCu0sdzvxLSISwXTtQs8STNGLs/m8iX6Pkl5BhOgaqg157sYgNQhVQcpdZrCtK +5UGg5ULowBS+Ou3Q8hRHtHrLRkQJaWLn9ZsC550fn1Jm0ld1fSk1McDfWmHNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689890482; 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=dKuVVU4Qeq29RyntSfR1qnENW4+1cyVcFnLz475rd2U=; b=i69TTxJzlRnVWHPMIgXj0kmE6nRhktcM5SaF/XIsahpp2oSklcS9dFSfad68DtiIbgec01 Jzb09UpQtLlzQD3Ed/juksQVglM22zFCoxm1+GpbsZHyz/g7b2dPjdr6UaA91f4VVTQ7uc uwF7tvS9z2E5XJCEPUUxU7iea3vZvj2NDkHTdYNpsovsTkuP7QvoPRY3zSC4zORVtRVVLv NYzdLKWK8d30ifb22lnSgWsGa+fv4bd6a35fRBjl93ixCJiMzjKjCq5zhvUb9Mn95Mulli XqOmcYQL5yITDmCL4lSDE2Z7zvxrO12CCvJq6u44iaNfLY92Vp810SDoSVIr6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689890482; a=rsa-sha256; cv=none; b=xwhaTAM/I1lTeXki2CpC/qPEcLBDyWCuYK64TLNX0tAMtZmiexXJACkW+Qaggwr41NDTLt 8mF1JF2GWhmEWLiNtLeZjAdL+dvHpBc1JHMgBQn0dEueRSr8HY4jYaL2MuW2FAxWEXToSM awuN62NayVCJu7tpH3xaagSxJ4YERUxP5uW/Kg6YdMV6QpzzRGaawbciL50d7H4OkTyDAY NjhVnXNG7HffEbtG7yDlusgP+9hH6SMxLLO9xODgkppLEdKNtvtHPCDMOle8+F9OXbatuW 6Dvu4ULzgTcqgE/tpAiZu3B8NAFs8rDCUwylNzvFN93rhSdHGqGxHSKzduueyw== Received: from [10.9.4.95] (unknown [209.182.120.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: kevans/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4R6RTs63qFzdcD; Thu, 20 Jul 2023 22:01:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Message-ID: <8a6a773d-d07d-2ddf-efae-31298954176a@FreeBSD.org> Date: Thu, 20 Jul 2023 17:01:21 -0500 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: git: 3cbc8e752b92 - main - tftpd: fix double-colon typo in option string Content-Language: en-US To: Dmitry Morozovsky Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202307202128.36KLSFbX002922@gitrepo.freebsd.org> <9d273ea1-e225-ee4d-73a4-632e0ff1d59d@FreeBSD.org> From: Kyle Evans In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/20/23 16:40, Dmitry Morozovsky wrote: > On Thu, 20 Jul 2023, Kyle Evans wrote: > >> On 7/20/23 16:28, Dmitry Morozovsky wrote: >>> The branch main has been updated by marck: >>> >>> URL: >>> https://cgit.FreeBSD.org/src/commit/?id=3cbc8e752b92442c784306731e94fd904de3373c >>> >>> commit 3cbc8e752b92442c784306731e94fd904de3373c >>> Author: Dmitry Morozovsky >>> AuthorDate: 2023-07-20 21:24:28 +0000 >>> Commit: Dmitry Morozovsky >>> CommitDate: 2023-07-20 21:24:28 +0000 >>> >>> tftpd: fix double-colon typo in option string >>> MFC after: 1 month >>> X-MFC-With: 273a307d0b80743fb08e23237b3f74dc94a8fa2a >>> X-MFC-With: 03c2616dc530e5b23f06f9aa421012154590e578 >> >> Er, this wasn't a bug. -d takes an optional argument, which is indicated with >> a double colon. > > Ah I see now, overlooked somehow. > > Will revert, sorry for the noise > > Thanks! From nobody Thu Jul 20 22:37:38 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6SHl0F6Pz4dZ1n; Thu, 20 Jul 2023 22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6SHk6mjVz4Fml; Thu, 20 Jul 2023 22: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=1689892659; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq4pEaSs314yab6KMoV9rbyX3xcH1nswkBaKozWKGeU=; b=eXOSr0p2X28TzdC2EHe6LAeWmd3omJPravJwgw8EvPGusnMRjeJw5U+W6EZqzagQpGOQ72 cNNnxnMRT3T8wFJnHKePfrVXYI1mT9sJOHXbxsNU5psogfBX4zPRxiAPMPRP+l39pQQdlG DqtWj3wSzBjumvO2R2dfo873zRVcNnTxQGOEv16Tw9u3uS2t70nwCLyDRQ4GCw40CSdt5p OHx4eVJEa+oqvHpzHkbukrhbfp10CIiHgK2gUu6UanYCzCfQosdVXjL51T0pt52NSf4t/P bHm1yxzgMEPI1IsJsjX81b5HNUYx57bhntPB+aDkAzholhS3AkHrgU4pajM75g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689892658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wq4pEaSs314yab6KMoV9rbyX3xcH1nswkBaKozWKGeU=; b=J6tc/fWSPnWpx7PURbwM+LpHjwbXBwBVQ2r9rtRjHggLvTs1yyg7MS0/qIpl4pae2IsbWu DRupVaUO6y9wMSMDfN4cE/QUtYot0ySc4/OXPY44XD5RL9lcoPJ87I27B5SEXmUpBZNrLH bcZybTzGzjxGaGpIA6BvOPxMG6jgboIJAzFooRDkNi7DqMeRPeae8zk17KlYuWzgmeFgpl B7rVv3Z2Q+LadcYAVXzdVfzOe1XnRO/BM2pLeJc9wAHGDNPf87G5qd3yPPOPDlrny4hPgB Pdm/UtlRe4thJqWe3FHz6jRTW6pqmDjtFyPsYPG7MNfZ1cwPQddjqirmbTlB8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689892658; a=rsa-sha256; cv=none; b=NHP+6b6WHHqBPPLrs7aXB1BDBpYXptTuiU13sqhqLt3t/BiyElZ9xcNj+6nBM6gNPxBtL3 bKXCV3rr+oNik4+fVAGrwitmNtPqBeWEEoOlXCU8N4xTzgczkJCBG7NLWpO4zZpqyEUdh5 cCZKshFtQEPSC6Kf680hVD/Rh4Hl4YTSbzvGt5m3EmrRnIDeue/xnWOvTUEXxXNqsvd8cs X2AjHHFZvznkzJ8vrBUMfmFkQMJYJK/RlM+Q5TOLZQRUJVFiQxsyEdlHrl90sDtN6vw6Ya c5XRF0P3Pn3r62skaXosUgX8NBQUJOHMYR/x5D8NC2K3onZ2ogdXXl9BoZyArg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6SHk5m0szpBL; Thu, 20 Jul 2023 22:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KMbcNg018310; Thu, 20 Jul 2023 22:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KMbcVY018309; Thu, 20 Jul 2023 22:37:38 GMT (envelope-from git) Date: Thu, 20 Jul 2023 22:37:38 GMT Message-Id: <202307202237.36KMbcVY018309@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: ba2f531f816a - main - ixl(4): Add link state polling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 Auto-Submitted: auto-generated The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 commit ba2f531f816a6bc1ef5f2cba4a329ff7bdbec0f3 Author: Krzysztof Galazka AuthorDate: 2023-07-20 22:33:52 +0000 Commit: Eric Joyner CommitDate: 2023-07-20 22:33:52 +0000 ixl(4): Add link state polling In some cases driver may ask FW about link state before FW finishes configuration of a (Q)SFP+ transceiver. If first attempt of using Get Link Status AQC after loading driver or handling a reset fails, then re-try periodically for 5 seconds. Signed-off-by: Krzysztof Galazka Signed-off-by: Eric Joyner Tested by: jeffrey.e.pieper@intel.com Approved by: erj@ MFC after: 2 days Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40899 --- sys/dev/ixl/i40e_adminq_cmd.h | 2 +- sys/dev/ixl/if_ixl.c | 50 ++++++++++++++++++++++++++++++++++++------- sys/dev/ixl/ixl.h | 2 ++ sys/dev/ixl/ixl_debug.h | 2 ++ sys/dev/ixl/ixl_pf.h | 4 ++++ sys/dev/ixl/ixl_pf_iflib.c | 4 +--- sys/dev/ixl/ixl_pf_main.c | 30 ++++++++++++++++++++------ 7 files changed, 75 insertions(+), 19 deletions(-) diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h index 564a076761d0..679e191412cd 100644 --- a/sys/dev/ixl/i40e_adminq_cmd.h +++ b/sys/dev/ixl/i40e_adminq_cmd.h @@ -44,7 +44,7 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 #define I40E_FW_API_VERSION_MINOR_X722 0x000C -#define I40E_FW_API_VERSION_MINOR_X710 0x000E +#define I40E_FW_API_VERSION_MINOR_X710 0x000F #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index 7ebbed1f81c8..6e1a3e3e2229 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -444,6 +444,29 @@ ixl_admin_timer(void *arg) { struct ixl_pf *pf = (struct ixl_pf *)arg; + if (ixl_test_state(&pf->state, IXL_STATE_LINK_POLLING)) { + struct i40e_hw *hw = &pf->hw; + sbintime_t stime; + enum i40e_status_code status; + + hw->phy.get_link_info = TRUE; + status = i40e_get_link_status(hw, &pf->link_up); + if (status == I40E_SUCCESS) { + ixl_clear_state(&pf->state, IXL_STATE_LINK_POLLING); + /* OS link info is updated in the admin task */ + } else { + device_printf(pf->dev, + "%s: i40e_get_link_status status %s, aq error %s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + stime = getsbinuptime(); + if (stime - pf->link_poll_start > IXL_PF_MAX_LINK_POLL) { + device_printf(pf->dev, "Polling link status failed\n"); + ixl_clear_state(&pf->state, IXL_STATE_LINK_POLLING); + } + } + } + /* Fire off the admin task */ iflib_admin_intr_deferred(pf->vsi.ctx); @@ -706,12 +729,6 @@ ixl_if_attach_post(if_ctx_t ctx) return (0); } - /* Determine link state */ - if (ixl_attach_get_link_status(pf)) { - error = EINVAL; - goto err; - } - error = ixl_switch_config(pf); if (error) { device_printf(dev, "Initial ixl_switch_config() failed: %d\n", @@ -740,6 +757,11 @@ ixl_if_attach_post(if_ctx_t ctx) device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", pf->qtag.num_allocated, pf->qtag.num_active); + /* Determine link state */ + error = ixl_attach_get_link_status(pf); + if (error == EINVAL) + goto err; + /* Limit PHY interrupts to link, autoneg, and modules failure */ status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, NULL); @@ -775,8 +797,20 @@ ixl_if_attach_post(if_ctx_t ctx) ixl_set_link(pf, ixl_test_state(&pf->state, IXL_STATE_LINK_ACTIVE_ON_DOWN)); hw->phy.get_link_info = true; - i40e_get_link_status(hw, &pf->link_up); - ixl_update_link_status(pf); + status = i40e_get_link_status(hw, &pf->link_up); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s get link status, status: %s aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + /* + * Most probably FW has not finished configuring PHY. + * Retry periodically in a timer callback. + */ + ixl_set_state(&pf->state, IXL_STATE_LINK_POLLING); + pf->link_poll_start = getsbinuptime(); + } else + ixl_update_link_status(pf); #ifdef PCI_IOV ixl_initialize_sriov(pf); diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h index 30e8ce40126b..03a1fa46fa65 100644 --- a/sys/dev/ixl/ixl.h +++ b/sys/dev/ixl/ixl.h @@ -286,6 +286,8 @@ /* For stats sysctl naming */ #define IXL_QUEUE_NAME_LEN 32 +#define IXL_PF_MAX_LINK_POLL SBT_1S * 5 + MALLOC_DECLARE(M_IXL); #define IXL_DEV_ERR(_dev, _format, ...) \ diff --git a/sys/dev/ixl/ixl_debug.h b/sys/dev/ixl/ixl_debug.h index 0d8c624d2df9..818ba8a1df83 100644 --- a/sys/dev/ixl/ixl_debug.h +++ b/sys/dev/ixl/ixl_debug.h @@ -101,6 +101,8 @@ enum ixl_dbg_mask { IXL_DBG_SWITCH_INFO = 0x00010000, IXL_DBG_I2C = 0x00020000, + IXL_DBG_LINK = 0x00100000, + IXL_DBG_ALL = 0xFFFFFFFF }; diff --git a/sys/dev/ixl/ixl_pf.h b/sys/dev/ixl/ixl_pf.h index 80b35fcb6696..9a786845be13 100644 --- a/sys/dev/ixl/ixl_pf.h +++ b/sys/dev/ixl/ixl_pf.h @@ -89,6 +89,7 @@ enum ixl_state { IXL_STATE_FW_LLDP_DISABLED = 9, IXL_STATE_EEE_ENABLED = 10, IXL_STATE_LINK_ACTIVE_ON_DOWN = 11, + IXL_STATE_LINK_POLLING = 12, }; #define IXL_PF_IN_RECOVERY_MODE(pf) \ @@ -172,6 +173,8 @@ struct ixl_pf { int num_vfs; uint16_t veb_seid; int vc_debug_lvl; + + sbintime_t link_poll_start; }; /* @@ -282,6 +285,7 @@ struct ixl_pf { #define ixl_dbg_info(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_INFO, s, ##__VA_ARGS__) #define ixl_dbg_filter(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_FILTER, s, ##__VA_ARGS__) #define ixl_dbg_iov(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_IOV, s, ##__VA_ARGS__) +#define ixl_dbg_link(pf, s, ...) ixl_debug_core((pf)->dev, (pf)->dbg_mask, IXL_DBG_LINK, s, ##__VA_ARGS__) /* PF-only function declarations */ void ixl_set_state(volatile u32 *s, enum ixl_state bit); diff --git a/sys/dev/ixl/ixl_pf_iflib.c b/sys/dev/ixl/ixl_pf_iflib.c index e0452c7dc01e..a0b450dc038b 100644 --- a/sys/dev/ixl/ixl_pf_iflib.c +++ b/sys/dev/ixl/ixl_pf_iflib.c @@ -1028,9 +1028,7 @@ ixl_rebuild_hw_structs_after_reset(struct ixl_pf *pf, bool is_up) i40e_aq_set_vsi_broadcast(&pf->hw, vsi->seid, TRUE, NULL); /* Determine link state */ - if (ixl_attach_get_link_status(pf)) { - error = EINVAL; - } + ixl_attach_get_link_status(pf); i40e_aq_set_dcb_parameters(hw, TRUE, NULL); diff --git a/sys/dev/ixl/ixl_pf_main.c b/sys/dev/ixl/ixl_pf_main.c index 1ba59c0592a7..13ba4c5f5d17 100644 --- a/sys/dev/ixl/ixl_pf_main.c +++ b/sys/dev/ixl/ixl_pf_main.c @@ -4705,22 +4705,38 @@ ixl_attach_get_link_status(struct ixl_pf *pf) { struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - int error = 0; + enum i40e_status_code status; if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || (hw->aq.fw_maj_ver < 4)) { i40e_msec_delay(75); - error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); - if (error) { - device_printf(dev, "link restart failed, aq_err=%d\n", - pf->hw.aq.asq_last_status); - return error; + status = i40e_aq_set_link_restart_an(hw, TRUE, NULL); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s link restart failed status: %s, aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + return (EINVAL); } } /* Determine link state */ hw->phy.get_link_info = TRUE; - i40e_get_link_status(hw, &pf->link_up); + status = i40e_get_link_status(hw, &pf->link_up); + if (status != I40E_SUCCESS) { + device_printf(dev, + "%s get link status, status: %s aq_err=%s\n", + __func__, i40e_stat_str(hw, status), + i40e_aq_str(hw, hw->aq.asq_last_status)); + /* + * Most probably FW has not finished configuring PHY. + * Retry periodically in a timer callback. + */ + ixl_set_state(&pf->state, IXL_STATE_LINK_POLLING); + pf->link_poll_start = getsbinuptime(); + return (EAGAIN); + } + ixl_dbg_link(pf, "%s link_up: %d\n", __func__, pf->link_up); /* Flow Control mode not set by user, read current FW settings */ if (pf->fc == -1) From nobody Thu Jul 20 22:48:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6SX05Ks6z4nMCy; Thu, 20 Jul 2023 22:48: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6SX04RFkz4JRF; Thu, 20 Jul 2023 22:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689893296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hS8tBplio4u4/blk02KWGHgVtjPTeIURkTcPkiMHtew=; b=aeXcjPsW9CqPLHcPVkL9d1YtDmb6UwZ4JZtJrXPa2XjQjUV2o4dU9jnWeM/hOzY4fihd9G xmwpXB2hSHbY/40aIHDZ/JoJ79CAYfsuFoHmBLW/gBZ1mbHW/HYz5x3OTX9LycE4wZBy7n J/W7k6jFU1TDj96nagc+mYq1vueNE7MWr/ypRNxHQgTdAQxQ1PWr3rPJMO+dtu2JBTLO2p WhIWwpgKB/ujKsvC7v+QmPooKFC98wvaUUJkprx6e1Z6oqcqfV+gOZmOatclSJlVFdcbTb YfLprs6s+1dlOHFRPFGhEfHbGpoTspXTzsPrIJiRXSmOY/n7qk20gfrW6ZYVTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689893296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hS8tBplio4u4/blk02KWGHgVtjPTeIURkTcPkiMHtew=; b=Uke/J0KNHGluN/KAygTjZ8t//SJmZNJNLkBgY9ijGHQxAM5IITJwiPaTvsJC76lHSYerVy ShS2nQF29Hcgu0W/3/qRKOL/V21j0i8rwsD905hUe183HpzQJgHZLyYMOdZtu0076EluQp qm1zeeaSlIbrdrGLTMfR9tFGMcB4BZUuxiHIRpKU/h52AJvyWEW/ysF49ni0VdBWr+ZLsw PpBqYTK2UAhSnGkAOMfoL/ZGd5332aDomCrOJfwm9gPBNR6tmeBz1IQM9/NiqI4sg+LFkV e5fO/G0lGVCfrKrgUl3LMepXp+L92Zgmh+zvj4cPtJOq7XroyyMTvSWCFjSs/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689893296; a=rsa-sha256; cv=none; b=OWsO4j37ygs7/WqlzQC1DouUFbn5NFD1oKp9iwDhWvdvku7BQvIRodLsGjNyc3HZHV3nLg nwNSW3mXf/j7Aknw3o3F1czU/TokNnEejW/5sTBESlYYHGNPMEXzmdlqAg958zM7kNCGb1 ndZTFvlxNMRA4H/22kOjWFD5Zwwzkgcx8Q1cTsDDbV82R7bvOYarMrAfPGjH3+cfexS/EB p1LEwRSWu7KHU9W1HCzcnrw2kdY80dpOArE0M7RAIziDyuDYK4FQIj4W2xF55DDSdFNpTs pbbOO7Gir/PS9iowny/S/14Q0ZLCL1jbQuVKi1CqTATU7ICStqraI8A9OW0QTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6SX03Pg7zpQ7; Thu, 20 Jul 2023 22:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KMmGcZ035257; Thu, 20 Jul 2023 22:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KMmGEW035256; Thu, 20 Jul 2023 22:48:16 GMT (envelope-from git) Date: Thu, 20 Jul 2023 22:48:16 GMT Message-Id: <202307202248.36KMmGEW035256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 93f39b467586 - stable/13 - iflib: Unlock ctx lock around call to ether_ifattach() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 93f39b4675865094b298e1fca5bcfa788348dd36 Auto-Submitted: auto-generated The branch stable/13 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=93f39b4675865094b298e1fca5bcfa788348dd36 commit 93f39b4675865094b298e1fca5bcfa788348dd36 Author: Przemyslaw Lewandowski AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner CommitDate: 2023-07-20 22:42:22 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner PR: 271768 Reviewed by: erj@, jhb@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 (cherry picked from commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d) --- sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 748970a58f3f..cba931f1b2a7 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5349,7 +5349,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct goto fail_queues; } + /* + * It prevents a double-locking panic with iflib_media_status when + * the driver loads. + */ + CTX_UNLOCK(ctx); ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac.octet); + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); From nobody Thu Jul 20 22:57:04 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Sk870KYz4nSMn; Thu, 20 Jul 2023 22:57: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Sk85QVZz4MVZ; Thu, 20 Jul 2023 22:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689893824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OSsIJ/Oxp3ejbjueSTSEByzC6kR5zpgkh0CD6dbFT0w=; b=AnrjmpAZ6NOk7HFfwWB9hvgK4r6J1fobSWYnRBUypr799QMZXFwma/iKNya2FYoSKf2VUs cOFHbSUEIIFX+GMLL5SDtRSvB1G1YV83DcO+Jo5D32f4VgLeC177/ym7ydvQkql83LvlA4 SZd1C9pLK1mxu6DeTm1QlFbx3lBERcewEcdzYvKU6u2H8n6dezFctv013x120QApQat85z N2/5Tnm9BRKgmk8TpyHka3kDR893VtLanWYVkFp6ouwxbEz2rCxWssRFyxNmBfcFoje0xG h5VXLLFp0x0WqpkyE1hxpJ/wtdscXlOTZU3kIvVeDZprOh5yoV4WNOVbcfyDmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689893824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OSsIJ/Oxp3ejbjueSTSEByzC6kR5zpgkh0CD6dbFT0w=; b=JschjQPjlpVELdZFx+omD17avXmbZkMuW0Ykke/h/1F+HeO48qGbPvHlId8o7LlkHsiysO eXgVpWksfh+gfwoZOhqYUa15ibeRx7DyCf1MhRrsmssNvc7QKYyAn40eYqKQsZ4/kRtrls 5TF7yBLvU6zqtvU8R8GQ9Torusa9LPVK+lzet5ZkYbC4hZvORFTIu/ssDJTIOl1WNY6Uek WTBGrJ1oO6jGYgiuMjgauxIK4+Ib5v8343isuF4++5jE95yuDHuKJJXnbUcJUfjXDk/GY0 hd4TpXOJB7kDsBdzucYdRDp+DiEYGhQKH8IeMORrzQgKFSERFmr3ABDbtmSz0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689893824; a=rsa-sha256; cv=none; b=Ruf5wOpNMHpYOpmL93Dqo/HWZBNSylWG1/uhj89d0Ua5lpLP/QX9vtPd3ygOlkpjzQWNYM Y9fPsGcG3WfJUKJWuO5lmjCILwFNpq9Iu1B5eu7rx5VZTMo6BoUz+RfQrwiftmpTcqxaOh 2ivF82PsHYeiJyJCkJCwYh+rto9mxTkrOD7FZtbK3rkvJnO2et88POvb9e+tMP9CyXW8rr vT3+3nHUz+AqOm4MWvvUUv3x4wAtkdXhxHzqPnSSEnJuj+buAs6cUMCY2Lc2STKnpzbWZ5 UqDA+UK1U7r1ZOU5f+bDV/oU+90usUHJkBDBnfSv6KzyGnmxBPbh4wWKGArQ3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6Sk84VGDzpR6; Thu, 20 Jul 2023 22:57:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KMv4Mw051042; Thu, 20 Jul 2023 22:57:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KMv4Aq051041; Thu, 20 Jul 2023 22:57:04 GMT (envelope-from git) Date: Thu, 20 Jul 2023 22:57:04 GMT Message-Id: <202307202257.36KMv4Aq051041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eric Joyner Subject: git: 2617bca5a8c9 - stable/12 - iflib: Unlock ctx lock around call to ether_ifattach() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2617bca5a8c98e9e84fba3f2ebd9302e8e893b8f Auto-Submitted: auto-generated The branch stable/12 has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=2617bca5a8c98e9e84fba3f2ebd9302e8e893b8f commit 2617bca5a8c98e9e84fba3f2ebd9302e8e893b8f Author: Przemyslaw Lewandowski AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner CommitDate: 2023-07-20 22:56:41 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner PR: 271768 Reviewed by: erj@, jhb@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 (cherry picked from commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d) --- sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 3690be2b2a77..da4cc9addbe9 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5196,7 +5196,13 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct goto fail_queues; } + /* + * It prevents a double-locking panic with iflib_media_status when + * the driver loads. + */ + CTX_UNLOCK(ctx); ether_ifattach(ctx->ifc_ifp, ctx->ifc_mac); + CTX_LOCK(ctx); if ((err = IFDI_ATTACH_POST(ctx)) != 0) { device_printf(dev, "IFDI_ATTACH_POST failed %d\n", err); From nobody Thu Jul 20 23:19:53 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6TDV1dv0z4nkNX; Thu, 20 Jul 2023 23:19: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6TDV1BLlz3FL4; Thu, 20 Jul 2023 23:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689895194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d9YbcgUbv4ARI2yKHuSfjMdGqDOcicYFNCnH7uacLk=; b=ftL5CApu9K0l9w43xY2IHNJQtX3X1aNSCjq7Ijq9HdPc02qjGl8TftGeQaB3M+5yPAIWEg F6GlJob43rsr3FKTotVjBmdHyWQEYat1SVZhAtTVrxeZC6pCZ5NF6Nt2ICv+RbV24L0MJO tM7VpEMoPNdko8PTC8XE4xrew9nU7x8Pvp2UGyRGrW1KEIGSnpyvz0ioQhW0fCVd+bPo6k Yc5OkEXbhJujt399eQ3ERCfiPO6Mbj3enKlOEiuiJIXsaCBXuidGWMPUeOQ3quW0uJEQ15 njz4E03o7mhZYS4qT+WHDetqdy6lLY6mJBIpQ59dbLq5ccVnRSFC8o7f/Kec8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689895194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0d9YbcgUbv4ARI2yKHuSfjMdGqDOcicYFNCnH7uacLk=; b=ZebBr/LzAv+MSj+b5LrTlU6XVpF4ric02ocymVaLFNYCyW6kVg5e2Iahq/SPmWN3HzNeTM t4Y3CYn3Zz059AmiwHh48zY1g2A6tYSK0+cPtaGJJxAJzzHtomdTogM8Ss4XtXlt4kXYX2 QeRjGBjSVbei7LgV7Kg/Ur7ivrL1jxW9/YfMX5XyiPV8zrqV25tipLpfy3x+FxTEfDHZKn ociHXOkE7D8le90lQeBzydTc5SHYD58P1nyh59Xw7N3nxAdadDMrk+4fx1Qa/1OJoKdCSR csMmcbEA/VCyhliVER1ibBp6Qhhs8sx+G4GoGMAXhqVR25U84S+gYeKYH5P7vw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689895194; a=rsa-sha256; cv=none; b=DljvRvH12v8CuXGXy4KwcXJuAge4a7Meg/lnCgnv+WzuySzseeHrfzI1JmjLVc0cKWk0b0 xJX02C5Y6wRjQ44l4jJmr0DfPecLxb5YmHTFkTAODc1e/CabVS3yTQn8xzozuaye5UoNmB vsjIUwChY2diw1iBca9lOyqDr291o6QAoiHTS/kDVKrAJMT60sgAzIXdcwmogHLoT2PgLu DGlU2OciMLFGeIUrp9btM0APOC6NGzXnyz39ANPaMRgVaGKrHnAL6MpqXc8/3Ugxq7Uu+M ropdnboXMgeQQp2dZcimCYqL/1KvVDSJAVx7wfWs5Py7PFKNE2BrqXPYCysZ/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 4R6TDV0BNTzq4F; Thu, 20 Jul 2023 23:19:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KNJrSW085668; Thu, 20 Jul 2023 23:19:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KNJriX085667; Thu, 20 Jul 2023 23:19:53 GMT (envelope-from git) Date: Thu, 20 Jul 2023 23:19:53 GMT Message-Id: <202307202319.36KNJriX085667@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: 59dc489a7e03 - main - mpr: Fix minor 'typos' comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59dc489a7e034674c3f52c56c95851bf31dc790b Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=59dc489a7e034674c3f52c56c95851bf31dc790b commit 59dc489a7e034674c3f52c56c95851bf31dc790b Author: Warner Losh AuthorDate: 2023-07-20 23:16:04 +0000 Commit: Warner Losh CommitDate: 2023-07-20 23:18:28 +0000 mpr: Fix minor 'typos' comment moving -> removing (we're removing the device) CAM_REQ_CMO_ERROR -> CAM_REQ_ERR (the former isn't a thing) Sponsored by: Netflix --- sys/dev/mpr/mpr_sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index dd630d212b7f..06dbed57dbac 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -2767,13 +2767,13 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm) * count by returning CAM_REQUEUE_REQ. Unfortunately, if * we hit a persistent drive problem that returns one of * these error codes, we would retry indefinitely. So, - * return CAM_REQ_CMP_ERROR so that we decrement the retry + * return CAM_REQ_CMP_ERR so that we decrement the retry * count and avoid infinite retries. We're taking the * potential risk of flagging false failures in the event * of a topology-related error (e.g. a SAS expander problem * causes a command addressed to a drive to fail), but * avoiding getting into an infinite retry loop. However, - * if we get them while were moving a device, we should + * if we get them while were removing a device, we should * fail the request as 'not there' because the device * is effectively gone. */ From nobody Thu Jul 20 23:37:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6TdH0qsdz4nwcX; Thu, 20 Jul 2023 23:37: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6TdH0PMcz3Ky3; Thu, 20 Jul 2023 23:37:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689896275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcpzZ30aTfZ/sI6yrCcrprm4fohInWRHCwNJym9I2bY=; b=BnN/3YZSy4+mqOnhGM0zOMOEe+0uF1M/TYVVlsG8q6wiCxMTg41AoK5l7R8y6bRFcdA0YD pxMvkivaFpb+taWErFqi8/PD95aYQZWxV5VxN4lHHWMXkVeP9VJW4hNIJY5VT46cCl3IcT gPqDoQWbGlPQ7cRpVvUsPkAzrhMelm+i3rGYsiG524FOJRE7e2Ob6cFiBq2OWEQ4+inyjM XNIvowUbbRAEUOId7kla5pJ0KRm9HgJo3jZQG4bHvMMhgH74T6029hxgQrakBAM3FJ+cwn xBX46POWve5ccjtvTzG8QuSfOdkfuxE9nKvbFf/Nj5jPZsF5hQ6rUHKn7Fv5NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689896275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PcpzZ30aTfZ/sI6yrCcrprm4fohInWRHCwNJym9I2bY=; b=TnE/Qh4sUc5CxLNh50zAzRgMQxpRdtKhKsCUhUmOWGcePxoXwHFdGIv/F4kND6X2WMP7FX r3+l8eipdgUp9cq8TGx1uDmWmSWzDGnFmYyqsws7W5FyI3VpN0nAyI/bszoMPWVoVHrPEq u737sXgRY8kHPTr1DUDJowvbQr73duV0Ml4JhHK9qE45IC+Ii00mA/A4AMF3Lh9jVkXdtv 9ll+CWTXqEfTHQsquew32+86LKtdlI0R3ppI/KoXDdmyoUpEKxxsZEJPVnq6rJOp2M9qCW NdtJmMiygY8YCXkUIfGfDgGkMYphz/ytfw1VJ8eozYQ3RE80XPXvAKyFFpP8Yw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689896275; a=rsa-sha256; cv=none; b=RI2665/n2fpWYM9aSFaVomerH/9xiNCh3LPZVFMAB8K0q+TxTNdEWljPbmt7Se1vQrB3ua JkntN6Z2NJBf+NdcjYrhP8heRsZES4KBH+r/Uv/jdJzahaZG+9gT7qyzPg/Li5VqjcwCLz WUovB0Y79Qs/PBWdNF48nhEeomT+EM3xvSeMoP909WzbaSD4ZrikdQCOs/prsvdP1KFKGB IWc2lc7UpdbOT+JhEkS50Zc1irRLWJrQeGebaPWSG4J26wIAr2WM7T+JkB2bkUsigdZ4ep ceLJ9Ne8CTYYEbAgqCvvMm+QS3LK1grMeTNqMs0gbyTeWzgyJQozhNTpDg7zLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6TdG69HMzqdZ; Thu, 20 Jul 2023 23:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36KNbsvb017456; Thu, 20 Jul 2023 23:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36KNbspb017454; Thu, 20 Jul 2023 23:37:54 GMT (envelope-from git) Date: Thu, 20 Jul 2023 23:37:54 GMT Message-Id: <202307202337.36KNbspb017454@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: 92053e4f8ae5 - main - share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92053e4f8ae5f6659db7a8fae016f46bb5447bf8 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=92053e4f8ae5f6659db7a8fae016f46bb5447bf8 commit 92053e4f8ae5f6659db7a8fae016f46bb5447bf8 Author: John Baldwin AuthorDate: 2023-07-20 23:36:35 +0000 Commit: John Baldwin CommitDate: 2023-07-20 23:37:46 +0000 share/mk: Pass -znoexecstack to ld.bfd when linking libraries and programs. lld assumes -znoexecstack by default whereas ld.bfd still defaults to -zexecstack in the absence of .note.GNU-stack annotations. Adding the flags centrally avoids having to patch various libraries in the tree as one-offs (e.g. OpenSSL 3 is the current thing generating new warnings with ld.bfd). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D41120 --- share/mk/bsd.lib.mk | 2 ++ share/mk/bsd.prog.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index dfaf554a3619..a58114af43c4 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -95,6 +95,8 @@ LDFLAGS+= -Wl,-zretpolineplt .warning Retpoline requested but not supported by compiler or linker .endif .endif +# LLD sensibly defaults to -znoexecstack, so do the same for BFD +LDFLAGS.bfd+= -Wl,-znoexecstack # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 6f1079944914..f61331aeaa90 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -68,6 +68,8 @@ LDFLAGS+= -Wl,-zretpolineplt .warning Retpoline requested but not supported by compiler or linker .endif .endif +# LLD sensibly defaults to -znoexecstack, so do the same for BFD +LDFLAGS.bfd+= -Wl,-znoexecstack # Initialize stack variables on function entry .if ${MK_INIT_ALL_ZERO} == "yes" From nobody Thu Jul 20 23:38:05 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6Tdk68yYz4nwxJ for ; Thu, 20 Jul 2023 23:38:18 +0000 (UTC) (envelope-from erj@erj.cc) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6Tdk4YQ6z3L7d for ; Thu, 20 Jul 2023 23:38:18 +0000 (UTC) (envelope-from erj@erj.cc) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-51e48e1f6d1so1783995a12.1 for ; Thu, 20 Jul 2023 16:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=erj.cc; s=google; t=1689896296; x=1690501096; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SI5Gwl0uVqt2IrClHTT/jG2mSMkpMwMaFmoHerpwO8M=; b=bjQIfcupUdJ3Yn7V2ZMetRe+MllgcKQwJrCoFQXwyh//mm7O4aERnCPeU0ke+CfT5o mmUeX8fVxG8bY3qrlCjjQBklCws3/Z6aYu9Grv3bQP7s4AwUCkmm05P24mfBUHJ7YrKg vbZk19ZO+c69sHh5tl0TbbP86ktpQ3b6S6Ce/f0PzCoQlp2hABYBgCVce8YSjws/NmUk pSJwvbwIjlqEREuJU+bB71STnYiVVC8heyk/qa1WV93mSS9R0AKigbxHI/wynBZX0qVW 65MbTrs9aDwpbNj+rDgLmfecjkWzL3N+n2reaR/zvwZf12hjgFZaueAZy0EUgpyU93zc rXZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689896296; x=1690501096; 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=SI5Gwl0uVqt2IrClHTT/jG2mSMkpMwMaFmoHerpwO8M=; b=UBT9S5Q6fK4KzDYKXro5maeJTY+gtncxVCvtfUHbsSr0mtLnLF2W6k33ANz9qtqOo9 Xb5Hquu12SGQ4aGzFGymANou0AZzQi1/KxPnJ1wuxN3iaEggv/wlYthjF4iHZ24gYLYW vZvZ6EDkcUMkB01eZCDXzk0Ikf0Z+YVspyto/m1jD9d7ix/DkYwWqy1zGnBXjDW7b8J6 ubPNLuCo9vP11K5+t29P4hHLZfKyLd4ivXkjyJ1vagAu7uxZ70lLHPL+qtTDWPWVtfMj rAqkTvs6F8zZzBpQVvP56nnBixPedYqHbPWyqwGlN8WSicIMyk/Pw1gZiwXlOKs5HYWH 1cAw== X-Gm-Message-State: ABy/qLYWfT2PIVkVUXSn3/kgoLZpnGBRYW8rKTDY/MeIXlJ9ic8CEsdB ZZiayPfR2rG/oa7WXCE5TjaZlsMslelsN8Iy9XFEX2Jn+EfwtsJd X-Google-Smtp-Source: APBJJlHznXG/nslUoNDTR60fMJD09npyRMVAsHJHfgaIFENJjrr43831HdoJHgHL6mTNF64uJTHcjsnQKuHlV3L8jh8= X-Received: by 2002:aa7:cd69:0:b0:51e:126a:403a with SMTP id ca9-20020aa7cd69000000b0051e126a403amr223316edb.13.1689896296090; Thu, 20 Jul 2023 16:38:16 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202307201739.36KHddue021046@gitrepo.freebsd.org> In-Reply-To: <202307201739.36KHddue021046@gitrepo.freebsd.org> From: Eric Joyner Date: Thu, 20 Jul 2023 16:38:05 -0700 Message-ID: Subject: Re: git: e0a63d875eeb - main - pciconf: add PCIe 5.0 and PCIe 6.0 link speeds To: Ed Maste Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="0000000000006fa3600600f3a421" X-Rspamd-Queue-Id: 4R6Tdk4YQ6z3L7d X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated --0000000000006fa3600600f3a421 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sweet! I can't wait to see these speeds reported on devices. :p - Eric On Thu, Jul 20, 2023 at 10:39=E2=80=AFAM Ed Maste wrot= e: > The branch main has been updated by emaste: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3De0a63d875eeb630092034808b0795a9= 35d5c0934 > > commit e0a63d875eeb630092034808b0795a935d5c0934 > Author: Ed Maste > AuthorDate: 2023-06-21 20:23:18 +0000 > Commit: Ed Maste > CommitDate: 2023-07-20 17:39:17 +0000 > > pciconf: add PCIe 5.0 and PCIe 6.0 link speeds > > Reviewed by: jhb > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D40710 > --- > usr.sbin/pciconf/cap.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c > index 3d28fe9bc331..9cae4bc49e03 100644 > --- a/usr.sbin/pciconf/cap.c > +++ b/usr.sbin/pciconf/cap.c > @@ -396,6 +396,10 @@ link_speed_string(uint8_t speed) > return ("8.0"); > case 4: > return ("16.0"); > + case 5: > + return ("32.0"); > + case 6: > + return ("64.0"); > default: > return ("undef"); > } > --0000000000006fa3600600f3a421 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sweet! I can't wait to see these spee= ds reported on devices. :p

- Eric

On Thu, Jul 20, 2= 023 at 10:39=E2=80=AFAM Ed Maste <= emaste@freebsd.org> wrote:
The branch main has been updated by emaste:

URL: https://cgit.= FreeBSD.org/src/commit/?id=3De0a63d875eeb630092034808b0795a935d5c0934
commit e0a63d875eeb630092034808b0795a935d5c0934
Author:=C2=A0 =C2=A0 =C2=A0Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-06-21 20:23:18 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-07-20 17:39:17 +0000

=C2=A0 =C2=A0 pciconf: add PCIe 5.0 and PCIe 6.0 link speeds

=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 jhb
=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0The FreeBSD Foundation
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd= .org/D40710
---
=C2=A0usr.sbin/pciconf/cap.c | 4 ++++
=C2=A01 file changed, 4 insertions(+)

diff --git a/usr.sbin/pciconf/cap.c b/usr.sbin/pciconf/cap.c
index 3d28fe9bc331..9cae4bc49e03 100644
--- a/usr.sbin/pciconf/cap.c
+++ b/usr.sbin/pciconf/cap.c
@@ -396,6 +396,10 @@ link_speed_string(uint8_t speed)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("8.0&q= uot;);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 case 4:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("16.0&= quot;);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0case 5:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ("32.0&= quot;);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0case 6:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return ("64.0&= quot;);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 default:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ("undef= ");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
--0000000000006fa3600600f3a421-- From nobody Fri Jul 21 03:44:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6b603LKfz4dVkS; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6b602pGxz3Jjf; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=PhmHAmayIo9AR2DKWeU+rQ3HsnlLtfQ7LKHO1RKFm6F/Qt8CTHpegHt9Nirw0fFtPjXUT8 buUbfPPupQRizoGyrK59OY9mJYXSoStzL8UCS8gchgVtO9toMEh7PNp7EY0o/Kf9DsEokl dN4Q5BElLxrRImdBzYfIthHeUWMIdhi69+zutwV7guXRa5RmxKOxLdOT2rtWJzvBojimC2 bBWcpeOgsGQOfQLxNk+nf7F3WEZh4d7rEfbVlCFxYX96MkNZ+fbEGybX/BN78lR20HgqxQ S2KyE7YmBtvkAydOIuEcIu0MgpMjcAJfZDqWpZ3lGN6/xv/2xWY5omH4BKaFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51EnNNOkUi4h0MTVVygw4S4m0muT8RKFgQ7+f3LfjVM=; b=J2zBBD3vlA9H+YBE8/xlSQnsCpsyHf+w3U1E7I2BQyJmaAIhyMDzz0Js9Ncxc7uqdGxwVM yNUZPa7IofWIo2Uz894rgvNLeoxB7OWEXEp4+RkyrIzCY74QKky6xDR8aFxicM1JZja1zg 38XlnvqQQuVkNVtxd8hOWs+bCB7J1CNBXll0n/dF/FsC4++HCsrPgoNUYc6pEEYy9fxo1i 3nU8w2ZypBq7FP3iAexUk52UkobJ/gW4RBop7tnjQvIiHir07QNhuUkCS+OAPMxHPZjKQZ j4p8/qkY64SzgCR/02WzAt9I+iAIBo9XH2vTh02JXik/tdYJ2cAEjfXDs8DdLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689911080; a=rsa-sha256; cv=none; b=Kc1b5/mCGYHFKoSvd9uZBeZrC6C8SO0c4s9LxYT/YqUzcaA/mMkA2z6gXCGuD6egA+Y9E2 Og6KV0bbrO5Kw05iTBqdtf5+mHTzIhIcGtBJRxPWST4CP8ArYNs2y/A9Ui/QTmPE8NX8IG bZ0gstFO0vAmo1fVaVH34Mvt8ljHyIhHt781wvQHuZBym+hz1j49dc2SBsxDw3Lfl2tcqA lDWiMXJw8sUO9uKwofRF1TMGlg73mYGEhmnlMxFFfPyt+f/beYziVxV22sdsrFhgCxamOH srgFhS0hvifnFjqyeSYCYEL+sJbComff4CQywzIYoDy1OlhPe/dQ3rUT1ufAJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6b601tkxzxVm; Fri, 21 Jul 2023 03:44:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L3ieXm031611; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L3ieEP031610; Fri, 21 Jul 2023 03:44:40 GMT (envelope-from git) Date: Fri, 21 Jul 2023 03:44:40 GMT Message-Id: <202307210344.36L3ieEP031610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 201c4b7c29da - main - e1000: Some fixes for em(4) TSO setup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 201c4b7c29da44500ccb9e47b854dc1207df8b0a Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=201c4b7c29da44500ccb9e47b854dc1207df8b0a commit 201c4b7c29da44500ccb9e47b854dc1207df8b0a Author: Kevin Bowling AuthorDate: 2023-07-21 01:51:02 +0000 Commit: Kevin Bowling CommitDate: 2023-07-21 01:52:53 +0000 e1000: Some fixes for em(4) TSO setup Always set TXD_CMD_IP for 82544 Otherwise set TXD_CMD_IP for IPv4, not IPv6 Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 255aea6347d2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -141,8 +141,10 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, if_softc_ctx_t scctx = sc->shared; struct em_tx_queue *que = &sc->tx_queues[pi->ipi_qsidx]; struct tx_ring *txr = &que->txr; + struct e1000_hw *hw = &sc->hw; struct e1000_context_desc *TXD; int cur, hdr_len; + uint32_t cmd_type_len; hdr_len = pi->ipi_ehdrlen + pi->ipi_ip_hlen + pi->ipi_tcp_hlen; *txd_lower = (E1000_TXD_CMD_DEXT | /* Extended descr type */ @@ -183,12 +185,23 @@ em_tso_setup(struct e1000_softc *sc, if_pkt_info_t pi, uint32_t *txd_upper, TXD->tcp_seg_setup.fields.mss = htole16(pi->ipi_tso_segsz); TXD->tcp_seg_setup.fields.hdr_len = hdr_len; - TXD->cmd_and_length = htole32(sc->txd_cmd | - E1000_TXD_CMD_DEXT | /* Extended descr */ - E1000_TXD_CMD_TSE | /* TSE context */ - E1000_TXD_CMD_IP | /* Do IP csum */ - E1000_TXD_CMD_TCP | /* Do TCP checksum */ - (pi->ipi_len - hdr_len)); /* Total len */ + /* + * 8254x SDM4.0 page 45, and PCIe GbE SDM2.5 page 63 + * - Set up basic TUCMDs + * - Enable IP bit on 82544 + * - For others IP bit on indicates IPv4, while off indicates IPv6 + */ + cmd_type_len = sc->txd_cmd | + E1000_TXD_CMD_DEXT | /* Extended descr */ + E1000_TXD_CMD_TSE | /* TSE context */ + E1000_TXD_CMD_TCP; /* Do TCP checksum */ + if (hw->mac.type == e1000_82544) + cmd_type_len |= E1000_TXD_CMD_IP; + else if (pi->ipi_etype == ETHERTYPE_IP) + cmd_type_len |= E1000_TXD_CMD_IP; + TXD->cmd_and_length = htole32(cmd_type_len | + (pi->ipi_len - hdr_len)); /* Total len */ + txr->tx_tso = true; if (++cur == scctx->isc_ntxd[0]) { From nobody Fri Jul 21 03:44:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6b614l4Tz4dVRD; Fri, 21 Jul 2023 03:44: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6b613pFXz3JmB; Fri, 21 Jul 2023 03:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xqHPlOee36iJAzJKS7fVXfw81YbNlGXjeM9wLfkF4E=; b=QzPWTemytShlZVfd7aE+sVSpl5S/FScv14RgmUvXJWEdNpEOYaLyAOopsXw6XK47teHFsE Nbpjs3dZSnUFe7XM9Xil0GNOUB2kv4/syJiYxIJqIjIqeE4QxvFWnQfHTy3nrm5XKUXGjN kQs7Jf2qlV2B13g3cH8NrWDQJkYl58WKXMAYeZbuQIJVIexRqzJw5v4A0zGQHas45nzmKa 6xjLEEE+EozeTL2kLTHSz55Znqp3PjyM0KYPjTjX7G2p7yRZdDoK0cd7PVp3q60ZX5hInS trZIT3Z1H+snO4Nac41D3Q6D1cUHXARIvGpesOV/jiyiLoKpPZYBixKIVBX7Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689911081; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+xqHPlOee36iJAzJKS7fVXfw81YbNlGXjeM9wLfkF4E=; b=NX1ziHdZSMdsx2P7D546mC1Ef28gLdHAk8FFc+EXx34yl3vtGjPg88BFpwOXSZPRVvu+Gs dQEvClGp59W+JOvYL65M0UqkmAyUJbHhbcOHwGXhTIpAnnzo/srZGE2Bm62SkF1Lmjpi69 WJxkBwuajLbpvTmVKbWHFAAoJACzi8wePtiTiTFc55l+widK9v5uRZ+3gTTJmJcsRK6Bam 3bnZvhiSSgwR7vYQwRIgAdGPEp4RixRVrCy57WT68imkfqEBX0IUgq/erDRpBGE1WErBhp Z1lDRjsqSiqPw7UvafNuY89mRnIyvxDETuUcyiJGWGDat0rbixLFXhFSpOhe3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689911081; a=rsa-sha256; cv=none; b=mKwWMYueN60cd2LFgVvhqB4UDAUuaQ/BUNjGYbgaXmN0SDyZ2jrJz4i0WAe80K4vREvxp6 HN3qpM8YsGQ/6eg6MKJvMwfNDfxvP2EuhCydLlwjB4oUE8u6ldRnb+9n1FiLtEjHlPclFO GKcoeoLuzmxKX423E6GK0WpOnp8CFrqhU1yIqGkW0r3lcJ5cK1Vyr4eTZcmbwHTqtNxiLp eZwHpGP2zXmkyrwTCuAELodh2VRl8q8G/ucQLbg4Oaw0fnbFmPyLYIGJBBUMKbVOxq9IR0 ZVUB/E/U+eRISL0C33Xu/0JuVZjZ3aYTE0W6Ii4yVnzu3SXZypxbQSzYqRgReg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6b612lrwzxKD; Fri, 21 Jul 2023 03:44:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L3iff2031630; Fri, 21 Jul 2023 03:44:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L3ifcX031629; Fri, 21 Jul 2023 03:44:41 GMT (envelope-from git) Date: Fri, 21 Jul 2023 03:44:41 GMT Message-Id: <202307210344.36L3ifcX031629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 95f7b36e8fac - main - e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95f7b36e8fac45092b9a4eea5e32732e979989f0 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=95f7b36e8fac45092b9a4eea5e32732e979989f0 commit 95f7b36e8fac45092b9a4eea5e32732e979989f0 Author: Kevin Bowling AuthorDate: 2023-07-21 03:30:00 +0000 Commit: Kevin Bowling CommitDate: 2023-07-21 03:44:04 +0000 e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 15 ++++++++------- sys/dev/e1000/if_em.c | 48 ++++++++++++++++++++++++++++++++---------------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 47f9b187aa14..069a1c00a4b2 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (sc->hw.mac.type >= e1000_82543) + if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(status, errors, ri); - if (status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special); + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr = 0; + uint32_t staterr; bool eop; int i, cidx; - i = 0; + staterr = i = 0; cidx = ri->iri_cidx; do { @@ -739,7 +739,8 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (staterr & E1000_RXD_STAT_VP) { + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 0b664b155872..b5a6e7e777d3 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,19 +781,21 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_JUMBO_MTU + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ IFCAP_TSO6 /********************************************************************* @@ -897,7 +899,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -912,8 +914,9 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -932,6 +935,19 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = LEM_CAPS; + + /* + * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO} + * by default as we don't have workarounds for all associated + * silicon errata. TSO4 may work on > 82544 but its status + * is unknown by the authors. Please report any success or failures. + */ + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); + + /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ + if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) + scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); + if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ From nobody Fri Jul 21 04:27:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c3T14Mvz4nsnh; Fri, 21 Jul 2023 04:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c3T0fNrz3mkX; Fri, 21 Jul 2023 04:27:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D27hDhk/REjIfxRCzyAEW2v0ucU5Xt/68er8SV3gaUU=; b=Uc79A5xdELEJsHPAxKWeFVcfikEgZQPRRV78x8tCoQcfQygQvRNsV7L6+trWqVyMAxmMM1 wIWkpoPgIyExJlmHJrgERdLHXnAm+z6gQPtO6qvRmcoSZR02CmGuc0O8iDlNxskK/Wmu05 A/G86qKcugZZphJI+DkhvHOHZ1LrBWFbui+I2Mg40Mk4cYqUZi2hzGK2/k+efbqoFzX9cz 6VGiQ2mnUzCl07HxXOx7+cugspbO18Me1VJByBRQ12ON9vegmwXJMFLOeDaUYgNF93WZkF G8EqFouXItir207hFDc0bz3U3XM3RvdSgZ3wAQCpr7amKmwvhwdEhLmy19YYgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D27hDhk/REjIfxRCzyAEW2v0ucU5Xt/68er8SV3gaUU=; b=szVZbmBxJQRuQKPsCSlR4tV/jLw61jrFPTUQtWXGDlHkqR2wIZQCEEM91LMp7j4sEs44of bg9roSwKWChy5EKn1jwZNuse5OwGTfOpCjAMYi3fA2ujDIG68qs8/cx9Pcopbd6pmt+vAh 5JxuhF5tq9S0J5FAMjdtwCJ8pVAMGUeACjy3Yag2Ca645EOq0rz1VtBI6INXAXP93TkgqQ 63wK38rqfIF+vPQyuoT6TuBm4EpAGJr0skdMMqGzh3tDbHimKszVQ2kMo7Kohye9HF62DD 18u4ws9SPpZxa8Jy3w9Gr57uJDZV1I+s/WoCIv1d9XGJGoqPvYsihpe6XxUV3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913653; a=rsa-sha256; cv=none; b=OSvfYrZDwgYCQ/x+7e6RKNnjPaMpopaL+YChvnDcGxV2M7Rz0D+tUeyIIghvbddclCspnV NLh0XbfxGzKTrP8X0z2lo3pXcehTczH68LqyAjfLOtyr0JBJ+lRiCHiSCN9+g1rCjFQ1+B XU22nUjjU3ayK3BHslBMFsY+Qg1l+IYnBEVAXwrVI/c8znN2nThaiO0fPcHTtzEg68qh2V A9JNm+OuVdqX0lGEb7wbw9kEjt1UjMXfrC41iWx69liaXB9delwBhR6I5fK0piD+C4dfbp 1DKqHiNUpQUyRfAHcK1EHDH6shzAcDOkBjqxIHWgeoQCkx42fxxb7klQwHgqYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c3S6q3HzyY6; Fri, 21 Jul 2023 04:27:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4RWRj098782; Fri, 21 Jul 2023 04:27:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4RW6T098781; Fri, 21 Jul 2023 04:27:32 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:27:32 GMT Message-Id: <202307210427.36L4RW6T098781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: b74486181832 - main - libc: locale: flesh out an incomplete comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b74486181832b664c749bf542c93e6e55bc2ac20 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=b74486181832b664c749bf542c93e6e55bc2ac20 commit b74486181832b664c749bf542c93e6e55bc2ac20 Author: Kyle Evans AuthorDate: 2023-07-21 04:27:24 +0000 Commit: Kyle Evans CommitDate: 2023-07-21 04:27:24 +0000 libc: locale: flesh out an incomplete comment Extrapolate from the context what the intention for the rest of the comment probably was -- that the C/POSIX (and now C.UTF-8) locales may avoid an allocation and reuse a global table. Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D41087 --- lib/libc/locale/xlocale_private.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libc/locale/xlocale_private.h b/lib/libc/locale/xlocale_private.h index 1d7b1a44d36f..149e019d6098 100644 --- a/lib/libc/locale/xlocale_private.h +++ b/lib/libc/locale/xlocale_private.h @@ -163,7 +163,10 @@ xlocale_release(void *val) /** * Load functions. Each takes the name of a locale and a pointer to the data - * to be initialised as arguments. Two special values are allowed for the + * to be initialised as arguments. Three special values are allowed for the + * name of the locale: C, POSIX, and C.UTF-8. When these are used, we may + * use some statically defined tables rather than allocating memory for the + * locales' use. */ extern void* __collate_load(const char*, locale_t); extern void* __ctype_load(const char*, locale_t); From nobody Fri Jul 21 04:32:29 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9B07VMz4nwTL; Fri, 21 Jul 2023 04:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c996pTxz3pPV; Fri, 21 Jul 2023 04:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=49WMqTYT0EfvJavYXDkbz+p0KsqOvdqQmtfDPs3Pw/U=; b=Yb4Rxgx8V4v3DRHtlh2B+oMCIsf/mekd906KcxmIOto81WsbgK8fwvcsM78vEkSe4khNlT MBDr3Y0lqNFx0VKxKKgrLVkdjz0PKrzvuS0dHoedQ9nX46OSgxl0MFxKXCS6SNUBrHCwoG /r65Qx7rqvOUjNJjXGVYBhXGAFAUY5HHe04d1VpDMU165n3JQJv9X/t1Azf0f8001CNK/E qnneiWKrkxxqw60jxYfRHKPXCor/xcxKPs9BkV1RBuOJhTlHgDSrsyf1dtRauIaeu7lgLy ybDdThYMcQdDODS/GvzpLwye9VqTkLFybl9k54Fs2k5In2opVyY64DAwsOLQ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913950; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=49WMqTYT0EfvJavYXDkbz+p0KsqOvdqQmtfDPs3Pw/U=; b=aOY2ZKHH+qV1lOO3t4K1DJUPbuHcTPSMTkfJsSL/KejLhbh3e1kSoegHzY+XFXbWxCGjzt YuwZWiXXzekucAXBdKt4JBVCTRliTh0VbQmN28dV4mZPf38hSaxorjgETJnf+Heq6z+Vuc wUaBjSt6XuCLtGKGvayabZNXOqses+CUxoMYcvGrpzAD8qNdCuh5NhbcTKSRcWJlhgiJwQ /xVsAuZsiBgLv0VvINUXov+bR0jDkCZA+hxsWM9c8KNaecfII6VToqVYOTA0UpdeMK8CbV jtYnAlrfgg0S5ZpTFH9MGK2a1BsB50ajkjqeQZUPf7b8jjYNU3lnNGRh6DPKFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913950; a=rsa-sha256; cv=none; b=LvUKUdMysHeOdWFlEzCA1RxBr3L/zhSivZE6i/sbzyNN5tW8HreBCa/KUlyLVR+fGPIF5V 5/j4mkLXK50H4oLfQImiJCxZ1HhnmlwjAr3B7GGUkTczMl78B53shzVo+yg2btGrK7FCuW g2xa7i8iZjqGdFobvfUe1z79JcHSuKqoyAPGaRDpLGbGnDFt9B/tnYT4BKkmKA8dx8VpFf KjFgvcE7MaQJNBu4Df38RdVZ8/9fNEcJ820CYEpNjiF/vuMTy74/3yMqTPddSE5l1D4ouO x3vj2CjsTJDVgnGbu/rV4rPDhe4VKUiBm0/A8BoTPR65IXaPd5cLYsU8TpHuNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c995sFvzyvj; Fri, 21 Jul 2023 04:32:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WT5v014716; Fri, 21 Jul 2023 04:32:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WTQc014715; Fri, 21 Jul 2023 04:32:29 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:29 GMT Message-Id: <202307210432.36L4WTQc014715@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: 38e831a8956e - main - cam: Add comment about recovery ccbs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38e831a8956e10809003e632a37f958e32578c9f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=38e831a8956e10809003e632a37f958e32578c9f commit 38e831a8956e10809003e632a37f958e32578c9f Author: Warner Losh AuthorDate: 2023-07-21 04:21:57 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:30 +0000 cam: Add comment about recovery ccbs SS_START and higher actions (currently only SS_TUR) allocate a recovery CCB to send a command to the periph. Add a quick comment about that here. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41081 --- sys/cam/scsi/scsi_all.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 4087c7b01778..37a58fda433e 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -72,6 +72,8 @@ typedef enum { SS_NOP = 0x000000, /* Do nothing */ SS_RETRY = 0x010000, /* Retry the command */ SS_FAIL = 0x020000, /* Bail out */ + + /* Actions larger than SS_START allocate a recovery CCB */ SS_START = 0x030000, /* Send a Start Unit command to the device, * then retry the original command. */ From nobody Fri Jul 21 04:32:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9C16P1z4nwcK; Fri, 21 Jul 2023 04:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c9C0YVDz3pCL; Fri, 21 Jul 2023 04:32:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wHJK3Yq/HXZvTPMQlULZalMzqyO2sK/9O/CWGtyNWo=; b=HdUAFffxAM727m0VynPe6mZfusaQZBxWCfaDsTgnbhri02O50bsc79Ywg9qQU9e+ouuyis co4rtaHIYGEvmk2QF2iBBiYq+8ebaXpOucrdkAzolyJr34pzkK/2YnvzlJDBPcnXksVFaz 70/1k979NobEOaH4VsZJWkDICSD4Kmh5zffsQuGrR2c6FO3yeivZPH+QQYfaseEeal047J KmFDPo8LPxlmNzPj3OGA+JedugZHCYIxlYZraEq1V57IytqaMeL01/NiKlD6KuXzU2fGQV +yXMVheZ5IpG/wNdHJ7qMRvy25jtPPdh6zV2ZGaTvO+MrUvNk/N6u3cqaVnH1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1wHJK3Yq/HXZvTPMQlULZalMzqyO2sK/9O/CWGtyNWo=; b=EnWs+lw85+YrCkY4Xf05LWGnb2DUjrY6z4DmiqXpo/4HpvpIKvviSXSuqwqnSq0ocO3lAY wlm0mJxuFPmy70clZwHR+abkfXzWSVUHXxRm9fA4ack0H5vFOZUsWc2aVTufp25utNV6wZ XrQsArB4soxbXf4MkLuddRpWGx/R5Y1oIgeqHoC5/JN7C8fDVxXaFbYQmALazD4ni9942h zm88fRdrmtqCEX/oa7lFWYNNWXJ4mPPJL4RT/+28FKeAlpvOJop+nCyQG04IBbir9mUxuX xREm4kJvQkQLadExo6h/FTykcPPzUM2IGh2l6HU8/BTlotWls/rYfMw2L4mZAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913951; a=rsa-sha256; cv=none; b=GoJ0D1m/eTKGqtigypZMApKNTBQftafWUNS0HuB0CP54p8VjEyekV+Int1+C1j8ScEwrFh xw+T7TqvkbvnIgboIDthQlL4aGGf9KPJLpc6XIWxRfxFSTTwkFw7bdnlh5saaV+491wq14 dBgFr7xfjK66a424KMpIQkaHXgpTxpQcvfwQD+ibgcMWVuIaWGGiLlmXPbmF1ATjgWfenT XBclTJ4gLeigxKZ9+BAoa58teqrE6+KxINA9eCNRy67n2NNNBILM18TmnprE2nXjQJ/v/d vb5zEJo1DJ/7YiQqL4w9WZvLd0t+0JK1glXo0NiA2ebiJ3wEpt/T/UgLxyy3Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c9B6mJxzyvk; Fri, 21 Jul 2023 04:32:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WUCK014739; Fri, 21 Jul 2023 04:32:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WUN4014738; Fri, 21 Jul 2023 04:32:30 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:30 GMT Message-Id: <202307210432.36L4WUN4014738@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: 367699ca7ac7 - main - cam/scsi: Better action for ASC/ASCQ 0x18/0x08 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 367699ca7ac706cf8e454c77abd57a1a54e7a877 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=367699ca7ac706cf8e454c77abd57a1a54e7a877 commit 367699ca7ac706cf8e454c77abd57a1a54e7a877 Author: Warner Losh AuthorDate: 2023-07-21 04:22:07 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:30 +0000 cam/scsi: Better action for ASC/ASCQ 0x18/0x08 0x18/0x8 is another code to indicate that the data was recovered successfully, so complete the command w/o an error rather than retry the operation. Sponsored by: Netflix Reviewed by: mav, jhb Differential Revision: https://reviews.freebsd.org/D41082 --- sys/cam/scsi/scsi_all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/scsi/scsi_all.c b/sys/cam/scsi/scsi_all.c index c1b23438fb4a..9c408fd85b05 100644 --- a/sys/cam/scsi/scsi_all.c +++ b/sys/cam/scsi/scsi_all.c @@ -1592,7 +1592,7 @@ static struct asc_table_entry asc_table[] = { { SST(0x18, 0x07, SS_NOP | SSQ_PRINT_SENSE, "Recovered data with ECC - data rewritten") }, /* R */ - { SST(0x18, 0x08, SS_RDEF, /* XXX TBD */ + { SST(0x18, 0x08, SS_NOP | SSQ_PRINT_SENSE, "Recovered data with linking") }, /* D O K */ { SST(0x19, 0x00, SS_RDEF, From nobody Fri Jul 21 04:32:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9D2VNxz4nwYy; Fri, 21 Jul 2023 04:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c9D1T50z3pSk; Fri, 21 Jul 2023 04:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohyULctqZw6bKLR424uqqK9IfbLdzDZN17oQV06aoHU=; b=UUEcJsa30JOqGU64mGEh7w6/QsQeo/ksMYFp7eAaWhY/we1flkI1LuPvFUrHY86rBcjPUd 49JOtW0H824ZFgP+Ug4ttgejIzSJvx4TQ0fYhV2FzMn2Kes6eQAkdVarKUvOgG77e5e3Nf PXPR3LeGM4fQ3D4uWdENhOSG+VSDpJqKNxXo5oRLdMR8xi06UzA7Z0s/yWGb7jvnNrZZjJ aaVvNH+fLqp93u+B6Azs0bu7CIT9KHJ1OguBLzGik+bcVDN5uqpaodviy1uGwUoOC38Vnn XPphL5Zepj8jXek5i8a4Y0ejquglcbvXoO/wJ3Z+4PH55rQxdBZlP/Sf8GiIBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ohyULctqZw6bKLR424uqqK9IfbLdzDZN17oQV06aoHU=; b=HKBigiELJt0jAjcJeUeB0ZY9q405QROZCB/QTNPNfrwVkJMkuZ2AEn1/xUu/sMhBJ2LjHh 4gQKJylLkfM2dtXA6iWcBOka2uRxK+Dr9l8TUk1lRuHQJNcYHj+FgHiRVzWLu0Fc3snOia rWo7cSUN48kIvCapQMzN9Jn/eyWcKwd6FUIZUDSLr3u3S9EK03lnVjXWlBvKFoLd3jbfw2 4/PoxcjsTV4seSX3zSo7NCmZG90Hnc36aWKvu/ymYmQlkXkf+G3akrFQZOg7bumzIkvByu aIwR8ATcBei6GtxLj0sabIo3AZ8M0xNIdsDXyHlL+KafInD2zETMcCrWRNSypA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913952; a=rsa-sha256; cv=none; b=toC16Tc8hObFbAIjc7eBZHvhjW0cqlQbM2pAxJHeiMJhYp8fxjowI4fVSIay/piZfzGyTy rQtKXJK8ouLNLMg2pIllmzA4vWM+bif3elX7CnlJ2VwearE8qyPGCVHvt8lxpxEdaWG7+F 51ZH3v8emVzySUDC9D3D8+1W/r7D8ap03+snti6TGx0t8jBVwfmjE0/wVibxEghybpQvyO z7Z6XZT+VKs0/34KxFrj1X7mdby3qQ7CF7NsjKf7aPTo93Zw8zL+m+TUDfxwQOf6tYd/1L RKQGbjWRq18OOHFDAzJQH69ttGuQVcSaoX2QSFUYgqhvo0C0aMquMtdEcU/+5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c9D0YlQzyMt; Fri, 21 Jul 2023 04:32:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WVL7014760; Fri, 21 Jul 2023 04:32:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WVUc014759; Fri, 21 Jul 2023 04:32:31 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:31 GMT Message-Id: <202307210432.36L4WVUc014759@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: 33734ddf2b18 - main - cam: Be explict about CAM_SMP_STATUS_ERROR List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb commit 33734ddf2b184ef82fcef31ecb5c679f6d4b1eeb Author: Warner Losh AuthorDate: 2023-07-21 04:22:18 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam: Be explict about CAM_SMP_STATUS_ERROR This is normally caught by default:, but no harm in making it explicit that we'll retry valid periphs. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D41083 --- sys/cam/cam_periph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 0e563343ee96..fe256e84cd2c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1996,6 +1996,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ case CAM_ATA_STATUS_ERROR: + case CAM_SMP_STATUS_ERROR: case CAM_REQ_CMP_ERR: case CAM_CMD_TIMEOUT: case CAM_UNEXP_BUSFREE: From nobody Fri Jul 21 04:32:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9F4DJBz4nwR8; Fri, 21 Jul 2023 04:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c9F2Fcbz3pXQ; Fri, 21 Jul 2023 04:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmhcnieqoXXTa6NCVpBWo0+LQyZv3+qkRNT0TR6TVVE=; b=D17HT98P19CAeEOcE/ShXbtDiUIbDS2QaWwRN+1keAhBFXeeg4rtIXGT6DdawtX9xqkHH5 ZVCcG7yZJsQJ6CQxZn1xADrxVAxKP+8Kdp33b9/X7xvB2seRHTEkmVbpf4aXO5yPb1qQ4n dATpNcS59SS+WXgb6uQYtXXVAbPy6okf22Yx+R6bkA/JSdzXHhm4FkvsY4T9DuOD0VcfpI SbGikzwmxJvY30tA6I5n+Fro7eaC11TvudOVFohwBTI6nPsy7RHcuDOTDqP8octd/SQFIQ XA0Um50dInttLkGRtKu6vczsHozk2RFXyLx1jQieOa8zzZuOyrvcAx82FavmkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RmhcnieqoXXTa6NCVpBWo0+LQyZv3+qkRNT0TR6TVVE=; b=vFJzwYJkF8Y6DiuNagj2AzVPTk0l/2zMI1mnGz1P7FfebQARuDfWjRnFkl+hwWCvJgOe8L U1Pw53wlLlEQFGttLM1GDU9hy4LZmgiHbRTyJknfzOj/LQI8Cw9nx4G/HfPir0GIj9ABvc yBgudrvPw2YExR4q+puXa5sMMa3JvRZza4E1qkcVZ8Q5OkxPftwRoQGKG31aHBbCpSGUjZ lN5xHrOZH5bSkWIhC+l4rYn4s2zHss2wmAKplJvr/mE9r3eMEFMoFbVeZ/8UDpNnsavtjL XnWAaEvctyKxqioM1SLcC91EMp4M1HgbkVrK9ASgjCPdx5nWLFI9exYrmHh8/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913953; a=rsa-sha256; cv=none; b=pm6+RjXXYcI0+bZQiSzSj06kD1HARU87mZoheNEDyDmW894blCIkicVWiwQD2aJarhHzPh CyXYV8CT6ogy+9InC2iENGpTGN3oZg2WRSnAF1gWglXD8A4Kh43uIsKw/YeFVcsPPGKJ9X ZMhm2KymuWUtGE6bmrHjWLx5KupaTULrMSHfFwObmEmTs38o0PKekPLmynttkJ6jtGHWpx +x8YlKpqw713PSHvaB8bU6tD/1UzVOHqIZbUm1cIzbJ+8XROwvsR9G6MDkVCjsmIhQM/lb YZzQ9/Z1S9qDjg7bDATW66N3G7WgZ3Y832oma2rDcAgFP7OFYiPGU2JAE3B67w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c9F184lzykZ; Fri, 21 Jul 2023 04:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WXw4014779; Fri, 21 Jul 2023 04:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WXEx014778; Fri, 21 Jul 2023 04:32:33 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:33 GMT Message-Id: <202307210432.36L4WXEx014778@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: 0732617ec174 - main - cam/nda: Remove impossible CAM codes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0732617ec174854c0875bb7171d850473c61569f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0732617ec174854c0875bb7171d850473c61569f commit 0732617ec174854c0875bb7171d850473c61569f Author: Warner Losh AuthorDate: 2023-07-21 04:22:27 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam/nda: Remove impossible CAM codes The NVME SIM does not generate these status values, so remove them. Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D41084 --- sys/cam/nvme/nvme_da.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 94915ec6a726..f2fb1b79f452 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1284,12 +1284,7 @@ ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) softc->timeouts++; #endif break; - case CAM_REQ_ABORTED: case CAM_REQ_CMP_ERR: - case CAM_REQ_TERMIO: - case CAM_UNREC_HBA_ERROR: - case CAM_DATA_RUN_ERR: - case CAM_ATA_STATUS_ERROR: #ifdef CAM_IO_STATS softc->errors++; #endif From nobody Fri Jul 21 04:32:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6c9G4S9qz4nwkc; Fri, 21 Jul 2023 04:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6c9G2NMqz3php; Fri, 21 Jul 2023 04:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=L5Jza8yajZG4mMTl/Sb/2njj6uK+QrYWSVv33Y7IbEHGhspj59dnnzxLX6YyqoD8PVSPXN mudr0znvdp2UZz8l0UqZHaIn2oIHlESVDSBrf/Zj+DC0JpOM/KmqO6rAEl6Li/V/B6Khge n0ivpNVqoluUFkZwn620Q7RC4nkaLf+QDVdxM1ubcuJkMif3rOH02wvO6GgEdCTIvmK8oo HPIvZyClxDa7rFo3s3Pqde8/Ealj1RZan6yrD5cW08YfAd0MYoIYFJBBigsKS0C34HUs/w 8ENgMfo4OKHM4Ad2FD6plIuv21XrJ7Nw0hXPzoEQ4dars/9NpRDss2fV0A1jfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689913954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zQvyYT+PnA5LGCJLd0v3+1ZryvBcUdiiRPb4lg0Uqhw=; b=Gnb5fjLyngeQdPQWp4GBOyK59rYXBjmuQz19f2nEUJ22mnVM2eRZgYTr+GAssLhXRIHxoG EW5IbStqRP9pbH7U2/+lQRLFB7bYU7RVY6yspigagj7j6iZO4+eH81z9g6asTsiOoNqDB3 Qd3muK1WtiEJpCA6VAIPP9Baft2Q74jwmhVtQJFeokf48pnNbQutw5bSPg8KdkxwysI6G3 lrgcf/jpIlHjq62+llx2LKZeljOGPgytnlPMiLdczT6TAo4s/lOdDYzCXI/3pyv0UWtQMK GgtYx9l9JxK5eYpk0UzW/red128PW9p4WdECgtz8/d+kE6kKcy9anri39vpKSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689913954; a=rsa-sha256; cv=none; b=f6sdDoK+Lv0w/eYNXcxnuiO1GFTRx7mACZWJmKN2+sbWl5SzQYFBoQeOW5yHfX+qlpM4FJ GPp7VcDnyV92A/E/tUmgaQjF0YScm9Q8lsV7MYGbO1DbqtuI/GKjJgRc5VkePtxW6nqzQn q4zwLsqyHQ72PXOTKI1xcJZYtkOToq7zq9DcufSdnd8mxXWT7tulEFVP/vwdbXc3UGcxDN ZON8Zv5Mkv/obLTqbH1dIXEK+iT6xCQMa3EVCFbEZiLz6Y48phO6F1Q4fjNcaek64MW6UT UWNbVHkhnHPsMXU9vLuNJOl/CnmREGDVDUmJDcg+VpoWw0f+diHdUYpk0XfJIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6c9G1VNKzyMv; Fri, 21 Jul 2023 04:32:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L4WYeO014801; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L4WYir014800; Fri, 21 Jul 2023 04:32:34 GMT (envelope-from git) Date: Fri, 21 Jul 2023 04:32:34 GMT Message-Id: <202307210432.36L4WYir014800@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: 774ab87cf27b - main - cam: Add CAM_NVME_STATUS_ERROR error code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=774ab87cf27beb3669693f14b9c89ebaf542eaf3 commit 774ab87cf27beb3669693f14b9c89ebaf542eaf3 Author: Warner Losh AuthorDate: 2023-07-21 04:22:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 04:32:31 +0000 cam: Add CAM_NVME_STATUS_ERROR error code Add CAM_NVME_STATUS_ERROR error code. Flag all NVME commands that completed with an error status as CAM_NVME_STATUS_ERROR (a new value) instaead of CAM_REQ_CMP_ERR. This indicates to the upper layers of CAM that the 'cpl' field for nvmeio CCBs is valid and can be examined for error recovery, if desired. No functional change. nda will still see these as errors, call ndaerror() to get the error recovery action, etc. cam_periph_error will select the same case as before (even w/o the change, though the change makes it explicit). Sponsored by: Netflix Reviewed by: chuck, mav, jhb Differential Revision: https://reviews.freebsd.org/D41085 --- sys/cam/cam.h | 7 ++++++- sys/cam/cam_periph.c | 1 + sys/cam/nvme/nvme_da.c | 1 + sys/dev/nvme/nvme_sim.c | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/cam/cam.h b/sys/cam/cam.h index 99f7b6a7f5c2..eacf3a248ce9 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -240,7 +240,12 @@ typedef enum { CAM_REQ_SOFTTIMEOUT = 0x1f, /* - * 0x20 - 0x32 are unassigned + * NVME error, look at errro code in CCB + */ + CAM_NVME_STATUS_ERROR = 0x20, + + /* + * 0x21 - 0x32 are unassigned */ /* Initiator Detected Error */ diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index fe256e84cd2c..8defdc9ecbe6 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1996,6 +1996,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT; /* FALLTHROUGH */ case CAM_ATA_STATUS_ERROR: + case CAM_NVME_STATUS_ERROR: case CAM_SMP_STATUS_ERROR: case CAM_REQ_CMP_ERR: case CAM_CMD_TIMEOUT: diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index f2fb1b79f452..9beef786f320 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -1285,6 +1285,7 @@ ndaerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) #endif break; case CAM_REQ_CMP_ERR: + case CAM_NVME_STATUS_ERROR: #ifdef CAM_IO_STATS softc->errors++; #endif diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index ec8cc03cb774..ad6783adf181 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -74,7 +74,7 @@ nvme_sim_nvmeio_done(void *ccb_arg, const struct nvme_completion *cpl) memcpy(&ccb->nvmeio.cpl, cpl, sizeof(*cpl)); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; if (nvme_completion_is_error(cpl)) { - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + ccb->ccb_h.status = CAM_NVME_STATUS_ERROR; xpt_done(ccb); } else { ccb->ccb_h.status = CAM_REQ_CMP; From nobody Fri Jul 21 08:56:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k1c328nz4dNDK; Fri, 21 Jul 2023 08:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6k1c2S3hz4HD9; Fri, 21 Jul 2023 08:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cbWRxy3WEPtm9lCQbZjXRCZAwOf4em95zK1jZK8bAI=; b=vmKfBj50XBg67+uyEvug1Z690qcZxSb7BsIAYDnNxYsS/7DbgbC1pmx1goFjlW6PjmV70o +Be3FEct6RVA3hYd72l6+IFtEIu2N7agefGIFwt4EgpYdUA/msp6xXtsA190uCI1F/jzo1 fAWYSrzpNjfS7eAkt2MkyKI1JI5SMi7V3ZlLdsAoRe+0eUw9UfAGzA7Q5xK/GJahicJgDU Gih9mZhgsqJUEiWscrLf9KfoCsvSdFajjah+4m5gqQ49k/zPZUnDPT3+8nKmZXOD9IhHJP DX/T+DXv8MwQAQOgPYSPeXq+2fahn4ReK0CFYMvAmj8uIyhTGtZPEPXVIIEMEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929780; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0cbWRxy3WEPtm9lCQbZjXRCZAwOf4em95zK1jZK8bAI=; b=xKPVq3xoSktpQ2CXlVn2ExeNOsm+w9unSfuSb8f+40bOEPjPHWYz7WJF360WpDBKTvIEcV 6ko5aIS37Jo8Q3bQJ82IQM3UIFRhuxhQ2k301T5Y3HGt/OQ4U9gFpXyYjUDwpeRT1RuHrg BqWpkC2afs/fQnQOmtWXszaVKKiZooZkDB96nUURPz2D74F7ouHAl+uVGAKU5bQhcl7kuA 9FrVp520Cze96VetvwE0sQdVdsNzEeeHD9Qs1kA0D09siHDJ/uNFhBBVeMxP3Epk/+3pak uC3dKC6nwJCoFUzx1kpdLhT1FS2KCDK9iqgkWUHUIbcI3bqY0/mq1MGG/3M4xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929780; a=rsa-sha256; cv=none; b=HGGTabOtyJ8Kftyl8xfMtLFGJ7tcdQoE2OvIxaHBKOdksQnX3AkyN2MeLsV8Or9cgcdlVp uL+CHgKlI9+OxYbB2/HyPYOBg5y/OBigmPgAd5JkqKbyOEu2vMSqdFXNozq2e4JqFpZTRH O5PTi0zGNji6Qp/H3VoNz1pHXFfQyU6X6GXQDQ9crNYkyOyVC6A/X4nVhiAA/U0WV//WwU KQaf6u7iQw+es5FaC9YPSGVELJH2ZbW5ExCFzBAr71jQBDWFZX5pY54Y3Jj8q0cZzmVhUp USAFTdLc4ar3w38KcrPVJQwRRhUPKIqVm66uxFa20KG0GKTdOTdgENZWsKAE3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6k1c0x7Dz166t; Fri, 21 Jul 2023 08:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L8uKNa045621; Fri, 21 Jul 2023 08:56:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8uKvA045620; Fri, 21 Jul 2023 08:56:20 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:56:20 GMT Message-Id: <202307210856.36L8uKvA045620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 65b618794f68 - stable/13 - lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 65b618794f68aadbebbca11de99278c9ec1b2992 Auto-Submitted: auto-generated The branch stable/13 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=65b618794f68aadbebbca11de99278c9ec1b2992 commit 65b618794f68aadbebbca11de99278c9ec1b2992 Author: Robert Clausecker AuthorDate: 2023-06-23 17:26:44 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:51:54 +0000 lib/libc/tests/string: add unit tests for ffs, ffsl, ffsll, fls, flsl, and flsll Also supply CFLAGS+=-fno-builtin to ensure our unit tests actually test libc functions and not clang's builtins. Sponsored by: FreeBSD Foundation Approved by: kevans MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40729 (cherry picked from commit 49390697b9265d08d3f831cf38cdc2f79e216c48) --- lib/libc/tests/string/Makefile | 9 ++++ lib/libc/tests/string/ffs_test.c | 88 ++++++++++++++++++++++++++++++++++++++ lib/libc/tests/string/ffsl_test.c | 32 ++++++++++++++ lib/libc/tests/string/ffsll_test.c | 32 ++++++++++++++ lib/libc/tests/string/fls_test.c | 88 ++++++++++++++++++++++++++++++++++++++ lib/libc/tests/string/flsl_test.c | 32 ++++++++++++++ lib/libc/tests/string/flsll_test.c | 32 ++++++++++++++ 7 files changed, 313 insertions(+) diff --git a/lib/libc/tests/string/Makefile b/lib/libc/tests/string/Makefile index 5d1944113a1a..e0b2db711682 100644 --- a/lib/libc/tests/string/Makefile +++ b/lib/libc/tests/string/Makefile @@ -1,5 +1,14 @@ # $FreeBSD$ +# ensure libc functions are tested, not clang's builtins +CFLAGS+= -fno-builtin + +ATF_TESTS_C+= ffs_test +ATF_TESTS_C+= ffsl_test +ATF_TESTS_C+= ffsll_test +ATF_TESTS_C+= fls_test +ATF_TESTS_C+= flsl_test +ATF_TESTS_C+= flsll_test ATF_TESTS_C+= memcmp_test ATF_TESTS_C+= memset_s_test ATF_TESTS_C+= stpncpy_test diff --git a/lib/libc/tests/string/ffs_test.c b/lib/libc/tests/string/ffs_test.c new file mode 100644 index 000000000000..aea61254482e --- /dev/null +++ b/lib/libc/tests/string/ffs_test.c @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#include + +#include +#include +#include +#include + +#ifndef FFS +# define FFS ffs +# define TYPE int +# define TYPE_MIN INT_MIN +#endif + +ATF_TC_WITHOUT_HEAD(zero); +ATF_TC_BODY(zero, tc) +{ + ATF_CHECK_EQ((TYPE)0, FFS(0)); +} + +ATF_TC_WITHOUT_HEAD(twobit); +ATF_TC_BODY(twobit, tc) +{ + const TYPE one = 1; + TYPE x; + const int n = sizeof(TYPE) * CHAR_BIT; + int i, j; + + for (i = 0; i < n - 1; i++) + for (j = 0; j <= i; j++) { + x = one << i | one << j; + ATF_CHECK_EQ_MSG(j + 1, FFS(x), + "%s(%#jx) == %d != %d", __STRING(FFS), (intmax_t)x, FFS(x), j + 1); + } +} + +ATF_TC_WITHOUT_HEAD(twobitneg); +ATF_TC_BODY(twobitneg, tc) +{ + const TYPE one = 1; + TYPE x; + const int n = sizeof(TYPE) * CHAR_BIT; + int i, j; + + for (i = 0; i < n - 1; i++) + for (j = 0; j <= i; j++) { + x = one << i | one << j | TYPE_MIN; + ATF_CHECK_EQ_MSG(j + 1, FFS(x), + "%s(%#jx) == %d != %d", __STRING(FFS), (intmax_t)x, FFS(x), j + 1); + } +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, zero); + ATF_TP_ADD_TC(tp, twobit); + ATF_TP_ADD_TC(tp, twobitneg); + + return (atf_no_error()); +} diff --git a/lib/libc/tests/string/ffsl_test.c b/lib/libc/tests/string/ffsl_test.c new file mode 100644 index 000000000000..809cea3d3a93 --- /dev/null +++ b/lib/libc/tests/string/ffsl_test.c @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#define FFS ffsl +#define TYPE long +#define TYPE_MIN LONG_MIN + +#include "ffs_test.c" diff --git a/lib/libc/tests/string/ffsll_test.c b/lib/libc/tests/string/ffsll_test.c new file mode 100644 index 000000000000..1a620cbf9aba --- /dev/null +++ b/lib/libc/tests/string/ffsll_test.c @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#define FFS ffsll +#define TYPE long long +#define TYPE_MIN LLONG_MIN + +#include "ffs_test.c" diff --git a/lib/libc/tests/string/fls_test.c b/lib/libc/tests/string/fls_test.c new file mode 100644 index 000000000000..847977d260c9 --- /dev/null +++ b/lib/libc/tests/string/fls_test.c @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#include + +#include +#include +#include +#include + +#ifndef FLS +# define FLS fls +# define TYPE int +# define TYPE_MIN INT_MIN +#endif + +ATF_TC_WITHOUT_HEAD(zero); +ATF_TC_BODY(zero, tc) +{ + ATF_CHECK_EQ((TYPE)0, FLS(0)); +} + +ATF_TC_WITHOUT_HEAD(twobit); +ATF_TC_BODY(twobit, tc) +{ + const TYPE one = 1; + TYPE x; + const int n = sizeof(TYPE) * CHAR_BIT; + int i, j; + + for (i = 0; i < n - 1; i++) + for (j = 0; j <= i; j++) { + x = one << i | one << j; + ATF_CHECK_EQ_MSG(i + 1, FLS(x), + "%s(%#jx) == %d != %d", __STRING(FLS), (intmax_t)x, FLS(x), i + 1); + } +} + +ATF_TC_WITHOUT_HEAD(twobitneg); +ATF_TC_BODY(twobitneg, tc) +{ + const TYPE one = 1; + TYPE x; + const int n = sizeof(TYPE) * CHAR_BIT; + int i, j; + + for (i = 0; i < n - 1; i++) + for (j = 0; j <= i; j++) { + x = one << i | one << j | TYPE_MIN; + ATF_CHECK_EQ_MSG(n, FLS(x), + "%s(%#jx) == %d != %d", __STRING(FLS), (intmax_t)x, FLS(x), n); + } +} + + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, zero); + ATF_TP_ADD_TC(tp, twobit); + ATF_TP_ADD_TC(tp, twobitneg); + + return (atf_no_error()); +} diff --git a/lib/libc/tests/string/flsl_test.c b/lib/libc/tests/string/flsl_test.c new file mode 100644 index 000000000000..4b1e330d4564 --- /dev/null +++ b/lib/libc/tests/string/flsl_test.c @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#define FLS flsl +#define TYPE long +#define TYPE_MIN LONG_MIN + +#include "fls_test.c" diff --git a/lib/libc/tests/string/flsll_test.c b/lib/libc/tests/string/flsll_test.c new file mode 100644 index 000000000000..23f469b7b5de --- /dev/null +++ b/lib/libc/tests/string/flsll_test.c @@ -0,0 +1,32 @@ +/*- + * Copyright (c) 2023 The FreeBSD Foundation + * + * This software was developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ''AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE + */ +#define FLS flsll +#define TYPE long long +#define TYPE_MIN LLONG_MIN + +#include "fls_test.c" From nobody Fri Jul 21 08:56:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k1d469kz4dNfS; Fri, 21 Jul 2023 08:56: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6k1d2zTnz4H3x; Fri, 21 Jul 2023 08:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZxRbRuW+7AEi0Avf2kUCDjxoBRlIzfMWkATP2e0yZTQ=; b=MoL9cZQAfl/jvX9e5doxfsuaWMFd+boIsSw7afRQxfwID0yeIKVMwSWWNDEpIjihTfith+ xeSD9+8DIhA2bKwgo/mdWLX0blvGkkp+51qLCmdiNKMiIA5CrZQGaM810+J0mdrFvEwzTx NXdG3cCcram8YanydPZVh0kiSDOshwguk770rTripnVyjik6e2QHnTnOBP7l0NqIbABzMS eS+hOOmcFhYHgwS+aMl59MtiTiEKn0PiM8jyDBARocyGxpG6fNzNQ6QCWVL4tNB73ne6zu nnSrkdrES3fHGN8oxjDNLoFm2vS4uEeLjN6ZKQKf6NG6DhGnv34bNS6xKqf1TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZxRbRuW+7AEi0Avf2kUCDjxoBRlIzfMWkATP2e0yZTQ=; b=yKI24ZZ7lr7oRazTPtuuoyv2urzBfkVTghRgFd2RCQ046gwANSikYs5jZzNt7vsqkmptyl SYFkB7+TZjtbShaJ5DjnbqKMkU9thkmO4bXkP9hpCVfTpcwHkIb/8iULLbOECUAGxPPzpF Uxm8havVClhsJr5B8TPg6XsNM9BF4CWhZrw43Yv5tZTK/f7y2BJj/PGUXVxd2VlXVjgVEb GPxB9yjTj/8PLgHXhXLaTU6nQDx8BK1ExHQ1j+kSjGTJk5fPedQRxqOFqcdUu6DOYGZ3Ek D4eSXSBTEzTA3eTw8qS/aaBUBtlttSgH/HI/aMKMa0drgf+meSQckAFsCXiLCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929781; a=rsa-sha256; cv=none; b=eHcNQZ1bDrjmUYQ060l1+jU1qFOgmyNJtHtEzhTgEGyy3937plC/DjB6X5HjWg2X3lWsO9 5Cx8uqpTfA9E8WQP9IDDTXEPNToJKwjcdd+j15RZWMrd3dmDYb3sQqFgA0U1fFJLe+3xzE Iaszpn31VFbgjzUiK14lJaQQMMWQqX8cmL0HuPOoN4f7ImExFkxRybvihOSzkwaJJc9YcZ eNK7uyTQwugzt66Q+zPviGTaCo1y/ZXqEE+HD2nrCqmFAM/5nD4Y7RtS4v079EapKd+TC+ 5kfvMSUW8zp/dQco9+fMuViGkO+nNJ3YoDeu87P+hoPHr4+Wbj8Ok2R6Bz3WwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6k1d1cS6z166v; Fri, 21 Jul 2023 08:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L8uLqe045643; Fri, 21 Jul 2023 08:56:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8uL3Z045642; Fri, 21 Jul 2023 08:56:21 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:56:21 GMT Message-Id: <202307210856.36L8uL3Z045642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 2c03221cce0b - stable/13 - lib/libc/string: replace ffs/fls implementations with clang builtins List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c03221cce0b7446cb681de0179349d2ee72c252 Auto-Submitted: auto-generated The branch stable/13 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=2c03221cce0b7446cb681de0179349d2ee72c252 commit 2c03221cce0b7446cb681de0179349d2ee72c252 Author: Robert Clausecker AuthorDate: 2023-06-23 16:22:54 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:52:37 +0000 lib/libc/string: replace ffs/fls implementations with clang builtins Most architectures we support (except for riscv64) have instructions to compute these functions very quickly. Replace old code with the ftz and clz builtin functions, allowing clang to generate good code for all architectures. We cannot use the ffs builtins as gcc uses ffs() to implement these on some platforms, potentially causing an infinite loop. As a consequence, toss out arm and i386 ffs() implementations. Sponsored by: The FreeBSD Foundation Reported by: jlduran@gmail.com, jhb Approved by: mhorne, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40730 Differential Revision: https://reviews.freebsd.org/D40966 (cherry picked from commit ee8b0c436d7221c25e8be3c3fe1f9da78b9d5b16) (cherry picked from commit 3f5788e0ed8e85567f651ad360596b8c330af5a9) --- lib/libc/arm/string/Makefile.inc | 1 - lib/libc/arm/string/ffs.S | 57 --------------------------------------- lib/libc/i386/string/Makefile.inc | 1 - lib/libc/i386/string/ffs.S | 56 -------------------------------------- lib/libc/string/ffs.c | 12 ++++----- lib/libc/string/ffsl.c | 12 ++++----- lib/libc/string/ffsll.c | 12 ++++----- lib/libc/string/fls.c | 13 +++++---- lib/libc/string/flsl.c | 14 +++++----- lib/libc/string/flsll.c | 13 +++++---- 10 files changed, 34 insertions(+), 157 deletions(-) diff --git a/lib/libc/arm/string/Makefile.inc b/lib/libc/arm/string/Makefile.inc index cf3175ea4e8c..550de34adb0e 100644 --- a/lib/libc/arm/string/Makefile.inc +++ b/lib/libc/arm/string/Makefile.inc @@ -3,7 +3,6 @@ MDSRCS+= \ bcopy.S \ bzero.S \ - ffs.S \ memcmp.S \ memcpy.S \ memmove.S \ diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S deleted file mode 100644 index 5756dd81d21d..000000000000 --- a/lib/libc/arm/string/ffs.S +++ /dev/null @@ -1,57 +0,0 @@ -/* $NetBSD: ffs.S,v 1.5 2003/04/05 23:08:52 bjh21 Exp $ */ -/* - * Copyright (c) 2001 Christopher Gilbert - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR 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$"); - -.syntax unified - -/* - * ffs - find first set bit, this algorithm isolates the first set - * bit, then multiplies the number by 0x0450fbaf which leaves the top - * 6 bits as an index into the table. This algorithm should be a win - * over the checking each bit in turn as per the C compiled version. - * - * This is the ffs algorithm devised by d.seal and posted to comp.sys.arm on - * 16 Feb 1994. - */ - -ENTRY(ffs) - /* Standard trick to isolate bottom bit in r0 or 0 if r0 = 0 on entry */ - rsb r1, r0, #0 - ands r0, r0, r1 - itt ne - clzne r0, r0 - rsbne r0, r0, #32 - RET -END(ffs) - - .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/i386/string/Makefile.inc b/lib/libc/i386/string/Makefile.inc index a8c50a285cbd..f3678b93bec3 100644 --- a/lib/libc/i386/string/Makefile.inc +++ b/lib/libc/i386/string/Makefile.inc @@ -4,7 +4,6 @@ MDSRCS+= \ bcmp.S \ bcopy.S \ bzero.S \ - ffs.S \ memcmp.S \ memcpy.S \ memmove.S \ diff --git a/lib/libc/i386/string/ffs.S b/lib/libc/i386/string/ffs.S deleted file mode 100644 index 3a0431c6a845..000000000000 --- a/lib/libc/i386/string/ffs.S +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1993 Winning Strategies, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Winning Strategies, Inc. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * 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 -__FBSDID("$FreeBSD$"); - -/* - * ffs(value) - * finds the first bit set in value and returns the index of - * that bit. Bits are numbered starting from 1, starting at the - * rightmost bit. A return value of 0 means that the argument - * was zero. - * - * Written by: - * J.T. Conklin (jtc@wimsey.com), Winning Strategies, Inc. - */ - -ENTRY(ffs) - bsfl 4(%esp),%eax - jz L1 /* ZF is set if all bits are 0 */ - incl %eax /* bits numbered from 1, not 0 */ - ret - - .align 2 -L1: xorl %eax,%eax /* clear result */ - ret -END(ffs) - - .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/string/ffs.c b/lib/libc/string/ffs.c index 738ef90ce091..34140e3e4d85 100644 --- a/lib/libc/string/ffs.c +++ b/lib/libc/string/ffs.c @@ -3,6 +3,10 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -43,11 +47,5 @@ __FBSDID("$FreeBSD$"); int ffs(int mask) { - int bit; - - if (mask == 0) - return(0); - for (bit = 1; !(mask & 1); bit++) - mask = (unsigned int)mask >> 1; - return (bit); + return (mask == 0 ? 0 : __builtin_ctz(mask) + 1); } diff --git a/lib/libc/string/ffsl.c b/lib/libc/string/ffsl.c index dbd894b9655b..701e23cdf8f4 100644 --- a/lib/libc/string/ffsl.c +++ b/lib/libc/string/ffsl.c @@ -3,6 +3,10 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,11 +44,5 @@ __FBSDID("$FreeBSD$"); int ffsl(long mask) { - int bit; - - if (mask == 0) - return (0); - for (bit = 1; !(mask & 1); bit++) - mask = (unsigned long)mask >> 1; - return (bit); + return (mask == 0 ? 0 : __builtin_ctzl(mask) + 1); } diff --git a/lib/libc/string/ffsll.c b/lib/libc/string/ffsll.c index 91886de2f127..e94fb518eb03 100644 --- a/lib/libc/string/ffsll.c +++ b/lib/libc/string/ffsll.c @@ -3,6 +3,10 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,11 +44,5 @@ __FBSDID("$FreeBSD$"); int ffsll(long long mask) { - int bit; - - if (mask == 0) - return (0); - for (bit = 1; !(mask & 1); bit++) - mask = (unsigned long long)mask >> 1; - return (bit); + return (mask == 0 ? 0 : __builtin_ctzll(mask) + 1); } diff --git a/lib/libc/string/fls.c b/lib/libc/string/fls.c index d9edc41f9599..3c4719776778 100644 --- a/lib/libc/string/fls.c +++ b/lib/libc/string/fls.c @@ -3,6 +3,10 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include /* @@ -40,11 +45,5 @@ __FBSDID("$FreeBSD$"); int fls(int mask) { - int bit; - - if (mask == 0) - return (0); - for (bit = 1; mask != 1; bit++) - mask = (unsigned int)mask >> 1; - return (bit); + return (mask == 0 ? 0 : CHAR_BIT * sizeof(mask) - __builtin_clz(mask)); } diff --git a/lib/libc/string/flsl.c b/lib/libc/string/flsl.c index 60370cf7d832..f5280b77a4e2 100644 --- a/lib/libc/string/flsl.c +++ b/lib/libc/string/flsl.c @@ -3,6 +3,11 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +37,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include /* @@ -40,11 +46,5 @@ __FBSDID("$FreeBSD$"); int flsl(long mask) { - int bit; - - if (mask == 0) - return (0); - for (bit = 1; mask != 1; bit++) - mask = (unsigned long)mask >> 1; - return (bit); + return (mask == 0 ? 0 : CHAR_BIT * sizeof(mask) - __builtin_clzl(mask)); } diff --git a/lib/libc/string/flsll.c b/lib/libc/string/flsll.c index 275aaa0e2e15..ab504b8e592f 100644 --- a/lib/libc/string/flsll.c +++ b/lib/libc/string/flsll.c @@ -3,6 +3,10 @@ * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2023 The FreeBSD Foundation + * + * Portions of this software were developed by Robert Clausecker + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +36,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include /* @@ -40,11 +45,5 @@ __FBSDID("$FreeBSD$"); int flsll(long long mask) { - int bit; - - if (mask == 0) - return (0); - for (bit = 1; mask != 1; bit++) - mask = (unsigned long long)mask >> 1; - return (bit); + return (mask == 0 ? 0 : CHAR_BIT * sizeof(mask) - __builtin_clzll(mask)); } From nobody Fri Jul 21 08:56:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k1f4tmvz4dNvf; Fri, 21 Jul 2023 08:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6k1f3t2Xz4HKS; Fri, 21 Jul 2023 08:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DnUs1ocCBoaIOJ/S0d0YpiYijKkPOYPimhcmW058ZxE=; b=s7jcOX1WpICBCd98fbFqhQ97Y7H6asb4yKsLItQ04oWvt/LZ9dy50wgEupbBa6skYsVaMe Kh3LG4Df1EPnhtJOIlAHqeiQC2gEJx4aYwM95zk88ughrn7P/vg//BNpB1sEomxmdDDWVu urUp+fFpmgh4PrNop/Z8J/g2PFt2B7X9SJnwKgvmIM1mw/ybmj3nf1bnbhmMAmbzoPLg6E C8d8u0tSiKFkmu/rvJw4katjRGBmg11s8HKHwWR8/Ki9by5sG3swZptd2m4RKTDiSuT9MO TTqZCVGH9AZ6OCCxwlOaaeAT0f/QoFm4w8BuRm6RkgdmdmtS8Xd6ipFwmNSeUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DnUs1ocCBoaIOJ/S0d0YpiYijKkPOYPimhcmW058ZxE=; b=liUsoE/HADgKt7Q6irHITeCQS9apZdRhj4jfxg2l3fcP2Bdt3sYxTPW+m0EK1utFbUAqqa DvlX1AwIyuzN9U+w6pKGSsrtkRcgKpNSVOT5xB6rDQfJ3nFxtmgCSzk8lGxGeg8kv8wM82 xd9ZfglIr3cPaga3DTBsCuAkkM7qK8HRHxn92CR05PCnG0dkeELKR7l9o+Bd6nfsi5OT2R 7GtIrITbxkaofo0NwwFnV9DIlSauNYu6g3Vn3CIQ+RZx+IvDJoYJb0M0L/SQ8RWBScHL/D Nm0q/0RgzpHapcTBOXnkkPX8jQTe6NRLB8XjerX60taR14J40cQJuHZ5sWVUyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929782; a=rsa-sha256; cv=none; b=h3wvbx5LsfNVH5ZhFePkhq22QSS8ev8fYWYLAVhaTKrm2ApyW+1RQcnVmBEIGk77rekhUo yycUKcWKwnw7m5LYzTQiTVR6P5ozeqLDNPec0bMii6y2ymKwBiJS4LBGM4aMjU8JevR/8D f6wUAJcznizZpZ53r49HgSj4T5G78w1z0jxTgrB5jxNbo5Hp2fhZfrWiOea90ZleTDaroD k6j1o8GLG+fvXkFtyaLtzCfiCKGnYhqoDcKkIjFBysEAYOWlWXT5TINUQM1N1/GXWUgchr mydbkDvyCxBhQS6dJOANyzvx6YWP4PFM4prPZMW6O/quXVY57l4YutElGXFo8A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6k1f2mQvz162Q; Fri, 21 Jul 2023 08:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L8uMaw045664; Fri, 21 Jul 2023 08:56:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8uM31045663; Fri, 21 Jul 2023 08:56:22 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:56:22 GMT Message-Id: <202307210856.36L8uM31045663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 3b0dacf6fd13 - stable/13 - lib/libc/string/bcmp.c: fix integer overflow bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3b0dacf6fd13cf8688402561192899507f46c276 Auto-Submitted: auto-generated The branch stable/13 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=3b0dacf6fd13cf8688402561192899507f46c276 commit 3b0dacf6fd13cf8688402561192899507f46c276 Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:54:08 +0000 lib/libc/string/bcmp.c: fix integer overflow bug bcmp() returned the number of remaining bytes when the main loop exits. In case of a match, this is zero, else a positive integer. On systems where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in the return value may cause the number of remaining bytes to overflow, becoming zero and falsely indicating a successful comparison. Fix the bug by always returning 0 on equality, 1 otherwise. PR: 272474 Approved by: emaste Reviewed by: imp MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41011 (cherry picked from commit 4da7282a1882fc03c99591c27d44a2e6dfda364b) --- lib/libc/string/bcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c index 96cd49039eee..c42fe79ddb2f 100644 --- a/lib/libc/string/bcmp.c +++ b/lib/libc/string/bcmp.c @@ -51,7 +51,7 @@ bcmp(const void *b1, const void *b2, size_t length) p2 = (char *)b2; do if (*p1++ != *p2++) - break; + return (1); while (--length); - return (length); + return (0); } From nobody Fri Jul 21 08:57:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k3D53mlz4dPfs; Fri, 21 Jul 2023 08:57: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6k3D3DJHz4JSg; Fri, 21 Jul 2023 08:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i3DiT7zmZVUbyoh/bz/LN0EYuFGaUFxWc63xQ4Tqu+Y=; b=Xln9LGJpYK1vhTg+mvCLLyWM2nBRvhyQsjb6DM24qTrZano1ZHj+CtuCwsGZGORHhW0n8D kSlltpDldU1UbBFeM20zDL369Km3FWU8sx7HR6m+EDGcyHEZ/ByC+rshK2r5QJbXTnTkeP bo5vf7MFVzzqDKtFEA8fNq74DTU3Nt+6x6rHf1zk3ry/wyiBL4l1hvVC/8xQqQZczSd4cw 8PwKeTX4Pa4xlD34UKOgPhhZNMxeADemF5Zk/SABnpCPnoECsucCcn2BDpt2l/8E2Vm+W2 7vSJWgCexr3cRB8fUVA2DRJSYUgvdsHOsuX1F8I4Z4fbTxM7W0ucCmxJIe/CUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i3DiT7zmZVUbyoh/bz/LN0EYuFGaUFxWc63xQ4Tqu+Y=; b=Z3PALfWEkX2kd1psOTcR/bD0L2zps14K0+KzN+EbQKRUmcvHxiKFC8uMk5lhxYGgEw3IzB 05o5ux3KTZar9+wctdgk1KpFEf33LSH4AocR++rGiSb3CQYYsdv5FFBY9Y12+afEIG6u4S RuDMDxKIm+s5QyPrWwTWAYrmEcpSww1QFe9RSiF6nX032hAN8DUGsrtcEhLQdyG6oVEwxz 4m2lX/RB/r7AZScs+CH1kczZraif6eeEnjUgMl74F2tt52+jb/X+uqb0kgr4h2QgNLYQ4o X80fU6cHZs6kIfNZsPNZtjdwW6rV7Vz3qi9Cov21B8xuCS+rKCh6n823kDiL/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929864; a=rsa-sha256; cv=none; b=xtJGP7TwEAiMYrY7B3UCoMwL6OVGAhj+CW8KloPwpE9qLVqmBmVlKyU2lZBcoGJ8V38Crz XE9LXChOksmSnZrcu++rCFxImXO2AQEPPOMDreP1F/0Jly5QOLYF2XQ7/n+iGCb065L+s8 5o4N/Xglrf5N8JJlBOxEUT6xHrO53WXVzJ8xHCtuPiuHJfbOSZudJpiRetgHefzcY+BWz3 eL6oEb1B6NkymqujNL+n61wCAIXsotA5ZFVVa+7PZAScmdo9TzqH2kZcbfDSA40X06htS6 nYFjBDnMws1MMLlD9oTkvqIXbZ3dad9z0FOwzUtI6BCbpPQBeUOUxArFP7WEMw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6k3D201Zz166y; Fri, 21 Jul 2023 08:57:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L8vi1p045994; Fri, 21 Jul 2023 08:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8viuA045993; Fri, 21 Jul 2023 08:57:44 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:57:44 GMT Message-Id: <202307210857.36L8viuA045993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Robert Clausecker Subject: git: 99544e13eec1 - stable/12 - lib/libc/string/bcmp.c: fix integer overflow bug List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 99544e13eec1586552470bd9d5f3b24038891401 Auto-Submitted: auto-generated The branch stable/12 has been updated by fuz: URL: https://cgit.FreeBSD.org/src/commit/?id=99544e13eec1586552470bd9d5f3b24038891401 commit 99544e13eec1586552470bd9d5f3b24038891401 Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:57:32 +0000 lib/libc/string/bcmp.c: fix integer overflow bug bcmp() returned the number of remaining bytes when the main loop exits. In case of a match, this is zero, else a positive integer. On systems where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in the return value may cause the number of remaining bytes to overflow, becoming zero and falsely indicating a successful comparison. Fix the bug by always returning 0 on equality, 1 otherwise. PR: 272474 Approved by: emaste Reviewed by: imp MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41011 (cherry picked from commit 4da7282a1882fc03c99591c27d44a2e6dfda364b) --- lib/libc/string/bcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c index 96cd49039eee..c42fe79ddb2f 100644 --- a/lib/libc/string/bcmp.c +++ b/lib/libc/string/bcmp.c @@ -51,7 +51,7 @@ bcmp(const void *b1, const void *b2, size_t length) p2 = (char *)b2; do if (*p1++ != *p2++) - break; + return (1); while (--length); - return (length); + return (0); } From nobody Fri Jul 21 08:59:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6k5h16TSz4dQlP; Fri, 21 Jul 2023 08:59: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6k5h0cF8z4KJ4; Fri, 21 Jul 2023 08:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKuYbjn8G4S++wn71jPuaQJh/WnobrGGEdVobPH2X/U=; b=fIt8GV3H8ScCpBHSG7pRdMIZwmjvjxZQGMx1gAMO4OW4Sk+cdZkVX6UamC9soClWdnf4rO VUx4/hzLkm6YjsuaVSl7dmIVs1noTrmlEOPczhswKmlcvMc4Ds4z8isEeJ3+tkzp1b5FlY qEdjrqxk7YoUcRIRBP3ND9wAz7+tS6Ql341pkthHTjjHTNqDsrPscLHqkXXqVrYpNkwrh+ Lu7GyU8ZXxBKZT1i2IXFBGG7tBC/SFF367HH28E+bAczQfytBPBAjX9Aodz6Vfmpkglou0 4YywLawyeih1plYeLgiLskEYM+kEL+R+T+dhycS6rs7PjSviNN0UTc06hkfWUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689929992; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vKuYbjn8G4S++wn71jPuaQJh/WnobrGGEdVobPH2X/U=; b=aj81+N2xHKt2XUG7Ng+ie/IFNGxFx2utdrEU9nJrvVOM4hMmEkPXCalaadKbMm3oCK36hJ EwU0AtHNyEk1MbbD00pGYGn5DZ0+MJyavbaP5O+q++stySujeuuu9qOk0Me3uTQQnbReB8 sUkFVF6bR0250xe7b+JvddQmThvrNP30oHYeqYVyJkvYCYkJkHm1HMB7AP3a/Nn5gHKONy A46wdnvpvQwpmGv7D7XSffenvrON/On8VbeXxaDiYFkz8Yf87iC46fh8GIm1Dcy2m9iEia I2WJDXJ1VSMSKmMd3ku5a7DTuUKPLUwtg5cKlt5QVPFSoMm2yimQoiDgtth0iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929992; a=rsa-sha256; cv=none; b=YJCJTYPmmHdghC6YrLo/bRDGpn6E7VSLetwChxnX0ok265pVQo0w4BxWnPcZzO29QbYEnZ Xd/Sei4w+z/ScNByhb2D2iNXel7a5xzIJtaBfjCkLUdfv8waKxQNX3moVoc3bUYU3JwTK7 Y6P55eMEV26bOc8E0QYKZJCHtEvcYG+rEB6w0yAl8+/wzlKyA75PYWK4rjnaITW3NkycXH OGBqQP00mpfYs7MRfDDo2fs0O4Gg6+2ddDy5U5Ci5vFQHorPB73HnQLVJjJ56+YkaWGnE+ OkgjAEY6hiap5aY+/sjlbYGMo2t+d0HSXapG/aUlYSUsbUXHr3ubFroqekwrTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6k5g6mT0z161X; Fri, 21 Jul 2023 08:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L8xpM6046379; Fri, 21 Jul 2023 08:59:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L8xp7v046378; Fri, 21 Jul 2023 08:59:51 GMT (envelope-from git) Date: Fri, 21 Jul 2023 08:59:51 GMT Message-Id: <202307210859.36L8xp7v046378@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Subject: git: 20fc5bf7df1d - main - xen: move vcpu_info to common, leave hook for setup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20fc5bf7df1db698f2651eaa04a3bc71290e1636 Auto-Submitted: auto-generated The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=20fc5bf7df1db698f2651eaa04a3bc71290e1636 commit 20fc5bf7df1db698f2651eaa04a3bc71290e1636 Author: Elliott Mitchell AuthorDate: 2023-06-08 21:13:17 +0000 Commit: Roger Pau Monné CommitDate: 2023-07-21 08:59:12 +0000 xen: move vcpu_info to common, leave hook for setup vcpu_info is crucial for the Xen event channel core. Since both the data and setup steps are identical between architectures, move them to the common file. Since there is no cross-architecture method to call a function on every processor during bring-up, simply leave the setup function. The number of vcpu_info structures available on the shared information page varies by architecture. Instead of hard-coding the count use nitems(). Add a warning message for this being used. Switch to XEN_VCPUID() and use Xen's typedefs. panic() on failure since >32 processors is no longer unusual. royger: Specify 64-byte alignment for vcpu_info to try to defend against vcpu_info crossing a page boundary. Add detection for this limit. Reviewed by: royger --- sys/x86/xen/hvm.c | 25 +++---------------------- sys/xen/xen-os.h | 5 +++++ sys/xen/xen_common.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 22 deletions(-) diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index d59c3901d2d7..38c93bf25998 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -88,8 +88,7 @@ int xen_vector_callback_enabled; bool xen_evtchn_needs_ack; /*------------------------------- Per-CPU Data -------------------------------*/ -DPCPU_DEFINE(struct vcpu_info, vcpu_local_info); -DPCPU_DEFINE(struct vcpu_info *, vcpu_info); +DPCPU_DECLARE(struct vcpu_info *, vcpu_info); /*------------------------------ Sysctl tunables -----------------------------*/ int xen_disable_pv_disks = 0; @@ -416,10 +415,8 @@ SYSINIT(xen_hvm_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, xen_hvm_sysinit, NULL); static void xen_hvm_cpu_init(void) { - struct vcpu_register_vcpu_info info; - struct vcpu_info *vcpu_info; uint32_t regs[4]; - int cpu, rc; + int rc; if (!xen_domain()) return; @@ -459,23 +456,7 @@ xen_hvm_cpu_init(void) rc); } - /* - * Set the vCPU info. - * - * NB: the vCPU info for vCPUs < 32 can be fetched from the shared info - * page, but in order to make sure the mapping code is correct always - * attempt to map the vCPU info at a custom place. - */ - vcpu_info = DPCPU_PTR(vcpu_local_info); - cpu = PCPU_GET(vcpu_id); - info.mfn = vtophys(vcpu_info) >> PAGE_SHIFT; - info.offset = vtophys(vcpu_info) - trunc_page(vtophys(vcpu_info)); - - rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); - if (rc != 0) - DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); - else - DPCPU_SET(vcpu_info, vcpu_info); + xen_setup_vcpu_info(); } SYSINIT(xen_hvm_cpu_init, SI_SUB_INTR, SI_ORDER_FIRST, xen_hvm_cpu_init, NULL); diff --git a/sys/xen/xen-os.h b/sys/xen/xen-os.h index e1d03b7322bc..4919a9fc0702 100644 --- a/sys/xen/xen-os.h +++ b/sys/xen/xen-os.h @@ -44,6 +44,11 @@ #include #include +/* + * Setup function which needs to be called on each processor by architecture + */ +extern void xen_setup_vcpu_info(void); + static inline vm_paddr_t xen_get_xenstore_mfn(void) { diff --git a/sys/xen/xen_common.c b/sys/xen/xen_common.c index d0f0ecdeed59..95fe00b2ba98 100644 --- a/sys/xen/xen_common.c +++ b/sys/xen/xen_common.c @@ -33,11 +33,16 @@ __FBSDID("$FreeBSD$"); #include /* required by xen/xen-os.h */ +#include +#include + #include /* required by xen/xen-os.h */ #include #include +#include + /*-------------------------------- Global Data -------------------------------*/ enum xen_domain_type xen_domain_type = XEN_NATIVE; @@ -49,3 +54,51 @@ uint32_t hvm_start_flags; /*------------------ Hypervisor Access Shared Memory Regions -----------------*/ shared_info_t *HYPERVISOR_shared_info; + +/*------------------------------- Per-CPU Data -------------------------------*/ +DPCPU_DEFINE(struct vcpu_info *, vcpu_info); + +void +xen_setup_vcpu_info(void) +{ + /* This isn't directly accessed outside this function */ + DPCPU_DEFINE_STATIC(vcpu_info_t, vcpu_local_info) + __attribute__((aligned(64))); + + vcpu_info_t *vcpu_info = DPCPU_PTR(vcpu_local_info); + vcpu_register_vcpu_info_t info = { + .mfn = vtophys(vcpu_info) >> PAGE_SHIFT, + .offset = vtophys(vcpu_info) & PAGE_MASK, + }; + unsigned int cpu = XEN_VCPUID(); + int rc; + + KASSERT(xen_domain(), ("%s(): invoked when not on Xen?", __func__)); + + _Static_assert(sizeof(struct vcpu_info) <= 64, + "struct vcpu_info is larger than supported limit of 64 bytes"); + + /* + * Set the vCPU info. + * + * NB: the vCPU info for some vCPUs can be fetched from the shared info + * page, but in order to make sure the mapping code is correct always + * attempt to map the vCPU info at a custom place. + */ + rc = HYPERVISOR_vcpu_op(VCPUOP_register_vcpu_info, cpu, &info); + if (rc == 0) + DPCPU_SET(vcpu_info, vcpu_info); + else if (cpu < nitems(HYPERVISOR_shared_info->vcpu_info)) { + static bool warned = false; + + DPCPU_SET(vcpu_info, &HYPERVISOR_shared_info->vcpu_info[cpu]); + + if (bootverbose && !warned) { + warned = true; + printf( + "WARNING: Xen vCPU %u failed to setup vcpu_info rc = %d\n", + cpu, rc); + } + } else + panic("Unable to register vCPU %u, rc=%d\n", cpu, rc); +} From nobody Fri Jul 21 09:22:10 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6kbR00BMz4nblK; Fri, 21 Jul 2023 09:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6kbQ6b1Cz3DrY; Fri, 21 Jul 2023 09:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BC/EQSpQgnmJgqq4/rhTvdVBP3I7JvsrFX7yqQBeew=; b=AUs8eNbstTN+SoZLNtL4cX04ypvIV2ZdUqRRnvdlRLBanqvLG1RW6n6CFXZCprKT/eAfWK BkqGkU+FEfDXMCLts4mrygswQbpEuLllxPuB1ONMcAYZ1Gf6QLMNmLvAb/JRMoq0/U6maW F5bVF1Zw2UKaOn7uaQstQtSny+rr96CFWNIlJTYdVxwjKBc+h1d7NG3Z0Kb8M7qESZxJsj IxYdv/S7exccVAhTrJ6ystHUnH00OXcdiWHCvPEX1ugn8N695Av4hqnLw+rsby1UMr75BB UXo81TgPsKfRWxCN1w37uxktadBL+n+L+BlxsjniFZbEBBh/kycfUXlsRPA5dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2BC/EQSpQgnmJgqq4/rhTvdVBP3I7JvsrFX7yqQBeew=; b=JCrfIKiAXD8MXahg949OVgbfiwEnBkIb/l/D4+ts71t+b7Htg3w+W3tkQ+PG+E/jeyQSzc WJ5qKvTxTOfG8VBeAJ7ZNrco7m3SIDFLPZlGjbiuIMYui7ZiOGu1LAafuASuoRcL8yuoqE KQonBbizLI0xxrCdopQhHFR7beoM8Ooy5jzV0AAmdz4TBCT1S6ST7d1igqtfss8vLXV5Nr VfTodLACe1vO6pWOVmJWmGJE4pZa4aCobynkm/ukGvSb6TAyJb/AsFq3ObIi8FzeO2Fohi 6E5rLIA8tB8f7PCx+D7RBwMKqJ6kQKsiW3IZEfkmUudajdX94BkXVZW3T4o4Wg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689931330; a=rsa-sha256; cv=none; b=H06rvr1IXw/OpM3PfOJ9J7ChhMOvoropSImS/wRUG+YKyuLnuEqx0bf+5wn5gv9ZadCUSU F/dsN46zSS3waI6mGtTHne6XOZkm2EfJI1wz9bhstCEYF+VYj1K5m0quT/CaYIuzTFxRcB ajIYpcIIrJ0UgrN3QgZXazmK4eg/Z9LRmgSZ4HIjHqQyh138Yth2lyOmhnU9he2Og9zHmZ CvIVZeeuq3SXw9/cVUIwCMDLJZx6uparezEl+MnGQddNSzsGjGsraGmR3bcpes8V9LzIDT s0fTBwmwg80MgXH7JfxI34rH9njKl5/G0P+zjoz+cMlomxVuHUgUDau+PdOUIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6kbQ5NTjz16mF; Fri, 21 Jul 2023 09:22:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L9MAAi094453; Fri, 21 Jul 2023 09:22:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L9MAOp094452; Fri, 21 Jul 2023 09:22:10 GMT (envelope-from git) Date: Fri, 21 Jul 2023 09:22:10 GMT Message-Id: <202307210922.36L9MAOp094452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 2238fb423031 - stable/13 - vn_lock_pair(): Support passing LK_NODDLKTREAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2238fb423031ff7cccdf733a89f9d26198e39af0 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2238fb423031ff7cccdf733a89f9d26198e39af0 commit 2238fb423031ff7cccdf733a89f9d26198e39af0 Author: Olivier Certner AuthorDate: 2023-07-09 17:12:52 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-21 09:21:38 +0000 vn_lock_pair(): Support passing LK_NODDLKTREAT (cherry picked from commit f58378393fb00f1683bc15f1ae7cbb83e047b9fb) --- sys/kern/vfs_vnops.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index e314739fa0ad..628e3aecc864 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3878,6 +3878,9 @@ vn_lock_pair_pause(const char *wmesg) * Both vnodes could be unlocked temporary (and reclaimed). * * If requesting shared locking, locked vnode lock must not be recursed. + * + * Only one of LK_SHARED and LK_EXCLUSIVE must be specified. + * LK_NODDLKTREAT can be optionally passed. */ void vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, @@ -3885,19 +3888,21 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, { int error; - MPASS(lkflags1 == LK_SHARED || lkflags1 == LK_EXCLUSIVE); - MPASS(lkflags2 == LK_SHARED || lkflags2 == LK_EXCLUSIVE); + MPASS((lkflags1 & LK_SHARED) != 0 ^ (lkflags1 & LK_EXCLUSIVE) != 0); + MPASS((lkflags1 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); + MPASS((lkflags2 & LK_SHARED) != 0 ^ (lkflags2 & LK_EXCLUSIVE) != 0); + MPASS((lkflags2 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); if (vp1 == NULL && vp2 == NULL) return; if (vp1 != NULL) { - if (lkflags1 == LK_SHARED && + if ((lkflags1 & LK_SHARED) != 0 && (vp1->v_vnlock->lock_object.lo_flags & LK_NOSHARE) != 0) - lkflags1 = LK_EXCLUSIVE; + lkflags1 = (lkflags1 & ~LK_SHARED) | LK_EXCLUSIVE; if (vp1_locked && VOP_ISLOCKED(vp1) != LK_EXCLUSIVE) { ASSERT_VOP_LOCKED(vp1, "vp1"); - if (lkflags1 == LK_EXCLUSIVE) { + if ((lkflags1 & LK_EXCLUSIVE) != 0) { VOP_UNLOCK(vp1); ASSERT_VOP_UNLOCKED(vp1, "vp1 shared recursed"); @@ -3910,12 +3915,12 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, } if (vp2 != NULL) { - if (lkflags2 == LK_SHARED && + if ((lkflags2 & LK_SHARED) != 0 && (vp2->v_vnlock->lock_object.lo_flags & LK_NOSHARE) != 0) - lkflags2 = LK_EXCLUSIVE; + lkflags2 = (lkflags2 & ~LK_SHARED) | LK_EXCLUSIVE; if (vp2_locked && VOP_ISLOCKED(vp2) != LK_EXCLUSIVE) { ASSERT_VOP_LOCKED(vp2, "vp2"); - if (lkflags2 == LK_EXCLUSIVE) { + if ((lkflags2 & LK_EXCLUSIVE) != 0) { VOP_UNLOCK(vp2); ASSERT_VOP_UNLOCKED(vp2, "vp2 shared recursed"); From nobody Fri Jul 21 09:22:11 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6kbS0sZYz4nbvL; Fri, 21 Jul 2023 09:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6kbS0B6Rz3DfM; Fri, 21 Jul 2023 09:22:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpSb9bxvFh/lUnYn56/l4QTqj4hv9ry54NwtFL77DyQ=; b=MSoBkABVoypZ6b2blVJOfRKVWRt5dvP0rnjt1AnPu0znVNwM3ukMQI/uu99LResYrdMgr5 bwzhzMRtjKG3ICtIoRAL1TOMw3axo0NAMqNLsu28L3u1i9+18TI2eixVw1aM3GkBYh+Q+P 65mTCffqnErSwmTBi/NmTTd5hV+pcEI7oH6Hp9wZUvv6XMsjFclihlM1LziiIJ040G8OQa dGNkEO2gGLgJRpfU3EZWscXcTl+leAv5oW2aCrkQoPJR45YMtp8paRz1j7hosRP+VeKcbV ExyNiLubCAo4EdKCFzjjP0WrKxdbHaLLalRCRb2Hv7S6pdD6AYABRAk/Fn4ZPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpSb9bxvFh/lUnYn56/l4QTqj4hv9ry54NwtFL77DyQ=; b=qB/a5gSDVOL+0cPDloztSwfMe2n6GD0Lu/yWw1LNYU+l0YBKS6IK1Gc5GOMAuHEogwLIYP 1bWpBD6cIyM5/1kjgcYKOcCzhCXMlwfxA2ZiVoG5kLR/RAph5plozvThONMUuOeBu6SgSR T8Kdi12ratKC0Goyryvd+WjS2vrlA55EqPwsmIbUmd2J4yrE8JxtsD1RZ79UmuC+XvTOP3 CmbpZ7/+y+NJY53xu1vAL10TLQlTHLxG6eLOB19Pj03BHilTXLS+/2o1nx9T1PvZ+QyCFw rTPIejSTnCdEEVN9c2YZB5clkTpf71UbqaTkdBLgQbk/TjA8bWEaczowBIGLTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689931332; a=rsa-sha256; cv=none; b=wPHkOFHf89+/Igd9A/Vhrsh2AtrsmY2y8SUi08zEVWp47yaxPTxK0ykYz7xeony1i1/WN4 tX3X7PfpalZWFHk1sPmG9K71zRhds/Ex9J1y9KgySrUIC0SUlzmylAP8SoZbf2P5mt9x4G vw8nJIpBcGaCv+KbPozBW2BmnmYiv+FGVnkeXoq2yWkX+gtsJasC9lrs00jY8rgaSsA8hs G3t3yP+DjhicUZDjqWOYe2LtRGjFo0ADKcBzP4Mh9Bgpyim3L1BJ80Oy1eBahyOnYpqX7b AYO1x5HV/h+sDUfwidT7E5zvoB/wGjo5Gr1HMqtYlOX3H1LWz0Ncldthb27P/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 4R6kbR6LnBz16rh; Fri, 21 Jul 2023 09:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L9MBFG094472; Fri, 21 Jul 2023 09:22:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L9MB54094471; Fri, 21 Jul 2023 09:22:11 GMT (envelope-from git) Date: Fri, 21 Jul 2023 09:22:11 GMT Message-Id: <202307210922.36L9MB54094471@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: d6fedc3f2d37 - stable/13 - vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d6fedc3f2d37a640fa39575a9e5e69d9840a6b68 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d6fedc3f2d37a640fa39575a9e5e69d9840a6b68 commit d6fedc3f2d37a640fa39575a9e5e69d9840a6b68 Author: Dmitry Chagin AuthorDate: 2023-07-19 13:51:07 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-21 09:21:38 +0000 vfs: Add a parenthese to vn_lock_pair() asserts to silence gcc (cherry picked from commit e38c634b77dec76c03613bd84b37ae22d3bb5699) --- sys/kern/vfs_vnops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 628e3aecc864..8f618a9ad46d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -3888,9 +3888,9 @@ vn_lock_pair(struct vnode *vp1, bool vp1_locked, int lkflags1, { int error; - MPASS((lkflags1 & LK_SHARED) != 0 ^ (lkflags1 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags1 & LK_SHARED) != 0) ^ ((lkflags1 & LK_EXCLUSIVE) != 0)); MPASS((lkflags1 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); - MPASS((lkflags2 & LK_SHARED) != 0 ^ (lkflags2 & LK_EXCLUSIVE) != 0); + MPASS(((lkflags2 & LK_SHARED) != 0) ^ ((lkflags2 & LK_EXCLUSIVE) != 0)); MPASS((lkflags2 & ~(LK_SHARED | LK_EXCLUSIVE | LK_NODDLKTREAT)) == 0); if (vp1 == NULL && vp2 == NULL) From nobody Fri Jul 21 09:24:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6kfW1vV8z4nd26; Fri, 21 Jul 2023 09:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6kfV6SDRz3FsB; Fri, 21 Jul 2023 09:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCcAfuEH+vjeMInuDVQrKJSi+XJo1rDvMK1/zDp3bvQ=; b=BbaEVDK0wW3mSXFFUAskW9X+rNvNhplhjHbuQ71zZ1Nd/m68qcFTYupWbWTvl+Zl46WL0k mFNSKJhJ+zrm4GhYqTUuZZmnTemZrN7yaiWYIyytCe0jC3nQbIaNtyhyzddxVXC5JOcdoa 2DNjbMLSzxCpOdINClADAD1I7pQS9Sbo/q6ibsIQavKZ9t0iWLVZ/ei05SZOAv0eqU0zFU 5SguFNyq2kUmpWt+ozdoYOTIoF3Sumt3gf9Z3vPC2dKBGj8nwbQIyoVYbjb/OtzBgaaAYp HkYkjzc9TO0T2LoLLRc5n+6Jr1ymdasOO7dK5XKRZ2pEr9IDuVtlYqPbagTYhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689931490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SCcAfuEH+vjeMInuDVQrKJSi+XJo1rDvMK1/zDp3bvQ=; b=ADw9kz4tals0Z0qRQCMKAsUQY1bMoe5s8OhL2dJ/gy+VKSgPiymLpmPGBFevVGyzoYYvfT nAl6sjQIcC3RU8ru7FjZl8wj1hjevhW/uWO0CaJpWBsmvWmMEe78hnpBxo55B89Nu99w+5 eebjFd25NW4cvpgEtHhbVGKjZdgQvJEFRB8xmo4ARX2K/cxf3rsSUrvrAHkm+yamfyVXOI IoTwU9x+9TJp5ViIOTExji/d+w75ZFCWF7qIjevY1sga9mbGu5Doy3mE5gQisYN80BVm4E HVAXmWly4YbRa4gHrfvJ4mc7qe7KCv1XSqbgeRCwbgOZvu5dltLUmtei0mlsdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689931490; a=rsa-sha256; cv=none; b=YA6XyN9nf6seS+xAu0OhGpAr3C1ivWGtaj6LBfggR+9lwoAe65ieu2lKagY91MczGhDO8Z IGsfGIys8BeUCxC7LT+lclkK36rgGvQU96ONPNbz720SoNzRWYmqrnrmI7s72fFV46RUnk wsVokA5O4xlDBBgVQrsoD3+PGAKYjeP9CxncTNR986ce86EjaiBM4uQEDlU6kkZG22RAEV aD7rSCUIPwnw5Uu4FzMKxTKM0Nxo1QQUpjQ/fuuLWQcOhqxxyxE3rroWSu6vt/iFhwNuoT xn98eOZ56weGQvGSv1ptz7dFLUYf7x4DiVBfnH7XCuOhrH+x4S3OiKT7ztPGjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6kfV58mkz16rn; Fri, 21 Jul 2023 09:24:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36L9OoW3096179; Fri, 21 Jul 2023 09:24:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36L9OoBD096178; Fri, 21 Jul 2023 09:24:50 GMT (envelope-from git) Date: Fri, 21 Jul 2023 09:24:50 GMT Message-Id: <202307210924.36L9OoBD096178@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: 9f23cbd6cae8 - main - atf_pytest_wrapper: fix use with pytest-7.4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f23cbd6cae82fd77edfad7173432fa8dccd0a95 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9f23cbd6cae82fd77edfad7173432fa8dccd0a95 commit 9f23cbd6cae82fd77edfad7173432fa8dccd0a95 Author: Kristof Provost AuthorDate: 2023-07-18 14:20:47 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 09:23:21 +0000 atf_pytest_wrapper: fix use with pytest-7.4 As of pytest 7.4 it no longer walks all the way to the root directory of the file system to find conftest files. As a result we don't find / usr/tests/conftest.py, and don't load atf_python. That in turn causes atf_python tests to fail. Explicitly set the confcutdir, as advised by the pytest changelog. See also: https://github.com/pytest-dev/pytest/pull/11043 MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D41064 --- libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp index 78b045b9775f..b0cc600bde21 100644 --- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp +++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp @@ -141,6 +141,8 @@ class Handler { std::vector args = {"pytest", "-vv", "-p", "no:cacheprovider", "-s", "--atf"}; + args.push_back("--confcutdir=" + python_path); + if (flag_list) { args.push_back("--co"); args.push_back(script_path); From nobody Fri Jul 21 10:32:35 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8g6p4qz4pFxd; Fri, 21 Jul 2023 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8g6MFMz3q5n; Fri, 21 Jul 2023 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKUVnNtxXcYDT5KvQGkJuS2uMtZcj6elxDI3RKO3E/0=; b=uEAx1DNWRsRnLcHxx7Bl/E38seT0tahrfW5dBVzYlLhFEfqlYE9r51wHFXmsSUpOuFeR63 KxZXjWYxH9OMZ7NyMS3VEd5JKKw9O3YiThYmFAD4Ohl+O8cnEHtmjue+fhWwIYLFKjGbCs B1d6JEF6GKJ16Ku1ESZKmZE1nfz+IIPFQH5hgpxEVO3oIryUl5UchD/B5EOXN2S26Xchil kD0prUFa/0adFmq2TxXTg/op8HpDdu7+XvHTuQ0YJ7vqLDedGBnOBGoczUZpF9QTUIsnBl GKe4WxuOOJTs+8hxrrUXHprx2AkHXnggPFRcTbIGorbP6AYKckXWmA1SvUaC1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tKUVnNtxXcYDT5KvQGkJuS2uMtZcj6elxDI3RKO3E/0=; b=iPoIgiyE6YUXyiG3rcVfc8V4CWKvcVt+8AWH/ND5QDWvv8qqe0v7Ancyb6a43U9vUVursJ DH6U6SG+OnJ59SVA5dGXXu3lCNFvoHa58aHNf8F4CESHyAQKpvtdUTjJ9FofjpFduAxZjB Ac70ZOEyV6bk05ggKoocTwt3GHkM3i0LhSYqUqJ2RQnm4R+mBwa6OMW5cFCSzAmyiNzsO2 SbmrZ/mTLjFIsBUg+GpXw+CrDrU2NT4uqmbm3hDDIZip9JdT2zOlLwZE21vfxwv0dLqXTR kCX6VHJIE2rt3seLtvmPLub+LX+642KlD1L2NW3ejrcBy7qHMUbZ0fPtDWGLVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935555; a=rsa-sha256; cv=none; b=W/ijRDLF6G9/AfZumrhwgHkBen7ENi651kSt3E469xt6GkSt+sTyccd7saE8ZIvDblFLNi bw62jAYqskRA0tCCoOog3iH5xM7ESPMHkoD3aWN87i4V6qGFcQic/o8SWzpu4ltgd2Zrr5 SQthcdkkwajWbuD2G8nAAKgx66r3FvosfGEVxGb/i/POddul7DK/YcFt93Jy/lLxU4b+mJ IY4PRylDyuOCra3io9L8l0mEHQD7JwfLN0UkHEXw6RrE4cc+SweQihjxUKRYPVKP5u6BT1 wJvAj9gTONoabX0eeJXM3mZQ6MSuCHtmK8PkwcI0hIJtBRj8oO6aHUPEz5/FOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8g5RnZz18X1; Fri, 21 Jul 2023 10:32:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWZXf010470; Fri, 21 Jul 2023 10:32:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWZ2l010469; Fri, 21 Jul 2023 10:32:35 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:35 GMT Message-Id: <202307211032.36LAWZ2l010469@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: 61e22e9b2905 - main - pf: use sctp_calculate_cksum() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 61e22e9b2905f405170c249a2239f324229b60d1 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=61e22e9b2905f405170c249a2239f324229b60d1 commit 61e22e9b2905f405170c249a2239f324229b60d1 Author: Kristof Provost AuthorDate: 2023-07-07 08:04:51 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:17 +0000 pf: use sctp_calculate_cksum() This function is always available, even if the SCTP or SCTP_SUPPORT options are not set. That lets us remove an ifdef, and also means we improve pf's SCTP handling when the options are not set. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40911 --- sys/netpfil/pf/pf.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 2a1813d6aadd..490a4130f025 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -112,9 +112,8 @@ __FBSDID("$FreeBSD$"); #include #endif /* INET6 */ -#if defined(SCTP) || defined(SCTP_SUPPORT) +#include #include -#endif #include #include @@ -438,6 +437,21 @@ VNET_DEFINE(struct intr_event *, pf_swi_ie); VNET_DEFINE(uint32_t, pf_hashseed); #define V_pf_hashseed VNET(pf_hashseed) +static void +pf_sctp_checksum(struct mbuf *m, int off) +{ + uint32_t sum = 0; + + /* Zero out the checksum, to enable recalculation. */ + m_copyback(m, off + offsetof(struct sctphdr, checksum), + sizeof(sum), (caddr_t)&sum); + + sum = sctp_calculate_cksum(m, off); + + m_copyback(m, off + offsetof(struct sctphdr, checksum), + sizeof(sum), (caddr_t)&sum); +} + int pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) { @@ -6569,12 +6583,10 @@ pf_route(struct mbuf **m, struct pf_krule *r, struct ifnet *oifp, in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } -#if defined(SCTP) || defined(SCTP_SUPPORT) if (m0->m_pkthdr.csum_flags & CSUM_SCTP & ~ifp->if_hwassist) { - sctp_delayed_cksum(m0, (uint32_t)(ip->ip_hl << 2)); + pf_sctp_checksum(m0, (uint32_t)(ip->ip_hl << 2)); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } -#endif /* * If small enough for interface, or the interface will take From nobody Fri Jul 21 10:32:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8j0ywGz4pG0S; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8j06N9z3q47; Fri, 21 Jul 2023 10:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHvYGoC6cjb/ybPFl16ajsteO0z60Vv0okoLj3L6jJA=; b=myGXtpIgdexYUu4/Ak7mb3zipnKAzEXiyFyV2O2gVQFUWP3/PJxbV9YvuY2Z8aw2dpWx2N fgrsQxrAOjNWkjSEGgUD7w8fI07Qvp2QNYE4Sb1edQE/QTFZDMzqog/GF7T3bs4hb0MyOS aXhgppTorSCKoICbMXR0oLTwww51e0mz8Og43SsMEgoL6Fuff4qZCP+90/uru8Qh0Qh+AU vjYVo0iyIEA2fFPIfzXFldidLG/ZX0qWC0v91hPW+WRTpHn48+vP3G4qty2gEOBOOzvfMQ 8AxVYaw9hDGjRbuSy3873ZlEqXnH3sK650Xmou+e4VXF5Cw9DdyEqwuVX2y3LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oHvYGoC6cjb/ybPFl16ajsteO0z60Vv0okoLj3L6jJA=; b=sAeoA5rDSZJXeHxcNyxSS7H+Q2u06ZyECP9S2GwSG+I8ik1VfuOxnQq1CrY3WAxSktxSTy +axllk/9ARpdfCSU2IGCLFMLMkRTqDEfkWTA+rY+C+/BnHL6KzPzt6hQwG07TuYNk1IKuQ wHCNGMVZCTy9FnGOjnpAzlF1e3yfyoTfoLJvZK8stkCd4z4c9OENsY8sUkoydzkL18m09n IUX0JIUZgVw0dDSlq02Nd1Mb71TLxN0FYurJE/8wip5OKyJ+aOIfz7sP/Kx/f9lsI3ufw9 04QMp7zCuFQFlee/td1Li3sUDEX/Ro4FMKryEu27xcNC1uqD593xB4NIYLfAGw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935557; a=rsa-sha256; cv=none; b=imnxcOnSmupgwcQnzXFmsAC5Kg6A7vYvOR9jfSXidMtrYiuFDWM5LiNM3ZkgPjgQPxpwFQ K7lDfg5iMwd+HOh8/zDw0nESZRurlmSdCojPaNsEApM8DWo15LzDFqU7H0iACGMFj4X+3t L3rB8FJ2zJaXJxG/iPrD0gCNqZouO1JouYaQSIEzI4zoRDteh+lJ/bfBvdkj7Hs9A240n2 S4XXZ15n6Br3FJ6DVWLBm7PNyVM2zqtaEJnS0tL4dH0mHaLEg6vKo33iVjwXBGMqM71v3f jJDxhRKaURfeXIH7qVcQRnHDJlNtFxOLlEk6vdRUCkXcHmkvgWKj87oGeZZtZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8h68K7z182d; Fri, 21 Jul 2023 10:32:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWagv010489; Fri, 21 Jul 2023 10:32:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWaio010488; Fri, 21 Jul 2023 10:32:36 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:36 GMT Message-Id: <202307211032.36LAWaio010488@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: 0bd4a6837c4b - main - pfctl: SCTP can have port numbers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0bd4a6837c4bc3dd6168c5679c21c58d41a6910e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0bd4a6837c4bc3dd6168c5679c21c58d41a6910e commit 0bd4a6837c4bc3dd6168c5679c21c58d41a6910e Author: Kristof Provost AuthorDate: 2023-04-26 14:59:40 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pfctl: SCTP can have port numbers MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40861 --- sbin/pfctl/parse.y | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 1a0935ce599b..390888526006 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -5274,8 +5274,9 @@ filter_consistent(struct pfctl_rule *r, int anchor_call) int problems = 0; if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP && + r->proto != IPPROTO_SCTP && (r->src.port_op || r->dst.port_op)) { - yyerror("port only applies to tcp/udp"); + yyerror("port only applies to tcp/udp/sctp"); problems++; } if (r->proto != IPPROTO_ICMP && r->proto != IPPROTO_ICMPV6 && @@ -5354,17 +5355,18 @@ rdr_consistent(struct pfctl_rule *r) { int problems = 0; - if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP) { + if (r->proto != IPPROTO_TCP && r->proto != IPPROTO_UDP && + r->proto != IPPROTO_SCTP) { if (r->src.port_op) { - yyerror("src port only applies to tcp/udp"); + yyerror("src port only applies to tcp/udp/sctp"); problems++; } if (r->dst.port_op) { - yyerror("dst port only applies to tcp/udp"); + yyerror("dst port only applies to tcp/udp/sctp"); problems++; } if (r->rpool.proxy_port[0]) { - yyerror("rpool port only applies to tcp/udp"); + yyerror("rpool port only applies to tcp/udp/sctp"); problems++; } } @@ -6936,6 +6938,8 @@ getservice(char *n) s = getservbyname(n, "tcp"); if (s == NULL) s = getservbyname(n, "udp"); + if (s == NULL) + s = getservbyname(n, "sctp"); if (s == NULL) { yyerror("unknown port %s", n); return (-1); From nobody Fri Jul 21 10:32:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8k0svwz4pFvJ; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8k0kQSz3qLG; Fri, 21 Jul 2023 10:32:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QqU4FTNx9OoIeXVbsfalR3bm7OuxHnyagmfqWgEI6SY=; b=BZvvDp08ihxroBoJyI6jQM4MyC1FW6Z4r8lkbmD0Uxhh0WrGPRsIHfwlAAdpeSdjlAIebB 8HI5T5r7mZJWrF+uTDEVX1y1vKZC2++tpkSm3oxMheoutdb/c7vsqEawgxe0g8tDl1W7sb S2KdRazcjrCP7jdIFhmrkO6Opdktm4M8uW6R1nuyCFmObj6ybqc3Ssg492+9WExbF/Hg2r hA3aJowKOS/SG4Jdwy9rnR66Kzn7qB41JLUDue95FYOmoXxcGXF+qasDAjZK4gVRrCtiTA YDzcPYJ2XKSrnX/BrZrEtPeN7AuAEjvFQck6clwdZwAKGLEGMllZmiMw2jr6UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QqU4FTNx9OoIeXVbsfalR3bm7OuxHnyagmfqWgEI6SY=; b=lU6HnV+tZOq4DLX9bjxycRGm9Rlc0+bYzF2BiirlmFP0ZE6+v/0gwIqfhU40MUG1+68tU+ IkGvn02yAlQXmOhy7y5gjfwrfYVqcypZYCx0/oR2Y9/nrBOGXt/gFvoLihscQWHvV72ioi jq46voyLcMrFTLvkWC/u6NMCIU0NxCrZwENVtIdfQoFE5ReqCqNyAaPLMxjQMeXbR4bV12 E2yTpbriLinxCNtoIU1MfZKbsl4bTB+4BPY5CMMUHqCWjSJSFGvCl7/DeL/dXsqpNXAfsz RbgKvpR8iMNREvpzNmwsG/bEdSB6CTVBLWhzlHXCSrF7ALfikAoqqZpHkL8z9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935558; a=rsa-sha256; cv=none; b=X1XYgFxPyvd/8ZSocyOZOirAKEESzw4mWHspewXhkNK0tfJOf65ilfcsHGxi08K2aHO9Z3 bj6Rfh4c7hJoilf2loYoCUGQjheFPf9GrpR8M9EBNMjibKw22eWh57d/1MrdnkHC/rabL0 tWsReWE5qX73hOm/NlO5paaQU5Gc5zutuch2TKWYdeNFEIzx+l194HxGDaWL36DKg5KwgK SSAwFbE69xtR3f5217sL42mEUQ2hLxlAByYUwHvhQZw7JDd+0AiGI/x4m+xVGotJuUe3V/ 73H0z2G4LPe0kitDMLo838HYaBuFn1gx/eZRa8Nqs9CzwKXMoMK+WA6/MYusJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8j6vfjz18J1; Fri, 21 Jul 2023 10:32:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWbiW010508; Fri, 21 Jul 2023 10:32:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWbgB010507; Fri, 21 Jul 2023 10:32:37 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:37 GMT Message-Id: <202307211032.36LAWbgB010507@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: 010ee43f5673 - main - pf: initial SCTP support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 010ee43f5673eea4c86f846893eadc3c5529b2f8 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=010ee43f5673eea4c86f846893eadc3c5529b2f8 commit 010ee43f5673eea4c86f846893eadc3c5529b2f8 Author: Kristof Provost AuthorDate: 2023-04-27 08:58:02 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf: initial SCTP support Basic state tracking for SCTP. This means we scan through the packet to identify the different chunks (so we can identify state changes). MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40862 --- sbin/pfctl/pf_print_state.c | 34 +++++++++ sys/net/pfvar.h | 13 ++++ sys/netpfil/pf/pf.c | 135 +++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_norm.c | 180 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 362 insertions(+) diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index f0ad9a427006..cabfc78de97a 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include #include @@ -206,6 +207,36 @@ print_seq(struct pfctl_state_peer *p) p->seqhi - p->seqlo); } + +static const char * +sctp_state_name(int state) +{ + switch (state) { + case SCTP_CLOSED: + return ("CLOSED"); + case SCTP_BOUND: + return ("BOUND"); + case SCTP_LISTEN: + return ("LISTEN"); + case SCTP_COOKIE_WAIT: + return ("COOKIE_WAIT"); + case SCTP_COOKIE_ECHOED: + return ("COOKIE_ECHOED"); + case SCTP_ESTABLISHED: + return ("ESTABLISHED"); + case SCTP_SHUTDOWN_SENT: + return ("SHUTDOWN_SENT"); + case SCTP_SHUTDOWN_RECEIVED: + return ("SHUTDOWN_RECEIVED"); + case SCTP_SHUTDOWN_ACK_SENT: + return ("SHUTDOWN_ACK_SENT"); + case SCTP_SHUTDOWN_PENDING: + return ("SHUTDOWN_PENDING"); + default: + return ("?"); + } +} + void print_state(struct pfctl_state *s, int opts) { @@ -300,6 +331,9 @@ print_state(struct pfctl_state *s, int opts) const char *states[] = PFUDPS_NAMES; printf(" %s:%s\n", states[src->state], states[dst->state]); + } else if (proto == IPPROTO_SCTP) { + printf(" %s:%s\n", sctp_state_name(src->state), + sctp_state_name(dst->state)); #ifndef INET6 } else if (proto != IPPROTO_ICMP && src->state < PFOTHERS_NSTATES && dst->state < PFOTHERS_NSTATES) { diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index e0c5fb5214a8..86e15f7c1709 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #endif @@ -1541,6 +1542,7 @@ struct pf_pdesc { union pf_headers { struct tcphdr tcp; struct udphdr udp; + struct sctphdr sctp; struct icmp icmp; #ifdef INET6 struct icmp6_hdr icmp6; @@ -1570,6 +1572,15 @@ struct pf_pdesc { u_int8_t dir; /* direction */ u_int8_t sidx; /* key index for source */ u_int8_t didx; /* key index for destination */ +#define PFDESC_SCTP_INIT 0x0001 +#define PFDESC_SCTP_INIT_ACK 0x0002 +#define PFDESC_SCTP_COOKIE 0x0004 +#define PFDESC_SCTP_ABORT 0x0008 +#define PFDESC_SCTP_SHUTDOWN 0x0010 +#define PFDESC_SCTP_SHUTDOWN_COMPLETE 0x0020 +#define PFDESC_SCTP_DATA 0x0040 +#define PFDESC_SCTP_OTHER 0x0080 + u_int16_t sctp_flags; }; #endif @@ -2270,6 +2281,8 @@ int pf_normalize_tcp_init(struct mbuf *, int, struct pf_pdesc *, int pf_normalize_tcp_stateful(struct mbuf *, int, struct pf_pdesc *, u_short *, struct tcphdr *, struct pf_kstate *, struct pf_state_peer *, struct pf_state_peer *, int *); +int pf_normalize_sctp(int, struct pfi_kkif *, struct mbuf *, int, + int, void *, struct pf_pdesc *); u_int32_t pf_state_expires(const struct pf_kstate *); void pf_purge_expired_fragments(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 490a4130f025..a721385f761f 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -309,6 +309,9 @@ static int pf_test_state_udp(struct pf_kstate **, static int pf_test_state_icmp(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, int, void *, struct pf_pdesc *, u_short *); +static int pf_test_state_sctp(struct pf_kstate **, + struct pfi_kkif *, struct mbuf *, int, + void *, struct pf_pdesc *, u_short *); static int pf_test_state_other(struct pf_kstate **, struct pfi_kkif *, struct mbuf *, struct pf_pdesc *); static u_int16_t pf_calc_mss(struct pf_addr *, sa_family_t, @@ -4244,6 +4247,11 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, dport = pd->hdr.udp.uh_dport; hdrlen = sizeof(pd->hdr.udp); break; + case IPPROTO_SCTP: + sport = pd->hdr.sctp.src_port; + dport = pd->hdr.sctp.dest_port; + hdrlen = sizeof(pd->hdr.sctp); + break; #ifdef INET case IPPROTO_ICMP: if (pd->af != AF_INET) @@ -4702,6 +4710,11 @@ pf_create_state(struct pf_krule *r, struct pf_krule *nr, struct pf_krule *a, pf_set_protostate(s, PF_PEER_DST, PFUDPS_NO_TRAFFIC); s->timeout = PFTM_UDP_FIRST_PACKET; break; + case IPPROTO_SCTP: + pf_set_protostate(s, PF_PEER_SRC, SCTP_COOKIE_WAIT); + pf_set_protostate(s, PF_PEER_DST, SCTP_CLOSED); + s->timeout = PFTM_TCP_FIRST_PACKET; + break; case IPPROTO_ICMP: #ifdef INET6 case IPPROTO_ICMPV6: @@ -5669,6 +5682,66 @@ pf_test_state_udp(struct pf_kstate **state, struct pfi_kkif *kif, return (PF_PASS); } +static int +pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, + struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) +{ + struct pf_state_key_cmp key; + struct pf_state_peer *src; //, *dst; + struct sctphdr *sh = &pd->hdr.sctp; + u_int8_t psrc; //, pdst; + + bzero(&key, sizeof(key)); + key.af = pd->af; + key.proto = IPPROTO_SCTP; + if (pd->dir == PF_IN) { /* wire side, straight */ + PF_ACPY(&key.addr[0], pd->src, key.af); + PF_ACPY(&key.addr[1], pd->dst, key.af); + key.port[0] = sh->src_port; + key.port[1] = sh->dest_port; + } else { /* stack side, reverse */ + PF_ACPY(&key.addr[1], pd->src, key.af); + PF_ACPY(&key.addr[0], pd->dst, key.af); + key.port[1] = sh->src_port; + key.port[0] = sh->dest_port; + } + + STATE_LOOKUP(kif, &key, *state, pd); + + if (pd->dir == (*state)->direction) { + src = &(*state)->src; + psrc = PF_PEER_SRC; + } else { + src = &(*state)->dst; + psrc = PF_PEER_DST; + } + + /* Track state. */ + if (pd->sctp_flags & PFDESC_SCTP_INIT) { + if (src->state < SCTP_COOKIE_WAIT) { + pf_set_protostate(*state, psrc, SCTP_COOKIE_WAIT); + (*state)->timeout = PFTM_TCP_OPENING; + } + } + if (pd->sctp_flags & PFDESC_SCTP_COOKIE) { + if (src->state < SCTP_ESTABLISHED) { + pf_set_protostate(*state, psrc, SCTP_ESTABLISHED); + (*state)->timeout = PFTM_TCP_ESTABLISHED; + } + } + if (pd->sctp_flags & (PFDESC_SCTP_SHUTDOWN | PFDESC_SCTP_ABORT | + PFDESC_SCTP_SHUTDOWN_COMPLETE)) { + if (src->state < SCTP_SHUTDOWN_PENDING) { + pf_set_protostate(*state, psrc, SCTP_SHUTDOWN_PENDING); + (*state)->timeout = PFTM_TCP_CLOSING; + } + } + + (*state)->expire = time_uptime; + + return (PF_PASS); +} + static int pf_test_state_icmp(struct pf_kstate **state, struct pfi_kkif *kif, struct mbuf *m, int off, void *h, struct pf_pdesc *pd, u_short *reason) @@ -7365,6 +7438,37 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, break; } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), + &action, &reason, AF_INET)) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } + pd.sport = &pd.hdr.sctp.src_port; + pd.dport = &pd.hdr.sctp.dest_port; + if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { + action = PF_DROP; + REASON_SET(&reason, PFRES_SHORT); + goto done; + } + action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + if (action == PF_DROP) + goto done; + action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + &reason); + if (action == PF_PASS) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } else { + action = pf_test_rule(&r, &s, kif, m, off, + &pd, &a, &ruleset, inp); + } + break; + } + case IPPROTO_ICMP: { if (!pf_pull_hdr(m, off, &pd.hdr.icmp, ICMP_MINLEN, &action, &reason, AF_INET)) { @@ -7882,6 +7986,37 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb break; } + case IPPROTO_SCTP: { + if (!pf_pull_hdr(m, off, &pd.hdr.sctp, sizeof(pd.hdr.sctp), + &action, &reason, AF_INET6)) { + if (action != PF_PASS) + pd.act.log |= PF_LOG_FORCE; + goto done; + } + pd.sport = &pd.hdr.sctp.src_port; + pd.dport = &pd.hdr.sctp.dest_port; + if (pd.hdr.sctp.src_port == 0 || pd.hdr.sctp.dest_port == 0) { + action = PF_DROP; + REASON_SET(&reason, PFRES_SHORT); + goto done; + } + action = pf_normalize_sctp(dir, kif, m, 0, off, h, &pd); + if (action == PF_DROP) + goto done; + action = pf_test_state_sctp(&s, kif, m, off, h, &pd, + &reason); + if (action == PF_PASS) { + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); + r = s->rule.ptr; + a = s->anchor.ptr; + } else { + action = pf_test_rule(&r, &s, kif, m, off, + &pd, &a, &ruleset, inp); + } + break; + } + case IPPROTO_ICMP: { action = PF_DROP; DPFPRINTF(PF_DEBUG_MISC, diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 5f6d9c1635cd..38312712a0ad 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #ifdef INET6 #include @@ -2016,6 +2018,184 @@ pf_normalize_mss(struct mbuf *m, int off, struct pf_pdesc *pd) return (0); } +static int +pf_scan_sctp(struct mbuf *m, int ipoff, int off, struct pf_pdesc *pd) +{ + struct sctp_chunkhdr ch = { }; + int chunk_off = sizeof(struct sctphdr); + int chunk_start; + + while (off + chunk_off < pd->tot_len) { + if (!pf_pull_hdr(m, off + chunk_off, &ch, sizeof(ch), NULL, + NULL, pd->af)) + return (PF_DROP); + + /* Length includes the header, this must be at least 4. */ + if (ntohs(ch.chunk_length) < 4) + return (PF_DROP); + + chunk_start = chunk_off; + chunk_off += roundup(ntohs(ch.chunk_length), 4); + + switch (ch.chunk_type) { + case SCTP_INITIATION: { + struct sctp_init_chunk init; + + if (!pf_pull_hdr(m, off + chunk_start, &init, + sizeof(init), NULL, NULL, pd->af)) + return (PF_DROP); + + /* + * RFC 9620, Section 3.3.2, "The Initiate Tag is allowed to have + * any value except 0." + */ + if (init.init.initiate_tag == 0) + return (PF_DROP); + if (init.init.num_inbound_streams == 0) + return (PF_DROP); + if (init.init.num_outbound_streams == 0) + return (PF_DROP); + if (ntohl(init.init.a_rwnd) < SCTP_MIN_RWND) + return (PF_DROP); + + /* + * RFC 9260, Section 3.1, INIT chunks MUST have zero + * verification tag. + */ + if (pd->hdr.sctp.v_tag != 0) + return (PF_DROP); + + pd->sctp_flags |= PFDESC_SCTP_INIT; + break; + } + case SCTP_INITIATION_ACK: + pd->sctp_flags |= PFDESC_SCTP_INIT_ACK; + break; + case SCTP_ABORT_ASSOCIATION: + pd->sctp_flags |= PFDESC_SCTP_ABORT; + break; + case SCTP_SHUTDOWN: + case SCTP_SHUTDOWN_ACK: + pd->sctp_flags |= PFDESC_SCTP_SHUTDOWN; + break; + case SCTP_SHUTDOWN_COMPLETE: + pd->sctp_flags |= PFDESC_SCTP_SHUTDOWN_COMPLETE; + break; + case SCTP_COOKIE_ECHO: + case SCTP_COOKIE_ACK: + pd->sctp_flags |= PFDESC_SCTP_COOKIE; + break; + case SCTP_DATA: + pd->sctp_flags |= PFDESC_SCTP_DATA; + break; + default: + pd->sctp_flags |= PFDESC_SCTP_OTHER; + break; + } + } + + /* Validate chunk lengths vs. packet length. */ + if (off + chunk_off != pd->tot_len) + return (PF_DROP); + + /* + * INIT, INIT_ACK or SHUTDOWN_COMPLETE chunks must always be the only + * one in a packet. + */ + if ((pd->sctp_flags & PFDESC_SCTP_INIT) && + (pd->sctp_flags & ~PFDESC_SCTP_INIT)) + return (PF_DROP); + if ((pd->sctp_flags & PFDESC_SCTP_INIT_ACK) && + (pd->sctp_flags & ~PFDESC_SCTP_INIT_ACK)) + return (PF_DROP); + if ((pd->sctp_flags & PFDESC_SCTP_SHUTDOWN_COMPLETE) && + (pd->sctp_flags & ~PFDESC_SCTP_SHUTDOWN_COMPLETE)) + return (PF_DROP); + + return (PF_PASS); +} + +int +pf_normalize_sctp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff, + int off, void *h, struct pf_pdesc *pd) +{ + struct pf_krule *r, *rm = NULL; + struct sctphdr *sh = &pd->hdr.sctp; + u_short reason; + sa_family_t af = pd->af; + int srs; + + PF_RULES_RASSERT(); + + /* Unconditionally scan the SCTP packet, because we need to look for + * things like shutdown and asconf chunks. */ + if (pf_scan_sctp(m, ipoff, off, pd) != PF_PASS) + goto sctp_drop; + + r = TAILQ_FIRST(pf_main_ruleset.rules[PF_RULESET_SCRUB].active.ptr); + /* Check if there any scrub rules. Lack of scrub rules means enforced + * packet normalization operation just like in OpenBSD. */ + srs = (r != NULL); + while (r != NULL) { + pf_counter_u64_add(&r->evaluations, 1); + if (pfi_kkif_match(r->kif, kif) == r->ifnot) + r = r->skip[PF_SKIP_IFP].ptr; + else if (r->direction && r->direction != dir) + r = r->skip[PF_SKIP_DIR].ptr; + else if (r->af && r->af != af) + r = r->skip[PF_SKIP_AF].ptr; + else if (r->proto && r->proto != pd->proto) + r = r->skip[PF_SKIP_PROTO].ptr; + else if (PF_MISMATCHAW(&r->src.addr, pd->src, af, + r->src.neg, kif, M_GETFIB(m))) + r = r->skip[PF_SKIP_SRC_ADDR].ptr; + else if (r->src.port_op && !pf_match_port(r->src.port_op, + r->src.port[0], r->src.port[1], sh->src_port)) + r = r->skip[PF_SKIP_SRC_PORT].ptr; + else if (PF_MISMATCHAW(&r->dst.addr, pd->dst, af, + r->dst.neg, NULL, M_GETFIB(m))) + r = r->skip[PF_SKIP_DST_ADDR].ptr; + else if (r->dst.port_op && !pf_match_port(r->dst.port_op, + r->dst.port[0], r->dst.port[1], sh->dest_port)) + r = r->skip[PF_SKIP_DST_PORT].ptr; + else { + rm = r; + break; + } + } + + if (srs) { + /* With scrub rules present SCTP normalization happens only + * if one of rules has matched and it's not a "no scrub" rule */ + if (rm == NULL || rm->action == PF_NOSCRUB) + return (PF_PASS); + + pf_counter_u64_critical_enter(); + pf_counter_u64_add_protected(&r->packets[dir == PF_OUT], 1); + pf_counter_u64_add_protected(&r->bytes[dir == PF_OUT], pd->tot_len); + pf_counter_u64_critical_exit(); + } + + /* Verify we're a multiple of 4 bytes long */ + if ((pd->tot_len - off - sizeof(struct sctphdr)) % 4) + goto sctp_drop; + + /* INIT chunk needs to be the only chunk */ + if (pd->sctp_flags & PFDESC_SCTP_INIT) + if (pd->sctp_flags & ~PFDESC_SCTP_INIT) + goto sctp_drop; + + return (PF_PASS); + +sctp_drop: + REASON_SET(&reason, PFRES_NORM); + if (rm != NULL && r->log) + PFLOG_PACKET(kif, m, AF_INET, reason, r, NULL, NULL, pd, + 1); + + return (PF_DROP); +} + #ifdef INET void pf_scrub_ip(struct mbuf **m0, struct pf_pdesc *pd) From nobody Fri Jul 21 10:32:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8l2d5sz4pG4v; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8l1pJ8z3q31; Fri, 21 Jul 2023 10:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHVI0Ze1OfcD3Z1PX87LIRRer+tFZWueKfEVXMEp5rI=; b=bx5QNAJGw0HsZ3+XUZfFTvUtOk38h3DYZ/2Z/GrZtvxN9fQfG8lr3rXIquWt8fJeAOp9PW uNvUZEMO/lPHh72dCIdfXKzPcOrNowkjKmYuN8KSbYOd8YH4HwVpx6vRnSZVAjEAzun/ZH lPK2LVKYDx2esC3jtI6CsWtv2q/4fgZ2mt+yNf2BhHq2C55Qzzc9xMP8xOyenH0ZN3UV0j s04cAJKySuE7kPwDXkdNoIBAgFx5KDv+C+iYJkPMq2Zwi8BP+z/NNUgBtLYN2gmPoVma+P XLrdj/SXgMSqDvA2drIh0SKOfCWWFrS+Y/2+M2B+OWxp35Id3q6LEE5bBac8Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HHVI0Ze1OfcD3Z1PX87LIRRer+tFZWueKfEVXMEp5rI=; b=Wyiwbi773bgt3SI/UNoVAd2Ml3roUICCKJYLDsJYXD5P2ihb2zD/SyGqfWB9+c85NLWF4O chHXZloK+5plvAo8Kp184BfXlmFdkcMjuyMC2q6ge6fkyNoe0GmgpAld6NMMeiRcdLe1Kr 4YLIAhhVn7RFC1piuWV5MUwlxJ5VLyxUixsMMpPaWzl21W39POMYLOPracLA0HLPu/mx77 NRnv/Hrle09ZHsjFj/opTlhk+YQ6KoIKP9LADKOI188DUqZG16PRfC9RzQTCSjWJrD5RuF H/nWoFY3yGSFGMrlxl+u7H/MfGHQqx3XnMWaY8o9OSxDsQlKxHmgko4OVYR02w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935559; a=rsa-sha256; cv=none; b=mP6XjDjymsOd6qObOTvuSWgjeVUAUDIDiqAZzQZMyAa1vXofPMM+eujMdoq/a9eYhqg9Vs YX9JSpKWdM32M3mfflmkzBAEIbo1C/c/CvTKgf72Pdpq1OKwKg125sSbbiIgsmLhuenU5u ySrcWFyVdUnO6ca42yWOjvryYW+68PmPQRdPOjk1WR7Vdw3t4XjgzXPqZVY35dbV702Zba /jmV+NWClrSNuzxtyxsC4Dw4rlXIwc3kIHGOBlv+5RfkPmR7UanbLForrdujEHFoliLxLg /fh9yiq86oImra+oSuYd1fXrK+3bPQ/e9DX1j3V3mxQzwB4nFyHl4JRzWWJD+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 4R6m8l0vgqz183n; Fri, 21 Jul 2023 10:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWdHd010533; Fri, 21 Jul 2023 10:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWd93010532; Fri, 21 Jul 2023 10:32:39 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:39 GMT Message-Id: <202307211032.36LAWd93010532@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: 953634737939 - main - pf tests: basic SCTP connection test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95363473793986eeecf19f7ed78d05f25cfa7b87 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95363473793986eeecf19f7ed78d05f25cfa7b87 commit 95363473793986eeecf19f7ed78d05f25cfa7b87 Author: Kristof Provost AuthorDate: 2023-04-27 09:13:40 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf tests: basic SCTP connection test pf can now inspect SCTP. Check that we can set up a connection. IPv4 and IPv6 tests. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40863 --- tests/sys/netpfil/pf/Makefile | 1 + tests/sys/netpfil/pf/sctp.sh | 190 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index 8e923b6971b8..19c87486d8bb 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -31,6 +31,7 @@ ATF_TESTS_SH+= altq \ rules_counter \ scrub_compat \ scrub_pass \ + sctp \ set_skip \ set_tos \ src_track \ diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh new file mode 100644 index 000000000000..5064fe316e5e --- /dev/null +++ b/tests/sys/netpfil/pf/sctp.sh @@ -0,0 +1,190 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright © 2023 Orange Business Services +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +sctp_init() +{ + pft_init + if ! kldstat -q -m sctp; then + atf_skip "This test requires SCTP" + fi +} + +atf_test_case "basic_v4" "cleanup" +basic_v4_head() +{ + atf_set descr 'Basic SCTP connection over IPv4 passthrough' + atf_set require.user root +} + +basic_v4_body() +{ + sctp_init + + j="sctp:basic_v4" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now with scrub rules present, so normalization is done + pft_set_rules ${j}a \ + "scrub on ${j}a" \ + "block" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now fail with a blocked port + echo "foo" | jexec ${j}a nc --sctp -N -l 1235 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 192.0.2.1 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi + + # Now fail with a blocked port but passing source port + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 192.0.2.1 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi +} + +basic_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "basic_v6" "cleanup" +basic_v6_head() +{ + atf_set descr 'Basic SCTP connection over IPv6' + atf_set require.user root +} + +basic_v6_body() +{ + sctp_init + + j="sctp:basic_v6" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 up no_dad + jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -6 -c 1 2001:db8::b + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block proto sctp" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now with scrub rules present, so normalization is done + pft_set_rules ${j}a \ + "scrub on ${j}a" \ + "block proto sctp" \ + "pass in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Now fail with a blocked port + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1235 & + sleep 1 + + out=$(jexec ${j}b nc --sctp -N -w 3 2001:db8::a 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi + + # Now fail with a blocked port but passing source port + out=$(jexec ${j}b nc --sctp -N -w 3 -p 1234 2001:db8::a 1235) + if [ "$out" == "foo" ]; then + atf_fail "SCTP port block failed" + fi +} + +basic_v6_cleanup() +{ + pft_cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case "basic_v4" + atf_add_test_case "basic_v6" +} From nobody Fri Jul 21 10:32:40 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8n53lMz4pFp5; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8m2cMPz3qMD; Fri, 21 Jul 2023 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJAB0J5Tioq0JVGYZATG1mYPCn/Fcvf9g4AYupAqIk=; b=HKm7TaTa746kgGlu3i4ylmenCwvdB4mqxchgDFgbUSg7RgQI/oVqM4HbSSI/GyrB8E36Ux zhDLh+Nca08EiBN/l8JvD/Lhi3O24oAOt62/OeN8kQZwYWEGwJTEr2aLUwnT2oUXJ6omqK wDNLZA9A3yZofl+di4i8VXk5famMH61fGYUg7TGDxfKviZh3kFk2EGqwxK/IwstkZmFe6a kF1GfwrYsPmqswEJ+Vm82hqutIeC8C+VVjmlWKaganRZpzjZwQWRf4yp/RohlBl+ParZh6 mPW9Y0gPJJT2MFWfhhAiNXr90uwfVxhF2yuuM7ivRSV9gJicLrtSJa/cZGkAtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935560; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BgJAB0J5Tioq0JVGYZATG1mYPCn/Fcvf9g4AYupAqIk=; b=WAA15pBl2WG87jowPJCJL2ZAmLscgaeR30Uh3cz7cZLiwh8nMy+mKtunh06th+xk4oP0wt WTXrsmH3NTJeQFIfB8KiFqipAgGYMe9IYqQUku3hJ4gMPVTLx84JEuke+uSgcoXdhIV++q 6TihJaKcbMqe2o8jgVUKynl3RFk2ddTRpj88GEv0tBlvdIWjZLmWycdi+k1YSr5q3e11K8 eTv8a0QbUYL6xUueIziB8K07veteQU2qOA+PtPE2egNJBNsScWLo6ovwKhkJOqQD0y8XdR qxK4pPjMPTcrq4QurzLglMUECxdz7f/LniHz8VIU07czpaFGARst0Vhxx3w4jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935560; a=rsa-sha256; cv=none; b=sCS6nekJ1kAr7RaTeOHTlx6OqCd7u0K9FI36x3EO42NQEacyNXC+CpyJMGTT78dYuBZBQG Mk31XN+zMS5zfY3niwXohOF+wfv8B1+wq/UZ7iYAAaLb5ZAt3/tEw9rieUATk3y4mAHLPx 1NDFQ0sGcXY2Z4ca4ctpnhDsE/+n44ShHz9Huit9Zy/w4gPok4opcB0i08OJGRYWQrUyxd D/AM8+jNwWSPh671cS58xu8pQJBlYB/y8uXBiDpRRQCWp3AIftEJQ8ppB3LnEs5EPKsbEr pTGFuXgaZYUJXJT6kYLNwcJhF0TiP3MvWxBXso8VcC1+mQsyqsp5nUWuav9IBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8m1THCz18Ct; Fri, 21 Jul 2023 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWeXR010552; Fri, 21 Jul 2023 10:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWeBL010551; Fri, 21 Jul 2023 10:32:40 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:40 GMT Message-Id: <202307211032.36LAWeBL010551@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: d1bc1e9e1ae0 - main - pf: support 'return' for SCTP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1bc1e9e1ae04016e16154884914d839566ebaec Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1bc1e9e1ae04016e16154884914d839566ebaec commit d1bc1e9e1ae04016e16154884914d839566ebaec Author: Kristof Provost AuthorDate: 2023-05-31 14:03:39 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf: support 'return' for SCTP Send an SCTP Abort message if we're refusing a connection, just like we send a RST for TCP. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40864 --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_norm.c | 2 + 3 files changed, 120 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 86e15f7c1709..f0fe15a5e9ee 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1581,6 +1581,7 @@ struct pf_pdesc { #define PFDESC_SCTP_DATA 0x0040 #define PFDESC_SCTP_OTHER 0x0080 u_int16_t sctp_flags; + u_int32_t sctp_initiate_tag; }; #endif diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index a721385f761f..70a00147ccf2 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -2960,6 +2960,120 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, return (m); } +static void +pf_send_sctp_abort(sa_family_t af, struct pf_pdesc *pd, + uint8_t ttl, int rtableid) +{ + struct mbuf *m; +#ifdef INET + struct ip *h = NULL; +#endif /* INET */ +#ifdef INET6 + struct ip6_hdr *h6 = NULL; +#endif /* INET6 */ + struct sctphdr *hdr; + struct sctp_chunkhdr *chunk; + struct pf_send_entry *pfse; + int off = 0; + + MPASS(af == pd->af); + + m = m_gethdr(M_NOWAIT, MT_DATA); + if (m == NULL) + return; + + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + /* The rest of the stack assumes a rcvif, so provide one. + * This is a locally generated packet, so .. close enough. */ + m->m_pkthdr.rcvif = V_loif; + + /* IPv4|6 header */ + switch (af) { +#ifdef INET + case AF_INET: + bzero(m->m_data, sizeof(struct ip) + sizeof(*hdr) + sizeof(*chunk)); + + h = mtod(m, struct ip *); + + /* IP header fields included in the TCP checksum */ + + h->ip_p = IPPROTO_SCTP; + h->ip_len = htons(sizeof(*h) + sizeof(*hdr) + sizeof(*chunk)); + h->ip_ttl = ttl ? ttl : V_ip_defttl; + h->ip_src = pd->dst->v4; + h->ip_dst = pd->src->v4; + + off += sizeof(struct ip); + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + bzero(m->m_data, sizeof(struct ip6_hdr) + sizeof(*hdr) + sizeof(*chunk)); + + h6 = mtod(m, struct ip6_hdr *); + + /* IP header fields included in the TCP checksum */ + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_nxt = IPPROTO_SCTP; + h6->ip6_plen = htons(sizeof(*h6) + sizeof(*hdr) + sizeof(*chunk)); + h6->ip6_hlim = ttl ? ttl : V_ip6_defhlim; + memcpy(&h6->ip6_src, &pd->dst->v6, sizeof(struct in6_addr)); + memcpy(&h6->ip6_dst, &pd->src->v6, sizeof(struct in6_addr)); + + off += sizeof(struct ip6_hdr); + break; +#endif /* INET6 */ + } + + /* SCTP header */ + hdr = mtodo(m, off); + + hdr->src_port = pd->hdr.sctp.dest_port; + hdr->dest_port = pd->hdr.sctp.src_port; + hdr->v_tag = pd->sctp_initiate_tag; + hdr->checksum = 0; + + /* Abort chunk. */ + off += sizeof(struct sctphdr); + chunk = mtodo(m, off); + + chunk->chunk_type = SCTP_ABORT_ASSOCIATION; + chunk->chunk_length = htons(sizeof(*chunk)); + + /* SCTP checksum */ + off += sizeof(*chunk); + m->m_pkthdr.len = m->m_len = off; + + pf_sctp_checksum(m, off - sizeof(*hdr) - sizeof(*chunk));; + + if (rtableid >= 0) + M_SETFIB(m, rtableid); + + /* Allocate outgoing queue entry, mbuf and mbuf tag. */ + pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT); + if (pfse == NULL) { + m_freem(m); + return; + } + + switch (af) { +#ifdef INET + case AF_INET: + pfse->pfse_type = PFSE_IP; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + pfse->pfse_type = PFSE_IP6; + break; +#endif /* INET6 */ + } + + pfse->pfse_m = m; + pf_send(pfse); +} + void pf_send_tcp(const struct pf_krule *r, sa_family_t af, const struct pf_addr *saddr, const struct pf_addr *daddr, @@ -3063,6 +3177,9 @@ pf_return(struct pf_krule *r, struct pf_krule *nr, struct pf_pdesc *pd, ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, r->return_ttl, true, 0, 0, rtableid); } + } else if (pd->proto == IPPROTO_SCTP && + (r->rule_flag & PFRULE_RETURN)) { + pf_send_sctp_abort(af, pd, r->return_ttl, rtableid); } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && r->return_icmp) pf_send_icmp(m, r->return_icmp >> 8, diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 38312712a0ad..6dda410d8327 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -2065,6 +2065,8 @@ pf_scan_sctp(struct mbuf *m, int ipoff, int off, struct pf_pdesc *pd) if (pd->hdr.sctp.v_tag != 0) return (PF_DROP); + pd->sctp_initiate_tag = init.init.initiate_tag; + pd->sctp_flags |= PFDESC_SCTP_INIT; break; } From nobody Fri Jul 21 10:32:43 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4cqDz4pG7M; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8q5htTz3qSF; Fri, 21 Jul 2023 10:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1WVKJvcjQ7LdxavE/jnsi2LGXOZSW6GP9jR0fn+KUk=; b=DlTMjluUg/nfsZ8LCgjJiCZWuAtr6XpS33M5kZgV2iCKXscUxBCZflctcX+4ZcRkvLG+Ip 0HOfnxMAWCjW9BM6yufxsFE6O+8/z0FAVkKggEN7t/ghuR5yh+Tyr86Dnnu1cbEHQBewxY TF7vzLdYAMCiq7AJBYD9TWa868KXg8H+Kij3Z53nkpz3lH0fK+G58dRthycYv3A5+4EjOm 1VX0B3sBfWZUf9ni0vGcKRaUm7GbYk2fQwBqy8JacqaVJvECK8cFD2YgTYJOqwwtpEtD4w 1F9REOFZGKbXFpToSj++PPpfzFrTb0K1RNFZYoY3+xwOxPukKRfO4Kil/LBY0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/1WVKJvcjQ7LdxavE/jnsi2LGXOZSW6GP9jR0fn+KUk=; b=eUszE6Le0LPrLHcSUbqMkmVAIIwSQJBH1TU/6ZExq/BNCEvTw4TYAKg7+O0jFwGol8QjWj icMeWZhC/g6UbQYmDJODQRBBc1x6atXf5LL1OedwgXnC6LQq60zk2Ngg116d48JAUJ9L2o 0rAn+ykkksCMS9cditvIkGxWH16qcuDnvu/bVv66mXAPyUXb81fVXL/bTY6RhHRJ8+Zrz4 ITAzTkX8XJX0RBM97/lBO0AyqUR9cur6F7jGkUROhvrrLU7rW8/YRDUuOUMvsT9O0eVxDh GGGxBby+E7qV5TKQkCWe1I0IC6ZADzrgPY/BWgfgrrE+fmu94rlfdBLfZQ0jdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935563; a=rsa-sha256; cv=none; b=iXUvPjqJwfA+tvk9ze2FqZqs6RTqP5AhBwVh2aYmvPN6vxiqbQw6JHeoi7ecx8FSMMsSxD SALbv4c2rtGQQS6FDk6IbnRICUjgFkFKJxA9oHc3yKYIbnPvBSK2mP+AExp/HDQBTeXhoO 5qi6HQgPFLfOs/e0nv9pyrid7eKMs4Gwglg1cKG21ypK7hoq+fpCvU9P8weHWZBBHpR46l E59EyB8oyYKnMUqphQm6l5oiSeXIVh7oPwkLsb0Sf9TqwIXhBQ8KVau3B4Ji6ZsxbRMrKB 3I/RGIaDAHtmz4Ggz1aH9i6PA1sI8g7Ht1fZxnkpSUHC+GYKl14H6NToQi2rYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8q4KCLz18Cv; Fri, 21 Jul 2023 10:32:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWhJh010615; Fri, 21 Jul 2023 10:32:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWhbj010614; Fri, 21 Jul 2023 10:32:43 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:43 GMT Message-Id: <202307211032.36LAWhbj010614@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: 1e02b7cb07ce - main - pf tests: test SCTP NAT List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab commit 1e02b7cb07ce31ad3c9e8c8be806d2825febb5ab Author: Kristof Provost AuthorDate: 2023-06-01 13:28:58 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test SCTP NAT MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40867 --- tests/sys/netpfil/pf/sctp.sh | 106 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 59697ad37be2..659c11c62113 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -298,10 +298,116 @@ abort_v4_cleanup() pft_cleanup } +atf_test_case "nat_v4" "cleanup" +nat_v4_head() +{ + atf_set descr 'Test NAT-ing SCTP over IPv4' + atf_set require.user root +} + +nat_v4_body() +{ + sctp_init + + j="sctp:nat_v4" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up + jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up + jexec ${j}gw sysctl net.inet.ip.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "nat on ${epair_srv}b from 192.0.2.0/24 -> (${epair_srv}b)" \ + "pass" + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + echo "foo" | jexec ${j}srv nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}c nc --sctp -N -w 3 198.51.100.1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi +} + +nat_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "nat_v6" "cleanup" +nat_v6_head() +{ + atf_set descr 'Test NAT-ing SCTP over IPv6' + atf_set require.user root +} + +nat_v6_body() +{ + sctp_init + + j="sctp:nat_v6" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a inet6 2001:db8::1/64 up no_dad + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b inet6 2001:db8::2/64 up no_dad + jexec ${j}gw ifconfig ${epair_c}a inet6 2001:db8:1::1/64 up no_dad + jexec ${j}gw sysctl net.inet6.ip6.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b inet6 2001:db8:1::2/64 up no_dad + jexec ${j}c route add -6 default 2001:db8:1::1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "nat on ${epair_srv}b from 2001:db8:1::/64 -> (${epair_srv}b)" \ + "pass" + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -6 -c 1 2001:db8::1 + + echo "foo" | jexec ${j}srv nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}c nc --sctp -N -w 3 2001:db8::1 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi +} + +nat_v6_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" atf_add_test_case "abort_v4" atf_add_test_case "abort_v6" + atf_add_test_case "nat_v4" + atf_add_test_case "nat_v6" } From nobody Fri Jul 21 10:32:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4gh4z4pG7N; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8n706jz3qSB; Fri, 21 Jul 2023 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BByRj/jWOVSrRxNzc/OEiA2UzjTIAb7lCtVvyGqVTxs=; b=ffdtnAq7a9wAt+GYUILJYbMNpVMXS7gNXsPJrwDyTnwL6EQD7Qb3rOCVKvCo5q20o3cHJ4 UJ3sQ5a+4TUIwgfO3bC+cDNsMGh9cBa8uHjpdNNLXkJCPAa8ZK5n22a58VrOsE/PGSPVUN DY+LRs5vskiOxjaWYd4gnIlLn/JIDceelus+OZCDhP6yJhgH6R5CcXvJ5KnvVaZKiYGRqu OS/9myBPEB8984YI5Kb7YXlpsDHxz+9djgWtJ5hFWrc5mkEk63Kgo2EShW0QCVdvxkTKm6 r5LvwR1xzA9kcM9AxO9X09d3d2q4TPLp066GjJ2gmzybfNv79otkzLyCZ/qULA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BByRj/jWOVSrRxNzc/OEiA2UzjTIAb7lCtVvyGqVTxs=; b=YrP+9yhbSDED2q8wIi6Wf62/btocXu4TAJug+2smNPLqFDJ2z6XeWfQgm02qvayr4rbhcb PaY3nLt31lPaGEXrLSyeLSXqmDEUKXskwbvisje9CLr4t4dKsW3ahBFPFvlAY640BJXrZP rkkN/UOvPoGq9+23TZi54Wa2+qzkV/MIcGoSiA9M6+vzQuW+/gLnvnduuSadI7Cyjy0o1D glU7K6Mys0V0mELecmeZtQzKYbRHrzF9oh4UAneQk1P/3QE0r+Rrg9r8rg2qQSJIx93mCQ EekBDtpcmV1IjTxEaTknnh5vlKrewj6PxI3DE//uM0+KhZyRiMlO4TA1rM1Egw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935562; a=rsa-sha256; cv=none; b=gejsZ8wDG6+tVwQefSSYLfQ49mqe9IQSuL66sVi69MTM77PkgTV7I8U3crNZTOCOAR6QuG CAozMHzihEGcU3IQfp8B9j5ujkF1bPABjfU2EpeaZYFZcL72wRDFSDS8ngiV6Rz5WPuOXD vClsVykBmx631ZIVBC5MHcYV52rcMVz+IqNEs8DUPqUE/n6oxP0WnSNzZDkEIojM6ZjH8u rs1URgEEY1LISKtM5JnyBG+MvbntaMNgnteCghyJs9SGZQ80erM4+di6czqbRuJb0AvhAf k2dLDnstWurgOsRRVJqn74bzq+pCNY46dkXJ7pFM25eSQ96imeatqV40KBrQrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8n565xz18Tb; Fri, 21 Jul 2023 10:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWf5A010573; Fri, 21 Jul 2023 10:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWfMC010572; Fri, 21 Jul 2023 10:32:41 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:41 GMT Message-Id: <202307211032.36LAWfMC010572@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: 2d42aa9d7ba6 - main - pf tests: test SCTP 'return' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d42aa9d7ba64fe7166f76234a595637f0c212cf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2d42aa9d7ba64fe7166f76234a595637f0c212cf commit 2d42aa9d7ba64fe7166f76234a595637f0c212cf Author: Kristof Provost AuthorDate: 2023-05-31 19:45:29 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:18 +0000 pf tests: test SCTP 'return' Ensure that we send a correct abort message for 'block return' rules. Test this by validating that nc doesn't sit around waiting for a connection. It should give up immediately when it receives the abort. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40865 --- tests/sys/netpfil/pf/sctp.sh | 117 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 5064fe316e5e..59697ad37be2 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -182,9 +182,126 @@ basic_v6_cleanup() pft_cleanup } +atf_test_case "abort_v4" "cleanup" +abort_v4_head() +{ + atf_set descr 'Test sending ABORT messages' + atf_set require.user root +} + +abort_v4_body() +{ + sctp_init + + j="sctp:abort_v4" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a 192.0.2.1/24 up + jexec ${j}b ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -c 1 192.0.2.2 + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block return in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + # If we get the abort we'll exit immediately, if we don't timeout will + # stop nc. + out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234) + if [ $? -eq 124 ]; then + atf_fail 'Abort not received' + fi + if [ "$out" == "foo" ]; then + atf_fail "block failed entirely" + fi + + # Without 'return' we will time out. + pft_set_rules ${j}a \ + "block in proto sctp to port 1234" + + out=$(jexec ${j}b timeout 3 nc --sctp -N 192.0.2.1 1234) + if [ $? -ne 124 ]; then + atf_fail 'Abort sent anyway?' + fi +} + +abort_v4_cleanup() +{ + pft_cleanup +} + +atf_test_case "abort_v6" "cleanup" +abort_v4_head() +{ + atf_set descr 'Test sending ABORT messages over IPv6' + atf_set require.user root +} + +abort_v6_body() +{ + sctp_init + + j="sctp:abort_v6" + epair=$(vnet_mkepair) + + vnet_mkjail ${j}a ${epair}a + vnet_mkjail ${j}b ${epair}b + + jexec ${j}a ifconfig ${epair}a inet6 2001:db8::a/64 no_dad + jexec ${j}b ifconfig ${epair}b inet6 2001:db8::b/64 no_dad + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}a ping -6 -c 1 2001:db8::b + + jexec ${j}a pfctl -e + pft_set_rules ${j}a \ + "block return in proto sctp to port 1234" + + echo "foo" | jexec ${j}a nc -6 --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + # If we get the abort we'll exit immediately, if we don't timeout will + # stop nc. + out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234) + if [ $? -eq 124 ]; then + atf_fail 'Abort not received' + fi + if [ "$out" == "foo" ]; then + atf_fail "block failed entirely" + fi + + # Without 'return' we will time out. + pft_set_rules ${j}a \ + "block in proto sctp to port 1234" + + out=$(jexec ${j}b timeout 3 nc --sctp -N 2001:db8::a 1234) + if [ $? -ne 124 ]; then + atf_fail 'Abort sent anyway?' + fi +} + +abort_v4_cleanup() +{ + pft_cleanup +} atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" + atf_add_test_case "abort_v4" + atf_add_test_case "abort_v6" } From nobody Fri Jul 21 10:32:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8v4ggwz4pFvP; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8p4NvTz3qSC; Fri, 21 Jul 2023 10:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MT0gV93MqexUBEnfmWwSQLyNsGCLt0qa5x2lHMfKPT8=; b=gMTLElFmFQ/NbzN7NzXzDxaZ7P0fD7QbCXFiipKP0jd5Qs07RSsIL6lIZ8WxZD7/Mo6jQq txfYIrGY1PBHsEOqht2c7105sMZx0gTABVpefnaTIbuY1haaQpF2v6ygy+/TgTuwjx38V1 mpO6L8Dgw72R5b3RAS4lLWAkf9rzkhw9k9Uf9wd9HXLS3rPfJRr1cWHmN+PzPkuv4CKlyx 0MTzoBbZ+A7No6+uYmChLu8z0qimRJnuy5ncoGyy8hzlxaU0HRy9GqPccAhpkBzDHR9+p4 j7AUOlkKLU9mMaLUxwXLY+ec+0kYPTkoOWqMweMdsI2UPwR0rijAcdW4KlcbLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MT0gV93MqexUBEnfmWwSQLyNsGCLt0qa5x2lHMfKPT8=; b=UQ0OssY7nsS1T8O5RCONlF+OEz2VC+tJu1Kr6Sl0iHb28O/xYCK000etsXFTphSspjgPEp SOjR0d4JM9bF1FZRjYWN6y0Av7QBxwFZ3X9Os0JMdMt+sjXwzobO2Eh201gb5BGFNkwKzp mb4nOJajuPxNdB8G5db93gTTGpVTqYAttOyEludRHHOt7vDssEDaZBb5NZq/cII9ufslfF ionbyMtjD+6XwImt/uEyCs5cz3WCBrc08PazJDnykxH6uxrUF0Z3xmJMCoaavf5l64gBU1 knT51+qIcpKR2dgjd/HmX0gjDBK9wARXZE5hShTLhZO1tDhJnWbn+kLILyM40w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935562; a=rsa-sha256; cv=none; b=ne5FLqdFEey5YTAPfSSVOAgTcvHuzA6RBznbvPf4ue8+LMjORoyXweI2h1HpW4y46y2mCw QMjcR5AJut37vAQqY7Q8l/9VmYc/qafW4arVBiX5DzeZjWxakyJxIndFJHdVaJIPlQxbIG nKbZWTbAHukjYdh+0bjd0WzXlbqcEbuDdDuTHu5GO51WxQlcew+06Nk9LMKcCTfIyL4BV5 esndZChWBQagjw9rU3pWh8plYWYdID0S+ohqPu78H5TOaZTsxMEzisPXV3oDW9v7vk90Zs o2+jz6yfKn2CAUx20oYK1ahvGNPUK5g9Y3+6ZPYleoRdLwS5Sjk4VKTJSRtLCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8p36nqz18G7; Fri, 21 Jul 2023 10:32:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWgQa010596; Fri, 21 Jul 2023 10:32:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWg4A010595; Fri, 21 Jul 2023 10:32:42 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:42 GMT Message-Id: <202307211032.36LAWg4A010595@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: 6053adafaa54 - main - pf: add SCTP NAT support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6053adafaa54204f91c43939fa334bde835403cb Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6053adafaa54204f91c43939fa334bde835403cb commit 6053adafaa54204f91c43939fa334bde835403cb Author: Kristof Provost AuthorDate: 2023-06-01 13:04:48 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf: add SCTP NAT support Support NAT-ing SCTP connections. This is mostly similar to UDP and TCP, but we refuse to change ports for SCTP, to avoid interfering with multihomed connections. As a result we also never copy the SCTP header back or recalculate checksums as we'd do for TCP or UDP (because we don't modify the header for SCTP). We do use the existing pf_change_ap() function to modify the packet, because we may still need to update the IPv4 header checksum. Reviewed by: tuexen MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40866 --- sys/netpfil/pf/pf.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_lb.c | 14 ++++++++++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 70a00147ccf2..9162f8cf949b 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -528,6 +528,23 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, m_copyback(m, off, sizeof(*uh), (caddr_t)uh); break; } + case IPPROTO_SCTP: { + struct sctphdr *sh = &pd->hdr.sctp; + uint16_t checksum = 0; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af)) { + pf_change_ap(m, pd->src, &sh->src_port, pd->ip_sum, + &checksum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, pd->af); + } + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) { + pf_change_ap(m, pd->dst, &sh->dest_port, pd->ip_sum, + &checksum, &nk->addr[pd->didx], + nk->port[pd->didx], 1, pd->af); + } + + break; + } case IPPROTO_ICMP: { struct icmp *ih = &pd->hdr.icmp; @@ -4472,6 +4489,25 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, struct pfi_kkif *kif, } rewrite++; break; + case IPPROTO_SCTP: { + uint16_t checksum = 0; + + if (PF_ANEQ(saddr, &nk->addr[pd->sidx], af) || + nk->port[pd->sidx] != sport) { + pf_change_ap(m, saddr, &pd->hdr.sctp.src_port, + pd->ip_sum, &checksum, + &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, af); + } + if (PF_ANEQ(daddr, &nk->addr[pd->didx], af) || + nk->port[pd->didx] != dport) { + pf_change_ap(m, daddr, &pd->hdr.sctp.dest_port, + pd->ip_sum, &checksum, + &nk->addr[pd->didx], + nk->port[pd->didx], 1, af); + } + break; + } #ifdef INET case IPPROTO_ICMP: nk->port[0] = nk->port[1]; @@ -5856,6 +5892,26 @@ pf_test_state_sctp(struct pf_kstate **state, struct pfi_kkif *kif, (*state)->expire = time_uptime; + /* translate source/destination address, if necessary */ + if ((*state)->key[PF_SK_WIRE] != (*state)->key[PF_SK_STACK]) { + uint16_t checksum = 0; + struct pf_state_key *nk = (*state)->key[pd->didx]; + + if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], pd->af) || + nk->port[pd->sidx] != pd->hdr.sctp.src_port) { + pf_change_ap(m, pd->src, &pd->hdr.sctp.src_port, + pd->ip_sum, &checksum, &nk->addr[pd->sidx], + nk->port[pd->sidx], 1, pd->af); + } + + if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af) || + nk->port[pd->didx] != pd->hdr.sctp.dest_port) { + pf_change_ap(m, pd->dst, &pd->hdr.sctp.dest_port, + pd->ip_sum, &checksum, &nk->addr[pd->didx], + nk->port[pd->didx], 1, pd->af); + } + } + return (PF_PASS); } diff --git a/sys/netpfil/pf/pf_lb.c b/sys/netpfil/pf/pf_lb.c index 98e1a2d32488..3055741f1fc0 100644 --- a/sys/netpfil/pf/pf_lb.c +++ b/sys/netpfil/pf/pf_lb.c @@ -240,7 +240,15 @@ pf_get_sport(sa_family_t af, u_int8_t proto, struct pf_krule *r, * port search; start random, step; * similar 2 portloop in in_pcbbind */ - if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP || + if (proto == IPPROTO_SCTP) { + key.port[1] = sport; + if (!pf_find_state_all_exists(&key, PF_IN)) { + *nport = sport; + return (0); + } else { + return (1); /* Fail mapping. */ + } + } else if (!(proto == IPPROTO_TCP || proto == IPPROTO_UDP || proto == IPPROTO_ICMP) || (low == 0 && high == 0)) { /* * XXX bug: icmp states don't use the id on both sides. @@ -711,6 +719,10 @@ pf_get_translation(struct pf_pdesc *pd, struct mbuf *m, int off, PF_POOLMASK(naddr, naddr, &r->rpool.cur->addr.v.a.mask, daddr, pd->af); + /* Do not change SCTP ports. */ + if (pd->proto == IPPROTO_SCTP) + break; + if (r->rpool.proxy_port[1]) { uint32_t tmp_nport; From nobody Fri Jul 21 10:32:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44wkz4pFxm; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8r6JgHz3qGC; Fri, 21 Jul 2023 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qz2gAS2Dd4BefHhpjvC2ORfIWZbakjKbFjsqe6W46ic=; b=u2SOannug5pzaA8d3mMSdSDTG/4vYUqOipygWwum6yPp+o7DX6DxKPPiBJ6eaGcfCjfI2z ixs7Q9dPOdSAOCvgBftqk+oc1g4NZlxfPPVU6E26TLWQs84FUoHAW4DP+2+iv3gS4ma8qQ z4S6vKIKGANZK2UA0DR8zYvBR/XTikjKqp5xV//RZ0X17Xzh65He4WdONJWX/5pj0baCAO bQYHtUXWEDyu1Z55SlIghWw8S3mIo+FF4bmedYqzlNWwGCPRfvjKLbAPxshJc8kWQQY2qg 50gyVjm2gNr/CMbLDxw1BeSfBRqFCKGyd7FeO35g0bIfVgd0vjXs2zXgQ5QZOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qz2gAS2Dd4BefHhpjvC2ORfIWZbakjKbFjsqe6W46ic=; b=GYxPdny2+t5alB4O/UWgZ5zGXFelDyTb2QxWHUvqsVku10kP2zW5xpqVxdkVg7+Ml663KC Di8g9lCBLUbY4KwK/bHlTx5wuN93tquwyEkZOIYPEBiwCXPQ5WzGf+4vQAGbQNa8RFH5Us m6hKFlFHoBw+QlXCvvtjWWgYWYxdhQfv38J3/wN2qmEDdYbx94biwwT+mUJ1CocnZDwwOq WmMAIQCAvscs2Pr8fpNWVgM1QnUEFrsK5rtAjBOuBGW/znOAiXOgmDJapwhrDjz314yUgJ 7m74hpj+P4XVMKaQJZC1x7UyCipLnMlBCHkHOiA5M0WnyhzhVFfQ4h/0xqUhSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935564; a=rsa-sha256; cv=none; b=aNYwp3SHUibTezJucqsaqAp/+APRXW9Dzstsu5Rl1huevdFgHPl9/edQzcLaUX0G6eXWtu 1YDk8UMIQ11pGFbu/1wn71NpYr4VH8wKZnXhT/u3l4vyhrXQJXIXvHgOU1t75OlpaJd+/R x1MnekW8omjLcd0v/fppQqWS2uTKvdxEvek2EuRKtg24ZxLlaPOlZcRx2qHhH8UPuDxADi w1+/23sgrXB7S3JxBn5dvqmwfV50USIx2XvTC9hUF4eRuSGTA9+5pP+3nMzNfqL+XbyYOV Bk7ABcih/ZAwi1KEWtTEMFdIOZDRPcS3g4Vwhty0hsFOOC9h0xdhTtmoqRhFRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8r4ydBz18S0; Fri, 21 Jul 2023 10:32:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWi9E010635; Fri, 21 Jul 2023 10:32:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWivD010634; Fri, 21 Jul 2023 10:32:44 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:44 GMT Message-Id: <202307211032.36LAWivD010634@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: 4369a57514f2 - main - pf tests: test 'rdr' for SCTP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4369a57514f227c989d4de87d1ce54470279ba41 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4369a57514f227c989d4de87d1ce54470279ba41 commit 4369a57514f227c989d4de87d1ce54470279ba41 Author: Kristof Provost AuthorDate: 2023-06-01 16:03:07 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test 'rdr' for SCTP Explicitly test that we cannot change the port number with rdr. That's not a desireable feature on SCTP, because it could break multihomed connections. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40868 --- tests/sys/netpfil/pf/sctp.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 659c11c62113..2c736017f9fa 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -402,6 +402,73 @@ nat_v6_cleanup() pft_cleanup } +atf_test_case "rdr_v4" "cleanup" +rdr_v4_head() +{ + atf_set descr 'Test rdr SCTP over IPv4' + atf_set require.user root +} + +rdr_v4_body() +{ + sctp_init + + j="sctp:rdr_v4" + epair_c=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + vnet_mkjail ${j}srv ${epair_srv}a + vnet_mkjail ${j}gw ${epair_srv}b ${epair_c}a + vnet_mkjail ${j}c ${epair_c}b + + jexec ${j}srv ifconfig ${epair_srv}a 198.51.100.1/24 up + # No default route in srv jail, to ensure we're NAT-ing + jexec ${j}gw ifconfig ${epair_srv}b 198.51.100.2/24 up + jexec ${j}gw ifconfig ${epair_c}a 192.0.2.1/24 up + jexec ${j}gw sysctl net.inet.ip.forwarding=1 + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + jexec ${j}gw pfctl -e + pft_set_rules ${j}gw \ + "rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 1234" \ + "pass" + + echo "foo" | jexec ${j}c nc --sctp -N -l 1234 & + + # Wait for the server to start + sleep 1 + + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234) + if [ "$out" != "foo" ]; then + atf_fail "SCTP connection failed" + fi + + # Despite configuring port changes pf will not do so. + echo "bar" | jexec ${j}c nc --sctp -N -l 1234 & + + pft_set_rules ${j}gw \ + "rdr pass on ${epair_srv}b proto sctp from 198.51.100.0/24 to any port 1234 -> 192.0.2.2 port 4321" \ + "pass" + + # This will fail + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 4321) + if [ "$out" == "bar" ]; then + atf_fail "Port was unexpectedly changed." + fi + + # This succeeds + out=$(jexec ${j}srv nc --sctp -N -w 3 198.51.100.2 1234) + if [ "$out" != "bar" ]; then + atf_fail "Port was unexpectedly changed." + fi +} + +rdr_v4_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -410,4 +477,5 @@ atf_init_test_cases() atf_add_test_case "abort_v6" atf_add_test_case "nat_v4" atf_add_test_case "nat_v6" + atf_add_test_case "rdr_v4" } From nobody Fri Jul 21 10:32:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44w4z4pG0h; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8v1N3Tz3qGJ; Fri, 21 Jul 2023 10:32:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNzWU4RuZJId6u1PoCiw8aw28muCjzcUClgDucB7GPw=; b=XFLQS8nvx+g3fYK6uo2qdvEgFVDZDuGdF/D636/9sMfFjkJkGZ3ZGfoELR2jN3bkGfZGxi pUzj91yPycmLlMKgULfLYQuNYr3vMQBL3BOXsHazDrmZUbHurFZEIoTrZ6dDYUQYPjavxO uWC9OI67sPuAZ/XIxOlvKqM3z5DDnqi8BLzNvDXHGF5Ltxg775WAfOpWOmUgYhz9k6CeAu mouSdaoHGEwPoKS5dVhrQzLyIxpoaSjzehA5zQWkl9GziV03BUH86Mf9fZPEvsaMezT8Kt 5qdD2mF9cCQPJI91UNfPQDKR/Yme1K6D0PT7eNy4cG7DiJkmKs7enOsFY++xLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935567; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sNzWU4RuZJId6u1PoCiw8aw28muCjzcUClgDucB7GPw=; b=g4Y3s9fLLhO+3G4wMjiIJSyBlHR5CKG6tmWGluzPIFadHzeuLwiLScLdAZ/61ZKCOqIAHu i3sosXluxAJaLJigDnsa8mMd69p6FoJ3MLEdRpL/mqv496BM8uNBTKxRW9vkAr6uRXGATd EMu/uow/OMhHopKX9cw7yZNPYbDoYetmjjmgY6zC5jY5lI9zvoIAumuAM6FByJVR4Mh/PB Li8J08hWrvIJptKgzxG38dbkdmwV37EJkcfx/Ap7h1cZyhE2Ozuq97RMAJ6RKuveZZ54NW JCjJQ77FpN7oF2HRZ72BP2Y6WXmBULm/1edhB7KxyJ7JnA5r+O7ELmAuUzTswQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935567; a=rsa-sha256; cv=none; b=QRX0T7e+ewXib6R/rY5tds46S1qhNzvY33MYiNUBP4MWgs/fjzIz2rYQ2dqxXrrLBIo+os gW9j0wV+17QoisogGbvJ3Q7B+1tkYAsIsCSRiM2msOJk5uaPfS4Ohe8EWemgR933Kvm03r JhZmF6DrZOz9aAtVVDLXuafARVDBNvvvhJQl0DNLdbXBxTcJCNoM8SWWppCEE4aMpoUxRk d1QBY56JRnX9UwafMYM1gmEWxT+aYcZLloT8yG2DY05CVEls02740wXDbuNcGBWEYWqhvr vmLk4sxjv82dLErmorHmcI+Sd7rGKRP8RBuX8iHP9z8DkN7Mbshv1R/m82AVGQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8t6LT0z18J2; Fri, 21 Jul 2023 10:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWkK5010679; Fri, 21 Jul 2023 10:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWkoW010678; Fri, 21 Jul 2023 10:32:46 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:46 GMT Message-Id: <202307211032.36LAWkoW010678@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: 47d0c1fe7d32 - main - pf.conf.5: document SCTP support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e commit 47d0c1fe7d3279e9d38df75cf0c359b1fbc26d5e Author: Kristof Provost AuthorDate: 2023-06-21 08:04:07 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf.conf.5: document SCTP support Mention SCTP in the pf.conf.5 Reviewed by: tuexen MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40870 --- share/man/man5/pf.conf.5 | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5 index 8292812f7817..2f071d3d94e8 100644 --- a/share/man/man5/pf.conf.5 +++ b/share/man/man5/pf.conf.5 @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2023 +.Dd June 21, 2023 .Dt PF.CONF 5 .Os .Sh NAME @@ -493,6 +493,7 @@ action: Packet is silently dropped. .It Ar return A TCP RST is returned for blocked TCP packets, +an SCTP ABORT chunk is returned for blocked SCTP packets, an ICMP UNREACHABLE is returned for blocked UDP packets, and all other packets are silently dropped. .El @@ -517,6 +518,7 @@ actions are possible: Incoming packet is silently dropped. .It Ar return Incoming packet is dropped and TCP RST is returned for TCP packets, +an SCTP ABORT chunk is returned for blocked SCTP packets, an ICMP UNREACHABLE is returned for UDP packets, and no response is sent for other packets. .El @@ -1267,8 +1269,8 @@ A stateful connection is automatically created to track packets matching such a rule as long as they are not blocked by the filtering section of .Nm pf.conf . The translation engine modifies the specified address and/or port in the -packet, recalculates IP, TCP and UDP checksums as necessary, and passes it to -the packet filter for evaluation. +packet, recalculates IP, TCP and UDP checksums as necessary, and passes +it to the packet filter for evaluation. .Pp Since translation occurs before filtering the filter engine will see packets as they look after any @@ -1404,6 +1406,7 @@ and layer 4 (see .Xr icmp 4 , .Xr icmp6 4 , .Xr tcp 4 , +.Xr sctp 4 , .Xr udp 4 ) headers. In addition, packets may also be @@ -1453,7 +1456,8 @@ can be overridden by specifying a message as a code or number. .It Ar return This causes a TCP RST to be returned for .Xr tcp 4 -packets and an ICMP UNREACHABLE for UDP and other packets. +packets, an SCTP ABORT for SCTP +and an ICMP UNREACHABLE for UDP and other packets. .El .Pp Options returning ICMP packets currently have no effect if @@ -1654,6 +1658,7 @@ Common protocols are .Xr icmp 4 , .Xr icmp6 4 , .Xr tcp 4 , +.Xr sctp 4 , and .Xr udp 4 . For a list of all the protocol name to number mappings used by @@ -2853,6 +2858,14 @@ reference to an anchor name containing characters will require double quote .Pq Sq \&" characters around the anchor name. +.Sh SCTP CONSIDERATIONS +.Xr pf 4 +supports +.Xr sctp 4 +connections. +It can match ports, track state and NAT SCTP traffic. +However, it will not alter port numbers during nat or rdr translations. +Doing so would break SCTP multihoming. .Sh TRANSLATION EXAMPLES This example maps incoming requests on port 80 to port 8080, on which a daemon is running (because, for example, it is not run as root, @@ -3319,6 +3332,7 @@ Service name database. .Xr pf 4 , .Xr pfsync 4 , .Xr tcp 4 , +.Xr sctp 4 , .Xr udp 4 , .Xr hosts 5 , .Xr pf.os 5 , From nobody Fri Jul 21 10:32:45 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6m8x44xRz4pG2k; Fri, 21 Jul 2023 10:32: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6m8t17K4z3qDH; Fri, 21 Jul 2023 10:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImG1X9YsZaUxI4VkH6ekOiF6MzW3Cko6OjAyHWRhuqU=; b=VBJAu36xZEsKZdpx6xotLv/hiedN342q0z8F+q4E7Wc7KBoKXk8mF4ezly9BBJI0DR6cOe B7OAkKO2mcLnZQ7hQmUSGZuOexaYbO5DBI4HyClqKWKfxLCWPsG+G4z9njUDvWtn9Wff+W xVKRIi+GquPX2OdcGUD5WgS6yjM01th4Dl3WGN9S7jE/6hXwdZhEpj3oBEl0fWqyNpcZuD kGMoShru+bWOdBRZusfBpfOJEMLHdyCdtDZUJe15rqw4h3N0FdadmxDzQ8wqvadRu/bxlF g5JIcvcSGm+xExGSq1hfhgF2+GMS7R0ik87mCWySSRgOA7iNF/6J4LwXQDNcEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689935566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ImG1X9YsZaUxI4VkH6ekOiF6MzW3Cko6OjAyHWRhuqU=; b=rsTwICfEmEFz9atpiLdRTE2xUgPdec7CMFngmWXl9akXNdOvIhaFptoFHHf5QyGDOAXo+k whIJxOehO3d6aOnig+wOTly0rnHolCTrFKbxyvSmsLIHQcjr47PnKJYmjdw5NE9fKW7Kl1 9n1GgB1LMt/Eud89G1Fti+pbZcvPj/8W5P6ecwzJIqS/Rp4Mz8TWjDgH+Ud5lKjVAgRcL8 sPpqyfVBLCLhMJfBNGPg1iw7S6u6L1JxeuYbT2UJF/EOLJlVYhN51iu/oQsRCiDbmApvlw e8Y1DPBSeYrCXbJdVZ8ONkeZZeWbFfwmqLtR/i/0E8FJIf76Ck3JYyxVytKHGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689935566; a=rsa-sha256; cv=none; b=V5Jc6j4fzRfgKKeRvYaqPkzPYiogaNvFzfsf2OtUu2Enf+VSUO9+mbbrI9PL0tOk9vVAIs eP4Q8qZ0rGe5OXX6lwKR5+T8MksPY2Mcv0tFUl3L9qlmKoml1WGztB2G2f2JUeiyOMr53x uUyJriA29JabMeGrKApLcjiLaHr81J1/8geKiq1D7GkANq6h/iWVtuF2bXGuUEt0gXXVVC 2gKMjRjLjAL7FCibIeG5k35G6z2WlFy+JyAiw7N1Ib1QltSdI/0Kqdf379+tK+nMZ83asB 0uCMeda8RbkDDlfVlLxtjQTusrg+xXv+pzAuK5wzD89R/kGa1pCmXkptE9Lazg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6m8s5yKkz18G8; Fri, 21 Jul 2023 10:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LAWjQm010655; Fri, 21 Jul 2023 10:32:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LAWjXh010654; Fri, 21 Jul 2023 10:32:45 GMT (envelope-from git) Date: Fri, 21 Jul 2023 10:32:45 GMT Message-Id: <202307211032.36LAWjXh010654@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: b7a9a5773a0f - main - pf tests: test SCTP pfsync List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b commit b7a9a5773a0fdf9b9c7839d79d76dbc6b69a6c4b Author: Kristof Provost AuthorDate: 2023-06-07 09:55:06 +0000 Commit: Kristof Provost CommitDate: 2023-07-21 10:32:19 +0000 pf tests: test SCTP pfsync Ensure that SCTP connections survive a failover to the backup pf instance. MFC after: 3 weeks Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D40869 --- tests/sys/netpfil/pf/sctp.sh | 188 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index 2c736017f9fa..ec131a6384cc 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -469,6 +469,193 @@ rdr_v4_cleanup() pft_cleanup } +atf_test_case "pfsync" "cleanup" +pfsync_head() +{ + atf_set descr 'Test pfsync-ing SCTP connections' + atf_set require.user root +} + +pfsync_body() +{ + # + Builds bellow topology and initiate an SCTP connection + # from client to server. + # + Tests that the connection remains open when we fail over from + # router one to router two. + # + # ┌──────┐ + # │client│ + # └───┬──┘ + # │ + # ┌───┴───┐ + # │bridge0│ + # └┬─────┬┘ + # │ │ + # ┌────────────────┴─┐ ┌─┴────────────────┐ + # │ one ├─┤ two │ + # └────────────────┬─┘ └─┬────────────────┘ + # │ │ + # ┌┴─────┴┐ + # │bridge1│ + # └───┬───┘ + # │ + # ┌───┴──┐ + # │server│ + # └──────┘ + + sctp_init + pfsynct_init + if ! kldstat -q -m carp + then + atf_skip "This test requires carp" + fi + + j="sctp:pfsync" + + tmp=`pwd` + + bridge0=$(vnet_mkbridge) + bridge1=$(vnet_mkbridge) + + epair_c=$(vnet_mkepair) + epair_one0=$(vnet_mkepair) + epair_two0=$(vnet_mkepair) + epair_sync=$(vnet_mkepair) + epair_one1=$(vnet_mkepair) + epair_two1=$(vnet_mkepair) + epair_srv=$(vnet_mkepair) + + ifconfig ${bridge0} addm ${epair_c}a addm ${epair_one0}a addm ${epair_two0}a + ifconfig ${epair_one0}a up + ifconfig ${epair_two0}a up + ifconfig ${epair_c}a up + ifconfig ${bridge0} up + + ifconfig ${bridge1} addm ${epair_srv}a addm ${epair_one1}a addm ${epair_two1}a + ifconfig ${epair_one1}a up + ifconfig ${epair_two1}a up + ifconfig ${epair_srv}a up + ifconfig ${bridge1} up + + vnet_mkjail ${j}c ${epair_c}b + jexec ${j}c ifconfig ${epair_c}b 192.0.2.2/24 up + jexec ${j}c route add default 192.0.2.1 + + vnet_mkjail ${j}one ${epair_one0}b ${epair_one1}b ${epair_sync}a + jexec ${j}one ifconfig ${epair_one0}b 192.0.2.3/24 up + jexec ${j}one ifconfig ${epair_one0}b \ + alias 192.0.2.1/32 vhid 1 pass 1234 + jexec ${j}one ifconfig ${epair_one1}b 198.51.100.3/24 up + jexec ${j}one ifconfig ${epair_one1}b \ + alias 198.51.100.2/32 vhid 2 pass 4321 + jexec ${j}one ifconfig ${epair_sync}a 203.0.113.1/24 up + jexec ${j}one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec ${j}one sysctl net.inet.ip.forwarding=1 + + vnet_mkjail ${j}two ${epair_two0}b ${epair_two1}b ${epair_sync}b + jexec ${j}two ifconfig ${epair_two0}b 192.0.2.4/24 up + jexec ${j}two ifconfig ${epair_two0}b \ + alias 192.0.2.1/32 vhid 1 pass 1234 + jexec ${j}two ifconfig ${epair_two1}b 198.51.100.4/24 up + jexec ${j}two ifconfig ${epair_two1}b \ + alias 198.51.100.2/32 vhid 2 pass 4321 + jexec ${j}two ifconfig ${epair_sync}b 203.0.113.2/24 up + jexec ${j}two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + jexec ${j}two sysctl net.inet.ip.forwarding=1 + + vnet_mkjail ${j}srv ${epair_srv}b + jexec ${j}srv ifconfig ${epair_srv}b 198.51.100.1/24 up + jexec ${j}srv route add default 198.51.100.2 + + # Demote two, to avoid dealing with asymmetric routing + jexec ${j}two sysctl net.inet.carp.demotion=50 + + jexec ${j}one pfctl -e + pft_set_rules ${j}one \ + "block all" \ + "pass proto { icmp, pfsync, carp }" \ + "pass proto sctp to port 1234" \ + "pass proto tcp to port 1234" + + jexec ${j}two pfctl -e + pft_set_rules ${j}two \ + "block all" \ + "pass proto { icmp, pfsync, carp }" \ + "pass proto sctp to port 1234" \ + "pass proto tcp to port 1234" + + # Give carp time to get set up + sleep 2 + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + # Now start up an SCTP connection + touch ${tmp}/input + tail -F ${tmp}/input | jexec ${j}srv nc --sctp -l 1234 & + sleep 1 + + jexec ${j}c nc --sctp 198.51.100.1 1234 > ${tmp}/output & + echo "1" >> ${tmp}/input + + # Give time for the traffic to arrive + sleep 1 + line=$(tail -n -1 ${tmp}/output) + if [ "${line}" != "1" ]; + then + echo "Found ${line}" + cat ${tmp}/output + atf_fail "Initial SCTP connection failed" + fi + + # Verify that two has the connection too + state=$(jexec ${j}two pfctl -ss | grep sctp) + if [ -z "${state}" ]; + then + jexec ${j}two pfctl -ss + atf_fail "Failed to find SCTP state on secondary pfsync host" + fi + + # Now fail over (both carp IPs should switch here) + jexec ${j}one sysctl net.inet.carp.demotion=100 + + while ! jexec ${j}one ifconfig ${epair_one0}b | grep MASTER; + do + sleep 1 + done + while ! jexec ${j}one ifconfig ${epair_one1}b | grep MASTER; + do + sleep 1 + done + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec ${j}c ping -c 1 198.51.100.1 + + # And check that the connection is still live + echo "2" >> ${tmp}/input + sleep 1 + line=$(tail -n -1 ${tmp}/output) + if [ "${line}" != "2" ]; + then + echo "Found ${line}" + cat ${tmp}/output + atf_fail "SCTP failover failed" + fi +} + +pfsync_cleanup() +{ + pfsynct_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -478,4 +665,5 @@ atf_init_test_cases() atf_add_test_case "nat_v4" atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" + atf_add_test_case "pfsync" } From nobody Fri Jul 21 14:24:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6sHx636Mz4dRmv; Fri, 21 Jul 2023 14:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6sHx4WHcz3xVZ; Fri, 21 Jul 2023 14:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689949453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7O79qE+7xceASpgC0j2hYUdOmjwQhsWjKg4iywwcI0E=; b=WuAhWE+XrRHklOmWaLDsJAdv1VfqPhcPEtbyTG2bkUGLT2HCCBm7FOggQWariGdliTORt5 lskGri9slEEC4ZqlLdQfsA+X0/88uGWhAhcygBduO0s+uJz9dwvx4pD4svIunSgf39Zsfc IJR1TLP0ycrfdfl1KxrHwlxgcmVjqrsjt8TUjqc7ZSpvgIvOjdNhjUQL73sxMiH1tZiVb4 1ztnG72GbC0jN5hxggY2N62dwhlnbAysPnkDDyV3fbNPP502C0y5K0VlWYl1DY2WLf9NnY Ntl0JTTDLfM/zF1ScVx66iQrP//Y8QLtMg4LqXGJeb3DlshsB7Rgx9gdsi6h4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689949453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7O79qE+7xceASpgC0j2hYUdOmjwQhsWjKg4iywwcI0E=; b=Lbg0eVRbls+vNpyWbdh2/FrJH43bpj0y67prMXF8Y5xTPnNzhmOzULz+42v7Py7GZlUrpo HMUWtHpWPydh/iDZWSQvzLuJgNwCa0X9fUFYkaYU02vhEViCbKwFC8NpQL6VKnqHavQrWn dP7Tz0ggdQ3oKc/rievx1YAkx6hhxRnu7+cTSDCm1ihEoFwDMK36hi6Ra6FN89Mnbd/CRC YiSAbPam/6MJ3WhULEIaRCsWSYlncoM1pgipG6dA+PudzMqbaxq8anmUMDXdcMhvz45JDf AH1IC9+5e5EMccuWgSEvoFpZrV/65B+rZBfIMsu9mutoLELKNUYgROSTIpuUvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689949453; a=rsa-sha256; cv=none; b=G6SQ9y9q4Qa9bJw0hjDQgK/9M+QP04MLoUlM6kP+HTZlx8XRESjVsNOPLA769SWur5EtbE G1h7JWWpzOoplDOAc3TF02xsLB68cb9zdtSkmVZ7ljT3vWXMjEtlxp3pMKMXZKSh21+Auz RzsnasJ/7cBtUVHsmsN0MLf6hxO+9mc2YwBBimvHkzkm2LwGIzzEzxWd102jCSFssl79YW zxbtBJgfeFw+gyihhdzFiXBlydCE326B/SaXSX7pt+f0wq1QZy7qNf0jXPJmRHNgc/N3Qc OIBmd8YlyokYtp7uHdnKSNKGPocRqzsxSs1VBMJ/NOpdjoMYdVMvwmxjKskD+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 4R6sHx3bXNzGlH; Fri, 21 Jul 2023 14:24:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LEODoV091789; Fri, 21 Jul 2023 14:24:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LEODBt091788; Fri, 21 Jul 2023 14:24:13 GMT (envelope-from git) Date: Fri, 21 Jul 2023 14:24:13 GMT Message-Id: <202307211424.36LEODBt091788@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: 8f8da1bcc799 - main - seq: style(9) cleanup List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f8da1bcc799c3ffc306ae7cb37c6591c629d709 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8f8da1bcc799c3ffc306ae7cb37c6591c629d709 commit 8f8da1bcc799c3ffc306ae7cb37c6591c629d709 Author: Ed Maste AuthorDate: 2023-06-25 23:33:49 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:17:24 +0000 seq: style(9) cleanup This is in part for diff reduction with OpenBSD. Sponsored by: The FreeBSD Foundation --- usr.bin/seq/seq.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/usr.bin/seq/seq.c b/usr.bin/seq/seq.c index d1d2cfbf17ed..d3d074985d85 100644 --- a/usr.bin/seq/seq.c +++ b/usr.bin/seq/seq.c @@ -57,8 +57,7 @@ __FBSDID("$FreeBSD$"); static const char *decimal_point = "."; /* default */ static char default_format[] = { "%g" }; /* default */ -static const struct option long_opts[] = -{ +static const struct option long_opts[] = { {"format", required_argument, NULL, 'f'}, {"separator", required_argument, NULL, 's'}, {"terminator", required_argument, NULL, 't'}, @@ -106,9 +105,9 @@ main(int argc, char *argv[]) decimal_point = locale->decimal_point; /* - * Process options, but handle negative numbers separately - * least they trip up getopt(3). - */ + * Process options, but handle negative numbers separately + * least they trip up getopt(3). + */ while ((optind < argc) && !numeric(argv[optind]) && (c = getopt_long(argc, argv, "+f:hs:t:w", long_opts, NULL)) != -1) { @@ -156,7 +155,7 @@ main(int argc, char *argv[]) incr = e_atof(argv[1]); /* Plan 9/GNU don't do zero */ if (incr == 0.0) - errx(1, "zero %screment", (first < last)? "in" : "de"); + errx(1, "zero %screment", (first < last) ? "in" : "de"); } /* default is one for Plan 9/GNU work alike */ @@ -176,7 +175,7 @@ main(int argc, char *argv[]) if (!valid_format(fmt)) errx(1, "invalid format string"); /* - * XXX to be bug for bug compatible with Plan 9 add a + * XXX to be bug for bug compatible with Plan 9 add a * newline if none found at the end of the format string. */ } else @@ -297,18 +296,18 @@ valid_format(const char *fmt) /* conversion */ switch (*fmt) { - case 'A': - case 'a': - case 'E': - case 'e': - case 'F': - case 'f': - case 'G': - case 'g': + case 'A': + case 'a': + case 'E': + case 'e': + case 'F': + case 'f': + case 'G': + case 'g': /* floating point formats are accepted */ conversions++; break; - default: + default: /* anything else is not */ return 0; } From nobody Fri Jul 21 14:41:54 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6shL5sD8z4db39; Fri, 21 Jul 2023 14:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6shL5PHxz42XQ; Fri, 21 Jul 2023 14:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689950514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HbiETvy1hYHOVMQqksJ/iJ9GfFB5LsLIKp9o5n+NrmA=; b=cjcQQVOfAC2a6+BswR3rCXTXZoQHmrDOSnsydtfCfv0uz4l4BVrO/qaEEG9/ce2ebvYbHO 7QuFKw5HAozsrHKHVrw1ueQT2g1vdzjLdhDjo5NioaZiGw+hoPA1FgEf7UAxE4No+EW2tW HxbIAKrDJImKINmhmqk+kf94CwzgbkJVAskvYxGnTuqV63dQDxWWfKr7KJYdwmIknGuI2d KXevw+1lQawZzUG3L7GNcqAnnD1HjP22fppIFrfjcxmpKVJozfFFjaCvBE4xQ1QYdw+CaW +Xhi32AMMlhnkYppLih1iXu0+Jwk/Hv2C31fDwfROuSV55xzNI4oYN2/VQr56g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689950514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HbiETvy1hYHOVMQqksJ/iJ9GfFB5LsLIKp9o5n+NrmA=; b=XgrUNhcUUwECqDH8W+ETeMNEZlHRgLro74kb3+8bRbQbN6vkoumi9HGhoGiFxPhO81MjTT YnjuPve/Mu32lgk3UsHKQmkv2/Is7KAYT4+YIeQ1p4mSXXw7FKiqZm77avsU1KNRjds0SX zS1iygtXC3jGrZIqrnn1cC/gpThSsOqd91hIjbPfTU/xLEIAJ3jnLU2oox2BD/5kOYBvTN hyukC816ABif/vCybD518DHLYN19NjiKes6xf3wQ4Q35diwXmPxUjbXgMhslQyIvTDAX+e BB87/1ya7Qx36rM3nEjPSEmZ/IvVOhX8JoNQHrjctKRLooUoBa3S1oQjl+fSSQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689950514; a=rsa-sha256; cv=none; b=tEhFIoAFZl+tiwyKArb4h5JTgjWIMC5mIr08AfDIhA+uZ1fR5/hfnC7NFJ42tNrIFK3S1H 2eGoewk55DrWNnnVYGe9n8QRnIoIen5IpPThgsx05nKzj3EFInQQFzUxb5EmAwJIv4jm/n TtxzjvRRQaVTdmcnYUSUaB9NUQxwQUAax8KaZK8QUAfshn1jj2qFxx3aBZqG5Vz4CVNDqi XZwZdiZEOtQH1Qu6uGZdlqrfZnqOA+UziQO0eKi7CVtLonQNzOIgxGskG9aMesz0lPBA6J q1cu6BBIthTr4oGplaQarpYvPcZJsNOkD0fsbv0UuvMVlZHdH/g2lJsaYmMvXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6shL4TRqzGJ8; Fri, 21 Jul 2023 14:41:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LEfs85023846; Fri, 21 Jul 2023 14:41:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LEfsWt023845; Fri, 21 Jul 2023 14:41:54 GMT (envelope-from git) Date: Fri, 21 Jul 2023 14:41:54 GMT Message-Id: <202307211441.36LEfsWt023845@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: d578a19e2cd3 - stable/13 - ssh: Update to OpenSSH 9.3p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d578a19e2cd312ef0ec842c9f16f97d66caea22a Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d578a19e2cd312ef0ec842c9f16f97d66caea22a commit d578a19e2cd312ef0ec842c9f16f97d66caea22a Author: Ed Maste AuthorDate: 2023-07-19 17:02:33 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:41:41 +0000 ssh: Update to OpenSSH 9.3p2 From the release notes: Changes since OpenSSH 9.3 ========================= This release fixes a security bug. Security ======== Fix CVE-2023-38408 - a condition where specific libaries loaded via ssh-agent(1)'s PKCS#11 support could be abused to achieve remote code execution via a forwarded agent socket if the following conditions are met: * Exploitation requires the presence of specific libraries on the victim system. * Remote exploitation requires that the agent was forwarded to an attacker-controlled system. Exploitation can also be prevented by starting ssh-agent(1) with an empty PKCS#11/FIDO allowlist (ssh-agent -P '') or by configuring an allowlist that contains only specific provider libraries. This vulnerability was discovered and demonstrated to be exploitable by the Qualys Security Advisory team. In addition to removing the main precondition for exploitation, this release removes the ability for remote ssh-agent(1) clients to load PKCS#11 modules by default (see below). Potentially-incompatible changes -------------------------------- * ssh-agent(8): the agent will now refuse requests to load PKCS#11 modules issued by remote clients by default. A flag has been added to restore the previous behaviour "-Oallow-remote-pkcs11". Note that ssh-agent(8) depends on the SSH client to identify requests that are remote. The OpenSSH >=8.9 ssh(1) client does this, but forwarding access to an agent socket using other tools may circumvent this restriction. Security: CVE-2023-38408 Sponsored by: The FreeBSD Foundation (cherry picked from commit 66fd12cf4896eb08ad8e7a2627537f84ead84dd3) --- crypto/openssh/ChangeLog | 1867 +--------------------------- crypto/openssh/README | 2 +- crypto/openssh/contrib/redhat/openssh.spec | 2 +- crypto/openssh/contrib/suse/openssh.spec | 2 +- crypto/openssh/ssh-agent.1 | 22 +- crypto/openssh/ssh-agent.c | 21 +- crypto/openssh/ssh-pkcs11.c | 6 +- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/version.h | 4 +- 10 files changed, 82 insertions(+), 1848 deletions(-) diff --git a/crypto/openssh/ChangeLog b/crypto/openssh/ChangeLog index f1d1b37d583c..40ca976a61b3 100644 --- a/crypto/openssh/ChangeLog +++ b/crypto/openssh/ChangeLog @@ -1,3 +1,36 @@ +commit 9795c4016ae35162072144df032c8b262433b462 +Author: Damien Miller +Date: Wed Jul 19 16:27:12 2023 +1000 + + OpenSSH 9.3p2 + +commit bde3635f3c9324bad132cf9ed917813d6abb599e +Author: Damien Miller +Date: Wed Jul 19 16:31:09 2023 +1000 + + update version in README + +commit f673f2f3e5f67099018fc281a6b5fb918142472e +Author: Damien Miller +Date: Wed Jul 19 16:31:00 2023 +1000 + + update RPM spec versions + +commit d7790cdce72a1b6982795baa2b4d6f0bdbb0100d +Author: Damien Miller +Date: Fri Jul 7 13:30:15 2023 +1000 + + disallow remote addition of FIDO/PKCS11 keys + + Depends on the local client performing the session-bind@openssh.com + operation, so non-OpenSSH local client may circumvent this. + +commit b23fe83f06ee7e721033769cfa03ae840476d280 +Author: Damien Miller +Date: Thu Jul 13 12:09:34 2023 +1000 + + terminate pkcs11 process for bad libraries + commit cb30fbdbee869f1ce11f06aa97e1cb8717a0b645 Author: Damien Miller Date: Thu Mar 16 08:28:19 2023 +1100 @@ -9402,1837 +9435,3 @@ Date: Mon Jul 19 05:08:54 2021 +0000 reliability on very heavily loaded hosts. OpenBSD-Regress-ID: 4c28a0fce3ea89ebde441d7091464176e9730533 - -commit 7953e1bfce9e76bec41c1331a29bc6cff9d416b8 -Author: Darren Tucker -Date: Mon Jul 19 13:47:51 2021 +1000 - - Add sshfp-connect.sh file missed in previous. - -commit b75a80fa8369864916d4c93a50576155cad4df03 -Author: dtucker@openbsd.org -Date: Mon Jul 19 03:13:28 2021 +0000 - - upstream: Ensure that all returned SSHFP records for the specified host - - name and hostkey type match instead of only one. While there, simplify the - code somewhat and add some debugging. Based on discussion in bz#3322, ok - djm@. - - OpenBSD-Commit-ID: 0a6a0a476eb7f9dfe8fe2c05a1a395e3e9b22ee4 - -commit 1cc1fd095393663cd72ddac927d82c6384c622ba -Author: dtucker@openbsd.org -Date: Mon Jul 19 02:21:50 2021 +0000 - - upstream: Id sync only, -portable already has this. - - Put dh_set_moduli_file call inside ifdef WITH_OPENSSL. Fixes - build with OPENSSL=no. - - OpenBSD-Commit-ID: af54abbebfb12bcde6219a44d544e18204defb15 - -commit 33abbe2f4153f5ca5c874582f6a7cc91ae167485 -Author: dtucker@openbsd.org -Date: Mon Jul 19 02:46:34 2021 +0000 - - upstream: Add test for host key verification via SSHFP records. This - - requires some external setup to operate so is disabled by default (see - comments in sshfp-connect.sh). - - OpenBSD-Regress-ID: c52c461bd1df3a803d17498917d156ef64512fd9 - -commit f0cd000d8e3afeb0416dce1c711c3d7c28d89bdd -Author: dtucker@openbsd.org -Date: Mon Jul 19 02:29:28 2021 +0000 - - upstream: Add ed25519 key and test SSHFP export of it. Only test - - RSA SSHFP export if we have RSA functionality compiled in. - - OpenBSD-Regress-ID: b4ff5181b8c9a5862e7f0ecdd96108622333a9af - -commit 0075511e27e5394faa28edca02bfbf13b9a6693e -Author: dtucker@openbsd.org -Date: Mon Jul 19 00:16:26 2021 +0000 - - upstream: Group keygen tests together. - - OpenBSD-Regress-ID: 07e2d25c527bb44f03b7c329d893a1f2d6c5c40c - -commit 034828820c7e62652e7c48f9ee6b67fb7ba6fa26 -Author: dtucker@openbsd.org -Date: Sun Jul 18 23:10:10 2021 +0000 - - upstream: Add test for ssh-keygen printing of SSHFP records. - - OpenBSD-Regress-ID: fde9566b56eeb980e149bbe157a884838507c46b - -commit 52c3b6985ef1d5dadb4c4fe212f8b3a78ca96812 -Author: djm@openbsd.org -Date: Sat Jul 17 00:38:11 2021 +0000 - - upstream: wrap some long lines - - OpenBSD-Commit-ID: 4f5186b1466656762dae37d3e569438d900c350d - -commit 43ec991a782791d0b3f42898cd789f99a07bfaa4 -Author: djm@openbsd.org -Date: Sat Jul 17 00:36:53 2021 +0000 - - upstream: fix sftp on ControlPersist connections, broken by recent - - SessionType change; spotted by sthen@ - - OpenBSD-Commit-ID: 4c5ddc5698790ae6ff50d2a4f8f832f0eeeaa234 - -commit 073f45c236550f158c9a94003e4611c07dea5279 -Author: djm@openbsd.org -Date: Fri Jul 16 09:00:23 2021 +0000 - - upstream: Explicitly check for and start time-based rekeying in the - - client and server mainloops. - - Previously the rekey timeout could expire but rekeying would not start - until a packet was sent or received. This could cause us to spin in - select() on the rekey timeout if the connection was quiet. - - ok markus@ - - OpenBSD-Commit-ID: 4356cf50d7900f3df0a8f2117d9e07c91b9ff987 - -commit ef7c4e52d5d840607f9ca3a302a4cbb81053eccf -Author: jmc@openbsd.org -Date: Wed Jul 14 06:46:38 2021 +0000 - - upstream: reorder SessionType; ok djm - - OpenBSD-Commit-ID: c7dd0b39e942b1caf4976a0b1cf0fed33d05418c - -commit 8aa2f9aeb56506dca996d68ab90ab9c0bebd7ec3 -Author: Darren Tucker -Date: Wed Jul 14 11:26:50 2021 +1000 - - Make whitespace consistent. - -commit 4f4297ee9b8a39f4dfd243a74c5f51f9e7a05723 -Author: Darren Tucker -Date: Wed Jul 14 11:26:12 2021 +1000 - - Add ARM64 Linux self-hosted runner. - -commit eda8909d1b0a85b9c3804a04d03ec6738fd9dc7f -Author: djm@openbsd.org -Date: Tue Jul 13 23:48:36 2021 +0000 - - upstream: add a SessionType directive to ssh_config, allowing the - - configuration file to offer equivalent control to the -N (no session) and -s - (subsystem) command-line flags. - - Part of GHPR#231 by Volker Diels-Grabsch with some minor tweaks; - feedback and ok dtucker@ - - OpenBSD-Commit-ID: 726ee931dd4c5cc7f1d7a187b26f41257f9a2d12 - -commit 7ae69f2628e338ba6e0eae7ee8a63bcf8fea7538 -Author: djm@openbsd.org -Date: Mon Jul 12 02:12:22 2021 +0000 - - upstream: fix some broken tests; clean up output - - OpenBSD-Regress-ID: 1d5038edb511dc4ce1622344c1e724626a253566 - -commit f5fc6a4c3404bbf65c21ca6361853b33d78aa87e -Author: Darren Tucker -Date: Mon Jul 12 18:00:05 2021 +1000 - - Add configure-time detection for SSH_TIME_T_MAX. - - Should fix printing cert times exceeding INT_MAX (bz#3329) on platforms - were time_t is a long long. The limit used is for the signed type, so if - some system has a 32bit unsigned time_t then the lower limit will still - be imposed and we would need to add some way to detect this. Anyone using - an unsigned 64bit can let us know when it starts being a problem. - -commit fd2d06ae4442820429d634c0a8bae11c8e40c174 -Author: dtucker@openbsd.org -Date: Mon Jul 12 06:22:57 2021 +0000 - - upstream: Make limit for time_t test unconditional in the - - format_absolute_time fix for bz#3329 that allows printing of timestamps past - INT_MAX. This was incorrectly included with the previous commit. Based on - discussion with djm@. - - OpenBSD-Commit-ID: 835936f6837c86504b07cabb596b613600cf0f6e - -commit 6c29b387cd64a57b0ec8ae7d2c8d02789d88fcc3 -Author: dtucker@openbsd.org -Date: Mon Jul 12 06:08:57 2021 +0000 - - upstream: Use existing format_absolute_time() function when - - printing cert validity instead of doing it inline. Part of bz#3329. - - OpenBSD-Commit-ID: a13d4e3c4f59644c23745eb02a09b2a4e717c00c - -commit 99981d5f8bfa383791afea03f6bce8454e96e323 -Author: djm@openbsd.org -Date: Fri Jul 9 09:55:56 2021 +0000 - - upstream: silence redundant error message; reported by Fabian Stelzer - - OpenBSD-Commit-ID: 9349a703016579a60557dafd03af2fe1d44e6aa2 - -commit e86097813419b49d5bff5c4b51d1c3a5d4d2d804 -Author: John Ericson -Date: Sat Dec 26 11:40:49 2020 -0500 - - Re-indent krb5 section after pkg-config addition. - -commit 32dd2daa56c294e40ff7efea482c9eac536d8cbb -Author: John Ericson -Date: Sat Dec 26 11:40:49 2020 -0500 - - Support finding Kerberos via pkg-config - - This makes cross compilation easier. - -commit def7a72234d7e4f684d72d33a0f7229f9eee0aa4 -Author: Darren Tucker -Date: Fri Jul 9 14:34:06 2021 +1000 - - Update comments about EGD to include prngd. - -commit b5d23150b4e3368f4983fd169d432c07afeee45a -Author: dtucker@openbsd.org -Date: Mon Jul 5 01:21:07 2021 +0000 - - upstream: Fix a couple of whitespace things. Portable already has - - these so this removes two diffs between the two. - - OpenBSD-Commit-ID: 769f017ebafd8e741e337b3e9e89eb5ac73c9c56 - -commit 8f57be9f279b8e905f9883066aa633c7e67b31cf -Author: dtucker@openbsd.org -Date: Mon Jul 5 01:16:46 2021 +0000 - - upstream: Order includes as per style(9). Portable already has - - these so this removes a handful of diffs between the two. - - OpenBSD-Commit-ID: 8bd7452d809b199c19bfc49511a798f414eb4a77 - -commit b75624f8733b3ed9e240f86cac5d4a39dae11848 -Author: dtucker@openbsd.org -Date: Mon Jul 5 00:50:25 2021 +0000 - - upstream: Remove comment referencing now-removed - - RhostsRSAAuthentication. ok djm@ - - OpenBSD-Commit-ID: 3d864bfbd99a1d4429a58e301688f3be464827a9 - -commit b67eb12f013c5441bb4f0893a97533582ad4eb13 -Author: djm@openbsd.org -Date: Mon Jul 5 00:25:42 2021 +0000 - - upstream: allow spaces to appear in usernames for local to remote, - - and scp -3 remote to remote copies. with & ok dtucker bz#1164 - - OpenBSD-Commit-ID: e9b550f3a85ffbb079b6720833da31317901d6dd - -commit 8c4ef0943e574f614fc7c6c7e427fd81ee64ab87 -Author: dtucker@openbsd.org -Date: Fri Jul 2 07:20:44 2021 +0000 - - upstream: Remove obsolete comments about SSHv1 auth methods. ok - - djm@ - - OpenBSD-Commit-ID: 6060f70966f362d8eb4bec3da2f6c4712fbfb98f - -commit 88908c9b61bcb99f16e8d398fc41e2b3b4be2003 -Author: Darren Tucker -Date: Sat Jul 3 23:00:19 2021 +1000 - - Remove reference to ChallengeResponse. - - challenge_response_authentication was removed from the struct, keeping - kbd_interactive_authentication. - -commit 321874416d610ad2158ce6112f094a4862c2e37f -Author: Darren Tucker -Date: Sat Jul 3 20:38:09 2021 +1000 - - Move signal.h up include order to match upstream. - -commit 4fa83e2d0e32c2dd758653e0359984bbf1334f32 -Author: Darren Tucker -Date: Sat Jul 3 20:36:06 2021 +1000 - - Remove old OpenBSD version marker. - - Looks like an accidental leftover from a sync. - -commit 9d5e31f55d5f3899b72645bac41a932d298ad73b -Author: Darren Tucker -Date: Sat Jul 3 20:34:19 2021 +1000 - - Remove duplicate error on error path. - - There's an extra error() call on the listen error path, it looks like - its removal was missed during an upstream sync. - -commit 888c459925c7478ce22ff206c9ac1fb812a40caf -Author: Darren Tucker -Date: Sat Jul 3 20:32:46 2021 +1000 - - Remove some whitespace not in upstream. - - Reduces diff vs OpenBSD by a small amount. - -commit 4d2d4d47a18d93f3e0a91a241a6fdb545bbf7dc2 -Author: Darren Tucker -Date: Sat Jul 3 19:27:43 2021 +1000 - - Replace remaining references to ChallengeResponse. - - Portable had a few additional references to ChallengeResponse related to - UsePAM, replaces these with equivalent keyboard-interactive ones. - -commit 53237ac789183946dac6dcb8838bc3b6b9b43be1 -Author: Darren Tucker -Date: Sat Jul 3 19:23:28 2021 +1000 - - Sync remaining ChallengeResponse removal. - - These were omitted from commit 88868fd131. - -commit 2c9e4b319f7e98744b188b0f58859d431def343b -Author: Darren Tucker -Date: Sat Jul 3 19:17:31 2021 +1000 - - Disable rocky84 to figure out why agent test fails - -commit bfe19197a92b7916f64a121fbd3c179abf15e218 -Author: Darren Tucker -Date: Fri Jul 2 15:43:28 2021 +1000 - - Remove now-unused SSHv1 enums. - - sRhostsRSAAuthentication and sRSAAuthentication are protocol 1 options - and are no longer used. - -commit c73b02d92d72458a5312bd098f32ce88868fd131 -Author: dtucker@openbsd.org -Date: Fri Jul 2 05:11:20 2021 +0000 - - upstream: Remove references to ChallengeResponseAuthentication in - - favour of KbdInteractiveAuthentication. The former is what was in SSHv1, the - latter is what is in SSHv2 (RFC4256) and they were treated as somewhat but - not entirely equivalent. We retain the old name as deprecated alias so - config files continue to work and a reference in the man page for people - looking for it. - - Prompted by bz#3303 which pointed out the discrepancy between the two - when used with Match. Man page help & ok jmc@, with & ok djm@ - - OpenBSD-Commit-ID: 2c1bff8e5c9852cfcdab1f3ea94dfef5a22f3b7e - -commit f841fc9c8c7568a3b5d84a4cc0cefacb7dbc16b9 -Author: Darren Tucker -Date: Fri Jul 2 15:20:32 2021 +1000 - - Fix ifdefs around get_random_bytes_prngd. - - get_random_bytes_prngd() is used if either of PRNGD_PORT or PRNGD_SOCKET - are defined, so adjust ifdef accordingly. - -commit 0767627cf66574484b9c0834500b42ea04fe528a -Author: Damien Miller -Date: Fri Jul 2 14:30:23 2021 +1000 - - wrap get_random_bytes_prngd() in ifdef - - avoid unused static function warning - -commit f93fdc4de158386efe1116bd44c5b3f4a7a82c25 -Author: Darren Tucker -Date: Mon Jun 28 13:06:37 2021 +1000 - - Add rocky84 test target. - -commit d443006c0ddfa7f6a5bd9c0ae92036f3d5f2fa3b -Author: djm@openbsd.org -Date: Fri Jun 25 06:30:22 2021 +0000 - - upstream: fix decoding of X.509 subject name; from Leif Thuresson - - via bz3327 ok markus@ - - OpenBSD-Commit-ID: 0ea2e28f39750dd388b7e317bc43dd997a217ae8 - -commit 2a5704ec142202d387fda2d6872fd4715ab81347 -Author: dtucker@openbsd.org -Date: Fri Jun 25 06:20:39 2021 +0000 - - upstream: Use better language to refer to the user. From l1ving - - via github PR#250, ok jmc@ - - OpenBSD-Commit-ID: 07ca3526626996613e128aeddf7748c93c4d6bbf - -commit 4bdf7a04797a0ea1c431a9d54588417c29177d19 -Author: dtucker@openbsd.org -Date: Fri Jun 25 03:38:17 2021 +0000 - - upstream: Replace SIGCHLD/notify_pipe kludge with pselect. - - Previously sshd's SIGCHLD handler would wake up select() by writing a - byte to notify_pipe. We can remove this by blocking SIGCHLD, checking - for child terminations then passing the original signal mask through - to pselect. This ensures that the pselect will immediately wake up if - a child terminates between wait()ing on them and the pselect. - - In -portable, for platforms that do not have pselect the kludge is still - there but is hidden behind a pselect interface. - - Based on other changes for bz#2158, ok djm@ - - OpenBSD-Commit-ID: 202c85de0b3bdf1744fe53529a05404c5480d813 - -commit c9f7bba2e6f70b7ac1f5ea190d890cb5162ce127 -Author: Darren Tucker -Date: Fri Jun 25 15:08:18 2021 +1000 - - Move closefrom() to before first malloc. - - When built against tcmalloc, tcmalloc allocates a descriptor for its - internal use, so calling closefrom() afterward causes the descriptor - number to be reused resulting in a corrupted connection. Moving the - closefrom a little earlier should resolve this. From kircherlike at - outlook.com via bz#3321, ok djm@ - -commit 7ebfe4e439853b88997c9cfc2ff703408a1cca92 -Author: Darren Tucker -Date: Fri Jun 18 20:41:45 2021 +1000 - - Put second -lssh in link line for sftp-server. - - When building --without-openssl the recent port-prngd.c change adds - a dependency on atomicio, but since nothing else in sftp-server uses - it, the linker may not find it. Add a second -lssh similar to other - binaries. - -commit e409d7966785cfd9f5970e66a820685c42169717 -Author: Darren Tucker -Date: Fri Jun 18 18:34:08 2021 +1000 - - Try EGD/PRNGD if random device fails. - - When built --without-openssl, try EGD/PRGGD (if configured) as a last - resort before failing. - -commit e43a898043faa3a965dbaa1193cc60e0b479033d -Author: Darren Tucker -Date: Fri Jun 18 18:32:51 2021 +1000 - - Split EGD/PRNGD interface into its own file. - - This will allow us to use it when building --without-openssl. - -commit acb2887a769a1b1912cfd7067f3ce04fad240260 -Author: Darren Tucker -Date: Thu Jun 17 21:03:19 2021 +1000 - - Handle GIDs > 2^31 in getgrouplist. - - When compiled in 32bit mode, the getgrouplist implementation may fail - for GIDs greater than LONG_MAX. Analysis and change from ralf.winkel - at tui.com. - -commit 31fac20c941126281b527605b73bff30a8f02edd -Author: dtucker@openbsd.org -Date: Thu Jun 10 09:46:28 2021 +0000 - - upstream: Use $SUDO when reading sshd's pidfile here too. - - OpenBSD-Regress-ID: 6bfb0d455d493f24839034a629c5306f84dbd409 - -commit a3a58acffc8cc527f8fc6729486d34e4c3d27643 -Author: dtucker@openbsd.org -Date: Thu Jun 10 09:43:51 2021 +0000 - - upstream: Use $SUDO when reading sshd's pidfile in case it was - - created with a very restrictive umask. This resyncs with -portable. - - OpenBSD-Regress-ID: 07fd2af06df759d4f64b82c59094accca1076a5d - -commit 249ad4ae51cd3bc235e75a4846eccdf8b1416611 -Author: dtucker@openbsd.org -Date: Thu Jun 10 09:37:59 2021 +0000 - - upstream: Set umask when creating hostkeys to prevent excessive - - permissions warning. - - OpenBSD-Regress-ID: 382841db0ee28dfef7f7bffbd511803e1b8ab0ef - -commit 9d0892153c005cc65897e9372b01fa66fcbe2842 -Author: dtucker@openbsd.org -Date: Thu Jun 10 03:45:31 2021 +0000 - - upstream: Add regress test for SIGHUP restart - - while handling active and unauthenticated clients. Should catch anything - similar to the pselect bug just fixed in sshd.c. - - OpenBSD-Regress-ID: 3b3c19b5e75e43af1ebcb9586875b3ae3a4cac73 - -commit 73f6f191f44440ca3049b9d3c8e5401d10b55097 -Author: dtucker@openbsd.org -Date: Thu Jun 10 03:14:14 2021 +0000 - - upstream: Continue accept loop when pselect - - returns -1, eg if it was interrupted by a signal. This should prevent - the hang discovered by sthen@ wherein sshd receives a SIGHUP while it has - an unauthenticated child and goes on to a blocking read on a notify_pipe. - feedback deraadt@, ok djm@ - - OpenBSD-Commit-ID: 0243c1c5544fca0974dae92cd4079543a3fceaa0 - -commit c785c0ae134a8e8b5c82b2193f64c632a98159e4 -Author: djm@openbsd.org -Date: Tue Jun 8 22:30:27 2021 +0000 - - upstream: test that UserKnownHostsFile correctly accepts multiple - - arguments; would have caught readconf.c r1.356 regression - - OpenBSD-Regress-ID: 71ca54e66c2a0211b04999263e56390b1f323a6a - -commit 1a6f6b08e62c78906a3032e8d9a83e721c84574e -Author: djm@openbsd.org -Date: Tue Jun 8 22:06:12 2021 +0000 - - upstream: fix regression in r1.356: for ssh_config options that - - accepted multiple string arguments, ssh was only recording the first. - Reported by Lucas via bugs@ - - OpenBSD-Commit-ID: 7cbf182f7449bf1cb7c5b4452667dc2b41170d6d - -commit 78e30af3e2b2dd540a341cc827c6b98dd8b0a6de -Author: djm@openbsd.org -Date: Tue Jun 8 07:40:12 2021 +0000 - - upstream: test argv_split() optional termination on comments - - OpenBSD-Regress-ID: 9fd1c4a27a409897437c010cfd79c54b639a059c - -commit a023138957ea2becf1c7f93fcc42b0aaac6f2b03 -Author: dtucker@openbsd.org -Date: Tue Jun 8 07:05:27 2021 +0000 - - upstream: Add testcases from bz#3319 for IPQoS and TunnelDevice - - being overridden on the command line. - - OpenBSD-Regress-ID: 801674d5d2d02abd58274a78cab2711f11de14a8 - -commit 660cea10b2cdc11f13ba99c89b1bbb368a4d9ff2 -Author: djm@openbsd.org -Date: Tue Jun 8 06:52:43 2021 +0000 - - upstream: sprinkle some "# comment" at end of configuration lines - - to test comment handling - - OpenBSD-Regress-ID: cb82fbf40bda5c257a9f742c63b1798e5a8fdda7 - -commit acc9c32dcb6def6c7d3688bceb4c0e59bd26b411 -Author: djm@openbsd.org -Date: Tue Jun 8 06:51:47 2021 +0000 - - upstream: more descriptive failure message - - OpenBSD-Regress-ID: 5300f6faf1d9e99c0cd10827b51756c5510e3509 - -commit ce04dd4eae23d1c9cf7c424a702f48ee78573bc1 -Author: djm@openbsd.org -Date: Mon Jun 7 01:16:34 2021 +0000 - - upstream: test AuthenticationMethods inside a Match block as well - - as in the main config section - - OpenBSD-Regress-ID: ebe0a686621b7cb8bb003ac520975279c28747f7 - -commit 9018bd821fca17e26e92f7a7e51d9b24cd62f2db -Author: djm@openbsd.org -Date: Mon Jun 7 00:00:50 2021 +0000 - - upstream: prepare for stricter sshd_config parsing that will refuse - - a config that has {Allow,Deny}{Users,Groups} on a line with no subsequent - arguments. Such lines are permitted but are nonsensical noops ATM - - OpenBSD-Regress-ID: ef65463fcbc0bd044e27f3fe400ea56eb4b8f650 - -commit a10f929d1ce80640129fc5b6bc1acd9bf689169e -Author: djm@openbsd.org -Date: Tue Jun 8 07:09:42 2021 +0000 - - upstream: switch sshd_config parsing to argv_split() - - similar to the previous commit, this switches sshd_config parsing to - the newer tokeniser. Config parsing will be a little stricter wrt - quote correctness and directives appearing without arguments. - - feedback and ok markus@ - - tested in snaps for the last five or so days - thanks Theo and those who - caught bugs - - OpenBSD-Commit-ID: 9c4305631d20c2d194661504ce11e1f68b20d93e - -commit ea9e45c89a4822d74a9d97fef8480707d584da4d -Author: djm@openbsd.org -Date: Tue Jun 8 07:07:15 2021 +0000 - - upstream: Switch ssh_config parsing to use argv_split() - - This fixes a couple of problems with the previous tokeniser, - strdelim() - - 1. strdelim() is permissive wrt accepting '=' characters. This is - intended to allow it to tokenise "Option=value" but because it - cannot keep state, it will incorrectly split "Opt=val=val2". - 2. strdelim() has rudimentry handling of quoted strings, but it - is incomplete and inconsistent. E.g. it doesn't handle escaped - quotes inside a quoted string. - 3. It has no support for stopping on a (unquoted) comment. Because - of this readconf.c r1.343 added chopping of lines at '#', but - this caused a regression because these characters may legitimately - appear inside quoted strings. - - The new tokeniser is stricter is a number of cases, including #1 above - but previously it was also possible for some directives to appear - without arguments. AFAIK these were nonsensical in all cases, and the - new tokeniser refuses to accept them. - - The new code handles quotes much better, permitting quoted space as - well as escaped closing quotes. Finally, comment handling should be - fixed - the tokeniser will terminate only on unquoted # characters. - - feedback & ok markus@ - - tested in snaps for the last five or so days - thanks Theo and those who - caught bugs - - OpenBSD-Commit-ID: dc72fd12af9d5398f4d9e159d671f9269c5b14d5 - -commit d786424986c04d1d375f231fda177c8408e05c3e -Author: dtucker@openbsd.org -Date: Tue Jun 8 07:02:46 2021 +0000 - - upstream: Check if IPQoS or TunnelDevice are already set before - - overriding. Prevents values in config files from overriding values supplied - on the command line. bz#3319, ok markus. - - OpenBSD-Commit-ID: f3b08b898c324debb9195e6865d8999406938f74 - -commit aae4b4d3585b9f944d7dbd3c9e5ba0006c55e457 -Author: djm@openbsd.org -Date: Tue Jun 8 06:54:40 2021 +0000 - - upstream: Allow argv_split() to optionally terminate tokenisation - - when it encounters an unquoted comment. - - Add some additional utility function for working with argument - vectors, since we'll be switching to using them to parse - ssh/sshd_config shortly. - - ok markus@ as part of a larger diff; tested in snaps - - OpenBSD-Commit-ID: fd9c108cef2f713f24e3bc5848861d221bb3a1ac - -commit da9f9acaac5bab95dca642b48e0c8182b246ab69 -Author: Darren Tucker -Date: Mon Jun 7 19:19:23 2021 +1000 - - Save logs on failure for upstream test - -commit 76883c60161e5f3808787085a27a8c37f8cc4e08 -Author: Darren Tucker -Date: Mon Jun 7 14:36:32 2021 +1000 - - Add obsdsnap-i386 upstream test target. - -commit d45b9c63f947ec5ec314696e70281f6afddc0ac3 -Author: djm@openbsd.org -Date: Mon Jun 7 03:38:38 2021 +0000 - - upstream: fix debug message when finding a private key to match a - - certificate being attempted for user authentication. Previously it would - print the certificate's path, whereas it was supposed to be showing the - private key's path. Patch from Alex Sherwin via GHPR247 - - OpenBSD-Commit-ID: d5af3be66d0f22c371dc1fe6195e774a18b2327b - -commit 530739d42f6102668aecd699be0ce59815c1eceb -Author: djm@openbsd.org -Date: Sun Jun 6 11:34:16 2021 +0000 - - upstream: Match host certificates against host public keys, not private - - keys. Allows use of certificates with private keys held in a ssh-agent. - Reported by Miles Zhou in bz3524; ok dtucker@ - - OpenBSD-Commit-ID: 25f5bf70003126d19162862d9eb380bf34bac22a - -commit 4265215d7300901fd7097061c7517688ade82f8e -Author: djm@openbsd.org -Date: Sun Jun 6 03:40:39 2021 +0000 - - upstream: Client-side workaround for a bug in OpenSSH 7.4: this release - - allows RSA/SHA2 signatures for public key authentication but fails to - advertise this correctly via SSH2_MSG_EXT_INFO. This causes clients of these - server to incorrectly match PubkeyAcceptedAlgorithms and potentially refuse - to offer valid keys. - - Reported by and based on patch from Gordon Messmer via bz3213, thanks - also for additional analysis by Jakub Jelen. ok dtucker - - OpenBSD-Commit-ID: d6d0b7351d5d44c45f3daaa26efac65847a564f7 - -commit bda270d7fb8522d43c21a79a4b02a052d7c64de8 -Author: djm@openbsd.org -Date: Sun Jun 6 03:17:02 2021 +0000 - - upstream: degrade gracefully if a sftp-server offers the - - limits@openssh.com extension but fails when the client tries to invoke it. - Reported by Hector Martin via bz3318 - - OpenBSD-Commit-ID: bd9d1839c41811616ede4da467e25746fcd9b967 - -commit d345d5811afdc2d6923019b653cdd93c4cc95f76 -Author: djm@openbsd.org -Date: Sun Jun 6 03:15:39 2021 +0000 - - upstream: the limits@openssh.com extension was incorrectly marked - - as an operation that writes to the filesystem, which made it unavailable in - sftp-server read-only mode. Spotted by Hector Martin via bz3318 - - OpenBSD-Commit-ID: f054465230787e37516c4b57098fc7975e00f067 - -commit 2b71010d9b43d7b8c9ec1bf010beb00d98fa765a -Author: naddy@openbsd.org -Date: Sat Jun 5 13:47:00 2021 +0000 - - upstream: PROTOCOL.certkeys: update reference from IETF draft to - - RFC - - Also fix some typos. - ok djm@ - - OpenBSD-Commit-ID: 5e855b6c5a22b5b13f8ffa3897a868e40d349b44 - -commit aa99b2d9a3e45b943196914e8d8bf086646fdb54 -Author: Darren Tucker -Date: Fri Jun 4 23:41:29 2021 +1000 - - Clear notify_pipe from readset if present. - - Prevents leaking an implementation detail to the caller. - -commit 6de8dadf6b4d0627d35bca0667ca44b1d61c2c6b -Author: Darren Tucker -Date: Fri Jun 4 23:24:25 2021 +1000 - - space->tabs. - -commit c8677065070ee34c05c7582a9c2f58d8642e552d -Author: Darren Tucker -Date: Fri Jun 4 18:39:48 2021 +1000 - - Add pselect implementation for platforms without. - - This is basically the existing notify_pipe kludge from serverloop.c - moved behind a pselect interface. It works by installing a signal - handler that writes to a pipe that the select is watching, then calls - the original handler. - - The select call in serverloop will become pselect soon, at which point the - kludge will be removed from thereand will only exist in the compat layer. - Original code by markus, help from djm. - -commit 7cd7f302d3a072748299f362f9e241d81fcecd26 -Author: Vincent Brillault -Date: Sun May 24 09:15:06 2020 +0200 - - auth_log: dont log partial successes as failures - - By design, 'partial' logins are successful logins, so initially with - authenticated set to 1, for which another authentication is required. As - a result, authenticated is always reset to 0 when partial is set to 1. - However, even if authenticated is 0, those are not failed login - attempts, similarly to attempts with authctxt->postponed set to 1. - -commit e7606919180661edc7f698e6a1b4ef2cfb363ebf -Author: djm@openbsd.org -Date: Fri Jun 4 06:19:07 2021 +0000 - - upstream: The RB_GENERATE_STATIC(3) macro expands to a series of - - function definitions and not a statement, so there should be no semicolon - following them. Patch from Michael Forney - - OpenBSD-Commit-ID: c975dd180580f0bdc0a4d5b7d41ab1f5e9b7bedd - -commit c298c4da574ab92df2f051561aeb3e106b0ec954 -Author: djm@openbsd.org -Date: Fri Jun 4 05:59:18 2021 +0000 - - upstream: rework authorized_keys example section, removing irrelevant - - stuff, de-wrapping the example lines and better aligning the examples with - common usage and FAQs; ok jmc - - OpenBSD-Commit-ID: d59f1c9281f828148e2a2e49eb9629266803b75c - -commit d9cb35bbec5f623589d7c58fc094817b33030f35 -Author: djm@openbsd.org -Date: Fri Jun 4 05:10:03 2021 +0000 - - upstream: adjust SetEnv description to clarify $TERM handling - - OpenBSD-Commit-ID: 8b8cc0124856bc1094949d55615e5c44390bcb22 - -commit 771f57a8626709f2ad207058efd68fbf30d31553 -Author: dtucker@openbsd.org -Date: Fri Jun 4 05:09:08 2021 +0000 - - upstream: Switch the listening select loop from select() to - - pselect() and mask signals while checking signal flags, umasking for pselect - and restoring afterwards. Also restore signals before sighup_restart so they - don't remain blocked after restart. - - This prevents a race where a SIGTERM or SIGHUP can arrive between - checking the flag and calling select (eg if sshd is processing a - new connection) resulting in sshd not shutting down until the next - time it receives a new connection. bz#2158, with & ok djm@ - - OpenBSD-Commit-ID: bf85bf880fd78e00d7478657644fcda97b9a936f - -commit f64f8c00d158acc1359b8a096835849b23aa2e86 -Author: djm@openbsd.org -Date: Fri Jun 4 05:02:40 2021 +0000 - - upstream: allow ssh_config SetEnv to override $TERM, which is otherwise - - handled specially by the protocol. Useful in ~/.ssh/config to set TERM to - something generic (e.g. "xterm" instead of "xterm-256color") for destinations - that lack terminfo entries. feedback and ok dtucker@ - - OpenBSD-Commit-ID: 38b1ef4d5bc159c7d9d589d05e3017433e2d5758 - -commit 60107677dc0ce1e93c61f23c433ad54687fcd9f5 -Author: djm@openbsd.org -Date: Fri Jun 4 04:02:21 2021 +0000 - - upstream: correct extension name "no-presence-required" => - - "no-touch-required" - - document "verify-required" option - - OpenBSD-Commit-ID: 1879ff4062cf61d79b515e433aff0bf49a6c55c5 - -commit ecc186e46e3e30f27539b4311366dfda502f0a08 -Author: Darren Tucker -Date: Wed Jun 2 13:54:11 2021 +1000 - - Retire fbsd7 test target. - *** 1141 LINES SKIPPED *** From nobody Fri Jul 21 14:52:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6swF4835z4nbgY; Fri, 21 Jul 2023 14:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6swF3brDz45YL; Fri, 21 Jul 2023 14:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689951133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfvrt9SFMZfvbVNtQ28GeTcwyhNCd5PGqU1Gig0Bikc=; b=Ti1NB6xDZrSK0y9vSMDliJ0nYTZI4d1woYjij5TZj+XuBwr/tGn333VgOZDgj7K3HA5UqU eA15xNRGOD+G3Pmvp9m4WPnUqsKFJKgpb4ch3jk7KeRFVimhob7lXcwTqNEex1PJUbMEdX nU/++lEpZO0/+5HEE7KgPPjxAk6yLnkb09ZEEPv0Y2KXC84TPdF3k036tI8tXNxyJnS+od JXat0LG0iYXVuDEyQvWZfSnyVutF4O9CRn7HiKwwyCz32+IW80pBEKImX+o3aTubOVgSQ4 mGgsJxtm7CGCaPVZfrtKTkLqkT2Le3/MRo2Pg8SmpZpR1WyBRWwXhCNZYs0cCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689951133; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dfvrt9SFMZfvbVNtQ28GeTcwyhNCd5PGqU1Gig0Bikc=; b=F9UdzcCP2iXl12H8LeonUvTl2LdtignFLnsctgmUIvWDLGRfgAoUaKObALppzlcQsLFY6u JkTEE7Z/ZxVAFQvkjeaoJWRdS9hcntu2zZmBQf7w6l2zb0xkCSr3AKDcOhxWiK9uflu43+ Nja+Dyy5/fV6QICC/ojxet7l6+2Wc5C9SDYlWHw9ERUOEQUnJAi2c3yyhzvoO8NJf7xDCs p+0JCdty+hwJcpJ0fN5c3zaWN0MoNu9gzdTJ15zDWB3Kyhe+It+g+xlj8XpXW815z7KegB +zOJ3TmJ3nKvN3Bb18Kssq2jlSD8CfE4TAjthol+mlwXNwKdRdzwPeYeCE1pOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689951133; a=rsa-sha256; cv=none; b=IzvKKrll8pyqlSdYtj4N4M0BxNg++RGh0qjmfjmzC207zNhjphtQTgnoueMLSiZ7kuRakx prcbfTjaxnlST0EtHZFbTz8opHTErl0a4N768dntmc8mzBDz6nekjR8CiSc+YUUQMmrrUw sYxxntMnX8xOD4qMLGeLPy31bqYefL0DUoRONcTHqMaifVMP7cZ9A3mF9gN5eMzEGOb7n+ TLKz40sxNUiSL2sOmo3bHlliQRdl621fGDoDqUvVJE0Nei85hj2eC5xwXPfOam76P1N/cG AxiYxIOMV6GuG8ybSB2bsdS5CmkEULmFKrA8eVvWDeUJ6amkHe3mN5kP3c2Onw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6swF2BmDzHRN; Fri, 21 Jul 2023 14:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LEqDVU041187; Fri, 21 Jul 2023 14:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LEqDvU041186; Fri, 21 Jul 2023 14:52:13 GMT (envelope-from git) Date: Fri, 21 Jul 2023 14:52:13 GMT Message-Id: <202307211452.36LEqDvU041186@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: abf778208f10 - stable/12 - ssh: Apply CVE-2023-38408 fix from OpenSSH 9.3p2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: abf778208f101f57ecf402230c69222641f0a032 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=abf778208f101f57ecf402230c69222641f0a032 commit abf778208f101f57ecf402230c69222641f0a032 Author: Ed Maste AuthorDate: 2023-07-19 17:02:33 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:46:53 +0000 ssh: Apply CVE-2023-38408 fix from OpenSSH 9.3p2 OpenSSH 9.3p2 provides a fix CVE-2023-38408 - a condition where specific libaries loaded via ssh-agent(1)'s PKCS#11 support could be abused to achieve remote code execution via a forwarded agent socket if the following conditions are met: * Exploitation requires the presence of specific libraries on the victim system. * Remote exploitation requires that the agent was forwarded to an attacker-controlled system. This commit is the primary part of the fix in 9.3p2, applied to the OpenSSH version in FreeBSD 12.x. Security: CVE-2023-38408 Sponsored by: The FreeBSD Foundation --- crypto/openssh/ssh-pkcs11.c | 6 ++---- crypto/openssh/sshd_config | 2 +- crypto/openssh/sshd_config.5 | 2 +- crypto/openssh/version.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/crypto/openssh/ssh-pkcs11.c b/crypto/openssh/ssh-pkcs11.c index b2e2b32a5078..9e48c134e411 100644 --- a/crypto/openssh/ssh-pkcs11.c +++ b/crypto/openssh/ssh-pkcs11.c @@ -1537,10 +1537,8 @@ pkcs11_register_provider(char *provider_id, char *pin, error("dlopen %s failed: %s", provider_id, dlerror()); goto fail; } - if ((getfunctionlist = dlsym(handle, "C_GetFunctionList")) == NULL) { - error("dlsym(C_GetFunctionList) failed: %s", dlerror()); - goto fail; - } + if ((getfunctionlist = dlsym(handle, "C_GetFunctionList")) == NULL) + fatal("dlsym(C_GetFunctionList) failed: %s", dlerror()); p = xcalloc(1, sizeof(*p)); p->name = xstrdup(provider_id); p->handle = handle; diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config index 33c6e9a3b130..14a58ef4ddbb 100644 --- a/crypto/openssh/sshd_config +++ b/crypto/openssh/sshd_config @@ -106,7 +106,7 @@ AuthorizedKeysFile .ssh/authorized_keys #PermitTunnel no #ChrootDirectory none #UseBlacklist no -#VersionAddendum FreeBSD-20221019 +#VersionAddendum FreeBSD-20230719 # no default banner path #Banner none diff --git a/crypto/openssh/sshd_config.5 b/crypto/openssh/sshd_config.5 index 34dc3648ed26..dd8623d9b4dd 100644 --- a/crypto/openssh/sshd_config.5 +++ b/crypto/openssh/sshd_config.5 @@ -1822,7 +1822,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-20221019 . +.Qq FreeBSD-20230719 . The value .Cm none may be used to disable this. diff --git a/crypto/openssh/version.h b/crypto/openssh/version.h index 30539ed442ca..3f7069aba20f 100644 --- a/crypto/openssh/version.h +++ b/crypto/openssh/version.h @@ -6,4 +6,4 @@ #define SSH_PORTABLE "p1" #define SSH_RELEASE SSH_VERSION SSH_PORTABLE -#define SSH_VERSION_FREEBSD "FreeBSD-20221019" +#define SSH_VERSION_FREEBSD "FreeBSD-20230719" From nobody Fri Jul 21 15:38:36 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6txn0JWGz4p513; Fri, 21 Jul 2023 15:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6txm72ntz4LSj; Fri, 21 Jul 2023 15:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TPhYrn88wYxhuyEMEcT22sdtGbG9q6HOcGpGsk7Dd/A=; b=fRZsN9DVmMu/6C+ssRSfcKcdDSecQkG/p+dgzaxJv63o91bYfWL8rOTlP3576e0j0vuMRD L0Gn2qe0AJdkz1IQdXGcuIFvTlfi2FkdP3DtTLOLV9ivYzCBFGlrJu191QxcHhyPtQmhoY OwedpEEXBEMt694lDSKniPuPCqjd7hKDiJ2JGUMlb0GY7g9V9IBAOg+2C1BIZ91IT/5O/k mc1upBgrvTEPnubt0TwDpeLd9E96v/04BrCR8kh+6fDG/UlMT4Wuq6zL3P0kZdGfI4uFsX K5xjnXLRvIZxG0uAEdHxVhj3FGHkTPzrkZnrOUTAoRzCd5rny0iTLb+tVDyuqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TPhYrn88wYxhuyEMEcT22sdtGbG9q6HOcGpGsk7Dd/A=; b=eQQy3VS39lQGr0Ymkk8XgpjkONHKfDDu7eqUs57HZpW8PyPK7Dj6/xIBRoZk21R+6/2FyI /O5rh/yGT+d4iy0NLWNV3adlkGXPA0GsCvah1T3BCj4+VBDhdip8PPQuQcmrKEr6EiGCCl BnuYoieO+5KoSBuSi4Pm3fulwcc43f2uAgAbdbEkW+61wr+Lry9IoXPY2CcZxHmDj90dE8 bL1klu21nKFCDfTz7i98zwr3aOZbQeTi93B2mR5TmWT1d4sqYpbT/7k1wA9FhrdQTiDCXm /xffS/RyarRrnUD/lmVrUUnlXfEZu4q/qx/mk8wfZSHiMjQuSn0+9Gj+JlW1lg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689953917; a=rsa-sha256; cv=none; b=n/zsGXxoKQMQQJIb4zngFFug3UKSS5xtnOGn7aj2wdBEsvZMC3mnFnyDQQNLVAQGDOUtD6 EvTAeGRyblBocdfy29iEu+Zgj1AcgUjs/lxRC9fkVoBXlj6rqSXYrRqAjknldEvZVrb+k7 2D5tsVcBaNFUInZ94yZ84yVhk0OGt0hmWBbgl250fYhYrUaFE3Np6EIE8jmBpHAZVQTvme rpWNztgMT1kGfydZEN+5ekDe2iiyD39irBIFxmwRwhvSM+h33q8lNs2LbxTWLdJmjUaqEf o/hQ6YV57lNibbXDGRZrjAZJFqFzz7kGzeulogDzeOFU0e9iBl1xHKg1e5RLDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6txm5vFczHg7; Fri, 21 Jul 2023 15:38:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LFcatg009133; Fri, 21 Jul 2023 15:38:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LFcaPV009132; Fri, 21 Jul 2023 15:38:36 GMT (envelope-from git) Date: Fri, 21 Jul 2023 15:38:36 GMT Message-Id: <202307211538.36LFcaPV009132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 5300b2093424 - stable/13 - libcbor: update to 0.10.2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5300b2093424826ea82a7d07574f584e0b9613ff Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=5300b2093424826ea82a7d07574f584e0b9613ff commit 5300b2093424826ea82a7d07574f584e0b9613ff Author: Ed Maste AuthorDate: 2023-04-21 20:09:03 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:41:41 +0000 libcbor: update to 0.10.2 Sponsored by: The FreeBSD Foundation (cherry picked from commit 5d3e7166f6a0187fa3f8831b16a06bd9955c21ff) --- contrib/libcbor/.circleci/config.yml | 224 ++++++ .../libcbor/.github/ISSUE_TEMPLATE/bug_report.md | 20 + contrib/libcbor/.github/PULL_REQUEST_TEMPLATE | 15 + contrib/libcbor/.github/workflows/fuzz-pr.yml | 25 + contrib/libcbor/.github/workflows/fuzz.yml | 6 +- contrib/libcbor/.gitignore | 8 + contrib/libcbor/.travis.yml | 66 -- contrib/libcbor/Bazel.md | 100 +++ contrib/libcbor/CHANGELOG.md | 47 ++ contrib/libcbor/CMakeLists.txt | 54 +- contrib/libcbor/CMakeModules/FindCMocka.cmake | 8 + contrib/libcbor/CMakeModules/JoinPaths.cmake | 23 + contrib/libcbor/CONTRIBUTING.md | 35 + contrib/libcbor/Doxyfile | 778 ++++++++++++++------- contrib/libcbor/README.md | 54 +- contrib/libcbor/appveyor.yml | 19 +- contrib/libcbor/clang-format.sh | 9 +- contrib/libcbor/codecov.yml | 9 +- contrib/libcbor/doc/source/api.rst | 4 +- contrib/libcbor/doc/source/api/encoding.rst | 4 + .../doc/source/api/item_reference_counting.rst | 19 +- .../decoding.rst => api/streaming_decoding.rst} | 14 +- .../libcbor/doc/source/api/streaming_encoding.rst | 65 ++ contrib/libcbor/doc/source/api/type_2.rst | 5 - contrib/libcbor/doc/source/api/type_3.rst | 6 +- contrib/libcbor/doc/source/api/type_4.rst | 9 +- contrib/libcbor/doc/source/api/type_5.rst | 26 +- contrib/libcbor/doc/source/api/type_7.rst | 9 +- contrib/libcbor/doc/source/conf.py | 4 +- contrib/libcbor/doc/source/getting_started.rst | 7 +- contrib/libcbor/doc/source/index.rst | 1 - contrib/libcbor/doc/source/requirements.txt | 60 +- contrib/libcbor/doc/source/rfc_conformance.rst | 4 +- contrib/libcbor/doc/source/streaming.rst | 13 - contrib/libcbor/doc/source/streaming/encoding.rst | 4 - contrib/libcbor/doc/source/using.rst | 11 +- contrib/libcbor/examples/CMakeLists.txt | 3 + contrib/libcbor/examples/bazel/README.md | 33 + contrib/libcbor/examples/bazel/WORKSPACE | 19 + contrib/libcbor/examples/bazel/src/BUILD | 46 ++ contrib/libcbor/examples/bazel/src/hello.cc | 7 + contrib/libcbor/examples/bazel/src/hello.h | 8 + contrib/libcbor/examples/bazel/src/hello_test.cc | 10 + contrib/libcbor/examples/bazel/src/main.cc | 10 + contrib/libcbor/examples/bazel/third_party/BUILD | 1 + .../examples/bazel/third_party/libcbor.BUILD | 21 + .../examples/bazel/third_party/libcbor/BUILD | 11 + .../bazel/third_party/libcbor/cbor/cbor_export.h | 42 ++ .../bazel/third_party/libcbor/cbor/configuration.h | 15 + contrib/libcbor/examples/cjson2cbor.c | 8 +- contrib/libcbor/examples/create_items.c | 25 +- contrib/libcbor/examples/hello.c | 3 +- contrib/libcbor/examples/readfile.c | 3 +- contrib/libcbor/examples/sort.c | 15 +- contrib/libcbor/examples/streaming_array.c | 47 ++ contrib/libcbor/examples/streaming_parser.c | 10 +- contrib/libcbor/misc/update_version.py | 29 +- contrib/libcbor/oss-fuzz/build.sh | 2 +- contrib/libcbor/oss-fuzz/cbor_load_fuzzer.cc | 54 +- contrib/libcbor/release.sh | 8 +- contrib/libcbor/src/CMakeLists.txt | 18 +- contrib/libcbor/src/cbor.c | 144 ++-- contrib/libcbor/src/cbor.h | 26 +- contrib/libcbor/src/cbor/arrays.c | 22 +- contrib/libcbor/src/cbor/arrays.h | 71 +- contrib/libcbor/src/cbor/bytestrings.c | 40 +- contrib/libcbor/src/cbor/bytestrings.h | 54 +- contrib/libcbor/src/cbor/callbacks.c | 153 ++-- contrib/libcbor/src/cbor/callbacks.h | 14 +- contrib/libcbor/src/cbor/common.c | 29 +- contrib/libcbor/src/cbor/common.h | 152 ++-- contrib/libcbor/src/cbor/configuration.h.in | 1 - contrib/libcbor/src/cbor/data.h | 11 +- contrib/libcbor/src/cbor/encoding.c | 20 +- contrib/libcbor/src/cbor/encoding.h | 103 ++- contrib/libcbor/src/cbor/floats_ctrls.c | 64 +- contrib/libcbor/src/cbor/floats_ctrls.h | 114 +-- .../libcbor/src/cbor/internal/builder_callbacks.c | 230 +++--- .../libcbor/src/cbor/internal/builder_callbacks.h | 12 +- contrib/libcbor/src/cbor/internal/encoders.c | 28 +- contrib/libcbor/src/cbor/internal/encoders.h | 5 + contrib/libcbor/src/cbor/internal/loaders.c | 2 +- contrib/libcbor/src/cbor/internal/loaders.h | 9 +- contrib/libcbor/src/cbor/internal/memory_utils.c | 17 +- contrib/libcbor/src/cbor/internal/memory_utils.h | 13 +- contrib/libcbor/src/cbor/internal/stack.c | 6 +- contrib/libcbor/src/cbor/internal/stack.h | 14 +- contrib/libcbor/src/cbor/internal/unicode.c | 9 +- contrib/libcbor/src/cbor/internal/unicode.h | 7 +- contrib/libcbor/src/cbor/ints.c | 59 +- contrib/libcbor/src/cbor/ints.h | 61 +- contrib/libcbor/src/cbor/maps.c | 21 +- contrib/libcbor/src/cbor/maps.h | 65 +- contrib/libcbor/src/cbor/serialization.c | 276 +++++--- contrib/libcbor/src/cbor/serialization.h | 135 ++-- contrib/libcbor/src/cbor/streaming.c | 181 ++--- contrib/libcbor/src/cbor/streaming.h | 10 +- contrib/libcbor/src/cbor/strings.c | 39 +- contrib/libcbor/src/cbor/strings.h | 87 ++- contrib/libcbor/src/cbor/tags.c | 11 +- contrib/libcbor/src/cbor/tags.h | 35 +- contrib/libcbor/src/libcbor.pc.in | 4 +- contrib/libcbor/test/CMakeLists.txt | 14 +- ...ype_4_encoders_test.c => array_encoders_test.c} | 31 +- contrib/libcbor/test/array_test.c | 222 ++++++ contrib/libcbor/test/assertions.c | 32 +- contrib/libcbor/test/assertions.h | 20 +- contrib/libcbor/test/bad_inputs_test.c | 43 +- ..._encoders_test.c => bytestring_encoders_test.c} | 20 +- .../test/{type_2_test.c => bytestring_test.c} | 122 +++- contrib/libcbor/test/callbacks_test.c | 374 +++++++++- contrib/libcbor/test/cbor_serialize_test.c | 490 +++++++++++-- contrib/libcbor/test/cbor_stream_decode_test.c | 274 ++++++-- contrib/libcbor/test/copy_test.c | 346 +++++++-- contrib/libcbor/test/float_ctrl_encoders_test.c | 213 ++++++ .../test/{type_7_test.c => float_ctrl_test.c} | 80 ++- contrib/libcbor/test/fuzz_test.c | 15 +- ...{type_5_encoders_test.c => map_encoders_test.c} | 21 +- contrib/libcbor/test/{type_5_test.c => map_test.c} | 120 +++- contrib/libcbor/test/memory_allocation_test.c | 277 -------- contrib/libcbor/test/memory_utils_test.c | 59 ++ ...pe_1_encoders_test.c => negint_encoders_test.c} | 49 +- .../libcbor/test/{type_1_test.c => negint_test.c} | 40 +- contrib/libcbor/test/pretty_printer_test.c | 9 +- contrib/libcbor/test/stack_over_limit_test.c | 15 +- contrib/libcbor/test/stream_expectations.c | 107 +-- contrib/libcbor/test/stream_expectations.h | 71 +- ...pe_3_encoders_test.c => string_encoders_test.c} | 21 +- .../libcbor/test/{type_3_test.c => string_test.c} | 112 ++- ...{type_6_encoders_test.c => tag_encoders_test.c} | 15 +- contrib/libcbor/test/{type_6_test.c => tag_test.c} | 59 +- contrib/libcbor/test/test_allocator.c | 89 +++ contrib/libcbor/test/test_allocator.h | 35 + contrib/libcbor/test/type_4_test.c | 127 ---- contrib/libcbor/test/type_7_encoders_test.c | 109 --- ...type_0_encoders_test.c => uint_encoders_test.c} | 46 +- .../libcbor/test/{type_0_test.c => uint_test.c} | 58 +- contrib/libcbor/test/unicode_test.c | 23 +- lib/libcbor/Makefile | 3 +- 139 files changed, 5668 insertions(+), 2660 deletions(-) diff --git a/contrib/libcbor/.circleci/config.yml b/contrib/libcbor/.circleci/config.yml new file mode 100644 index 000000000000..69371b67d624 --- /dev/null +++ b/contrib/libcbor/.circleci/config.yml @@ -0,0 +1,224 @@ +version: 2.1 + +commands: + linux-setup: + steps: + - run: sudo apt-get update + - run: sudo apt-get install -y cmake ${TOOLCHAIN_PACKAGES} + - run: sudo apt install libcmocka-dev + build: + steps: + - run: > + cmake -DWITH_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DSANITIZE=OFF \ + -DCOVERAGE="${CMAKE_COVERAGE:='OFF'}" \ + . + - run: make -j 16 VERBOSE=1 + build-release: + steps: + - run: > + cmake -DWITH_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + . + - run: make -j 16 VERBOSE=1 + test: + steps: + - run: ctest -VV + +orbs: + codecov: codecov/codecov@3.2.2 + +jobs: + static-test: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: g++ + steps: + - checkout + - linux-setup + - run: sudo apt-get install -y clang-format doxygen cppcheck + - run: cppcheck --inline-suppr --error-exitcode=1 . + - run: bash clang-format.sh --verbose + - run: > + if ! $(git diff-index --quiet HEAD); then + echo "Code formatting doesn't conform to clang-format" + echo "Please run clang-format.sh, commit the diff, and push to re-run CI" + echo "Excerpt of the diff follows" + git diff | head -n 20 + fi + - run: > + if doxygen Doxyfile | grep 'warning: '; then + echo "Doxygen warning (see above) -- misformatted docs?" + exit 1 + fi + - run: > + cd doc && + pip3 install -r source/requirements.txt && + make html + + build-and-test: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: g++ + CMAKE_COVERAGE: ON + steps: + - checkout + - linux-setup + - run: sudo apt-get install -y valgrind + - build + - test + - run: ctest -T Coverage + - codecov/upload + - run: ctest --output-on-failure -T memcheck | tee memcheck.out + - run: > + if grep -q 'Memory Leak\|IPW\|Uninitialized Memory Conditional\|Uninitialized Memory Read' memcheck.out; then + cat Testing/Temporary/MemoryChecker* + exit 1 + fi; + + build-and-test-clang: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: clang + CC: clang + CXX: clang++ + steps: + - checkout + - linux-setup + - build + - test + + build-and-test-32b: + machine: + image: ubuntu-2204:2022.10.2 + steps: + - checkout + - run: sudo apt-get update + - run: sudo apt-get install -y cmake gcc-multilib g++-multilib libc6-dev-i386 + # Make cmocka from source w/ 32b setup + - run: git clone https://git.cryptomilk.org/projects/cmocka.git ~/cmocka + - run: > + cd $(mktemp -d /tmp/build.XXXX) && + cmake ~/cmocka -DCMAKE_TOOLCHAIN_FILE=~/cmocka/cmake/Toolchain-cross-m32.cmake && + make && + sudo make install + # Piggyback on the cmocka 32b toolchain + - run: > + cmake -DWITH_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_TOOLCHAIN_FILE=~/cmocka/cmake/Toolchain-cross-m32.cmake \ + . + - run: make -j 16 VERBOSE=1 + - test + + build-and-test-release-clang: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: clang + CC: clang + CXX: clang++ + steps: + - checkout + - linux-setup + - build-release + - test + + llvm-coverage: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: clang + CC: clang + CXX: clang++ + CMAKE_COVERAGE: ON + steps: + - checkout + - linux-setup + - build + - run: make llvm-coverage + + + build-and-test-arm: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: g++ + resource_class: arm.medium + steps: + - checkout + - linux-setup + - build + - test + + build-bazel: + machine: + image: ubuntu-2204:2022.10.2 + environment: + TOOLCHAIN_PACKAGES: g++ + steps: + - checkout + - linux-setup + - run: sudo apt install apt-transport-https curl gnupg + - run: curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg + - run: sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ + - run: echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list + - run: sudo apt update + - run: sudo apt install bazel + - run: bazel --version + - run: > + pushd examples/bazel && + bazel run -s src:hello + + build-and-test-osx: + macos: + xcode: 12.5.1 + steps: + - checkout + - run: bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + - run: brew install cmocka cmake + - build + - test + + + build-and-test-win: + resource_class: 'windows.medium' + machine: + image: 'windows-server-2022-gui:current' + shell: 'bash.exe' + steps: + - checkout + - run: choco install cmake -y + - run: git clone https://git.cryptomilk.org/projects/cmocka.git + - run: cd cmocka && git checkout tags/cmocka-1.1.5 + - run: /c/Program\ Files/Cmake/bin/cmake -S cmocka -B cmocka_build + - run: /c/Program\ Files/Cmake/bin/cmake --build cmocka_build + - run: /c/Program\ Files/Cmake/bin/cmake -S . -B libcbor_build -DWITH_TESTS=ON -DCMOCKA_INCLUDE_DIR=cmocka/include -DCMOCKA_LIBRARIES=$(pwd)/cmocka_build/src/Debug/cmocka.lib + - run: /c/Program\ Files/Cmake/bin/cmake --build libcbor_build + - run: > + export PATH="$(pwd)/cmocka_build/src/Debug/:$PATH" && + /c/Program\ Files/Cmake/bin/ctest.exe --test-dir libcbor_build --output-on-failure + +workflows: + build-and-test: + jobs: + - static-test + - build-and-test + - build-and-test-clang + - build-and-test-32b + - build-and-test-release-clang + - build-and-test-arm + - build-and-test-win + - build-bazel + - llvm-coverage + # OSX builds are expensive, run only on master + - build-and-test-osx: + requires: + - build-and-test + filters: + branches: + only: [master] diff --git a/contrib/libcbor/.github/ISSUE_TEMPLATE/bug_report.md b/contrib/libcbor/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..75997d8424cc --- /dev/null +++ b/contrib/libcbor/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,20 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: PJK + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior. If possible, please attach a runnable code snippet. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Environment** +libcbor version and build configuration flags (or source package version if using a package manager). diff --git a/contrib/libcbor/.github/PULL_REQUEST_TEMPLATE b/contrib/libcbor/.github/PULL_REQUEST_TEMPLATE new file mode 100644 index 000000000000..1174d56f9c7a --- /dev/null +++ b/contrib/libcbor/.github/PULL_REQUEST_TEMPLATE @@ -0,0 +1,15 @@ +## Description + +What changes and why + +## Checklist + +- [ ] I have read followed [CONTRIBUTING.md](https://github.com/PJK/libcbor/blob/master/CONTRIBUTING.md) + - [ ] I have added tests + - [ ] I have updated the documentation + - [ ] I have updated the CHANGELOG +- [ ] Are there any breaking changes? + - [ ] If yes: I have marked them in the CHANGELOG ([example](https://github.com/PJK/libcbor/blob/87e2d48a127968d39f158cbfc2b79d6285bd039d/CHANGELOG.md?plain=1#L16)) +- [ ] Does this PR introduce any platform specific code? +- [ ] Security: Does this PR potentially affect security? +- [ ] Performance: Does this PR potentially affect performance? diff --git a/contrib/libcbor/.github/workflows/fuzz-pr.yml b/contrib/libcbor/.github/workflows/fuzz-pr.yml new file mode 100644 index 000000000000..0e3c4fde4e02 --- /dev/null +++ b/contrib/libcbor/.github/workflows/fuzz-pr.yml @@ -0,0 +1,25 @@ +# A quick CIFuzz sanity check. Fuzzing time is kept low provide fast feedback +# on PRs; fuzz.yml schedules a daily long-running fuzzing job. +name: CIFuzz PR check +on: [pull_request] +jobs: + Fuzzing: + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'libcbor' + dry-run: false + - name: Smoke Test Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'libcbor' + fuzz-seconds: 10 + dry-run: false + - name: Upload Crash + uses: actions/upload-artifact@v1 + if: failure() + with: + name: artifacts + path: ./out/artifacts diff --git a/contrib/libcbor/.github/workflows/fuzz.yml b/contrib/libcbor/.github/workflows/fuzz.yml index c5275121868f..8603cc2f338e 100644 --- a/contrib/libcbor/.github/workflows/fuzz.yml +++ b/contrib/libcbor/.github/workflows/fuzz.yml @@ -1,5 +1,7 @@ name: CIFuzz -on: [pull_request] +on: + schedule: + - cron: '0 4 * * *' jobs: Fuzzing: runs-on: ubuntu-latest @@ -13,7 +15,7 @@ jobs: uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master with: oss-fuzz-project-name: 'libcbor' - fuzz-seconds: 600 + fuzz-seconds: 14400 # 4 hours dry-run: false - name: Upload Crash uses: actions/upload-artifact@v1 diff --git a/contrib/libcbor/.gitignore b/contrib/libcbor/.gitignore index b6fe00f938ad..61f88a874965 100644 --- a/contrib/libcbor/.gitignore +++ b/contrib/libcbor/.gitignore @@ -6,3 +6,11 @@ doxygen_docs */*.out cmake-build-debug venv +**.DS_Store +.vscode +# No top-level requirements, see doc/source +requirements.txt +examples/bazel/bazel-bazel +examples/bazel/bazel-bin +examples/bazel/bazel-out +examples/bazel/bazel-testlogs diff --git a/contrib/libcbor/.travis.yml b/contrib/libcbor/.travis.yml deleted file mode 100644 index 288de2903399..000000000000 --- a/contrib/libcbor/.travis.yml +++ /dev/null @@ -1,66 +0,0 @@ -language: c - -matrix: - include: - - arch: amd64 - os: linux - dist: bionic - compiler: clang - env: TRAVIS_ARCH="amd64" - - arch: amd64 - os: linux - dist: bionic - compiler: gcc - env: TRAVIS_ARCH="amd64" - - arch: arm64 - os: linux - dist: bionic - compiler: gcc - env: TRAVIS_ARCH="arm64" - - arch: ppc64le - os: linux - dist: bionic - compiler: gcc - env: TRAVIS_ARCH="ppc64le" - - arch: amd64 - os: osx - compiler: gcc - env: TRAVIS_ARCH="amd64" - -before_install: - - pushd ${HOME} - - git clone https://gitlab.com/cmocka/cmocka.git - - cd cmocka && mkdir build && cd build - - cmake .. && make -j2 && sudo make install - - cd .. && popd - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update -qq; sudo apt-get install -y clang-format-8 cppcheck; fi - - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" -a "$TRAVIS_ARCH" = "amd64" ]; then pip install --user codecov; export CFLAGS="-coverage"; fi - -script: - - > - if [ "$TRAVIS_OS_NAME" = "linux" ]; then - cppcheck . --error-exitcode=1 - # Fail if re-formatting creates diffs (implying bad formatting) - /clang-format.sh --verbose - git diff-index --quiet HEAD - fi; - - mkdir build && cd build - - cmake -DWITH_TESTS=ON - -DCBOR_CUSTOM_ALLOC=ON - -DCMAKE_BUILD_TYPE=Debug - -DSANITIZE=OFF - .. - - make VERBOSE=1 - - ctest -VV - - ctest -T memcheck | tee memcheck.out - - > - if grep -q 'Memory Leak\|IPW\|Uninitialized Memory Conditional\|Uninitialized Memory Read' memcheck.out; then - exit 1 - fi; - - -after_success: - - if [ "$TRAVIS_OS_NAME" = "linux" -a "$CC" = "gcc" -a "$TRAVIS_ARCH" = "amd64" ]; then codecov; fi - -notifications: - email: false diff --git a/contrib/libcbor/Bazel.md b/contrib/libcbor/Bazel.md new file mode 100644 index 000000000000..9fa2081f58fc --- /dev/null +++ b/contrib/libcbor/Bazel.md @@ -0,0 +1,100 @@ +# Use as a Bazel Dependency + +To use libcbor in your +[Baze](https://bazel.build/) +project, first add the following section to your project's `WORKSPACE` file. +Note the location of the `third_party/libcbor.BUILD` file - you may use a +different location if you wish, but you the file must be make available to +`WORKSPACE`. + +## WORKSPACE + +Note, this imports version `0.8.0` - you may need to update the version and +the sha256 hash. + +```python +# libcbor +http_archive( + name = "libcbor", + build_file = "//third_party:libcbor.BUILD", + sha256 = "dd04ea1a7df484217058d389e027e7a0143a4f245aa18a9f89a5dd3e1a4fcc9a", + strip_prefix = "libcbor-0.8.0", + urls = ["https://github.com/PJK/libcbor/archive/refs/tags/v0.8.0.zip"], +) +``` + +## third_party/libcbor.BUILD + +Bazel will unzip the libcbor zip file, then copy this file in as `BUILD`. +Bazel will then use this file to compile libcbor. +[Cmake](https://cmake.org/) +is used in two passes: to create the Makefiles, and then to invoke Make to build +the `libcbor.a` static library. `libcbor.a` and the `.h` files are then made +available for other packages to use. + +```python +genrule( + name = "cbor_cmake", + srcs = glob(["**"]), + outs = ["libcbor.a", "cbor.h", "cbor/arrays.h", "cbor/bytestrings.h", + "cbor/callbacks.h", "cbor/cbor_export.h", "cbor/common.h", "cbor/configuration.h", "cbor/data.h", + "cbor/encoding.h", "cbor/floats_ctrls.h", "cbor/ints.h", "cbor/maps.h", + "cbor/serialization.h", "cbor/streaming.h", "cbor/strings.h", "cbor/tags.h"], + cmd = " && ".join([ + # Remember where output should go. + "INITIAL_WD=`pwd`", + # Build libcbor library. + "cd `dirname $(location CMakeLists.txt)`", + "cmake -DCMAKE_BUILD_TYPE=Release .", + "cmake --build .", + # Export the .a and .h files for cbor rule, below. + "cp src/libcbor.a src/cbor.h $$INITIAL_WD/$(RULEDIR)", + "cp src/cbor/*h cbor/configuration.h $$INITIAL_WD/$(RULEDIR)/cbor"]), + visibility = ["//visibility:private"], +) + +cc_import( + name = "cbor", + hdrs = ["cbor.h", "cbor/arrays.h", "cbor/bytestrings.h", + "cbor/callbacks.h", "cbor/cbor_export.h", "cbor/common.h", "cbor/configuration.h", "cbor/data.h", + "cbor/encoding.h", "cbor/floats_ctrls.h", "cbor/ints.h", "cbor/maps.h", + "cbor/serialization.h", "cbor/streaming.h", "cbor/strings.h", "cbor/tags.h"], + static_library = "libcbor.a", + visibility = ["//visibility:public"], +) +``` + +## third_party/BUILD + +The `libcbor.BUILD` file must be make available to the top-level `WORKSPACE` +file: + +```python +exports_files(["libcbor.BUILD"])) +``` + +## Your BUILD File + +Add libcbor dependency to your package's `BUILD` file like so: + +```python +cc_library( + name = "...", + srcs = [ ... ], + hdrs = [ ... ], + deps = [ + ... + "@libcbor//:cbor", + ], +) +``` + +## Your C File + +Now you may simply include `cbor.h`: + +```c +#include "cbor.h" + +static const uint8_t version = cbor_major_version; +``` diff --git a/contrib/libcbor/CHANGELOG.md b/contrib/libcbor/CHANGELOG.md index 0f13a45d6b24..f2475f308c7a 100644 --- a/contrib/libcbor/CHANGELOG.md +++ b/contrib/libcbor/CHANGELOG.md @@ -1,6 +1,53 @@ +Template: +- [Fix issue X in feature Y](https://github.com/PJK/libcbor/pull/XXX) (by [YYY](https://github.com/YYY)) + Next --------------------- +0.10.2 (2023-01-31) +--------------------- +- [Fixed minor test bug causing failures for x86 Linux](https://github.com/PJK/libcbor/pull/266) (discovered by [trofi](https://github.com/PJK/libcbor/issues/263)) + - Actual libcbor functionality not affected, bug was in the test suite +- [Made tests platform-independent](https://github.com/PJK/libcbor/pull/272) + +0.10.1 (2022-12-30) +--------------------- +- [Fix a regression in `cbor_serialize_alloc` that caused serialization of zero-length strings and bytestrings or byte/strings with zero-length chunks to fail](https://github.com/PJK/libcbor/pull/260) (discovered by [martelletto](https://github.com/martelletto)) + +0.10.0 (2022-12-29) +--------------------- +- Make the buffer_size optional in `cbor_serialize_alloc` [[#205]](https://github.com/PJK/libcbor/pull/205) (by [hughsie](https://github.com/hughsie)) +- BREAKING: Improved half-float encoding for denormalized numbers. [[#208]](https://github.com/PJK/libcbor/pull/208) (by [ranvis](https://github.com/ranvis)) + - Denormalized half-floats will now preserve data in the mantissa + - Note: Half-float NaNs still lose data (https://github.com/PJK/libcbor/issues/215) +- BUILD BREAKING: Minimum CMake version is 3.0 [[#201]](https://github.com/PJK/libcbor/pull/201) (by [thewtex@](https://github.com/thewtex)) + - See https://repology.org/project/cmake/versions for support; the vast majority of users should not be affected. +- Fix a potential memory leak when the allocator fails during array or map decoding [[#224]](https://github.com/PJK/libcbor/pull/224) (by [James-ZHANG](https://github.com/James-ZHANG)) +- [Fix a memory leak when the allocator fails when adding chunks to indefinite bytestrings.](https://github.com/PJK/libcbor/pull/242) ([discovered](https://github.com/PJK/libcbor/pull/228) by [James-ZHANG](https://github.com/James-ZHANG)) +- [Fix a memory leak when the allocator fails when adding chunks to indefinite strings](https://github.com/PJK/libcbor/pull/246) +- Potentially BUILD BREAKING: [Add nodiscard attributes to most functions](https://github.com/PJK/libcbor/pull/248) + - **Warning**: This may cause new build warnings and (in rare cases, depending on your configuration) errors +- BREAKING: [Fix `cbor_copy` leaking memory and creating invalid items when the allocator fails](https://github.com/PJK/libcbor/pull/249). + - Previously, the failures were not handled in the interface. Now, `cbor_copy` may return `NULL` upon failure; clients should check the return value +- [Fix `cbor_build_tag` illegal memory behavior when the allocator fails](https://github.com/PJK/libcbor/pull/249) +- [Add a new `cbor_serialized_size` API](https://github.com/PJK/libcbor/pull/250) +- [Reworked `cbor_serialize_alloc` to allocate the exact amount of memory necessary upfront](https://github.com/PJK/libcbor/pull/251) + - This should significantly speed up `cbor_serialize_alloc` for large items by avoiding multiple reallocation iterations + - Clients should not use the return value of `cbor_serialize_alloc`. It may be removed in the future. +- BUILD BREAKING: [Deprecate CBOR_CUSTOM_ALLOC](https://github.com/PJK/libcbor/pull/237) + - `cbor_set_allocs` will always be enabled from now on + - Note: The flag will be kept as a no-op triggering a warning when used for one version and then removed completely + +0.9.0 (2021-11-14) +--------------------- +- Improved pkg-config paths handling [[#164]](https://github.com/PJK/libcbor/pull/164) (by [jtojnar@](https://github.com/jtojnar)) +- Use explicit math.h linkage [[#170]](https://github.com/PJK/libcbor/pull/170) +- BREAKING: Fixed handling of items that exceed the host size_t range [[#186]](https://github.com/PJK/libcbor/pull/186hg) + - Callbacks for bytestrings, strings, arrays, and maps use uint64_t instead of size_t to allow handling of large items that exceed size_t even if size_t < uint64_t + - cbor_decode explicitly checks size to avoid overflows (previously broken, potentially resulting in erroneous decoding on affected systems) + - The change should be a noop for 64b systems +- Added a [Bazel](https://bazel.build/) build example [[#196]](https://github.com/PJK/libcbor/pull/196) (by [andyjgf@](https://github.com/andyjgf)) + 0.8.0 (2020-09-20) --------------------- - BUILD BREAKING: Use BUILD_SHARED_LIBS to determine how to build libraries (fixed Windows linkage) [[#148]](https://github.com/PJK/libcbor/pull/148) (by [intelligide@](https://github.com/intelligide)) diff --git a/contrib/libcbor/CMakeLists.txt b/contrib/libcbor/CMakeLists.txt index edba03720d2f..5c0a7846cfa3 100644 --- a/contrib/libcbor/CMakeLists.txt +++ b/contrib/libcbor/CMakeLists.txt @@ -1,11 +1,11 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.0) project(libcbor) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules/") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/") include(CTest) SET(CBOR_VERSION_MAJOR "0") -SET(CBOR_VERSION_MINOR "8") -SET(CBOR_VERSION_PATCH "0") +SET(CBOR_VERSION_MINOR "10") +SET(CBOR_VERSION_PATCH "2") SET(CBOR_VERSION ${CBOR_VERSION_MAJOR}.${CBOR_VERSION_MINOR}.${CBOR_VERSION_PATCH}) set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true) @@ -18,6 +18,13 @@ if(BIG_ENDIAN) endif() option(CBOR_CUSTOM_ALLOC "Custom, dynamically defined allocator support" OFF) +if(CBOR_CUSTOM_ALLOC) + message(WARNING + "CBOR_CUSTOM_ALLOC has been deprecated. Custom allocators are now enabled by default." + "The flag is a no-op and will be removed in the next version. " + "Please remove CBOR_CUSTOM_ALLOC from your build configuation.") +endif(CBOR_CUSTOM_ALLOC) + option(CBOR_PRETTY_PRINTER "Include a pretty-printing routine" ON) set(CBOR_BUFFER_GROWTH "2" CACHE STRING "Factor for buffer growth & shrinking") set(CBOR_MAX_STACK_SIZE "2048" CACHE STRING "maximum size for decoding context stack") @@ -85,7 +92,7 @@ set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g") include(CheckTypeSize) check_type_size("size_t" SIZEOF_SIZE_T) if(SIZEOF_SIZE_T LESS 8) - message(WARNING "Your size_t is less than 8 bytes. Long items with 64b length specifiers might not work as expected. Make sure to run the tests!") + message(WARNING "Your size_t is less than 8 bytes. Decoding of huge items that would exceed the memory address space will always fail. Consider implementing a custom streaming decoder if you need to deal with huge items.") else() add_definitions(-DEIGHT_BYTE_SIZE_T) endif() @@ -99,19 +106,36 @@ add_custom_target(coverage COMMAND ctest COMMAND lcov --capture --directory . --output-file coverage.info COMMAND genhtml coverage.info --highlight --legend --output-directory coverage_html - COMMAND echo "Coverage report ready: file://${CMAKE_CURRENT_BINARY_DIR}/coverage_html/index.html") + COMMAND echo "Coverage report ready: ${CMAKE_CURRENT_BINARY_DIR}/coverage_html/index.html") + +add_custom_target(llvm-coverage + COMMAND make -j 16 + COMMAND rm -rf coverage_profiles + COMMAND mkdir coverage_profiles + COMMAND bash -c [[ for TEST in $(ls test/*_test); do LLVM_PROFILE_FILE="coverage_profiles/$(basename -- ${TEST}).profraw" ./${TEST}; done ]] + # VERBATIM makes escaping working, but breaks shell expansions, so we need to explicitly use bash + COMMAND bash -c [[ llvm-profdata merge -sparse $(ls coverage_profiles/*.profraw) -o coverage_profiles/combined.profdata ]] + COMMAND bash -c [[ llvm-cov show -instr-profile=coverage_profiles/combined.profdata test/*_test -format=html > coverage_profiles/report.html ]] + COMMAND bash -c [[ llvm-cov report -instr-profile=coverage_profiles/combined.profdata test/*_test ]] + COMMAND echo "Coverage report ready: ${CMAKE_CURRENT_BINARY_DIR}/coverage_profiles/report.html" + VERBATIM) + include_directories(src) -option(COVERAGE "Enable code coverage instrumentation" OFF) +option(c "Enable code coverage instrumentation" OFF) if (COVERAGE) message("Configuring code coverage instrumentation") - if(NOT CMAKE_C_COMPILER MATCHES "gcc") - message(WARNING "Gcov instrumentation only works with GCC") + if(CMAKE_C_COMPILER_ID MATCHES "GNU") + # https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fprofile-arcs -ftest-coverage --coverage") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g -fprofile-arcs -ftest-coverage --coverage") + elseif(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-instr-generate -fcoverage-mapping") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-instr-generate") + else() + message(WARNING "Code coverage build not implemented for compiler ${CMAKE_C_COMPILER_ID}") endif() - # https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fprofile-arcs -ftest-coverage --coverage") - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g -fprofile-arcs -ftest-coverage --coverage") endif (COVERAGE) @@ -139,20 +163,20 @@ else() message(STATUS "LTO is not enabled") endif(use_lto) -subdirs(src) +add_subdirectory(src) if(use_lto) set_property(DIRECTORY src PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) endif(use_lto) if (WITH_TESTS) - subdirs(test) + add_subdirectory(test) if(use_lto) set_property(DIRECTORY test PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) endif(use_lto) endif (WITH_TESTS) if (WITH_EXAMPLES) - subdirs(examples) + add_subdirectory(examples) if(use_lto) set_property(DIRECTORY examples PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) endif(use_lto) diff --git a/contrib/libcbor/CMakeModules/FindCMocka.cmake b/contrib/libcbor/CMakeModules/FindCMocka.cmake index 770b44afc426..29e57ae87f1b 100644 --- a/contrib/libcbor/CMakeModules/FindCMocka.cmake +++ b/contrib/libcbor/CMakeModules/FindCMocka.cmake @@ -21,7 +21,14 @@ #============================================================================= # +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_CMOCKA QUIET cmocka) + set(CMOCKA_DEFINITIONS ${PC_CMOCKA_CFLAGS_OTHER}) +endif() + find_path(CMOCKA_INCLUDE_DIR + HINTS ${PC_CMOCKA_INCLUDEDIR} ${PC_CMOCKA_INCLUDE_DIRS} NAMES cmocka.h PATHS @@ -29,6 +36,7 @@ find_path(CMOCKA_INCLUDE_DIR ) find_library(CMOCKA_LIBRARY + HINTS ${PC_CMOCKA_LIBDIR} ${PC_CMOCKA_LIBRARY_DIRS} NAMES cmocka cmocka_shared PATHS diff --git a/contrib/libcbor/CMakeModules/JoinPaths.cmake b/contrib/libcbor/CMakeModules/JoinPaths.cmake new file mode 100644 index 000000000000..c68d91b84dbc --- /dev/null +++ b/contrib/libcbor/CMakeModules/JoinPaths.cmake @@ -0,0 +1,23 @@ +# This module provides function for joining paths +# known from most languages +# +# SPDX-License-Identifier: (MIT OR CC0-1.0) +# Copyright 2020 Jan Tojnar +# https://github.com/jtojnar/cmake-snips +# +# Modelled after Python’s os.path.join +# https://docs.python.org/3.7/library/os.path.html#os.path.join +# Windows not supported +function(join_paths joined_path first_path_segment) + set(temp_path "${first_path_segment}") + foreach(current_segment IN LISTS ARGN) + if(NOT ("${current_segment}" STREQUAL "")) + if(IS_ABSOLUTE "${current_segment}") + set(temp_path "${current_segment}") + else() + set(temp_path "${temp_path}/${current_segment}") + endif() + endif() + endforeach() + set(${joined_path} "${temp_path}" PARENT_SCOPE) +endfunction() diff --git a/contrib/libcbor/CONTRIBUTING.md b/contrib/libcbor/CONTRIBUTING.md new file mode 100644 index 000000000000..cc834d21a46b --- /dev/null +++ b/contrib/libcbor/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contributing to libcbor + +libcbor is maintained by [@PJK](https://github.com/PJK) in his spare time on a best-effort basis. + +Community contributions are welcome as long as they align with the [project priorities](https://github.com/PJK/libcbor#main-features) and [goals](https://libcbor.readthedocs.io/en/latest/development.html#goals) and follow the guidelines described belows. + +## Principles + +**Bug reports and questions:** Bug reports and specific technical questions are always welcome. Feel free to open an [issue](https://github.com/PJK/libcbor/issues). + +**Incremental improvements:** Bug fixes (including build scripts, examples, test, typos, CI/CD config, etc.) and documentation improvements (fixes of typos, inaccuracies, out of date content, etc.) are always welcome. Feel free to open a [PR](https://github.com/PJK/libcbor/pulls). + +**New features:** I am looking to keep the scope of libcbor small. If you would like to add a feature, please open an issue with your proposal (or reach out to me privately) to discuss if the feature fits into libcbor before opening a PR. + +**Major changes:** Please open an issue with your proposal (or reach out to me privately) to discuss if the improvement fits into cbor before opening a PR. + +## Pull Request Process + +1. Ensure that all CI checks pass +2. Check that the PR is complete and of good quality + - Include a descriptive summary of the change. If the PR addresses an open issue, please link it. + - Code changes: Add tests + - If necessary: Update documentation, including any links +3. Code changes: Update [the changelog](https://github.com/PJK/libcbor/blob/master/CHANGELOG.md). Do *not* change the version number. + +## Interactions + +I work on libcbor on a best effort basis. The typical response time is a few days. + +If you do not receive a response in a few weeks, feel free to ping the PR or issue. + +## Resources + +- [Development documentation](https://libcbor.readthedocs.io/en/latest/development.html) + diff --git a/contrib/libcbor/Doxyfile b/contrib/libcbor/Doxyfile index b197d2bcdedc..2571057646d7 100644 --- a/contrib/libcbor/Doxyfile +++ b/contrib/libcbor/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.12 +# Doxyfile 1.9.6 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,16 +12,26 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. *** 13659 LINES SKIPPED *** From nobody Fri Jul 21 15:38:37 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6txp1y5gz4p5HD; Fri, 21 Jul 2023 15:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6txp1Pzhz4LYJ; Fri, 21 Jul 2023 15:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sD/EB1NbyyqAA10Yx2+EmGBf7naiSCmJpmhkc8dq6RQ=; b=cRjsSIkicos+OR0sJaU8R9xrS7NBIhF3umWBe66ZTmFBM+5J/XnqHX72fhvHVxlgB1tKJj lOt8iLceNjNN1yIbgmyL/31xN1mIUXCnYK1AK7GkzeR3/nepd0anlT56QwaOmXKvoqPOAR cSSHgBPlNrhyTRzihD/2g/sBGUUI/LNlWByx/KmX+C+QR4NBi+uGrkMkLsxijM85D5q3Qu Ue3YLY0mk7QSYNsjYXMFwIWj9QtjtXvYUf7+wahv/T7tWL/N64uAJrINmGO4MLypoOqa13 7AglzlX+Za4hJ6848wT8lk7Lqc+APgDR3eP+KO/t3orxqBq8alZT/X3/WcTEsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sD/EB1NbyyqAA10Yx2+EmGBf7naiSCmJpmhkc8dq6RQ=; b=KvQkcOqClR21YwLteqJrkt06QJkr/UQo6AJJOKtqrT3bPcHakvF9sIZfhc0Xan3FYOW1DZ HT5sclIfz1Imo3/HomzPssHjIVenC6ysEED32kWmnl3x7V4PecHsEudU0U6JrGEXlpoI/R YhVhZvO0QtwtP/VWgqNxkC6wMAp1NPY5inZeEUW3SUPL2S7dSHffNPMWfq0IrdqKHn7tdr SUOV/r+VznAKt3MOmnXfdxf2zZ5MLC44q9taXOCJYFoatBh7XtyEn/nMA64LU9x/PIbVcf sga0eSPR+p6vuq1FaDNzJif4uxIlR/SxxUodWrtCJvnQVVg44pFD0slNXscPug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689953918; a=rsa-sha256; cv=none; b=aURP7JL7CzVmz1VtdvqRCRo3v13uAGgqZg8eNCMCa50Ob+ItchVM3A+iGi1rI+blOwiwxF NbbOPRSs59Cr5AZ1QxftF39uxBp/CJe5xWkLPNIemXw0iHZSFeiTEifB8umia3c6toHg0Y QYQLrjCakFv3oF6W+yVqHL1+WTz3O8nwAq0zyy+zWTxjEphf7YdB3dcAX1Tiy94IoXHAhD 271jzLzSRRdz5Ih0xExNHpEebA3KkO4d0/MqesrTxLddejm+TS0kDUKrGdWzgJX6Qumvsp IPIkIzffNTwbxo9tcyn4pAReO/V3I0cMtEJByriXNG0SjlM5gse2mROIY3QHfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6txp0C4HzJZt; Fri, 21 Jul 2023 15:38:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LFcbh2009152; Fri, 21 Jul 2023 15:38:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LFcbZC009151; Fri, 21 Jul 2023 15:38:37 GMT (envelope-from git) Date: Fri, 21 Jul 2023 15:38:37 GMT Message-Id: <202307211538.36LFcbZC009151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: b27bad1e0373 - stable/13 - libfido2: update to 1.9.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b27bad1e0373832af03cf2c4f84006899baa81e1 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b27bad1e0373832af03cf2c4f84006899baa81e1 commit b27bad1e0373832af03cf2c4f84006899baa81e1 Author: Ed Maste AuthorDate: 2023-05-05 23:11:52 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:41:42 +0000 libfido2: update to 1.9.0 Some highlights from NEWS: ** Added OpenSSL 3.0 compatibility. ** Removed OpenSSL 1.0 compatibility. ** Support for FIDO 2.1 "minPinLength" extension. ** Support for COSE_EDDSA, COSE_ES256, and COSE_RS1 attestation. ** Support for TPM 2.0 attestation. ** Support for device timeouts; see fido_dev_set_timeout(). ** New API calls: - es256_pk_from_EVP_PKEY; - fido_cred_attstmt_len; - fido_cred_attstmt_ptr; - fido_cred_pin_minlen; - fido_cred_set_attstmt; - fido_cred_set_pin_minlen; - fido_dev_set_pin_minlen_rpid; - fido_dev_set_timeout; - rs256_pk_from_EVP_PKEY. ** Reliability and portability fixes. ** Better handling of HID devices without identification strings; gh#381. Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit f540a43052c12c76d3453ead881248d5467a1ab0) --- contrib/libfido2/CMakeLists.txt | 59 +- contrib/libfido2/NEWS | 22 + contrib/libfido2/README.adoc | 9 +- contrib/libfido2/examples/assert.c | 44 +- contrib/libfido2/examples/cred.c | 110 +- contrib/libfido2/examples/extern.h | 8 - contrib/libfido2/examples/reset.c | 13 +- contrib/libfido2/examples/util.c | 28 - contrib/libfido2/fuzz/Dockerfile | 6 +- contrib/libfido2/fuzz/Makefile | 16 +- contrib/libfido2/fuzz/clock.c | 79 ++ contrib/libfido2/fuzz/dummy.h | 83 ++ contrib/libfido2/fuzz/export.gnu | 12 + contrib/libfido2/fuzz/functions.txt | 1165 ++++++++++++---------- contrib/libfido2/fuzz/fuzz_assert.c | 48 +- contrib/libfido2/fuzz/fuzz_bio.c | 1 + contrib/libfido2/fuzz/fuzz_cred.c | 39 +- contrib/libfido2/fuzz/fuzz_credman.c | 1 + contrib/libfido2/fuzz/fuzz_hid.c | 30 +- contrib/libfido2/fuzz/fuzz_largeblob.c | 1 + contrib/libfido2/fuzz/fuzz_mgmt.c | 28 + contrib/libfido2/fuzz/fuzz_netlink.c | 94 +- contrib/libfido2/fuzz/mutator_aux.c | 5 +- contrib/libfido2/fuzz/mutator_aux.h | 5 +- contrib/libfido2/fuzz/report.tgz | Bin 303082 -> 320981 bytes contrib/libfido2/fuzz/summary.txt | 86 +- contrib/libfido2/fuzz/wrap.c | 201 ++-- contrib/libfido2/fuzz/wrapped.sym | 25 +- contrib/libfido2/man/CMakeLists.txt | 17 +- contrib/libfido2/man/es256_pk_new.3 | 18 +- contrib/libfido2/man/fido2-token.1 | 12 + contrib/libfido2/man/fido_cred_new.3 | 50 +- contrib/libfido2/man/fido_cred_set_authdata.3 | 57 +- contrib/libfido2/man/fido_cred_verify.3 | 12 +- contrib/libfido2/man/fido_dev_enable_entattest.3 | 27 +- contrib/libfido2/man/fido_dev_info_manifest.3 | 10 + contrib/libfido2/man/fido_dev_set_io_functions.3 | 35 +- contrib/libfido2/man/rs256_pk_new.3 | 18 +- contrib/libfido2/openbsd-compat/hkdf.c | 124 --- contrib/libfido2/openbsd-compat/hkdf.h | 65 -- contrib/libfido2/openbsd-compat/openbsd-compat.h | 17 +- contrib/libfido2/openbsd-compat/strsep.c | 79 ++ contrib/libfido2/regress/CMakeLists.txt | 10 +- contrib/libfido2/regress/assert.c | 88 +- contrib/libfido2/regress/cred.c | 646 +++++++++++- contrib/libfido2/regress/dev.c | 154 ++- contrib/libfido2/src/CMakeLists.txt | 15 +- contrib/libfido2/src/assert.c | 168 +--- contrib/libfido2/src/authkey.c | 16 +- contrib/libfido2/src/bio.c | 77 +- contrib/libfido2/src/cbor.c | 107 +- contrib/libfido2/src/config.c | 74 +- contrib/libfido2/src/cred.c | 245 +++-- contrib/libfido2/src/credman.c | 62 +- contrib/libfido2/src/dev.c | 63 +- contrib/libfido2/src/ecdh.c | 12 +- contrib/libfido2/src/eddsa.c | 82 +- contrib/libfido2/src/es256.c | 62 +- contrib/libfido2/src/export.gnu | 9 + contrib/libfido2/src/export.llvm | 9 + contrib/libfido2/src/export.msvc | 9 + contrib/libfido2/src/extern.h | 55 +- contrib/libfido2/src/fido.h | 18 +- contrib/libfido2/src/fido/config.h | 2 + contrib/libfido2/src/fido/eddsa.h | 9 +- contrib/libfido2/src/fido/es256.h | 3 +- contrib/libfido2/src/fido/param.h | 8 +- contrib/libfido2/src/fido/rs256.h | 3 +- contrib/libfido2/src/fido/types.h | 14 +- contrib/libfido2/src/hid_freebsd.c | 8 +- contrib/libfido2/src/hid_linux.c | 4 +- contrib/libfido2/src/hid_openbsd.c | 17 +- contrib/libfido2/src/hid_osx.c | 32 +- contrib/libfido2/src/hid_unix.c | 3 +- contrib/libfido2/src/hid_win.c | 48 +- contrib/libfido2/src/info.c | 81 +- contrib/libfido2/src/io.c | 104 +- contrib/libfido2/src/largeblob.c | 65 +- contrib/libfido2/src/netlink.c | 4 +- contrib/libfido2/src/nfc_linux.c | 44 +- contrib/libfido2/src/pin.c | 72 +- contrib/libfido2/src/reset.c | 12 +- contrib/libfido2/src/rs1.c | 99 ++ contrib/libfido2/src/rs256.c | 127 ++- contrib/libfido2/src/time.c | 74 ++ contrib/libfido2/src/tpm.c | 286 ++++++ contrib/libfido2/src/types.c | 76 ++ contrib/libfido2/src/u2f.c | 158 ++- contrib/libfido2/src/webauthn.h | 839 ++++++++++++++++ contrib/libfido2/src/winhello.c | 387 +++---- contrib/libfido2/tools/CMakeLists.txt | 3 + contrib/libfido2/tools/config.c | 48 + contrib/libfido2/tools/extern.h | 3 +- contrib/libfido2/tools/fido2-token.c | 2 + contrib/libfido2/tools/token.c | 6 + contrib/libfido2/windows/build.ps1 | 390 ++++---- contrib/libfido2/windows/const.ps1 | 42 + contrib/libfido2/windows/release.ps1 | 84 ++ lib/libfido2/Makefile | 4 + 99 files changed, 5599 insertions(+), 2302 deletions(-) diff --git a/contrib/libfido2/CMakeLists.txt b/contrib/libfido2/CMakeLists.txt index 101b7b33e2fc..d775a98c5b48 100644 --- a/contrib/libfido2/CMakeLists.txt +++ b/contrib/libfido2/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Yubico AB. All rights reserved. +# Copyright (c) 2018-2021 Yubico AB. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. @@ -28,7 +28,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_COLOR_MAKEFILE OFF) set(CMAKE_VERBOSE_MAKEFILE ON) set(FIDO_MAJOR "1") -set(FIDO_MINOR "8") +set(FIDO_MINOR "9") set(FIDO_PATCH "0") set(FIDO_VERSION ${FIDO_MAJOR}.${FIDO_MINOR}.${FIDO_PATCH}) @@ -68,10 +68,11 @@ if(NOT MSVC) set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_DARWIN_C_SOURCE") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__STDC_WANT_LIB_EXT1__=1") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(NFC_LINUX OFF) + set(NFC_LINUX ON) set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_GNU_SOURCE") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_DEFAULT_SOURCE") - elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__BSD_VISIBLE=1") endif() set(FIDO_CFLAGS "${FIDO_CFLAGS} -std=c99") @@ -79,7 +80,7 @@ if(NOT MSVC) endif() check_c_compiler_flag("-Wshorten-64-to-32" HAVE_SHORTEN_64_TO_32) -check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL) +check_c_compiler_flag("-Werror -fstack-protector-all" HAVE_STACK_PROTECTOR_ALL) check_include_files(cbor.h HAVE_CBOR_H) check_include_files(endian.h HAVE_ENDIAN_H) @@ -88,7 +89,6 @@ check_include_files(openssl/opensslv.h HAVE_OPENSSLV_H) check_include_files(signal.h HAVE_SIGNAL_H) check_include_files(sys/random.h HAVE_SYS_RANDOM_H) check_include_files(unistd.h HAVE_UNISTD_H) -check_include_files("windows.h;webauthn.h" HAVE_WEBAUTHN_H) check_symbol_exists(arc4random_buf stdlib.h HAVE_ARC4RANDOM_BUF) check_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME) @@ -101,17 +101,13 @@ check_symbol_exists(getrandom sys/random.h HAVE_GETRANDOM) check_symbol_exists(memset_s string.h HAVE_MEMSET_S) check_symbol_exists(readpassphrase readpassphrase.h HAVE_READPASSPHRASE) check_symbol_exists(recallocarray stdlib.h HAVE_RECALLOCARRAY) -check_symbol_exists(sigaction signal.h HAVE_SIGACTION) check_symbol_exists(strlcat string.h HAVE_STRLCAT) check_symbol_exists(strlcpy string.h HAVE_STRLCPY) +check_symbol_exists(strsep string.h HAVE_STRSEP) check_symbol_exists(sysconf unistd.h HAVE_SYSCONF) check_symbol_exists(timespecsub sys/time.h HAVE_TIMESPECSUB) check_symbol_exists(timingsafe_bcmp string.h HAVE_TIMINGSAFE_BCMP) -set(CMAKE_EXTRA_INCLUDE_FILES signal.h) -check_type_size("sig_atomic_t" HAVE_SIG_ATOMIC_T) -set(CMAKE_EXTRA_INCLUDE_FILES) - set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) try_compile(HAVE_POSIX_IOCTL "${CMAKE_CURRENT_BINARY_DIR}/posix_ioctl_check.o" @@ -134,16 +130,15 @@ list(APPEND CHECK_VARIABLES HAVE_POSIX_IOCTL HAVE_READPASSPHRASE HAVE_RECALLOCARRAY - HAVE_SIGACTION HAVE_SIGNAL_H HAVE_STRLCAT HAVE_STRLCPY + HAVE_STRSEP HAVE_SYSCONF HAVE_SYS_RANDOM_H HAVE_TIMESPECSUB HAVE_TIMINGSAFE_BCMP HAVE_UNISTD_H - HAVE_WEBAUTHN_H ) foreach(v ${CHECK_VARIABLES}) @@ -156,26 +151,26 @@ if(HAVE_EXPLICIT_BZERO AND NOT LIBFUZZER) add_definitions(-DHAVE_EXPLICIT_BZERO) endif() -if(HAVE_SIGACTION AND (NOT HAVE_SIG_ATOMIC_T STREQUAL "")) - add_definitions(-DSIGNAL_EXAMPLE) -endif() - if(UNIX) add_definitions(-DHAVE_DEV_URANDOM) endif() if(MSVC) if((NOT CBOR_INCLUDE_DIRS) OR (NOT CBOR_LIBRARY_DIRS) OR - (NOT CRYPTO_INCLUDE_DIRS) OR (NOT CRYPTO_LIBRARY_DIRS) OR - (NOT ZLIB_INCLUDE_DIRS) OR (NOT ZLIB_LIBRARY_DIRS)) - message(FATAL_ERROR "please provide definitions for " - "{CBOR,CRYPTO,ZLIB}_{INCLUDE,LIBRARY}_DIRS when building " - "under msvc") + (NOT CBOR_BIN_DIRS) OR (NOT CRYPTO_INCLUDE_DIRS) OR + (NOT CRYPTO_LIBRARY_DIRS) OR (NOT CRYPTO_BIN_DIRS) OR + (NOT ZLIB_INCLUDE_DIRS) OR (NOT ZLIB_LIBRARY_DIRS) OR + (NOT ZLIB_BIN_DIRS)) + message(FATAL_ERROR "please define " + "{CBOR,CRYPTO,ZLIB}_{INCLUDE,LIBRARY,BIN}_DIRS when " + "building under msvc") endif() set(CBOR_LIBRARIES cbor) set(ZLIB_LIBRARIES zlib) set(CRYPTO_LIBRARIES crypto-46) set(MSVC_DISABLED_WARNINGS_LIST + "C4152" # nonstandard extension used: function/data pointer + # conversion in expression; "C4200" # nonstandard extension used: zero-sized array in # struct/union; "C4204" # nonstandard extension used: non-constant aggregate @@ -191,12 +186,10 @@ if(MSVC) ${MSVC_DISABLED_WARNINGS_LIST}) string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Z7 /guard:cf /sdl /RTCcsu") + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Od /Z7 /guard:cf /sdl /RTCcsu") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /guard:cf /sdl") - if (HAVE_WEBAUTHN_H) - add_definitions(-DUSE_WINHELLO) - set(USE_WINHELLO ON) - endif() + add_definitions(-DUSE_WINHELLO) + set(USE_WINHELLO ON) else() include(FindPkgConfig) pkg_search_module(CBOR libcbor) @@ -275,9 +268,14 @@ else() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-omit-frame-pointer") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2") + if(CRYPTO_VERSION VERSION_GREATER_EQUAL 3.0) + add_definitions(-DOPENSSL_API_COMPAT=0x10100000L) + endif() + if(FUZZ) add_definitions(-DFIDO_FUZZ) endif() + if(LIBFUZZER) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=fuzzer-no-link") endif() @@ -404,10 +402,9 @@ if(BUILD_MANPAGES) endif() if(NOT WIN32) - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - if(NOT LIBFUZZER AND NOT FUZZ) - subdirs(regress) - endif() + if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT FUZZ) + enable_testing() + subdirs(regress) endif() if(FUZZ) subdirs(fuzz) diff --git a/contrib/libfido2/NEWS b/contrib/libfido2/NEWS index a89766b72e89..04cda4e0e83a 100644 --- a/contrib/libfido2/NEWS +++ b/contrib/libfido2/NEWS @@ -1,3 +1,25 @@ +* Version 1.9.0 (2021-10-27) + ** Enabled NFC support on Linux. + ** Added OpenSSL 3.0 compatibility. + ** Removed OpenSSL 1.0 compatibility. + ** Support for FIDO 2.1 "minPinLength" extension. + ** Support for COSE_EDDSA, COSE_ES256, and COSE_RS1 attestation. + ** Support for TPM 2.0 attestation. + ** Support for device timeouts; see fido_dev_set_timeout(). + ** New API calls: + - es256_pk_from_EVP_PKEY; + - fido_cred_attstmt_len; + - fido_cred_attstmt_ptr; + - fido_cred_pin_minlen; + - fido_cred_set_attstmt; + - fido_cred_set_pin_minlen; + - fido_dev_set_pin_minlen_rpid; + - fido_dev_set_timeout; + - rs256_pk_from_EVP_PKEY. + ** Reliability and portability fixes. + ** Better handling of HID devices without identification strings; gh#381. + ** Fixed detection of Windows's native webauthn API; gh#382. + * Version 1.8.0 (2021-07-22) ** Dropped 'Requires.private' entry from pkg-config file. ** Better support for FIDO 2.1 authenticators. diff --git a/contrib/libfido2/README.adoc b/contrib/libfido2/README.adoc index f5ffa7e4e602..a0e188bf8774 100644 --- a/contrib/libfido2/README.adoc +++ b/contrib/libfido2/README.adoc @@ -23,6 +23,8 @@ file for the full license text. *libfido2* is known to work on Linux, macOS, Windows, OpenBSD, and FreeBSD. +NFC support is available on Linux and Windows. + === Documentation Documentation is available in troff and HTML formats. An @@ -40,7 +42,7 @@ is also available. ==== Releases -The current release of *libfido2* is 1.8.0. Please consult Yubico's +The current release of *libfido2* is 1.9.0. Please consult Yubico's https://developers.yubico.com/libfido2/Releases[release page] for source and binary releases. @@ -66,7 +68,7 @@ Follow the instructions for Ubuntu 18.04 (Bionic) below. Or from source, on UNIX-like systems: - $ (rm -rf build && mkdir build && cd build && cmake ..) + $ cmake -B build $ make -C build $ sudo make -C build install @@ -75,7 +77,8 @@ https://www.freedesktop.org/wiki/Software/pkg-config/[pkg-config] may need to be installed, or the PKG_CONFIG_PATH environment variable set. *libfido2* depends on https://github.com/pjk/libcbor[libcbor], -https://www.openssl.org[OpenSSL], and https://zlib.net[zlib]. On Linux, libudev +https://www.openssl.org[OpenSSL] 1.1 or newer, and https://zlib.net[zlib]. +On Linux, libudev (part of https://www.freedesktop.org/wiki/Software/systemd[systemd]) is also required. diff --git a/contrib/libfido2/examples/assert.c b/contrib/libfido2/examples/assert.c index dc3fda3ac447..8b0dbd9f6eb2 100644 --- a/contrib/libfido2/examples/assert.c +++ b/contrib/libfido2/examples/assert.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Yubico AB. All rights reserved. + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ @@ -20,7 +20,7 @@ #include "../openbsd-compat/openbsd-compat.h" #include "extern.h" -static const unsigned char cdh[32] = { +static const unsigned char cd[32] = { 0xec, 0x8d, 0x8f, 0x78, 0x42, 0x4a, 0x2b, 0xb7, 0x82, 0x34, 0xaa, 0xca, 0x07, 0xa1, 0xf6, 0x56, 0x42, 0x1c, 0xb6, 0xf6, 0xb3, 0x00, 0x86, 0x52, @@ -106,10 +106,9 @@ verify_assert(int type, const unsigned char *authdata_ptr, size_t authdata_len, errx(1, "fido_assert_new"); /* client data hash */ - r = fido_assert_set_clientdata_hash(assert, cdh, sizeof(cdh)); + r = fido_assert_set_clientdata(assert, cd, sizeof(cd)); if (r != FIDO_OK) - errx(1, "fido_assert_set_clientdata_hash: %s (0x%x)", - fido_strerr(r), r); + errx(1, "fido_assert_set_clientdata: %s (0x%x)", fido_strerr(r), r); /* relying party */ r = fido_assert_set_rp(assert, "localhost"); @@ -166,7 +165,7 @@ main(int argc, char **argv) const char *blobkey_out = NULL; const char *hmac_out = NULL; unsigned char *body = NULL; - long long seconds = 0; + long long ms = 0; size_t len; int type = COSE_ES256; int ext = 0; @@ -182,16 +181,12 @@ main(int argc, char **argv) pin = optarg; break; case 'T': -#ifndef SIGNAL_EXAMPLE - (void)seconds; - errx(1, "-T not supported"); -#else - if (base10(optarg, &seconds) < 0) + if (base10(optarg, &ms) < 0) errx(1, "base10: %s", optarg); - if (seconds <= 0 || seconds > 30) + if (ms <= 0 || ms > 30) errx(1, "-T: %s must be in (0,30]", optarg); + ms *= 1000; /* seconds to milliseconds */ break; -#endif case 'a': if (read_blob(optarg, &body, &len) < 0) errx(1, "read_blob: %s", optarg); @@ -262,10 +257,9 @@ main(int argc, char **argv) fido_dev_force_u2f(dev); /* client data hash */ - r = fido_assert_set_clientdata_hash(assert, cdh, sizeof(cdh)); + r = fido_assert_set_clientdata(assert, cd, sizeof(cd)); if (r != FIDO_OK) - errx(1, "fido_assert_set_clientdata_hash: %s (0x%x)", - fido_strerr(r), r); + errx(1, "fido_assert_set_clientdata: %s (0x%x)", fido_strerr(r), r); /* relying party */ r = fido_assert_set_rp(assert, "localhost"); @@ -286,20 +280,12 @@ main(int argc, char **argv) if (uv && (r = fido_assert_set_uv(assert, FIDO_OPT_TRUE)) != FIDO_OK) errx(1, "fido_assert_set_uv: %s (0x%x)", fido_strerr(r), r); -#ifdef SIGNAL_EXAMPLE - prepare_signal_handler(SIGINT); - if (seconds) { - prepare_signal_handler(SIGALRM); - alarm((unsigned)seconds); - } -#endif + /* timeout */ + if (ms != 0 && (r = fido_dev_set_timeout(dev, (int)ms)) != FIDO_OK) + errx(1, "fido_dev_set_timeout: %s (0x%x)", fido_strerr(r), r); - r = fido_dev_get_assert(dev, assert, pin); - if (r != FIDO_OK) { -#ifdef SIGNAL_EXAMPLE - if (got_signal) - fido_dev_cancel(dev); -#endif + if ((r = fido_dev_get_assert(dev, assert, pin)) != FIDO_OK) { + fido_dev_cancel(dev); errx(1, "fido_dev_get_assert: %s (0x%x)", fido_strerr(r), r); } diff --git a/contrib/libfido2/examples/cred.c b/contrib/libfido2/examples/cred.c index 74145c761380..4a9d8bf4b25a 100644 --- a/contrib/libfido2/examples/cred.c +++ b/contrib/libfido2/examples/cred.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Yubico AB. All rights reserved. + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ @@ -17,7 +17,7 @@ #include "../openbsd-compat/openbsd-compat.h" #include "extern.h" -static const unsigned char cdh[32] = { +static const unsigned char cd[32] = { 0xf9, 0x64, 0x57, 0xe7, 0x2d, 0x97, 0xf6, 0xbb, 0xdd, 0xd7, 0xfb, 0x06, 0x37, 0x62, 0xea, 0x26, 0x20, 0x44, 0x8e, 0x69, 0x7c, 0x03, 0xf2, 0x31, @@ -42,9 +42,8 @@ usage(void) static void verify_cred(int type, const char *fmt, const unsigned char *authdata_ptr, - size_t authdata_len, const unsigned char *x509_ptr, size_t x509_len, - const unsigned char *sig_ptr, size_t sig_len, bool rk, bool uv, int ext, - const char *key_out, const char *id_out) + size_t authdata_len, const unsigned char *attstmt_ptr, size_t attstmt_len, + bool rk, bool uv, int ext, const char *key_out, const char *id_out) { fido_cred_t *cred; int r; @@ -57,11 +56,10 @@ verify_cred(int type, const char *fmt, const unsigned char *authdata_ptr, if (r != FIDO_OK) errx(1, "fido_cred_set_type: %s (0x%x)", fido_strerr(r), r); - /* client data hash */ - r = fido_cred_set_clientdata_hash(cred, cdh, sizeof(cdh)); + /* client data */ + r = fido_cred_set_clientdata(cred, cd, sizeof(cd)); if (r != FIDO_OK) - errx(1, "fido_cred_set_clientdata_hash: %s (0x%x)", - fido_strerr(r), r); + errx(1, "fido_cred_set_clientdata: %s (0x%x)", fido_strerr(r), r); /* relying party */ r = fido_cred_set_rp(cred, "localhost", "sweet home localhost"); @@ -96,15 +94,10 @@ verify_cred(int type, const char *fmt, const unsigned char *authdata_ptr, goto out; } - /* x509 */ - r = fido_cred_set_x509(cred, x509_ptr, x509_len); + /* attestation statement */ + r = fido_cred_set_attstmt(cred, attstmt_ptr, attstmt_len); if (r != FIDO_OK) - errx(1, "fido_cred_set_x509: %s (0x%x)", fido_strerr(r), r); - - /* sig */ - r = fido_cred_set_sig(cred, sig_ptr, sig_len); - if (r != FIDO_OK) - errx(1, "fido_cred_set_sig: %s (0x%x)", fido_strerr(r), r); + errx(1, "fido_cred_set_attstmt: %s (0x%x)", fido_strerr(r), r); r = fido_cred_verify(cred); if (r != FIDO_OK) @@ -138,27 +131,6 @@ out: fido_cred_free(&cred); } -static fido_dev_t * -open_from_manifest(const fido_dev_info_t *dev_infos, size_t len, - const char *path) -{ - size_t i; - fido_dev_t *dev; - - for (i = 0; i < len; i++) { - const fido_dev_info_t *curr = fido_dev_info_ptr(dev_infos, i); - if (path == NULL || - strcmp(path, fido_dev_info_path(curr)) == 0) { - dev = fido_dev_new_with_info(curr); - if (fido_dev_open_with_info(dev) == FIDO_OK) - return (dev); - fido_dev_free(&dev); - } - } - - return (NULL); -} - int main(int argc, char **argv) { @@ -171,16 +143,13 @@ main(int argc, char **argv) const char *blobkey_out = NULL; const char *key_out = NULL; const char *id_out = NULL; - const char *path = NULL; unsigned char *body = NULL; - long long seconds = 0; + long long ms = 0; size_t len; int type = COSE_ES256; int ext = 0; int ch; int r; - fido_dev_info_t *dev_infos = NULL; - size_t dev_infos_len = 0; if ((cred = fido_cred_new()) == NULL) errx(1, "fido_cred_new"); @@ -191,16 +160,12 @@ main(int argc, char **argv) pin = optarg; break; case 'T': -#ifndef SIGNAL_EXAMPLE - (void)seconds; - errx(1, "-T not supported"); -#else - if (base10(optarg, &seconds) < 0) + if (base10(optarg, &ms) < 0) errx(1, "base10: %s", optarg); - if (seconds <= 0 || seconds > 30) + if (ms <= 0 || ms > 30) errx(1, "-T: %s must be in (0,30]", optarg); + ms *= 1000; /* seconds to milliseconds */ break; -#endif case 'b': ext |= FIDO_EXT_LARGEBLOB_KEY; blobkey_out = optarg; @@ -248,21 +213,20 @@ main(int argc, char **argv) } } - fido_init(0); - argc -= optind; argv += optind; - if (argc > 1) + if (argc != 1) usage(); - dev_infos = fido_dev_info_new(16); - fido_dev_info_manifest(dev_infos, 16, &dev_infos_len); - if (argc == 1) - path = argv[0]; - if ((dev = open_from_manifest(dev_infos, dev_infos_len, path)) == NULL) - errx(1, "open_from_manifest"); + fido_init(0); + + if ((dev = fido_dev_new()) == NULL) + errx(1, "fido_dev_new"); + r = fido_dev_open(dev, argv[0]); + if (r != FIDO_OK) + errx(1, "fido_dev_open: %s (0x%x)", fido_strerr(r), r); if (u2f) fido_dev_force_u2f(dev); @@ -271,11 +235,10 @@ main(int argc, char **argv) if (r != FIDO_OK) errx(1, "fido_cred_set_type: %s (0x%x)", fido_strerr(r), r); - /* client data hash */ - r = fido_cred_set_clientdata_hash(cred, cdh, sizeof(cdh)); + /* client data */ + r = fido_cred_set_clientdata(cred, cd, sizeof(cd)); if (r != FIDO_OK) - errx(1, "fido_cred_set_clientdata_hash: %s (0x%x)", - fido_strerr(r), r); + errx(1, "fido_cred_set_clientdata: %s (0x%x)", fido_strerr(r), r); /* relying party */ r = fido_cred_set_rp(cred, "localhost", "sweet home localhost"); @@ -301,20 +264,12 @@ main(int argc, char **argv) if (uv && (r = fido_cred_set_uv(cred, FIDO_OPT_TRUE)) != FIDO_OK) errx(1, "fido_cred_set_uv: %s (0x%x)", fido_strerr(r), r); -#ifdef SIGNAL_EXAMPLE - prepare_signal_handler(SIGINT); - if (seconds) { - prepare_signal_handler(SIGALRM); - alarm((unsigned)seconds); - } -#endif + /* timeout */ + if (ms != 0 && (r = fido_dev_set_timeout(dev, (int)ms)) != FIDO_OK) + errx(1, "fido_dev_set_timeout: %s (0x%x)", fido_strerr(r), r); - r = fido_dev_make_cred(dev, cred, pin); - if (r != FIDO_OK) { -#ifdef SIGNAL_EXAMPLE - if (got_signal) - fido_dev_cancel(dev); -#endif + if ((r = fido_dev_make_cred(dev, cred, pin)) != FIDO_OK) { + fido_dev_cancel(dev); errx(1, "fido_makecred: %s (0x%x)", fido_strerr(r), r); } @@ -329,9 +284,8 @@ main(int argc, char **argv) uv = true; verify_cred(type, fido_cred_fmt(cred), fido_cred_authdata_ptr(cred), - fido_cred_authdata_len(cred), fido_cred_x5c_ptr(cred), - fido_cred_x5c_len(cred), fido_cred_sig_ptr(cred), - fido_cred_sig_len(cred), rk, uv, ext, key_out, id_out); + fido_cred_authdata_len(cred), fido_cred_attstmt_ptr(cred), + fido_cred_attstmt_len(cred), rk, uv, ext, key_out, id_out); if (blobkey_out != NULL) { /* extract the "largeBlob" key */ diff --git a/contrib/libfido2/examples/extern.h b/contrib/libfido2/examples/extern.h index 0ea68c4fb585..5633b23d2003 100644 --- a/contrib/libfido2/examples/extern.h +++ b/contrib/libfido2/examples/extern.h @@ -11,10 +11,6 @@ #include #include -#ifdef HAVE_SIGNAL_H -#include -#endif - /* util.c */ EC_KEY *read_ec_pubkey(const char *); RSA *read_rsa_pubkey(const char *); @@ -25,9 +21,5 @@ int write_blob(const char *, const unsigned char *, size_t); int write_ec_pubkey(const char *, const void *, size_t); int write_rsa_pubkey(const char *, const void *, size_t); int write_eddsa_pubkey(const char *, const void *, size_t); -#ifdef SIGNAL_EXAMPLE -void prepare_signal_handler(int); -extern volatile sig_atomic_t got_signal; -#endif #endif /* _EXTERN_H_ */ diff --git a/contrib/libfido2/examples/reset.c b/contrib/libfido2/examples/reset.c index eb341c26c0cd..b429d05f0fe4 100644 --- a/contrib/libfido2/examples/reset.c +++ b/contrib/libfido2/examples/reset.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Yubico AB. All rights reserved. + * Copyright (c) 2018-2021 Yubico AB. All rights reserved. * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file. */ @@ -34,16 +34,9 @@ main(int argc, char **argv) if ((r = fido_dev_open(dev, argv[1])) != FIDO_OK) errx(1, "fido_dev_open: %s (0x%x)", fido_strerr(r), r); -#ifdef SIGNAL_EXAMPLE - prepare_signal_handler(SIGINT); -#endif - if ((r = fido_dev_reset(dev)) != FIDO_OK) { -#ifdef SIGNAL_EXAMPLE - if (got_signal) - fido_dev_cancel(dev); -#endif - errx(1, "fido_reset: %s (0x%x)", fido_strerr(r), r); + fido_dev_cancel(dev); + errx(1, "fido_dev_reset: %s (0x%x)", fido_strerr(r), r); } if ((r = fido_dev_close(dev)) != FIDO_OK) diff --git a/contrib/libfido2/examples/util.c b/contrib/libfido2/examples/util.c index caa68aa880ee..8b360af21c7a 100644 --- a/contrib/libfido2/examples/util.c +++ b/contrib/libfido2/examples/util.c @@ -21,9 +21,6 @@ #include #include #include -#ifdef HAVE_SIGNAL_H -#include -#endif #ifdef HAVE_UNISTD_H #include #endif @@ -33,31 +30,6 @@ #include "../openbsd-compat/openbsd-compat.h" #include "extern.h" -#ifdef SIGNAL_EXAMPLE -volatile sig_atomic_t got_signal = 0; - -static void -signal_handler(int signo) -{ - (void)signo; - got_signal = 1; -} - -void -prepare_signal_handler(int signo) -{ - struct sigaction sa; - - memset(&sa, 0, sizeof(sa)); - - sigemptyset(&sa.sa_mask); - sa.sa_handler = signal_handler; - - if (sigaction(signo, &sa, NULL) < 0) - err(1, "sigaction"); -} -#endif - int base10(const char *str, long long *ll) { diff --git a/contrib/libfido2/fuzz/Dockerfile b/contrib/libfido2/fuzz/Dockerfile index 895da69e4c4c..f175991d0462 100644 --- a/contrib/libfido2/fuzz/Dockerfile +++ b/contrib/libfido2/fuzz/Dockerfile @@ -1,12 +1,12 @@ -# Copyright (c) 2019 Yubico AB. All rights reserved. +# Copyright (c) 2019-2021 Yubico AB. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. FROM ubuntu:focal ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get install -y clang-11 cmake git libssl-dev libudev-dev make pkg-config +RUN apt-get install -y clang-12 cmake git libssl-dev libudev-dev make pkg-config RUN apt-get install -y zlib1g-dev RUN git clone --branch v0.8.0 https://github.com/PJK/libcbor RUN git clone https://github.com/yubico/libfido2 -RUN CC=clang-11 CXX=clang++-11 /libfido2/fuzz/build-coverage /libcbor /libfido2 +RUN CC=clang-12 CXX=clang++-12 /libfido2/fuzz/build-coverage /libcbor /libfido2 diff --git a/contrib/libfido2/fuzz/Makefile b/contrib/libfido2/fuzz/Makefile index 4b067c23aac2..1a974a2bf557 100644 --- a/contrib/libfido2/fuzz/Makefile +++ b/contrib/libfido2/fuzz/Makefile @@ -1,11 +1,11 @@ -# Copyright (c) 2019 Yubico AB. All rights reserved. +# Copyright (c) 2019-2021 Yubico AB. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -IMAGE := libfido2-coverage:1.8.0 +IMAGE := libfido2-coverage:1.9.1 RUNNER := libfido2-runner -PROFDATA := llvm-profdata-11 -COV := llvm-cov-11 +PROFDATA := llvm-profdata-12 +COV := llvm-cov-12 TARGETS := fuzz_assert fuzz_bio fuzz_cred fuzz_credman fuzz_hid \ fuzz_largeblob fuzz_netlink fuzz_mgmt CORPORA := $(foreach f,${TARGETS},${f}/corpus) @@ -50,16 +50,18 @@ profdata: run report.tgz: profdata docker exec ${RUNNER} /bin/sh -c 'rm -rf /report && mkdir /report && \ ${COV} show -format=html -tab-size=8 -instr-profile=/$< \ - -output-dir=/report /libfido2/build/src/libfido2.so' + --show-branch-summary=false -output-dir=/report \ + /libfido2/build/src/libfido2.so' docker exec -i ${RUNNER} tar Czcf / - report > $@ summary.txt: profdata docker exec ${RUNNER} ${COV} report -use-color=false \ - /libfido2/build/src/libfido2.so -instr-profile=/$< > $@ + --show-branch-summary=false /libfido2/build/src/libfido2.so \ + -instr-profile=/$< > $@ functions.txt: profdata docker exec ${RUNNER} /bin/sh -c '${COV} report -use-color=false \ - -show-functions -instr-profile=/$< \ + -show-functions --show-branch-summary=false -instr-profile=/$< \ /libfido2/build/src/libfido2.so /libfido2/src/*.[ch]' > $@ clean: run diff --git a/contrib/libfido2/fuzz/clock.c b/contrib/libfido2/fuzz/clock.c new file mode 100644 index 000000000000..23803c2ee3e5 --- /dev/null +++ b/contrib/libfido2/fuzz/clock.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Yubico AB. All rights reserved. + * Use of this source code is governed by a BSD-style + * license that can be found in the LICENSE file. + */ + +#include +#include + +#include "mutator_aux.h" + +/* + * A pseudo-random monotonic clock with a probabilistic discontinuity to + * the end of time (as measured by struct timespec). + */ + +extern int prng_up; +extern int __wrap_clock_gettime(clockid_t, struct timespec *); +extern int __real_clock_gettime(clockid_t, struct timespec *); +extern int __wrap_usleep(unsigned int); +static TLS struct timespec fuzz_clock; + +static void +tick(unsigned int usec) +{ + long long drift; + + /* + * Simulate a jump to the end of time with 0.125% probability. + * This condition should be gracefully handled by callers of + * clock_gettime(). + */ + if (uniform_random(800) < 1) { + fuzz_clock.tv_sec = LLONG_MAX; + fuzz_clock.tv_nsec = LONG_MAX; + return; + } + + drift = usec * 1000LL + (long long)uniform_random(10000000); /* 10ms */ + if (LLONG_MAX - drift < (long long)fuzz_clock.tv_nsec) { + fuzz_clock_reset(); /* Not much we can do here. */ + } else if (drift + (long long)fuzz_clock.tv_nsec < 1000000000) { + fuzz_clock.tv_nsec += (long)(drift); + } else { + fuzz_clock.tv_sec += (long)(drift / 1000000000); + fuzz_clock.tv_nsec += (long)(drift % 1000000000); + } +} + +int +__wrap_clock_gettime(clockid_t clk_id, struct timespec *tp) +{ + if (!prng_up || clk_id != CLOCK_MONOTONIC) + return __real_clock_gettime(clk_id, tp); + if (uniform_random(400) < 1) + return -1; + + tick(0); + *tp = fuzz_clock; + + return 0; +} + +int +__wrap_usleep(unsigned int usec) +{ + if (uniform_random(400) < 1) + return -1; + + tick(usec); + + return 0; +} + +void +fuzz_clock_reset(void) +{ + memset(&fuzz_clock, 0, sizeof(fuzz_clock)); +} diff --git a/contrib/libfido2/fuzz/dummy.h b/contrib/libfido2/fuzz/dummy.h index 981cceec37b5..95744eba634b 100644 --- a/contrib/libfido2/fuzz/dummy.h +++ b/contrib/libfido2/fuzz/dummy.h @@ -93,4 +93,87 @@ const uint8_t dummy_eddsa[] = { 0xe2, 0x39, 0xdf, 0x2f, 0x87, 0x19, 0xb3, 0x02, }; +const uint8_t dummy_netlink_wiredata[] = { + 0xd8, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9d, 0x2e, 0x00, 0x00, + 0x01, 0x02, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x6e, 0x66, 0x63, 0x00, 0x06, 0x00, 0x01, 0x00, + 0x1e, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x05, 0x00, + 0x1f, 0x00, 0x00, 0x00, 0x80, 0x01, 0x06, 0x00, + 0x14, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x03, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x05, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x06, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x08, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x09, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x0f, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x0a, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, + 0x13, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x14, 0x00, 0x0c, 0x00, *** 12268 LINES SKIPPED *** From nobody Fri Jul 21 15:38:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6txq3PjPz4p5HN; Fri, 21 Jul 2023 15:38: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6txq20RVz4LfF; Fri, 21 Jul 2023 15:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5jjaeU2OGW9CY4s0dp/jmxcNrvYecuF0P4nhR/qmdOM=; b=EnvvTgGMocvB1eADPHsgj7sg5+tN2xeZMzG5UA6iglc2XKmV9igY4azVRbbvLH6dWJQJy6 uYeXVNsO+zUjwpyNt73OkoTEcz2cntKxhOxs+Bl/Y+epNQEsCR4uzGwkIvTo/s0OaxkNjs u/8LIbFre8pMXdGxVt+mq961hO+3LViZtrEmYvzKAkre8jPxZ77qHMs1aCxFBFatTzkGJK cqZLrYDjXIEMxZIyhzxsRY/nJBIscGJ+YJR6MC+UdeoPd9dBtj+Xn1mQaA+pPAGaPBPNAw v7+KYEhLUNF6q8OCuho5PKLkwVRD5R3CSV96dsUvWrYAY7lprxg80sr8Gxt3jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689953919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5jjaeU2OGW9CY4s0dp/jmxcNrvYecuF0P4nhR/qmdOM=; b=WrePcKN4l7SPDGuEUnuYqk1vyhLiz8/ZXLq53ZCkiWeGXY3drokz9lSfqy5HrypGQtTZl+ lVNK/0VCL3TON/fCvnVMZjvR/PlamFdxg1O6Jj/jUDKL5li9DNhvmHIao6ucOfNq7zYy3r mHubl7zXCagKNA75YErekcxI7WwPmoyT8MMOS5vj5LiqKvXKLI2TnWJdsam8bYAvHFCbEl mt1BBoadlJmrngxXN0MWOTCDyU81KfUeu+InAPjN+TNWSqW8e83gFoqrbwFq6EIeMcijzY FMA2r6R5nnOd2wuw2+QqJ3FQzSj/8PhUMADBIiW36bDg5DlH3KX72KAuF287pA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689953919; a=rsa-sha256; cv=none; b=Z+vcmPX0JY8XwOjUBhwPWnnBCN7eUhHSmbnxJVmjN5z7OETvN+d9sh37xRD78r7S8d/ubj qxETrP2ordmWLOXGiJ+oBG8wFCxORPFiF4wQvfu1/W73HZJazfWExYAPL8N6RKHTtcHxOv whNQqRu9vNg03fYQyOPn00JChhR6X8i+Z0J5qp9ADa9XxsabYLQ5Gy8vs63UGm5b91fEbt zZ5+CeVYp/uluvi1hIIIFS3tTBFHlz1j/cdNIdblKaYIm2QAuaj0ETZwTvrVjBtw4UQpQ9 Jtorg4ULPDDHRzT6/9N0IJOJWlCxLKCLMgPoPc2iOngI/hCo3IZALALKtt/HWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6txq0yT0zJcR; Fri, 21 Jul 2023 15:38:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LFcdfF009173; Fri, 21 Jul 2023 15:38:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LFcdMf009172; Fri, 21 Jul 2023 15:38:39 GMT (envelope-from git) Date: Fri, 21 Jul 2023 15:38:39 GMT Message-Id: <202307211538.36LFcdMf009172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 079a1c2059e7 - stable/13 - libfido2: update to 1.10.0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 079a1c2059e7cc19360ff6840317efefdff876a1 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=079a1c2059e7cc19360ff6840317efefdff876a1 commit 079a1c2059e7cc19360ff6840317efefdff876a1 Author: Ed Maste AuthorDate: 2023-05-05 23:57:34 +0000 Commit: Ed Maste CommitDate: 2023-07-21 14:41:42 +0000 libfido2: update to 1.10.0 Some highlights from NEWS: ** bio: fix CTAP2 canonical CBOR encoding in fido_bio_dev_enroll_*(); gh#480. ** New API calls: - fido_dev_info_set; - fido_dev_io_handle; - fido_dev_new_with_info; - fido_dev_open_with_info. ** Documentation and reliability fixes. ** Support for TPM 2.0 attestation of COSE_ES256 credentials. Relnotes: Yes Sponsored by: The FreeBSD Foundation (cherry picked from commit 3e696dfb7009cd8ffa12e36f48f4339bb7a2048d) --- contrib/libfido2/CMakeLists.txt | 47 +- contrib/libfido2/LICENSE | 2 +- contrib/libfido2/NEWS | 14 + contrib/libfido2/README.adoc | 4 +- contrib/libfido2/SECURITY.md | 5 + contrib/libfido2/examples/README.adoc | 2 +- contrib/libfido2/fuzz/Dockerfile | 2 +- contrib/libfido2/fuzz/Makefile | 2 +- contrib/libfido2/fuzz/export.gnu | 1 + contrib/libfido2/fuzz/functions.txt | 35 +- contrib/libfido2/fuzz/fuzz_hid.c | 11 +- contrib/libfido2/fuzz/report.tgz | Bin 320981 -> 323706 bytes contrib/libfido2/fuzz/summary.txt | 14 +- contrib/libfido2/man/CMakeLists.txt | 17 +- contrib/libfido2/man/check.sh | 42 ++ contrib/libfido2/man/eddsa_pk_new.3 | 4 +- contrib/libfido2/man/es256_pk_new.3 | 8 +- contrib/libfido2/man/fido2-assert.1 | 6 +- contrib/libfido2/man/fido2-cred.1 | 6 +- contrib/libfido2/man/fido2-token.1 | 24 +- contrib/libfido2/man/fido_assert_allow_cred.3 | 4 +- contrib/libfido2/man/fido_assert_new.3 | 95 ++-- contrib/libfido2/man/fido_assert_set_authdata.3 | 57 ++- contrib/libfido2/man/fido_assert_verify.3 | 6 +- contrib/libfido2/man/fido_bio_dev_get_info.3 | 2 +- contrib/libfido2/man/fido_bio_enroll_new.3 | 4 +- contrib/libfido2/man/fido_bio_info_new.3 | 2 +- contrib/libfido2/man/fido_bio_template.3 | 4 +- contrib/libfido2/man/fido_cbor_info_new.3 | 3 +- contrib/libfido2/man/fido_cred_exclude.3 | 2 +- contrib/libfido2/man/fido_cred_new.3 | 10 +- contrib/libfido2/man/fido_cred_set_authdata.3 | 20 +- contrib/libfido2/man/fido_cred_verify.3 | 44 +- contrib/libfido2/man/fido_credman_metadata_new.3 | 6 +- contrib/libfido2/man/fido_dev_enable_entattest.3 | 6 +- contrib/libfido2/man/fido_dev_get_assert.3 | 6 +- contrib/libfido2/man/fido_dev_get_touch_begin.3 | 4 +- contrib/libfido2/man/fido_dev_info_manifest.3 | 41 +- contrib/libfido2/man/fido_dev_largeblob_get.3 | 10 +- contrib/libfido2/man/fido_dev_make_cred.3 | 6 +- contrib/libfido2/man/fido_dev_open.3 | 71 ++- contrib/libfido2/man/fido_dev_set_io_functions.3 | 81 +++- contrib/libfido2/man/fido_dev_set_pin.3 | 2 +- contrib/libfido2/man/fido_init.3 | 28 +- contrib/libfido2/man/fido_strerr.3 | 2 +- contrib/libfido2/man/rs256_pk_new.3 | 4 +- contrib/libfido2/regress/cred.c | 576 ++++++++++++++++++++++- contrib/libfido2/src/CMakeLists.txt | 2 +- contrib/libfido2/src/bio.c | 4 +- contrib/libfido2/src/cbor.c | 1 - contrib/libfido2/src/dev.c | 7 + contrib/libfido2/src/eddsa.c | 6 +- contrib/libfido2/src/export.gnu | 4 + contrib/libfido2/src/export.llvm | 4 + contrib/libfido2/src/export.msvc | 4 + contrib/libfido2/src/extern.h | 1 - contrib/libfido2/src/fido.h | 8 +- contrib/libfido2/src/fido/types.h | 4 +- contrib/libfido2/src/hid.c | 56 ++- contrib/libfido2/src/hid_osx.c | 62 ++- contrib/libfido2/src/hid_win.c | 2 +- contrib/libfido2/src/tpm.c | 144 +++++- contrib/libfido2/src/webauthn.h | 88 +++- contrib/libfido2/src/winhello.c | 171 ++++--- contrib/libfido2/tools/test.sh | 6 +- contrib/libfido2/windows/build.ps1 | 2 +- contrib/libfido2/windows/const.ps1 | 6 +- contrib/libfido2/windows/cygwin.gpg | Bin 0 -> 2193 bytes contrib/libfido2/windows/cygwin.ps1 | 68 +++ contrib/libfido2/windows/release.ps1 | 19 +- lib/libfido2/Makefile | 2 +- 71 files changed, 1639 insertions(+), 374 deletions(-) diff --git a/contrib/libfido2/CMakeLists.txt b/contrib/libfido2/CMakeLists.txt index d775a98c5b48..11a51ac5a645 100644 --- a/contrib/libfido2/CMakeLists.txt +++ b/contrib/libfido2/CMakeLists.txt @@ -9,7 +9,7 @@ project(libfido2 C) cmake_minimum_required(VERSION 3.0) # Set PIE flags for POSITION_INDEPENDENT_CODE targets, added in CMake 3.14. if(POLICY CMP0083) - cmake_policy(SET CMP0083 NEW) + cmake_policy(SET CMP0083 NEW) endif() include(CheckCCompilerFlag) @@ -21,14 +21,14 @@ include(CheckTypeSize) include(GNUInstallDirs) include(CheckPIESupported OPTIONAL RESULT_VARIABLE CHECK_PIE_SUPPORTED) if(CHECK_PIE_SUPPORTED) - check_pie_supported(LANGUAGES C) + check_pie_supported(LANGUAGES C) endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_COLOR_MAKEFILE OFF) set(CMAKE_VERBOSE_MAKEFILE ON) set(FIDO_MAJOR "1") -set(FIDO_MINOR "9") +set(FIDO_MINOR "10") set(FIDO_PATCH "0") set(FIDO_VERSION ${FIDO_MAJOR}.${FIDO_MINOR}.${FIDO_PATCH}) @@ -40,16 +40,15 @@ option(BUILD_TOOLS "Build tool programs" ON) option(FUZZ "Enable fuzzing instrumentation" OFF) option(LIBFUZZER "Build libfuzzer harnesses" OFF) option(USE_HIDAPI "Use hidapi as the HID backend" OFF) -option(USE_WINHELLO "Abstract Windows Hello as a FIDO device" OFF) -option(NFC_LINUX "Experimental NFC support on Linux" OFF) +option(USE_WINHELLO "Abstract Windows Hello as a FIDO device" ON) +option(NFC_LINUX "Enable NFC support on Linux" ON) add_definitions(-D_FIDO_MAJOR=${FIDO_MAJOR}) add_definitions(-D_FIDO_MINOR=${FIDO_MINOR}) add_definitions(-D_FIDO_PATCH=${FIDO_PATCH}) -if(CYGWIN OR MSYS) +if(CYGWIN OR MSYS OR MINGW) set(WIN32 1) - add_definitions(-DWINVER=0x0a00) endif() if(WIN32) @@ -68,12 +67,13 @@ if(NOT MSVC) set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_DARWIN_C_SOURCE") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__STDC_WANT_LIB_EXT1__=1") elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(NFC_LINUX ON) set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_GNU_SOURCE") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_DEFAULT_SOURCE") elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD") set(FIDO_CFLAGS "${FIDO_CFLAGS} -D__BSD_VISIBLE=1") + elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") + set(FIDO_CFLAGS "${FIDO_CFLAGS} -D_NETBSD_SOURCE") endif() set(FIDO_CFLAGS "${FIDO_CFLAGS} -std=c99") set(CMAKE_C_FLAGS "${FIDO_CFLAGS} ${CMAKE_C_FLAGS}") @@ -167,12 +167,13 @@ if(MSVC) endif() set(CBOR_LIBRARIES cbor) set(ZLIB_LIBRARIES zlib) - set(CRYPTO_LIBRARIES crypto-46) + set(CRYPTO_LIBRARIES crypto-47) set(MSVC_DISABLED_WARNINGS_LIST "C4152" # nonstandard extension used: function/data pointer # conversion in expression; "C4200" # nonstandard extension used: zero-sized array in # struct/union; + "C4201" # nonstandard extension used: nameless struct/union; "C4204" # nonstandard extension used: non-constant aggregate # initializer; "C4706" # assignment within conditional expression; @@ -188,8 +189,10 @@ if(MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 -WX ${MSVC_DISABLED_WARNINGS_STR}") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Od /Z7 /guard:cf /sdl /RTCcsu") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi /guard:cf /sdl") - add_definitions(-DUSE_WINHELLO) - set(USE_WINHELLO ON) + if(USE_WINHELLO) + add_definitions(-DUSE_WINHELLO) + endif() + set(NFC_LINUX OFF) else() include(FindPkgConfig) pkg_search_module(CBOR libcbor) @@ -223,6 +226,8 @@ else() set(BASE_LIBRARIES ${BASE_LIBRARIES} rt) endif() endif() + else() + set(NFC_LINUX OFF) endif() if(MINGW) @@ -238,14 +243,18 @@ else() set(HIDAPI_LIBRARIES hidapi${HIDAPI_SUFFIX}) endif() - if(FUZZ) - set(NFC_LINUX ON) - endif() - if(NFC_LINUX) add_definitions(-DNFC_LINUX) endif() + if(WIN32) + if(USE_WINHELLO) + add_definitions(-DUSE_WINHELLO) + endif() + else() + set(USE_WINHELLO OFF) + endif() + add_compile_options(-Wall) add_compile_options(-Wextra) add_compile_options(-Werror) @@ -257,6 +266,10 @@ else() add_compile_options(-pedantic) add_compile_options(-pedantic-errors) + if(WIN32) + add_compile_options(-Wno-type-limits) + add_compile_options(-Wno-cast-function-type) + endif() if(HAVE_SHORTEN_64_TO_32) add_compile_options(-Wshorten-64-to-32) endif() @@ -306,10 +319,10 @@ elseif(NOT MSVC) # clang/gcc + gnu ld if(FUZZ) string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} - " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/fuzz/export.gnu") + " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/fuzz/export.gnu") else() string(CONCAT CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} - " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/export.gnu") + " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/export.gnu") endif() if(NOT WIN32) string(CONCAT CMAKE_SHARED_LINKER_FLAGS diff --git a/contrib/libfido2/LICENSE b/contrib/libfido2/LICENSE index 4224f20992c0..75a03f87e3af 100644 --- a/contrib/libfido2/LICENSE +++ b/contrib/libfido2/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2021 Yubico AB. All rights reserved. +Copyright (c) 2018-2022 Yubico AB. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/contrib/libfido2/NEWS b/contrib/libfido2/NEWS index 04cda4e0e83a..a48b685156c1 100644 --- a/contrib/libfido2/NEWS +++ b/contrib/libfido2/NEWS @@ -1,3 +1,17 @@ +* Version 1.10.0 (2022-01-17) + ** hid_osx: handle devices with paths > 511 bytes; gh#462. + ** bio: fix CTAP2 canonical CBOR encoding in fido_bio_dev_enroll_*(); gh#480. + ** winhello: fallback to GetTopWindow() if GetForegroundWindow() fails. + ** winhello: fallback to hid_win.c if webauthn.dll isn't available. + ** New API calls: + - fido_dev_info_set; + - fido_dev_io_handle; + - fido_dev_new_with_info; + - fido_dev_open_with_info. + ** Cygwin and NetBSD build fixes. + ** Documentation and reliability fixes. + ** Support for TPM 2.0 attestation of COSE_ES256 credentials. + * Version 1.9.0 (2021-10-27) ** Enabled NFC support on Linux. ** Added OpenSSL 3.0 compatibility. diff --git a/contrib/libfido2/README.adoc b/contrib/libfido2/README.adoc index a0e188bf8774..114cc5eed762 100644 --- a/contrib/libfido2/README.adoc +++ b/contrib/libfido2/README.adoc @@ -10,7 +10,7 @@ image:https://oss-fuzz-build-logs.storage.googleapis.com/badges/libfido2.svg["Fu communicate with a FIDO device over USB, and to verify attestation and assertion signatures. -*libfido2* supports the FIDO U2F (CTAP 1) and FIDO 2.0 (CTAP 2) protocols. +*libfido2* supports the FIDO U2F (CTAP 1) and FIDO2 (CTAP 2) protocols. For usage, see the `examples/` directory. @@ -42,7 +42,7 @@ is also available. ==== Releases -The current release of *libfido2* is 1.9.0. Please consult Yubico's +The current release of *libfido2* is 1.10.0. Please consult Yubico's https://developers.yubico.com/libfido2/Releases[release page] for source and binary releases. diff --git a/contrib/libfido2/SECURITY.md b/contrib/libfido2/SECURITY.md new file mode 100644 index 000000000000..e12a48a847ba --- /dev/null +++ b/contrib/libfido2/SECURITY.md @@ -0,0 +1,5 @@ +# Reporting libfido2 Security Issues + +To report security issues in libfido2, please contact security@yubico.com. +A PGP public key can be found at +https://www.yubico.com/support/security-advisories/issue-rating-system/. diff --git a/contrib/libfido2/examples/README.adoc b/contrib/libfido2/examples/README.adoc index bcecb22f5258..44ee52743a0d 100644 --- a/contrib/libfido2/examples/README.adoc +++ b/contrib/libfido2/examples/README.adoc @@ -25,7 +25,7 @@ The following definitions are used in the description below: - - A credential's associated FIDO 2.1 "largeBlob" symmetric key. + A credential's associated CTAP 2.1 "largeBlob" symmetric key. === Description diff --git a/contrib/libfido2/fuzz/Dockerfile b/contrib/libfido2/fuzz/Dockerfile index f175991d0462..aefe1980ada4 100644 --- a/contrib/libfido2/fuzz/Dockerfile +++ b/contrib/libfido2/fuzz/Dockerfile @@ -7,6 +7,6 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y clang-12 cmake git libssl-dev libudev-dev make pkg-config RUN apt-get install -y zlib1g-dev -RUN git clone --branch v0.8.0 https://github.com/PJK/libcbor +RUN git clone --branch v0.9.0 https://github.com/PJK/libcbor RUN git clone https://github.com/yubico/libfido2 RUN CC=clang-12 CXX=clang++-12 /libfido2/fuzz/build-coverage /libcbor /libfido2 diff --git a/contrib/libfido2/fuzz/Makefile b/contrib/libfido2/fuzz/Makefile index 1a974a2bf557..ce3fee73c69c 100644 --- a/contrib/libfido2/fuzz/Makefile +++ b/contrib/libfido2/fuzz/Makefile @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -IMAGE := libfido2-coverage:1.9.1 +IMAGE := libfido2-coverage:1.10.0 RUNNER := libfido2-runner PROFDATA := llvm-profdata-12 COV := llvm-cov-12 diff --git a/contrib/libfido2/fuzz/export.gnu b/contrib/libfido2/fuzz/export.gnu index 0c712b30a429..cac142ae970e 100644 --- a/contrib/libfido2/fuzz/export.gnu +++ b/contrib/libfido2/fuzz/export.gnu @@ -201,6 +201,7 @@ fido_dev_info_product; fido_dev_info_product_string; fido_dev_info_ptr; + fido_dev_info_set; fido_dev_info_vendor; fido_dev_is_fido2; fido_dev_major; diff --git a/contrib/libfido2/fuzz/functions.txt b/contrib/libfido2/fuzz/functions.txt index 886893b1d11d..946682d07d00 100644 --- a/contrib/libfido2/fuzz/functions.txt +++ b/contrib/libfido2/fuzz/functions.txt @@ -172,7 +172,7 @@ cbor_array_iter 12 0 100.00% 16 0 cbor_parse_reply 27 0 100.00% 36 0 100.00% cbor_vector_free 6 0 100.00% 5 0 100.00% cbor_bytestring_copy 14 0 100.00% 18 0 100.00% -cbor_string_copy 14 1 92.86% 18 3 83.33% +cbor_string_copy 14 0 100.00% 18 0 100.00% cbor_add_bytestring 14 0 100.00% 21 0 100.00% cbor_add_string 14 0 100.00% 21 0 100.00% cbor_add_bool 14 0 100.00% 21 0 100.00% @@ -200,7 +200,7 @@ cbor_decode_uint64 4 0 100.00% 8 0 cbor_decode_cred_id 8 0 100.00% 9 0 100.00% cbor_decode_user 8 0 100.00% 9 0 100.00% cbor_decode_rp_entity 8 0 100.00% 9 0 100.00% -cbor_build_uint 10 4 60.00% 9 4 55.56% +cbor_build_uint 10 1 90.00% 9 2 77.78% cbor_array_append 17 0 100.00% 21 0 100.00% cbor_array_drop 18 2 88.89% 17 3 82.35% cbor.c:ctap_check_cbor 28 0 100.00% 26 0 100.00% @@ -209,7 +209,7 @@ cbor.c:cbor_add_arg 13 0 100.00% 21 0 cbor.c:cbor_add_uint8 14 0 100.00% 21 0 100.00% cbor.c:cbor_encode_largeblob_key_ext 6 0 100.00% 6 0 100.00% cbor.c:cbor_encode_hmac_secret_param 59 4 93.22% 66 8 87.88% -cbor.c:get_cose_alg 36 1 97.22% 38 3 92.11% +cbor.c:get_cose_alg 36 0 100.00% 38 0 100.00% cbor.c:find_cose_alg 35 0 100.00% 33 0 100.00% cbor.c:decode_attcred 25 0 100.00% 44 0 100.00% cbor.c:decode_cred_extensions 14 0 100.00% 24 0 100.00% @@ -222,7 +222,7 @@ cbor.c:decode_cred_id_entry 10 0 100.00% 19 0 cbor.c:decode_user_entry 25 0 100.00% 35 0 100.00% cbor.c:decode_rp_entity_entry 15 0 100.00% 25 0 100.00% ------------------------------------------------------------------------------------------------------------------ -TOTAL 1047 28 97.33% 1237 54 95.63% +TOTAL 1047 23 97.80% 1237 46 96.28% File '/libfido2/src/compress.c': Name Regions Miss Cover Lines Miss Cover @@ -386,6 +386,7 @@ fido_dev_get_touch_begin 50 0 100.00% 59 fido_dev_get_touch_status 17 0 100.00% 20 0 100.00% fido_dev_set_io_functions 18 4 77.78% 14 6 57.14% fido_dev_set_transport_functions 6 2 66.67% 9 3 66.67% +fido_dev_io_handle 1 1 0.00% 3 3 0.00% fido_init 8 1 87.50% 5 0 100.00% fido_dev_new 5 0 100.00% 14 0 100.00% fido_dev_new_with_info 10 10 0.00% 16 16 0.00% @@ -419,7 +420,7 @@ dev.c:fido_dev_set_extension_flags 7 0 100.00% 7 dev.c:fido_dev_set_option_flags 29 0 100.00% 18 0 100.00% dev.c:fido_dev_set_protocol_flags 11 0 100.00% 17 0 100.00% ------------------------------------------------------------------------------------------------------------------- -TOTAL 420 78 81.43% 488 102 79.10% +TOTAL 421 79 81.24% 491 105 78.62% File '/libfido2/src/ecdh.c': Name Regions Miss Cover Lines Miss Cover @@ -493,8 +494,9 @@ Name Regions Miss Cover Lines Mis fido_hid_get_usage 13 0 100.00% 22 0 100.00% fido_hid_get_report_len 19 0 100.00% 27 0 100.00% fido_dev_info_new 1 0 100.00% 3 0 100.00% -fido_dev_info_free 9 0 100.00% 14 0 100.00% +fido_dev_info_free 9 0 100.00% 9 0 100.00% fido_dev_info_ptr 1 0 100.00% 3 0 100.00% +fido_dev_info_set 26 2 92.31% 30 3 90.00% fido_dev_info_path 1 0 100.00% 3 0 100.00% fido_dev_info_vendor 1 0 100.00% 3 0 100.00% fido_dev_info_product 1 0 100.00% 3 0 100.00% @@ -502,8 +504,9 @@ fido_dev_info_manufacturer_string 1 0 100.00% 3 fido_dev_info_product_string 1 0 100.00% 3 0 100.00% hid.c:get_key_len 6 0 100.00% 12 0 100.00% hid.c:get_key_val 6 0 100.00% 18 0 100.00% +hid.c:fido_dev_info_reset 1 0 100.00% 6 0 100.00% ------------------------------------------------------------------------------------------------------------------- -TOTAL 60 0 100.00% 114 0 100.00% +TOTAL 87 2 97.70% 145 3 97.93% File '/libfido2/src/hid_linux.c': Name Regions Miss Cover Lines Miss Cover @@ -612,7 +615,7 @@ File '/libfido2/src/largeblob.c': Name Regions Miss Cover Lines Miss Cover ------------------------------------------------------------------------------------------------------------------- fido_dev_largeblob_get 26 2 92.31% 38 4 89.47% -fido_dev_largeblob_set 27 2 92.59% 36 4 88.89% +fido_dev_largeblob_set 27 0 100.00% 36 0 100.00% fido_dev_largeblob_remove 12 0 100.00% 18 0 100.00% fido_dev_largeblob_get_array 15 2 86.67% 27 4 85.19% fido_dev_largeblob_set_array 14 0 100.00% 19 0 100.00% @@ -642,7 +645,7 @@ largeblob.c:largeblob_get_uv_token 19 0 100.00% 23 largeblob.c:largeblob_set_tx 35 0 100.00% 36 0 100.00% largeblob.c:prepare_hmac 13 2 84.62% 23 7 69.57% ------------------------------------------------------------------------------------------------------------------- -TOTAL 513 21 95.91% 684 47 93.13% +TOTAL 513 19 96.30% 684 43 93.71% File '/libfido2/src/log.c': Name Regions Miss Cover Lines Miss Cover @@ -783,11 +786,11 @@ TOTAL 24 0 100.00% 23 File '/libfido2/src/rs1.c': Name Regions Miss Cover Lines Miss Cover --------------------------------------------------------------------------------------------------------------------- -rs1_verify_sig 20 1 95.00% 30 3 90.00% +rs1_verify_sig 20 0 100.00% 30 0 100.00% rs1.c:rs1_get_EVP_MD 4 0 100.00% 6 0 100.00% rs1.c:rs1_free_EVP_MD 1 0 100.00% 3 0 100.00% --------------------------------------------------------------------------------------------------------------------- -TOTAL 25 1 96.00% 39 3 92.31% +TOTAL 25 0 100.00% 39 0 100.00% File '/libfido2/src/rs256.c': Name Regions Miss Cover Lines Miss Cover @@ -820,15 +823,17 @@ TOTAL 43 3 93.02% 43 File '/libfido2/src/tpm.c': Name Regions Miss Cover Lines Miss Cover --------------------------------------------------------------------------------------------------------------------- -fido_get_signed_hash_tpm 20 0 100.00% 25 0 100.00% -tpm.c:check_rsa2048_pubarea 16 0 100.00% 28 0 100.00% -tpm.c:bswap_rsa2048_pubarea 1 0 100.00% 10 0 100.00% +fido_get_signed_hash_tpm 25 0 100.00% 39 0 100.00% +tpm.c:check_es256_pubarea 18 0 100.00% 30 0 100.00% +tpm.c:bswap_es256_pubarea 1 0 100.00% 12 0 100.00% +tpm.c:check_rs256_pubarea 16 0 100.00% 28 0 100.00% +tpm.c:bswap_rs256_pubarea 1 0 100.00% 10 0 100.00% tpm.c:check_sha1_certinfo 14 0 100.00% 38 0 100.00% tpm.c:get_signed_sha1 17 0 100.00% 19 0 100.00% tpm.c:get_signed_name 7 0 100.00% 10 0 100.00% tpm.c:bswap_sha1_certinfo 1 0 100.00% 8 0 100.00% --------------------------------------------------------------------------------------------------------------------- -TOTAL 76 0 100.00% 138 0 100.00% +TOTAL 100 0 100.00% 194 0 100.00% File '/libfido2/src/types.c': Name Regions Miss Cover Lines Miss Cover diff --git a/contrib/libfido2/fuzz/fuzz_hid.c b/contrib/libfido2/fuzz/fuzz_hid.c index 556e62ac4cd3..eaf00dc92de8 100644 --- a/contrib/libfido2/fuzz/fuzz_hid.c +++ b/contrib/libfido2/fuzz/fuzz_hid.c @@ -175,15 +175,20 @@ static void manifest(const struct param *p) { size_t ndevs, nfound; - fido_dev_info_t *devlist; + fido_dev_info_t *devlist = NULL, *devlist_set = NULL; int16_t vendor_id, product_id; + fido_dev_io_t io; + fido_dev_transport_t t; + memset(&io, 0, sizeof(io)); + memset(&t, 0, sizeof(t)); set_netlink_io_functions(fd_read, fd_write); set_wire_data(p->netlink_wiredata.body, p->netlink_wiredata.len); set_udev_parameters(p->uevent, &p->report_descriptor); ndevs = uniform_random(64); if ((devlist = fido_dev_info_new(ndevs)) == NULL || + (devlist_set = fido_dev_info_new(1)) == NULL || fido_dev_info_manifest(devlist, ndevs, &nfound) != FIDO_OK) goto out; for (size_t i = 0; i < nfound; i++) { @@ -195,9 +200,13 @@ manifest(const struct param *p) product_id = fido_dev_info_product(di); consume(&vendor_id, sizeof(vendor_id)); consume(&product_id, sizeof(product_id)); + fido_dev_info_set(devlist_set, 0, fido_dev_info_path(di), + fido_dev_info_manufacturer_string(di), + fido_dev_info_product_string(di), &io, &t); } out: fido_dev_info_free(&devlist, ndevs); + fido_dev_info_free(&devlist_set, 1); } void diff --git a/contrib/libfido2/fuzz/report.tgz b/contrib/libfido2/fuzz/report.tgz index cf74f315cb80..d78f4628de59 100644 Binary files a/contrib/libfido2/fuzz/report.tgz and b/contrib/libfido2/fuzz/report.tgz differ diff --git a/contrib/libfido2/fuzz/summary.txt b/contrib/libfido2/fuzz/summary.txt index 298c8377379f..05c000aa7757 100644 --- a/contrib/libfido2/fuzz/summary.txt +++ b/contrib/libfido2/fuzz/summary.txt @@ -16,33 +16,33 @@ src/authkey.c 44 0 100.00% src/bio.c 419 20 95.23% 49 2 95.92% 559 21 96.24% src/blob.c 53 2 96.23% 10 0 100.00% 83 4 95.18% src/buf.c 8 1 87.50% 2 0 100.00% 16 1 93.75% -src/cbor.c 1047 28 97.33% 54 0 100.00% 1237 54 95.63% +src/cbor.c 1047 23 97.80% 54 0 100.00% 1237 46 96.28% src/compress.c 34 4 88.24% 3 0 100.00% 28 3 89.29% src/config.c 108 0 100.00% 11 0 100.00% 151 0 100.00% src/cred.c 632 34 94.62% 69 2 97.10% 830 36 95.66% src/credman.c 382 10 97.38% 40 0 100.00% 518 15 97.10% -src/dev.c 420 78 81.43% 44 6 86.36% 488 102 79.10% +src/dev.c 421 79 81.24% 45 7 84.44% 491 105 78.62% src/ecdh.c 117 2 98.29% 4 0 100.00% 146 5 96.58% src/eddsa.c 80 3 96.25% 10 0 100.00% 106 8 92.45% src/err.c 122 10 91.80% 1 0 100.00% 126 10 92.06% src/es256.c 306 5 98.37% 19 0 100.00% 358 7 98.04% -src/hid.c 60 0 100.00% 12 0 100.00% 114 0 100.00% +src/hid.c 87 2 97.70% 14 0 100.00% 145 3 97.93% src/hid_linux.c 173 68 60.69% 14 7 50.00% 250 104 58.40% src/hid_unix.c 28 20 28.57% 2 0 100.00% 43 24 44.19% src/info.c 184 0 100.00% 39 0 100.00% 316 0 100.00% src/io.c 182 7 96.15% 13 0 100.00% 221 11 95.02% src/iso7816.c 18 1 94.44% 5 0 100.00% 38 0 100.00% -src/largeblob.c 513 21 95.91% 30 0 100.00% 684 47 93.13% +src/largeblob.c 513 19 96.30% 30 0 100.00% 684 43 93.71% src/log.c 39 5 87.18% 7 1 85.71% 63 4 93.65% src/netlink.c 328 14 95.73% 40 0 100.00% 498 32 93.57% src/nfc_linux.c 327 73 77.68% 23 5 78.26% 458 124 72.93% src/pin.c 403 3 99.26% 26 0 100.00% 495 3 99.39% src/random.c 6 1 83.33% 1 0 100.00% 6 1 83.33% src/reset.c 24 0 100.00% 3 0 100.00% 23 0 100.00% -src/rs1.c 25 1 96.00% 3 0 100.00% 39 3 92.31% +src/rs1.c 25 0 100.00% 3 0 100.00% 39 0 100.00% src/rs256.c 141 8 94.33% 13 0 100.00% 172 10 94.19% src/time.c 43 3 93.02% 3 0 100.00% 43 1 97.67% -src/tpm.c 76 0 100.00% 7 0 100.00% 138 0 100.00% +src/tpm.c 100 0 100.00% 9 0 100.00% 194 0 100.00% src/types.c 25 0 100.00% 6 0 100.00% 46 0 100.00% src/u2f.c 528 4 99.24% 17 0 100.00% 685 12 98.25% @@ -54,4 +54,4 @@ src/fido.h 0 0 - src/fido/err.h 0 0 - 0 0 - 0 0 - src/fido/param.h 0 0 - 0 0 - 0 0 - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -TOTAL 7809 481 93.84% 679 26 96.17% 10180 708 93.05% +TOTAL 7861 476 93.94% 684 27 96.05% 10270 699 93.19% diff --git a/contrib/libfido2/man/CMakeLists.txt b/contrib/libfido2/man/CMakeLists.txt index 3e50c50d37a0..5ce2fc7b83ed 100644 --- a/contrib/libfido2/man/CMakeLists.txt +++ b/contrib/libfido2/man/CMakeLists.txt @@ -44,6 +44,7 @@ list(APPEND MAN_SOURCES list(APPEND MAN_ALIAS eddsa_pk_new eddsa_pk_free + eddsa_pk_new eddsa_pk_from_EVP_PKEY eddsa_pk_new eddsa_pk_from_ptr eddsa_pk_new eddsa_pk_to_EVP_PKEY es256_pk_new es256_pk_free @@ -75,6 +76,7 @@ list(APPEND MAN_ALIAS fido_assert_new fido_assert_user_id_len fido_assert_new fido_assert_user_id_ptr fido_assert_new fido_assert_user_name + fido_assert_set_authdata fido_assert_set_authdata_raw fido_assert_set_authdata fido_assert_set_clientdata fido_assert_set_authdata fido_assert_set_clientdata_hash fido_assert_set_authdata fido_assert_set_count @@ -117,8 +119,8 @@ list(APPEND MAN_ALIAS fido_cbor_info_new fido_cbor_info_free fido_cbor_info_new fido_cbor_info_maxmsgsiz fido_cbor_info_new fido_cbor_info_maxcredbloblen - fido_cbor_info_new fido_cbor_info_maxcredcntlst; - fido_cbor_info_new fido_cbor_info_maxcredidlen; + fido_cbor_info_new fido_cbor_info_maxcredcntlst + fido_cbor_info_new fido_cbor_info_maxcredidlen fido_cbor_info_new fido_cbor_info_fwversion fido_cbor_info_new fido_cbor_info_options_len fido_cbor_info_new fido_cbor_info_options_name_ptr @@ -163,6 +165,7 @@ list(APPEND MAN_ALIAS fido_cred_new fido_cred_user_name fido_cred_new fido_cred_x5c_len fido_cred_new fido_cred_x5c_ptr + fido_cred_verify fido_cred_verify_self fido_credman_metadata_new fido_credman_del_dev_rk fido_credman_metadata_new fido_credman_get_dev_metadata fido_credman_metadata_new fido_credman_get_dev_rk @@ -211,6 +214,7 @@ list(APPEND MAN_ALIAS fido_dev_info_manifest fido_dev_info_product fido_dev_info_manifest fido_dev_info_product_string fido_dev_info_manifest fido_dev_info_ptr + fido_dev_info_manifest fido_dev_info_set fido_dev_info_manifest fido_dev_info_vendor fido_dev_open fido_dev_build fido_dev_open fido_dev_cancel @@ -219,26 +223,33 @@ list(APPEND MAN_ALIAS fido_dev_open fido_dev_force_fido2 fido_dev_open fido_dev_force_u2f fido_dev_open fido_dev_free + fido_dev_open fido_dev_has_pin + fido_dev_open fido_dev_has_uv fido_dev_open fido_dev_is_fido2 fido_dev_open fido_dev_is_winhello fido_dev_open fido_dev_major fido_dev_open fido_dev_minor fido_dev_open fido_dev_new + fido_dev_open fido_dev_new_with_info + fido_dev_open fido_dev_open_with_info fido_dev_open fido_dev_protocol fido_dev_open fido_dev_supports_cred_prot fido_dev_open fido_dev_supports_credman + fido_dev_open fido_dev_supports_permissions fido_dev_open fido_dev_supports_pin fido_dev_open fido_dev_supports_uv - fido_dev_open fido_dev_has_uv fido_dev_set_pin fido_dev_get_retry_count fido_dev_set_pin fido_dev_get_uv_retry_count fido_dev_set_pin fido_dev_reset + fido_dev_set_io_functions fido_dev_io_handle fido_dev_set_io_functions fido_dev_set_sigmask fido_dev_set_io_functions fido_dev_set_timeout + fido_dev_set_io_functions fido_dev_set_transport_functions fido_dev_largeblob_get fido_dev_largeblob_set fido_dev_largeblob_get fido_dev_largeblob_remove fido_dev_largeblob_get fido_dev_largeblob_get_array fido_dev_largeblob_get fido_dev_largeblob_set_array + fido_init fido_set_log_handler rs256_pk_new rs256_pk_free rs256_pk_new rs256_pk_from_ptr rs256_pk_new rs256_pk_from_EVP_PKEY diff --git a/contrib/libfido2/man/check.sh b/contrib/libfido2/man/check.sh new file mode 100755 index 000000000000..951afeb88e0b --- /dev/null +++ b/contrib/libfido2/man/check.sh @@ -0,0 +1,42 @@ +#!/bin/sh -u + +# Copyright (c) 2022 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +T=$(mktemp -d) || exit 1 +find . -maxdepth 1 -type f -name '*.3' -print0 > "$T/files" + +xargs -0 awk '/^.Sh NAME/,/^.Nd/' < "$T/files" | \ + awk '/^.Nm/ { print $2 }' | sort -u > "$T/Nm" +xargs -0 awk '/^.Fn/ { print $2 }' < "$T/files" | sort -u > "$T/Fn" +(cd "$T" && diff -u Nm Fn) + +cut -c2- ../src/export.llvm | sort > "$T/exports" +(cd "$T" && diff -u Nm exports) + +awk '/^list\(APPEND MAN_SOURCES/,/^\)/' CMakeLists.txt | \ + awk '/.3$/ { print $1 }' | sort > "$T/listed_sources" +xargs -0 -n1 basename < "$T/files" | sort > "$T/actual_sources" +(cd "$T" && diff -u listed_sources actual_sources) + +awk '/^list\(APPEND MAN_ALIAS/,/^\)/' CMakeLists.txt | \ + sed '1d;$d' | awk '{ print $1, $2 }' | sort > "$T/listed_aliases" +xargs -0 grep -o "^.Fn [A-Za-z0-9_]* \"" < "$T/files" | \ + cut -c3- | sed 's/\.3:\.Fn//;s/ "//' | awk '$1 != $2' | \ + sort > "$T/actual_aliases" +(cd "$T" && diff -u listed_aliases actual_aliases) + +xargs -0 grep -hB1 "^.Fn [A-Za-z0-9_]* \"" < "$T/files" | \ + sed -E 's/^.F[tn] //;s/\*[^"\*]+"/\*"/g;s/ [^" \*]+"/"/g;/^--$/d' | \ + paste -d " " - - | sed 's/\* /\*/' | sort > "$T/documented_prototypes" +while read -r f; do + awk "/\/\*/ { next } /$f\(/,/;/" ../src/fido.h ../src/fido/*.h | \ + sed -E 's/^[ ]+//;s/[ ]+/ /' | tr '\n' ' ' | \ + sed 's/(/ "/;s/, /" "/g;s/);/"/;s/ $/\n/' +done < "$T/exports" | sort > "$T/actual_prototypes" +(cd "$T" && diff -u documented_prototypes actual_prototypes) + +(cd "$T" && rm files Nm Fn exports listed_sources actual_sources \ + listed_aliases actual_aliases documented_prototypes actual_prototypes) +rmdir -- "$T" diff --git a/contrib/libfido2/man/eddsa_pk_new.3 b/contrib/libfido2/man/eddsa_pk_new.3 index 65bf9a9f753d..998def484790 100644 --- a/contrib/libfido2/man/eddsa_pk_new.3 +++ b/contrib/libfido2/man/eddsa_pk_new.3 @@ -11,7 +11,7 @@ .Nm eddsa_pk_from_EVP_PKEY , .Nm eddsa_pk_from_ptr , .Nm eddsa_pk_to_EVP_PKEY -.Nd FIDO 2 COSE EDDSA API +.Nd FIDO2 COSE EDDSA API .Sh SYNOPSIS .In openssl/evp.h .In fido/eddsa.h @@ -106,7 +106,7 @@ If an error occurs, returns NULL. .Sh RETURN VALUES The -.Fn eddsa_pk_from_EC_KEY +.Fn eddsa_pk_from_EVP_PKEY and .Fn eddsa_pk_from_ptr functions return diff --git a/contrib/libfido2/man/es256_pk_new.3 b/contrib/libfido2/man/es256_pk_new.3 index 6c1bac0f57f9..5e184340a575 100644 --- a/contrib/libfido2/man/es256_pk_new.3 +++ b/contrib/libfido2/man/es256_pk_new.3 @@ -9,10 +9,10 @@ .Nm es256_pk_new , .Nm es256_pk_free , .Nm es256_pk_from_EC_KEY , -.Nm es256_pk_from_EVP_KEY , +.Nm es256_pk_from_EVP_PKEY , .Nm es256_pk_from_ptr , .Nm es256_pk_to_EVP_PKEY -.Nd FIDO 2 COSE ES256 API +.Nd FIDO2 COSE ES256 API .Sh SYNOPSIS .In openssl/ec.h .In fido/es256.h @@ -82,7 +82,7 @@ No references to are kept. .Pp The -.Fn es256_pk_from_EVP_KEY +.Fn es256_pk_from_EVP_PKEY function fills .Fa pk with the contents of @@ -124,7 +124,7 @@ returns NULL. .Sh RETURN VALUES The .Fn es256_pk_from_EC_KEY , -.Fn es256_pk_from_EVP_KEY , +.Fn es256_pk_from_EVP_PKEY , and .Fn es256_pk_from_ptr functions return diff --git a/contrib/libfido2/man/fido2-assert.1 b/contrib/libfido2/man/fido2-assert.1 index da47d6f19dd3..ee8135c18483 100644 --- a/contrib/libfido2/man/fido2-assert.1 +++ b/contrib/libfido2/man/fido2-assert.1 @@ -7,7 +7,7 @@ .Os .Sh NAME .Nm fido2-assert -.Nd get/verify a FIDO 2 assertion +.Nd get/verify a FIDO2 assertion .Sh SYNOPSIS .Nm .Fl G @@ -24,7 +24,7 @@ .Op Ar type .Sh DESCRIPTION .Nm -gets or verifies a FIDO 2 assertion. +gets or verifies a FIDO2 assertion. .Pp The input of .Nm @@ -117,7 +117,7 @@ will not expect a credential id in its input, and may output multiple assertions. Resident credentials are called .Dq discoverable credentials -in FIDO 2.1. +in CTAP 2.1. .It Fl t Ar option Toggles a key/value .Ar option , diff --git a/contrib/libfido2/man/fido2-cred.1 b/contrib/libfido2/man/fido2-cred.1 index 301564d688e5..0b10e74a0507 100644 --- a/contrib/libfido2/man/fido2-cred.1 +++ b/contrib/libfido2/man/fido2-cred.1 @@ -7,7 +7,7 @@ .Os .Sh NAME .Nm fido2-cred -.Nd make/verify a FIDO 2 credential +.Nd make/verify a FIDO2 credential .Sh SYNOPSIS .Nm .Fl M @@ -26,7 +26,7 @@ .Op Ar type .Sh DESCRIPTION .Nm -makes or verifies a FIDO 2 credential. +makes or verifies a FIDO2 credential. .Pp A credential .Ar type @@ -143,7 +143,7 @@ will fail. Create a resident credential. Resident credentials are called .Dq discoverable credentials -in FIDO 2.1. +in CTAP 2.1. .It Fl u Create a U2F credential. By default, diff --git a/contrib/libfido2/man/fido2-token.1 b/contrib/libfido2/man/fido2-token.1 index fd82c23cffb7..1aa2feb86859 100644 --- a/contrib/libfido2/man/fido2-token.1 +++ b/contrib/libfido2/man/fido2-token.1 @@ -7,7 +7,7 @@ .Os .Sh NAME .Nm fido2-token -.Nd find and manage a FIDO 2 authenticator +.Nd find and manage a FIDO2 authenticator .Sh SYNOPSIS .Nm .Fl C @@ -121,7 +121,7 @@ .Fl V .Sh DESCRIPTION .Nm -manages a FIDO 2 authenticator. +manages a FIDO2 authenticator. .Pp The options are as follows: .Bl -tag -width Ds @@ -176,12 +176,12 @@ where is the enrollment's template base64-encoded id. The user will be prompted for the PIN. .It Fl D Fl u Ar device -Disables the FIDO 2.1 +Disables the CTAP 2.1 .Dq user verification always feature on .Ar device . .It Fl G Fl b Fl k Ar key_path Ar blob_path Ar device -Gets a FIDO 2.1 +Gets a CTAP 2.1 .Dq largeBlob encrypted with .Ar key_path @@ -194,7 +194,7 @@ The blob is written to .Ar blob_path . A PIN or equivalent user-verification gesture is required. .It Fl G Fl b Fl n Ar rp_id Oo Fl i Ar cred_id Oc Ar blob_path Ar device -Gets a FIDO 2.1 +Gets a CTAP 2.1 .Dq largeBlob associated with .Ar rp_id @@ -234,7 +234,7 @@ The user will be prompted for the PIN. .It Fl L Produces a list of authenticators found by the operating system. .It Fl L Fl b Ar device -Produces a list of FIDO 2.1 +Produces a list of CTAP 2.1 .Dq largeBlobs on .Ar device . @@ -264,12 +264,12 @@ Sets the PIN of .Ar device . The user will be prompted for the PIN. .It Fl S Fl a Ar device -Enables FIDO 2.1 Enterprise Attestation on +Enables CTAP 2.1 Enterprise Attestation on .Ar device . .It Fl S Fl b Fl k Ar key_path Ar blob_path Ar device Sets .Ar blob_path -as a FIDO 2.1 +as a CTAP 2.1 .Dq largeBlob encrypted with .Ar key_path @@ -284,7 +284,7 @@ A PIN or equivalent user-verification gesture is required. .It Fl S Fl b Fl n Ar rp_id Oo Fl i Ar cred_id Oc Ar blob_path Ar device Sets .Ar blob_path -as a FIDO 2.1 +as a CTAP 2.1 .Dq largeBlob associated with .Ar rp_id @@ -353,7 +353,7 @@ the minimum PIN length of Multiple IDs may be specified, separated by commas. The user will be prompted for the PIN. .It Fl S Fl u Ar device -Enables the FIDO 2.1 +Enables the CTAP 2.1 .Dq user verification always feature on .Ar device . @@ -392,9 +392,9 @@ An authenticator's path may contain spaces. .Pp Resident credentials are called .Dq discoverable credentials -in FIDO 2.1. +in CTAP 2.1. .Pp -Whether the FIDO 2.1 +Whether the CTAP 2.1 .Dq user verification always feature is activated or deactivated after an authenticator reset is vendor-specific. diff --git a/contrib/libfido2/man/fido_assert_allow_cred.3 b/contrib/libfido2/man/fido_assert_allow_cred.3 index bbe6e4d8929a..7fd730c3f63c 100644 --- a/contrib/libfido2/man/fido_assert_allow_cred.3 +++ b/contrib/libfido2/man/fido_assert_allow_cred.3 @@ -7,7 +7,7 @@ .Os .Sh NAME .Nm fido_assert_allow_cred -.Nd appends a credential ID to the list of credentials allowed in an assertion +.Nd allow a credential in a FIDO2 assertion .Sh SYNOPSIS .In fido.h .Ft int @@ -31,7 +31,7 @@ If .Fn fido_assert_allow_cred fails, the existing list of allowed credentials is preserved. .Pp -For the format of a FIDO 2 credential ID, please refer to the +For the format of a FIDO2 credential ID, please refer to the Web Authentication (webauthn) standard. .Sh RETURN VALUES The error codes returned by diff --git a/contrib/libfido2/man/fido_assert_new.3 b/contrib/libfido2/man/fido_assert_new.3 index 16f4e3a6e46d..a1a3c101ba33 100644 --- a/contrib/libfido2/man/fido_assert_new.3 +++ b/contrib/libfido2/man/fido_assert_new.3 @@ -31,7 +31,7 @@ .Nm fido_assert_id_len , .Nm fido_assert_sigcount , .Nm fido_assert_flags -.Nd FIDO 2 assertion API +.Nd FIDO2 assertion API .Sh SYNOPSIS .In fido.h .Ft fido_assert_t * @@ -85,9 +85,12 @@ .Ft uint8_t .Fn fido_assert_flags "const fido_assert_t *assert" "size_t idx" .Sh DESCRIPTION -FIDO 2 assertions are abstracted in -.Em libfido2 -by the +A FIDO2 assertion is a collection of statements, each statement a +map between a challenge, a credential, a signature, and ancillary +attributes. +In *** 3261 LINES SKIPPED *** From nobody Fri Jul 21 16:08:20 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6vc42xl4z4pMVx; Fri, 21 Jul 2023 16:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6vc42TBZz4VcR; Fri, 21 Jul 2023 16:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689955700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V/ICnGTpPul6XnJQak/h4M1oybyZ4ulLdHL1cZAPCuY=; b=jp7bQsAe7ZjSKS1+3IXHb9LpLQMbhck9NdlhMvCRnUnCA8KFZyeh1C0MVbOEqX16bZJC/n rZr53TlM2HvxSe8qA3gFSygGtCWEsgOsFWNhWJ0YGiSUMeZBom69gR/PtY+JuGIUIihud6 9i5VWBnujixiI1oQqgudUCE6AqSqMBcb+rHE3AJnO5+iW5X+VtVFo5fDUTz7kfLuhdUUVt OFLh7PNvOXA530/cqTkhUZtFpgx7h+oN4h1Ny07gUMkwo/9Wo0NlUbeAxpvRivh7sLc8KH R75SIGa2fI+3KMwJUf7AHcMWrYOqJ6XUBIEj0mJYtv24wLZ95OhGA2Qt0QGTdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689955700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V/ICnGTpPul6XnJQak/h4M1oybyZ4ulLdHL1cZAPCuY=; b=ePQ11jiRCChrP/QnZjo9WtyyInB1CC4apRB/uhniccER2kYdVfHifNV6SWupHnAs3d+we6 m2WNZHYZ1QMiGjc5imOmQIhJuJlxf3CWNHIWN4tjieJwWOBMGxHN9ypHWEuWZ9irBzwGEt dBLi+0yOzTBNloauxIRpqF+gONFBw8MAn9RpJWPQkh4fX9gX6aPhlIWinlB456rEMpUpI2 JuiTereyDt/8FzToOqmj+R65SffRoRe5mRtEZ0Mu2z6ZEUSyZvmKz9CFxclZ2fhpxS5U7N xFXx4J+WOpvxbteimM+cnOqguLDF/pqJ18PMbh3E2mIskcG/QcjL9EHvQgjemA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689955700; a=rsa-sha256; cv=none; b=R4vWTtq0oY6Xi6CvS17nenmq8nqm46JyNICozWSUaO4b/KmmlJ9SOovQqsap/sF91kH6HT CUN0zYp2wFQqtBPnS28nWxVAuUYyBIJBTcp0gmHsJj39kA026tBWnhXl7mdWbIm23uqNwU xea3D/YIU8jHKd1RJMjw08CctY9t4zSdQY5TdkmnG/cO/6OmcoxWgncFFOLcqvYvaIi2PX cByfG5Z8hkNvri5jNqGn6usOiP/2iChPYCBvf3bDEEyHluvDEWcis2Wjv+pivicVhN7Caj suOVUMDbFc/sPvwTumXKY7voeii4ivRN0SGpYVEt2d4YGlSW29vh+Pb4SsM0kA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6vc41YqJzK73; Fri, 21 Jul 2023 16:08:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LG8K3h059739; Fri, 21 Jul 2023 16:08:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LG8KJi059738; Fri, 21 Jul 2023 16:08:20 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:08:20 GMT Message-Id: <202307211608.36LG8KJi059738@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: b4993704d6bb - main - cam_periph: Fix a comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 commit b4993704d6bbc3d2e563a7f7f41619ca292ad5b4 Author: Warner Losh AuthorDate: 2023-07-21 16:06:03 +0000 Commit: Warner Losh CommitDate: 2023-07-21 16:07:13 +0000 cam_periph: Fix a comment Add a couple of words so that this sentence makes sense. Sponsored by: Netflix --- sys/cam/cam_periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 8defdc9ecbe6..9ff3d156023d 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1262,7 +1262,7 @@ cam_periph_runccb(union ccb *ccb, * shutdown_post_sync event will run with the scheduler stopped, but * before we're officially dumping. To avoid hanging in adashutdown * initiated commands (or other similar situations), we have to test for - * either SCHEDULER_STOPPED() here as well. + * either dumping or SCHEDULER_STOPPED() here. * * To avoid locking problems, dumping/polling callers must call * without a periph lock held. From nobody Fri Jul 21 16:14:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6vkn5f3vz4pPf0; Fri, 21 Jul 2023 16:14: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6vkn2ZCkz4XKj; Fri, 21 Jul 2023 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=rIPDDPwKyjIPlkYxdlycZw35to7UiJSyNHqb5UjrCiZXmcLwYY0qJoKrJnoNwhnBMN/k27 De6AOENtzvExZRYRuNehy3+oq6iR5jIoe/ebk/e2/6R+RFo43wR7HfniS8l91MWVleQegW XyO95D4GOTWrI3CGhoFfV1Fo5g7KswDR9+9+OH+2TNlQ6Tupc5hq0TroOQO3spDy48eyW1 y333td4ZwFIxM/06s+k1tMEA99EuBLtiAJwBlZ9rbsMwIKRIG7qu/RA4SSjBGdMouAUrqT IU+XTD6wLbuZM/0C7gaNh3Q0ujvt5LJujFDVgoLk99SQoW8zvauSkn3vRdc8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yQJ8poOuSjcfHT5aCgJZnSq3qwhI7GBNt8bwSsUH14I=; b=Tqxyr6TxY7QbH37XBvvUwTtrGpWR9cQS/6o5b/W/S7pn5D490tRsw5lY0KDCqMKzo3jCxp 8skgF3OnMFEE4G+/v9ASWNT7jxR5hUNsYRnO6Z9lw+Fj5yqlic4AEF6oisDHi7T4s6HjHa JTTIu//K/UG3JnmGCyR7z2aMEwJizrZfeF/b1ObtINTruRU52HoFEr/q9njzj3CMlBeRrg eqI10821mQdLV/9ar4jXI8X6OWvZa2jJ7MxOjKiMtDKWf8bH5/g/enrnA+goNCQelnq1Ba p95gkmgHn3WcKYe9iYOuFqDZPZbb60J+am7C1oh7QdWpdb1/mCZ/ud1lVlO1KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689956049; a=rsa-sha256; cv=none; b=d+Me3hmkX1+b7skkVPppgMB+C1lWD1OHtrZWvl32+vlCgTWy/3ir/+hmusqvvRmsEW/FxG PzVSJHzb8GlwtEN976ow8nVnulwRk1mxavCeapFa2k2w9KAiLLDPZpDCtIMkLfjqI4o7tZ YFJHePJmTeVSzG8kWMvZx7dxkAsmrT7y9Z6uROslQ7XUVSvlehJUHrSMIW7YHG5VzBzkLk DvX9J0BGDx1b9hpAhXDhQ7CH4H3fj83AAqud+ZaoQcnyJiJ+eyKmhDoQqO5E7h4wZOdoAX 9KLzDKj+I9vikFiP0j6a40GxRKfk+3PKVkOpRHnh5NB+Rh8EhBaYklDHDVpW1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6vkn1QwYzKVL; Fri, 21 Jul 2023 16:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LGE96K075332; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LGE9E8075331; Fri, 21 Jul 2023 16:14:09 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:14:09 GMT Message-Id: <202307211614.36LGE9E8075331@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: ff4633d9f897 - main - cam_periph: Comment about why we need to reset cbfcnp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff4633d9f897c2247bc67930740509a1ba315c81 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4633d9f897c2247bc67930740509a1ba315c81 commit ff4633d9f897c2247bc67930740509a1ba315c81 Author: Warner Losh AuthorDate: 2023-07-21 16:11:37 +0000 Commit: Warner Losh CommitDate: 2023-07-21 16:11:37 +0000 cam_periph: Comment about why we need to reset cbfcnp Just spent a few minutes puzzling out why we do this. Add a comment to remind my future self (and other intersted folk) why we do the reset here when we'd set it a few lines above. Sponsored by: Netflix --- sys/cam/cam_periph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 9ff3d156023d..0de73cffdc1f 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1298,6 +1298,11 @@ cam_periph_runccb(union ccb *ccb, if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) error = 0; else if (error_routine != NULL) { + /* + * cbfcnp is modified by cam_periph_ccbwait so + * reset it before we call the error routine + * which may call xpt_done. + */ ccb->ccb_h.cbfcnp = cam_periph_done; error = (*error_routine)(ccb, camflags, sense_flags); } else From nobody Fri Jul 21 16:15:55 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6vmr2dRmz4pQgR; Fri, 21 Jul 2023 16:15: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6vmr1dL6z4XlB; Fri, 21 Jul 2023 16:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZhdbxwRMnZsubAcRlBQirj75BV1fX3yIjDvylhUJlc=; b=pmgazkqbObSaxPPEwno8Tugrao+52KeCestQ3NQHVrmN/0EmmRWYKkZvAPHzmMUqAcYXhv DZyI4/tCP4ABSw7dsq54BQ8cJtUJQN034QL35nH4G4/nLydL58bB4N4NV1Vbp34v8Yrwsn sWJaf49jZ6DmBOy1whuKlqxL7WZtsEY77hSXI32aH0Ny7Ys6Jw/asX8Iv6VfrYTsVJVL1I nFgeQ5uGo5ydJER44c/TVJxBuwfG5GgC5oR/7cN8uZ6rIZEU66vX3pyMqPEKa3C8n/qYgl uLrttQe3zXp9X7WArVDZ6cb7tEXmccvXDisClx1ROZiEvwZbncc/sJqPYJOVdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689956156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xZhdbxwRMnZsubAcRlBQirj75BV1fX3yIjDvylhUJlc=; b=WxQBvSM1lD32zASgH2ME0GPSULjJPUAY1jjvhx7RnpQqR0AjVkO4qn3oy6rYFE8MlO/Ukl mI0M0bcbxtV5sdKIZAzp05232vm2uNd3dBbErWjuI74eIb914Xbt4jJkjoTI6FJvGm7iNF n85R1kCi36Oktw1NAax3LmnEw2WyPvjFORM0TQjl7fvADqzgJYyYXCxwrrE2E7svBojMZx dNwwDoTgl6dnbSwn4nna3yjdog3J3Fc5lJRagYR1KhWx2V6rkfpqBpIigtywRwtktiHYZR dnILArlD6AfYuIFlnfKbOD/as5CIZK6RM6Iaht7rt3jG33xXHbVw02ncaX79GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689956156; a=rsa-sha256; cv=none; b=Ni4aLCukdVhU+r5DCgDKtPH76J4jyI1YaZ0aqoXCPatwq7HrA68hmCpnC0ds0iYGSDiPWm wc6wvWw9pj7ncuYO7Gcr6UpQPwKK3wjUIBN+KVigWAliY3yCpYrT+RimBXG+NN8oUIcnow VsnWUIzrJcfjuSvtxdJ+gnxE1rC6rOVomSOzJ69haONBrYGR/C0CteHNwROCzRWKOHuxOK 5uw4gvlhNZSrJXvlYEfZYrk+ulnYY0nfZ3p6FfwyWMg/Ji2JV3SYifp1qQ34OhPabD3Zzi JfVfXUFuGhpDSrv+flM799DGMi8QCmlvnrjDpD1pyBOB1SNdoRqhSLO5YhqxVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6vmr0T7HzK7c; Fri, 21 Jul 2023 16:15:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LGFtuS075653; Fri, 21 Jul 2023 16:15:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LGFtTl075652; Fri, 21 Jul 2023 16:15:55 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:15:55 GMT Message-Id: <202307211615.36LGFtTl075652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 039d7ad8ee6b - stable/12 - ssh-agent: document "-O no-restrict-websafe" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 039d7ad8ee6b6c40044123a118b037179ac7c203 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=039d7ad8ee6b6c40044123a118b037179ac7c203 commit 039d7ad8ee6b6c40044123a118b037179ac7c203 Author: Ed Maste AuthorDate: 2023-07-21 15:59:09 +0000 Commit: Ed Maste CommitDate: 2023-07-21 16:08:12 +0000 ssh-agent: document "-O no-restrict-websafe" OpenSSH commits 9fd2441113fc and 4a4883664d6b, which are part of OpenSSH 9.2p1. Sponsored by: The FreeBSD Foundation --- crypto/openssh/ssh-agent.1 | 27 +++++++++++++++++++++++++-- crypto/openssh/ssh-agent.c | 8 ++++---- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/crypto/openssh/ssh-agent.1 b/crypto/openssh/ssh-agent.1 index 8844b2eb45e8..b9d28b8e103e 100644 --- a/crypto/openssh/ssh-agent.1 +++ b/crypto/openssh/ssh-agent.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ssh-agent.1,v 1.73 2022/03/31 17:27:27 naddy Exp $ +.\" $OpenBSD: ssh-agent.1,v 1.75 2022/10/07 06:00:58 jmc Exp $ .\" $FreeBSD$ .\" .\" Author: Tatu Ylonen @@ -35,7 +35,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: October 7 2022 $ .Dt SSH-AGENT 1 .Os .Sh NAME @@ -47,11 +47,13 @@ .Op Fl \&Ddx .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash +.Op Fl O Ar option .Op Fl P Ar allowed_providers .Op Fl t Ar life .Nm ssh-agent .Op Fl a Ar bind_address .Op Fl E Ar fingerprint_hash +.Op Fl O Ar option .Op Fl P Ar allowed_providers .Op Fl t Ar life .Ar command Op Ar arg ... @@ -103,6 +105,27 @@ The default is Kill the current agent (given by the .Ev SSH_AGENT_PID environment variable). +.It Fl O Ar option +Specify an option when starting +.Nm . +Currently only one option is supported: +.Cm no-restrict-websafe . +This instructs +.Nm +to permit signatures using FIDO keys that might be web authentication +requests. +By default, +.Nm +refuses signature requests for FIDO keys where the key application string +does not start with +.Dq ssh: +and when the data to be signed does not appear to be a +.Xr ssh 1 +user authentication request or a +.Xr ssh-keygen 1 +signature. +The default behaviour prevents forwarded access to a FIDO key from also +implicitly forwarding the ability to authenticate to websites. .It Fl P Ar allowed_providers Specify a pattern-list of acceptable paths for PKCS#11 provider and FIDO authenticator middleware shared libraries that may be used with the diff --git a/crypto/openssh/ssh-agent.c b/crypto/openssh/ssh-agent.c index 2c2c7a639907..9f376f83a798 100644 --- a/crypto/openssh/ssh-agent.c +++ b/crypto/openssh/ssh-agent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.292 2022/09/17 10:11:29 djm Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.293 2022/10/07 06:00:58 jmc Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -2015,9 +2015,9 @@ usage(void) { fprintf(stderr, "usage: ssh-agent [-c | -s] [-Ddx] [-a bind_address] [-E fingerprint_hash]\n" - " [-P allowed_providers] [-t life]\n" - " ssh-agent [-a bind_address] [-E fingerprint_hash] [-P allowed_providers]\n" - " [-t life] command [arg ...]\n" + " [-O option] [-P allowed_providers] [-t life]\n" + " ssh-agent [-a bind_address] [-E fingerprint_hash] [-O option]\n" + " [-P allowed_providers] [-t life] command [arg ...]\n" " ssh-agent [-c | -s] -k\n"); exit(1); } From nobody Fri Jul 21 16:36:52 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6wF05xMkz4dX6X; Fri, 21 Jul 2023 16:36: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6wF05W9Cz4kqL; Fri, 21 Jul 2023 16:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689957412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E2t7R/uumZ2+dp8VBlwnUSU55JkN7IQLbiEbq7uxe4A=; b=WBZzo8yKLRVPlZwAwEYeJN9/nx7pIcY6vmwJV08VGeDEVT/FpJRnfGHp+4mCSptB7IR6By 04L78C6d5Y013Ug0IJpc9IChkUBv//jdhayTl0gtqAhdKiXFSAtmdUxU2Qk/8SabZBfe8Q JDUmz6V0ypvcfFVpYbmZSQT786dS4mGwSkZ5t76e1+f4TSRGtRY6fX4IjUXderhiWc3InC YrGF2yY0/vZ+guciiHlQNuez21KmCl+S+aDtV1X5ARf52DPJ/r3SyNMurjpjgEQBFPJX/k juBGuHhPU/gRAuxv6wCNtaCOhYFgxsREPxkgbWKszruxrfxVmXFZyiHRiz74xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689957412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E2t7R/uumZ2+dp8VBlwnUSU55JkN7IQLbiEbq7uxe4A=; b=YdX/Z8gCJFfYPqAQUUF362g6nGBIsZWXjsR9L0OY9KDkrpdAtJwKjAqVVtmZPPjmSbulf8 AdV3Ek4TwEsmv1wSYQADTNsYN+PmrtcgaaNkTA/u9bLl2gcpzqgrcnammdMJ3PHQ+j3EMV vCA4Jknekqye7heXYlCZ7aKBpTBL+DArgDLdcHR1s/7jkPRR3FwjFq/zUhq+rh2xGcMSYz x4GRsctUhNBHAXqFZg2uh8j4+ZTsbcETf3mFOZsPndPG2T5AImEgiscsBr9TkYR0jKFUJB 8O/FK2XfrQiS1ztWGMf+emjzrlgQfQcEPFSGQtpZiTJc3TvBKUokRC8UJ5K2nA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689957412; a=rsa-sha256; cv=none; b=m+87yPqs4Bhvmw9DOe+SOsdcfidxG05Pc4TlL2zgZbEk03mTTIdIgwh3I1t3fTgjovNbWF 5UDmF3hvkXz887LGDAfywci0lx4x/PKEZP4ExeQV494QJmgsgGFcdO2UW56/7DTpbZPAYa mzUYJM5Mieaf7ZJk9mUwmn8RmD/ZNP0x2QpKri9zvD+QNqejP92+ZHIdEaH960Qxxyiwqt qVFtWxS4Wm5GoEMPguXKB3rTDCrFOU7pEez4lzPmxnUC3YTk+csrHgfkyVpdSilXT/Ct0k fms25DyAFIjbCZ9rlRxDLcNHJPHrIXzJ8Mt1YDL2azdE+oDA/h3456lt4QjXgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6wF04XBbzKZc; Fri, 21 Jul 2023 16:36:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LGaqbP008637; Fri, 21 Jul 2023 16:36:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LGaqd6008636; Fri, 21 Jul 2023 16:36:52 GMT (envelope-from git) Date: Fri, 21 Jul 2023 16:36:52 GMT Message-Id: <202307211636.36LGaqd6008636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 56749f05dbfd - stable/12 - ssh: disallow loading PKCS#11 modules by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 56749f05dbfdb003aeb5639ef5f9b8af8f5e65ba Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=56749f05dbfdb003aeb5639ef5f9b8af8f5e65ba commit 56749f05dbfdb003aeb5639ef5f9b8af8f5e65ba Author: Ed Maste AuthorDate: 2023-07-19 17:02:33 +0000 Commit: Ed Maste CommitDate: 2023-07-21 16:25:51 +0000 ssh: disallow loading PKCS#11 modules by default This is the rest of the OpenSSH 9.3p2 change to address CVE-2023-38408. From the release notes: * ssh-agent(8): the agent will now refuse requests to load PKCS#11 modules issued by remote clients by default. A flag has been added to restore the previous behaviour "-Oallow-remote-pkcs11". Note that ssh-agent(8) depends on the SSH client to identify requests that are remote. The OpenSSH >=8.9 ssh(1) client does this, but forwarding access to an agent socket using other tools may circumvent this restriction. Security: CVE-2023-38408 Sponsored by: The FreeBSD Foundation --- crypto/openssh/ssh-agent.1 | 22 ++++++++++++++++++++-- crypto/openssh/ssh-agent.c | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/crypto/openssh/ssh-agent.1 b/crypto/openssh/ssh-agent.1 index b9d28b8e103e..a0ea506bdc93 100644 --- a/crypto/openssh/ssh-agent.1 +++ b/crypto/openssh/ssh-agent.1 @@ -108,9 +108,27 @@ environment variable). .It Fl O Ar option Specify an option when starting .Nm . -Currently only one option is supported: +Currently two options are supported: +.Cm allow-remote-pkcs11 +and .Cm no-restrict-websafe . -This instructs +.Pp +The +.Cm allow-remote-pkcs11 +option allows clients of a forwarded +.Nm +to load PKCS#11 or FIDO provider libraries. +By default only local clients may perform this operation. +Note that signalling that a +.Nm +client remote is performed by +.Xr ssh 1 , +and use of other tools to forward access to the agent socket may circumvent +this restriction. +.Pp +The +.Cm no-restrict-websafe , +instructs .Nm to permit signatures using FIDO keys that might be web authentication requests. diff --git a/crypto/openssh/ssh-agent.c b/crypto/openssh/ssh-agent.c index 9f376f83a798..0e218390a21c 100644 --- a/crypto/openssh/ssh-agent.c +++ b/crypto/openssh/ssh-agent.c @@ -172,6 +172,12 @@ char socket_dir[PATH_MAX]; /* Pattern-list of allowed PKCS#11/Security key paths */ static char *allowed_providers; +/* + * Allows PKCS11 providers or SK keys that use non-internal providers to + * be added over a remote connection (identified by session-bind@openssh.com). + */ +static int remote_add_provider; + /* locking */ #define LOCK_SIZE 32 #define LOCK_SALT_SIZE 16 @@ -1249,6 +1255,12 @@ process_add_identity(SocketEntry *e) if (strcasecmp(sk_provider, "internal") == 0) { debug_f("internal provider"); } else { + if (e->nsession_ids != 0 && !remote_add_provider) { + verbose("failed add of SK provider \"%.100s\": " + "remote addition of providers is disabled", + sk_provider); + goto out; + } if (realpath(sk_provider, canonical_provider) == NULL) { verbose("failed provider \"%.100s\": " "realpath: %s", sk_provider, @@ -1412,6 +1424,11 @@ process_add_smartcard_key(SocketEntry *e) error_f("failed to parse constraints"); goto send; } + if (e->nsession_ids != 0 && !remote_add_provider) { + verbose("failed PKCS#11 add of \"%.100s\": remote addition of " + "providers is disabled", provider); + goto send; + } if (realpath(provider, canonical_provider) == NULL) { verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", provider, strerror(errno)); @@ -2077,7 +2094,9 @@ main(int ac, char **av) break; case 'O': if (strcmp(optarg, "no-restrict-websafe") == 0) - restrict_websafe = 0; + restrict_websafe = 0; + else if (strcmp(optarg, "allow-remote-pkcs11") == 0) + remote_add_provider = 1; else fatal("Unknown -O option"); break; From nobody Fri Jul 21 19:01:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R6zRv0rSbz4npTR; Fri, 21 Jul 2023 19:01: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R6zRv0Jwcz4Dht; Fri, 21 Jul 2023 19:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689966091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXQl72gRy2Hu3W0EUGiMP1Yec7JmQKPOldUHw6OggNw=; b=vycuH/BtnmvDol6G3C1FvYEkpWtb0Q4G0fuR4WZ2hocQC1PmEFFJ63P2eYu6nOJxuHs77y iRIcnT79epM1N04f+MInBaCagDTo4nt3lgUstF584YKzQfJ6itvTojX7qMLs+6j9ckps9J 7qYIwQdHGVH4XxEQ/j9liu2dY4THkOi1TQonX/FsW11qhRN24njGhCSvvNWphg2g66M2t0 +1W7vMKpKS1l7i26tzH5Iz48Wrlrovh3ZRvg3jX3sXTeCmwOyOxzMjmzs9AouQsXAdo4vK nnWSebeRBu//wpDD5j/wo+DOlReMpKo7fUoEomGmWgA+cdPh+/KTF4Ea34HW8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689966091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zXQl72gRy2Hu3W0EUGiMP1Yec7JmQKPOldUHw6OggNw=; b=ZOLbduD/AqAU2sgRs5bv8gc+dip/NQZ3XD/cInQrerFjOS15zRqPRkW0Jfvi+4YWJro3b1 XkZFaDVeDQ1Jdk0MVjOBJF4tFrQSfz7oomTBIZgrmvgDYZ1LeADUaXqs431BpzaDI0tf4F HT+c1ScXKw+T1OuY5WrAwgGZrfYjE9zJChdGsmnqFwkCWJiWrYl6c8bFOUQVFVnI0fkL5r CyWIx3U8OBxpjY3bYEfUbSDtb3vX0lyeGwGAvb+JIT7EcAsParg268zDVPITW4tj7kdlUI F82PGuO5fKaiucnJlTDedd3qElDk2fu8FvWFZYGB1TIT9d5jxmhU0l5ATJMksA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689966091; a=rsa-sha256; cv=none; b=v18B4G36voE37L+bcNZzeSRLa8CULQshD2cmKrONqXSJzVvSP4fsetsOoIfCGdbtXIa1Ub 1tINsNUc4aSbG89tMGDSiDC14C8/A2vBQN9RsNMQP4dokdEr4aRIN8hYFFo98b6xvBUemg va/LWa8HBVtq/mM2LHx5myuGb1T0ht/CYhgqzDijJJ/Ig117buQto4Tv2ezWXDACIBujms u5OqhIF2lhBzOVl6zvmKYdeHlG6du9aAUtvsbDVLIKCo7QgfbMSSvTSCAHiBsz//9OYbNa hvYmyCtRCRT9ksUR2jfd+hb4BRSUSZTWS9jTFqfEKXWKqcu55lbQZC0uD7mryg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R6zRt6TRxzPS0; Fri, 21 Jul 2023 19:01:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36LJ1UYh055399; Fri, 21 Jul 2023 19:01:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36LJ1UKr055398; Fri, 21 Jul 2023 19:01:30 GMT (envelope-from git) Date: Fri, 21 Jul 2023 19:01:30 GMT Message-Id: <202307211901.36LJ1UKr055398@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: bc310a95c58a - main - ip output: ensure that mbufs are mapped if ipsec is enabled List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc310a95c58a3c570ed7e5103371453881e36ba1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bc310a95c58a3c570ed7e5103371453881e36ba1 commit bc310a95c58a3c570ed7e5103371453881e36ba1 Author: Konstantin Belousov AuthorDate: 2023-07-20 12:08:24 +0000 Commit: Konstantin Belousov CommitDate: 2023-07-21 18:51:13 +0000 ip output: ensure that mbufs are mapped if ipsec is enabled Ipsec needs access to packet headers to determine if a policy is applicable. It seems that typically IP headers are mapped, but the code is arguably needs to check this before blindly accessing them. Then, operations like m_unshare() and m_makespace() are not yet ready for unmapped mbufs. Ensure that the packet is mapped before calling into IPSEC_OUTPUT(). PR: 272616 Reviewed by: jhb, markj Sponsored by: NVidia networking MFC after: 1 week Differential revision: https://reviews.freebsd.org/D41112 --- sys/netinet/ip_output.c | 6 ++++++ sys/netinet6/ip6_output.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 1976ab9803af..3f30c63cdc87 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -671,6 +671,12 @@ again: sendit: #if defined(IPSEC) || defined(IPSEC_SUPPORT) if (IPSEC_ENABLED(ipv4)) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IPSTAT_INC(ips_odropped); + error = ENOBUFS; + goto bad; + } if ((error = IPSEC_OUTPUT(ipv4, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 59ac04842854..7e3c98270cc2 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -461,6 +461,12 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, * XXX: need scope argument. */ if (IPSEC_ENABLED(ipv6)) { + m = mb_unmapped_to_ext(m); + if (m == NULL) { + IP6STAT_INC(ip6s_odropped); + error = ENOBUFS; + goto bad; + } if ((error = IPSEC_OUTPUT(ipv6, m, inp)) != 0) { if (error == EINPROGRESS) error = 0; From nobody Sat Jul 22 00:22:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R76ZX4DHlz4p3Np; Sat, 22 Jul 2023 00:22: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R76ZX3prSz3pnH; Sat, 22 Jul 2023 00:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689985364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD5kcqUm5P8FfJklEYjHIukDlicyH1Z87osc/Dd0u/A=; b=Yf+pSEzKYUshyMTJDrKnJaDov6/fqlgOAfIdlazRWr20fSwUNMu++WwxWPx9nrFoq1enYH BnYyrrbSjNu9niuscB4eoTT1xZZBrqkJ7kAdUnMXuc5JuPz7AT6lJw9wqHgPx/MkltfkX2 Jf/7RwQ95fafLuwGDXC2MR/DDqyjLmBixmR0YD0acfs1p+bV070V0D8x49kgxP7jOnK4R1 jGubYxJXmQnj08wYQYx2kyFCbgmDCmxs4CXMieCK2kL5J4PV1fBn/uwVrLg5c+ipxVSO+R sdZRPXi9iVwck/RNgo76cR6lI8tLhBX31KRCXcWQr1riJnM0j1shhr9/RHXi0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689985364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=RD5kcqUm5P8FfJklEYjHIukDlicyH1Z87osc/Dd0u/A=; b=REWgrgTIs53OD/ARo7EVABBgoIqEHrv0sJnBJuGuMQhS0m1b2vZu0gmwYijrboSW4Yz/j8 OyvbrKWTUSgQ53thTC5NbsL35s9Ul9YeUu/N0htV34UqBfiPxeCqIqKUUIuRe9S8wkRf/4 3otd4ggCaqL9DmsWheKxvdeTXGKDcWOrjzpzDRYXrVDKXahg74yTyc1CcxTMx6lnWx5iTE d48yq3P5k0UNllWbmZkflc1IApYZyaUd2E9KmLu+pVq8am/FHqTOYoQ0ZrHJkdW8Xe6Swe 81CPf2/him99mHHcqKnWx2oaVqjj67ZVYFsp4u8C9HXBwfvTvpsREhfv2O30Tw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689985364; a=rsa-sha256; cv=none; b=d+Derfa6rAocSnDpedESv8qBMQxJyxAA8yoLpnbEV8B6E/r338CP8VYvPzOlterznCoyy1 JwqfXsCwJLWC5ntAeQq2n3uh7yyqOrNRQSQl3EtijxVgdLhoSXkpKGwVWiNNoipuF8PZHt Iht+JDmhwM6E++inDyTJtR4+wGReaWtQ6Og2DCb+BHDtdF/SJ/9DT7LqifU71v3Dnd+/WF cZNqd/CuTRFKFbGLLSMso4DGyEtu+IfUQwvMkoPV4pL6O+LcMJcEg3qKqGY3n1Ttai7Jx1 BNBSbBx7YfjQEGFaPb3QsMYiMsPlPDG9JOPvLOGszHF9jyV7OdaC65+4stXDTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R76ZX2t0dzY6D; Sat, 22 Jul 2023 00:22:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M0MioH086386; Sat, 22 Jul 2023 00:22:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M0MiJS086385; Sat, 22 Jul 2023 00:22:44 GMT (envelope-from git) Date: Sat, 22 Jul 2023 00:22:44 GMT Message-Id: <202307220022.36M0MiJS086385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 17207eae668b - stable/13 - Write out corrected superblock when creating a UFS/FFS snapshot. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17207eae668b80561c98fe18a9a5e18409d47c58 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=17207eae668b80561c98fe18a9a5e18409d47c58 commit 17207eae668b80561c98fe18a9a5e18409d47c58 Author: Kirk McKusick AuthorDate: 2023-06-13 07:21:43 +0000 Commit: Kirk McKusick CommitDate: 2023-07-22 00:22:10 +0000 Write out corrected superblock when creating a UFS/FFS snapshot. PR: 271352 Tested-by: Peter Holm Sponsored-by: The FreeBSD Foundation (cherry picked from commit f1549d7d522995bf5d821ae08cc2f500ba545285) --- sys/ufs/ffs/ffs_snapshot.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 709038db071f..a23f0ad502a9 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -207,7 +207,7 @@ ffs_snapshot(struct mount *mp, char *snapfile) long snaplistsize = 0; int32_t *lp; void *space; - struct fs *copy_fs = NULL, *fs; + struct fs *copy_fs = NULL, *fs, *bpfs; struct thread *td = curthread; struct inode *ip, *xp; struct buf *bp, *nbp, *ibp; @@ -828,8 +828,10 @@ resumefs: } else { loc = blkoff(fs, fs->fs_sblockloc); copy_fs->fs_fmod = 0; - copy_fs->fs_ckhash = ffs_calc_sbhash(copy_fs); - bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize); + bpfs = (struct fs *)&nbp->b_data[loc]; + bcopy((caddr_t)copy_fs, (caddr_t)bpfs, (u_int)fs->fs_sbsize); + ffs_oldfscompat_write(bpfs, ump); + bpfs->fs_ckhash = ffs_calc_sbhash(bpfs); bawrite(nbp); } /* From nobody Sat Jul 22 03:24:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7BcG2shdz4nlc2; Sat, 22 Jul 2023 03:24: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7BcG2R6Jz3FcS; Sat, 22 Jul 2023 03:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giYxzGtrkA231XYRh5ELRtaaBnQC4rSePZK97nWzwJk=; b=WLjBBY9SWil0fvL0zXhFLa6ki7orXJTNkslW1llvqZxR7CjaOndPxuk4JnD+JEOJ7wjR87 8sOIE4vbCPzvno6PYWBHdD7iGKR1GKbYcWKo98WAWv/NIdRNpnrumvRa6j3k7fCuu7yrtx vXYn9t4nSvpsc9mq0jtpzF7dYrZyljZHTyfxrnhcAr5AdWYOAi9XlXgWYGF67LslEN/1rx AmOYilf870xtUCqpFuHyF7TWrRsdIWUftXntcJrtzES10UTWrapyrs+O9oLLcq81J4O0tn snNeiIDnzojBdoVeXjIcSbRovhycxrw0Ywj1KOTREAL6SG0QRCLBTz8CwiN+cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=giYxzGtrkA231XYRh5ELRtaaBnQC4rSePZK97nWzwJk=; b=xlYYIg9AHGZEwKOEICM8X7UflTkrirqZl9N6zqhCzGmO3LKsnyoLGJBRFgOYtVsycZPENp 7w7wkKaoNVczmm9FulNYd1uNPQ++F9CUlycB32cWzQAyBElm27/HCfxmXZ5w3c315GAxxf wjtIzvwWWiOthuhiIwaA03X7JLajhbkUbupVvQcdMwB6v2rhLdlfjtPo6gcCo+qMDCcK5l 6ebFBKPW1rFmZFQ9PHifif4az7x/yCh/G4Qx0TSY7abO6QeIM9bMJ2fxgfeu9tAuc0I6vv BfT8rJ9A8NT/uJAs/p2UxcjmxIi3mFWsfPqCQ2kU7aHUKLDse01REam2woI87Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689996270; a=rsa-sha256; cv=none; b=E+gHh00Esbn7ARWxo9UL6AnuHU4IWG0oRTTktrTlgTRP5kfyxaWFH4vR/hoZkp+Sv0yW9w nW4XGF/DLDU+lEgBBsDIHTsZYEANqR5JgyI+TmGV5X2sMGgPThFi7QNcvGXkYrFQ+ISyTL hKt2xmYU+cOW/D9Cj08z9/V3Dv6GUDW7xjflX9QOEZFZjve83zsMCSyY4zV/y1nBN79fY+ eW0H5dYMcfk7fwDabtj0ZtVzJoudMUtst9ZW2WPV1ZLdHq2lz3O4C6IaMkNV+iX+SYZ1iv HXEWePFFagj5vkXrriB+iLQKOfiLPrqAbVngjA5912EvHkx2Ke3a0qTtXWTYoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7BcG1Cy7zfFx; Sat, 22 Jul 2023 03:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M3OUiH085844; Sat, 22 Jul 2023 03:24:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M3OUdk085843; Sat, 22 Jul 2023 03:24:30 GMT (envelope-from git) Date: Sat, 22 Jul 2023 03:24:30 GMT Message-Id: <202307220324.36M3OUdk085843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 1feb6f1cbe06 - stable/13 - release: sprinkle UNAME_r hacks following c883b6fd8ccd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1feb6f1cbe06c0b6dbbb96b4d195813e129c634b Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=1feb6f1cbe06c0b6dbbb96b4d195813e129c634b commit 1feb6f1cbe06c0b6dbbb96b4d195813e129c634b Author: Glen Barber AuthorDate: 2021-03-04 14:22:45 +0000 Commit: Glen Barber CommitDate: 2023-07-22 03:18:43 +0000 release: sprinkle UNAME_r hacks following c883b6fd8ccd Pass UNAME_r override to make(1) for ports builds when building ports for another branch. Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 63749bfe96b792b3a435f84ad81a47888cae1dea) --- release/Makefile.azure | 2 +- release/Makefile.ec2 | 2 +- release/Makefile.vagrant | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/Makefile.azure b/release/Makefile.azure index de95a944f9c7..32e91833b766 100644 --- a/release/Makefile.azure +++ b/release/Makefile.azure @@ -39,7 +39,7 @@ azure-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y www/npm . else - make -C ${PORTSDIR}/www/npm BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/www/npm BATCH=1 all install clean . endif . endif npm install -g azure-cli diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 035137e61d53..e26f4f705cc6 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -45,7 +45,7 @@ CW_EC2_PORTINSTALL= cw-ec2-portinstall: .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile) - env - PATH=$$PATH make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean + env - UNAME_r=${UNAME_r} PATH=$$PATH make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean .else . if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y diff --git a/release/Makefile.vagrant b/release/Makefile.vagrant index 4abcaa891ed3..d49eedacb6c9 100644 --- a/release/Makefile.vagrant +++ b/release/Makefile.vagrant @@ -58,7 +58,7 @@ vagrant-check-depends: . endif env ASSUME_ALWAYS_YES=yes pkg install -y curl . else - make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean + env UNAME_r=${UNAME_r} make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean . endif .endif From nobody Sat Jul 22 03:24:31 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7BcH3ThSz4nlff; Sat, 22 Jul 2023 03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7BcH2vh0z3FRV; Sat, 22 Jul 2023 03: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=1689996271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/Fg05YV+s92iSx6D8bPiMN8gJpV5zmbKyEZ8Hds5oA=; b=Or7g/eZ3DjpW7RvfzRp2n/ddBqV1DV787zH2mCoDap293TiEoKozjcCUt9n+nPi89iMyvx 9IulKKAqoB4e5loIIjzgG0qqVz97WpSQxxHRfpzodTcTEbvRgkIbcsCycOBibDAz2k/TEg rbt0UYeMVy6fnk3PX0L6NV63rnqwB8SFAKmF/nqUSAN0N+U6PNkRX869RvGFByQbK+9/p7 LNzC80G8NStTdUO6MJRF7MC+Gmu7K8aC4q3HqN0X/62MIpf+jvFsMEuIiA4/G2TlpPDLBG 8kFODaPL9NadtUpD3HRHzwMV2Jm3jPTvnYTwpyoqwsl+RFiEfZSu6Ed6AOoMfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/Fg05YV+s92iSx6D8bPiMN8gJpV5zmbKyEZ8Hds5oA=; b=Kr7HwdqZt5CJHktlR/jwoNVeIG9qgz+w1pPV9rnsvXTOH6UKzG6Bo86990SGqhpnZe4GEM emIk/BvZxMSN+fDcpN5n0HIx5K07yiUBzkg9zaF01oX21tQP0pAPyp7lKzoUoiLrE98D4j cQQ7A5VFmFHFoIeF5p/4HkVah0apW5zkDwLf7jENa16t9E+tnt8K9zilmzntpqt44D7EJN ZeHaFkd4pa1yjX/KAjpCQiWYevSOKXblj0yQ/EgsPIjJgimF/t6NJfAgKnyejoD7D9pesA fut4EIQjWIN1DuQSxSpYT3TJv7/+POJe8TcycUZyY1vQHTzTrvHFS9fdILsFdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689996271; a=rsa-sha256; cv=none; b=DwTsZTavx9RCDkaZ+h+Vx4yjtvYgwqOPgIcmngP3+Px5QHNqCGj+Ucra6r1tRVOaksY1nd DM1J1rlHLJGcudaR6npZXEBtH7N2PhbqzbRPQRafy9fcoFaENpPnEUutGvzgDn3k7Gr4L0 edYj6cIJTuHArs8U5y7RQLerUxkwbfDD4Lfn83yhJ8xtnJGgIKLlSiROdRkRLYzDJ6R+eF 5MoC0HE/PmzemAt8KoGNwLfZd5RudKMuaFdddJikw/nWDZJV1UMezFmawKHNvfX6iWL0z+ oJaMtE86FQvBlpU3gTcWmC7y2oaFEQcH+kAvDuhBFeGfuO5qPDKxKul/AykUKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7BcH1sLtzf3s; Sat, 22 Jul 2023 03:24:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M3OVGS085863; Sat, 22 Jul 2023 03:24:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M3OVUh085862; Sat, 22 Jul 2023 03:24:31 GMT (envelope-from git) Date: Sat, 22 Jul 2023 03:24:31 GMT Message-Id: <202307220324.36M3OVUh085862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 9265ff1fe357 - stable/13 - release: Include Makefile.inc1 in Makefile.vm List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9265ff1fe3571d2a28f16007e55fc1f32da1b3bb Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=9265ff1fe3571d2a28f16007e55fc1f32da1b3bb commit 9265ff1fe3571d2a28f16007e55fc1f32da1b3bb Author: Glen Barber AuthorDate: 2021-03-02 15:19:59 +0000 Commit: Glen Barber CommitDate: 2023-07-22 03:19:28 +0000 release: Include Makefile.inc1 in Makefile.vm Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit c883b6fd8ccd8d9c50b3f8fbb04da20ac0dec1c4) --- release/Makefile.vm | 1 + 1 file changed, 1 insertion(+) diff --git a/release/Makefile.vm b/release/Makefile.vm index 5ce0ffafd69c..c652d393d64a 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -182,3 +182,4 @@ cloudware-release: .include "${.CURDIR}/Makefile.azure" .include "${.CURDIR}/Makefile.gce" .include "${.CURDIR}/Makefile.vagrant" +.include "${.CURDIR}/Makefile.inc1" From nobody Sat Jul 22 03:24:32 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7BcK186wz4nlYR; Sat, 22 Jul 2023 03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7BcJ4Z6Dz3FbD; Sat, 22 Jul 2023 03:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXKJGUJ2ng3cw0Rvm59JY78rvIBX5XUO9m41WKYmwO0=; b=i70Rxz6ubpncQ7tJez9CunzshrydGEiDJQxjpHmKgDhxUAgJC1FKASGsV/H8BfzQ3kHb9L SQIIkwxkSCimY7PKv+UnFfzDw10Ezh8dE+8/jkWT2Fc2VyHjLZ5MiFUglDCumHjPf1dHpj iPTnGjfJ5sshdC7TtrgL6u51+YpMKIstXtrmbc3aHQ/4ES3ffvwQVVVgKEaltT9ywAFpQX BkKT2WniwAenUwSjQLjRmdOAamRoXnTzDyPj7sZ4FdP+xGrhJYdV7jB+TYWiqPifBiIOvu Bmn11lcofher1DEKa/ofSMwDcFjFuxGWpMl2+A4745SIgNhz3wxTtgi3r6gmng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fXKJGUJ2ng3cw0Rvm59JY78rvIBX5XUO9m41WKYmwO0=; b=fEeMnjlQ5PcfP0ec7iWxImdTPP+SEa+m0hOvoluZydFDYLruvV/GmcuxvE2Y5lsiP9EWJy 6GerCJDaklYGtZ9+mhX7rQnUhMpPOBSsILcxNJDOogKmSnOvKxCtn5dF5cF7LZ6VF7c0s+ L2fFjs3Z99IKyYa2trZkguEXmjKGwxmKvyqkt6XtE5xhbP3xzcZ38D7UY03nsbcv7wt6EP C4IlNpLkt2q2ZX43eUJTxdCH4tiks3KARkD0zyZLfi9bN6HNj9IRC8kPhjKhFS+2LEwrTG wg+PJ3IT8vk/FeGJeYSbw4/tDYWZYFUWszXT+oV1g6bPlDajzpvRCUbkR2EdZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689996272; a=rsa-sha256; cv=none; b=bDoAhybG2TkMSCuPmfduEw+fEnR4a4Amx32Ff3FOsrUq9OznkwXAsBk3Loqpr17AUqdJcp F+Nm+tCReQMOWRmizaUXcRNaTSjsy28nHM8c0zPLZ1B+/4nOv8x9R5x04Brqq59EnWO4iV /zcSLjsI2UA1tb1mv2x8uhotSNTDh/Hxy9RWM+yZMvE6qTm8WNLpxLyYTgP4c80qk8ZSaU quPv73SgrxPLZlRMc0jeb0LnZx15SUegyXft49qqu9xoq/h4EKuc+AZDnV9oCPekul1sx/ 68LU2hkcnDn/QKzgZygbBf/tah97VQT/A/BOb+bOWM71F5V6kRalOvseuJcBzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7BcJ32pMzf66; Sat, 22 Jul 2023 03:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M3OWb6085882; Sat, 22 Jul 2023 03:24:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M3OWK9085881; Sat, 22 Jul 2023 03:24:32 GMT (envelope-from git) Date: Sat, 22 Jul 2023 03:24:32 GMT Message-Id: <202307220324.36M3OWK9085881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: 638dd626370e - stable/13 - release: Adjust where UNAME_r is defined for ports builds List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 638dd626370e43e06ed0dfdb7e167290300fc01e Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=638dd626370e43e06ed0dfdb7e167290300fc01e commit 638dd626370e43e06ed0dfdb7e167290300fc01e Author: Glen Barber AuthorDate: 2021-03-02 15:11:04 +0000 Commit: Glen Barber CommitDate: 2023-07-22 03:20:13 +0000 release: Adjust where UNAME_r is defined for ports builds In followup to 80ab50e1de19ca125f05a13937c796d48c4edd4a, export UNAME_r in Makefile.inc1 instead of Makefile.vm. Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 0be274d3737972532c042d06c53b5807e95aa845) --- release/Makefile.inc1 | 3 +++ release/Makefile.vm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release/Makefile.inc1 b/release/Makefile.inc1 index da7226dfa890..99d61a45e700 100644 --- a/release/Makefile.inc1 +++ b/release/Makefile.inc1 @@ -40,3 +40,6 @@ BUILDDATE!= date +%Y%m%d .export BUILDDATE .endif +# Override UNAME_r to allow building ports for a different branch. +UNAME_r= ${REVISION}-${BRANCH} +.export UNAME_r diff --git a/release/Makefile.vm b/release/Makefile.vm index c652d393d64a..abd5f4c5de00 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -58,7 +58,7 @@ emulator-portinstall: .if ( ${TARGET_ARCH} != "i386" ) || ( ${MACHINE_ARCH} != "amd64" ) .if !exists(/usr/local/bin/qemu-${TARGET_ARCH}-static) .if exists(${PORTSDIR}/emulators/qemu-user-static/Makefile) - env - UNAME_r="${REVISION}-${BRANCH}" PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean + env - UNAME_r=${UNAME_r} PATH=$$PATH make -C ${PORTSDIR}/emulators/qemu-user-static BATCH=1 all install clean .else .if !exists(/usr/local/sbin/pkg-static) env ASSUME_ALWAYS_YES=yes pkg bootstrap -y From nobody Sat Jul 22 03:24:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7BcK5gJwz4nlYd; Sat, 22 Jul 2023 03: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7BcK4swdz3Fh1; Sat, 22 Jul 2023 03: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=1689996273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7MJY7tkqqVwuDZ0Khhw2XRUZ3bVOCgQj5tBNkEa4HQ=; b=yoziQyeQTTRQmsOGAkcVVSMiMBOXorR26xa4QcazkeWPqmoyQuePq09ZnUCH081ciLiCu1 Ka/Xx6NnnsN3j8argoh2f3AYYvx05W+Pl0sar5o/2BGBeGMpqy1lyypE3byG/qfDIBdEqm 2ixtVmo3monzI77qCq4J+PsI8vrn5AYN+bJm2VwTR2Z7llSb0yY3MtpdPe32ffxvunaScl iSph4Rq5bHiNygfR4/0LgjRmgL5aLb5Az+suZpHSEXmR9Vjez0WqzhezZkRtSpIM9l/RqX GmqAbpWQ814kuO0kXRSpWmXMxlaROtsnkfpjE01IzE3SSD9QomoBe5JooK7iDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F7MJY7tkqqVwuDZ0Khhw2XRUZ3bVOCgQj5tBNkEa4HQ=; b=F3bWO5sI1IvZTOIpuE8qxgFjtERBl0L2pJHFkLPiUjY7YYkok7OqCmEGU1SNBJiYbY5MBZ IycAzLYq3FHnGBCR6byvVXKps62mSliSK4Sx58rXaqF142Fjm/XkyOMMM2tqC785Pg2hXi 1SAXhzMzh9VQY1lkpDFG8uM4mOCy79ibi6MS/GJc/GimlhtejwlZVad0U1dNHY6Bn4urDU t7RhT/WFFfol+8d0FMf0fgJeqDMYNPtk5SPFeBE7FKIdcDG+L4CqzeYVuRzBdXcuMQC+Wu jv935AH5xj3n0eUnZbPf+tQ6WdOD6zy46763eUPlRL6gXF/Ak/Lem6YEnnU97w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689996273; a=rsa-sha256; cv=none; b=CEJueaKEoUbG35OY9Ujf9XCQ7wMZDS+LNWGDwpXlf0fEvkRultrfKb2pe7YE4wIA5HH0Oo 5fmPCYmEcanS6bq3EisOdT9h5+lgrhkz389awIcSN3OmPY05y1NnDT6McPxa+c3jlnIBRA J9QWK0AjzrddRyk9UlPKue3tALGTOTajQavFmE8wrjABbeOZiEEFgGlL5rr4aoPl5NdPnd SiOqVnjFQaD/+5F8KfQjrNKQePhFXoxWmj34FiARt4yvyz70gyVVMR/qbhjB6eDGmH+IWY pKMSI11tjKk+cG7CLM54/LLode9g2yRh6/kRPHdI1hg/NlRxST6cfxMlLg0YZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7BcK3zK9zdkT; Sat, 22 Jul 2023 03:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M3OXQr085902; Sat, 22 Jul 2023 03:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M3OXFu085901; Sat, 22 Jul 2023 03:24:33 GMT (envelope-from git) Date: Sat, 22 Jul 2023 03:24:33 GMT Message-Id: <202307220324.36M3OXFu085901@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Glen Barber Subject: git: a1e58f1f630f - stable/13 - release: pass UNAME_r to fix building 14.x ports on 13.x List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gjb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a1e58f1f630ffa2de1d54d9d59a7d0ab2a178695 Auto-Submitted: auto-generated The branch stable/13 has been updated by gjb: URL: https://cgit.FreeBSD.org/src/commit/?id=a1e58f1f630ffa2de1d54d9d59a7d0ab2a178695 commit a1e58f1f630ffa2de1d54d9d59a7d0ab2a178695 Author: Glen Barber AuthorDate: 2021-02-18 23:52:39 +0000 Commit: Glen Barber CommitDate: 2023-07-22 03:23:06 +0000 release: pass UNAME_r to fix building 14.x ports on 13.x Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd Sponsored by: PayPal https://paypal.me/gjbbsd (cherry picked from commit 80ab50e1de19ca125f05a13937c796d48c4edd4a) From nobody Sat Jul 22 03:31:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Bmn4cCCz4nqQB; Sat, 22 Jul 2023 03:31:53 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7Bmn3cLGz3J1b; Sat, 22 Jul 2023 03:31:53 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V0BL8B92wPOczwEaFCP7EGD9SI3Ap5PCEwLxrv4wBic=; b=liG2xrqczOYE0R1UcgFog7fyXF2WFsEWuSxpSzjmf2w7Z3BpJ7pOcU/r2yZ7vogn+zsiYl 3ombH7IOcPqKNDY3wpop/6FwKpVsy30Ngb5B/7Q3RqyqbeuAZLSgAc+4TYYAYIK1nWnMNA 2FfmS15gwa4uc/5UCnm51W/FiUNQjgOmSsyqTXNcMcEar+41GfCGpNDoeHOuHxNHATxy0K y18dSp29xE8GXrFpECQSpmp+OcQwxsCwQHmKYKY3lId7Jv9HZMrhGiYyXLB3dqTbUQPiPB FulvrHjLFJ+h+tZW9hR/10l2QRfZFCPlcBY1T90YV2iuyq/UdXAnpPgcz41N9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689996713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V0BL8B92wPOczwEaFCP7EGD9SI3Ap5PCEwLxrv4wBic=; b=HQCYeiasMN2ve81dAGV/Z3BteTFLaCHYqDZvtPVYWSeRsM0p9E24w+NI/wZPMZqkVR3U5w Lfb/fowIcvaRtAlHJrF6QVsIez6v09OZoR5kB3Vr+yTgsAycFbdUsngopjdQC43J+1JMPI H/OYtyPEQFTr0cu23LG9PrxVvVOeqvcI9GB4St6+Bmfi/YnipTnRrIDPTYuFkwSG1LM6+3 pwMoipeYb8Od1tptULe9dgCncpDZiB3dviSYFTRC3dQaZCzIgJF3wULwUEX1eaWeBR/xso ddNFsay2QkCzBGaarVGBre5Yo0hqqGYOt1gq2Txe3k3ZfIYpQOeGgZA5WnO76A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689996713; a=rsa-sha256; cv=none; b=Zmi4ICU99tk7wiy/8KsXputj3lbSOy+qoKYVdHpoyoB6r80eJc1IBbPAF52gA/UdrD0csK gqp8lJGklv1MOnnuj4XAIRJG67tF0m9/J7RHJXqU0V/mnyahIKPOQoo6Ptx+Lj41btWLEG neGWjZq29MJogGwBLOkaXleAuavbnUiGQCo5rZADlB9+qK0XdYvwXD5IaaGA0H1tDRvRx3 iZpIWX0oCwdalHFiuxJzfkPqCbZLyikaHKLAxINYv6uGPqZ0fxwgov10aMgLBpnXIriFVV EQlrzRGf9MS+y3UgWgVsBCpUrJJNKYu1HCttGmDExCfP/MUGIy6M2vzhj98MUA== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 1504716336; Sat, 22 Jul 2023 03:31:53 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Sat, 22 Jul 2023 03:31:50 +0000 From: Glen Barber To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Subject: Re: git: a1e58f1f630f - stable/13 - release: pass UNAME_r to fix building 14.x ports on 13.x Message-ID: <20230722033150.GX1219@FreeBSD.org> References: <202307220324.36M3OXFu085901@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wQ8ANTl3uYPVjUZt" Content-Disposition: inline In-Reply-To: <202307220324.36M3OXFu085901@gitrepo.freebsd.org> --wQ8ANTl3uYPVjUZt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 22, 2023 at 03:24:33AM +0000, Glen Barber wrote: > The branch stable/13 has been updated by gjb: >=20 > URL: https://cgit.FreeBSD.org/src/commit/?id=3Da1e58f1f630ffa2de1d54d9d59= a7d0ab2a178695 >=20 > commit a1e58f1f630ffa2de1d54d9d59a7d0ab2a178695 > Author: Glen Barber > AuthorDate: 2021-02-18 23:52:39 +0000 > Commit: Glen Barber > CommitDate: 2023-07-22 03:23:06 +0000 >=20 > release: pass UNAME_r to fix building 14.x ports on 13.x > =20 > Sponsored by: GoFundMe https://www.gofundme.com/f/gjbbsd > Sponsored by: PayPal https://paypal.me/gjbbsd > =20 > (cherry picked from commit 80ab50e1de19ca125f05a13937c796d48c4edd4a) >=20 This indeed was an empty commit. The conflict resolved here was fixed in a previous commit where UNAME_r was adjusted, so this cherry-pick is empty as result of that former resolution. Glen --wQ8ANTl3uYPVjUZt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAmS7TaAACgkQAxRYpUeP 4pPY3A//VJiPQ8UeP/L35owCvDUTsCxTlcrODLLv95ExuV67kPAnz1WjrFZUcXKy Z9/RWL4XJZ+MJQMCb4rxoeTmHGJpoX/RSAI7hcQp1s9+Ba1HvqmKuhAc2xfK1sek UPNeVS079JXOx3aANcMmnxowgWYgxHoou+KA6d6irq6Eus/4MQp7utO0dXfUbwup Xnn0Rymw+sSIxPqrOmiPGl6NKwXUpOBTSR75LC07+V3T28itful60dsjyeCZFMgs xqT5hrC5LhGOaF/9+J2V9y45cQ8ZW+zAl9eSdBw3lLCFbtJZY3tQT8Akll3PDb4Q 6qo2nvwM8cpevqolFwe7Z22oveuZ9WItMkAIG3ganNnLZRbOw0BTp5k/5nFIlqyg /V+14yCXErk3+VjZTQ6eevwueSZDyORaQBNcwNynGmbadFl5IsMvm+fqfag1o0eq LYwSuF1HAbnL6AJpmJIcdJb/NG20TY+yi7NwI7twLeFThwxsQSPiK15yEZYZ4VqB +RJ3dRL+AA/gYSfDw7nl+EBQhhiylpAimtDwwoiYc8dci34WdlmtWXFzq3CK3Zkl wUHK7VX23R/B6YkE8x51rpORiTQMs7yUbJLBVNWAwcDUWON3hyA6S8MyG3/hxnuc lGb/0Zfpqvv1X0mbxBvkOVQa3RLYUmO62tppnfTRetGBqodpn1o= =DOaz -----END PGP SIGNATURE----- --wQ8ANTl3uYPVjUZt-- From nobody Sat Jul 22 04:44:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7DNB6X0Bz4nYgm; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7DNB5Z8Kz3tCQ; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=q0lzXJ0rfC1OZ8JP4v2cH5/ODOv9neNyNWlJz7sflAoEMweIp+ruvZ8bsGJQoYUQKDgiXp AK8h+4gxbzRKimxBHvVxU2bKVTj/9ObRQiXnJWb+I3+MLbL37tEtLXzZJ8IO4nucQyphXo Jdo8IorK5v+1jpxgPaq18miWgWs1czlwdOK2zOWzY1CYB5TPs1oyAA+B8fer+lr1hjvU5S OhP/q/KS5/yJHVPSEQqwzNA337DAoA//l8XKpES9NOLg6P49JYWqHq4T43g2NZvDhCP1DZ YfS5VBBAhm6w6UWjVMen/sAPWe11btkAvehXr7TsvycyejwcDoPgDh9NoRPXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+MbIKR0cQLMSrwwRpuqSJ0w34HJXyVNQNszfWsQqrZE=; b=gWhfl+23UuoDpR32nH1kxY0fzMB2fGwzP+8ake9dmoIaRm3LF+Et+tJSnyCp59a7/48GV6 WE1Cado6kxjJ50uOxJqJasm8E5+KLxMOJ521OBTwNzi07dh1nMEp169PCcFBH6cdunv7Lj 1PmjTqDN6gl7fDwz0jcUEPYFKZ1qWX9983I2O+t2I+ZR8T0dtk8I3TG5VH8wkYGsdagBcR 2ABHYBupVAMQmUtZcjyiYMixlfH8qtWQInoIHd1dDnrQeZINC8YDsTBiYHmA+BngL6+Vy6 PeMDsrZn/x4v7/2+ND+5urIxjc50/yDLNxK1at+SZEGgIGeef7Bz93BcxiyEbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690001050; a=rsa-sha256; cv=none; b=weuujpv9deZb/ev7X0YvcqrLjAzHF6TG++kWLe/AboP5wtfjV0N6DceU6+27Wf9CyT7r/t 8gE1QPZmRlK73zEBglqOSTGbizf3D9FeKXD5kKFx9NpJpwNuN+f1V16Kr8GBeXsofGm6uV dV94qRLOo5pa8VJFkSqzbcIpFsRYDQXNjsMbMvbwKvG9Z+VPMuEkxO73yV5JqLQnyrYiaA F2kS2USe6dD+9dvn7lGgfS0n41/dpuyEAAQ2TGwjkYXE1Dpmy6wjlSMhxB32VGlCAqS906 a40CDBGoQ2vC0nP3yNGpQYjCdSpPEbX95eZpZTBPeqkmj8a5B1Q3HLmyg3GDeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7DNB46QVzh2Q; Sat, 22 Jul 2023 04:44:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M4i9ZA018662; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M4i9CE018661; Sat, 22 Jul 2023 04:44:09 GMT (envelope-from git) Date: Sat, 22 Jul 2023 04:44:09 GMT Message-Id: <202307220444.36M4i9CE018661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5d3c98254927 - main - Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d3c982549278c72d59debae7227366453d3c4a8 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=5d3c982549278c72d59debae7227366453d3c4a8 commit 5d3c982549278c72d59debae7227366453d3c4a8 Author: Kevin Bowling AuthorDate: 2023-07-22 04:42:23 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 04:42:23 +0000 Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes" Seems to cause a panic when booting under VitrualBox. Reported by: yasu This reverts commit 95f7b36e8fac45092b9a4eea5e32732e979989f0. --- sys/dev/e1000/em_txrx.c | 15 +++++++-------- sys/dev/e1000/if_em.c | 48 ++++++++++++++++-------------------------------- 2 files changed, 23 insertions(+), 40 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 069a1c00a4b2..47f9b187aa14 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - if (scctx->isc_capenable & IFCAP_RXCSUM) + /* XXX add a faster way to look this up */ + if (sc->hw.mac.type >= e1000_82543) em_receive_checksum(status, errors, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); + if (status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr; + uint32_t staterr = 0; bool eop; int i, cidx; - staterr = i = 0; + i = 0; cidx = ri->iri_cidx; do { @@ -739,8 +739,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && - staterr & E1000_RXD_STAT_VP) { + if (staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b5a6e7e777d3..0b664b155872 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,21 +781,19 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_JUMBO_MTU - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ - IFCAP_TSO6 - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ IFCAP_TSO6 /********************************************************************* @@ -899,7 +897,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -914,9 +912,8 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | - CSUM_IP6_TCP | CSUM_IP6_UDP; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -935,19 +932,6 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; scctx->isc_capabilities = LEM_CAPS; - - /* - * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO} - * by default as we don't have workarounds for all associated - * silicon errata. TSO4 may work on > 82544 but its status - * is unknown by the authors. Please report any success or failures. - */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - - /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ - if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) - scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); - if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ From nobody Sat Jul 22 04:58:44 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Dj03xb2z4njcg; Sat, 22 Jul 2023 04:58: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7Dj03DRkz40mg; Sat, 22 Jul 2023 04:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E87ngSMog1Hy/SFESe+7racRLQL5V7wNlU2XgXpLWRI=; b=ZQsNiW6hPK6ePzUavL86e6W8s07Bo0PlkB4695VvLStL6FHcOdO/BPXUQlAfhqoOXIUdx1 jSNdV99XWv4eJ5H5ctbmJ4a0qgKM+8E4OwtYGDTabU5EvZdRWwMr6qvM8puag/ke2ifxR2 l4XG/U3sfPKkUxQ2hliOwY8+hkqcExY33wrnM7rtBxRV/86lvekjZpuGnfQwGeD6/HTcuh p88qb4Na8v0vtZx8PUp4mrGiIwSn8IgjsrYg3luGim5XvJxRLwFtqi4c+Z9RPkwFrkjkEv bW4frhnXNZ1aN3BMTAZ+074/5q8t7fjAjytQEvpeUf9bckdBR5fuiimYn2WroA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690001924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E87ngSMog1Hy/SFESe+7racRLQL5V7wNlU2XgXpLWRI=; b=FOPWFioVoa3SBOZq4sbWKf4X9/GKsWC6WrrE9FacqzKos8ujpUuJ3srCCeDlQu5vejvzfE qSufjdbvalyWWvFU9kznpPh5qGyt/TkusTW0fi0qZfnZKXxxTdEmHsSlkhoh85NdD89XmR NfbeYqSycnFmwOgXGHsSNuxyDlQAmHd/RS6XLHUuGV6FqhsJ4Z4boMCoxKaxLcPJn6F6Gk UQCvgWcxsv25kRdtPsAQCJXvu4Ws2650fGSMp/EeblgI1g2IyteZu4Ec5pruxGriOFWJUE Kz/zKOhMzeGmIACNLPYce4JEMRx6bnNfTbKjArBXrK/pdlQABs/GWYoghvzxXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690001924; a=rsa-sha256; cv=none; b=FNexTHN+gMvfL4Ptviv99zB+HpGjPAhgWRTn9pGan8Inodp39/X6AwfFOxMICgXftrm1p+ jgP7K/ogszjvRgl7frzM+InIXQebPiNVKSYJEnWuM6qnHl5Aa8CbD1ZZ4IA3Ttv5APgmu7 Y1P3ymbZJvySUOYv6G7ewKwYFESHy1qZA2ZLtcPwyP18vtJvZ+qx4iJKHMT1q31dIgtAdN 9SBUntg9peIWsKKGiq5i/trofpwKT7zpQuHc2FeNQZ+XVhyBgE2toik3mKiC+ncq+aonkd 15whi/WKQ7GPQpAoxesUO+nvtMEjfQJV+bzIolnAqerjJRf3nMVcgek95n2psQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7Dj02LF7zhNG; Sat, 22 Jul 2023 04:58:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M4wibq036226; Sat, 22 Jul 2023 04:58:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M4wiWl036225; Sat, 22 Jul 2023 04:58:44 GMT (envelope-from git) Date: Sat, 22 Jul 2023 04:58:44 GMT Message-Id: <202307220458.36M4wiWl036225@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 29edff0dea0f - main - arm64/riscv pmap: Initialize the pmap's pm_pvchunk field List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29edff0dea0f7a2df710dd649d0cbcd4a2da3692 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=29edff0dea0f7a2df710dd649d0cbcd4a2da3692 commit 29edff0dea0f7a2df710dd649d0cbcd4a2da3692 Author: Alan Cox AuthorDate: 2023-07-16 20:58:04 +0000 Commit: Alan Cox CommitDate: 2023-07-22 04:58:18 +0000 arm64/riscv pmap: Initialize the pmap's pm_pvchunk field I believe that there are two reasons that the missing TAILQ initialization operations haven't caused a problem. First, the TAILQ head's first field is being initialized to zeroes elsewhere. Second, the first access to the TAILQ head's last field is by TAILQ_INSERT_HEAD(), which assigns to the last field without reading it when the first field is NULL. Reviewed by: kib, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41118 --- sys/arm64/arm64/pmap.c | 3 +++ sys/riscv/riscv/pmap.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index c2681104c961..b2591437b3b3 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -1291,6 +1291,7 @@ pmap_bootstrap(vm_paddr_t kernstart, vm_size_t kernlen) PMAP_LOCK_INIT(kernel_pmap); kernel_pmap->pm_l0_paddr = pmap_early_vtophys((vm_offset_t)kernel_pmap_store.pm_l0); + TAILQ_INIT(&kernel_pmap->pm_pvchunk); vm_radix_init(&kernel_pmap->pm_root); kernel_pmap->pm_cookie = COOKIE_FROM(-1, INT_MIN); kernel_pmap->pm_stage = PM_STAGE1; @@ -2270,6 +2271,7 @@ pmap_pinit0(pmap_t pmap) bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_l0_paddr = READ_SPECIALREG(ttbr0_el1); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); pmap->pm_cookie = COOKIE_FROM(ASID_RESERVED_FOR_PID_0, INT_MIN); pmap->pm_stage = PM_STAGE1; @@ -2293,6 +2295,7 @@ pmap_pinit_stage(pmap_t pmap, enum pmap_stage stage, int levels) pmap->pm_l0_paddr = VM_PAGE_TO_PHYS(m); pmap->pm_l0 = (pd_entry_t *)PHYS_TO_DMAP(pmap->pm_l0_paddr); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); pmap->pm_cookie = COOKIE_FROM(-1, INT_MAX); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 7580f091ad86..3732eea14f7d 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -646,6 +646,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen) /* Set this early so we can use the pagetable walking functions */ kernel_pmap_store.pm_top = (pd_entry_t *)l1pt; PMAP_LOCK_INIT(kernel_pmap); + TAILQ_INIT(&kernel_pmap->pm_pvchunk); vm_radix_init(&kernel_pmap->pm_root); rw_init(&pvh_global_lock, "pmap pv global"); @@ -1327,6 +1328,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_satp = pmap_satp_mode() | (vtophys(pmap->pm_top) >> PAGE_SHIFT); CPU_ZERO(&pmap->pm_active); + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); pmap_activate_boot(pmap); } @@ -1369,6 +1371,7 @@ pmap_pinit(pmap_t pmap) pmap->pm_top[i] = kernel_pmap->pm_top[i]; } + TAILQ_INIT(&pmap->pm_pvchunk); vm_radix_init(&pmap->pm_root); return (1); From nobody Sat Jul 22 08:56:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Kz76zF7z4ndp1; Sat, 22 Jul 2023 08:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7Kz75n8Zz49MB; Sat, 22 Jul 2023 08:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690016179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6drNqlqzVCzW4ZAgAFXYDZBUQnqAW72gR76EAGNEW8k=; b=wqr1Pro7TsxIwzwUBhKgofxyQdjukMnGuKgUWGA8cIZGKUHUxhPCBPuhpefBLsiQC/SCBN GvanQgmASlQtZ2AkUPoLFUzgBuu0ynzkmxDJUeAYhjoU3X53H6L7MbrQddcb8dYPXnAm2j fmvD7wgG30+E6eLmI+fsRtLv4CdNb5FFkBBnitzguL2WrwZG3or6veA9jNfBbWoYqmT8I0 ArdxQwGkZtOAA+I5yhH+bG24VxD7VrmzHNxCdrrwzJDuzmtI1WxRbCBaUQFEV0LUhPZXg4 0Vxwohf2lKBv0Lu8Wb3fkokThcy6zit3nIyDgmmBPARxxxDfq+DdYI4kMSw/Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690016179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6drNqlqzVCzW4ZAgAFXYDZBUQnqAW72gR76EAGNEW8k=; b=JaFZJl9ZVcJMWImtIIZ3/IKuUz5+Ky98ZqMHGGxdSZN+/N99MBeH2bAmserXvhp4Ruf3rV C/IxcxbHcGTalr5gAxROWL26A9zJIXLVTZ7jVKVA0rfbID41cKR185nk8PyRobtATlb8dx ZWJz1VjCPgUsDLj3ofPpoqzXeCvqg9SQ653KA6Sm0sOS/ugK54ViZG9XG8anKLNdmQVZS6 wtLDEdFG7EwJ8fpurj5iGwJZxe+pwm8e4MiS76D4J/cSbg7tv9uwSZGU3OCS7oCo83jWPq glfdbNi/Yabrnk5q6v8GUNOxZLd6hqLuWWsdgvlOy8XYiScWr8QHU1+QKUspyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690016179; a=rsa-sha256; cv=none; b=IA2KZ4Egc6O6pNxZ/PzRnvZFKhnBJ6jtBTW/M1BGwMFECCdxOXhnWUdctv/s6OL5MmFU/3 1z7niOlNzTZgGeAX+KE0uA4L8osTjHIdv8ZtZn3Hp0Rqs20i89TwgF84LoYuLLy/W/9O1E qrEOruZkuU8Bha1iwFSrMXhZWVvHCSrRIQBenckAPATauc59SIyI9MqaiL4g0DkwCIW7o8 9he0V57rMsyc//QOP8xxtGe8srAiQEMCZGYAC0yVcXfATPivddc2w/o38tr+Bt3HXxLLqY NaKXgvTVHqEaA7rYZCK0VkeonsTzAXli+cryVYHsQQ02GQPg8dD78IbSK+PuPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7Kz74sP2zpK9; Sat, 22 Jul 2023 08:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36M8uJD5032982; Sat, 22 Jul 2023 08:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M8uJQs032981; Sat, 22 Jul 2023 08:56:19 GMT (envelope-from git) Date: Sat, 22 Jul 2023 08:56:19 GMT Message-Id: <202307220856.36M8uJQs032981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 241a55b4615e - main - libc/csu: Do not compile the finalizer() for PIC build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 241a55b4615ef671583db13e6729b0028539c063 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=241a55b4615ef671583db13e6729b0028539c063 commit 241a55b4615ef671583db13e6729b0028539c063 Author: Dmitry Chagin AuthorDate: 2023-07-22 08:56:06 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 08:56:06 +0000 libc/csu: Do not compile the finalizer() for PIC build Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D41148 --- lib/libc/csu/libc_start1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/csu/libc_start1.c b/lib/libc/csu/libc_start1.c index d6a973bf0fe0..f0e708e405ce 100644 --- a/lib/libc/csu/libc_start1.c +++ b/lib/libc/csu/libc_start1.c @@ -76,6 +76,7 @@ process_irelocs(void) #error "Define platform reloc type" #endif +#ifndef PIC static void finalizer(void) { @@ -90,6 +91,7 @@ finalizer(void) } _fini(); } +#endif static void handle_static_init(int argc, char **argv, char **env) From nobody Sat Jul 22 11:09:15 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwc08gNz4nx06; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7NwY3HwYz3sq9; Sat, 22 Jul 2023 11:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cReIH+zUw2wHQF1sJA3x7OugJMtZf53xINTW3iH3a0=; b=QAHO6iiTMf6jWVsUYspLJFY4CeMBs2vbPUwcYL5RJkFayvkFtzsbg4OdNwD6Oa5JCfGY7I H5PobGghD3A1MUMVHArxAvqUUPo9WvPrrqvxPocPk0idJvbvj/VaXFSjrNbjxClyNFKhpl 3T0aCTqvhfdCaeb3MSNqwNi+PB76mF4QSOWfZx6CytsecagN26Dnmgq0one3RcZyfuLRVg 6QWhGSlyuzcvgLVaDhGApqpoeFA3Z+FSolrMN603pHHZhsyiOjeuJH7eZcY1+Lzae1ywvN L2rwWHzYh6RW7SbCIOGoTtd5b3mmpu9Q+SIDN9cEuoEqkWHkfTyPjCsZjrXDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9cReIH+zUw2wHQF1sJA3x7OugJMtZf53xINTW3iH3a0=; b=mQjiBm3HWtgpB7iuTrhdNqxtOc1KqCpyqSDk7aP+NUfRmLcgE65AMqUnaZcCEOBZjtwxov cvZFfYtkayswPvYDbMcJdSnaWKAqO5/ju9fIthJH22WRxLf9aK2txHL22g7q7Y8KRQyHJr RfdbXVl+6kCficfIrixWNSs8zkXJnxIk4FY5h6qa8UZGMS8EFTPkOtoiTdonf49dZjF2S5 rxmct+z0gKrTDCcPo/Arfjr9wVwot5WnrLkPI2m18MFPPYHfn5CuR/OKglBctsIK1O4Fmt QAx04d5elW1Phyliap3AkhXTiEGLqDOAM0yUrf8L+n1P7yLTTpL/Sqg7mGSU8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024157; a=rsa-sha256; cv=none; b=vLBH4WzdY/4V3aal0BQRQShIRZDmAV5z6D4hdmkTU/kLl2kwp9PmRJ8Xvr6TYa7iSpUjPf Sg59ZqK6fVcpIsgPA+QpGkqWpGweOi4ZMkmsR1gCk1ltka5QVxs2ZRVzVpOH2Vfjgy5//n eQHcZUhO4Xgq8jsLXwhJzyBgATGwMHlOfAydKtHTeweDWN3pJRn8KyqzfiMWn5IdIViV+D uOjKI2+yyQTDIicdbvSdlkupoegxLQetYcOJ0TkyWHwYkIbSe+1mWbxCWi0IqOPXmzUYt4 V9Gnxu+wQyTS1dNflB9dK+QMCHzfZusixejDcvyv9ftBaJH+cEUYU20FlqUsBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7NwX2pDzzsL6; Sat, 22 Jul 2023 11:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MB9Fs6049655; Sat, 22 Jul 2023 11:09:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9FOq049654; Sat, 22 Jul 2023 11:09:15 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:15 GMT Message-Id: <202307221109.36MB9FOq049654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 41f2c69ee389 - main - linux(4): Modify xattr syscalls to match Linux List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41f2c69ee38933cd67916c77494ab1b26322ec0a Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=41f2c69ee38933cd67916c77494ab1b26322ec0a commit 41f2c69ee38933cd67916c77494ab1b26322ec0a Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:31 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:31 +0000 linux(4): Modify xattr syscalls to match Linux MFC after: 1 month --- sys/amd64/linux/syscalls.master | 18 +++++++++--------- sys/amd64/linux32/syscalls.master | 18 +++++++++--------- sys/arm64/linux/syscalls.master | 18 +++++++++--------- sys/i386/linux/syscalls.master | 18 +++++++++--------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index e4ac2ef99edf..6d8e4102d6fc 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -1117,7 +1117,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1126,7 +1126,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1135,7 +1135,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1144,7 +1144,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1152,7 +1152,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1160,28 +1160,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 194 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 195 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 196 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 382b681fdde1..e871f6fdbfc8 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -1222,7 +1222,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1231,7 +1231,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1240,7 +1240,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1249,7 +1249,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1257,7 +1257,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1265,28 +1265,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 232 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 233 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 234 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/arm64/linux/syscalls.master b/sys/arm64/linux/syscalls.master index b9dda787389c..04748e30182c 100644 --- a/sys/arm64/linux/syscalls.master +++ b/sys/arm64/linux/syscalls.master @@ -26,7 +26,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -35,7 +35,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -44,7 +44,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -53,7 +53,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -61,7 +61,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -69,28 +69,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 11 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 12 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 13 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index c7168f7da80e..614731ee2cfe 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -1238,7 +1238,7 @@ int linux_setxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1247,7 +1247,7 @@ int linux_lsetxattr( const char *path, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1256,7 +1256,7 @@ int linux_fsetxattr( l_int fd, const char *name, - const char *value, + void *value, l_size_t size, l_int flags ); @@ -1265,7 +1265,7 @@ int linux_getxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1273,7 +1273,7 @@ int linux_lgetxattr( const char *path, const char *name, - char *value, + void *value, l_size_t size ); } @@ -1281,28 +1281,28 @@ int linux_fgetxattr( l_int fd, const char *name, - char *value, + void *value, l_size_t size ); } 232 AUE_NULL STD { int linux_listxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 233 AUE_NULL STD { int linux_llistxattr( const char *path, - const char *list, + char *list, l_size_t size ); } 234 AUE_NULL STD { int linux_flistxattr( l_int fd, - const char *list, + char *list, l_size_t size ); } From nobody Sat Jul 22 11:09:16 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb70Kbz4nwwh; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7NwY3BmVz3skX; Sat, 22 Jul 2023 11:09:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsQM5o4r8TpUyLf+mS6k0HeE3YwiboIfoCavFsXkcpw=; b=EhBX33PZ2/NUtOoGQ2mSm+sOe3sQJOBJilujkpRNI24qwWQL0uHGxXzWZUDdKgwYDHv8DR RVh3436JPL2C4pK1vs/gWuq4hTZbWAf6F9Pco9AZ7jqCzY8RXahtypIkY0yOeoRarNA9Nv VSldZuLVYKpIP1iB38voAhszaDrp59GiALP/WgZWNlGzsTaf5YRmrqk+P9vUmdmZU+Ks4O zlIPn7R4Tz2qECRMCZIEfYrSMBJq/bcw4j9qwD8/Dtdqhab2nHBBxilGSGd7gB2UJ9L8HK HRzb+/jcSjYbzKXdan4rpsjAWnVccmP/GUBCsFV/7Jv8M7tnQoaOs1LDvcbTrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsQM5o4r8TpUyLf+mS6k0HeE3YwiboIfoCavFsXkcpw=; b=qbBimTuw+zaO0TTcnKtzc8eJ3l1QOfYG/qwSY46TEseZsHouBnACYyhjCYhnPl54ZA54UX umbj2jJnUl7t2/OBaXMOiLTMmYK8uV8yRTtzfTdaMccVNPeSberNWsQCkXsjCHJ/Nrb9ou 67Pe8v5IWtMYvT9YOcb8xnFr3rAG5F3oDst5h8F7uclyfZM0H3Sxerk60tjOqAzqHARP7P DwUjakvDe/9cmCgZzu2BYzpYDLGSgpVJjX9h67eceVp+0Rx8RDCZCfCPlXE3bn4U1jjvJk BkY9+mHUWkxXd8/Q+zZFOiHdtUWZTSR/ED9QZx/2d8qXy/2Sk6xIIgEr3Z1Jmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024157; a=rsa-sha256; cv=none; b=q+rysOoK6WugtGGk7DzO701bm6XycwmWHchmQ98yp2rquYbVA95DHcgV9n3mnWfHl4YEPy UNuCv8O1hCtPOvWmemRjTOKmejQ+Y6XeUj9bk6cjKbfJFKorcaUHA/ATQNdK+AnpYzzEjb e8gWv7fkdadVBfFfEoR/NT7cg3envAqvUyZzlgIXNXOH7u5q56yY4RcYp2qlA0ek2fJaL5 Eu7/1367ho4ctsqUELBLiyrqZtMBlkqIe1pC5TxaSrRZu77capddQi/cCMaOPO+8cU85Iv z2gRYUzA2UtedlN4oSySOF5eg/BYu80TsL8u/gC3Wj/sZwC8ZkYtBb2QbyfftA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7NwX6mlzzsPv; Sat, 22 Jul 2023 11:09:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MB9G7W049674; Sat, 22 Jul 2023 11:09:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9GpP049673; Sat, 22 Jul 2023 11:09:16 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:16 GMT Message-Id: <202307221109.36MB9GpP049673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: d9c2dc6bf17b - main - linux(4): Regen for xattr syscalls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 commit d9c2dc6bf17b7710cbbac18bc0b913803b6c8a50 Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:32 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:32 +0000 linux(4): Regen for xattr syscalls MFC after: 1 month --- sys/amd64/linux/linux_proto.h | 18 ++++++++-------- sys/amd64/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- sys/amd64/linux32/linux32_proto.h | 18 ++++++++-------- sys/amd64/linux32/linux32_systrace_args.c | 36 +++++++++++++++---------------- sys/arm64/linux/linux_proto.h | 18 ++++++++-------- sys/arm64/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- sys/i386/linux/linux_proto.h | 18 ++++++++-------- sys/i386/linux/linux_systrace_args.c | 36 +++++++++++++++---------------- 8 files changed, 108 insertions(+), 108 deletions(-) diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h index a767712d6dce..3bf8ea0fc7b1 100644 --- a/sys/amd64/linux/linux_proto.h +++ b/sys/amd64/linux/linux_proto.h @@ -634,55 +634,55 @@ struct linux_readahead_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c index 67571971d584..6ff1764b077c 100644 --- a/sys/amd64/linux/linux_systrace_args.c +++ b/sys/amd64/linux/linux_systrace_args.c @@ -1436,7 +1436,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1447,7 +1447,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1458,7 +1458,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1469,7 +1469,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1479,7 +1479,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1489,7 +1489,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1498,7 +1498,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 194: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1507,7 +1507,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 195: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1516,7 +1516,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 196: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5039,7 +5039,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5061,7 +5061,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5083,7 +5083,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5105,7 +5105,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5124,7 +5124,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5143,7 +5143,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5159,7 +5159,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5175,7 +5175,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5191,7 +5191,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index f9b3ee7e9452..1b4892124c7c 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -712,55 +712,55 @@ struct linux_gettid_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index 72ca52bc84c8..c137bcb18fd6 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -1562,7 +1562,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1573,7 +1573,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1584,7 +1584,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1595,7 +1595,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1605,7 +1605,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1615,7 +1615,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1624,7 +1624,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1633,7 +1633,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1642,7 +1642,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5694,7 +5694,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5716,7 +5716,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5738,7 +5738,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5760,7 +5760,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5779,7 +5779,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5798,7 +5798,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5814,7 +5814,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5830,7 +5830,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5846,7 +5846,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/arm64/linux/linux_proto.h b/sys/arm64/linux/linux_proto.h index b02e284d8d5e..1c3dffcd6bb6 100644 --- a/sys/arm64/linux/linux_proto.h +++ b/sys/arm64/linux/linux_proto.h @@ -37,55 +37,55 @@ struct thread; struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/arm64/linux/linux_systrace_args.c b/sys/arm64/linux/linux_systrace_args.c index 123388136fd8..a2ef2d257037 100644 --- a/sys/arm64/linux/linux_systrace_args.c +++ b/sys/arm64/linux/linux_systrace_args.c @@ -17,7 +17,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -28,7 +28,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -39,7 +39,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -50,7 +50,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -60,7 +60,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -70,7 +70,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -79,7 +79,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 11: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -88,7 +88,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 12: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -97,7 +97,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 13: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -2387,7 +2387,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2409,7 +2409,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2431,7 +2431,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2453,7 +2453,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2472,7 +2472,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2491,7 +2491,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -2507,7 +2507,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -2523,7 +2523,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -2539,7 +2539,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index f1f1c6f6333e..22564f25f484 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -705,55 +705,55 @@ struct linux_gettid_args { struct linux_setxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_lsetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_fsetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(const char *)]; const char * value; char value_r_[PADR_(const char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)]; }; struct linux_getxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_lgetxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_fgetxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; - char value_l_[PADL_(char *)]; char * value; char value_r_[PADR_(char *)]; + char value_l_[PADL_(void *)]; void * value; char value_r_[PADR_(void *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_listxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_llistxattr_args { char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_flistxattr_args { char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)]; - char list_l_[PADL_(const char *)]; const char * list; char list_r_[PADR_(const char *)]; + char list_l_[PADL_(char *)]; char * list; char list_r_[PADR_(char *)]; char size_l_[PADL_(l_size_t)]; l_size_t size; char size_r_[PADR_(l_size_t)]; }; struct linux_removexattr_args { diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index a50c6b2d77a9..e93d46556092 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -1593,7 +1593,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_setxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1604,7 +1604,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lsetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1615,7 +1615,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fsetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* const char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ iarg[a++] = p->flags; /* l_int */ *n_args = 5; @@ -1626,7 +1626,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_getxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1636,7 +1636,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_lgetxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1646,7 +1646,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct linux_fgetxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intptr_t)p->value; /* void * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 4; break; @@ -1655,7 +1655,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct linux_listxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1664,7 +1664,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct linux_llistxattr_args *p = params; uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -1673,7 +1673,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct linux_flistxattr_args *p = params; iarg[a++] = p->fd; /* l_int */ - uarg[a++] = (intptr_t)p->list; /* const char * */ + uarg[a++] = (intptr_t)p->list; /* char * */ iarg[a++] = p->size; /* l_size_t */ *n_args = 3; break; @@ -5761,7 +5761,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5783,7 +5783,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5805,7 +5805,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland const char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5827,7 +5827,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5846,7 +5846,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5865,7 +5865,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 2: - p = "userland char *"; + p = "userland void *"; break; case 3: p = "l_size_t"; @@ -5881,7 +5881,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5897,7 +5897,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "userland const char *"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; @@ -5913,7 +5913,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) p = "l_int"; break; case 1: - p = "userland const char *"; + p = "userland char *"; break; case 2: p = "l_size_t"; From nobody Sat Jul 22 11:09:19 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb6tdHz4nx05; Sat, 22 Jul 2023 11:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7Nwb3FRqz3svP; Sat, 22 Jul 2023 11:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56keMqqRkZgWNNeYBDTzcX9Aj25OhXtYcjiW7l6UyCY=; b=LtaC1XxMvNolJxTGWhCAwR4k1wMAA7aIXcdq2HzkXdbvFygIAV68gm6Q0157q5S8bFc+7x hHL0VSx0sfM3pMuqhBgj7DPRxxOXRagEi6NxU+VZj3uU7BvhNxJXYw3owPdZG9+XusQrHy LiLJ/Yti5QAAtWSoefAKybmCFbt1WKhrKDYlcJoFrDSxioZpKs3zgpRqz0W1E8+PiA47Tb ioIaxIBraZ7Tm1pD63D44Qr0ZeIk4FEs1UvG17/yUZc2z/DhO1ij7QcGWxFzxPL+BsXBdc VeYY995dywXwZk+MVR9FfmlDyDjWN6vNLk4n+djyxaTG/E8nkPoKXpwgqDznog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=56keMqqRkZgWNNeYBDTzcX9Aj25OhXtYcjiW7l6UyCY=; b=O2JKWJK05pOXG13elcTa0CjUEhoYA7MvxaNSy2BN2WUyqoc+wPrQ39ET1tgfbKbp+35WFo v16hrfZ4ROaW8F7exFBWL5xNEah0hPObAP89f8owmvV6HChG2vhpYySri3C3K5MeKPdSiO cuR9FyHILHo2BQH23GO8mvpoeZooPTITJnnECpehaUb8lDIKZQmn4GkCvNC9PpamMRzHAa IENPIsnVGi6IogQHb15Jl+XeXhg/65U1UwSn8kLhqEKz5eJtxfksRJj+LUYbjP0lrmMLUr +W44u4Jdw50VBCmCFIT6RTbV8+8IVMhAEElBc90qUuFFuQ6GJphZhA4trtyBjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024159; a=rsa-sha256; cv=none; b=Dl1nBOmEXnElw5zjygvQSUecTVcrBwEPjZm0M4ImSzfGFjhqCm/mql8DEK/BxDb8JCJhj7 KAtI19Iqdr+fFLqZJhy8c4PhtitpyiZm0WDk0Pk0pEC4p5IL64KNPug0emw2H6AXvd96BI J/hq3qAqZFqrcFqTY9utdl65MuIZpyci8Sk4M2wbxWTI59/YBaI4H6waBQYZ/kQGKyMzvP IHkGNtsFP3yK0RBYYsAOZ2Bhf7CkNf+7k8n7cer5NhbuqYIfMtimxAPxMoTTAloWRsReVI VzDotLP6JABW7lo97cnYhG0UGUoQObg3d8Yh04q0BwJNoEnz5VJ1XME0vpzHPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7Nwb1Rr7zsZF; Sat, 22 Jul 2023 11:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MB9JoY049734; Sat, 22 Jul 2023 11:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9JVN049733; Sat, 22 Jul 2023 11:09:19 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:19 GMT Message-Id: <202307221109.36MB9JVN049733@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 22dca7acf775 - main - linux(4): Implement xattr syscalls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf commit 22dca7acf7756c07d3ccbfdc8dfd10fd9ad3f9cf Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:33 +0000 linux(4): Implement xattr syscalls Reviewed by: Differential revision: https://reviews.freebsd.org/D35544 MFC after: 1 month --- sys/compat/linux/linux_dummy.c | 21 --- sys/compat/linux/linux_xattr.c | 399 +++++++++++++++++++++++++++++++++++++++++ sys/modules/linux/Makefile | 1 + sys/modules/linux64/Makefile | 1 + 4 files changed, 401 insertions(+), 21 deletions(-) diff --git a/sys/compat/linux/linux_dummy.c b/sys/compat/linux/linux_dummy.c index 46596aa4a92a..861482b67d8f 100644 --- a/sys/compat/linux/linux_dummy.c +++ b/sys/compat/linux/linux_dummy.c @@ -146,24 +146,3 @@ DUMMY(pidfd_send_signal); DUMMY(io_uring_setup); DUMMY(io_uring_enter); DUMMY(io_uring_register); - -#define DUMMY_XATTR(s) \ -int \ -linux_ ## s ## xattr( \ - struct thread *td, struct linux_ ## s ## xattr_args *arg) \ -{ \ - \ - return (EOPNOTSUPP); \ -} -DUMMY_XATTR(set); -DUMMY_XATTR(lset); -DUMMY_XATTR(fset); -DUMMY_XATTR(get); -DUMMY_XATTR(lget); -DUMMY_XATTR(fget); -DUMMY_XATTR(list); -DUMMY_XATTR(llist); -DUMMY_XATTR(flist); -DUMMY_XATTR(remove); -DUMMY_XATTR(lremove); -DUMMY_XATTR(fremove); diff --git a/sys/compat/linux/linux_xattr.c b/sys/compat/linux/linux_xattr.c new file mode 100644 index 000000000000..60c4c8ddf4c9 --- /dev/null +++ b/sys/compat/linux/linux_xattr.c @@ -0,0 +1,399 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2023 Dmitry Chagin + * + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#ifdef COMPAT_LINUX32 +#include +#include +#else +#include +#include +#endif + +#include + +#define LINUX_XATTR_SIZE_MAX 65536 +#define LINUX_XATTR_LIST_MAX 65536 +#define LINUX_XATTR_NAME_MAX 255 + +#define LINUX_XATTR_CREATE 0x1 +#define LINUX_XATTR_REPLACE 0x2 +#define LINUX_XATTR_FLAGS LINUX_XATTR_CREATE|LINUX_XATTR_REPLACE + +struct listxattr_args { + int fd; + const char *path; + char *list; + l_size_t size; + int follow; +}; + +struct setxattr_args { + int fd; + const char *path; + const char *name; + void *value; + l_size_t size; + l_int flags; + int follow; +}; + +static char *extattr_namespace_names[] = EXTATTR_NAMESPACE_NAMES; + + +static int +xatrr_to_extattr(const char *uattrname, int *attrnamespace, char *attrname) +{ + char uname[LINUX_XATTR_NAME_MAX + 1], *dot; + size_t len, cplen; + int error; + + error = copyinstr(uattrname, uname, sizeof(uname), &cplen); + if (error != 0) + return (error); + if (cplen == sizeof(uname)) + return (ERANGE); + dot = strchr(uname, '.'); + if (dot == NULL) + return (ENOTSUP); + *dot = '\0'; + for (*attrnamespace = EXTATTR_NAMESPACE_USER; + *attrnamespace < nitems(extattr_namespace_names); + (*attrnamespace)++) { + if (bcmp(uname, extattr_namespace_names[*attrnamespace], + dot - uname + 1) == 0) { + dot++; + len = strlen(dot) + 1; + bcopy(dot, attrname, len); + return (0); + } + } + return (ENOTSUP); +} + +static int +listxattr(struct thread *td, struct listxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + char *data, *prefix, *key; + struct uio auio; + struct iovec aiov; + unsigned char keylen; + size_t sz, cnt, rs, prefixlen, pairlen; + int attrnamespace, error; + + if (args->size != 0) + sz = min(LINUX_XATTR_LIST_MAX, args->size); + else + sz = LINUX_XATTR_LIST_MAX; + + data = malloc(sz, M_LINUX, M_WAITOK); + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_SYSSPACE; + auio.uio_td = td; + cnt = 0; + for (attrnamespace = EXTATTR_NAMESPACE_USER; + attrnamespace < nitems(extattr_namespace_names); + attrnamespace++) { + aiov.iov_base = data; + aiov.iov_len = sz; + auio.uio_resid = sz; + auio.uio_offset = 0; + + if (args->path != NULL) + error = kern_extattr_list_path(td, args->path, + attrnamespace, &auio, args->follow, UIO_USERSPACE); + else + error = kern_extattr_list_fd(td, args->fd, + attrnamespace, &auio); + rs = sz - auio.uio_resid; + if (error != 0 || rs == 0) + continue; + prefix = extattr_namespace_names[attrnamespace]; + prefixlen = strlen(prefix); + key = data; + while (rs > 0) { + keylen = (unsigned char)key[0]; + pairlen = prefixlen + 1 + keylen + 1; + if (cnt + pairlen > LINUX_XATTR_LIST_MAX) { + error = E2BIG; + break; + } + if ((args->list != NULL && cnt > args->size) || + pairlen >= sizeof(attrname)) { + error = ERANGE; + break; + } + ++key; + if (args->list != NULL) { + sprintf(attrname, "%s.%.*s", prefix, keylen, key); + error = copyout(attrname, args->list, pairlen); + if (error != 0) + break; + args->list += pairlen; + } + cnt += pairlen; + key += keylen; + rs -= (keylen + 1); + } + } + if (error == 0) + td->td_retval[0] = cnt; + free(data, M_LINUX); + return (error); +} + +int +linux_listxattr(struct thread *td, struct linux_listxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = -1, + .path = args->path, + .list = args->list, + .size = args->size, + .follow = FOLLOW, + }; + + return (listxattr(td, &eargs)); +} + +int +linux_llistxattr(struct thread *td, struct linux_llistxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = -1, + .path = args->path, + .list = args->list, + .size = args->size, + .follow = NOFOLLOW, + }; + + return (listxattr(td, &eargs)); +} + +int +linux_flistxattr(struct thread *td, struct linux_flistxattr_args *args) +{ + struct listxattr_args eargs = { + .fd = args->fd, + .path = NULL, + .list = args->list, + .size = args->size, + .follow = 0, + }; + + return (listxattr(td, &eargs)); +} + +static int +linux_path_removexattr(struct thread *td, const char *upath, const char *uname, + int follow) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(uname, &attrnamespace, attrname); + if (error != 0) + return (error); + + return (kern_extattr_delete_path(td, upath, attrnamespace, + attrname, follow, UIO_USERSPACE)); +} + +int +linux_removexattr(struct thread *td, struct linux_removexattr_args *args) +{ + + return (linux_path_removexattr(td, args->path, args->name, + FOLLOW)); +} + +int +linux_lremovexattr(struct thread *td, struct linux_lremovexattr_args *args) +{ + + return (linux_path_removexattr(td, args->path, args->name, + NOFOLLOW)); +} + +int +linux_fremovexattr(struct thread *td, struct linux_fremovexattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + return (kern_extattr_delete_fd(td, args->fd, attrnamespace, + attrname)); +} + +static int +linux_path_getxattr(struct thread *td, const char *upath, const char *uname, + void *value, l_size_t size, int follow) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(uname, &attrnamespace, attrname); + if (error != 0) + return (error); + + return (kern_extattr_get_path(td, upath, attrnamespace, + attrname, value, size, follow, UIO_USERSPACE)); +} + +int +linux_getxattr(struct thread *td, struct linux_getxattr_args *args) +{ + + return (linux_path_getxattr(td, args->path, args->name, + args->value, args->size, FOLLOW)); +} + +int +linux_lgetxattr(struct thread *td, struct linux_lgetxattr_args *args) +{ + + return (linux_path_getxattr(td, args->path, args->name, + args->value, args->size, NOFOLLOW)); +} + +int +linux_fgetxattr(struct thread *td, struct linux_fgetxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + return (kern_extattr_get_fd(td, args->fd, attrnamespace, + attrname, args->value, args->size)); +} + +static int +setxattr(struct thread *td, struct setxattr_args *args) +{ + char attrname[LINUX_XATTR_NAME_MAX + 1]; + int attrnamespace, error; + + if ((args->flags & ~(LINUX_XATTR_FLAGS)) != 0 || + args->flags == (LINUX_XATTR_FLAGS)) + return (EINVAL); + error = xatrr_to_extattr(args->name, &attrnamespace, attrname); + if (error != 0) + return (error); + + if ((args->flags & (LINUX_XATTR_FLAGS)) != 0 ) { + if (args->path != NULL) + error = kern_extattr_get_path(td, args->path, + attrnamespace, attrname, NULL, args->size, + args->follow, UIO_USERSPACE); + else + error = kern_extattr_get_fd(td, args->fd, + attrnamespace, attrname, NULL, args->size); + if ((args->flags & LINUX_XATTR_CREATE) != 0) { + if (error == 0) + error = EEXIST; + else if (error == ENOATTR) + error = 0; + } + if (error != 0) + goto out; + } + if (args->path != NULL) + error = kern_extattr_set_path(td, args->path, attrnamespace, + attrname, args->value, args->size, args->follow, + UIO_USERSPACE); + else + error = kern_extattr_set_fd(td, args->fd, attrnamespace, + attrname, args->value, args->size); +out: + td->td_retval[0] = 0; + return (error); +} + +int +linux_setxattr(struct thread *td, struct linux_setxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = -1, + .path = args->path, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = FOLLOW, + }; + + return (setxattr(td, &eargs)); +} + +int +linux_lsetxattr(struct thread *td, struct linux_lsetxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = -1, + .path = args->path, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = NOFOLLOW, + }; + + return (setxattr(td, &eargs)); +} + +int +linux_fsetxattr(struct thread *td, struct linux_fsetxattr_args *args) +{ + struct setxattr_args eargs = { + .fd = args->fd, + .path = NULL, + .name = args->name, + .value = args->value, + .size = args->size, + .flags = args->flags, + .follow = 0, + }; + + return (setxattr(td, &eargs)); +} diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index 294a7d595cc6..42ce6607dfc2 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -34,6 +34,7 @@ SRCS= linux${SFX}_dummy_machdep.c \ linux_timer.c \ linux_uid16.c \ linux_vdso.c \ + linux_xattr.c \ opt_inet6.h \ opt_ktrace.h \ opt_posix.h \ diff --git a/sys/modules/linux64/Makefile b/sys/modules/linux64/Makefile index 4fe9ccd576c1..0a133e6e79b4 100644 --- a/sys/modules/linux64/Makefile +++ b/sys/modules/linux64/Makefile @@ -29,6 +29,7 @@ SRCS= linux_dummy_machdep.c \ linux_time.c \ linux_vdso.c \ linux_timer.c \ + linux_xattr.c \ opt_ktrace.h \ opt_inet6.h \ opt_posix.h \ From nobody Sat Jul 22 11:09:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7Nwb6tfcz4nwq6; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7NwZ2lQVz3skY; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asAjy+C6zZuHQcjHKG3Tf1smPObotd8MwaEB3vaA2ao=; b=tYMQ2NdoCQJ80WSRNY37xeSQNGfxxOoQitrQpUaAU37wm+6HLckbUlmB7EO3bK17bK0aLR xSMDFpadIwrM/Y9rDzBELy0mKyxbejw5EyRauZtcJDwEZ2CzbvVU0vUkT5OjGIwtoUfRTL o3nXioRgGb1LrSU7skrsdiKldZbTzOA9tDlleusH3dyBt/476xU39QFXifuAG0fgExWLIV h7pw5cJJ9u/wGdUKadk+pFFCJgrLbGY+JOwS8zzpyV26AWL3wlvKpccUT/RYxvxY0jn8/A UZJRc9+0i/CHduq4OE6gF68oPwMjYCxUkzEY8d9JBi4nUso1AkOeAL3j4yqFAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690024158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asAjy+C6zZuHQcjHKG3Tf1smPObotd8MwaEB3vaA2ao=; b=PYwPv40rKJJCQSyvE7WC3iKIXQdOwLkKs+mhFkyCBwnNwDRcoviXs0P3eH/kek2ULemDza l5LxF1lwhU+qGXU6K4S8FGfTbOitsfoqHB49ojlkEcC7e/RNtiqi1Zen7dAbc3g22Aacm1 2O3EkAwiEMEG8LcKsj0nZaGOIwZiqzcT49xJY+Ll1v+gj+gYO6Z9wqqjvS6dJMTcY4nm7y 2mT70KjrVkTQtsIegwLxPgZBf5hHNzNgm3bqHJr5rv0cnN3FaZCaazYNv/zXClJYuTPd7x XklIWc23kd8W2joN3jl/noEQk7TYb2piBNdE5YpEEaJ9+agnSrRvPvEAeHBR8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690024158; a=rsa-sha256; cv=none; b=tOSrG+QWeo9jX/z1t50dYodxuvQcpNxFtZoQxX7buXs2nTKcj2SWRjpQgAE7hkjbY5+4t4 pdejmnmk7Ursa0WMe//dXo8QQHEEFOH7DLXk0pK0JdU8YgoEj/EcQ/HZ70SoawS9hWzYrZ DBz2qX/UI5lhHQEdkJ4TvSnmJtJLZ1ETCcJUGWJeAhMQkVTgBO2JIkVMiBdJdEXLQq98Nl y44Oj2wyZdAbiDoAUHoc7Ua0P23gHSPNLJU8yTOLdfwVDHZIDCjslyHeQGhA0e8v5QktTt 7mlISqz/30By9Rfnln9g5SJK9dwkqXZM1Cegx9sbjnFQkViXBR0XxBF4MumXdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7NwZ1G6PzsBQ; Sat, 22 Jul 2023 11:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MB9HxW049694; Sat, 22 Jul 2023 11:09:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MB9H9t049693; Sat, 22 Jul 2023 11:09:17 GMT (envelope-from git) Date: Sat, 22 Jul 2023 11:09:17 GMT Message-Id: <202307221109.36MB9H9t049693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: 6453d4240f6b - main - vfs: Export exattr methods to reuse by Linuxulator List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6453d4240f6b46c718efa59651239f8519e1523e Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=6453d4240f6b46c718efa59651239f8519e1523e commit 6453d4240f6b46c718efa59651239f8519e1523e Author: Dmitry Chagin AuthorDate: 2023-07-22 11:03:33 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-22 11:03:33 +0000 vfs: Export exattr methods to reuse by Linuxulator Reviewed by: Differential revision: https://reviews.freebsd.org/D35543 MFC after: 1 month --- sys/kern/vfs_extattr.c | 245 ++++++++++++++++++++++++++++++++++--------------- sys/sys/extattr.h | 22 +++++ 2 files changed, 193 insertions(+), 74 deletions(-) diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 4b2cd920f32b..d5f2101cf2d0 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -49,15 +49,15 @@ __FBSDID("$FreeBSD$"); #include #include -static int kern_extattr_set_path(struct thread *td, const char *path, +static int user_extattr_set_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes, int follow); -static int kern_extattr_get_path(struct thread *td, const char *path, +static int user_extattr_get_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes, int follow); -static int kern_extattr_delete_path(struct thread *td, const char *path, +static int user_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, const char *attrname, int follow); -static int kern_extattr_list_path(struct thread *td, const char *path, +static int user_extattr_list_path(struct thread *td, const char *path, int attrnamespace, void *data, size_t nbytes, int follow); /* @@ -232,25 +232,35 @@ struct extattr_set_fd_args { int sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_set_fd(td, uap->fd, uap->attrnamespace, + attrname, uap->data, uap->nbytes)); +} + +int +kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_SET), &fp); if (error) return (error); - error = extattr_set_vp(fp->f_vnode, uap->attrnamespace, - attrname, uap->data, uap->nbytes, td); + error = extattr_set_vp(fp->f_vnode, attrnamespace, + attrname, data, nbytes, td); fdrop(fp, td); return (error); @@ -269,7 +279,7 @@ int sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { - return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + return (user_extattr_set_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, FOLLOW)); } @@ -286,25 +296,36 @@ int sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { - return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + return (user_extattr_set_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_set_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, void *data, size_t nbytes, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_set_path(td, path, attrnamespace, + attrname, data, nbytes, follow, UIO_USERSPACE)); +} + +int +kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, void *data, size_t nbytes, int follow, + enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); @@ -399,25 +420,35 @@ struct extattr_get_fd_args { int sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_get_fd(td, uap->fd, uap->attrnamespace, + attrname, uap->data, uap->nbytes)); +} + +int +kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_GET), &fp); if (error) return (error); - error = extattr_get_vp(fp->f_vnode, uap->attrnamespace, - attrname, uap->data, uap->nbytes, td); + error = extattr_get_vp(fp->f_vnode, attrnamespace, + attrname, data, nbytes, td); fdrop(fp, td); return (error); @@ -435,7 +466,7 @@ struct extattr_get_file_args { int sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { - return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + return (user_extattr_get_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, FOLLOW)); } @@ -451,25 +482,36 @@ struct extattr_get_link_args { int sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { - return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + return (user_extattr_get_path(td, uap->path, uap->attrnamespace, uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_get_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, void *data, size_t nbytes, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_get_path(td, path, attrnamespace, + attrname, data, nbytes, follow, UIO_USERSPACE)); +} + +int +kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, void *data, size_t nbytes, int follow, + enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); @@ -534,24 +576,34 @@ struct extattr_delete_fd_args { int sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { - struct file *fp; char attrname[EXTATTR_MAXNAMELEN + 1]; - cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); + return (kern_extattr_delete_fd(td, uap->fd, uap->attrnamespace, + attrname)); +} + +int +kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname) +{ + struct file *fp; + cap_rights_t rights; + int error; + + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - error = getvnode_path(td, uap->fd, + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_DELETE), &fp); if (error) return (error); - error = extattr_delete_vp(fp->f_vnode, uap->attrnamespace, + error = extattr_delete_vp(fp->f_vnode, attrnamespace, attrname, td); fdrop(fp, td); return (error); @@ -568,7 +620,7 @@ int sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { - return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + return (user_extattr_delete_path(td, uap->path, uap->attrnamespace, uap->attrname, FOLLOW)); } @@ -583,25 +635,35 @@ int sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { - return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + return (user_extattr_delete_path(td, uap->path, uap->attrnamespace, uap->attrname, NOFOLLOW)); } -static int -kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, +int +user_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, const char *uattrname, int follow) { - struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN + 1]; int error; - AUDIT_ARG_VALUE(attrnamespace); error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return(error); + return (kern_extattr_delete_path(td, path, attrnamespace, + attrname, follow, UIO_USERSPACE)); +} + +int +kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, + const char *attrname, int follow, enum uio_seg pathseg) +{ + struct nameidata nd; + int error; + + AUDIT_ARG_VALUE(attrnamespace); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return(error); @@ -623,33 +685,19 @@ kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, * References: vp must be a valid reference for the duration of the call */ static int -extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, - size_t nbytes, struct thread *td) +extattr_list_vp(struct vnode *vp, int attrnamespace, struct uio *auiop, + struct thread *td) { - struct uio auio, *auiop; size_t size, *sizep; - struct iovec aiov; ssize_t cnt; int error; - if (nbytes > IOSIZE_MAX) - return (EINVAL); - - auiop = NULL; sizep = NULL; cnt = 0; - if (data != NULL) { - aiov.iov_base = data; - aiov.iov_len = nbytes; - auio.uio_iov = &aiov; - auio.uio_iovcnt = 1; - auio.uio_offset = 0; - auio.uio_resid = nbytes; - auio.uio_rw = UIO_READ; - auio.uio_segflg = UIO_USERSPACE; - auio.uio_td = td; - auiop = &auio; - cnt = nbytes; + if (auiop != NULL) { + if (auiop->uio_resid > IOSIZE_MAX) + return (EINVAL); + cnt = auiop->uio_resid; } else sizep = &size; @@ -668,7 +716,7 @@ extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, VOP_UNLOCK(vp); if (auiop != NULL) { - cnt -= auio.uio_resid; + cnt -= auiop->uio_resid; td->td_retval[0] = cnt; } else td->td_retval[0] = size; @@ -685,20 +733,44 @@ struct extattr_list_fd_args { #endif int sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap) +{ + struct uio auio, *auiop; + struct iovec aiov; + + if (uap->data != NULL) { + aiov.iov_base = uap->data; + aiov.iov_len = uap->nbytes; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_resid = uap->nbytes; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_td = td; + auiop = &auio; + } else + auiop = NULL; + + return (kern_extattr_list_fd(td, uap->fd, uap->attrnamespace, + auiop)); +} + +int +kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, + struct uio *auiop) { struct file *fp; cap_rights_t rights; int error; - AUDIT_ARG_FD(uap->fd); - AUDIT_ARG_VALUE(uap->attrnamespace); - error = getvnode_path(td, uap->fd, + AUDIT_ARG_FD(fd); + AUDIT_ARG_VALUE(attrnamespace); + error = getvnode_path(td, fd, cap_rights_init_one(&rights, CAP_EXTATTR_LIST), &fp); if (error) return (error); - error = extattr_list_vp(fp->f_vnode, uap->attrnamespace, uap->data, - uap->nbytes, td); + error = extattr_list_vp(fp->f_vnode, attrnamespace, auiop, td); fdrop(fp, td); return (error); @@ -716,7 +788,7 @@ int sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { - return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + return (user_extattr_list_path(td, uap->path, uap->attrnamespace, uap->data, uap->nbytes, FOLLOW)); } @@ -732,25 +804,50 @@ int sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { - return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + return (user_extattr_list_path(td, uap->path, uap->attrnamespace, uap->data, uap->nbytes, NOFOLLOW)); } static int -kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, +user_extattr_list_path(struct thread *td, const char *path, int attrnamespace, void *data, size_t nbytes, int follow) +{ + struct uio auio, *auiop; + struct iovec aiov; + + if (data != NULL) { + aiov.iov_base = data; + aiov.iov_len = nbytes; + auio.uio_iov = &aiov; + auio.uio_iovcnt = 1; + auio.uio_offset = 0; + auio.uio_resid = nbytes; + auio.uio_rw = UIO_READ; + auio.uio_segflg = UIO_USERSPACE; + auio.uio_td = td; + auiop = &auio; + } else + auiop = NULL; + + return (kern_extattr_list_path(td, path, attrnamespace, + auiop, follow, UIO_USERSPACE)); +} + +int +kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, + struct uio *auiop, int follow, enum uio_seg pathseg) { struct nameidata nd; int error; AUDIT_ARG_VALUE(attrnamespace); - NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, pathseg, path); error = namei(&nd); if (error) return (error); NDFREE_PNBUF(&nd); - error = extattr_list_vp(nd.ni_vp, attrnamespace, data, nbytes, td); + error = extattr_list_vp(nd.ni_vp, attrnamespace, auiop, td); vrele(nd.ni_vp); return (error); diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h index aa47f25985ce..f3ca2a8ea913 100644 --- a/sys/sys/extattr.h +++ b/sys/sys/extattr.h @@ -64,11 +64,33 @@ #ifdef _KERNEL #include +enum uio_seg; +struct uio; struct thread; struct ucred; struct vnode; int extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, struct thread *td, accmode_t accmode); +int kern_extattr_set_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow, enum uio_seg pathseg); +int kern_extattr_set_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes); +int kern_extattr_get_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow, enum uio_seg pathseg); +int kern_extattr_get_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname, void *data, size_t nbytes); +int kern_extattr_delete_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, int follow, + enum uio_seg pathseg); +int kern_extattr_delete_fd(struct thread *td, int fd, int attrnamespace, + const char *attrname); +int kern_extattr_list_path(struct thread *td, const char *path, + int attrnamespace, struct uio *auiop, int follow, + enum uio_seg pathseg); +int kern_extattr_list_fd(struct thread *td, int fd, int attrnamespace, + struct uio *auiop); #else #include From nobody Sat Jul 22 18:23:13 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7ZYF5RyPz4nt8h; Sat, 22 Jul 2023 18:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7ZYF4WFJz3Qfp; Sat, 22 Jul 2023 18:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690050193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCmri2LmiVI4FZWvFFzi+9NrA3kj9LY6F9CxCIUZ1LM=; b=ezIEqNm+51HiKx+YaQKhackvz2X9V+TSywjo4CUWL+ohyTmMu7s4HSy5boYuci29IhgYgp btOtIkAt8nc9+4g9kuH1T4kvNgtM2bZJlca1N4VR2xAZjiDWHZ+OeUrekJgi5AriLsJ/6t BGkM1ehH/0iCmpis7TsgrV4sMIxQrETCBR0REjT1xHjVn8VYs/Dh1Dl5PTEUkvVMEx2PWy sq0WAetcT90VaFIXRMcSZ9akWEmUAWXcQ/Ai12kXzmeFYWXUZa6s157rrX0dP5BA6X8rX+ O+Gvbz/Sn/i+Qfuar6Oe2qSmtcQMqjgGXKXGk0QgheNY0T7W+i+WZvhn5gi6fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690050193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCmri2LmiVI4FZWvFFzi+9NrA3kj9LY6F9CxCIUZ1LM=; b=ZHaCAHr6pFHUzlN2aFdEZ9CQCb/KELL80gcnmUdhsRSzt58Ky1+8fHigIQa0RCHIplN5vv 5aIJDsmYPSYjMINlWksh5f+SZnLhz6xhV5LiQzuUc81Z54lawaTVXJ/mgxs1JGqb/S1hEX xIR5p+ro5Vd81uNp/Q9VMyobPeLNdFMjk/kUuf8wT/g137L6+vpd6eH4LvvG5EzYzCIDm/ mKVcyR1keZImVgsOdF8Wq4Y/LrRiDBbOvx6wadO0JV+FdXiHPchzlr+K7Bm854nDDKKTvn AfXtI6KvvZyfRDykQArIN9Zth+lQQ8ncWFMiolvnsf2yGOOKtE3wJ7JsgX6wBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690050193; a=rsa-sha256; cv=none; b=xZDDPeoQYjyXLfvtvHU/w2qOkn737s1UVTw3z1O2o4QFQmR3S4Tkww0q6Tu2QLleqNp4XX Dizf1ZyrYXe+wHQLckLI+GJXb3WWaWqV/wPLDAYBIQKQarLHnRz4pBxHivf0xZyHZoH3vX lBmhWZci6/j7+hIvKtE9LXxqQgWDp5ieDFVKdQYmzTbjS6WVq6oZw5WdyUQYHCJqd1eZy8 5oGKu8HK82IU4/IWbLqpYXRP0RB/eqbd6z3cHmSNO1s1f0bHsh3bsj7rmsn2fat9DMg0wn ZN/ATn/tAGeNe6Z4wYMfWgdYa9yqVmHsPnuTsjnyE9bLrDdaHxUGNc4E1qJ5SA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7ZYF2mfGz14fp; Sat, 22 Jul 2023 18:23:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MINDf1075367; Sat, 22 Jul 2023 18:23:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MIND9w075366; Sat, 22 Jul 2023 18:23:13 GMT (envelope-from git) Date: Sat, 22 Jul 2023 18:23:13 GMT Message-Id: <202307221823.36MIND9w075366@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 50a4d8b34570 - stable/13 - depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 50a4d8b345705ff2180c150903228f99b08b5674 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=50a4d8b345705ff2180c150903228f99b08b5674 commit 50a4d8b345705ff2180c150903228f99b08b5674 Author: Dimitry Andric AuthorDate: 2023-07-10 22:50:09 +0000 Commit: Dimitry Andric CommitDate: 2023-07-22 18:22:34 +0000 depend-cleanup.sh: handle 32-bit dependencies having no 64-bit equivalent For example with the recent removal of ffs.S for 32-bit arm and i386, the egrep in clean_dep() did not find any files to remove, even if you added a "clean_dep lib/libc ffs S" line. This is because it will never find the ffs.S filename in the 64-bit .depend files for libc. Split the searching and removing of 32-bit dependencies and objects into a separate part to cope with this. This can be used similarly later on, for other bitnesses. MFC after: 3 days (cherry picked from commit 7ba8cc9b7b6bdea142d7ecb82c7d3a9b095e967d) --- tools/build/depend-cleanup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh index 58a7c72b2082..92a085067c2b 100755 --- a/tools/build/depend-cleanup.sh +++ b/tools/build/depend-cleanup.sh @@ -33,7 +33,11 @@ clean_dep() echo "Removing stale dependencies and objects for $2.$3"; \ rm -f \ "$OBJTOP"/$1/.depend.$2.* \ - "$OBJTOP"/$1/$2.*o \ + "$OBJTOP"/$1/$2.*o + fi + if egrep -qw "$2\.$3" "$OBJTOP"/obj-lib32/$1/.depend.$2.*o 2>/dev/null; then + echo "Removing 32-bit stale dependencies and objects for $2.$3" + rm -f \ "$OBJTOP"/obj-lib32/$1/.depend.$2.* \ "$OBJTOP"/obj-lib32/$1/$2.*o fi From nobody Sat Jul 22 19:23:09 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R7btQ0zRhz4pVqW; Sat, 22 Jul 2023 19:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R7btQ0MX2z40Mj; Sat, 22 Jul 2023 19:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690053790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEAXcfDfHLIOXpzMVkZoocnVBy06X0xVvxt0M4KMcxI=; b=czVZI0xr+qKH2iNHSbXQYbwGynVkSWx78keV7rlcNDOC7CwwwRTT5Y2WmkX19I90Tc6Hb0 npfrQO47uyJwIPE6jRZWiW0YFV6lgHcBFjv/8h5ljLkwfuaHI/SGSg7T7qe6VJqhOQ7Vea EgW4h4+ZtJhCwk9CMsHq1wjN8BbgW3meJml0TZpHhENQie0vkDSpVKZP0TNSrPj3PfFHbb siTIC03aqqqx6B6lOl5oYAV3FjH+2TrVkywQDvBi409PwrapaGPP1o3BYfVxU/ZmDnw6fy s6IKlUeUcpPFhvpZbRib9zAFvo6f5UN9HavyP7ucDKkkLRBjfSrBmMjnog9alw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690053790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yEAXcfDfHLIOXpzMVkZoocnVBy06X0xVvxt0M4KMcxI=; b=SD7M4l2DgRd0JIIQqK0dxdNJCylAKj32XVYEgtw4crn7MtBdiKF2mhdXtdjpvxB1J4fU2Z w9uD1/JLmcU3TMAyNecWI6038n6O5dT/EKMaD6BOY0pr/Cs3f8dvQQ2R4KAzIxCT0M+xGd imkKilDs6rZ710F5yn1PINfSZSMQwLHhrHV10bx1IRpDfLr8LuwQWQeHpiYBu2lR2Te6S1 QB0nIvHYjrWS2dGCQZru32L+AmZntmtod2qFgc4TQcmixUED15fdOXcros4n18Xgm6QlRB ON/zDlWVCqkEJpQSMro/xtTNH8RVsJVeUHZQ+DN8aNkGwbR7B2qDzhA5ORxsaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690053790; a=rsa-sha256; cv=none; b=ovq+lmhgjGhb803euSnQdVQZiGNHxj1jOOdeaHYFsTqd5Fpdjb24fK5vOrZDofnMD6hj3K 6RuLXKHwBaMpyO7pUNOz0N0U375Dq7ohcnS5Qy7cKAGeC2t/M9Q4SqM6CI634dhNZMpVxr 6C4qYekiGP/uMh32LvDs6MEG5LrUQQxQMU1AV+wWDiwWDCM6McVSlax/m5PvW/SqWavS8s OVl6wCw7vjwyN0LfqL3XUvC5K2AQtLiHcBwmkYWrzfzWgk153WslQVn6lyBtKRtc/clh38 pfP3F7tRFkPOFxMLeD0AlxFSjqrS613XRKCaLjPYi+eix3DS+/XXd6rGKrwKIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R7btP6XSFz165L; Sat, 22 Jul 2023 19:23:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36MJN9mG075163; Sat, 22 Jul 2023 19:23:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36MJN97g075162; Sat, 22 Jul 2023 19:23:09 GMT (envelope-from git) Date: Sat, 22 Jul 2023 19:23:09 GMT Message-Id: <202307221923.36MJN97g075162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 918c25677d88 - main - e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 918c25677d882a901696672bd4d39b62faa56dfa Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=918c25677d882a901696672bd4d39b62faa56dfa commit 918c25677d882a901696672bd4d39b62faa56dfa Author: Kevin Bowling AuthorDate: 2023-07-22 18:33:27 +0000 Commit: Kevin Bowling CommitDate: 2023-07-22 19:13:43 +0000 e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes * em(4) obey administrative ifcaps for using hwcsum offload * em(4) obey administrative ifcaps for hw vlan receive tagging * em(4) add additional TSO6 ifcap, but disabled by default as is TSO4 * lem(4) obey administrative ifcaps for using hwcsum offload * lem(4) add support for hw vlan receive tagging * lem(4) Add ifcaps for TSO offload experimentation, but disabled by default due to errata and possibly missing txrx code. * lem(4) disable HWCSUM ifcaps by default on 82547 due to errata around full duplex links. It may still be administratively enabled. Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30072 --- sys/dev/e1000/em_txrx.c | 15 +++++++------ sys/dev/e1000/if_em.c | 57 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c index 47f9b187aa14..069a1c00a4b2 100644 --- a/sys/dev/e1000/em_txrx.c +++ b/sys/dev/e1000/em_txrx.c @@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) i++; } while (!eop); - /* XXX add a faster way to look this up */ - if (sc->hw.mac.type >= e1000_82543) + if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(status, errors, ri); - if (status & E1000_RXD_STAT_VP) { - ri->iri_vtag = le16toh(rxd->special); + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + status & E1000_RXD_STAT_VP) { + ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK); ri->iri_flags |= M_VLANTAG; } @@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) uint16_t len; uint32_t pkt_info; - uint32_t staterr = 0; + uint32_t staterr; bool eop; int i, cidx; - i = 0; + staterr = i = 0; cidx = ri->iri_cidx; do { @@ -739,7 +739,8 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri) if (scctx->isc_capenable & IFCAP_RXCSUM) em_receive_checksum(staterr, staterr >> 24, ri); - if (staterr & E1000_RXD_STAT_VP) { + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + staterr & E1000_RXD_STAT_VP) { ri->iri_vtag = le16toh(rxd->wb.upper.vlan); ri->iri_flags |= M_VLANTAG; } diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 0b664b155872..0da1f0a2dc67 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -781,19 +781,22 @@ em_set_num_queues(if_ctx_t ctx) return (maxqueues); } -#define LEM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER - -#define EM_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO - -#define IGB_CAPS \ - IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ - IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ - IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\ +#define LEM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO| IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define EM_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ + IFCAP_TSO6 + +#define IGB_CAPS \ + IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \ + IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \ + IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \ IFCAP_TSO6 /********************************************************************* @@ -897,7 +900,7 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; /* - * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO} + * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} * by default as we don't have workarounds for all associated * silicon errata. E. g., with several MACs such as 82573E, * TSO only works at Gigabit speed and otherwise can cause the @@ -912,8 +915,9 @@ em_if_attach_pre(if_ctx_t ctx) * work for a few MACs of this class - at least when sticking * with Gigabit - in which case users may enable TSO manually. */ - scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO; + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; /* * We support MSI-X with 82574 only, but indicate to iflib(4) * that it shall give MSI at least a try with other devices. @@ -929,9 +933,25 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_rxqsizes[0] = roundup2((scctx->isc_nrxd[0] + 1) * sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); scctx->isc_txd_size[0] = sizeof(struct e1000_tx_desc); scctx->isc_rxd_size[0] = sizeof(struct e1000_rx_desc); - scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP; scctx->isc_txrx = &lem_txrx; - scctx->isc_capabilities = LEM_CAPS; + scctx->isc_tx_tso_segments_max = EM_MAX_SCATTER; + scctx->isc_tx_tso_size_max = EM_TSO_SIZE; + scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE; + scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS; + /* + * For LEM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6} + * by default as we don't have workarounds for all associated + * silicon errata. TSO4 may work on > 82544 but its status + * is unknown by the authors. Please report any success or failures. + */ + scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6); + scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO | + CSUM_IP6_TCP | CSUM_IP6_UDP; + + /* 8254x SDM4.0 page 33 - FDX requirement on these chips */ + if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2) + scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); + if (hw->mac.type < e1000_82543) scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); /* 82541ER doesn't do HW tagging */ @@ -939,7 +959,6 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities &= ~IFCAP_VLAN_HWTAGGING; /* INTx only */ scctx->isc_msix_bar = 0; - scctx->isc_capenable = scctx->isc_capabilities; } /* Setup PCI resources */