From nobody Tue Oct 8 00:31:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMxm76SLCz5YgSs; Tue, 08 Oct 2024 00:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMxm75SVzz46qM; Tue, 8 Oct 2024 00:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728347511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ut4eRiSH7expnBBDbkFgV1z4pTSSKO60koaTdGgaOuw=; b=pq7UZ21XjR2RFoUrIqb8cH2AZsCX81UKP6vMjA9iGQ8Z7xqcWFzbYF88aZLrZCyIiQm6yh WSzjY0jWRdNsLkvFq8r9xbeFCWzQ39A4MNOucJLd6bBNmX81h1Heqv77O3oZPz1Zl5iaXf NTPhTL77C9hjPyJUC/UjnCTCI6xDJ2jlvBXL2BRk2c6hiNyZfAEWCooswZfA0N2JR2ktzi JW8sLTcDLTy4mBXtD++ZZVik0jwLCt3g3VbeyCR0RNaqtTQyXxxkaXj6H2Jgpjt7T39TFq C0L49jm9ngrxngotSOFbUcLAaeU/ZF8kWqk1X9kPhp5kLDBKXtnJI/WsJdZU+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728347511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ut4eRiSH7expnBBDbkFgV1z4pTSSKO60koaTdGgaOuw=; b=ldDrnZ7uLJ1bY8ni4vD9jNcEbgAtG9AEqE2LYHMvSnBJCV/J02/oV5aAEBQ1VbbB8PiVBO anEXUHWBCjknHnnYgrKMQGm93BotzJP1HtVjS6TQG0o3I+5JNcMTUX6KBi4UgwWuU2yssq vrqXnLGlSBIQtgXkoMS2oK63zCph/DBgHKAqZV+7EnKLhQ6r5sbq3INFjrnZKFXxL5oJ15 WRFzoeql1PQXwBBfLntguzoEjv1QsfpyewSB/kS8olnR69bhhLaKGBA4N9p4/eKX8EKukj Y2IVYqZ25GjWO/8hPbPPvaZykIIADKGxeVKknDr+Yu3NuyheXubntOmfnWBpLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728347511; a=rsa-sha256; cv=none; b=kTTWf67zPR7iLsX+99gUQsJArUJUuN6sfFTBo9YiLVYqHeKqWhEiy+gKsN7bl8HXflWiBj sSCqng8qTLTCn7R/9MhZxSi92bGum8DIL1337UJz4SUQcxeHrItR3O8EFfCMi1eWOmEA2J rWlNVq58qJIaNOiEos7xPMB3Vzqcl7Sq+C11MvWC17gswxNdCeNt51V5jg1Pnx/5C9ddsd EeaSf3EkOMgcFyIjWWDlEXwqJw1oLyo7vDjYOcYl4vRPBewbi7M89QEVPF7cS1m0Cu6egk IQIHXBTIADa2PSHWBJucxeS1PXMMsStb/2QaN0lEIUWyYwB1gP1fXpl7RnEzRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMxm753Lgz17R1; Tue, 8 Oct 2024 00:31:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4980Vpkn082700; Tue, 8 Oct 2024 00:31:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4980Vp1a082696; Tue, 8 Oct 2024 00:31:51 GMT (envelope-from git) Date: Tue, 8 Oct 2024 00:31:51 GMT Message-Id: <202410080031.4980Vp1a082696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone <jrm@FreeBSD.org> Subject: git: 26f21a6494b4 - stable/14 - libpcap: Update to 1.10.5 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 26f21a6494b4cf791bc45d7ed3138bfab9f8f854 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=26f21a6494b4cf791bc45d7ed3138bfab9f8f854 commit 26f21a6494b4cf791bc45d7ed3138bfab9f8f854 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2024-09-14 17:09:34 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2024-10-07 17:27:04 +0000 libpcap: Update to 1.10.5 Changes: https://git.tcpdump.org/libpcap/blob/bbcbc9174df3298a854daee2b3e666a4b6e5383a:/CHANGES Reviewed by: emaste Obtained from: https://www.tcpdump.org/release/libpcap-1.10.5.tar.gz Sponsored by: The FreeBSD Foundation (cherry picked from commit afdbf109c6a661a729938f68211054a0a50d38ac) (cherry picked from commit ecb75be376a3e18d3e4836b6ee07015264784694) (cherry picked from commit f0bcebe67ef6cf9f104535d6cd9f151c1b61dd6a) (cherry picked from commit 34aa6f2c2db5cc9655f201a1ef01adbb9fb484d5) --- contrib/libpcap/CHANGES | 181 +- contrib/libpcap/CMakeLists.txt | 1021 +- contrib/libpcap/CREDITS | 17 + contrib/libpcap/INSTALL.md | 84 +- contrib/libpcap/Makefile.in | 168 +- contrib/libpcap/TODO | 5 - contrib/libpcap/VERSION | 2 +- contrib/libpcap/aclocal.m4 | 227 +- contrib/libpcap/atmuni31.h | 2 +- contrib/libpcap/autogen.sh | 25 + contrib/libpcap/bpf_dump.c | 2 - contrib/libpcap/bpf_filter.c | 16 +- contrib/libpcap/bpf_image.c | 6 +- contrib/libpcap/charconv.c | 4 +- contrib/libpcap/cmake/Modules/Finddpdk.cmake | 2 +- contrib/libpcap/cmakeconfig.h.in | 6 +- contrib/libpcap/config.guess | 62 +- contrib/libpcap/config.h.in | 28 +- contrib/libpcap/config.sub | 230 +- contrib/libpcap/configure | 10815 ++++++++++--------- contrib/libpcap/configure.ac | 145 +- contrib/libpcap/diag-control.h | 174 +- contrib/libpcap/dlpisubs.c | 22 +- contrib/libpcap/doc/README.haiku.md | 57 + contrib/libpcap/doc/README.hpux | 2 +- .../doc/{README.Win32.md => README.windows.md} | 0 contrib/libpcap/etherent.c | 6 +- contrib/libpcap/extract.h | 2 +- contrib/libpcap/fad-getad.c | 30 +- contrib/libpcap/fad-gifc.c | 24 +- contrib/libpcap/fad-glifc.c | 28 +- contrib/libpcap/fmtutils.c | 59 +- contrib/libpcap/fmtutils.h | 10 +- contrib/libpcap/ftmacros.h | 4 +- contrib/libpcap/gencode.c | 596 +- contrib/libpcap/gencode.h | 4 +- contrib/libpcap/grammar.y.in | 140 +- contrib/libpcap/install-sh | 689 +- contrib/libpcap/missing/asprintf.c | 8 +- contrib/libpcap/missing/strlcat.c | 6 +- contrib/libpcap/missing/strlcpy.c | 6 +- contrib/libpcap/missing/strtok_r.c | 4 +- contrib/libpcap/missing/win_asprintf.c | 6 +- contrib/libpcap/mkdep | 28 +- contrib/libpcap/msdos/makefile | 2 +- contrib/libpcap/msdos/makefile.dj | 4 +- contrib/libpcap/msdos/makefile.wc | 6 +- contrib/libpcap/msdos/pktdrvr.c | 2 +- contrib/libpcap/msdos/pktdrvr.h | 2 +- contrib/libpcap/msdos/readme.dos | 4 +- contrib/libpcap/nametoaddr.c | 57 +- contrib/libpcap/nlpid.h | 2 +- contrib/libpcap/optimize.c | 34 +- contrib/libpcap/pcap-airpcap.c | 53 +- contrib/libpcap/pcap-bpf.c | 417 +- contrib/libpcap/pcap-bt-linux.c | 56 +- contrib/libpcap/pcap-bt-monitor-linux.c | 38 +- contrib/libpcap/pcap-common.c | 405 +- contrib/libpcap/pcap-config.1 | 108 +- contrib/libpcap/pcap-config.in | 11 +- contrib/libpcap/pcap-dag.c | 103 +- contrib/libpcap/pcap-dbus.c | 12 +- contrib/libpcap/pcap-dlpi.c | 72 +- contrib/libpcap/pcap-dos.c | 22 +- contrib/libpcap/pcap-dpdk.c | 32 +- contrib/libpcap/pcap-enet.c | 6 +- contrib/libpcap/pcap-filter.manmisc.in | 15 +- contrib/libpcap/pcap-haiku.c | 504 + contrib/libpcap/pcap-haiku.cpp | 305 - contrib/libpcap/pcap-int.h | 187 +- contrib/libpcap/pcap-libdlpi.c | 26 +- contrib/libpcap/pcap-linux.c | 654 +- contrib/libpcap/pcap-netfilter-linux.c | 61 +- contrib/libpcap/pcap-netmap.c | 24 +- contrib/libpcap/pcap-new.c | 31 +- contrib/libpcap/pcap-nit.c | 44 +- contrib/libpcap/pcap-npf.c | 296 +- contrib/libpcap/pcap-null.c | 10 +- contrib/libpcap/pcap-pf.c | 59 +- contrib/libpcap/pcap-rdmasniff.c | 16 +- contrib/libpcap/pcap-rpcap-int.h | 75 - contrib/libpcap/pcap-rpcap.c | 199 +- contrib/libpcap/pcap-savefile.manfile.in | 64 +- contrib/libpcap/pcap-septel.c | 14 +- contrib/libpcap/pcap-sita.c | 42 +- contrib/libpcap/pcap-sita.html | 4 +- contrib/libpcap/pcap-snf.c | 46 +- contrib/libpcap/pcap-snit.c | 57 +- contrib/libpcap/pcap-snoop.c | 54 +- contrib/libpcap/pcap-tc.c | 66 +- contrib/libpcap/pcap-tstamp.manmisc.in | 7 +- contrib/libpcap/pcap-usb-linux-common.c | 130 - contrib/libpcap/pcap-usb-linux-common.h | 107 +- contrib/libpcap/pcap-usb-linux.c | 95 +- contrib/libpcap/pcap-util.c | 287 +- contrib/libpcap/pcap-util.h | 6 +- contrib/libpcap/pcap.3pcap.in | 24 +- contrib/libpcap/pcap.c | 439 +- contrib/libpcap/pcap/can_socketcan.h | 25 +- contrib/libpcap/pcap/dlt.h | 75 +- contrib/libpcap/pcap/funcattrs.h | 106 +- contrib/libpcap/pcap/namedb.h | 27 +- contrib/libpcap/pcap/nflog.h | 2 +- contrib/libpcap/pcap/pcap-inttypes.h | 2 +- contrib/libpcap/pcap/pcap.h | 89 +- contrib/libpcap/pcap/sll.h | 1 + contrib/libpcap/pcap/socket.h | 56 +- contrib/libpcap/pcap/usb.h | 6 + contrib/libpcap/pcap_activate.3pcap | 12 +- contrib/libpcap/pcap_breakloop.3pcap | 2 +- contrib/libpcap/pcap_compile.3pcap.in | 3 +- contrib/libpcap/pcap_create.3pcap | 12 +- contrib/libpcap/pcap_dump.3pcap | 3 +- contrib/libpcap/pcap_findalldevs.3pcap | 43 +- contrib/libpcap/pcap_init.3pcap | 15 +- contrib/libpcap/pcap_lookupdev.3pcap | 10 +- contrib/libpcap/pcap_lookupnet.3pcap | 21 +- contrib/libpcap/pcap_loop.3pcap | 24 +- contrib/libpcap/pcap_next_ex.3pcap | 11 +- contrib/libpcap/pcap_offline_filter.3pcap | 3 +- contrib/libpcap/pcap_open_live.3pcap | 30 +- contrib/libpcap/pcap_open_offline.3pcap.in | 13 +- contrib/libpcap/pcap_set_tstamp_precision.3pcap.in | 3 +- contrib/libpcap/pcap_setnonblock.3pcap | 40 +- contrib/libpcap/pcap_strerror.3pcap | 14 +- contrib/libpcap/portability.h | 27 +- contrib/libpcap/ppp.h | 2 +- contrib/libpcap/rpcap-protocol.c | 4 +- contrib/libpcap/rpcap-protocol.h | 6 +- contrib/libpcap/rpcapd/CMakeLists.txt | 29 +- contrib/libpcap/rpcapd/Makefile.in | 4 +- contrib/libpcap/rpcapd/config_params.h | 2 +- contrib/libpcap/rpcapd/daemon.c | 70 +- contrib/libpcap/rpcapd/daemon.h | 4 +- contrib/libpcap/rpcapd/fileconf.c | 18 +- contrib/libpcap/rpcapd/log.c | 2 - contrib/libpcap/rpcapd/rpcapd-config.manfile.in | 12 +- contrib/libpcap/rpcapd/rpcapd.c | 62 +- contrib/libpcap/rpcapd/rpcapd.manadmin.in | 54 +- contrib/libpcap/rpcapd/win32-svc.c | 2 +- contrib/libpcap/savefile.c | 38 +- contrib/libpcap/scanner.l | 171 +- contrib/libpcap/sf-pcap.c | 150 +- contrib/libpcap/sf-pcapng.c | 24 +- contrib/libpcap/sockutils.c | 123 +- contrib/libpcap/sockutils.h | 26 +- contrib/libpcap/sslutils.c | 4 +- contrib/libpcap/sslutils.h | 10 +- contrib/libpcap/testprogs/Makefile.in | 2 +- contrib/libpcap/testprogs/filtertest.c | 6 +- contrib/libpcap/testprogs/findalldevstest-perf.c | 2 - contrib/libpcap/testprogs/findalldevstest.c | 8 +- contrib/libpcap/testprogs/valgrindtest.c | 4 +- contrib/libpcap/thread-local.h | 72 + contrib/pf/pflogd/pflogd.c | 11 + lib/libpcap/Makefile | 1 - lib/libpcap/config.h | 4 +- 157 files changed, 12381 insertions(+), 9570 deletions(-) diff --git a/contrib/libpcap/CHANGES b/contrib/libpcap/CHANGES index c574a278064f..bf8701c829a0 100644 --- a/contrib/libpcap/CHANGES +++ b/contrib/libpcap/CHANGES @@ -1,3 +1,168 @@ +Friday, August 30, 2024 / The Tcpdump Group + Summary for 1.10.5 libpcap release + Source code: + Spell WirelessHART details properly. + Mark pcap_vasprintf() as printf-like. + Finalize moving of bpf_filter.c. (GH #1166) + Remove an unneeded argument from gen_mcode6(). + Don't do some Berkeley YACC workarounds with YACC releases not + requiring them. + Use correct data types rather than int in some cases. + Squelch compiler warning in grammar.c. + Fix findalldevtest compilation if IPv6 isn't enabled. + Rename helper routines for pcap modules to have names beginning with + pcapint_, to avoid namespace collisions for code linking statically + with libpcap. + Avoid casting hack for the Windows cleanup-on-exit routine. + Use %zu format for one case of printing a size_t. + Fix some Coverity errors. + Fix availabilities of some functions to match reality. + pcap: make the seconds and microseconds/nanoseconds fields unsigned. + Remove the unused pcap-rpcap-int.h header file. + Thread safety: + Make some static variables thread-local; fixes issue #1174. + Packet filtering: + Improve reporting of some invalid filter expressions. + Return an error from pcap_compile() if the scanner fails to initialize. + Optimizer fix from Archit Shah to recompute dominators after + moving code (#976); fixes #945 (although the resulting filter + isn't empty). + Optimizer fix from Archit Shah to mark value as unknown when store + of that value is deleted (#972); fixes #143, #434, #436, #437, + and #1076. + Linux: + Properly return warnings. + Don't use DLT_LINUX_SLL2 for anything other than the "any" device. + Avoid 32-bit unsigned integer overflow in USB captures. Fixes + issues #1134 and #1205. + Fix a file descriptor leak. + Properly report warnings about unknown ARPHRD_ types. + Fix DLT_CAN_SOCKETCAN handling of CAN FD. + Add CAN XL support to DLT_CAN_SOCKETCAN. + Clean up the code that sets the "real" ("original") length for + isochronous USB transfers. + Avoid unnecessary blocking on recvmsg() in the Bluetooth monitor and + Bluetoth modules. + Solaris: + Handle BPF returning ESRCH for unknown devices. + List the "any" device if it's supported. + Report {non-existent zone}/{interface} errors appropriately. + Allow attaching to links owned by a non-global zone. (Based on + pull request #1202.) + Fix AF_LINK handling on illumos. + macOS: + Redid the availability macros to be closer to what Apple's doing + in recent SDKs, including tagging pcap-namedb.h routines. + Fix the install name of the installed shared library to have a + full path when building with CMake. + Fix universal builds. + Haiku: + Convert the module to C. Fixes issue #1114. + Address a few compiler warnings. Fixes issue #1114. + Fix various build problems. Fixes issue #1114. + Report non-existent devices correctly. + Fix handling of packet statistics. + Fix packet timestamping. + Fix packet filtering with low snaplen. + Improve connection status reporting. + Add support for promiscuous mode. + Detect DLTs and loopback capture support at run time. + Report IEEE 802.11 as PCAP_IF_WIRELESS. + Windows: + Fix internal handling of "not supported" error codes from NPF. + Work around a bug in Npcap 1.00 in case of driver version mismatch. + Don't call WSACleanup() when handling a failed WSAStartup(). + BSD, macOS, AIX, Solaris 11, Linux: + Add a new error PCAP_ERROR_CAPTURE_NOTSUP, for use if a capture + mechanism is not present, in the hopes that, for example, + attempts to capture on Windows Services for Linux 1, in which + the NT kernel attempts to simulate Linux system calls but does + not support packet sockets, can get an error that better + indicates the underlying problem. + AirPcap: + Format an error message if we run out of memory. + nflog: + Fix count of dropped packets. + Make sure we don't overflow when rounding up the TLV length. + rpcap: + Handle routines removed in at least some OpenSSL libraries. + CVE-2023-7256: Clean up sock_initaddress() and its callers to avoid + double frees in some cases. + Don't define SOCKET ourselves; instead, define PCAP_SOCKET as int + on UN*Xes and as SOCKET on Windows. + CVE-2024-8006: Fix pcap_findalldevs_ex() not to crash if passed a + file:// URL with a path to a directory that cannot be opened. + Savefiles: + Handle DLT_/LINKTYPE_ mapping better, to handle some + OpenBSD-specific link types better. + Treat if_tsoffset as signed in pcapng files, as the spec says. + Don't try to fix the "real" length for isochronous USB + transfers if the number of USB descriptors is too large. + Reject pcap files where one of the reserved fields in the + "link-layer type plus other stuff" is non-zero. + Building and testing: + Add a configure option to help debugging (--enable-instrument-functions). + Improved tests and error reporting for uses of pkg-config, and + improve help message. + Fix Haiku build. + With CMake, install headers in CMAKE_INSTALL_INCLUDEDIR rather + than just include. + Build libpcap.a before building test programs. + Print address family numerically, as well as symbolically, + in findalldevstest. + Fail with suggestions, rather than failing over to no capture + support, if no capture mechanism was found. Fixes issue #1016. + Don't indent comments in Make, as that may cause them not to be + recognized as comments. + Don't check for libssl if we aren't going to use it. + Better handle enabling and disabling of sanitizers. Fixes issue + #1171. + CMakeLists.txt: Print "Symlinking: /some/path to ..." conditionally. + Evaluate CMAKE_INSTALL_PREFIX at install time. + cmake: Update the minimum required version to 2.8.12 (except Windows). + cmake: suppress CMP0042 OLD deprecated warning. + Makefile.in: Add the releasecheck target. + Cirrus CI: Add the "make releasecheck" command in the Linux task. + Makefile.in: Add the whitespacecheck target. + Cirrus CI: Run the "make whitespacecheck" command in the Linux task. + Autoconf: Update config.{guess,sub}, timestamps 2024-01-01. + Autoconf: Update the install-sh script to the 2020-11-14.01 version. + Compile with '-Wnull-pointer-subtraction', + '-Wunused-but-set-parameter', and '-Wunused-but-set-variable' in + devel mode if supported. + Don't ignore spaces between CMAKE_C_FLAGS and DPDK_C_FLAGS with + CMake. + Use noreturn and __format__ with XL C 7.0 and later. + Check for the same -W flags in autotools and CMake. + Autoconf: Add autogen.sh, remove configure and config.h.in and put + these generated files in the release tarball. + Autoconf: Get the size of a time_t. + Fix propagation of cc_werr_cflags() output. + Makefile.in(s): Fix the depend target. + mkdep: Exit with a non-zero status if a command fails. + Fix HCI_CHANNEL_MONITOR detection with musl libc. + Extend "make shellcheck" onto mkdep too. + Add initial support for building with TinyCC. + Address all known compiler warnings specific to illumos, Linux, NetBSD, + Solaris and Sun C; in CI expect warnings specific to TinyCC only. + Documentation: + Update and fix pcap-filter man page. + Add a README.haiku.md file. + Document pcap-config better. + Man page formatting and prose fixes. + Rename doc/README.Win32.md to doc/README.windows.md. + Update pcap-savefile man page to match the Internet-Draft for + pcap. + Fix CMake issues for target used by other projects. + Explain "any" device better in pcap_open_live(3PCAP). + Update INSTALL.md. + Note in man pages that errbuf arguments must point to an error + buffer. + Note that if pcap_findalldevs() fails it sets *alldevsp to NULL; + there's no devices list to free. + Explain "other addresses" in pcap_findalldevs(3PCAP). + Document pcap_lookupnet(3PCAP) a bit better. + Friday, April 7, 2023 / The Tcpdump Group Summary for 1.10.4 libpcap release Source code: @@ -58,7 +223,7 @@ Saturday, December 31, 2022 / The Tcpdump Group when reading a LINKTYPE_PFLOG file. Put CAN ID field in CAN pseudo-headers for LINUX_SLL2, as we do for LINUX_SLL. - Fix inorrectly-computed "real" length for isochronous USB + Fix incorrectly-computed "real" length for isochronous USB transfers when reading savefiles. Don't crash if pcap_can_set_rfmon() is called. Fix pcap_offline_read() loop. @@ -139,7 +304,7 @@ Saturday, December 31, 2022 / The Tcpdump Group Return an error if the driver reports 0 timestamp modes supported. Close the ADAPTER handle for some errors in pcap_create_interface(). - Get rid of old umaintained VS project files. + Get rid of old unmaintained VS project files. Fix deprecation warning for pcap_handle(). Npcap is now at npcap.com, not npcap.org. Make sure "no such device" and "no permission to open device" @@ -307,7 +472,7 @@ Tuesday, December 29, 2020 Remove (unused) SITA support Capture file reading: Correctly handle pcapng captures with more than one IDB with a - snspshot length greater than the supported maximum + snapshot length greater than the supported maximum Capture file writing: Create the file in pcap_dump_open_append() if it doesn't exist Packet filtering: @@ -421,7 +586,7 @@ Tuesday, December 29, 2020 isn't called Fix compilation on Cygwin/MSYS Add pcap_handle(), and deprecate pcap_fileno() - Report PCAP_ERROR_NO_SUCH_DEVICE for a non-existent device + Report PCAP_ERROR_NO_SUCH_DEVICE for a nonexistent device Return an appropriate error message for device removed or device unusable due to a suspend/resume Report a warning for unknown NdisMedium types @@ -503,7 +668,7 @@ Sunday, July 22, 2018 Windows with WinPcap/Npcap (GitHub issue #824) Have pcap_dump_open_append() create the dump file if it doesn't exists (GitHub issue #247) - Fix the maxmum snapshot length for DLT_USBPCAP + Fix the maximum snapshot length for DLT_USBPCAP Use -fPIC when building for 64-bit SPARC on Linux (GitHub issue #837) Fix CMake 64-bit library installation directory on some Linux distributions @@ -668,7 +833,7 @@ Wednesday Nov. 12, 2014 guy@alum.mit.edu/mcr@sandelman.ca Monday Aug. 12, 2014 guy@alum.mit.edu Summary for 1.6.2 libpcap release - Don't crash on filters testing a non-existent link-layer type + Don't crash on filters testing a nonexistent link-layer type field. Fix sending in non-blocking mode on Linux with memory-mapped capture. @@ -956,7 +1121,7 @@ Mon. October 27, 2008. ken@netfunctional.ca. Summary for 1.0.0 libpcap rele Autogenerate VERSION numbers better Mon. September 10, 2007. ken@xelerance.com. Summary for 0.9.8 libpcap release - Change build process to put public libpcap headers into pcap subir + Change build process to put public libpcap headers into pcap subdir DLT: Add value for IPMI IPMB packets DLT: Add value for u10 Networks boards Require <net/pfvar.h> for pf definitions - allows reading of pflog formatted @@ -1285,7 +1450,7 @@ v0.2.1 Sun Jul 14 03:02:26 PDT 1996 (steve@research.oknet.com) - Fixed to handle raw ip addresses such as 0.0.0.1 without "left - justifing" + justifying" - Add "sca" keyword (for DEC cluster services) as suggested by Terry Kennedy (terry@spcvxa.spc.edu) diff --git a/contrib/libpcap/CMakeLists.txt b/contrib/libpcap/CMakeLists.txt index 58c5159905d0..9012ef41769f 100644 --- a/contrib/libpcap/CMakeLists.txt +++ b/contrib/libpcap/CMakeLists.txt @@ -2,9 +2,26 @@ if(WIN32) # # We need 3.12 or later, so that we can set policy CMP0074; see # below. + # cmake_minimum_required(VERSION 3.12) else(WIN32) - cmake_minimum_required(VERSION 2.8.6) + # + # For now: + # + # if this is a version of CMake less than 3.5, require only + # 2.8.12, just in case somebody is configuring with CMake + # on a "long-term support" version # of some OS and that + # version supplies an older version of CMake; + # + # otherwise, require 3.5, so we don't get messages warning + # that support for versions of CMake lower than 3.5 is + # deprecated. + # + if(CMAKE_VERSION VERSION_LESS "3.5") + cmake_minimum_required(VERSION 2.8.12) + else() + cmake_minimum_required(VERSION 3.5) + endif() endif(WIN32) # @@ -12,8 +29,15 @@ endif(WIN32) # neither do we with autotools; don't do so with CMake, either, and # suppress warnings about that. # +# Setting CMAKE_MACOSX_RPATH to FALSE uses the old behavior, +# but removes the POLICY CMP0042 OLD deprecated warning. +# See https://cmake.org/cmake/help/latest/policy/CMP0042.html +# +if (NOT DEFINED CMAKE_MACOSX_RPATH) + set(CMAKE_MACOSX_RPATH FALSE) +endif() if(POLICY CMP0042) - cmake_policy(SET CMP0042 OLD) + cmake_policy(SET CMP0042 NEW) endif() # @@ -47,20 +71,52 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) # -# We only need a C++ compiler for Haiku; all code except for its -# pcap module is in C. +# We explicitly indicate what languages are used in libpcap to avoid +# checking for a C++ compiler. +# +# One reason to avoid that check is that there's no need to waste +# configuration time performing it. +# +# Another reason is that: +# +# CMake will try to determine the sizes of some data types, including +# void *, early in the process of configuration; apparently, it's done +# as part of processing the project() command. # -# We do that by specifying just C in the project() call and, after -# that finishes, checking for Haiku and, if we're building for -# Haiku, use enable_language() to check for C++. This means that -# we don't require a C++ compiler on platforms other than Haiku. +# At least as of CMake 2.8.6, it does so by checking the size of +# "void *" in C, setting CMAKE_C_SIZEOF_DATA_PTR based on that, +# setting CMAKE_SIZEOF_VOID_P to that, and then checking the size +# of "void *" in C++, setting CMAKE_CXX_SIZEOF_DATA_PTR based on +# that, and then setting CMAKE_SIZEOF_VOID_P to *that*. # -# CMAKE_SYSTEM_NAME is set by project(), so we can't do this by -# testing CMAKE_SYSTEM_NAME and then passing different language -# lists to project() based on the system. +# The compile tests include whatever C flags may have been provided +# to CMake in the CFLAGS and CXXFLAGS environment variables. +# +# If you set an architecture flag such as -m32 or -m64 in CFLAGS +# but *not* in CXXFLAGS, the size for C++ will win, and hilarity +# will ensue. +# +# Or if, at least on Solaris, you have a newer version of GCC +# installed, but *not* a newer version of G++, and you have Oracle +# Studio installed, it will find GCC, which will default to building +# 64-bit, and Oracle Studio's C++ compiler, which will default to +# building 32-bit, the size for C++ will win, and, again, hilarity +# will ensue. # project(pcap C) +# +# Setting CMAKE_MACOSX_RPATH to FALSE causes the installed +# libpcap.A.dylib to have just libpcap.A.dylib as the install +# name; Apple built libpcap with an install_name of /usr/lib/libpcap.A.dylib +# (back when they still shipped individual system dylibs rather than +# shipping a pre-built shared library cache, at least), and we do the +# same with autotools; do the same with CMake. +# +if (NOT DEFINED CMAKE_INSTALL_NAME_DIR) + set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) +endif() + # # For getting raw lists of --libs and --libs --static information from a # pkg-config module. @@ -190,55 +246,6 @@ macro(get_link_info_from_library_path _library_prefix _library_name) endif() endmacro() -if(CMAKE_SYSTEM_NAME STREQUAL "Haiku") - enable_language(CXX) - - # - # OK, this is a royal pain. - # - # CMake will try to determine the sizes of some data types, including - # void *, early in the process of configuration; apparently, it's done - # as part of processing the project() command. - # - # At least as of CMake 2.8.6, it does so by checking the size of - # "void *" in C, setting CMAKE_C_SIZEOF_DATA_PTR based on that, - # setting CMAKE_SIZEOF_VOID_P to that, and then checking the size - # of "void *" in C++, setting CMAKE_CXX_SIZEOF_DATA_PTR based on - # that, and then setting CMAKE_SIZEOF_VOID_P to *that*. - # - # The compile tests include whatever C flags may have been provided - # to CMake in the CFLAGS and CXXFLAGS environment variables. - # - # If you set an architecture flag such as -m32 or -m64 in CFLAGS - # but *not* in CXXFLAGS, the size for C++ will win, and hilarity - # will ensue. - # - # Or if, at least on Solaris, you have a newer version of GCC - # installed, but *not* a newer version of G++, and you have Oracle - # Studio installed, it will find GCC, which will default to building - # 64-bit, and Oracle Studio's C++ compiler, which will default to - # building 32-bit, the size for C++ will win, and, again, hilarity - # will ensue. - # - # So we make sure both languages have the same pointer sizes with - # the flags they're given; if they don't, it means that the - # compilers for the languages will, with those flags, not produce - # code that can be linked together. - # - # This is unlikely to happen on Haiku, but it *has* happened on - # Solaris; we do this for future-proofing, in case we ever need - # C++ on a platform where that can happen. - # - if(NOT ${CMAKE_C_SIZEOF_DATA_PTR} EQUAL ${CMAKE_CXX_SIZEOF_DATA_PTR}) - message(FATAL_ERROR -"C compiler ${CMAKE_C_COMPILER} produces code with \ -${CMAKE_C_SIZEOF_DATA_PTR}-byte pointers while C++ compiler \ -${CMAKE_CXX_COMPILER} produces code with \ -${CMAKE_CXX_SIZEOF_DATA_PTR}-byte pointers. \ -This prevents code in these languages from being combined.") - endif() -endif() - # # Show the bit width for which we're compiling. # This can help debug problems if you're dealing with a compiler that @@ -256,7 +263,7 @@ endif() # Solaris pkg-config is annoying. For at least one package (D-Bus, I'm # looking at *you*!), there are separate include files for 32-bit and # 64-bit builds (I guess using "unsigned long long" as a 64-bit integer -# type on a 64-bit build is like crossing the beams or soething), and +# type on a 64-bit build is like crossing the beams or something), and # there are two separate .pc files, so if we're doing a 32-bit build we # should make sure we look in /usr/lib/pkgconfig for .pc files and if # we're doing a 64-bit build we should make sure we look in @@ -563,8 +570,6 @@ set(PACKAGE_STRING "${LIBRARY_NAME} ${PACKAGE_VERSION}") # Project settings ###################################### -add_definitions(-DHAVE_CONFIG_H) - include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${pcap_SOURCE_DIR} @@ -615,9 +620,7 @@ if(USE_STATIC_RT) if(MSVC) foreach(RT_FLAG CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) string(REGEX REPLACE "/MD" "/MT" ${RT_FLAG} "${${RT_FLAG}}") endforeach(RT_FLAG) elseif(MINGW) @@ -699,7 +702,6 @@ main(void) # # Now check for various system functions. # -check_function_exists(strerror HAVE_STRERROR) check_function_exists(strerror_r HAVE_STRERROR_R) if(HAVE_STRERROR_R) # @@ -755,29 +757,26 @@ if(NOT WIN32) endif() # -# These tests are for network applications that need socket functions -# and getaddrinfo()/getnameinfo()-ish functions. We now require -# getaddrinfo() and getnameinfo(). On UN*X systems, we also prefer -# versions of recvmsg() that conform to the Single UNIX Specification, -# so that we can check whether a datagram received with recvmsg() was -# truncated when received due to the buffer being too small. +# Look for various networking-related libraries that we may need. # -# On Windows, getaddrinfo() is in the ws2_32 library. - -# On most UN*X systems, they're available in the system library. +# We need getaddrinfo() to translate host names in filters to IP +# addresses. We use getaddrinfo() because we want a portable +# thread-safe way of getting information for a host name or port; +# there exist _r versions of gethostbyname() and getservbyname() on +# some platforms, but not on all platforms. # -# Under Solaris, we need to link with libsocket and libnsl to get -# getaddrinfo() and getnameinfo() and, if we have libxnet, we need to -# link with libxnet before libsocket to get a version of recvmsg() -# that conforms to the Single UNIX Specification. +# We may also need socket() and other socket functions to support: # -# We use getaddrinfo() because we want a portable thread-safe way -# of getting information for a host name or port; there exist _r -# versions of gethostbyname() and getservbyname() on some platforms, -# but not on all platforms. +# Local packet capture with capture mechanisms that use sockets. # -# NOTE: if you hand check_library_exists as its last argument a variable -# that's been set, it skips the test, so we need different variables. +# Local capture device enumeration if a socket call is needed to +# enumerate devices or get device attributes. +# +# Packet capture from services that put captured packets on the +# network, such as rpcap servers. +# +# We may also need getnameinfo() for packet capture from services +# that put packets on the network. # set(PCAP_LINK_LIBRARIES "") set(LIBS "") @@ -786,9 +785,13 @@ set(REQUIRES_PRIVATE "") set(LIBS_PRIVATE "") include(CheckLibraryExists) if(WIN32) + # + # Windows. # # We need winsock2.h and ws2tcpip.h. # + # On Windows, getaddrinfo() is in the ws2_32 library. + # cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES ws2_32) check_symbol_exists(getaddrinfo "winsock2.h;ws2tcpip.h" LIBWS2_32_HAS_GETADDRINFO) @@ -800,16 +803,28 @@ if(WIN32) endif(LIBWS2_32_HAS_GETADDRINFO) else(WIN32) # - # UN*X. First try the system libraries, then try the libraries - # for Solaris and possibly other systems that picked up the - # System V library split. + # UN*X. + # + # Most UN*Xes have getaddrinfo(), and the other routines we may + # need, in the default searched libraries (e.g., libc). + # Check there first. + # + # NOTE: if you hand check_library_exists as its last argument a + # variable that's been set, it skips the test, so we need different + # variables for different libraries. # check_function_exists(getaddrinfo STDLIBS_HAVE_GETADDRINFO) if(NOT STDLIBS_HAVE_GETADDRINFO) - # - # Not found in the standard system libraries. - # Try libsocket, which requires libnsl. - # + # + # Not found in the standard system libraries. + # + # In some versions of Solaris, we need to link with libsocket + # and libnsl, so check in libsocket and also link with liblnsl + # when doing this test. + # + # Linking with libsocket and libnsl will find all the routines + # we need. + # cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES nsl) check_library_exists(socket getaddrinfo "" LIBSOCKET_HAS_GETADDRINFO) @@ -823,10 +838,17 @@ else(WIN32) set(LIBS_STATIC "-lsocket -lnsl ${LIBS_STATIC}") set(LIBS_PRIVATE "-lsocket -lnsl ${LIBS_PRIVATE}") else(LIBSOCKET_HAS_GETADDRINFO) + # + # Not found in libsocket; test for it in libnetwork, which + # is where it is in Haiku. + # + # Linking with libnetwork will find all the routines we + # need. + # check_library_exists(network getaddrinfo "" LIBNETWORK_HAS_GETADDRINFO) if(LIBNETWORK_HAS_GETADDRINFO) # - # OK, we found it in libnetwork (Haiku). + # OK, we found it in libnetwork. # set(PCAP_LINK_LIBRARIES network ${PCAP_LINK_LIBRARIES}) set(LIBS "-lnetwork ${LIBS}") @@ -840,17 +862,32 @@ else(WIN32) endif(LIBNETWORK_HAS_GETADDRINFO) endif(LIBSOCKET_HAS_GETADDRINFO) - # - # OK, do we have recvmsg() in libxnet? - # We also link with libsocket and libnsl. - # + # + # We require a version of recvmsg() that conforms to the Single + # UNIX Specification, so that we can check whether a datagram + # received with recvmsg() was truncated when received due to the + # buffer being too small. + # + # On most systems, the version of recvmsg() in the libraries + # found above conforms to the SUS. + # + # On at least some versions of Solaris, it does not conform to + # the SUS, and we need the version in libxnet, which does + # conform. + # + # Check whether libxnet exists and has a version of recvmsg(); + # if it does, link with libxnet before we link with libsocket, + # to get that version. + # + # This test also links with libsocket and libnsl. + # cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES socket nsl) check_library_exists(xnet recvmsg "" LIBXNET_HAS_RECVMSG) cmake_pop_check_state() if(LIBXNET_HAS_RECVMSG) # - # Yes - link with it as well. + # libxnet has recvmsg(); link with it as well. # set(PCAP_LINK_LIBRARIES xnet ${PCAP_LINK_LIBRARIES}) set(LIBSC "-lxnet ${LIBS_LIBS}") @@ -859,7 +896,9 @@ else(WIN32) endif(LIBXNET_HAS_RECVMSG) endif(NOT STDLIBS_HAVE_GETADDRINFO) - # DLPI needs putmsg under HPUX so test for -lstr while we're at it + # + # DLPI needs putmsg under HP-UX, so test for -lstr while we're at it. + # check_function_exists(putmsg STDLIBS_HAVE_PUTMSG) if(NOT STDLIBS_HAVE_PUTMSG) check_library_exists(str putmsg "" LIBSTR_HAS_PUTMSG) @@ -1231,7 +1270,6 @@ endif(NOT WIN32) if(ENABLE_PROFILING) if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() endif() @@ -1264,7 +1302,7 @@ endif() # # Test if the each of the sanitizers in the ENABLE_SANITIZERS list are # supported by the compiler, and, if so, adds the appropriate flags to -# CMAKE_C_FLAGS, CMAKE_CXX_FLAGS, and SANITIZER_FLAGS. If not, it fails. +# CMAKE_C_FLAGS, and SANITIZER_FLAGS. If not, it fails. # # Do this last, in the hope that it will prevent configuration on Linux # from somehow deciding it doesn't need -lpthread when building rpcapd @@ -1272,17 +1310,25 @@ endif() # obvious CMake debugging flag reveals, it doesn't realize that if we # turn sanitizer stuff on). # -set(SANITIZER_FLAGS "") -foreach(sanitizer IN LISTS ENABLE_SANITIZERS) +# Note: apparently, some projects have decided that ENABLE_SANITIZERS +# is a Boolean, with OFF meaning "no sanitizers" and ON meaning "all +# sanitizers". Whoever decided that didn't put it up as a common +# CMake idiom, as far as I can tell; we only discovered this because +# JetBrains' CLion "helpfully" appears to pass -DENABLE_SANITIZERS=OFF +# to CMake by default, which causes CMake to fail on libpcap. Thanks! +# +# We thus also allow a setting of OFF to mean "no sanitizers" and ON to +# mean "all supported sanitizers that we know about and that can all +# be used together". +# +macro(test_sanitizer _sanitizer _sanitizer_flag) + message(STATUS "Checking sanitizer ${_sanitizer}") + set(sanitizer_variable "sanitize_${_sanitizer}") # Set -Werror to catch "argument unused during compilation" warnings - - message(STATUS "Checking sanitizer ${sanitizer}") - set(sanitizer_variable "sanitize_${sanitizer}") - set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize=${sanitizer}") - check_c_compiler_flag("-fsanitize=${sanitizer}" ${sanitizer_variable}) + set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize=${_sanitizer}") + check_c_compiler_flag("-fsanitize=${_sanitizer}" ${sanitizer_variable}) if(${${sanitizer_variable}}) - set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize=${sanitizer}") - message(STATUS "${sanitizer} sanitizer supported using -fsanitizer=${sanitizer}") + set(${_sanitizer_flag} "-fsanitize=${_sanitizer}") else() # # Try the versions supported prior to Clang 3.2. @@ -1291,119 +1337,397 @@ foreach(sanitizer IN LISTS ENABLE_SANITIZERS) # Otherwise, give up. # set(sanitizer_variable "OLD_${sanitizer_variable}") - if ("${sanitizer}" STREQUAL "address") + if ("${_sanitizer}" STREQUAL "address") set(CMAKE_REQUIRED_FLAGS "-Werror -fsanitize-address") check_c_compiler_flag("-fsanitize-address" ${sanitizer_variable}) if(${${sanitizer_variable}}) - set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fsanitize-address") - message(STATUS "${sanitizer} sanitizer supported using -fsanitize-address") - else() - message(FATAL_ERROR "${sanitizer} isn't a supported sanitizer") + set(${_sanitizer_flag} "-fsanitize-address") endif() - elseif("${sanitizer}" STREQUAL "undefined") + elseif("${_sanitizer}" STREQUAL "undefined") set(CMAKE_REQUIRED_FLAGS "-Werror -fcatch-undefined-behavior") check_c_compiler_flag("-fcatch-undefined-behavior" ${sanitizer_variable}) if(${${sanitizer_variable}}) - set(SANITIZER_FLAGS "${SANITIZER_FLAGS} -fcatch-undefined-behavior") - message(STATUS "${sanitizer} sanitizer supported using catch-undefined-behavior") - else() - message(FATAL_ERROR "${sanitizer} isn't a supported sanitizer") + set(${_sanitizer_flag} "-fcatch-undefined-behavior") endif() - else() - message(FATAL_ERROR "${sanitizer} isn't a supported sanitizer") endif() endif() - unset(CMAKE_REQUIRED_FLAGS) -endforeach() +endmacro(test_sanitizer) + +set(SANITIZER_FLAGS "") +if("${ENABLE_SANITIZERS}") + # + # This appears to indicate that ENABLE_SANITIZERS was set to a + # string value that is "one of the true constants", meaning + # "1, ON, YES, TRUE, Y, or a non-zero number". + # + # It does not appear to happen for other settings, including + # setting it to a list of one or more sanitizers. + # + # This setting means "enable all sanitizers that the compiler + # supports". + # + foreach(sanitizer "address" "undefined") + unset(SANITIZER_FLAG) + test_sanitizer(${sanitizer} SANITIZER_FLAG) + if(SANITIZER_FLAG) + message(STATUS "${sanitizer} sanitizer supported using ${SANITIZER_FLAG}") + set(SANITIZER_FLAGS "${SANITIZER_FLAGS} ${SANITIZER_FLAG}") + else() + message(STATUS "${sanitizer} isn't a supported sanitizer") + endif() + endforeach() + if("${SANITIZER_FLAGS}" STREQUAL "") + message(FATAL_ERROR "No supported sanitizers found") + endif() +else() + # + # This appears to indicate that ENABLE_SANITIZERS was either: + # + # not set; + # set to a set to a string value that is not "one of the true + # constants", meaning "1, ON, YES, TRUE, Y, or a non-zero number". + # + # The latter includes setting it to "one of the false constants", + # meaning the string "is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, + # the empty string, or ends in the suffix -NOTFOUND." + # + # It also includes setting it to a list of one or more sanitizers. + # + # We want to treat "not set" and "set to one of the false constants" + # as meaning "do not enable any sanitizers". + # + # We want to treat "set to a list of one or more sanitizers" as + # meaning "enable all the sanitizers in the list". + # + # This requires that we distinguish between those two cases. + # + if(ENABLE_SANITIZERS) + # + # This appears to indicate that ENABLE_SANITIZERS was set to + # a string value that is "not one of the false constants". + # + # We already know it's "not one of the true constants", so + # we treat it as a list of sanitizers. + # + foreach(sanitizer IN LISTS ENABLE_SANITIZERS) + unset(SANITIZER_FLAG) + test_sanitizer(${sanitizer} SANITIZER_FLAG) + if(SANITIZER_FLAG) + message(STATUS "${sanitizer} sanitizer supported using ${SANITIZER_FLAG}") + set(SANITIZER_FLAGS "${SANITIZER_FLAGS} ${SANITIZER_FLAG}") + else() + message(FATAL_ERROR "${sanitizer} isn't a supported sanitizer") + endif() + endforeach() + else() + # + # This appears to indicate that ENABLE_SANITIZERS was either: + # + # not set; + # set to a value that's "one of the false constants"; + # + # so we don't enable any sanitizers. + # + message(STATUS "Not enabling sanitizers") + endif() +endif() if(NOT "${SANITIZER_FLAGS}" STREQUAL "") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O1 -g ${SANITIZER_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -g ${SANITIZER_FLAGS} -fno-omit-frame-pointer -fno-optimize-sibling-calls") endif() -# -# OpenSSL/libressl. -# -find_package(OpenSSL) -if(OPENSSL_FOUND) +if(ENABLE_REMOTE) # - # We have OpenSSL. + # OpenSSL/libressl. # - include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) - set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${OPENSSL_LIBRARIES}) + find_package(OpenSSL) + if(OPENSSL_FOUND) + # + # We have OpenSSL. + # + include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) + set(PCAP_LINK_LIBRARIES ${PCAP_LINK_LIBRARIES} ${OPENSSL_LIBRARIES}) - # - # The find_package() module CMake provides for OpenSSL uses does not *** 38674 LINES SKIPPED *** From nobody Tue Oct 8 00:31:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMxm90hZWz5YgWk; Tue, 08 Oct 2024 00:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMxm90GMDz46y0; Tue, 8 Oct 2024 00:31:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728347513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lriNQVYcjN4g+/vrTp+aJ799n97h076BhCuKglKYtV4=; b=J68T1+bjhtUrvRq9Fpn00YVgzE4W5Sa+bPJmEqBrOmomVo4RsBxdUiDf1C6/KE1BIU1EYp ZQRfXZ4oXo6TuCiQQrN4Qi/WVNkk2UO1Y25XfpV9bToH5cdd13litkAvn0ArI8lFOu3FXW 1HNkXuwZwV9uuJ1JIlDVOqMp1wsfNEfu9+IW5lEMW0aDoJREc/Pc2sqL0gdZQkWISWqvju ivG9cTXcyIZTP7Tsn4BWYd9KjE/PudFQ2QGgV4PdmAa1DgbYokPkyG1pUwdCujGVfm9qCH ap0fBHKbnQubR8rkD9RcTzqW25LUk3SMhFFdsizdlSAKy0QsYtrm7bbM+d99lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728347513; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lriNQVYcjN4g+/vrTp+aJ799n97h076BhCuKglKYtV4=; b=PPu1XqYzWaWw65DP4CXwnE+ffeMoNecFunhd0xiyrw9Qhtk2oLDstP+G4QWY6KTbxnIcXw At1Z2F5eX4y3CMxFvg6bXnbO1Z4QDzbtJgsoZ38/TrUd7jXQxSFW3hvur1TqVHiEhQG54K fu81ntaG93tiB96kwYwnq1hNQj2g8EtOjSTwjbIH7/3OfJwcVFm+QDZ0SFz2hW4NQN63hR kYAXC3sVSPh1k8LZgj27A3Eej3Li2Xdln4XfJqYZpwBPcHVdW8kTKwGXHRlWkeSYqVJQOZ Iy+OrP4Wa9H0TD/4diJOtG2UMTwthM9AsVrvPOuVkS8Vq5u3AOD52QAP2nO7hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728347513; a=rsa-sha256; cv=none; b=lv09dAU+TuKi1OvG+z5jjeggsMka89VpLKnNNkGYT506V/E3Ebk3Jn/u+duWT/1UvAd1CG gS0YzI3vCnmEED4MWzae5Pl+O3VxdRnyrBYT9lDzfcoBDVMZd3RUYknGIyumTD4ruf7fFx Fcs1egzGLRkEvla5O+GycJ0hjNN5AT+lTn8QYIV4rwj0DQ46bp1Nly1IY+7Unec3LEpgrf nC9VYNxRYyuP+mD6WB5wNtnTolYjr1yg9lP0BgIN//G8De60DUK1zLirLRjXSUE/UyaOpc xsATYClVzPYd6fIcm1hFsA8krsd1MQMKYU94D0CHWeEcp2bgP33ZP3jceuNv6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMxm86z9gz17fK; Tue, 8 Oct 2024 00:31:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4980VqjU082739; Tue, 8 Oct 2024 00:31:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4980VqoY082736; Tue, 8 Oct 2024 00:31:52 GMT (envelope-from git) Date: Tue, 8 Oct 2024 00:31:52 GMT Message-Id: <202410080031.4980VqoY082736@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone <jrm@FreeBSD.org> Subject: git: ec3da16d8bc1 - stable/14 - tcpdump: Update to 4.99.5 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ec3da16d8bc19ad90f04cc227fc8f409813c44f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=ec3da16d8bc19ad90f04cc227fc8f409813c44f4 commit ec3da16d8bc19ad90f04cc227fc8f409813c44f4 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2024-09-23 19:23:25 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2024-10-07 18:32:06 +0000 tcpdump: Update to 4.99.5 Changes: https://git.tcpdump.org/tcpdump/blob/4a789712f187e3ac7b2c0044c3a3f8c71b83646e:/CHANGES Obtained from: https://www.tcpdump.org/release/tcpdump-4.99.5.tar.xz Sponsored by: The FreeBSD Foundation (cherry picked from commit 0a7e5f1f02aad2ff5fff1c60f44c6975fd07e1d9) --- contrib/tcpdump/CHANGES | 131 +- contrib/tcpdump/CMakeLists.txt | 301 +- contrib/tcpdump/CONTRIBUTING.md | 269 +- contrib/tcpdump/CREDITS | 34 +- contrib/tcpdump/INSTALL.md | 35 +- contrib/tcpdump/Makefile.in | 98 +- contrib/tcpdump/VERSION | 2 +- contrib/tcpdump/addrtoname.c | 7 +- contrib/tcpdump/addrtostr.c | 24 +- contrib/tcpdump/af.c | 2 - contrib/tcpdump/autogen.sh | 25 + contrib/tcpdump/bpf_dump.c | 2 - contrib/tcpdump/checksum.c | 39 +- contrib/tcpdump/cmake/Modules/FindCRYPTO.cmake | 185 +- contrib/tcpdump/cmakeconfig.h.in | 14 +- contrib/tcpdump/config.guess | 62 +- contrib/tcpdump/config.h.in | 27 +- contrib/tcpdump/config.sub | 230 +- contrib/tcpdump/configure | 7188 ++++++++++++++---------- contrib/tcpdump/configure.ac | 476 +- contrib/tcpdump/cpack.c | 2 - contrib/tcpdump/diag-control.h | 95 +- contrib/tcpdump/doc/README.Win32.md | 200 - contrib/tcpdump/doc/README.haiku.md | 33 + contrib/tcpdump/doc/README.solaris.md | 5 + contrib/tcpdump/extract.h | 2 +- contrib/tcpdump/ftmacros.h | 2 +- contrib/tcpdump/funcattrs.h | 5 +- contrib/tcpdump/gmpls.c | 2 - contrib/tcpdump/in_cksum.c | 2 - contrib/tcpdump/install-sh | 689 ++- contrib/tcpdump/instrument-functions.c | 250 + contrib/tcpdump/interface.h | 2 +- contrib/tcpdump/ip.h | 1 - contrib/tcpdump/ipproto.c | 2 - contrib/tcpdump/l2vpn.c | 2 - contrib/tcpdump/machdep.c | 2 - contrib/tcpdump/makemib | 2 +- contrib/tcpdump/mib.h | 12 +- contrib/tcpdump/missing/datalinks.c | 2 - contrib/tcpdump/missing/dlnames.c | 2 - contrib/tcpdump/missing/getopt_long.c | 3 +- contrib/tcpdump/missing/getservent.c | 2 - contrib/tcpdump/missing/snprintf.c | 2 - contrib/tcpdump/missing/strlcat.c | 2 - contrib/tcpdump/missing/strlcpy.c | 2 - contrib/tcpdump/missing/strsep.c | 2 - contrib/tcpdump/mkdep | 28 +- contrib/tcpdump/nameser.h | 8 +- contrib/tcpdump/netdissect-alloc.c | 2 - contrib/tcpdump/netdissect.c | 16 +- contrib/tcpdump/netdissect.h | 75 +- contrib/tcpdump/nlpid.c | 2 - contrib/tcpdump/ntp.c | 2 - contrib/tcpdump/oui.c | 2 - contrib/tcpdump/parsenfsfh.c | 53 +- contrib/tcpdump/pflog.h | 45 +- contrib/tcpdump/print-802_11.c | 62 +- contrib/tcpdump/print-802_15_4.c | 32 +- contrib/tcpdump/print-ah.c | 2 - contrib/tcpdump/print-ahcp.c | 2 - contrib/tcpdump/print-aodv.c | 2 - contrib/tcpdump/print-aoe.c | 2 - contrib/tcpdump/print-ap1394.c | 2 - contrib/tcpdump/print-arcnet.c | 2 - contrib/tcpdump/print-arista.c | 2 - contrib/tcpdump/print-arp.c | 2 - contrib/tcpdump/print-ascii.c | 8 +- contrib/tcpdump/print-atalk.c | 2 - contrib/tcpdump/print-atm.c | 4 +- contrib/tcpdump/print-babel.c | 2 - contrib/tcpdump/print-bcm-li.c | 2 - contrib/tcpdump/print-beep.c | 2 - contrib/tcpdump/print-bfd.c | 8 +- contrib/tcpdump/print-bgp.c | 23 +- contrib/tcpdump/print-bootp.c | 43 +- contrib/tcpdump/print-brcmtag.c | 3 - contrib/tcpdump/print-bt.c | 2 - contrib/tcpdump/print-calm-fast.c | 2 - contrib/tcpdump/print-carp.c | 5 +- contrib/tcpdump/print-cdp.c | 10 +- contrib/tcpdump/print-cfm.c | 2 - contrib/tcpdump/print-chdlc.c | 2 - contrib/tcpdump/print-cip.c | 2 - contrib/tcpdump/print-cnfp.c | 2 - contrib/tcpdump/print-dccp.c | 2 - contrib/tcpdump/print-decnet.c | 2 - contrib/tcpdump/print-dhcp6.c | 70 +- contrib/tcpdump/print-domain.c | 12 +- contrib/tcpdump/print-dsa.c | 2 - contrib/tcpdump/print-dtp.c | 4 +- contrib/tcpdump/print-dvmrp.c | 4 +- contrib/tcpdump/print-eap.c | 3 +- contrib/tcpdump/print-egp.c | 2 - contrib/tcpdump/print-eigrp.c | 2 - contrib/tcpdump/print-enc.c | 2 - contrib/tcpdump/print-esp.c | 29 +- contrib/tcpdump/print-ether.c | 6 +- contrib/tcpdump/print-fddi.c | 5 +- contrib/tcpdump/print-forces.c | 2 - contrib/tcpdump/print-fr.c | 18 +- contrib/tcpdump/print-frag6.c | 26 +- contrib/tcpdump/print-ftp.c | 2 - contrib/tcpdump/print-geneve.c | 2 - contrib/tcpdump/print-geonet.c | 2 - contrib/tcpdump/print-gre.c | 2 - contrib/tcpdump/print-hncp.c | 2 - contrib/tcpdump/print-hsrp.c | 2 - contrib/tcpdump/print-http.c | 2 - contrib/tcpdump/print-icmp.c | 2 - contrib/tcpdump/print-icmp6.c | 15 +- contrib/tcpdump/print-igmp.c | 2 - contrib/tcpdump/print-igrp.c | 2 - contrib/tcpdump/print-ip-demux.c | 2 - contrib/tcpdump/print-ip.c | 68 +- contrib/tcpdump/print-ip6.c | 45 +- contrib/tcpdump/print-ip6opts.c | 2 - contrib/tcpdump/print-ipcomp.c | 2 - contrib/tcpdump/print-ipfc.c | 2 - contrib/tcpdump/print-ipnet.c | 2 - contrib/tcpdump/print-ipoib.c | 2 - contrib/tcpdump/print-ipx.c | 6 +- contrib/tcpdump/print-isakmp.c | 25 +- contrib/tcpdump/print-isoclns.c | 34 +- contrib/tcpdump/print-juniper.c | 5 +- contrib/tcpdump/print-krb.c | 11 +- contrib/tcpdump/print-l2tp.c | 2 - contrib/tcpdump/print-lane.c | 2 - contrib/tcpdump/print-ldp.c | 20 +- contrib/tcpdump/print-lisp.c | 14 +- contrib/tcpdump/print-llc.c | 2 - contrib/tcpdump/print-lldp.c | 4 +- contrib/tcpdump/print-lmp.c | 2 - contrib/tcpdump/print-loopback.c | 5 +- contrib/tcpdump/print-lspping.c | 2 - contrib/tcpdump/print-lwapp.c | 2 - contrib/tcpdump/print-lwres.c | 10 +- contrib/tcpdump/print-m3ua.c | 2 - contrib/tcpdump/print-macsec.c | 3 - contrib/tcpdump/print-mobile.c | 2 - contrib/tcpdump/print-mobility.c | 5 +- contrib/tcpdump/print-mpcp.c | 2 - contrib/tcpdump/print-mpls.c | 2 - contrib/tcpdump/print-mptcp.c | 2 - contrib/tcpdump/print-msdp.c | 2 - contrib/tcpdump/print-msnlb.c | 2 - contrib/tcpdump/print-nflog.c | 22 +- contrib/tcpdump/print-nfs.c | 29 +- contrib/tcpdump/print-nsh.c | 7 +- contrib/tcpdump/print-ntp.c | 4 - contrib/tcpdump/print-null.c | 2 - contrib/tcpdump/print-olsr.c | 16 +- contrib/tcpdump/print-openflow-1.0.c | 143 +- contrib/tcpdump/print-openflow-1.3.c | 15 +- contrib/tcpdump/print-openflow.c | 2 - contrib/tcpdump/print-ospf.c | 10 +- contrib/tcpdump/print-ospf6.c | 15 +- contrib/tcpdump/print-otv.c | 2 - contrib/tcpdump/print-pflog.c | 30 +- contrib/tcpdump/print-pgm.c | 2 - contrib/tcpdump/print-pim.c | 8 +- contrib/tcpdump/print-pktap.c | 2 - contrib/tcpdump/print-ppi.c | 2 - contrib/tcpdump/print-ppp.c | 11 +- contrib/tcpdump/print-pppoe.c | 2 - contrib/tcpdump/print-pptp.c | 2 - contrib/tcpdump/print-ptp.c | 45 +- contrib/tcpdump/print-radius.c | 173 +- contrib/tcpdump/print-raw.c | 2 - contrib/tcpdump/print-realtek.c | 2 - contrib/tcpdump/print-resp.c | 6 +- contrib/tcpdump/print-rip.c | 46 +- contrib/tcpdump/print-ripng.c | 2 - contrib/tcpdump/print-rpki-rtr.c | 40 +- contrib/tcpdump/print-rsvp.c | 2 - contrib/tcpdump/print-rt6.c | 4 +- contrib/tcpdump/print-rtsp.c | 2 - contrib/tcpdump/print-rx.c | 4 +- contrib/tcpdump/print-sctp.c | 7 +- contrib/tcpdump/print-sflow.c | 8 +- contrib/tcpdump/print-sip.c | 2 - contrib/tcpdump/print-sl.c | 2 - contrib/tcpdump/print-sll.c | 2 - contrib/tcpdump/print-slow.c | 2 - contrib/tcpdump/print-smb.c | 20 +- contrib/tcpdump/print-smtp.c | 2 - contrib/tcpdump/print-snmp.c | 12 +- contrib/tcpdump/print-someip.c | 3 - contrib/tcpdump/print-ssh.c | 2 - contrib/tcpdump/print-stp.c | 5 +- contrib/tcpdump/print-sunatm.c | 2 - contrib/tcpdump/print-sunrpc.c | 2 - contrib/tcpdump/print-symantec.c | 2 - contrib/tcpdump/print-syslog.c | 5 +- contrib/tcpdump/print-tcp.c | 64 +- contrib/tcpdump/print-telnet.c | 4 +- contrib/tcpdump/print-tftp.c | 2 - contrib/tcpdump/print-timed.c | 2 - contrib/tcpdump/print-tipc.c | 6 +- contrib/tcpdump/print-token.c | 2 - contrib/tcpdump/print-udld.c | 2 - contrib/tcpdump/print-udp.c | 101 +- contrib/tcpdump/print-unsupported.c | 2 - contrib/tcpdump/print-usb.c | 14 +- contrib/tcpdump/print-vjc.c | 2 - contrib/tcpdump/print-vqp.c | 2 - contrib/tcpdump/print-vrrp.c | 2 - contrib/tcpdump/print-vsock.c | 2 - contrib/tcpdump/print-vtp.c | 6 +- contrib/tcpdump/print-vxlan-gpe.c | 2 - contrib/tcpdump/print-vxlan.c | 2 - contrib/tcpdump/print-wb.c | 2 - contrib/tcpdump/print-whois.c | 2 - contrib/tcpdump/print-zep.c | 10 +- contrib/tcpdump/print-zephyr.c | 2 - contrib/tcpdump/print-zeromq.c | 26 +- contrib/tcpdump/print.c | 18 +- contrib/tcpdump/signature.c | 2 - contrib/tcpdump/smbutil.c | 19 +- contrib/tcpdump/status-exit-codes.h | 1 - contrib/tcpdump/strtoaddr.c | 2 - contrib/tcpdump/tcp.h | 6 +- contrib/tcpdump/tcpdump.1.in | 87 +- contrib/tcpdump/tcpdump.c | 107 +- contrib/tcpdump/udp.h | 14 +- contrib/tcpdump/util-print.c | 67 +- usr.sbin/tcpdump/tcpdump/config.h | 4 +- 227 files changed, 7690 insertions(+), 5092 deletions(-) diff --git a/contrib/tcpdump/CHANGES b/contrib/tcpdump/CHANGES index 33ced66dd826..b63d1eb658d3 100644 --- a/contrib/tcpdump/CHANGES +++ b/contrib/tcpdump/CHANGES @@ -1,3 +1,128 @@ +Friday, August 30, 2024 / The Tcpdump Group + Summary for 4.99.5 tcpdump release + Refine protocol decoding for: + Arista: Use the test .pcap file from pull request #955 (HwInfo). + BGP: Fix an undefined behavior when it tries to parse a too-short packet. + CARP: Print the protocol name before any GET_(). + CDP: only hex-dump unknown TLVs in verbose mode. + DHCP: parse the SZTP redirect tag. + DHCPv6: client-id/server-id DUID type 2 correction; parse the user class, + boot file URL, and SZTP redirect options; add DUID-UUID printing + (RFC6355). + DNS: Detect and correctly handle too-short URI RRs. + EAP: Assign ndo_protocol in the eap_print() function. + ESP: Don't use EVP_add_cipher_alias() (fixes building on OpenBSD 7.5). + Frame Relay (Multilink): Fix the Timestamp Information Element printing. + ICMPv6: Fix printing the Home Agent Address Discovery Reply Message. + IEEE 802.11: no need for an element ID in the structures for IEs, make + the length in the IE structures a u_int, include the "TA" field while + printing Block Ack Control frame. + IP: Enable TSO (TCP Segmentation Offload) support; fix printing invalid + cases as invalid, not truncated; use ND_ICHECKMSG_ZU() to test the + header length. + IPv6: Fix printing invalid cases as invalid, not truncated; use + ND_ICHECKMSG_U() to print an invalid version. + IPv6: Fix invalid 32-bit versus 64-bit printouts of fragment headers. + ISAKMP: Fix printing Delete payload SPI when size is zero. + Kerberos: Print the protocol name, remove a redundant bounds check. + lwres: Fix an undefined behavior in pointer arithmetic. + OpenFlow 1.0: Fix indentation of PORT_MOD, improve handling of + some lengths, and fix handling of snapend. + TCP: Test ports < 1024 in port order to select the printer. + UDP: Move source port equal BCM_LI_PORT to bottom of long if else chain. + UDP: Test ports < 1024 in port order to select the printer. + LDP: Add missing fields of the Common Session Parameters TLV and fix the + offset for the A&D bits. + NFLOG: Use correct AF code points on all OSes. + NFS: Avoid printing non-ASCII characters. + OSPF: Pad TLVs in LS_OPAQUE_TYPE_RI to multiples of 4 bytes. + OSPF: Update LS-Ack printing not to run off the end of the packet. + OSPF6: Fix an undefined behavior. + pflog: use nd_ types in struct pfloghdr. + PPP: Check if there is some data to hexdump. + PPP: Remove an extra colon before LCP Callback Operation. + Use the buffer stack for de-escaping PPP; fixes CVE-2024-2397; + Note: This problem does not affect any tcpdump release. + PTP: Fix spelling of type SIGNALING, Parse major and minor version + correctly, Print majorSdoId field instead of just the first bit. + RIP: Make a couple trivial protocol updates. + RPKI-Router: Refine length and bounds checks. + RX: Use the "%Y-%m-%d" date format. + smbutil.c: Use the "%Y-%m-%d" date format. + SNMP: Fix two undefined behaviors. + Text protocols: Fix printing truncation if it is not the case. + ZEP: Use the "%Y-%m-%d" date format. + ZMTP: Replace custom code with bittok2str(). + User interface: + Print the supported time stamp types (-J) to stdout instead of stderr. + Print the list of data link types (-L) to stdout instead of stderr. + Use symmetrical quotation characters in error messages. + Update --version option to print 32/64-bit build and time_t size. + Improve error messages for invalid interface indexes specified + with -i. + Support "3des" as an alias for "des_ede3_cbc" even if the crypto + library doesn't support adding aliases. + Source code: + tcpdump: Fix a memory leak. + child_cleanup: reap as many child processes as possible. + Ignore failures when setting the default "any" device DLL to LINUX_SLL2. + Fix for backends which doesn't support capsicum. + Update ND_BYTES_BETWEEN() macro for better accuracy. + Update ND_BYTES_AVAILABLE_AFTER() macro for better accuracy. + Introduce new ND_ICHECK*() macros to deduplicate more code. + Skip privilege dropping when using -Z root on --with-user builds. + Add a nd_printjn() function. + Make nd_trunc_longjmp() not static inline. + Include <time.h> from netdissect.h. + Remove init_crc10_table() and the entourage. + Initialize tzcode early. + Capsicum support: Fix a 'not defined' macro error. + Update the "Error converting time" tests for packet times. + Fix warnings when building for 32-bit and defining _TIME_BITS=64. + Free interface list just before exiting where it wasn't being + freed. + Building and testing: + Add a configure option to help debugging (--enable-instrument-functions). + At build time require a proof of suitable snprintf(3) implementation in + libc (and document Solaris 9 as unsupported because of that). + Makefile.in: Add two "touch .devel" commands in the releasecheck target. + Autoconf: Get --with-user and --with-chroot right. + Autoconf: Fix --static-pcap-only test on Solaris 10. + Autoconf: Add some warning flags for clang 13 or newer. + Autoconf: Update config.{guess,sub}, timestamps 2024-01-01. + Autoconf: Add autogen.sh, remove configure and config.h.in and put + these generated files in the release tarball. + Autoconf: Update the install-sh script to the 2020-11-14.01 version. + configure: Apply autoupdate 2.69. + CMake: improve the comment before project(tcpdump C). + Do not require vsnprintf(). + tests: Use the -tttt option, by default, for the tests. + Autoconf, CMake: Get the size of a void * and a time_t. + Fix propagation of cc_werr_cflags() output. + Makefile.in: Fix the depend target. + mkdep: Exit with a non-zero status if a command fails. + Autoconf: use V_INCLS to update the list of include search paths. + Autoconf: don't put anything before -I and -L flags for local libpcap. + Autoconf, CMake: work around an Xcode 15+ issue. + Autoconf, CMake: use pkg-config and Homebrew when looking for + libcrypto. + Fix Sun C invocation from CMake. + mkdep: Use TMPDIR if it is set and not null. + Add initial support for building with TinyCC. + Makefile.in: Use the variable MAKE instead of the make command. + Makefile.in: Add instrumentation configuration in releasecheck target. + Make various improvements to the TESTrun script. + Untangle detection of pcap_findalldevs(). + Autoconf: don't use egrep, use $EGREP. + Autoconf: check for gethostbyaddr(), not gethostbyname(). + Autoconf, CMake: search for gethostbyaddr() in libnetwork. + Make illumos build warning-free. + Documentation: + Fixed errors in doc/README.Win32.md and renamed it to README.windows.md. + Make various improvements to the man page. + Add initial README file for Haiku. + Make various improvements to CONTRIBUTING.md. + Friday, April 7, 2023 / The Tcpdump Group Summary for 4.99.4 tcpdump release Source code: @@ -184,7 +309,7 @@ Wednesday, June 9, 2021 by gharris Fix "make clean" for out-of-tree autotools builds CMake: add stuff from CMAKE_PREFIX_PATH to PKG_CONFIG_PATH. Documentation: - man: Update a reference as www.cifs.org is gone. [skip ci] + man: Update a reference as www.cifs.org is gone. man: Update DNS sections Solaris: Fix a compile error with Sun C @@ -913,7 +1038,7 @@ Wed. April 25, 2007. ken@xelerance.com. Summary for 3.9.6 tcpdump release RFC 4340. Add support for per-VLAN spanning tree and per-VLAN rapid spanning tree Add support for Multiple-STP as per 802.1s - Add support for the cisco propriatry 'dynamic trunking protocol' + Add support for the cisco proprietary 'dynamic trunking protocol' Add support for the cisco proprietary VTP protocol Update dhcp6 options table as per IETF standardization activities @@ -1687,7 +1812,7 @@ v2.0.1 Sun Jan 26 21:10:10 PDT - Ultrix 4.0 is supported (also thanks to Jeff Mogul). - IBM RT and Stanford Enetfilter support has been added by - Rayan Zachariassen <rayan@canet.ca>. Tcpdump has been tested under + Rayan Zachariassen <rayan@canet.ca>. tcpdump has been tested under both the vanilla Enetfilter interface, and the extended interface (#ifdef'd by IBMRTPC) present in the MERIT version of the Enetfilter. diff --git a/contrib/tcpdump/CMakeLists.txt b/contrib/tcpdump/CMakeLists.txt index 9495b5d4c234..f9071295eff1 100644 --- a/contrib/tcpdump/CMakeLists.txt +++ b/contrib/tcpdump/CMakeLists.txt @@ -2,21 +2,26 @@ if(WIN32) # # We need 3.12 or later, so that we can set policy CMP0074; see # below. + # cmake_minimum_required(VERSION 3.12) else(WIN32) # - # For now, require only 2.8.6, just in case somebody is - # configuring with CMake on a "long-term support" version - # of some OS and that version supplies an older version of - # CMake. + # For now: + # + # if this is a version of CMake less than 3.5, require only + # 2.8.12, just in case somebody is configuring with CMake + # on a "long-term support" version # of some OS and that + # version supplies an older version of CMake; # - # If this is ever updated to CMake 3.1 or later, remove the - # stuff in cmake/Modules/FindPCAP.cmake that appends subdirectories - # of directories from CMAKE_PREFIX_PATH to the PKG_CONFIG_PATH - # environment variable when running pkg-config, to make sure - # it finds any .pc file from there. + # otherwise, require 3.5, so we don't get messages warning + # that support for versions of CMake lower than 3.5 is + # deprecated. # - cmake_minimum_required(VERSION 2.8.12) + if(CMAKE_VERSION VERSION_LESS "3.5") + cmake_minimum_required(VERSION 2.8.12) + else() + cmake_minimum_required(VERSION 3.5) + endif() endif(WIN32) # @@ -77,7 +82,7 @@ endif() # If, for whatever reason, directories in which we search for external # libraries, other than the standard system library directories, are # added to the executable's rpath in the build process, we most -# defintely want them in the installed image's rpath if they are +# definitely want them in the installed image's rpath if they are # necessary in order to find the libraries at run time. # set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) @@ -85,7 +90,13 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) # -# OK, this is a royal pain. +# We explicitly indicate what languages are used in tcpdump to avoid +# checking for a C++ compiler. +# +# One reason to avoid that check is that there's no need to waste +# configuration time performing it. +# +# Another reason is that: # # CMake will try to determine the sizes of some data types, including # void *, early in the process of configuration; apparently, it's done @@ -111,11 +122,88 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) # building 32-bit, the size for C++ will win, and, again, hilarity # will ensue. # -# So we *explicitly* state that only C is used; there is currently no -# C++ code in tcpdump. -# project(tcpdump C) +# +# Export the size of void * as SIZEOF_VOID_P so that it can be +# tested with #if. +# +set(SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}") + +# +# Show the bit width for which we're compiling. +# This can help debug problems if you're dealing with a compiler that +# defaults to generating 32-bit code even when running on a 64-bit +# platform, and where that platform may provide only 64-bit versions of +# libraries that we might use (looking at *you*, Oracle Studio!). +# +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + message(STATUS "Building 32-bit") +elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) + message(STATUS "Building 64-bit") +endif() + +# +# Solaris pkg-config is annoying. For at least one package (D-Bus, I'm +# looking at *you*!), there are separate include files for 32-bit and +# 64-bit builds (I guess using "unsigned long long" as a 64-bit integer +# type on a 64-bit build is like crossing the beams or something), and +# there are two separate .pc files, so if we're doing a 32-bit build we +# should make sure we look in /usr/lib/pkgconfig for .pc files and if +# we're doing a 64-bit build we should make sure we look in +# /usr/lib/amd64/pkgconfig for .pc files. +# +if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_VERSION MATCHES "5[.][0-9.]*") + # + # Note: string(REPLACE) does not appear to support using ENV{...} + # as an argument, so we set a variable and then use set() to set + # the environment variable. + # + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + # + # 64-bit build. If /usr/lib/pkgconfig appears in the path, + # prepend /usr/lib/amd64/pkgconfig to it; otherwise, + # put /usr/lib/amd64 at the end. + # + if((NOT DEFINED ENV{PKG_CONFIG_PATH}) OR "$ENV{PKG_CONFIG_PATH}" EQUAL "") + # + # Not set, or empty. Set it to /usr/lib/amd64/pkgconfig. + # + set(fixed_path "/usr/lib/amd64/pkgconfig") + elseif("$ENV{PKG_CONFIG_PATH}" MATCHES "/usr/lib/pkgconfig") + # + # It contains /usr/lib/pkgconfig. Prepend + # /usr/lib/amd64/pkgconfig to /usr/lib/pkgconfig. + # + string(REPLACE "/usr/lib/pkgconfig" + "/usr/lib/amd64/pkgconfig:/usr/lib/pkgconfig" + fixed_path "$ENV{PKG_CONFIG_PATH}") + else() + # + # Not empty, but doesn't contain /usr/lib/pkgconfig. + # Append /usr/lib/amd64/pkgconfig to it. + # + set(fixed_path "$ENV{PKG_CONFIG_PATH}:/usr/lib/amd64/pkgconfig") + endif() + set(ENV{PKG_CONFIG_PATH} "${fixed_path}") + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + # + # 32-bit build. If /usr/amd64/lib/pkgconfig appears in the path, + # prepend /usr/lib/pkgconfig to it. + # + if("$ENV{PKG_CONFIG_PATH}" MATCHES "/usr/lib/amd64/pkgconfig") + # + # It contains /usr/lib/amd64/pkgconfig. Prepend + # /usr/lib/pkgconfig to /usr/lib/amd64/pkgconfig. + # + string(REPLACE "/usr/lib/amd64/pkgconfig" + "/usr/lib/pkgconfig:/usr/lib/amd64/pkgconfig" + fixed_path "$ENV{PKG_CONFIG_PATH}") + set(ENV{PKG_CONFIG_PATH} "${fixed_path}") + endif() + endif() +endif() + # # For checking if a compiler flag works and adding it if it does. # @@ -266,8 +354,6 @@ file(STRINGS ${tcpdump_SOURCE_DIR}/VERSION # Project settings ###################################### -add_definitions(-DHAVE_CONFIG_H) - include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${tcpdump_SOURCE_DIR} @@ -320,10 +406,17 @@ include(CheckStructHasMember) include(CheckVariableExists) include(CheckTypeSize) +# +# Get the size of a time_t, to know whether it's 32-bit or 64-bit. +# +cmake_push_check_state() +set(CMAKE_EXTRA_INCLUDE_FILES time.h) +check_type_size("time_t" SIZEOF_TIME_T) +cmake_pop_check_state() + # # Header files. # -check_include_file(fcntl.h HAVE_FCNTL_H) check_include_file(rpc/rpc.h HAVE_RPC_RPC_H) check_include_file(net/if.h HAVE_NET_IF_H) if(HAVE_RPC_RPC_H) @@ -368,7 +461,12 @@ else(WIN32) if(LIBNSL_HAS_GETHOSTBYADDR) set(TCPDUMP_LINK_LIBRARIES ${TCPDUMP_LINK_LIBRARIES} nsl) else(LIBNSL_HAS_GETHOSTBYADDR) - message(FATAL_ERROR "gethostbyaddr is required, but wasn't found") + check_library_exists(network gethostbyaddr "" LIBNETWORK_HAS_GETHOSTBYADDR) + if(LIBNETWORK_HAS_GETHOSTBYADDR) + set(TCPDUMP_LINK_LIBRARIES ${TCPDUMP_LINK_LIBRARIES} network) + else(LIBNETWORK_HAS_GETHOSTBYADDR) + message(FATAL_ERROR "gethostbyaddr is required, but wasn't found") + endif(LIBNETWORK_HAS_GETHOSTBYADDR) endif(LIBNSL_HAS_GETHOSTBYADDR) endif(LIBSOCKET_HAS_GETHOSTBYADDR) endif(NOT STDLIBS_HAVE_GETHOSTBYADDR) @@ -396,20 +494,68 @@ endif(STDLIBS_HAVE_GETSERVENT) cmake_pop_check_state() # -# Make sure we have vsnprintf() and snprintf(); we require them. -# We use check_symbol_exists(), as they aren't necessarily external -# functions - in Visual Studio, for example, they're inline functions -# calling a common external function. +# Make sure we have snprintf(); we require it. +# We use check_symbol_exists(), as it isn't necessarily an external +# function - in Visual Studio, for example, it is an inline function +# calling an external function. # -check_symbol_exists(vsnprintf "stdio.h" HAVE_VSNPRINTF) -if(NOT HAVE_VSNPRINTF) - message(FATAL_ERROR "vsnprintf() is required but wasn't found") -endif(NOT HAVE_VSNPRINTF) check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF) if(NOT HAVE_SNPRINTF) message(FATAL_ERROR "snprintf() is required but wasn't found") endif() +# +# Require a proof of suitable snprintf(3), same as in Autoconf. +# +include(CheckCSourceRuns) +check_c_source_runs(" +#include <stdio.h> +#include <string.h> +#include <inttypes.h> +#include <sys/types.h> + +int main() +{ + char buf[100]; + uint64_t t = (uint64_t)1 << 32; + + snprintf(buf, sizeof(buf), \"%zu\", sizeof(buf)); + if (strncmp(buf, \"100\", sizeof(buf))) + return 1; + + snprintf(buf, sizeof(buf), \"%zd\", -sizeof(buf)); + if (strncmp(buf, \"-100\", sizeof(buf))) + return 2; + + snprintf(buf, sizeof(buf), \"%\" PRId64, -t); + if (strncmp(buf, \"-4294967296\", sizeof(buf))) + return 3; + + snprintf(buf, sizeof(buf), \"0o%\" PRIo64, t); + if (strncmp(buf, \"0o40000000000\", sizeof(buf))) + return 4; + + snprintf(buf, sizeof(buf), \"0x%\" PRIx64, t); + if (strncmp(buf, \"0x100000000\", sizeof(buf))) + return 5; + + snprintf(buf, sizeof(buf), \"%\" PRIu64, t); + if (strncmp(buf, \"4294967296\", sizeof(buf))) + return 6; + + return 0; +} + +" + SUITABLE_SNPRINTF +) +if(NOT SUITABLE_SNPRINTF) + message(FATAL_ERROR +"The snprintf(3) implementation in this libc is not suitable, +tcpdump would not work correctly even if it managed to compile." + ) +endif() + check_function_exists(getopt_long HAVE_GETOPT_LONG) check_function_exists(setlinebuf HAVE_SETLINEBUF) # @@ -618,6 +764,14 @@ set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) # check_include_file(pcap/pcap-inttypes.h HAVE_PCAP_PCAP_INTTYPES_H) +# +# At compile time HAVE_PCAP_FINDALLDEVS depends on HAVE_PCAP_IF_T. +# +cmake_push_check_state() +set(CMAKE_EXTRA_INCLUDE_FILES pcap.h) +check_type_size(pcap_if_t PCAP_IF_T) +cmake_pop_check_state() + # # Check for various functions in libpcap/WinPcap/Npcap. # @@ -707,19 +861,6 @@ endif(HAVE_PCAP_CREATE) # if we have them. # check_function_exists(pcap_findalldevs HAVE_PCAP_FINDALLDEVS) -if(HAVE_PCAP_FINDALLDEVS) - # - # Check for libpcap having pcap_findalldevs() but the pcap.h header - # not having pcap_if_t; some versions of Mac OS X shipped with pcap.h - # from 0.6 and libpcap 0.8, so that libpcap had pcap_findalldevs but - # pcap.h didn't have pcap_if_t. - # - cmake_push_check_state() - set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) - set(CMAKE_EXTRA_INCLUDE_FILES pcap.h) - check_type_size(pcap_if_t PCAP_IF_T) - cmake_pop_check_state() -endif(HAVE_PCAP_FINDALLDEVS) check_function_exists(pcap_dump_flush HAVE_PCAP_DUMP_FLUSH) check_function_exists(pcap_lib_version HAVE_PCAP_LIB_VERSION) if(NOT HAVE_PCAP_LIB_VERSION) @@ -728,8 +869,56 @@ endif(NOT HAVE_PCAP_LIB_VERSION) check_function_exists(pcap_setdirection HAVE_PCAP_SETDIRECTION) check_function_exists(pcap_set_immediate_mode HAVE_PCAP_SET_IMMEDIATE_MODE) check_function_exists(pcap_dump_ftell64 HAVE_PCAP_DUMP_FTELL64) -check_function_exists(pcap_open HAVE_PCAP_OPEN) -check_function_exists(pcap_findalldevs_ex HAVE_PCAP_FINDALLDEVS_EX) +# +# macOS Sonoma's libpcap includes stub versions of the remote- +# capture APIs. They are exported as "weakly linked symbols". +# +# Xcode 15 offers only a macOS Sonoma SDK, which has a .tbd +# file for libpcap that claims it includes those APIs. (Newer +# versions of macOS don't provide the system shared libraries, +# they only provide the dyld shared cache containing those +# libraries, so the OS provides SDKs that include a .tbd file +# to use when linking.) +# +# This means that check_function_exists() will think that +# the remote-capture APIs are present, including pcap_open() +# and pcap_findalldevs_ex(). +# +# However, they are *not* present in macOS Ventura and earlier, +# which means that building on Ventura with Xcode 15 produces +# executables that fail to start because one of those APIs +# isn't found in the system libpcap. +# +# Protecting calls to those APIs with __builtin_available() +# does not prevent this, because the libpcap header files +# in the Sonoma SDK mark them as being first available +# in macOS 10.13, just like all the other routines introduced +# in libpcap 1.9, even though they're only available if libpcap +# is built with remote capture enabled or stub routines are +# provided. (A fix to enable this has been checked into the +# libpcap repository, and may end up in a later version of +# the SDK.) +# +# Given all that, and given that the versions of the +# remote-capture APIs in Sonoma are stubs that always fail, +# there doesn't seem to be any point in checking for pcap_open() +# and pcap_findalldevs_ex() if we're linking against the Apple libpcap. +# +# However, if we're *not* linking against the Apple libpcap, +# we should check for it, so that we can use it if it's present. +# +# So we check for pcap_open() and pcap_findalldevs_ex() if 1) this isn't +# macOS or 2) the the libpcap we found is not a system library, meaning +# that its path begins neither with /usr/lib (meaning it's a system +# dylib) nor /Application/Xcode.app (meaning it's a file in +# the Xcode SDK). +# +if(NOT APPLE OR NOT + (PCAP_LIBRARIES MATCHES "/usr/lib/.*" OR + PCAP_LIBRARIES MATCHES "/Application/Xcode.app/.*")) + check_function_exists(pcap_open HAVE_PCAP_OPEN) + check_function_exists(pcap_findalldevs_ex HAVE_PCAP_FINDALLDEVS_EX) +endif() # # On Windows, check for pcap_wsockinit(); if we don't have it, check for @@ -787,11 +976,6 @@ endif(WITH_SMI) if(WITH_CRYPTO) find_package(CRYPTO) if(CRYPTO_FOUND) - # - # Check for some headers and functions. - # - check_include_file(openssl/evp.h HAVE_OPENSSL_EVP_H) - # # 1) do we have EVP_CIPHER_CTX_new? # If so, we use it to allocate an EVP_CIPHER_CTX, as @@ -958,9 +1142,9 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) # We do *not* care whether a structure had padding added at # the end because of __declspec(align) - *we* don't use # __declspec(align), because the only structures whose layout - # we precisely specify are those that get overlayed on packet + # we precisely specify are those that get overlaid on packet # data, and in those every element is an array of octets so - # that we have full control over the size and aligmnet, and, + # that we have full control over the size and alignment, and, # apparently, jmp_buf has such a declaration on x86, meaning # that everything that includes netdissect.h, i.e. almost every # file in tcpdump, gets a warning. @@ -979,12 +1163,19 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel) check_and_add_compiler_option(-Wmissing-prototypes) check_and_add_compiler_option(-Wmissing-variable-declarations) check_and_add_compiler_option(-Wold-style-definition) - check_and_add_compiler_option(-Wpedantic) + if(NOT CMAKE_C_COMPILER_ID MATCHES "Sun") + # In Sun C versions that implement GCC compatibility "-Wpedantic" + # means the same as "-pedantic". The latter is mutually exclusive + # with several other options. One of those is "-xc99", which has + # already been set for Sun C above. + check_and_add_compiler_option(-Wpedantic) + endif() check_and_add_compiler_option(-Wpointer-arith) check_and_add_compiler_option(-Wpointer-sign) check_and_add_compiler_option(-Wshadow) check_and_add_compiler_option(-Wsign-compare) check_and_add_compiler_option(-Wstrict-prototypes) + check_and_add_compiler_option(-Wundef) check_and_add_compiler_option(-Wunreachable-code-return) check_and_add_compiler_option(-Wused-but-marked-unused) check_and_add_compiler_option(-Wwrite-strings) @@ -998,9 +1189,13 @@ endif() # usage: cmake -DEXTRA_CFLAGS='-Wall -Wextra -Werror' ... # if(NOT "${EXTRA_CFLAGS}" STREQUAL "") - foreach(_extra_cflag ${EXTRA_CFLAGS}) - check_and_add_compiler_option("${_extra_cflag}") - endforeach(_extra_cflag) + # The meaning of EXTRA_CFLAGS is "use the exact specified options, or the + # build risks failing to fail", not "try every specified option, omit those + # that do not work and use the rest". Thus use add_compile_options(), not + # foreach()/check_and_add_compiler_option(). Another reason to do that is + # that the effect lasts in testprogs/ and testprogs/fuzz/. + string(REPLACE " " ";" _extra_cflags_list ${EXTRA_CFLAGS}) + add_compile_options(${_extra_cflags_list}) message(STATUS "Added extra compile options (${EXTRA_CFLAGS})") endif() diff --git a/contrib/tcpdump/CONTRIBUTING.md b/contrib/tcpdump/CONTRIBUTING.md index 26f226ebd973..215e4c6831c4 100644 --- a/contrib/tcpdump/CONTRIBUTING.md +++ b/contrib/tcpdump/CONTRIBUTING.md @@ -36,17 +36,17 @@ and ask! ## How to add new code and to update existing code -0) Check that there isn't a pull request already opened for the changes you +1) Check that there isn't a pull request already opened for the changes you intend to make. -1) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump +2) [Fork](https://help.github.com/articles/fork-a-repo/) the Tcpdump [repository](https://github.com/the-tcpdump-group/tcpdump). -2) The easiest way to test your changes on multiple operating systems and +3) The easiest way to test your changes on multiple operating systems and architectures is to let the upstream CI test your pull request (more on this below). -3) Setup your git working copy +4) Setup your git working copy ``` git clone https://github.com/<username>/tcpdump.git cd tcpdump @@ -54,19 +54,19 @@ and ask! git fetch upstream ``` -4) Do a `touch .devel` in your working directory. +5) Do a `touch .devel` in your working directory. Currently, the effect is * add (via `configure`, in `Makefile`) some warnings options (`-Wall`, `-Wmissing-prototypes`, `-Wstrict-prototypes`, ...) to the compiler if it supports these options, * have the `Makefile` support `make depend` and the `configure` script run it. -5) Configure and build +6) Configure and build ``` ./configure && make -s && make check ``` -6) Add/update tests +7) Add/update tests The `tests` directory contains regression tests of the dissection of captured packets. Those captured packets were saved running tcpdump with option `-w sample.pcap`. Additional options, such as `-n`, are used to create relevant @@ -96,12 +96,12 @@ and ask! It is often useful to have test outputs with different verbosity levels (none, `-v`, `-vv`, `-vvv`, etc.) depending on the code. -7) Test using `make check` (current build options) and `./build_matrix.sh` +8) Test using `make check` (current build options) and `./build_matrix.sh` (a multitude of build options, build systems and compilers). If you can, test on more than one operating system. Don't send a pull request until all tests pass. -8) Try to rebase your commits to keep the history simple. +9) Try to rebase your commits to keep the history simple. ``` git fetch upstream git rebase upstream/master @@ -109,32 +109,76 @@ and ask! (If the rebase fails and you cannot resolve, issue `git rebase --abort` and ask for help in the pull request comment.) -9) Once 100% happy, put your work into your forked repository using `git push`. +10) Once 100% happy, put your work into your forked repository using `git push`. -10) [Initiate and send](https://help.github.com/articles/using-pull-requests/) +11) [Initiate and send](https://help.github.com/articles/using-pull-requests/) a pull request. This will trigger the upstream repository CI tests. ## Code style and generic remarks -* A thorough reading of some other printers code is useful. +1) A thorough reading of some other printers code is useful. -* Put the normative reference if any as comments (RFC, etc.). +2) To help learn how tcpdump works or to help debugging: + You can configure and build tcpdump with the instrumentation of functions: + ``` + $ ./configure --enable-instrument-functions + $ make -s clean all + ``` + + This generates instrumentation calls for entry and exit to functions. + Just after function entry and just before function exit, these + profiling functions are called and print the function names with + indentation and call level. + + If entering in a function, it prints also the calling function name with + file name and line number. There may be a small shift in the line number. + + In some cases, with Clang 11, the file number is unknown (printed '??') + or the line number is unknown (printed '?'). In this case, use GCC. + + If the environment variable INSTRUMENT is + - unset or set to an empty string, print nothing, like with no + instrumentation + - set to "all" or "a", print all the functions names + - set to "global" or "g", print only the global functions names + + This allows to run: + ``` + $ INSTRUMENT=a ./tcpdump ... + $ INSTRUMENT=g ./tcpdump ... + $ INSTRUMENT= ./tcpdump ... + ``` + or + ``` + $ export INSTRUMENT=global + $ ./tcpdump ... + ``` + + The library libbfd is used, therefore the binutils-dev package is required. -* Put the format of packets/headers/options as comments if there is no +3) Put the normative reference if any as comments (RFC, etc.). + +4) Put the format of packets/headers/options as comments if there is no published normative reference. -* The printer may receive incomplete packet in the buffer, truncated at any +5) The printer may receive incomplete packet in the buffer, truncated at any random position, for example by capturing with `-s size` option. + This means that an attempt to fetch packet data based on the expected + format of the packet may run the risk of overrunning the buffer. + + Furthermore, if the packet is complete, but is not correctly formed, + that can also cause a printer to overrun the buffer, as it will be + fetching packet data based on the expected format of the packet. + + Therefore, integral, IPv4 address, and octet sequence values should + be fetched using the `GET_*()` macros, which are defined in + `extract.h`. + If your code reads and decodes every byte of the protocol packet, then to ensure proper and complete bounds checks it would be sufficient to read all - packet data using the `GET_*()` macros, typically: - ``` - GET_U_1(p) - GET_S_1(p) - GET_BE_U_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } - GET_BE_S_n(p), n in { 2, 3, 4, 5, 6, 7, 8 } *** 22507 LINES SKIPPED *** From nobody Tue Oct 8 00:42:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMy0l0SJhz5YgwK; Tue, 08 Oct 2024 00:42:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMy0k6bHqz486R; Tue, 8 Oct 2024 00:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728348166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGHQJJWsus76KPknWslsbaT38++ihCyOe5aCqXyFoYo=; b=oEIzmTGX4ixVyVdYsnLA+rOuZLWJRQIn0ro/1SkgX4prFJ8DuxiwxTtaWpWkJbaOjh10v7 sDxZ/z5WCzqxu0/4emwZbScT5e2/MU163D7FRpGrXuXh1eyccAy1iZuLQOX2dTLygUmKDf m8q7V1nOgX5oFMBc61LRtdySY6ArLbCSCWjPmNGmtDjV9XY5lzbNA83nxEqVDrR2uTNVWp 7Ab7sPhYDO9ovBKR1Wncfvv/0RlGpr0ztoTF87gFpuZgjY/Fmx2KiwHZARi30ddCPQ8Dq5 3PF5EykSduqoAykMIyyilKTlwfe1KNqOIh5ewIO0kG5320aqOqPNbdgXJ/7feA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728348166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NGHQJJWsus76KPknWslsbaT38++ihCyOe5aCqXyFoYo=; b=b9xtF2FDBuK9Cuwoe61qJJ2U4Nl5V1nBy5ZLnBS+A7HXj5YMxFMfS7v7f0evUlhODuYvrl j+fFh4le4H1KjsZqSpiKGDl98v3fZvsa8vzeVcWR6QKqlv0oUVy9IanWrZrt9oLRLZjLz6 FtukdFEa6OhIrCkY2D9QJupouhI1UUJzf9S9JyILwCytWTnM8/yiHim9Zj1afaPH9a/Pjl K030BOBRmxKkn7QBa3FUYmgnQMVfaylubYK7zPbMG92Ts1IQD6PjnLJbKiyyNkiNmPkaC8 VD+ua24AQHPzUBplTRZ8M3Lwl7ypoTUPzjwjfHk8D9z0zvFwqHL25v3tXqax7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728348166; a=rsa-sha256; cv=none; b=wqoaOji1tG0UI+1lK3ddrgNdvoeXJxISKGf9dug6xiskgbgnenvsPHvEqbJDFYIQvyA9NC QWC9uD9zZC0aErOVCragESdFLEVj5ED196rx9+HMixPK4q+TApBzDjJS5pIyQYyyKBVN4R 4I0siDlTG+eGu+YpgqDTu7dn+pfEm+5L/qKK39KeigLof9xvTPjiu3sKtZWmhYK6eweI3H VnS9KDcRGuoYx1cn5nIHiVfy/srt5+cTca+8Mrgy+6/TgmhXBOw+7VxU5rOq7v8ZcsVn38 08uVWFc2YY5/qFnuG4mhT90FpDy86l9CjvhLUcCOruUkSvyKuRoJsJMIxT/47g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMy0k6Bh3z182P; Tue, 8 Oct 2024 00:42:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4980gkYh002947; Tue, 8 Oct 2024 00:42:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4980gkxG002944; Tue, 8 Oct 2024 00:42:46 GMT (envelope-from git) Date: Tue, 8 Oct 2024 00:42:46 GMT Message-Id: <202410080042.4980gkxG002944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Joseph Mingrone <jrm@FreeBSD.org> Subject: git: 80b19c315004 - stable/14 - ObsoleteFiles.inc: Update after libpcap upgrade from 1.10.4 to 1.10.5 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 80b19c31500493dc440833761850fea49fbf7f30 Auto-Submitted: auto-generated The branch stable/14 has been updated by jrm: URL: https://cgit.FreeBSD.org/src/commit/?id=80b19c31500493dc440833761850fea49fbf7f30 commit 80b19c31500493dc440833761850fea49fbf7f30 Author: Joseph Mingrone <jrm@FreeBSD.org> AuthorDate: 2024-09-14 17:13:23 +0000 Commit: Joseph Mingrone <jrm@FreeBSD.org> CommitDate: 2024-10-08 00:41:10 +0000 ObsoleteFiles.inc: Update after libpcap upgrade from 1.10.4 to 1.10.5 Sponsored by: The FreeBSD Foundation (cherry picked from commit 407a9cced68440ce86f1c5d86c57e6b4ec3e4618) --- ObsoleteFiles.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 1a7441b80158..a39336af81db 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20240914 libpcap upgrade from 1.10.4 to 1.10.5 +OLD_FILES+=contrib/libpcap/pcap-haiku.cpp +OLD_FILES+=contrib/libpcap/pcap-rpcap-int.h +OLD_FILES+=contrib/libpcap/pcap-usb-linux-common.c + # 20240827: retire fips.so OLD_LIBS+=usr/lib/ossl-modules/fips.so From nobody Tue Oct 8 04:01:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN2QX6d5wz5Yt4r; Tue, 08 Oct 2024 04:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN2QX61Bbz4VnC; Tue, 8 Oct 2024 04:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Fa+a6Jbg/ijHgWeWNKvPBAK5NNZO8HJjGbZmINWJIE=; b=AckwM/2st+nHf8/k+eXaRyMFTeFLa9GEBKD4xa/rorBoN7xv1T3r6oE9tHmV4g2dg4fW+Z z3BJQwU8W89D65jMzLviqm5j06doNaVXXsd/vhxviqf+rVauG9TTVZ/Yul7n35nbJGgbC+ VbxFo46fZZLM/bvQg+NMy2z6w4s1tySS/M0mlMGfil5Q3JuZ6DgjsOr1YksWNugzNISKeI GnMxKSgo+7jMEJEzJjO1b0eAEn6J1nAYTHYZ5OYzVLg8kEEi7BqNxkNq+st82lKUAS6V2G b6kM7Ee69kS37CrQ61elVwjYV9NRMpbvS0ejkmwOvSnfW8pV3ya5lJBT9iFwbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Fa+a6Jbg/ijHgWeWNKvPBAK5NNZO8HJjGbZmINWJIE=; b=g0aD1nRkY45u38Tbr/ilmvDWf1+O8lUjaIlL8QEPvzU3/2aYdByn3B0phWTw4b6oY5uSZJ QcMwaOfyMCTrar6s5xTHMOhkxlMMsjINGPhrdjSRGD7EJUHhOQKFUsuz8Kb6EtUlpyVDHP TyJBPzD8eJAfc6qapMUBGB60LxOc7S61J2dBfYW8AizxAeLVVAJn/DbK0m+W6GNl3+jW0S 1rMOsrsbUE/QlH5FvjxYUGjRgPgNhZQgFuSO/B/CW54p1JzwgaNIDh5fgDF0kkOBxUWTdK nSbfOwWwTM78iLdUS4Z3/XmNbqj7XQBxkrvkkSK8DihYK+jtVdOgZw7aJMKeyQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728360116; a=rsa-sha256; cv=none; b=minQ+bLrRlCxmED6A+ouBwyzGHAiL8z0zLKfkm+PM5aJXaKV/FYwwaKuHNg7yXVc31zq/C pFxGeHdQaUYDIxrvEItTvkmQoLNsxFw56Qj/odxYfaThQKnM5LbxH0864+MZfB9gz90s/p kcrxMewpHAf0/2YqwrX7rKe0lQj2q8HUhf3PlE9adm3P084gzom80+CbXs4AHegxrPL4RQ RgOfoomu5KzB6Olskv426xuXllzHcslP08ucdP7Bs8PB2idmZw+od+Tw9ruVH5+U79XfWY yJrEO5+0SYH+ECb95soT+neNv5Gyf7C4zRgT3AD54p4dlL8r4X7SwCvnW/JM1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN2QX5c3SzFNs; Tue, 8 Oct 2024 04:01:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49841ubb044557; Tue, 8 Oct 2024 04:01:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49841uXi044554; Tue, 8 Oct 2024 04:01:56 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:01:56 GMT Message-Id: <202410080401.49841uXi044554@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 381601cfcb56 - stable/13 - ifnet: make if_alloc_domain() never fail List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 381601cfcb56a98a14dcbfddb1b2be0ea7a5192c Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=381601cfcb56a98a14dcbfddb1b2be0ea7a5192c commit 381601cfcb56a98a14dcbfddb1b2be0ea7a5192c Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2021-11-23 03:49:57 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 04:00:59 +0000 ifnet: make if_alloc_domain() never fail The last consumer of if_com_alloc() is firewire. It never fails to allocate. Most likely the if_com_alloc() KPI will go away together with if_fwip(), less likely new consumers of if_com_alloc() will be added, but they would need to follow the no fail KPI. MFC note: As for stable/13, there is one additional consumer sppp, which also never fails to allocate. This MFCing is mainly to keep behavioral compatibility of if_alloc_domain() and its wrappers if_alloc(), if_alloc_dev(), and if_gethandle() with stable/14 and onward branches. 3rd party drivers should be ready for this for years as this behavioral change was done in stable/14 at November 22 2021. As a good effect new drivers to be MFCed to stable/13 do not have to conditionally check failure from if_alloc() for stable/13. (cherry picked from commit 4787572d0580c6fdf818fd64efa3089de88720f0) --- sys/net/if.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index a7aed084143c..78da7cf02bfb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -399,7 +399,7 @@ ifindex_alloc(void **old) } static void -ifindex_free_locked(u_short idx) +ifindex_free(u_short idx) { IFNET_WLOCK_ASSERT(); @@ -410,15 +410,6 @@ ifindex_free_locked(u_short idx) V_if_index--; } -static void -ifindex_free(u_short idx) -{ - - IFNET_WLOCK(); - ifindex_free_locked(idx); - IFNET_WUNLOCK(); -} - static void ifnet_setbyindex(u_short idx, struct ifnet *ifp) { @@ -631,11 +622,8 @@ if_alloc_domain(u_char type, int numa_domain) #endif if (if_com_alloc[type] != NULL) { ifp->if_l2com = if_com_alloc[type](type, ifp); - if (ifp->if_l2com == NULL) { - free(ifp, M_IFNET); - ifindex_free(idx); - return (NULL); - } + KASSERT(ifp->if_l2com, ("%s: if_com_alloc[%u] failed", __func__, + type)); } IF_ADDR_LOCK_INIT(ifp); @@ -730,7 +718,7 @@ if_free(struct ifnet *ifp) KASSERT(ifp == ifnet_byindex(ifp->if_index), ("%s: freeing unallocated ifnet", ifp->if_xname)); - ifindex_free_locked(ifp->if_index); + ifindex_free(ifp->if_index); IFNET_WUNLOCK(); if (refcount_release(&ifp->if_refcount)) @@ -1334,7 +1322,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) * or we'd lock on one vnet and unlock on another. */ IFNET_WLOCK(); - ifindex_free_locked(ifp->if_index); + ifindex_free(ifp->if_index); IFNET_WUNLOCK(); /* From nobody Tue Oct 8 04:03:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN2SD4mXCz5Yt53; Tue, 08 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN2SD4L1lz4W5m; Tue, 8 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B2Tg45KjlWCGUkOUXhEfE6tS82M3hfWD44U1Udp+6wo=; b=IfGad6fdpdzaC1LgRrbhJAhdLqM5DDykjWL+pjZGMfTdesyeTJZuTcodij3RXTn//p7au4 BpRL0NybGvZBygb0miFd9bz4KyqxnzMXSIv4Pas2B1LAMQXC6JG/fnbIoY0ILUy/l5lGaW YAe9yLdxiHY8VGxVRPsCM22KaXmwOyVAEeIBZH3p/zR5g6uQ7LXmaz0fznrnWrTMMUfVmC ozHfYAMDcvVBw0BUwRSRjEj+3xbskp8tMGxLII51RiMnNQ5ySN9uXo+pb4CbBtQNfqpmZh EHG15S6fBGcHPI9fKED6gWNxfqLKyoAayUQGut4XXa2xfe4ceBqcqk3j3x080w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728360204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B2Tg45KjlWCGUkOUXhEfE6tS82M3hfWD44U1Udp+6wo=; b=fMR1VAiOqVnodajNDuNWnXxuX4fZ+YLh3rfzDmVMC5dyHgAp80pCuFx9KcKEac+jg1kbHI oO34hKot03z8OhESi3O/brJeK8CaM3cyS+IWvUH7v2E2gqf5+eo2QpfSwPZANRsaeAQr+B SnTKVMuqg9Z/mAx4oduqt4Rq2qKcI+GO/G6qe2Zu+v1wcZjiAonp5deSWErOJUZJNaW77b ry2kmkNx373SJDuK5o3EIa+sIbnGX1DpMEa0JjgE686/JmzzjG2nRSPll0kqbweJLl90Ot fB+ClXDGN+/ZDenWKNRWLRyvWHt7W0VHopS7qGLmTQ7KDaEl+lagd9eTE8G8JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728360204; a=rsa-sha256; cv=none; b=HnSofTblAjLn9RtJNaM8cevbVTKrO7aaNiHvQV8DXBTaDixpNYssXUJh7aWxFlUpA8ln8R k+pbTYV/wVu0fw98a+DN0pijoQVNvIzaUdXcRu3G0iDRC8q9i4RDczadYuSgpox3XADAFQ 3/oCimPhORbBM/f1EsTk0ojXM8FVm28WkYSUGuzqsPVOQcQMivSoAHwbe68UgXXtdy7dQ+ U1i4kyTtiZ8rfj6eYrSizvxHwui9usoxXLA8HxnLbS1FNiyf3JT7jAuQ+f983n0DAzi8gT U5II3RIHFNgDjVYIDx3QWtHvuXaVDhsWy7tQSbRmS6DhlsCHx3wgL286j1J2Ig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN2SD3xTjzFRn; Tue, 8 Oct 2024 04:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49843OGp044870; Tue, 8 Oct 2024 04:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49843OhC044867; Tue, 8 Oct 2024 04:03:24 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:03:24 GMT Message-Id: <202410080403.49843OhC044867@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 6b86b8f0f6b6 - stable/14 - netstat: increase width of Netif column List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 commit 6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62 Author: Lexi Winter <lexi@le-Fay.ORG> AuthorDate: 2024-05-08 09:44:29 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 04:02:24 +0000 netstat: increase width of Netif column The previous width of Netif (10 or 8) was too short for modern interface names; make it 12, which is long enough to display "epair0a.1000". This came up in practice with genet(4) interfaces, since the base interface name is long enough that with the previous limit, VLAN identifiers would be truncated at 1 character in the IPv6 output: "genet0.100" becomes "genet0.1". The width is now fixed, and doesn't depend on the address family, because there's no reason that length of the interface name would vary based on the AF. Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 (cherry picked from commit d33b87e8cf91a6bcb5eac0ecc0371c1041c61050) netstat: for -W, use IFNAMSIZ If -W is specified, use IFNAMSIZ as the width of the Netif column, instead of the default 12. (cherry picked from commit ae9c0ba8ef2f540f9030909cf07e3c59f876fd23) --- usr.bin/netstat/nhops.c | 5 ++--- usr.bin/netstat/route.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 19a7a6891050..c4412bc68081 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -65,16 +65,15 @@ #include "common.h" /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; static int wid_gw; @@ -416,7 +415,7 @@ print_nhops_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; xo_open_instance("rt-family"); pr_family(fam); xo_open_list("nh-entry"); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 9096d5f58daf..10d47c6a330e 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -191,16 +191,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ struct _wid wid; @@ -241,7 +240,7 @@ set_wid(int fam) wid.flags = 6; wid.pksent = 8; wid.mtu = 6; - wid.iface = WID_IF_DEFAULT(fam); + wid.iface = WID_IF_DEFAULT; wid.expire = 6; } From nobody Tue Oct 8 04:46:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN3PZ69hkz5Ywsj; Tue, 08 Oct 2024 04:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN3PZ5S8Nz4gD9; Tue, 8 Oct 2024 04:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njsVfvdtBZq5MxB78NepKRH+xK2TnMlpm+88qgOcsxs=; b=iITaemwAjHw50ovkMPzahY+VRD5eHXTVp66ocmW+1TXYdaHQjMlAwMF6FQy+XFleZoRkH6 qbUQercao0oaHDJYL9dmoO7KIfiBGQZumhNQ2ZKjNYV1fcGuiqiQQHqZor9Oad6/+klAZ9 z2k5NK4l/3JI9PP7WRofOv8SRWEqHEj9CT4bbItwqvbpMhuHqAosFXpz2VjgS2CmZJECAo GrrNV9r16mr4QLpviiC9wHlEfMtTP98njQa9X8mMlRXRMvr1H1RaMaAhRmTJBe4WydSn23 OlqBZ/5ZxLSC430ppcVed0c3FuGJfjOGehb3U7RaeqQyIBh/FhB5oBDi7rmPEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=njsVfvdtBZq5MxB78NepKRH+xK2TnMlpm+88qgOcsxs=; b=kdUpNovUY3xC1qC49h2y1vwkpYxKKuPYjwezbXF4rT9w7/nygIEy/g2054oAd+kVcKA3Q4 dlrsfAuQ2RACWFbw0QpqAOt1WHEWiBJAE4hN0ZFnmL9SmUh40LQ7Q1eJ1V6TlW7Jfe3xzD sXK0x5ANqFvXBeqqPec69exptq9MQPgcw8Dp/M9+8huIQWa7eovQdMY7z92p/zUqDnArqg 4CYHhXHqBJvgsSjxJaSL/InmPPO7pKX5SdoCAAD6jaahvW4kE8/8VoyqsWyrENmEUuhu69 84K7z8cMCXwXgt1R6OjazAUT7sRx1G5/N6g9piCFo9PXGpMHfGg+ISliEPsWbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728362770; a=rsa-sha256; cv=none; b=EXDsIxrsf9//iMHevq67fxcnGcHOBGsRWs8sKWFsW14lJBV2YmOvCXjKadh49s1k9mZGzl GHe0OahXfisK5R2taeDfjbngNRoeyrw0bJmJAYD1thQlGFhApcroNfR6jYOciSCUEfc4YX bPJ3hOXmA2PyAMaG4YJT4O1tQH5pCT9hhMj9XnN/HISSXdC0/XUU4U79cKkSTmYOEACeBg 4mbnEPK0RqcskY3RfBxS2h3ytvP60LvJwuzvMALP9+Bl05/CDhVK0++k7EBkJFc6tyXXyP hi6pb1DJil2uwq/nFRCUUBcHt+gDO5OCn3ddynNeD+pqA4KgY0G2QE1/t0ubWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN3PZ4f8bzGcB; Tue, 8 Oct 2024 04:46:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4984kA4a012572; Tue, 8 Oct 2024 04:46:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4984kATE012569; Tue, 8 Oct 2024 04:46:10 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:46:10 GMT Message-Id: <202410080446.4984kATE012569@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 18aa2a81c465 - stable/14 - hhook: Sprinkle const qualifiers where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 18aa2a81c4651be2c7705f26f98175efa4f7a859 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=18aa2a81c4651be2c7705f26f98175efa4f7a859 commit 18aa2a81c4651be2c7705f26f98175efa4f7a859 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 04:44:54 +0000 hhook: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 941f8aceac1b6c16ca4d96b52e60ab437c4f9207) --- sys/kern/kern_hhook.c | 8 ++++---- sys/sys/hhook.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c index f4ad16d99a12..432b889856ff 100644 --- a/sys/kern/kern_hhook.c +++ b/sys/kern/kern_hhook.c @@ -128,7 +128,7 @@ hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd) * Register a new helper hook function with a helper hook point. */ int -hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags) +hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki, uint32_t flags) { struct hhook *hhk, *tmp; int error; @@ -185,7 +185,7 @@ hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags) * struct in the array. */ int -hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) +hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags) { struct hhook_head **heads_to_hook, *hhh; int error, i, n_heads_to_hook; @@ -243,7 +243,7 @@ tryagain: * Remove a helper hook function from a helper hook point. */ int -hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki) +hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki) { struct hhook *tmp; @@ -270,7 +270,7 @@ hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki) * virtual instances of the hook point if it is virtualised). */ int -hhook_remove_hook_lookup(struct hookinfo *hki) +hhook_remove_hook_lookup(const struct hookinfo *hki) { struct hhook_head *hhh; diff --git a/sys/sys/hhook.h b/sys/sys/hhook.h index 084023ccb546..f83389fec2e3 100644 --- a/sys/sys/hhook.h +++ b/sys/sys/hhook.h @@ -107,14 +107,14 @@ struct hhook_head { /* Public KPI functions. */ void hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd); -int hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, +int hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki, uint32_t flags); -int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags); +int hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags); -int hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki); +int hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki); -int hhook_remove_hook_lookup(struct hookinfo *hki); +int hhook_remove_hook_lookup(const struct hookinfo *hki); int hhook_head_register(int32_t hhook_type, int32_t hhook_id, struct hhook_head **hhh, uint32_t flags); From nobody Tue Oct 8 04:46:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN3Pc0hTLz5Ywkw; Tue, 08 Oct 2024 04:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN3Pb5mz0z4g5t; Tue, 8 Oct 2024 04:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qvUXijfRMYZT1a7jfcJTAtJc7nztjUl5pCBgXZV00yY=; b=Lx9gyn63eHzedYvbnoMmtMnLlLvdI3SlKLKnH+77D/7YmFbrouuAxIu2LBCFLY0h9G0j0C SR5Y2zi3Om0bHIFm6ALuh+ZwmREQ5NPpokhCzY5CupYq+77oY6RdBwZvEAaB5UI6539DZ/ VE4Rp7mSQKBAy+4uvvXk9MbrBBi5nPNBOtNmXSPTDmU7hVro5mv+mVSpetEajUTrNO78DO +emaD3tCusTmMDSN8+Mwr3+JMyBpnTSCLJhNgx3rR9RWRp6lnsKjDswywTuVZ5mRg3IupC KHeL1YkSRwJNse66T/EMGjbIboBg1ANYdvak9vxaCoepyyqfT1UfSvQED7GvFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qvUXijfRMYZT1a7jfcJTAtJc7nztjUl5pCBgXZV00yY=; b=NaiBhrfmM3jlREKGs8N51tSySrkDH36C7z4BtH518Qv43EYWM4gngTUM/dtSYMg5wXEmz8 wc5Em7RquMpcHEzR9T7jAl7HI2n12nmJw30iB7JL6Nwq1bIU/XZGyX18zq49LknUIP1R/0 uMd94sQIS24pV+jjcVzPFZAobzoHlUkzhIkJNTzt4iaAhmlIgMPCCDWN87NvujlbQGn6K/ N0tZbwJjWN/4ss2pFw/u673Ab4ebDZ0S3qwxktPF3FosgC+rqa5+8rW0yc9fEUxWZ+/4aW E6vRNucTmUaJcZ36qdlbveFjLUdr9SJq7PUi4H95kt9ffx9R/GtJtu/X9iE5eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728362771; a=rsa-sha256; cv=none; b=ZPpBVh4iR61G1wU5Cghd/n2oK93lFHq7UHv6ecIFApjxe5MQxfyDjDP2lm8jOgmjxi38k6 unXBUPWFxoUW/FMwOokDBt3pl3jM7ayK/cXEw3H/NmppXJP2hda0nkqpKK/DN5gZeMD6YP J4SpVBEgzihDlnPb7Oxgxc6JcOnREOXFg9lOyQTj05RVaf7dl/e2bTlLBTNGZsX8e/9b/c NfvAdBbsmV6vFEasME2avoYKVVYPnxRcomp1Aun8HOoYMXdANY+m7qusKkeuq4KlkQzAEv cxGZTRuGvvOHGbVMEJdYZnV2WztdWyt1CbmxDSntigxAXrgOvAT/ijxhG+uK9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN3Pb5NQLzGWQ; Tue, 8 Oct 2024 04:46:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4984kB6W012617; Tue, 8 Oct 2024 04:46:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4984kBLo012614; Tue, 8 Oct 2024 04:46:11 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:46:11 GMT Message-Id: <202410080446.4984kBLo012614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 54c79d3ae419 - stable/14 - khelp: Sprinkle const qualifiers where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 54c79d3ae419c81a7e6bbc8c60f0959462bf0b4d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=54c79d3ae419c81a7e6bbc8c60f0959462bf0b4d commit 54c79d3ae419c81a7e6bbc8c60f0959462bf0b4d Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 04:44:54 +0000 khelp: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 89937323bddd41fd8b92430c3ece48d3e32c2c23) --- share/man/man9/khelp.9 | 6 +++--- sys/kern/kern_khelp.c | 4 ++-- sys/sys/khelp.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/share/man/man9/khelp.9 b/share/man/man9/khelp.9 index 39515eef237c..d619f385d513 100644 --- a/share/man/man9/khelp.9 +++ b/share/man/man9/khelp.9 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 15, 2011 +.Dd October 1, 2024 .Dt KHELP 9 .Os .Sh NAME @@ -48,8 +48,8 @@ .Fn "int khelp_destroy_osd" "struct osd *hosd" .Fn "int32_t khelp_get_id" "char *hname" .Fn "void * khelp_get_osd" "struct osd *hosd" "int32_t id" -.Fn "int khelp_add_hhook" "struct hookinfo *hki" "uint32_t flags" -.Fn "int khelp_remove_hhook" "struct hookinfo *hki" +.Fn "int khelp_add_hhook" "const struct hookinfo *hki" "uint32_t flags" +.Fn "int khelp_remove_hhook" "const struct hookinfo *hki" .Fn KHELP_DECLARE_MOD "hname" "hdata" "hhooks" "version" .Fn KHELP_DECLARE_MOD_UMA "hname" "hdata" "hhooks" "version" "ctor" "dtor" .Sh DESCRIPTION diff --git a/sys/kern/kern_khelp.c b/sys/kern/kern_khelp.c index eadb2b5a8db9..533d75a8dcd6 100644 --- a/sys/kern/kern_khelp.c +++ b/sys/kern/kern_khelp.c @@ -254,7 +254,7 @@ khelp_get_id(char *hname) } int -khelp_add_hhook(struct hookinfo *hki, uint32_t flags) +khelp_add_hhook(const struct hookinfo *hki, uint32_t flags) { int error; @@ -268,7 +268,7 @@ khelp_add_hhook(struct hookinfo *hki, uint32_t flags) } int -khelp_remove_hhook(struct hookinfo *hki) +khelp_remove_hhook(const struct hookinfo *hki) { int error; diff --git a/sys/sys/khelp.h b/sys/sys/khelp.h index 2ef45806c35a..7aadb6a58faa 100644 --- a/sys/sys/khelp.h +++ b/sys/sys/khelp.h @@ -70,8 +70,8 @@ void * khelp_get_osd(struct osd *hosd, int32_t id); int32_t khelp_get_id(char *hname); -int khelp_add_hhook(struct hookinfo *hki, uint32_t flags); +int khelp_add_hhook(const struct hookinfo *hki, uint32_t flags); -int khelp_remove_hhook(struct hookinfo *hki); +int khelp_remove_hhook(const struct hookinfo *hki); #endif /* _SYS_KHELP_H_ */ From nobody Tue Oct 8 04:46:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN3Pd2xNSz5Ywsl; Tue, 08 Oct 2024 04:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN3Pd0pVNz4g5x; Tue, 8 Oct 2024 04:46:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/f7VOoH7FWXrSVxyQUzE4VfDLiQ8uCLQ9E9I+Ykl0sk=; b=Hc8Lq5DuzYnetV6ZbC0lilmkhAm6Y9hla61gUpkKIzijBLsrpad25al/SPE954RQ45arI6 hJvgrBmjr6AM6m8gjAQn3y1X0QP5Tx381AAKJ3gDFt0o2f3zVIl/FWGA7+7vrmxVdB2CPh Nkktmuq5McTIBmDFyFZhh5g7RjXWAvi4NQvgFxoN69JayaFFZo6NO/LukfQ33Why31aspw J0Cur2MdZ7cldgDMBTboZwqe8L3si5nC5fdP1wj67xQjJzCVgm8mcPl9RaPyLIup9Jy8WX q5Q/IQIidL7eLU7OUlZxG/CtPZn608BwNYUx/1lNFZHZ30qzvpB+MY+ImVhh/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728362773; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/f7VOoH7FWXrSVxyQUzE4VfDLiQ8uCLQ9E9I+Ykl0sk=; b=ijUK1Wmpof++trIIa9D1y7Jydpkwy+tr8zlN8WeZOkHZRKFaaybjicQ+mOn8afG4HfepOe F3kOKkFzivW7KPpBZK9MqHDWavLe8QNq0737fHWbexBx5dQoxh/1yBeisx2Cl3hqLSFarM CWxV3derw88x5390kPmvDeVW/hTlyx9b1fOZSwhhIGkOrV2CWYXbMz4d6KMgPom88qMVdD Y6uLr5cj+TXDrHUcRGHc2Ah2N5LskNwtuzcp+6FhhGf+5Qcf4ji+gp/fguHdWgQIoVW1rN XaMfyZNo51isHu4SfMChYqzZ+TFG+LUPPE5kozaaRx45mSN/EKhHatKLmu9Gyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728362773; a=rsa-sha256; cv=none; b=RCYXOzD2noeVxQHvpA5/h/neSF/nvHNP6d4ZSED925q80OHYz9iFrvn688H0nkD20lEUOh nLLMC57UhDdv9v5FzuSkf3BD3TIbl6fBCBNzjK+9TclG1isCsTWb2CPeRKHdS3nczRtZky 5FZgnwfFgOUF40TGM2kiLQz9+3p4ZreMdHn+V/rp0XN6pnwAEqJGlujIHlQuvFeYDk/J7e fhARB1+6swuWLzxeKvwYInInUC2BQ3n7HPhBzrfMz7ktvT8Dcwm2ZUmnSRAVLUaZ9z45gj ChGODdSWT/ntHBPbXh/8iqLW6Dkpm3zxHAnaeh+m7UlXCKqrpjUNfpoxvBPufA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN3Pc6MvSzGxG; Tue, 8 Oct 2024 04:46:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4984kCF3012662; Tue, 8 Oct 2024 04:46:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4984kCs4012659; Tue, 8 Oct 2024 04:46:12 GMT (envelope-from git) Date: Tue, 8 Oct 2024 04:46:12 GMT Message-Id: <202410080446.4984kCs4012659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: d6374ee0517f - stable/14 - if_enc(4): Make enc_add_hhooks() void List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d6374ee0517f8d991eafe022e2027dd1e64a2ad1 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d6374ee0517f8d991eafe022e2027dd1e64a2ad1 commit d6374ee0517f8d991eafe022e2027dd1e64a2ad1 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 04:44:55 +0000 if_enc(4): Make enc_add_hhooks() void As for the consumer `enc_add_hhooks()`, `hhook_add_hook()` will never fail for the given parameters. Meanwhile, to build the module if_enc(4), at least option INET or INET6 is required, so no need for the error EPFNOSUPPORT. No functional change intended. Reviewed by: ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46770 (cherry picked from commit 7643141e9314f1eac0d9ac08457410509e6829ad) --- sys/net/if_enc.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index 18587dc1cb46..3c7ae38324c3 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -96,7 +96,7 @@ static int enc_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static int enc_clone_create(struct if_clone *, int, caddr_t); static void enc_clone_destroy(struct ifnet *); -static int enc_add_hhooks(struct enc_softc *); +static void enc_add_hhooks(struct enc_softc *); static void enc_remove_hhooks(struct enc_softc *); static const char encname[] = "enc"; @@ -315,13 +315,12 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data, return (0); } -static int +static void enc_add_hhooks(struct enc_softc *sc) { struct hookinfo hki; - int error; + int error __diagused; - error = EPFNOSUPPORT; hki.hook_func = enc_hhook; hki.hook_helper = NULL; hki.hook_udata = sc; @@ -330,28 +329,23 @@ enc_add_hhooks(struct enc_softc *sc) hki.hook_type = HHOOK_TYPE_IPSEC_IN; error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); hki.hook_type = HHOOK_TYPE_IPSEC_OUT; error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); #endif #ifdef INET6 hki.hook_id = AF_INET6; hki.hook_type = HHOOK_TYPE_IPSEC_IN; error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET6], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); hki.hook_type = HHOOK_TYPE_IPSEC_OUT; error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET6], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); #endif - return (error); } static void @@ -394,8 +388,7 @@ vnet_enc_init_proto(void *unused __unused) { KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); - if (enc_add_hhooks(V_enc_sc) != 0) - enc_clone_destroy(V_enc_sc->sc_ifp); + enc_add_hhooks(V_enc_sc); } VNET_SYSINIT(vnet_enc_init_proto, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_enc_init_proto, NULL); From nobody Tue Oct 8 07:07:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Xv74K5z5Z4m4; Tue, 08 Oct 2024 07:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Xv6ppxz42K8; Tue, 8 Oct 2024 07:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1koFbEmPqAMcLx7T8Curi3xAa7FzQ2QjMPAfiwfS74=; b=xNwFHL23G8iih6Nh3ZNfqOcME/CxYyavke19LuLy2eZp5qZ+JyBn2t0dA2PMV5aJb+OMao 4hyqDy4SwIa1ju3AyLKmgVGiHcYwDPeTk3iQcl2YXhPP9gFNKK3gjOQq/jzFFq5sh5Vw38 PwruUZ6sxNHlyyPljOnp/lLa9QAiw4c3aGIj3NgldwTrOXIDNe//2xFQaNI2tArWLmRoHq bwuVaDlz9pqDhxGV3DpDNycI8cVDDarHhUpJhfqoHsLZ9jb7KCoOOpBxXANIu7zZ7g7Dxa g6Zak/pD+zZdvBy72hiiF4GIg/OFB8RvxRenZBrKspuosbGSs1UOotqZnRR+FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d1koFbEmPqAMcLx7T8Curi3xAa7FzQ2QjMPAfiwfS74=; b=mJcwBVwM5nT4b3POKn1/zOE/32rtAMo2TX7QsXnrzOwyTkkZlja3JHvyQtLQfFyeC6OT9w 1XC604wBXdJ/dHAp6GbW81Ms3OVMvoEzKVFXe9vjYCN2xO6wtzFhHErRAdTpK4svyHWgo7 EO/2emGE4k2LFvoroky5AnEoc0gdZrWH1ZO474SFZchp6zFDNOOq5Mf1LJ2GFZQAcjQC/B AD3ekmWkuANdCBW8kHFlmdkgexk7dBByFPLsHjqzSkp28B3xGPH7LlvGYK3EmeMMbOGsze zCSRLLfMYy2aOToxS10IfB9ica3GKudY7hZycVFzw9I/Lu7rO5LcWE9jL8bxiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371263; a=rsa-sha256; cv=none; b=InmAsa4yvvQKOQ/UV72Xn3fr6P6pJoJFtSR9oRVwnQEeUpBVlVzU5iTNdnefCp4YPp4AG9 FsHHeOin4VmjLqisproZNz7fJrJM8E87FH4Q/YVz3CCe+smgWLb1oApgx6vJ5FTLGw92zZ 5rCgyyNfhvYl1E2ist6QV0sxBC5AA6nnrlDk0Ab+b9x8yd8wGwHEaLnPzTlo5/3Nk3WLth 3D1PVsRm8Z37w9PKKnfzsCGkW8cdB7y6G5naRYmbopxLT9qe19diEA8ML10RnVFfkAgWk+ royEb38XTrcxQQcXGdGkqPeKYY4lV6o29VBDTNHUbSsF6EkTNjkAc5rkrdEEfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Xv6HtRzLGK; Tue, 8 Oct 2024 07:07:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877hUX051396; Tue, 8 Oct 2024 07:07:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877htZ051393; Tue, 8 Oct 2024 07:07:43 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:43 GMT Message-Id: <202410080707.49877htZ051393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 68c7c28d0e65 - stable/14 - nuageinit: Lua check and lint files List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 68c7c28d0e65a3c59810a1b2d441c74bfaeab81a Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=68c7c28d0e65a3c59810a1b2d441c74bfaeab81a commit 68c7c28d0e65a3c59810a1b2d441c74bfaeab81a Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-29 18:40:52 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Lua check and lint files Mostly white space, style, and luacheck compliance. Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit 504981357aa36365784458cfe8d9e23097bfac7b) --- libexec/nuageinit/nuage.lua | 56 +++++----- libexec/nuageinit/nuageinit | 158 ++++++++++++++------------- libexec/nuageinit/tests/Makefile | 10 +- libexec/nuageinit/tests/addgroup.lua | 1 + libexec/nuageinit/tests/addsshkey.lua | 3 + libexec/nuageinit/tests/adduser.lua | 1 + libexec/nuageinit/tests/dirname.lua | 7 +- libexec/nuageinit/tests/err.lua | 1 + libexec/nuageinit/tests/nuage.sh | 21 +++- libexec/nuageinit/tests/nuageinit.sh | 187 ++++++++++++++++---------------- libexec/nuageinit/tests/sethostname.lua | 1 + libexec/nuageinit/tests/utils.sh | 18 ++- libexec/nuageinit/tests/warn.lua | 1 + libexec/nuageinit/yaml.lua | 1 + 14 files changed, 258 insertions(+), 208 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 116ab143ccfa..d35d3725fa99 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -1,15 +1,17 @@ +--- -- SPDX-License-Identifier: BSD-2-Clause -- -- Copyright(c) 2022 Baptiste Daroussin <bapt@FreeBSD.org> +local lfs = require("lfs") local pu = require("posix.unistd") local function warnmsg(str) - io.stderr:write(str.."\n") + io.stderr:write(str .. "\n") end local function errmsg(str) - io.stderr:write(str.."\n") + io.stderr:write(str .. "\n") os.exit(1) end @@ -28,15 +30,17 @@ local function mkdir_p(path) if lfs.attributes(path, "mode") ~= nil then return true end - local r,err = mkdir_p(dirname(path)) + local r, err = mkdir_p(dirname(path)) if not r then - return nil,err.." (creating "..path..")" + return nil, err .. " (creating " .. path .. ")" end return lfs.mkdir(path) end local function sethostname(hostname) - if hostname == nil then return end + if hostname == nil then + return + end local root = os.getenv("NUAGE_FAKE_ROOTDIR") if not root then root = "" @@ -44,12 +48,12 @@ local function sethostname(hostname) local hostnamepath = root .. "/etc/rc.conf.d/hostname" mkdir_p(dirname(hostnamepath)) - local f,err = io.open(hostnamepath, "w") + local f, err = io.open(hostnamepath, "w") if not f then - warnmsg("Impossible to open "..hostnamepath .. ":" ..err) + warnmsg("Impossible to open " .. hostnamepath .. ":" .. err) return end - f:write("hostname=\""..hostname.."\"\n") + f:write('hostname="' .. hostname .. '"\n') f:close() end @@ -62,7 +66,7 @@ local function splitlist(list) elseif type(list) == "table" then ret = list else - warnmsg("Invalid type ".. type(list) ..", expecting table or string") + warnmsg("Invalid type " .. type(list) .. ", expecting table or string") end return ret end @@ -77,7 +81,7 @@ local function adduser(pwd) if root then cmd = cmd .. "-R " .. root .. " " end - local f = io.popen(cmd .. " usershow " ..pwd.name .. " -7 2>/dev/null") + local f = io.popen(cmd .. " usershow " .. pwd.name .. " -7 2> /dev/null") local pwdstr = f:read("*a") f:close() if pwdstr:len() ~= 0 then @@ -89,10 +93,10 @@ local function adduser(pwd) if not pwd.homedir then pwd.homedir = "/home/" .. pwd.name end - local extraargs="" + local extraargs = "" if pwd.groups then local list = splitlist(pwd.groups) - extraargs = " -G ".. table.concat(list, ',') + extraargs = " -G " .. table.concat(list, ",") end -- pw will automatically create a group named after the username -- do not add a -g option in this case @@ -108,23 +112,23 @@ local function adduser(pwd) local precmd = "" local postcmd = "" if pwd.passwd then - precmd = "echo "..pwd.passwd .. "| " + precmd = "echo " .. pwd.passwd .. "| " postcmd = " -H 0 " elseif pwd.plain_text_passwd then - precmd = "echo "..pwd.plain_text_passwd .. "| " + precmd = "echo " .. pwd.plain_text_passwd .. "| " postcmd = " -h 0 " end cmd = precmd .. "pw " if root then cmd = cmd .. "-R " .. root .. " " end - cmd = cmd .. "useradd -n ".. pwd.name .. " -M 0755 -w none " - cmd = cmd .. extraargs .. " -c '".. pwd.gecos - cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s "..pwd.shell .. postcmd + cmd = cmd .. "useradd -n " .. pwd.name .. " -M 0755 -w none " + cmd = cmd .. extraargs .. " -c '" .. pwd.gecos + cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s " .. pwd.shell .. postcmd local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add user "..pwd.name); + warnmsg("nuageinit: fail to add user " .. pwd.name) warnmsg(cmd) return nil end @@ -149,7 +153,7 @@ local function addgroup(grp) if root then cmd = cmd .. "-R " .. root .. " " end - local f = io.popen(cmd .. " groupshow " ..grp.name .. " 2>/dev/null") + local f = io.popen(cmd .. " groupshow " .. grp.name .. " 2> /dev/null") local grpstr = f:read("*a") f:close() if grpstr:len() ~= 0 then @@ -158,16 +162,16 @@ local function addgroup(grp) local extraargs = "" if grp.members then local list = splitlist(grp.members) - extraargs = " -M " .. table.concat(list, ',') + extraargs = " -M " .. table.concat(list, ",") end cmd = "pw " if root then cmd = cmd .. "-R " .. root .. " " end - cmd = cmd .. "groupadd -n ".. grp.name .. extraargs + cmd = cmd .. "groupadd -n " .. grp.name .. extraargs local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add group ".. grp.name); + warnmsg("nuageinit: fail to add group " .. grp.name) warnmsg(cmd) return false end @@ -196,7 +200,7 @@ local function addsshkey(homedir, key) local f = io.open(ak_path, "a") if not f then - warnmsg("nuageinit: impossible to open "..ak_path) + warnmsg("nuageinit: impossible to open " .. ak_path) return end f:write(key .. "\n") @@ -214,12 +218,12 @@ end local n = { warn = warnmsg, err = errmsg, + dirname = dirname, + mkdir_p = mkdir_p, sethostname = sethostname, adduser = adduser, addgroup = addgroup, - addsshkey = addsshkey, - dirname = dirname, - mkdir_p = mkdir_p, + addsshkey = addsshkey } return n diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 622e294bb531..50d77dfef9f5 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -1,18 +1,18 @@ #!/usr/libexec/flua - +--- -- SPDX-License-Identifier: BSD-2-Clause-FreeBSD -- -- Copyright(c) 2022 Baptiste Daroussin <bapt@FreeBSD.org> local nuage = require("nuage") +local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage ".. arg[0] .." <cloud-init directory> [config-2|nocloud]") + nuage.err("Usage " .. arg[0] .. " <cloud-init directory> [config-2|nocloud]") end local path = arg[1] local citype = arg[2] -local ucl = require("ucl") local default_user = { name = "freebsd", @@ -30,9 +30,9 @@ end local function open_config(name) nuage.mkdir_p(root .. "/etc/rc.conf.d") - local f,err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") + local f, err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") if not f then - nuage.err("nuageinit: unable to open "..name.." config: " .. err) + nuage.err("nuageinit: unable to open " .. name .. " config: " .. err) end return f end @@ -40,17 +40,17 @@ end local function get_ifaces() local parser = ucl.parser() -- grab ifaces - local ns = io.popen('netstat -i --libxo json') + local ns = io.popen("netstat -i --libxo json") local netres = ns:read("*a") ns:close() - local res,err = parser:parse_string(netres) + local res, err = parser:parse_string(netres) if not res then nuage.warn("Error parsing netstat -i --libxo json outout: " .. err) return nil end local ifaces = parser:get_object() local myifaces = {} - for _,iface in pairs(ifaces["statistics"]["interface"]) do + for _, iface in pairs(ifaces["statistics"]["interface"]) do if iface["network"]:match("<Link#%d>") then local s = iface["address"] myifaces[s:lower()] = iface["name"] @@ -67,7 +67,7 @@ local function config2_network(p) return end f:close() - local res,err = parser:parse_file(p .. "/network_data.json") + local res, err = parser:parse_file(p .. "/network_data.json") if not res then nuage.warn("nuageinit: error parsing network_data.json: " .. err) return @@ -80,7 +80,7 @@ local function config2_network(p) return end local mylinks = {} - for _,v in pairs(obj["links"]) do + for _, v in pairs(obj["links"]) do local s = v["ethernet_mac_address"]:lower() mylinks[v["id"]] = ifaces[s] end @@ -91,66 +91,72 @@ local function config2_network(p) local ipv6 = {} local ipv6_routes = {} local ipv4 = {} - for _,v in pairs(obj["networks"]) do + for _, v in pairs(obj["networks"]) do local interface = mylinks[v["link"]] if v["type"] == "ipv4_dhcp" then - network:write("ifconfig_"..interface.."=\"DHCP\"\n") + network:write("ifconfig_" .. interface .. '="DHCP"\n') end if v["type"] == "ipv4" then - network:write("ifconfig_"..interface.."=\"inet "..v["ip_address"].." netmask " .. v["netmask"] .. "\"\n") + network:write( + "ifconfig_" .. interface .. '="inet ' .. v["ip_address"] .. " netmask " .. v["netmask"] .. '"\n' + ) if v["gateway"] then - routing:write("defaultrouter=\""..v["gateway"].."\"\n") + routing:write('defaultrouter="' .. v["gateway"] .. '"\n') end if v["routes"] then - for i,r in ipairs(v["routes"]) do + for i, r in ipairs(v["routes"]) do local rname = "cloudinit" .. i .. "_" .. interface - if v["gateway"] and v["gateway"] == r["gateway"] then goto next end + if v["gateway"] and v["gateway"] == r["gateway"] then + goto next + end if r["network"] == "0.0.0.0" then - routing:write("defaultrouter=\""..r["gateway"].."\"\n") + routing:write('defaultrouter="' .. r["gateway"] .. '"\n') goto next end - routing:write("route_".. rname .. "=\"-net ".. r["network"] .. " ") - routing:write(r["gateway"] .. " " .. r["netmask"] .. "\"\n") + routing:write("route_" .. rname .. '="-net ' .. r["network"] .. " ") + routing:write(r["gateway"] .. " " .. r["netmask"] .. '"\n') ipv4[#ipv4 + 1] = rname ::next:: end end end if v["type"] == "ipv6" then - ipv6[#ipv6+1] = interface - ipv6_routes[#ipv6_routes+1] = interface - network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..v["ip_address"].."\"\n") + ipv6[#ipv6 + 1] = interface + ipv6_routes[#ipv6_routes + 1] = interface + network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. v["ip_address"] .. '"\n') if v["gateway"] then - routing:write("ipv6_defaultrouter=\""..v["gateway"].."\"\n") - routing:write("ipv6_route_"..interface.."=\""..v["gateway"]) - routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + routing:write('ipv6_defaultrouter="' .. v["gateway"] .. '"\n') + routing:write("ipv6_route_" .. interface .. '="' .. v["gateway"]) + routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') end -- TODO compute the prefixlen for the routes --if v["routes"] then - -- for i,r in ipairs(v["routes"]) do + -- for i, r in ipairs(v["routes"]) do -- local rname = "cloudinit" .. i .. "_" .. mylinks[v["link"]] -- -- skip all the routes which are already covered by the default gateway, some provider -- -- still list plenty of them. - -- if v["gateway"] == r["gateway"] then goto next end - -- routing:write("ipv6_route_" .. rname .. "\"\n") - -- ipv6_routes[#ipv6_routes+1] = rname + -- if v["gateway"] == r["gateway"] then + -- goto next + -- end + -- routing:write("ipv6_route_" .. rname .. '"\n') + -- ipv6_routes[#ipv6_routes + 1] = rname -- ::next:: -- end --end end end if #ipv4 > 0 then - routing:write("static_routes=\"") - routing:write(table.concat(ipv4, " ") .. "\"\n") + routing:write('static_routes="') + routing:write(table.concat(ipv4, " ") .. '"\n') end if #ipv6 > 0 then - network:write("ipv6_network_interfaces=\"") - network:write(table.concat(ipv6, " ") .. "\"\n") - network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + network:write('ipv6_network_interfaces="') + network:write(table.concat(ipv6, " ") .. '"\n') + network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') end if #ipv6_routes > 0 then - routing:write("ipv6_static_routes=\"") - routing:write(table.concat(ipv6, " ") .. "\"\n") + routing:write('ipv6_static_routes="') + routing:write(table.concat(ipv6, " ") .. '"\n') end network:close() routing:close() @@ -158,7 +164,7 @@ end if citype == "config-2" then local parser = ucl.parser() - local res,err = parser:parse_file(path..'/meta_data.json') + local res, err = parser:parse_file(path .. "/meta_data.json") if not res then nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) @@ -175,32 +181,32 @@ if citype == "config-2" then -- network config2_network(path) elseif citype == "nocloud" then - local f,err = io.open(path.."/meta-data") + local f, err = io.open(path .. "/meta-data") if err then - nuage.err("nuageinit: error parsing nocloud meta-data: ".. err) + nuage.err("nuageinit: error parsing nocloud meta-data: " .. err) end local obj = yaml.eval(f:read("*a")) f:close() if not obj then nuage.err("nuageinit: error parsing nocloud meta-data") end - local hostname = obj['local-hostname'] + local hostname = obj["local-hostname"] if not hostname then - hostname = obj['hostname'] + hostname = obj["hostname"] end if hostname then nuage.sethostname(hostname) end else - nuage.err("Unknown cloud init type: ".. citype) + nuage.err("Unknown cloud init type: " .. citype) end -- deal with user-data local ud = nil local f = nil -userdatas = { "user-data", "user_data" } -for _,v in pairs(userdatas) do - f = io.open(path..'/' .. v, "r") +userdatas = {"user-data", "user_data"} +for _, v in pairs(userdatas) do + f = io.open(path .. "/" .. v, "r") if f then ud = v break @@ -209,33 +215,33 @@ end if not f then os.exit(0) end -local line = f:read('*l') +local line = f:read("*l") f:close() if line == "#cloud-config" then - f = io.open(path.."/" .. ud) + f = io.open(path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then nuage.err("nuageinit: error parsing cloud-config file: " .. ud) end if obj.groups then - for n,g in pairs(obj.groups) do + for n, g in pairs(obj.groups) do if (type(g) == "string") then local r = nuage.addgroup({name = g}) if not r then - nuage.warn("nuageinit: failed to add group: ".. g) + nuage.warn("nuageinit: failed to add group: " .. g) end elseif type(g) == "table" then - for k,v in pairs(g) do + for k, v in pairs(g) do nuage.addgroup({name = k, members = v}) end else - nuage.warn("nuageinit: invalid type : "..type(g).." for users entry number "..n); + nuage.warn("nuageinit: invalid type: " .. type(g) .. " for users entry number " .. n) end end end if obj.users then - for n,u in pairs(obj.users) do + for n, u in pairs(obj.users) do if type(u) == "string" then if u == "default" then nuage.adduser(default_user) @@ -249,12 +255,12 @@ if line == "#cloud-config" then end local homedir = nuage.adduser(u) if u.ssh_authorized_keys then - for _,v in ipairs(u.ssh_authorized_keys) do + for _, v in ipairs(u.ssh_authorized_keys) do nuage.addsshkey(homedir, v) end end else - nuage.warn("nuageinit: invalid type : "..type(u).." for users entry number "..n); + nuage.warn("nuageinit: invalid type : " .. type(u) .. " for users entry number " .. n) end ::unext:: end @@ -264,7 +270,7 @@ if line == "#cloud-config" then end if obj.ssh_authorized_keys then local homedir = nuage.adduser(default_user) - for _,k in ipairs(obj.ssh_authorized_keys) do + for _, k in ipairs(obj.ssh_authorized_keys) do nuage.addsshkey(homedir, k) end end @@ -273,48 +279,52 @@ if line == "#cloud-config" then nuage.mkdir_p(root .. "/etc/rc.conf.d") local network = open_config("network") local routing = open_config("routing") - local ipv6={} - for _,v in pairs(obj.network.ethernets) do - if not v.match then goto next end - if not v.match.macaddress then goto next end + local ipv6 = {} + for _, v in pairs(obj.network.ethernets) do + if not v.match then + goto next + end + if not v.match.macaddress then + goto next + end if not ifaces[v.match.macaddress] then - nuage.warn("nuageinit: not interface matching: "..v.match.macaddress) + nuage.warn("nuageinit: not interface matching: " .. v.match.macaddress) goto next end local interface = ifaces[v.match.macaddress] if v.dhcp4 then - network:write("ifconfig_"..interface.."=\"DHCP\"\n") + network:write("ifconfig_" .. interface .. '="DHCP"\n') elseif v.addresses then - for _,a in pairs(v.addresses) do + for _, a in pairs(v.addresses) do if a:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)") then - network:write("ifconfig_"..interface.."=\"inet "..a.."\"\n") + network:write("ifconfig_" .. interface .. '="inet ' .. a .. '"\n') else - network:write("ifconfig_"..interface.."_ipv6=\"inet6 "..a.."\"\n") - ipv6[#ipv6 +1] = interface + network:write("ifconfig_" .. interface .. '_ipv6="inet6 ' .. a .. '"\n') + ipv6[#ipv6 + 1] = interface end end end if v.gateway4 then - routing:write("defaultrouter=\""..v.gateway4.."\"\n") + routing:write('defaultrouter="' .. v.gateway4 .. '"\n') end if v.gateway6 then - routing:write("ipv6_defaultrouter=\""..v.gateway6.."\"\n") - routing:write("ipv6_route_"..interface.."=\""..v.gateway6) - routing:write(" -prefixlen 128 -interface "..interface.."\"\n") + routing:write('ipv6_defaultrouter="' .. v.gateway6 .. '"\n') + routing:write("ipv6_route_" .. interface .. '="' .. v.gateway6) + routing:write(" -prefixlen 128 -interface " .. interface .. '"\n') end ::next:: end if #ipv6 > 0 then - network:write("ipv6_network_interfaces=\"") - network:write(table.concat(ipv6, " ") .. "\"\n") - network:write("ipv6_default_interface=\""..ipv6[1].."\"\n") + network:write('ipv6_network_interfaces="') + network:write(table.concat(ipv6, " ") .. '"\n') + network:write('ipv6_default_interface="' .. ipv6[1] .. '"\n') end network:close() routing:close() end else - local res,err = os.execute(path..'/' .. ud) + local res, err = os.execute(path .. "/" .. ud) if not res then - nuage.err("nuageinit: error executing user-data script: ".. err) + nuage.err("nuageinit: error executing user-data script: " .. err) end end diff --git a/libexec/nuageinit/tests/Makefile b/libexec/nuageinit/tests/Makefile index d5b3bd9dcc82..ccb81c090445 100644 --- a/libexec/nuageinit/tests/Makefile +++ b/libexec/nuageinit/tests/Makefile @@ -2,12 +2,12 @@ PACKAGE= tests ATF_TESTS_SH= nuage utils nuageinit -${PACKAGE}FILES+= warn.lua -${PACKAGE}FILES+= err.lua -${PACKAGE}FILES+= dirname.lua -${PACKAGE}FILES+= sethostname.lua +${PACKAGE}FILES+= addgroup.lua ${PACKAGE}FILES+= addsshkey.lua ${PACKAGE}FILES+= adduser.lua -${PACKAGE}FILES+= addgroup.lua +${PACKAGE}FILES+= dirname.lua +${PACKAGE}FILES+= err.lua +${PACKAGE}FILES+= sethostname.lua +${PACKAGE}FILES+= warn.lua .include <bsd.test.mk> diff --git a/libexec/nuageinit/tests/addgroup.lua b/libexec/nuageinit/tests/addgroup.lua index 60a0d8346793..a36a5e24c7b3 100644 --- a/libexec/nuageinit/tests/addgroup.lua +++ b/libexec/nuageinit/tests/addgroup.lua @@ -1,6 +1,7 @@ #!/usr/libexec/flua local n = require("nuage") + if n.addgroup() then n.err("addgroup should not accept empty value") end diff --git a/libexec/nuageinit/tests/addsshkey.lua b/libexec/nuageinit/tests/addsshkey.lua index 3aa5f7619ec2..47e102c162a9 100644 --- a/libexec/nuageinit/tests/addsshkey.lua +++ b/libexec/nuageinit/tests/addsshkey.lua @@ -1,2 +1,5 @@ +#!/usr/libexec/flua + local n = require("nuage") + n.addsshkey(".", "mykey") diff --git a/libexec/nuageinit/tests/adduser.lua b/libexec/nuageinit/tests/adduser.lua index 9366d2abd0f4..cef6be0c0e0c 100644 --- a/libexec/nuageinit/tests/adduser.lua +++ b/libexec/nuageinit/tests/adduser.lua @@ -1,6 +1,7 @@ #!/usr/libexec/flua local n = require("nuage") + if n.adduser() then n.err("adduser should not accept empty value") end diff --git a/libexec/nuageinit/tests/dirname.lua b/libexec/nuageinit/tests/dirname.lua index d1268e48575c..7e3a2c835502 100644 --- a/libexec/nuageinit/tests/dirname.lua +++ b/libexec/nuageinit/tests/dirname.lua @@ -1,8 +1,11 @@ +#!/usr/libexec/flua + local n = require("nuage") + print(n.dirname("/my/path/path1")) if n.dirname("path") then - nuage.err("Expecting nil for n.dirname(\"path\")") + n.err('Expecting nil for n.dirname("path")') end if n.dirname() then - nuage.err("Expecting nil for n.dirname") + n.err("Expecting nil for n.dirname") end diff --git a/libexec/nuageinit/tests/err.lua b/libexec/nuageinit/tests/err.lua index c62fa1098f09..567d4f2df66e 100644 --- a/libexec/nuageinit/tests/err.lua +++ b/libexec/nuageinit/tests/err.lua @@ -1,4 +1,5 @@ #!/usr/libexec/flua local n = require("nuage") + n.err("plop") diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 29842bff3d6b..4e2353176b16 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -1,9 +1,16 @@ +#- +# Copyright (c) 2022 Baptiste Daroussin <bapt@FreeBSD.org> +# +# SPDX-License-Identifier: BSD-2-Clause +# + atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser atf_test_case addgroup -sethostname_body() { +sethostname_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua if [ ! -f etc/rc.conf.d/hostname ]; then @@ -12,7 +19,8 @@ sethostname_body() { atf_check -o inline:"hostname=\"myhostname\"\n" cat etc/rc.conf.d/hostname } -addsshkey_body() { +addsshkey_body() +{ atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua if [ ! -f .ssh/authorized_keys ]; then atf_fail "ssh key not added" @@ -24,7 +32,8 @@ addsshkey_body() { atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys } -adduser_body() { +adduser_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" if [ $(id -u) -ne 0 ]; then atf_skip "root required" @@ -38,7 +47,8 @@ adduser_body() { atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd } -addgroup_body() { +addgroup_body() +{ export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group @@ -46,7 +56,8 @@ addgroup_body() { atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } -atf_init_test_cases() { +atf_init_test_cases() +{ atf_add_test_case sethostname atf_add_test_case addsshkey atf_add_test_case adduser diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index b5078e256853..64ac066fefbf 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -1,8 +1,13 @@ +#- +# Copyright (c) 2022 Baptiste Daroussin <bapt@FreeBSD.org> +# +# SPDX-License-Identifier: BSD-2-Clause +# + atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script atf_test_case nocloud_user_data_script -atf_test_case nocloud_userdata_cloudconfig atf_test_case nocloud_userdata_cloudconfig_users atf_test_case nocloud_network atf_test_case config2 @@ -12,7 +17,6 @@ atf_test_case config2_pubkeys_meta_data atf_test_case config2_network atf_test_case config2_network_static_v4 - args_body() { atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit @@ -43,8 +47,8 @@ nocloud_userdata_script_body() here=$(pwd) mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user-data - chmod 755 ${here}/media/nuageinit/user-data + printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user-data + chmod 755 ${here}/media/nuageinit/user-data atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud } @@ -53,8 +57,8 @@ nocloud_user_data_script_body() here=$(pwd) mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho "yeah"\n" > ${here}/media/nuageinit/user_data - chmod 755 ${here}/media/nuageinit/user_data + printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user_data + chmod 755 ${here}/media/nuageinit/user_data atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud } @@ -68,16 +72,16 @@ nocloud_userdata_cloudconfig_users_body() mkdir -p media/nuageinit printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data mkdir -p etc - cat > etc/master.passwd <<EOF + cat > etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group <<EOF + cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - cat > media/nuageinit/user-data <<EOF + cat > media/nuageinit/user-data << EOF #cloud-config groups: - admingroup: [root,sys] @@ -115,12 +119,12 @@ nocloud_network_body() here=$(pwd) mkdir -p media/nuageinit mkdir -p etc - cat > etc/master.passwd <<EOF + cat > etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group <<EOF + cat > etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -135,16 +139,15 @@ EOF myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - cat > media/nuageinit/user-data <<EOF + cat > media/nuageinit/user-data << EOF #cloud-config -# network: version: 2 ethernets: # opaque ID for physical interfaces, only referred to by other stanzas id0: match: - macaddress: '${myaddr}' + macaddress: "$myaddr" addresses: - 192.168.14.2/24 - 2001:1::1/64 @@ -153,13 +156,13 @@ network: EOF export NUAGE_FAKE_ROOTDIR=$(pwd) atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud - cat > network <<EOF + cat > network << EOF ifconfig_${myiface}="inet 192.168.14.2/24" ifconfig_${myiface}_ipv6="inet6 2001:1::1/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF - cat > routing <<EOF + cat > routing << EOF defaultrouter="192.168.14.1" ipv6_defaultrouter="2001:1::2" ipv6_route_${myiface}="2001:1::2 -prefixlen 128 -interface ${myiface}" @@ -176,7 +179,7 @@ config2_body() atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF { - "hostname": "cloudimg", + "hostname": "cloudimg" } EOF export NUAGE_FAKE_ROOTDIR=$(pwd) @@ -195,17 +198,16 @@ config2_pubkeys_body() touch media/nuageinit/meta_data.json cat > media/nuageinit/user-data << EOF #cloud-config - ssh_authorized_keys: - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova" EOF mkdir -p etc - cat > etc/master.passwd <<EOF + cat > etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group <<EOF + cat > etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -225,17 +227,16 @@ config2_pubkeys_user_data_body() touch media/nuageinit/meta_data.json cat > media/nuageinit/user_data << EOF #cloud-config - ssh_authorized_keys: - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova" EOF mkdir -p etc - cat > etc/master.passwd <<EOF + cat > etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group <<EOF + cat > etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -251,37 +252,37 @@ config2_pubkeys_meta_data_body() atf_skip "root required" fi mkdir -p media/nuageinit - cat > media/nuageinit/meta_data.json <<EOF + cat > media/nuageinit/meta_data.json << EOF { - "uuid": "uuid_for_this_instance", - "admin_pass": "a_generated_password", - "public_keys": { - "tdb": "ssh-ed25519 my_key_id tdb@host" - }, - "keys": [ - { - "name": "tdb", - "type": "ssh", - "data": "ssh-ed25519 my_key_id tdb@host" - } - ], - "hostname": "freebsd-14-test.novalocal", - "name": "freebsd-14-test", - "launch_index": 0, - "availability_zone": "nova", - "random_seed": "long_random_seed", - "project_id": "my_project_id", - "devices": [], - "dedicated_cpus": [] + "uuid": "uuid_for_this_instance", + "admin_pass": "a_generated_password", + "public_keys": { + "tdb": "ssh-ed25519 my_key_id tdb@host" + }, + "keys": [ + { + "name": "tdb", + "type": "ssh", + "data": "ssh-ed25519 my_key_id tdb@host" + } + ], + "hostname": "freebsd-14-test.novalocal", + "name": "freebsd-14-test", + "launch_index": 0, + "availability_zone": "nova", + "random_seed": "long_random_seed", + "project_id": "my_project_id", + "devices": [], + "dedicated_cpus": [] } EOF mkdir -p etc - cat > etc/master.passwd <<EOF + cat > etc/master.passwd << EOF root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh EOF pwd_mkdb -d etc ${here}/etc/master.passwd - cat > etc/group <<EOF + cat > etc/group << EOF wheel:*:0:root users:*:1: EOF @@ -289,7 +290,8 @@ EOF atf_check -o inline:"ssh-ed25519 my_key_id tdb@host\n" cat home/freebsd/.ssh/authorized_keys } -config2_network_body() { +config2_network_body() +{ here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json @@ -300,13 +302,13 @@ config2_network_body() { set -- $mynetworks myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') -cat > media/nuageinit/network_data.json <<EOF +cat > media/nuageinit/network_data.json << EOF { "links": [ { "ethernet_mac_address": "$myaddr", "id": "iface0", - "mtu": null, + "mtu": null } ], "networks": [ @@ -315,39 +317,39 @@ cat > media/nuageinit/network_data.json <<EOF "link": "iface0", "type": "ipv4_dhcp" }, - { // IPv6 - "id": "private-ipv4", - "type": "ipv6", - "link": "iface0", - // supports condensed IPv6 with CIDR netmask - "ip_address": "2001:cdba::3257:9652/24", - "gateway": "fd00::1" - "routes": [ - { *** 193 LINES SKIPPED *** From nobody Tue Oct 8 07:07:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Xx1kmFz5Z4yM; Tue, 08 Oct 2024 07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Xx0bQ5z42mC; Tue, 8 Oct 2024 07: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=1728371265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Iz4hhxCcqD+P5F8IWPxmu8gz66E2LsuADvReZNKpDo=; b=XNmPdzZiY7pnJ0XTdVxPISCM0vD8vRSQahYHbVZotawmMdEY1p1n7yPWv84DrfqZbl4qXp h0pli6wP0t+qgtpVefnzCWgJB/NnbyrEdHqPNvHef6DOTu45y9rbjx34m+arlVsJcyeuFq RGw4NNnxmH86JfOC61YwBTMUFkKs9XO1GGH+V8HRwWbZ/zdyk+oQCYNXjlgxulXLt4wuPF AJLz7b0w69ztY7hngHWoBI5wrnm0O0RA1/G4hZbHAgd1Ti6zcO5c6SnSKZyIzXjevHaKjy Xi6ex3S6Q4T2cGOYEbWsa0WLHza+LSXmN802+8K2qm70lWhNYNFFOPRtFMV1FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Iz4hhxCcqD+P5F8IWPxmu8gz66E2LsuADvReZNKpDo=; b=phzV+yzOD8/6fKAMlDl7zQ+tpAepzR7v72r2dYAvt5TY+vQhNFg5hiRBHGIiPnMeA024aa p22aNdmVVXyHjq+bMJC1S8ZxtpPAXf042PZjqsU2asDTXboozlDiYGqoK0rEUqBXlu6tjQ B/xUh53Vi94UVh3fUl8uUm5f1hNpzo3QdSmyQt9QhIcEfuV1jT7WCWDgW8T8lg7iAlq30u XnVCaY5+HnP883woetrE4AJsWSpB+V15JylnG9hjlVMVzK22H9SFGdNxRmNZ71YByKtbY+ eExsLIeuWx7IibUBpM9AAXq0bTk5GPVGJf7hUurje8ZLhpcoVlN0Sf2Eo2j8PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371265; a=rsa-sha256; cv=none; b=rqTYZ56DeCly3h9vBXn/acMFu4rK3+yVxPnKIWo/2TdEXdB+fsaoZriyOAJtsd8R0StUmP IlM7huP9pHXR6NB7kXOs5F3jBeh4Es2P1j84DTj0jmGB6wcIXi/koqNfRkCHLmnTK1lmKC QZPxCjLMoZTZfA4GARjMLaE8vJVmDYicd4knEBrDaa6rEWRcUaCN1tvcrm7Lwn6MpzMTkj 8FFtKBHbv/3KoTZWu+4ARAcDdmrTE/9O6IXahR8MNLRhUAwIdcjYlUjZGYNMPxvRhlULQ/ un2stOSaffunb251cnjwxlvSPAyKUMb19yMhE5VEGIfwb3SwThkHMtpedxSrlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Xx0BD2zLGL; Tue, 8 Oct 2024 07:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877ihD051438; Tue, 8 Oct 2024 07:07:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877ire051435; Tue, 8 Oct 2024 07:07:44 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:44 GMT Message-Id: <202410080707.49877ire051435@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: c96dbfbd1b52 - stable/14 - nuageinit: Silence an fstyp(8) warning List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c96dbfbd1b5274cd0cdcdffacfe365f7be1d2d79 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c96dbfbd1b5274cd0cdcdffacfe365f7be1d2d79 commit c96dbfbd1b5274cd0cdcdffacfe365f7be1d2d79 Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-26 01:59:36 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Silence an fstyp(8) warning Silence a warning emitted by fread(3) in fstyp(8)'s read_buf(), when detecting the file system type of the cloud-init device: % fstyp /dev/iso9660/cidata fstyp: fread: Invalid argument cd9660 Also rephrase slightly a comment while here. Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit d71e2c037c942dbe2a9fd2630d5cf155dd1bf7db) --- libexec/rc/rc.d/nuageinit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/nuageinit b/libexec/rc/rc.d/nuageinit index 8da0b1aed741..a44761ea1d9e 100755 --- a/libexec/rc/rc.d/nuageinit +++ b/libexec/rc/rc.d/nuageinit @@ -18,8 +18,8 @@ nuageinit_start() { local citype # detect cloud init provider - # according to the specification of the config drive - # it either formatted in vfat or iso9660 and labeled + # according to the specification, the config drive + # is either formatted in vfat or iso9660 and labeled # config-2 for f in iso9660 msdosfs; do drive="/dev/$f/[cC][oO][nN][fF][iI][gG]-2" @@ -39,7 +39,7 @@ nuageinit_start() err 1 "Impossible to find a cloud init provider" fi mkdir -p /media/nuageinit - fs=$(fstyp $drive) + fs=$(fstyp $drive 2> /dev/null) mount -t $fs $drive /media/nuageinit # according to the specification, the content is either # in the openstack or ec2 directory From nobody Tue Oct 8 07:07:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Xy4B9dz5Z4T0; Tue, 08 Oct 2024 07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Xy1tYBz42Yg; Tue, 8 Oct 2024 07: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=1728371266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZPr9PGuHEUBOBEmeETDNYynvyoxr6+ZCLp871khvws=; b=TmBxHDkx8FmuZFtBxoVbmJqYeUCq7K/ARh87cSQBcEcZBxvkWHmV5MvaGQtRrj/Qse97+i Qi0/IYDnWIVm0ojHn9fjrPA1VcDVS9rVd6XruJMhv9d6jqkvw1mn29kLOvLJTMmR7jr/wE gK6vX6RK7jscflxFb6o3ejJZJeobcW9jJV+tRMOrAYgwHlkEqcrDZVjUBkvT/3dxWJJcTo FRku3CwuefrkJd9GZ/yIWbh/ZDcIgX/KMkDLnRiSUwE2k7JJaJswJ62QbcINqUPe4Di6I8 HSe5Wu0Il3v1MdTZE+bAAmUmuz8Xol39s7ESsNU1ATHs73XbgzEuCSa7maQ/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371266; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CZPr9PGuHEUBOBEmeETDNYynvyoxr6+ZCLp871khvws=; b=KKlsHfNu4rRfSk9pX9fgCwvYlci1QiFZcuK+/5ACLqm5wiqxveU7cBPMjdnCSOuILCbVYG DSvnAarbKMBuZhXDsyd57shtoEEeunJjRWMIzVdmA0RbWgae8LhLbGwKbIC/WNwlktbGc6 QAKEyD1Xq3gnwKMql1G+9Bchmxiyl/7U77P432zAfd4+4eacYxBMMsTRWgPCVL3dat+ECd WPRD2K/Ggz7XESSOCV8YQvFQHcgsxbuMrgZY7+NRsWDyfN//NDC+dhv8xEicGtoZkvwFvG BXGIHpYpjZjL9HTbYtGIXgrHC5UrP2Exm9CUxMwxw4aXRmDjn73HfrGlJslSag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371266; a=rsa-sha256; cv=none; b=eQZiSjZIs2VwE05w7u97XIiTM7DSbDBk7k8hzcefbeRU8ijd1Jez5ULH+yunYxS6b3f220 M+OPGqDxFZBUb9MN6MisKUt1EIlCEg6JtzhQhg4U/Wc86zwE5542ygm8FP1Ac3V/HMWAcT gZCNb6utOOTI7esmtOY0Dv0x2JWo1zqhlvONTr7NIvuAZ4JSVpA2ZJp63nlK9AmE83QBEk n6C7quFyEyYHXBsW+PfhUHCg/RGAjjyQ/ZH1FlNQHjDWHVrZcLtPIrhXKW5HfCUT+JTwVq v88SDChvl2QIE7rBp8wP8CG3f6PzKaDk8UcIkFWIU6ClCotfq98RWG7zWBi/WA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Xy0qb6zL9D; Tue, 8 Oct 2024 07:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877k2q051485; Tue, 8 Oct 2024 07:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877kn4051482; Tue, 8 Oct 2024 07:07:46 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:46 GMT Message-Id: <202410080707.49877kn4051482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 1eaf3331eaee - stable/14 - nuageinit: Replace os.execute with Lua libraries List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 1eaf3331eaee56f012191195dc3e688f5284f69d Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=1eaf3331eaee56f012191195dc3e688f5284f69d commit 1eaf3331eaee56f012191195dc3e688f5284f69d Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 00:37:10 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Replace os.execute with Lua libraries Prefer posix.sys.stat's chmod() to os.execute(). While here, change the name of the locals to be more descriptive. Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit 9b2d92addc31ba6f5696c85d184a45d43e9073dc) --- libexec/nuageinit/nuage.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index d35d3725fa99..1f035036f802 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -3,8 +3,9 @@ -- -- Copyright(c) 2022 Baptiste Daroussin <bapt@FreeBSD.org> +local unistd = require("posix.unistd") +local sys_stat = require("posix.sys.stat") local lfs = require("lfs") -local pu = require("posix.unistd") local function warnmsg(str) io.stderr:write(str .. "\n") @@ -206,12 +207,12 @@ local function addsshkey(homedir, key) f:write(key .. "\n") f:close() if chownak then - os.execute("chmod 0600 " .. ak_path) - pu.chown(ak_path, dirattrs.uid, dirattrs.gid) + sys_stat.chmod(ak_path, 384) + unistd.chown(ak_path, dirattrs.uid, dirattrs.gid) end if chowndotssh then - os.execute("chmod 0700 " .. dotssh_path) - pu.chown(dotssh_path, dirattrs.uid, dirattrs.gid) + sys_stat.chmod(dotssh_path, 448) + unistd.chown(dotssh_path, dirattrs.uid, dirattrs.gid) end end From nobody Tue Oct 8 07:07:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Xz3mYpz5Z4yP; Tue, 08 Oct 2024 07:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Xz35c0z42KW; Tue, 8 Oct 2024 07:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YujeaGFYQx7hLl2K1N+zdxtr6V49u8Sp3WnMtDMs6ag=; b=jteK7pUn3L0TBdrgWmU0MocDr+PdBCnm6F1nPwni8JESQrubDhRgMK0VstxozyxUgHzWhy vJahFr6KndspVi+UJqciOWg0X3XL6R9lHQILqrYuj6ghE4bGcZZLWWhOHvZHEnBzSn6NuA 32rnR1oSBp+sg17/KaCb9p5B2XCgWJJczjt1hmX25R203mth9fHpteFcS4CJ2XzokzEbXr JVP/vpIfelNoUZvEKECpwF+/NP1FNxo6MG+7xXiDiAJciRXuYmyHulY3UFtmWLIyka3vrs K7c/3bF31bHAGrtT/9iI0NVkLKtvUtASLmGY/+UWllSjw/WPljg47LVWcCJxFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YujeaGFYQx7hLl2K1N+zdxtr6V49u8Sp3WnMtDMs6ag=; b=wAemcu9xWDhvfMEadRGlHQYt6xzL0cUO+4ARbmkFfUZS+9iuiCqilShJEV9FKMDPzGJ70K 6LJrVi5NEvgQzi22ZTofzq03CudS0gSCuBJ8UbZcd9awvUoBWhmkZOEZYz/N38CPnxzkkW EK4s5OYEN1cSqoRF6F5yboWI8oZFaIum4HvsRWdsWu2XoeR3BokqxJyN3PeVs/eut8Jfcl OLg2VcjLFFtqYEavv49MIwNB/83BrQuM+7J13lw8/qinidhWe+ObjwQb7YbUVMWSLFMnsQ BFTMvx9sAqe0qZnzTF1RYKTxNKT0TPKD3q30D3NiDk/xgPjshHBPmzW87d5f0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371267; a=rsa-sha256; cv=none; b=eGb8z1PWluiWJGtfsZEL/O/h3iKUR1WjG8v+smZ8LBMy78qiHVhpZBbS/3meg7M2LSTRzD Dh9rt7KKQdUWDU82MvPU/5u/vj6x1CPiK0kMVIWuEJECSu80jNuAYyJ5+f0vV5yQB8Cqz+ 9vilV5b17d769kO0ohz3pL4m+fMRNDa3Oa183wbqTsAOUrKi/T+H0hUKv/P2qdeJM1enaQ NpE/upFbdhaZzYzPoYuYGb/zUt+iZOfX3Yxdg7HgVNpb2N3bRauWmWzCIlWmbgVi/fZudf vRnI+BP4Pxk3eoPiTinFrDWNCZE0ysvSNGsdcKrxvmX++kz9O/hpwFL56fz/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 4XN6Xz1mZJzKxy; Tue, 8 Oct 2024 07:07:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877lja051528; Tue, 8 Oct 2024 07:07:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877lVt051525; Tue, 8 Oct 2024 07:07:47 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:47 GMT Message-Id: <202410080707.49877lVt051525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 182ff41e8484 - stable/14 - nuageinit: Standardize warning/error messages List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 182ff41e84849f0c4fc2c07755604a26d8f8cd64 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=182ff41e84849f0c4fc2c07755604a26d8f8cd64 commit 182ff41e84849f0c4fc2c07755604a26d8f8cd64 Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 01:18:11 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Standardize warning/error messages Standardize the utilities from nuage.lua, to return nil on failure, plus an error message as a second result, and some value different from nil on success. Make warnmsg() and errmsg() append "nuageinit: " by default. Pass an optional second parameter as false to avoid printing this tag. Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit 945632ca76117029e7bd1f46d17ccb378973daf7) --- libexec/nuageinit/nuage.lua | 21 ++++++++++++++------- libexec/nuageinit/nuageinit | 26 +++++++++++++------------- libexec/nuageinit/tests/nuage.sh | 4 ++-- libexec/nuageinit/tests/nuageinit.sh | 4 ++-- libexec/nuageinit/tests/utils.sh | 4 ++-- 5 files changed, 33 insertions(+), 26 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 1f035036f802..c27b66b23be2 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -7,12 +7,19 @@ local unistd = require("posix.unistd") local sys_stat = require("posix.sys.stat") local lfs = require("lfs") -local function warnmsg(str) - io.stderr:write(str .. "\n") +local function warnmsg(str, prepend) + if not str then + return + end + local tag = "" + if prepend ~= false then + tag = "nuageinit: " + end + io.stderr:write(tag .. str .. "\n") end -local function errmsg(str) - io.stderr:write(str .. "\n") +local function errmsg(str, prepend) + warnmsg(str, prepend) os.exit(1) end @@ -129,7 +136,7 @@ local function adduser(pwd) local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add user " .. pwd.name) + warnmsg("fail to add user " .. pwd.name) warnmsg(cmd) return nil end @@ -172,7 +179,7 @@ local function addgroup(grp) cmd = cmd .. "groupadd -n " .. grp.name .. extraargs local r = os.execute(cmd) if not r then - warnmsg("nuageinit: fail to add group " .. grp.name) + warnmsg("fail to add group " .. grp.name) warnmsg(cmd) return false end @@ -201,7 +208,7 @@ local function addsshkey(homedir, key) local f = io.open(ak_path, "a") if not f then - warnmsg("nuageinit: impossible to open " .. ak_path) + warnmsg("impossible to open " .. ak_path) return end f:write(key .. "\n") diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 50d77dfef9f5..8c289fea6b1d 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -9,7 +9,7 @@ local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage " .. arg[0] .. " <cloud-init directory> [config-2|nocloud]") + nuage.err("Usage " .. arg[0] .. " <cloud-init directory> [config-2|nocloud]", false) end local path = arg[1] local citype = arg[2] @@ -32,7 +32,7 @@ local function open_config(name) nuage.mkdir_p(root .. "/etc/rc.conf.d") local f, err = io.open(root .. "/etc/rc.conf.d/" .. name, "w") if not f then - nuage.err("nuageinit: unable to open " .. name .. " config: " .. err) + nuage.err("unable to open " .. name .. " config: " .. err) end return f end @@ -69,14 +69,14 @@ local function config2_network(p) f:close() local res, err = parser:parse_file(p .. "/network_data.json") if not res then - nuage.warn("nuageinit: error parsing network_data.json: " .. err) + nuage.warn("error parsing network_data.json: " .. err) return end local obj = parser:get_object() local ifaces = get_ifaces() if not ifaces then - nuage.warn("nuageinit: no network interfaces found") + nuage.warn("no network interfaces found") return end local mylinks = {} @@ -167,7 +167,7 @@ if citype == "config-2" then local res, err = parser:parse_file(path .. "/meta_data.json") if not res then - nuage.err("nuageinit: error parsing config-2: meta_data.json: " .. err) + nuage.err("error parsing config-2 meta_data.json: " .. err) end local obj = parser:get_object() if obj.public_keys then @@ -183,12 +183,12 @@ if citype == "config-2" then elseif citype == "nocloud" then local f, err = io.open(path .. "/meta-data") if err then - nuage.err("nuageinit: error parsing nocloud meta-data: " .. err) + nuage.err("error parsing nocloud meta-data: " .. err) end local obj = yaml.eval(f:read("*a")) f:close() if not obj then - nuage.err("nuageinit: error parsing nocloud meta-data") + nuage.err("error parsing nocloud meta-data") end local hostname = obj["local-hostname"] if not hostname then @@ -222,21 +222,21 @@ if line == "#cloud-config" then local obj = yaml.eval(f:read("*a")) f:close() if not obj then - nuage.err("nuageinit: error parsing cloud-config file: " .. ud) + nuage.err("error parsing cloud-config file: " .. ud) end if obj.groups then for n, g in pairs(obj.groups) do if (type(g) == "string") then local r = nuage.addgroup({name = g}) if not r then - nuage.warn("nuageinit: failed to add group: " .. g) + nuage.warn("failed to add group: " .. g) end elseif type(g) == "table" then for k, v in pairs(g) do nuage.addgroup({name = k, members = v}) end else - nuage.warn("nuageinit: invalid type: " .. type(g) .. " for users entry number " .. n) + nuage.warn("invalid type: " .. type(g) .. " for users entry number " .. n) end end end @@ -260,7 +260,7 @@ if line == "#cloud-config" then end end else - nuage.warn("nuageinit: invalid type : " .. type(u) .. " for users entry number " .. n) + nuage.warn("invalid type : " .. type(u) .. " for users entry number " .. n) end ::unext:: end @@ -288,7 +288,7 @@ if line == "#cloud-config" then goto next end if not ifaces[v.match.macaddress] then - nuage.warn("nuageinit: not interface matching: " .. v.match.macaddress) + nuage.warn("not interface matching: " .. v.match.macaddress) goto next end local interface = ifaces[v.match.macaddress] @@ -325,6 +325,6 @@ if line == "#cloud-config" then else local res, err = os.execute(path .. "/" .. ud) if not res then - nuage.err("nuageinit: error executing user-data script: " .. err) + nuage.err("error executing user-data script: " .. err) end end diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 4e2353176b16..6d8a2746de1f 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -42,7 +42,7 @@ adduser_body() printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd pwd_mkdb -d etc etc/master.passwd printf "wheel:*:0:root\n" > etc/group - atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua + atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua test -d home/impossible_username || atf_fail "home not created" atf_check -o inline:"impossible_username::1001:1001::0:0:impossible_username User:/home/impossible_username:/bin/sh\n" grep impossible_username etc/master.passwd } @@ -52,7 +52,7 @@ addgroup_body() export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group - atf_check -e inline:"Argument should be a table\nArgument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua + atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua atf_check -o inline:"impossible_groupname:*:1001:\n" grep impossible_groupname etc/group } diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 64ac066fefbf..f3fc55e87523 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -22,7 +22,7 @@ args_body() atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop - atf_check -s exit:1 -e inline:"Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh + atf_check -s exit:1 -e inline:"nuageinit: Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh } nocloud_body() @@ -174,7 +174,7 @@ config2_body() { here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing config-2: meta_data.json.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 printf "{}" > media/nuageinit/meta_data.json atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF diff --git a/libexec/nuageinit/tests/utils.sh b/libexec/nuageinit/tests/utils.sh index c3b5b8212938..26f117d81d60 100644 --- a/libexec/nuageinit/tests/utils.sh +++ b/libexec/nuageinit/tests/utils.sh @@ -10,12 +10,12 @@ atf_test_case dirname warn_body() { - atf_check -e "inline:plop\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/warn.lua + atf_check -e "inline:nuageinit: plop\n" -s exit:0 /usr/libexec/flua $(atf_get_srcdir)/warn.lua } err_body() { - atf_check -e "inline:plop\n" -s exit:1 /usr/libexec/flua $(atf_get_srcdir)/err.lua + atf_check -e "inline:nuageinit: plop\n" -s exit:1 /usr/libexec/flua $(atf_get_srcdir)/err.lua } dirname_body() From nobody Tue Oct 8 07:07:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Y04MsYz5Z4wD; Tue, 08 Oct 2024 07:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Y03GjDz42ms; Tue, 8 Oct 2024 07:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJC+m92DiMMVnu9c2Rbj6QQNQBHwsFMv0H3G8+3XGDM=; b=KUazA4LZAgVOOD/kI6GAUcwInrTrH0h4rRhluLP2ZF6hdvvwAnKbmot14AdxjRzfege6s7 vS16+JAKVno5iEPnILmE0J2kApfQQkWNnbFVrhtXrqBnpECDCIp3bo6itaDvPhqOjKiDxC jktdGPEZ+4MkDsE35/noCNt4SBOeP7A2svznNjY1lC50YJk5lWBo2jE8tsheB5QLpTukaU 87eLrghOchs2eOAToKMdSOcUSiZ+/jcAtJPykMVhtfpTxSP+c2pO4k9+9oKonkDfI+BPOO DMJj8V2ceBLhBPFz0D3YeI9uWIYtiCrp3zyRjHV8eEduHh3QWWCeIuVigIOtmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rJC+m92DiMMVnu9c2Rbj6QQNQBHwsFMv0H3G8+3XGDM=; b=Z1kAsVMxJLPwEZNZf9xRu3++vAXEfPsS+7YebKBoFVGHIvXPvb1+bRZsJYlOZztiz0f3oz Tr66P8Zg1dkWUmujy8iE4dkGwCZnAH2mPBWpZexoMmjwxnxAXv55ooxxUExbD++l1+ZmmB XQUKcbBAAtLPeAw1Ba3D3XWEs2rpZVjzR2XBGru6HZXFUQYHo3kgcxPu99uWbGjbTd4He3 PwzXBMfLYvXKPcPen+kO8I3b9oa4opGqdJzo88r5C3S36sH3EbIl+9pEtDhH5SLOyWc5Qp vIudk5cUAznk5kKBFWbx5ZRtpRzbE6Mz07uP1Dgio3oSRfd31SV1kw56s3xHdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371268; a=rsa-sha256; cv=none; b=mFIZQVESbzMUv+NAAbQopRcWDz9OD4ZxnJp6i2+fo0PmZ1tHpRJtPD2cac9lnoxxYAhise zTchaCGXpG9QpYhFZeUWpl42YgGHaFIhYb5MqSocUpqaNQe0jZZFcfoQwCekiqyvdzBWVr q8f/RjbUwvVhrhzBVVx9dm46vMX/QSxz863bAoTpm3F7TJm9bRJDbVa5ApQewfdZMIrxTS SynVi8EUHfcYY/L5XdGsFuuQRXWHMPBjAEEDnxbcUOOItMKr3ynecRVePs5yubMQT0bBsm ErRESi0Mm9jE/obnONQlLeeTLN3D2RPqFbCdo2BnCB+4n/FbJiVqvNxubhkMhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Y02mTtzLGM; Tue, 8 Oct 2024 07:07:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877moK051573; Tue, 8 Oct 2024 07:07:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877mKC051570; Tue, 8 Oct 2024 07:07:48 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:48 GMT Message-Id: <202410080707.49877mKC051570@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 03abe3ac4077 - stable/14 - nuageinit: Standardize user-facing error messages List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 03abe3ac4077101f30561fe8ca0b4007012bd63b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=03abe3ac4077101f30561fe8ca0b4007012bd63b commit 03abe3ac4077101f30561fe8ca0b4007012bd63b Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 01:59:16 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Standardize user-facing error messages Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit 38bb6f79e39a14ea99f559f59129a4cadf92b569) --- libexec/nuageinit/nuageinit | 2 +- libexec/nuageinit/tests/nuageinit.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index 8c289fea6b1d..c8f74d13b7fd 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -9,7 +9,7 @@ local ucl = require("ucl") local yaml = require("yaml") if #arg ~= 2 then - nuage.err("Usage " .. arg[0] .. " <cloud-init directory> [config-2|nocloud]", false) + nuage.err("Usage: " .. arg[0] .. " <cloud-init-directory> (<config-2> | <nocloud>)", false) end local path = arg[1] local citype = arg[2] diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index f3fc55e87523..6b8ea7ff3328 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -19,9 +19,9 @@ atf_test_case config2_network_static_v4 args_body() { - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla - atf_check -s exit:1 -e inline:"Usage /usr/libexec/nuageinit <cloud-init directory> [config-2|nocloud]\n" /usr/libexec/nuageinit bla meh plop + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit bla + atf_check -s exit:1 -e inline:"Usage: /usr/libexec/nuageinit <cloud-init-directory> (<config-2> | <nocloud>)\n" /usr/libexec/nuageinit bla meh plop atf_check -s exit:1 -e inline:"nuageinit: Unknown cloud init type: meh\n" /usr/libexec/nuageinit bla meh } From nobody Tue Oct 8 07:07:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Y16dBHz5Z54B; Tue, 08 Oct 2024 07:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Y14v9pz42bt; Tue, 8 Oct 2024 07:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ACBL69GwZuE3NKrZ0RB5l/W5WkDBLfmIzuDHZTNX/FE=; b=lieZa/FUpcsYBd46TH8UrH3L9haUm7qRYHZXC/SWgaWE9qjWLDsO1CLw4umvNc77dBW+JA GDajntiHjrCedd3C2D2xWh1fw8sa0Ven66qrXmZfyKsnA2LvXLbFSfHKovqk4zZFhPV7de naw/n/4CVwJAGwUZvWx6IrnkLrOBM5gVc690hlsOkV02n6daMr12DrmizB3Pl6+40F4OBv mQtmkSpuccPObBakJmu5VHDEQspTwc958VwsOwjSSdRdGGQC8e51zUOF6k0pmHtIxkbs+l r0Ika7raC6Om18N976hrZ01+BO1Ydia4GAnwrqOwSG9GRjUDBgsrdKGB5Nz+Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371269; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ACBL69GwZuE3NKrZ0RB5l/W5WkDBLfmIzuDHZTNX/FE=; b=oUEubhH1dzMQa61BhnGF68bYmrlFoqD33GaKm9uf8m8yvOQorUQdQcVXXL5fU8Xwk6z/mr EmZkl9P00I0tC77gDiYz0ZYmLzVhgS1NNoNvPgDaV3+j9b5XEDOk+/4KsNhhn+46Yk2n9+ WPrRcSqaS13wFbgs7TCEGbjiBgbD1vPY1VTN/DnPFKbDrmiGzZ9NILOPb7NmZGgTxrGaWQ GQ3bmbJCVx5KHz+brpYnYOECxMQqblRX9SWFN+iKcxV103p3Fpu3Ifiai5b6ARSFhD1sKE K5AJMUwMFpoHMifvVjXnqbUnFpvAHqijQM6gdAwLCIWRXv3nsaTNGVutBRkv/Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371269; a=rsa-sha256; cv=none; b=vVfD+bRADKlFN4q5IZeu96+UNlZWJbK2U8B4WGVp4Ogcfvj00MrOrKgM6nukK1M1T16PWA 3eSf2sN/slE2Bd2F39Y9g3Neg1nZvGnl7miWglc5So5UiPlYq3jyL0+qFle4RAoVRyWl9H L7jsp51qFzNKqjVF+1bgtan5ez56U6IcKgFbH1fq5Co7cmNwKsWw2EyZlkqRJYVQUsZyle Yw9a8dUcXpv2bLnjYu8X+Ko7hAiN6MkgCHc5Q8YQkHnqDEyrByILrElANkPfw0tgfqkyEp mrRtwrwlIAN8+Vfu04Bzsl0Pz/oUzMiCcV2EGD0ZIj7ihovBVVkeTyYKYQdFjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Y13ckYzLGN; Tue, 8 Oct 2024 07:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877nwH051609; Tue, 8 Oct 2024 07:07:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877nLG051606; Tue, 8 Oct 2024 07:07:49 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:49 GMT Message-Id: <202410080707.49877nLG051606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 9881d68b1ea7 - stable/14 - nuageinit: Fix passwords List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9881d68b1ea763efd6db7c7aecbe47176851582b Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9881d68b1ea763efd6db7c7aecbe47176851582b commit 9881d68b1ea763efd6db7c7aecbe47176851582b Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 01:28:18 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:01 +0000 nuageinit: Fix passwords The hashed password usually contains a "$" sign, which, when used on a shell, must be escaped. Also, the plain text password may contain special characters that require escaping. Add a quick fix by enclosing it in single quotes. Note that if the plain text password contains a "'", it will still fail. This will be properly fixed in later commits. Some here documents require the document to be a string literal, especially when passing invalid characters. Enclose it in single quotes. Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit b9ce743c5447e90c2c97f4d49e048c301f708527) --- libexec/nuageinit/nuage.lua | 8 ++++---- libexec/nuageinit/tests/nuageinit.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index c27b66b23be2..4e21405a443b 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -120,11 +120,11 @@ local function adduser(pwd) local precmd = "" local postcmd = "" if pwd.passwd then - precmd = "echo " .. pwd.passwd .. "| " - postcmd = " -H 0 " + precmd = "echo '" .. pwd.passwd .. "' | " + postcmd = " -H 0" elseif pwd.plain_text_passwd then - precmd = "echo " .. pwd.plain_text_passwd .. "| " - postcmd = " -h 0 " + precmd = "echo '" .. pwd.plain_text_passwd .. "' | " + postcmd = " -h 0" end cmd = precmd .. "pw " if root then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 6b8ea7ff3328..434fb3095929 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -81,7 +81,7 @@ EOF wheel:*:0:root users:*:1: EOF - cat > media/nuageinit/user-data << EOF + cat > media/nuageinit/user-data << 'EOF' #cloud-config groups: - admingroup: [root,sys] @@ -103,11 +103,11 @@ cloud-users:*:1002: freebsd:*:1003: foobar:*:1004: EOF - cat > expectedpasswd << EOF + cat > expectedpasswd << 'EOF' root:*:0:0::0:0:Charlie &:/root:/bin/csh sys:*:1:0::0:0:Sys:/home/sys:/bin/csh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh -foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh +foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd From nobody Tue Oct 8 07:07:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Y25Xz0z5Z54F; Tue, 08 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Y255Xgz42kf; Tue, 8 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMW4yyv7XJ0nybJihjIhujKZd4S200beIBJxqD1QJNg=; b=wQYkOTjBE42RWb4mV9kvocoH/5N5S3x/SnrItTJpQruJR/rBOgiTgO42gPHiHZkeVqUb3S 4zn5zQdCsftkGsSW1pfML+59PVeeAn9TKBN4uC7GBckrQYqdS4q66wkUszKDMnYNrSnoJ8 aPTZ/QNgu+18Gq/7I2cFMG5z7Pr4LyaolrANjyql6lwR7VYpKAxA7EXOv5B9lSVuqwxFDp 3G1r77lL98I772CGUSBsCDC+Xe436LUVstbNK7E+uTZTtAf8MM4CNHDx4+mQomZyY6mLRb c+8sIT4VGk5oE8wfw+qya1qEGmxdY5eY0MGzJsVmgduvW4XcBXOmRsz1ohoOrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMW4yyv7XJ0nybJihjIhujKZd4S200beIBJxqD1QJNg=; b=S8xN6S3qh8I0C0JNhXW+o4CDdJwJIiyTIaEWFUjdgMsbfOyMn0TYYlfrxY98cEwr8qLOLZ 38/9N8fYF8TEPkr9+GNLvXBWeZjBvW16y3+jPvdJaEDtMT2dvi56a2cg3ImVVAOVkaBKaf 71mgkgf7j8TXNgT/vVdEDV4yMjf9FBZC5iV1Rwho+st65vU/h8Gj032xjcok+hySoYbnY0 6UPBqPB/laGFjoxbAnUsXENLb32xzk4isU3QRA3enbRbanSTzrizXw6FIrCxHdeWu/8hqo SVe+1uWtsES0jRMMs4wzxiE1h14eqZBNQMNDX50/L+5j3Vdfxc9/m+K/OF9Jiw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371270; a=rsa-sha256; cv=none; b=MXzoSmJJFNJjdEgLxyxSLVC+J3A2D1HZYIQfVyS1YahhC95fI0zw7TXSZktf8tojemjbU8 hYPZIPX3jAWLnYavQquhn+ZngNE5QWOnRVMtHTfc2vZs2j2YVo4jupiM9lFZXuyKRaHlUB yDeqgp1zVXEFneUDN3u7ui/RxD3LQRz7IIQheu5UKCpeDDaPzCo1C5qVclywEXrJc7qfZm lIyIsWi4KO+HvDu2vDbYDr4Tq753Q+oOppUHNkrAfxh/0S6L7t1us5uWEWREwope8WVx8E /nvZQyb4kMYJTdMZew/X5WhVtRh3NPLd/gWXr8YaHHf0ERJ7h8rTZzeMXbDVyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Y24NbnzLTj; Tue, 8 Oct 2024 07:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877oQJ051645; Tue, 8 Oct 2024 07:07:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877o0g051642; Tue, 8 Oct 2024 07:07:50 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:50 GMT Message-Id: <202410080707.49877o0g051642@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: e573007af24a - stable/14 - nuageinit: tests: Cleanup List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e573007af24ac41dbd3f8f959949f30b6047587e Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=e573007af24ac41dbd3f8f959949f30b6047587e commit e573007af24ac41dbd3f8f959949f30b6047587e Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 03:26:21 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:02 +0000 nuageinit: tests: Cleanup - Export NUAGE_FAKE_ROOTDIR only once - Use the header section of the test to require the root user - Use the PWD environment variable - Set the root/sys shell as /bin/sh - Use RFC 5737 reserved IP addresses Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit e72457c4f5166eef2a27249e02f3c1e9a1cf852d) --- libexec/nuageinit/tests/nuage.sh | 14 +-- libexec/nuageinit/tests/nuageinit.sh | 165 ++++++++++++++++------------------- 2 files changed, 83 insertions(+), 96 deletions(-) diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 6d8a2746de1f..293a0a4a9a83 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case sethostname atf_test_case addsshkey atf_test_case adduser @@ -11,7 +13,6 @@ atf_test_case addgroup sethostname_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" atf_check /usr/libexec/flua $(atf_get_srcdir)/sethostname.lua if [ ! -f etc/rc.conf.d/hostname ]; then atf_fail "hostname not written" @@ -32,14 +33,14 @@ addsshkey_body() atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys } +adduser_head() +{ + atf_set "require.user" root +} adduser_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir etc - printf "root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" > etc/master.passwd + printf "root:*:0:0::0:0:Charlie &:/root:/bin/sh\n" > etc/master.passwd pwd_mkdb -d etc etc/master.passwd printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/adduser.lua @@ -49,7 +50,6 @@ adduser_body() addgroup_body() { - export NUAGE_FAKE_ROOTDIR="$(pwd)" mkdir etc printf "wheel:*:0:root\n" > etc/group atf_check -e inline:"nuageinit: Argument should be a table\nnuageinit: Argument should be a table\n" /usr/libexec/flua $(atf_get_srcdir)/addgroup.lua diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 434fb3095929..f7f39ce32ad8 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: BSD-2-Clause # +export NUAGE_FAKE_ROOTDIR="$PWD" + atf_test_case args atf_test_case nocloud atf_test_case nocloud_userdata_script @@ -27,56 +29,51 @@ args_body() nocloud_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit ${here}/media/nuageinit/ nocloud - export NUAGE_FAKE_ROOTDIR=$(pwd) - printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > ${here}/media/nuageinit/meta-data - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:1 -e match:"nuageinit: error parsing nocloud.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit/ nocloud + printf "instance-id: iid-local01\nlocal-hostname: cloudimg\n" > "${PWD}"/media/nuageinit/meta-data + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname cat > media/nuageinit/meta-data << EOF instance-id: iid-local01 hostname: myhost EOF - atf_check -s exit:0 /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud atf_check -o inline:"hostname=\"myhost\"\n" cat etc/rc.conf.d/hostname } nocloud_userdata_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user-data - chmod 755 ${here}/media/nuageinit/user-data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data + chmod 755 "${PWD}"/media/nuageinit/user-data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } nocloud_user_data_script_body() { - here=$(pwd) mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data - printf "#!/bin/sh\necho yeah\n" > ${here}/media/nuageinit/user_data - chmod 755 ${here}/media/nuageinit/user_data - atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data + printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user_data + chmod 755 "${PWD}"/media/nuageinit/user_data + atf_check -s exit:0 -o inline:"yeah\n" /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud } +nocloud_userdata_cloudconfig_users_head() +{ + atf_set "require.user" root +} nocloud_userdata_cloudconfig_users_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: @@ -94,7 +91,7 @@ users: groups: users passwd: $6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/ EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > expectedgroup << EOF wheel:*:0:root,freebsd users:*:1:foobar @@ -104,33 +101,33 @@ freebsd:*:1003: foobar:*:1004: EOF cat > expectedpasswd << 'EOF' -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:$6$j212wezy$7H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF - sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd - atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd - atf_check -o file:expectedgroup cat ${here}/etc/group + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" "${PWD}"/etc/master.passwd + atf_check -o file:expectedpasswd cat "${PWD}"/etc/master.passwd + atf_check -o file:expectedgroup cat "${PWD}"/etc/group } +nocloud_network_head() +{ + atf_set "require.user" root +} nocloud_network_body() { - here=$(pwd) mkdir -p media/nuageinit mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mynetworks=$(ifconfig -l ether) if [ -z "$mynetworks" ]; then atf_skip "a network interface is needed" @@ -138,7 +135,7 @@ EOF set -- $mynetworks myiface=$1 myaddr=$(ifconfig $myiface ether | awk '/ether/ { print $2 }') - printf "instance-id: iid-local01\n" > ${here}/media/nuageinit/meta-data + printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data cat > media/nuageinit/user-data << EOF #cloud-config network: @@ -149,51 +146,48 @@ network: match: macaddress: "$myaddr" addresses: - - 192.168.14.2/24 - - 2001:1::1/64 - gateway4: 192.168.14.1 - gateway6: 2001:1::2 + - 192.0.2.2/24 + - 2001:db8::2/64 + gateway4: 192.0.2.1 + gateway6: 2001:db8::1 EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit nocloud + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud cat > network << EOF -ifconfig_${myiface}="inet 192.168.14.2/24" -ifconfig_${myiface}_ipv6="inet6 2001:1::1/64" +ifconfig_${myiface}="inet 192.0.2.2/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::2/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF cat > routing << EOF -defaultrouter="192.168.14.1" -ipv6_defaultrouter="2001:1::2" -ipv6_route_${myiface}="2001:1::2 -prefixlen 128 -interface ${myiface}" +defaultrouter="192.0.2.1" +ipv6_defaultrouter="2001:db8::1" +ipv6_route_${myiface}="2001:db8::1 -prefixlen 128 -interface ${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } + config2_body() { - here=$(pwd) mkdir -p media/nuageinit - atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check -s exit:1 -e match:"nuageinit: error parsing config-2 meta_data.json:.*" /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 printf "{}" > media/nuageinit/meta_data.json - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > media/nuageinit/meta_data.json << EOF { "hostname": "cloudimg" } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"hostname=\"cloudimg\"\n" cat etc/rc.conf.d/hostname } +config2_pubkeys_head() +{ + atf_set "require.user" root +} config2_pubkeys_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user-data << EOF @@ -203,26 +197,24 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } - +config2_pubkeys_user_data_head() +{ + atf_set "require.user" root +} config2_pubkeys_user_data_body() { - here=$(pwd) - export NUAGE_FAKE_ROOTDIR=$(pwd) - if [ $(id -u) -ne 0 ]; then - atf_skip "root required" - fi mkdir -p media/nuageinit touch media/nuageinit/meta_data.json cat > media/nuageinit/user_data << EOF @@ -232,15 +224,15 @@ ssh_authorized_keys: EOF mkdir -p etc cat > etc/master.passwd << EOF -root:*:0:0::0:0:Charlie &:/root:/bin/csh -sys:*:1:0::0:0:Sys:/home/sys:/bin/csh +root:*:0:0::0:0:Charlie &:/root:/bin/sh +sys:*:1:0::0:0:Sys:/home/sys:/bin/sh EOF - pwd_mkdb -d etc ${here}/etc/master.passwd + pwd_mkdb -d etc "${PWD}"/etc/master.passwd cat > etc/group << EOF wheel:*:0:root users:*:1: EOF - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys } @@ -292,7 +284,6 @@ EOF config2_network_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -322,7 +313,7 @@ cat > media/nuageinit/network_data.json << EOF "type": "ipv6", "link": "iface0", // supports condensed IPv6 with CIDR netmask - "ip_address": "2001:cdba::3257:9652/24", + "ip_address": "2001:db8::3257:9652/64", "gateway": "fd00::1", "routes": [ { @@ -341,11 +332,10 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="DHCP" -ifconfig_${myiface}_ipv6="inet6 2001:cdba::3257:9652/24" +ifconfig_${myiface}_ipv6="inet6 2001:db8::3257:9652/64" ipv6_network_interfaces="${myiface}" ipv6_default_interface="${myiface}" EOF @@ -354,13 +344,12 @@ ipv6_defaultrouter="fd00::1" ipv6_route_${myiface}="fd00::1 -prefixlen 128 -interface ${myiface}" ipv6_static_routes="${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } config2_network_static_v4_body() { - here=$(pwd) mkdir -p media/nuageinit printf "{}" > media/nuageinit/meta_data.json mynetworks=$(ifconfig -l ether) @@ -402,9 +391,7 @@ cat > media/nuageinit/network_data.json << EOF ] } EOF - - export NUAGE_FAKE_ROOTDIR=$(pwd) - atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2 + atf_check /usr/libexec/nuageinit "${PWD}"/media/nuageinit config-2 cat > network << EOF ifconfig_${myiface}="inet 10.184.0.244 netmask 255.255.240.0" EOF @@ -413,8 +400,8 @@ route_cloudinit1_${myiface}="-net 10.0.0.0 11.0.0.1 255.0.0.0" defaultrouter="23.253.157.1" static_routes="cloudinit1_${myiface}" EOF - atf_check -o file:network cat ${here}/etc/rc.conf.d/network - atf_check -o file:routing cat ${here}/etc/rc.conf.d/routing + atf_check -o file:network cat "${PWD}"/etc/rc.conf.d/network + atf_check -o file:routing cat "${PWD}"/etc/rc.conf.d/routing } atf_init_test_cases() From nobody Tue Oct 8 07:07:51 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN6Y4113qz5Z54L; Tue, 08 Oct 2024 07:07:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN6Y36rvxz42sf; Tue, 8 Oct 2024 07:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TYUPIq/MSIjsaaXlGzb0UXV5QKJM1CMiKJ+wLIvVR0I=; b=Psr7/zrjmhFQCD0tnrxMSfUBlfhmzWdbpG3St1tmLKSF/bm5gxasm5EDHA6lVY9fXflsnt C4aos55QDDQN0DwtIbI/XgAd5qJQx1ZkMxT/++ZcCFc05Xn7laiW3v1tV4RJ77DtI9Ffzo 8fwt7Z09yQJM9RH/LRyeQEbEruN1td/XfX9cl9wv5ZW4loolbwJwQ/CH+6ceHFekDyt4E2 ZzZysAtYasZBbsF5N2O5ZQkJRRNn/9ZtIIgcmNdIeIwxjQ0HONt1uzkGsdRQD/dFjIf4// IIyV7lhT+hqKIC3XU5zH15X7109QR2l4urNhxfbinE4HSJ+dWGDk3N5/jhxWmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728371272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TYUPIq/MSIjsaaXlGzb0UXV5QKJM1CMiKJ+wLIvVR0I=; b=WhMuPGKiQbBnTK+qK4tLpq8cn/6riGSijCYOYv55084cy/G41yvItRGrdlND+9mvfNYvC5 zxk321g9jqHEr8hR1eaeVhvSMZAuEN7e8IHKr5P1NmPPqGU52Q4yr7akfNrnJ1Lh7e4pwy ErI9DadWDMY6GIkPdaWnTEOfthfpo96kGVGiVSmNXpkoxUypzLlZqHrBop4RcSDmqONOv3 UTogwFLPysMZzwePDFCVgjVeZ8+4ncsVaYXTT7TjLN1ncGE37zYYc8Zx1COmUBu2UU+5ps l5o2ivnRfo3RnlNNicLDztczxmlrAyo294hv0YBhDgbxSQCgagbDxlAN3cV7UA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728371272; a=rsa-sha256; cv=none; b=xsuhE6S6HzkJe/6qU4iWdqBlnGI1AE/6jDLb0gabivc/8yPQs0209z1TzSuYG8SZtQ1zVR fkMKejzsiJ211Nn1G6G46sWGXynv1q96OZSsnXSXaei8WJktb/zIf9A9DvKLP+5UufCH+6 fE+zQlX69GLnqDHXhYB2+z41oR5TGJ93niRLUlNfaS7gc2xonseGw5bah21/+8lU9d8QB4 pYbe//jjPhC8CJZsgdQHoU0mxyhuZN4xyIZZzI4meZSGCjHKrUfEgVIDHr6pAxmG4oII3e Ns3sOsI3+fo7eZreDJFMitSqlmNZZhoGsuYMpfS5PZGvefAxh+K96b8LqORe1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN6Y35Rq7zKw4; Tue, 8 Oct 2024 07:07:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49877pjS051687; Tue, 8 Oct 2024 07:07:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49877pcX051684; Tue, 8 Oct 2024 07:07:51 GMT (envelope-from git) Date: Tue, 8 Oct 2024 07:07:51 GMT Message-Id: <202410080707.49877pcX051684@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin <bapt@FreeBSD.org> Subject: git: 62cd7d538d86 - stable/14 - release: basic-cloudinit improve default image List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 62cd7d538d863aefbf0cbe57eca5cc8e86a855c5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=62cd7d538d863aefbf0cbe57eca5cc8e86a855c5 commit 62cd7d538d863aefbf0cbe57eca5cc8e86a855c5 Author: Jose Luis Duran <jlduran@gmail.com> AuthorDate: 2024-07-30 04:47:04 +0000 Commit: Baptiste Daroussin <bapt@FreeBSD.org> CommitDate: 2024-10-08 07:04:02 +0000 release: basic-cloudinit improve default image - Add the firstboot-freebsd-update package, as long as we do not have pkgbase, this is needed - Support SLAAC by default to complement DHCPv4 (use SYNCDHP instead) Signed-off-by: Jose Luis Duran <jlduran@gmail.com> (cherry picked from commit 120740221fd4a4577e63e6c279f9873cabe449d0) --- release/tools/basic-cloudinit.conf | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/release/tools/basic-cloudinit.conf b/release/tools/basic-cloudinit.conf index da4bed5ea5b5..a03c11603ed6 100644 --- a/release/tools/basic-cloudinit.conf +++ b/release/tools/basic-cloudinit.conf @@ -1,6 +1,4 @@ #!/bin/sh -# -# # Should be enough for base image, image can be resized in needed export VMSIZE=5g @@ -9,13 +7,17 @@ export VMSIZE=5g export CONFIG_DRIVE=YES export CONFIG_DRIVE_SIZE=1M +# Packages to install into the image we're creating. +# * firstboot-freebsd-update, to install security updates at first boot. +export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} firstboot-freebsd-update" + # Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST="sshd growfs nuageinit" +export VM_RC_LIST="${VM_RC_LIST} firstboot_freebsd_update growfs sshd nuageinit" vm_extra_pre_umount() { cat << EOF >> ${DESTDIR}/etc/rc.conf dumpdev="AUTO" -ifconfig_DEFAULT="DHCP" +ifconfig_DEFAULT="SYNCDHCP accept_rtadv" sshd_enable="YES" EOF @@ -25,7 +27,8 @@ beastie_disable="YES" loader_logo="none" console="comconsole,vidconsole" EOF - cat <<EOF >> ${DESTDIR}/etc/ssh/sshd_config + + cat << EOF >> ${DESTDIR}/etc/ssh/sshd_config PasswordAuthentication yes UsePAM no EOF From nobody Tue Oct 8 08:39:35 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN8Zv614yz5Z9bH; Tue, 08 Oct 2024 08:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN8Zv5TfMz4Fcr; Tue, 8 Oct 2024 08:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728376775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=99FjkK3BOW4eWejYgi53WEQYKOtr3IxqaKvCm/g5uKg=; b=grHwYfOgaNzIvftpdvxwAhA6BhEgyxgSvWLbN9ifY98Vx2qItzClG4wFJCBFv00KZZtJas /UtaBnjtZhbBDC82emijMGpftsoIxo4dTW462TZcmaewIWr3y4IplVe56tqgqflB2cz8Bb phoF29kA2VyBrxkKC9GhtLckWPlTS/yIX14XeNOzmLGxpVd/mpZIDN+Tooy4GkSy7DCXx8 vr4vOX2ZHMVA5xdxzkpSFPcjNTn0EouYzB2VL3Se9e7IcKcrAoAVViTYwaoQuTDqKsf81g j5yGuFtOQjExVay5k+sFRnCnUYRl9kdsOuUiJdGb1Ji6nFVKfiKmlye0nWwDow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728376775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=99FjkK3BOW4eWejYgi53WEQYKOtr3IxqaKvCm/g5uKg=; b=XyHAlazOaajA9EfOXdm071aYaNxJ+tQrqIGOtXM4BXFAD91l+JpuBmLObmnlWjCxn4VHPn vSoqvV83Y/J5Vww8iPXvTlX5RwYIP1c4XX0quGWP72mikH12WG3f38Ny4ggBjNgHpf0RYe CU5SdZBbvQc5IrD1QImBAHx/nXnGPlbWes4NKMf5yU4v46AcY+y1dTheCO1Tkq/L1yd671 j9HBA+Mk5wATSnaegpFKSg5no/Z/qWTwtkSHmg/cl23BMGLYVyvaiUdmT92x4snQFgDc9A uY2CD3RvB3d85ZOA6e8Fy88uiPqfmLEKIXp6OkIlkoIrCh/uZeD3YQv67FWhgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728376775; a=rsa-sha256; cv=none; b=G5pW2wHISKCMW16CigvpsbnmsJkaRPCwZgYY1c9n2oV6BMtHS1TYWrr0er7+SgdVl1iijZ O8bK7kZLWxYjpJaQkLo0aa8Lk+gDH/1ZyvDMMCOJzcvMLWFBnq4LIJlFG9a6ue69T/y3rj 97nD5tCtjpMA45dAtNn9Xl+mDMTujoAA79fRkNcTxsoN1B17PugDvdBTtf1m0JIl42vWP9 2lwbwXu2+4DRD5dJXcROzvJdaufKEZrv/DHIPoeur1cp+SBHyJCvGYg1py0jV+LJfUrGtP u3Iz3RXHSkZRH09N6d1shZVNYzEKoM/F3CFOwf2T+kMZMI7rY5/VT5W2u4kcdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN8Zv54tYzNfj; Tue, 8 Oct 2024 08:39:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4988dZ8o004752; Tue, 8 Oct 2024 08:39:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4988dZxt004749; Tue, 8 Oct 2024 08:39:35 GMT (envelope-from git) Date: Tue, 8 Oct 2024 08:39:35 GMT Message-Id: <202410080839.4988dZxt004749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric <dim@FreeBSD.org> Subject: git: 789f0f34e4ca - stable/14 - Merge commit b84d773fd004 from llvm git (by Fangrui Song): List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 789f0f34e4caa813168bfceeb6cdc5f147953be2 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=789f0f34e4caa813168bfceeb6cdc5f147953be2 commit 789f0f34e4caa813168bfceeb6cdc5f147953be2 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-22 17:08:47 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-08 08:37:14 +0000 Merge commit b84d773fd004 from llvm git (by Fangrui Song): [Parallel] Revert sequential task changes https://reviews.llvm.org/D148728 introduced `bool Sequential` to unify `execute` and the old `spawn` without argument. However, sequential tasks might be executed by any worker thread (non-deterministic), leading to non-determinism output for ld.lld -z nocombreloc (see https://reviews.llvm.org/D133003). In addition, the extra member variables have overhead. This sequential task has only been used for lld parallel relocation scanning. This patch restores the behavior before https://reviews.llvm.org/D148728 . Fix #105958 Pull Request: https://github.com/llvm/llvm-project/pull/109084 This fixes the non-reproducibility we had noticed when linking our EFI loaders, and for which we committed a workaround in f5ce3f4ef562. MFC after: 3 days (cherry picked from commit 54521a2ff93ae06c95c31f79f89dc23c9b51c20b) --- contrib/llvm-project/lld/ELF/Relocations.cpp | 56 ++++++++++++++-------- .../llvm/include/llvm/Support/Parallel.h | 4 +- contrib/llvm-project/llvm/lib/Support/Parallel.cpp | 49 +++++-------------- 3 files changed, 48 insertions(+), 61 deletions(-) diff --git a/contrib/llvm-project/lld/ELF/Relocations.cpp b/contrib/llvm-project/lld/ELF/Relocations.cpp index 92a1b9baaca3..8cb01b63d2cc 100644 --- a/contrib/llvm-project/lld/ELF/Relocations.cpp +++ b/contrib/llvm-project/lld/ELF/Relocations.cpp @@ -1584,30 +1584,44 @@ template <class ELFT> void elf::scanRelocations() { bool serial = !config->zCombreloc || config->emachine == EM_MIPS || config->emachine == EM_PPC64; parallel::TaskGroup tg; - for (ELFFileBase *f : ctx.objectFiles) { - auto fn = [f]() { + auto outerFn = [&]() { + for (ELFFileBase *f : ctx.objectFiles) { + auto fn = [f]() { + RelocationScanner scanner; + for (InputSectionBase *s : f->getSections()) { + if (s && s->kind() == SectionBase::Regular && s->isLive() && + (s->flags & SHF_ALLOC) && + !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) + scanner.template scanSection<ELFT>(*s); + } + }; + if (serial) + fn(); + else + tg.spawn(fn); + } + auto scanEH = [] { RelocationScanner scanner; - for (InputSectionBase *s : f->getSections()) { - if (s && s->kind() == SectionBase::Regular && s->isLive() && - (s->flags & SHF_ALLOC) && - !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) - scanner.template scanSection<ELFT>(*s); + for (Partition &part : partitions) { + for (EhInputSection *sec : part.ehFrame->sections) + scanner.template scanSection<ELFT>(*sec); + if (part.armExidx && part.armExidx->isLive()) + for (InputSection *sec : part.armExidx->exidxSections) + if (sec->isLive()) + scanner.template scanSection<ELFT>(*sec); } }; - tg.spawn(fn, serial); - } - - tg.spawn([] { - RelocationScanner scanner; - for (Partition &part : partitions) { - for (EhInputSection *sec : part.ehFrame->sections) - scanner.template scanSection<ELFT>(*sec); - if (part.armExidx && part.armExidx->isLive()) - for (InputSection *sec : part.armExidx->exidxSections) - if (sec->isLive()) - scanner.template scanSection<ELFT>(*sec); - } - }); + if (serial) + scanEH(); + else + tg.spawn(scanEH); + }; + // If `serial` is true, call `spawn` to ensure that `scanner` runs in a thread + // with valid getThreadIndex(). + if (serial) + tg.spawn(outerFn); + else + outerFn(); } static bool handleNonPreemptibleIfunc(Symbol &sym, uint16_t flags) { diff --git a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h index 8170da98f15a..c34619ab7d96 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h @@ -97,9 +97,7 @@ public: // Spawn a task, but does not wait for it to finish. // Tasks marked with \p Sequential will be executed // exactly in the order which they were spawned. - // Note: Sequential tasks may be executed on different - // threads, but strictly in sequential order. - void spawn(std::function<void()> f, bool Sequential = false); + void spawn(std::function<void()> f); void sync() const { L.sync(); } diff --git a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp index 9b14b05b5211..26da702969b7 100644 --- a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp +++ b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp @@ -12,7 +12,6 @@ #include "llvm/Support/Threading.h" #include <atomic> -#include <deque> #include <future> #include <thread> #include <vector> @@ -39,7 +38,7 @@ namespace { class Executor { public: virtual ~Executor() = default; - virtual void add(std::function<void()> func, bool Sequential = false) = 0; + virtual void add(std::function<void()> func) = 0; virtual size_t getThreadCount() const = 0; static Executor *getDefaultExecutor(); @@ -98,13 +97,10 @@ public: static void call(void *Ptr) { ((ThreadPoolExecutor *)Ptr)->stop(); } }; - void add(std::function<void()> F, bool Sequential = false) override { + void add(std::function<void()> F) override { { std::lock_guard<std::mutex> Lock(Mutex); - if (Sequential) - WorkQueueSequential.emplace_front(std::move(F)); - else - WorkQueue.emplace_back(std::move(F)); + WorkStack.push_back(std::move(F)); } Cond.notify_one(); } @@ -112,42 +108,23 @@ public: size_t getThreadCount() const override { return ThreadCount; } private: - bool hasSequentialTasks() const { - return !WorkQueueSequential.empty() && !SequentialQueueIsLocked; - } - - bool hasGeneralTasks() const { return !WorkQueue.empty(); } - void work(ThreadPoolStrategy S, unsigned ThreadID) { threadIndex = ThreadID; S.apply_thread_strategy(ThreadID); while (true) { std::unique_lock<std::mutex> Lock(Mutex); - Cond.wait(Lock, [&] { - return Stop || hasGeneralTasks() || hasSequentialTasks(); - }); + Cond.wait(Lock, [&] { return Stop || !WorkStack.empty(); }); if (Stop) break; - bool Sequential = hasSequentialTasks(); - if (Sequential) - SequentialQueueIsLocked = true; - else - assert(hasGeneralTasks()); - - auto &Queue = Sequential ? WorkQueueSequential : WorkQueue; - auto Task = std::move(Queue.back()); - Queue.pop_back(); + auto Task = std::move(WorkStack.back()); + WorkStack.pop_back(); Lock.unlock(); Task(); - if (Sequential) - SequentialQueueIsLocked = false; } } std::atomic<bool> Stop{false}; - std::atomic<bool> SequentialQueueIsLocked{false}; - std::deque<std::function<void()>> WorkQueue; - std::deque<std::function<void()>> WorkQueueSequential; + std::vector<std::function<void()>> WorkStack; std::mutex Mutex; std::condition_variable Cond; std::promise<void> ThreadsCreated; @@ -205,16 +182,14 @@ TaskGroup::~TaskGroup() { L.sync(); } -void TaskGroup::spawn(std::function<void()> F, bool Sequential) { +void TaskGroup::spawn(std::function<void()> F) { #if LLVM_ENABLE_THREADS if (Parallel) { L.inc(); - detail::Executor::getDefaultExecutor()->add( - [&, F = std::move(F)] { - F(); - L.dec(); - }, - Sequential); + detail::Executor::getDefaultExecutor()->add([&, F = std::move(F)] { + F(); + L.dec(); + }); return; } #endif From nobody Tue Oct 8 08:39:36 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN8Zw6zbtz5Z9K6; Tue, 08 Oct 2024 08:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN8Zw6K2cz4Ffx; Tue, 8 Oct 2024 08:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728376776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkJv0g3e2lGo7PxnO1ERbxERyP2jpKn22JDdDgrckzM=; b=Og18qgrc9FfqUTiLOUOP0S+KF6GVbAAzBcSFkXknSSf1IPeac/HmUTg0wpJYT9TBSwuZxm f1Z/8I/ZrYk6yL6Y/mn2LmhwUVcu7eSeT5/DNJjLA1JZtvJpL3Y3EKZlCjRlcsbXy56Rgy nzUFLBG4UzTHhHeR/5yd1HmEL958+vqQbKO3cchTxWN+W41VH+VaGMsGnwxK3P+ecegkuT gqywPO0z8Yxev4/Q1uAEf8joghNrK62b7a/RkylRRukZBIupsVVHWxUVpM4p9wuA2cjc4L EhOQdCJRNe1Hg6bnq/57nfc3dw9oY8d+DbOYdbNLWbOO+08EC0u+o+28wPgSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728376776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gkJv0g3e2lGo7PxnO1ERbxERyP2jpKn22JDdDgrckzM=; b=yNGDZjHTgLOWuLJcNnoKhiut9CgBiErRpnAJPAA3mPRv407yEyoIZ12ZTJ3EUGa9p6k/qu PpE6aejJa/1tJYmpCVy5RroPhg2hdLCGhmKR2dfIqsCLKCEpVI3enM19dDnONGQfZGz/DH O/d9davckB5wBr8zfK4WZXCTErZOMPXv6JXWFKXTUqpguHkNTqJxyitz8Ho8mTi7nJyWpC GwtV274t8MrLvZC5WTrB9HfVbQwrixJNYxhM3gtRG9Rep2brIsfY99DOIS8WIE7/4CS4JP qN0QqlqHCTq1GEwTa5NMr+LR15tOGOT/saSV2rsTw5oCD3Wkbi9D9NRGkMx+rA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728376776; a=rsa-sha256; cv=none; b=QWLV1ex8MY3MnbID5saYZMJGWwPpI7+fQaVQtzacRvSOzOC5GKDDwrrQ8vuQbUUeS3PL9g qxpcADNgT1/AT0jyfAjTtpeUD1nk4u96r9BmSUu+iHUGLyD3gx/Oo6k3en4ABR5TV7VJ+1 AakHeq1tVzEvgjKaKsyBxNhnHVMWTxG2WvakPz1AE+NvJ5zr8I1sLo3yLvCkUP1KNijrhD Subse5wZ5y72RIOKFDKNda8u8JXKoeTM5Mswl49+P5fPBkIHLdIjnlszn1FNArSfoeCg3B s52R2uY3VJT2hoLji1+dFYgmm8ZbPCVlW5o2zi6SVx5rTnhm6p7fGr5QwB1ooQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN8Zw5l7rzNr3; Tue, 8 Oct 2024 08:39:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4988dacB004797; Tue, 8 Oct 2024 08:39:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4988da0D004794; Tue, 8 Oct 2024 08:39:36 GMT (envelope-from git) Date: Tue, 8 Oct 2024 08:39:36 GMT Message-Id: <202410080839.4988da0D004794@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric <dim@FreeBSD.org> Subject: git: 342240c6e025 - stable/14 - Bump lld LINKER_FREEBSD_VERSION for reproducibility fix List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 342240c6e0257e798efc12c7e6aa9cdc6b22c9e1 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=342240c6e0257e798efc12c7e6aa9cdc6b22c9e1 commit 342240c6e0257e798efc12c7e6aa9cdc6b22c9e1 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-22 17:12:01 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-08 08:37:14 +0000 Bump lld LINKER_FREEBSD_VERSION for reproducibility fix The upstream fix to make lld output for our EFI loaders reproducible again was committed in 54521a2ff93a. Bump lld's LINKER_FREEBSD_VERSION to be able to check this in the EFI loader Makefile. MFC after: 3 days (cherry picked from commit f97c7fdc59d252cc8611968ffac541d4b8342b8b) --- lib/clang/include/lld/Common/Version.inc | 2 +- stand/efi/loader/Makefile | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 20f5fbe6e124..2e9f3e4e6330 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style -#define LLD_FREEBSD_VERSION 1400006 +#define LLD_FREEBSD_VERSION 1400007 #define LLD_VERSION_STRING "18.1.6 (FreeBSD llvmorg-18.1.6-0-g1118c2e05e67-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 02563681c3e8..d2b872e0ca99 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -106,10 +106,17 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie LDFLAGS+= -Wl,--no-dynamic-linker .endif +.include <bsd.linker.mk> + +.if ${LINKER_TYPE} == "lld" && \ + (${LINKER_FREEBSD_VERSION} < 1400007 || \ + (${LINKER_FREEBSD_VERSION} >= 1500000 && \ + ${LINKER_FREEBSD_VERSION} < 1500001)) # When lld is using multiple threads, which it does by default, it can # result in non-reproducible output with the custom linker script. Work # around this by disabling threading. -LDFLAGS.lld+= -Wl,--threads=1 +LDFLAGS+= -Wl,--threads=1 +.endif CLEANFILES+= ${LOADER}.efi From nobody Tue Oct 8 08:45:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN8jc6094z5Z9Qm; Tue, 08 Oct 2024 08:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN8jc4lMQz4GWk; Tue, 8 Oct 2024 08:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728377124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XITcKLtgo74SYZgyFcqtw7pR1RrFlTK8SXbjC1Y4Ir4=; b=kRVcOpX4F9z56Sh/ZK552Cb/mLei03gmGEfNM5roseaOy8Sp8pdqvy1hPSPCs14STx4MmN UWuiw2C+1GW0GAJxWd2qrFS2ec0ys0C2Eslk7nO9LIHwTO7i2iCMBxFgpR3cgJzZ5EfFs5 hDEAoqn/mm5/M7q1652UZ85pZwlIpIGQhV4dRTsx/+f2aZKNJYBKPrkjDhiTJYDyUSKd7h jAVyA63Y7wxmIT+vjcb/yxMPsRDfaLgz2pImv3tObZEiodjDquh0My+Rm2G4FgL+WumnUW pEpIhqqD0/jOgwKNbaaJVYADfCUmNRoHxy/WUCRVMHl29STIRv0R1PNdyf+mPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728377124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XITcKLtgo74SYZgyFcqtw7pR1RrFlTK8SXbjC1Y4Ir4=; b=evCgUopDnlBMMkkKJ+tH20ZejSU9OhRLPHIvzBmAqDpLM1lt+aXEC2Hta2gNa1MfzBGmMq g788sV9SFr0heGfvmcp1lunpi6o2GVXB1VmA0xxs/2FRc/xlEwJTDFTTjwT+fuSxFAtb5Z Y/B0a354quv6hDMeB3xLd7WFiRFRYHOlEfqvchjFrl9/Ysdgx0cTHqyIQnZSJnsTzT8GyW WgZ4ZCHrB9bfVTSFAhyM3ReZ7YPoGB2Y1MrpyBkfsbhsfksxmhP3wIIDF/gC4RCB2hYtdQ MhUcdzqWijF16dzV4FI5SbV4qzT/5MKIboJGoj3gr2tjZfFg8Hj6kysKscobfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728377124; a=rsa-sha256; cv=none; b=UVn0RXHUv0dC/PXYucSpv9K+MuIqb5KWtsXkFba9xwcslsiYkB43hBz1Fa8GjVel/SRPks //ePqUK2ur+Ujj482PoaKs+0fMN/uC2HDnXh1VJFlHmPc8D1KNfFLI4codU30VP6GSyCmj tLML+l+m57hbjTqgBrYruIp6lQWjM/rNSBEZ6geuJCQYKKmTaMAimVnw67LojI+T+R1ySp 1rAyEp8rv/910yeEVOkgK+GpdYLJ9hliX9D9xGM71yeyA7bwZ3GFFYCllv5AjtKlq3ulXp G6Q5adWHiBhXbM2jxmCN0X9q58HrWrFf72QJ4whygdotY4EFCCh8QfiiP2X7Kw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN8jc43vqzNyf; Tue, 8 Oct 2024 08:45:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4988jOsa021610; Tue, 8 Oct 2024 08:45:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4988jOtN021607; Tue, 8 Oct 2024 08:45:24 GMT (envelope-from git) Date: Tue, 8 Oct 2024 08:45:24 GMT Message-Id: <202410080845.4988jOtN021607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric <dim@FreeBSD.org> Subject: git: a492ec843f84 - stable/13 - Merge commit b84d773fd004 from llvm git (by Fangrui Song): List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a492ec843f84caef3668b9467dbcf718eba5063b Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=a492ec843f84caef3668b9467dbcf718eba5063b commit a492ec843f84caef3668b9467dbcf718eba5063b Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-22 17:08:47 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-08 08:37:09 +0000 Merge commit b84d773fd004 from llvm git (by Fangrui Song): [Parallel] Revert sequential task changes https://reviews.llvm.org/D148728 introduced `bool Sequential` to unify `execute` and the old `spawn` without argument. However, sequential tasks might be executed by any worker thread (non-deterministic), leading to non-determinism output for ld.lld -z nocombreloc (see https://reviews.llvm.org/D133003). In addition, the extra member variables have overhead. This sequential task has only been used for lld parallel relocation scanning. This patch restores the behavior before https://reviews.llvm.org/D148728 . Fix #105958 Pull Request: https://github.com/llvm/llvm-project/pull/109084 This fixes the non-reproducibility we had noticed when linking our EFI loaders, and for which we committed a workaround in f5ce3f4ef562. MFC after: 3 days (cherry picked from commit 54521a2ff93ae06c95c31f79f89dc23c9b51c20b) --- contrib/llvm-project/lld/ELF/Relocations.cpp | 56 ++++++++++++++-------- .../llvm/include/llvm/Support/Parallel.h | 4 +- contrib/llvm-project/llvm/lib/Support/Parallel.cpp | 49 +++++-------------- 3 files changed, 48 insertions(+), 61 deletions(-) diff --git a/contrib/llvm-project/lld/ELF/Relocations.cpp b/contrib/llvm-project/lld/ELF/Relocations.cpp index 92a1b9baaca3..8cb01b63d2cc 100644 --- a/contrib/llvm-project/lld/ELF/Relocations.cpp +++ b/contrib/llvm-project/lld/ELF/Relocations.cpp @@ -1584,30 +1584,44 @@ template <class ELFT> void elf::scanRelocations() { bool serial = !config->zCombreloc || config->emachine == EM_MIPS || config->emachine == EM_PPC64; parallel::TaskGroup tg; - for (ELFFileBase *f : ctx.objectFiles) { - auto fn = [f]() { + auto outerFn = [&]() { + for (ELFFileBase *f : ctx.objectFiles) { + auto fn = [f]() { + RelocationScanner scanner; + for (InputSectionBase *s : f->getSections()) { + if (s && s->kind() == SectionBase::Regular && s->isLive() && + (s->flags & SHF_ALLOC) && + !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) + scanner.template scanSection<ELFT>(*s); + } + }; + if (serial) + fn(); + else + tg.spawn(fn); + } + auto scanEH = [] { RelocationScanner scanner; - for (InputSectionBase *s : f->getSections()) { - if (s && s->kind() == SectionBase::Regular && s->isLive() && - (s->flags & SHF_ALLOC) && - !(s->type == SHT_ARM_EXIDX && config->emachine == EM_ARM)) - scanner.template scanSection<ELFT>(*s); + for (Partition &part : partitions) { + for (EhInputSection *sec : part.ehFrame->sections) + scanner.template scanSection<ELFT>(*sec); + if (part.armExidx && part.armExidx->isLive()) + for (InputSection *sec : part.armExidx->exidxSections) + if (sec->isLive()) + scanner.template scanSection<ELFT>(*sec); } }; - tg.spawn(fn, serial); - } - - tg.spawn([] { - RelocationScanner scanner; - for (Partition &part : partitions) { - for (EhInputSection *sec : part.ehFrame->sections) - scanner.template scanSection<ELFT>(*sec); - if (part.armExidx && part.armExidx->isLive()) - for (InputSection *sec : part.armExidx->exidxSections) - if (sec->isLive()) - scanner.template scanSection<ELFT>(*sec); - } - }); + if (serial) + scanEH(); + else + tg.spawn(scanEH); + }; + // If `serial` is true, call `spawn` to ensure that `scanner` runs in a thread + // with valid getThreadIndex(). + if (serial) + tg.spawn(outerFn); + else + outerFn(); } static bool handleNonPreemptibleIfunc(Symbol &sym, uint16_t flags) { diff --git a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h index 8170da98f15a..c34619ab7d96 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/Parallel.h @@ -97,9 +97,7 @@ public: // Spawn a task, but does not wait for it to finish. // Tasks marked with \p Sequential will be executed // exactly in the order which they were spawned. - // Note: Sequential tasks may be executed on different - // threads, but strictly in sequential order. - void spawn(std::function<void()> f, bool Sequential = false); + void spawn(std::function<void()> f); void sync() const { L.sync(); } diff --git a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp index 9b14b05b5211..26da702969b7 100644 --- a/contrib/llvm-project/llvm/lib/Support/Parallel.cpp +++ b/contrib/llvm-project/llvm/lib/Support/Parallel.cpp @@ -12,7 +12,6 @@ #include "llvm/Support/Threading.h" #include <atomic> -#include <deque> #include <future> #include <thread> #include <vector> @@ -39,7 +38,7 @@ namespace { class Executor { public: virtual ~Executor() = default; - virtual void add(std::function<void()> func, bool Sequential = false) = 0; + virtual void add(std::function<void()> func) = 0; virtual size_t getThreadCount() const = 0; static Executor *getDefaultExecutor(); @@ -98,13 +97,10 @@ public: static void call(void *Ptr) { ((ThreadPoolExecutor *)Ptr)->stop(); } }; - void add(std::function<void()> F, bool Sequential = false) override { + void add(std::function<void()> F) override { { std::lock_guard<std::mutex> Lock(Mutex); - if (Sequential) - WorkQueueSequential.emplace_front(std::move(F)); - else - WorkQueue.emplace_back(std::move(F)); + WorkStack.push_back(std::move(F)); } Cond.notify_one(); } @@ -112,42 +108,23 @@ public: size_t getThreadCount() const override { return ThreadCount; } private: - bool hasSequentialTasks() const { - return !WorkQueueSequential.empty() && !SequentialQueueIsLocked; - } - - bool hasGeneralTasks() const { return !WorkQueue.empty(); } - void work(ThreadPoolStrategy S, unsigned ThreadID) { threadIndex = ThreadID; S.apply_thread_strategy(ThreadID); while (true) { std::unique_lock<std::mutex> Lock(Mutex); - Cond.wait(Lock, [&] { - return Stop || hasGeneralTasks() || hasSequentialTasks(); - }); + Cond.wait(Lock, [&] { return Stop || !WorkStack.empty(); }); if (Stop) break; - bool Sequential = hasSequentialTasks(); - if (Sequential) - SequentialQueueIsLocked = true; - else - assert(hasGeneralTasks()); - - auto &Queue = Sequential ? WorkQueueSequential : WorkQueue; - auto Task = std::move(Queue.back()); - Queue.pop_back(); + auto Task = std::move(WorkStack.back()); + WorkStack.pop_back(); Lock.unlock(); Task(); - if (Sequential) - SequentialQueueIsLocked = false; } } std::atomic<bool> Stop{false}; - std::atomic<bool> SequentialQueueIsLocked{false}; - std::deque<std::function<void()>> WorkQueue; - std::deque<std::function<void()>> WorkQueueSequential; + std::vector<std::function<void()>> WorkStack; std::mutex Mutex; std::condition_variable Cond; std::promise<void> ThreadsCreated; @@ -205,16 +182,14 @@ TaskGroup::~TaskGroup() { L.sync(); } -void TaskGroup::spawn(std::function<void()> F, bool Sequential) { +void TaskGroup::spawn(std::function<void()> F) { #if LLVM_ENABLE_THREADS if (Parallel) { L.inc(); - detail::Executor::getDefaultExecutor()->add( - [&, F = std::move(F)] { - F(); - L.dec(); - }, - Sequential); + detail::Executor::getDefaultExecutor()->add([&, F = std::move(F)] { + F(); + L.dec(); + }); return; } #endif From nobody Tue Oct 8 08:45:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN8jd71DQz5Z9Qn; Tue, 08 Oct 2024 08:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN8jd5jtVz4GWl; Tue, 8 Oct 2024 08:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728377125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32lgEsox5mQo1nAyWW7iIRz9DkOw8PQF7Iqy4TzMb5A=; b=hgbf+3bGoo2s906Q9UDtKQ5NpYhgEy3IXx7Q4nPcp0INtzRYCeyTHvO9SCOl6UujHARAGN s5GMoN6r/pvGZCS/CBgtMHPHlfp2s7XqwiZmAbbjqZAUyCkgEbstRplJbyRgJ/JNaX0Db/ lOrHSZXFAfNLWbmOe9krrRkQiDSwzhK5SUqaUwH05Yz3UuUQbXrFJTxrRfMvqPzL8lmCDw yJ5i5xyQ13DkucxU+8sAfM3iM6oD1i1zQMFKvOe6sedqsRo2Kaqj/jPtNn8ZwWlkiwBIdH 6faVkyiIZ2ZgNPfRZjVGoVW6h2NW3uDLBq4FFUBe5DbbbRdxOesdqQM3ojcZOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728377125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=32lgEsox5mQo1nAyWW7iIRz9DkOw8PQF7Iqy4TzMb5A=; b=uUYB+E2swvwfU5sOPrQipvsb05ola3ciV49vo4TI68BvxaVuSi/PcdF5mBJj8Z/5zsEUZJ KVt7sfILUCzrloi/Q2coKmtijeer2xhHrxTYVauuaTYu/o0thXAcsK0pryvh2zyPQF5mh9 dbP/EKX3+tkDDW2vbMDtNF+OZxxTSiuOsj2bujaZBtI9YgxDjgh6E8Uhdl6wWRXOF7+aL7 sF3ZuAytPLxKE5plcf+r9c+e6nzZyYHab4zaKFj3T4YmJA3qmzO6Nv95ZvkdvBDnYWBoLT 2V4QId/zln8ZB0vZQeeAjDzw6sLvPs6hVfkpxEdcpsWcg/Zc6CU3oOXS+lnp1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728377125; a=rsa-sha256; cv=none; b=ePaOlm6LNMFAD1pZAhMbii/NkpIgneEJpTnQdnDcmeW6Wpa0QjZ1D4WYBIpDwMOlDiim7I IQyH0p7rW7OKHSo8qObUcxNNbzH3uOZycnMAyuy1Q5OBdH4qV5ECpkc6Kx017Fd7KhshRM ZN+li23Gvq5Ufc9Xb4aFCrkJOQ+fa45ASsDQuT3Vpnm0pT6D8OoEGJwYDmfAMPmyeLCXJ1 +sPIB3PCdNLH6obkYp8g6JE3+5zvmILSiz5TMsN1Iu0CqDWO8qPw6hdKx0/0JafFMAnovB dJcwsE1VrvQE6+1Nec0LTmNuMw6oeKN0kdjmu3SN+NXuclkHjY/l7QvuAMvEvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XN8jd52cCzP1L; Tue, 8 Oct 2024 08:45:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4988jPDT021655; Tue, 8 Oct 2024 08:45:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4988jPrt021652; Tue, 8 Oct 2024 08:45:25 GMT (envelope-from git) Date: Tue, 8 Oct 2024 08:45:25 GMT Message-Id: <202410080845.4988jPrt021652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric <dim@FreeBSD.org> Subject: git: 04393db00313 - stable/13 - Bump lld LINKER_FREEBSD_VERSION for reproducibility fix List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04393db0031382a3b2d7de037e862b33e3ea4bbe Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=04393db0031382a3b2d7de037e862b33e3ea4bbe commit 04393db0031382a3b2d7de037e862b33e3ea4bbe Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2024-09-22 17:12:01 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2024-10-08 08:37:09 +0000 Bump lld LINKER_FREEBSD_VERSION for reproducibility fix The upstream fix to make lld output for our EFI loaders reproducible again was committed in 54521a2ff93a. Bump lld's LINKER_FREEBSD_VERSION to be able to check this in the EFI loader Makefile. MFC after: 3 days (cherry picked from commit f97c7fdc59d252cc8611968ffac541d4b8342b8b) --- lib/clang/include/lld/Common/Version.inc | 2 +- stand/efi/loader/Makefile | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/clang/include/lld/Common/Version.inc b/lib/clang/include/lld/Common/Version.inc index 20f5fbe6e124..2e9f3e4e6330 100644 --- a/lib/clang/include/lld/Common/Version.inc +++ b/lib/clang/include/lld/Common/Version.inc @@ -1,4 +1,4 @@ // Local identifier in __FreeBSD_version style -#define LLD_FREEBSD_VERSION 1400006 +#define LLD_FREEBSD_VERSION 1400007 #define LLD_VERSION_STRING "18.1.6 (FreeBSD llvmorg-18.1.6-0-g1118c2e05e67-" __XSTRING(LLD_FREEBSD_VERSION) ")" diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index c5503da655f9..a2cb643dd4c4 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -105,10 +105,17 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie LDFLAGS+= -Wl,--no-dynamic-linker .endif +.include <bsd.linker.mk> + +.if ${LINKER_TYPE} == "lld" && \ + (${LINKER_FREEBSD_VERSION} < 1400007 || \ + (${LINKER_FREEBSD_VERSION} >= 1500000 && \ + ${LINKER_FREEBSD_VERSION} < 1500001)) # When lld is using multiple threads, which it does by default, it can # result in non-reproducible output with the custom linker script. Work # around this by disabling threading. -LDFLAGS.lld+= -Wl,--threads=1 +LDFLAGS+= -Wl,--threads=1 +.endif CLEANFILES+= ${LOADER}.efi From nobody Tue Oct 8 10:09:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNBZQ6SV3z5ZFMd; Tue, 08 Oct 2024 10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNBZQ68lSz4MRt; Tue, 8 Oct 2024 10: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=1728382158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/23Q5s1Bt39dk9H+ozt6Ij4Jo84AQ43KSkxmq7csmO8=; b=xfdUFkWo+yq6BltOIWh//mUS+EwSA3GDbSPOVHXhIjXyQ5XB9A4SjtC9v0eeu2xcR5bJZB EARU5lUv75E7FgF25CzPouV7hd/i5ZyjTk36PkWcMR4ecQC7WnD2SUqHhfNFv5G4Rar5Y3 DjTJ8HPUuG/Z+VdAUqJselXGX+iu9/EwADmhlPt9fRjRGVm12n3XGA3Erh/5lNZMKPQGZz lDoc0PJSvv9TUN2RjPMgeeJDrNwtGaj8pWFeCJK4p4yqB2kAI75MQWX7lrgwacaIgmMP7J VwzteXNb2W2PwnfXZtUvFrGgaAEawnv16hWvI59rLqOtHnJBiOKDIclMZFU0+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/23Q5s1Bt39dk9H+ozt6Ij4Jo84AQ43KSkxmq7csmO8=; b=pS1Mnfbl8OLD3Rj0SG9F9+alkGX5njQnOptYs+8CODRAs5hRx6i1vWw8QjV5Py+2qwSYc+ HRHf1/k9RKNMoTUp9r0UI0Q6D4Pzaoqpc6XQX6NYYY8xmc5JKBCIBEm1nEsE19tCELUcuA LbJDb2K01e064mQxZyMyBsYdvuLI9Ggz9NJLmsqFEbmobwjbzr1Pxu58ppWp9nc2zB42cC CraENVitV5Lw3Bl4tg+imwi5Upum9hd/5Z+x2+Bl3XbPQbXQHYTzJRT7qqgsPyiB20EWUr VoazBdFHKFfULbqiHtCvihGP39ZhNPDMefNsrQTsDKG2wZgGGm+IOH24zEolKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728382158; a=rsa-sha256; cv=none; b=TkB1HyOMv7vRmtKNT36JZm9D1WJ3rBR5rBdtaetuPxeevPBQLdSs8rncYODouIqzBU5FZA Q602TblpbnkQCMw59ocJxp0KBmLImGyg3MIH8gr/5ZsXPbtN/B7Xh2gP2ycfma1pA1+YuM QNYGp3IXt8etks5W+3di1Kf3+fJ8xtDnjqi5LseYDip+nU/A/k8IaYknIojWJ40GQUXZb3 GJ40rBVH7EUQ05xbxVkRrm+nPXZmGZdKSp9P7Fis+frRtwq2+U/EWQrvNXKayRU7I7y62v 6LU1+BaIbik7VLqx9pTkVWoiDEwFDmFY4KO08o7JBjgGvcWiDEiQlFjvuoc9MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNBZQ5dzPzQhY; Tue, 8 Oct 2024 10:09:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 498A9Iwx059033; Tue, 8 Oct 2024 10:09:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498A9IaQ059028; Tue, 8 Oct 2024 10:09:18 GMT (envelope-from git) Date: Tue, 8 Oct 2024 10:09:18 GMT Message-Id: <202410081009.498A9IaQ059028@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: f500e5c6c99b - stable/13 - net: Remove unneeded NULL check for the allocated ifnet List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f500e5c6c99bd4520daa4524113462e3cf68f032 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f500e5c6c99bd4520daa4524113462e3cf68f032 commit f500e5c6c99bd4520daa4524113462e3cf68f032 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-06-28 10:16:29 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 10:07:18 +0000 net: Remove unneeded NULL check for the allocated ifnet Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740 MFC note: This is only a partial MFC, as some drivers do not exist in stable/13 branch. The if_epair(4) drifts too much from stable/14 so not included in this MFC. (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc) (cherry picked from commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3) --- sys/arm/allwinner/if_emac.c | 5 ----- sys/arm/ti/cpsw/if_cpsw.c | 5 ----- sys/dev/ae/if_ae.c | 6 ------ sys/dev/age/if_age.c | 6 ------ sys/dev/alc/if_alc.c | 6 ------ sys/dev/ale/if_ale.c | 6 ------ sys/dev/altera/atse/if_atse.c | 5 ----- sys/dev/axgbe/if_axgbe.c | 5 ----- sys/dev/bce/if_bce.c | 6 ------ sys/dev/bfe/if_bfe.c | 5 ----- sys/dev/bge/if_bge.c | 5 ----- sys/dev/bxe/bxe.c | 16 +++------------- sys/dev/cadence/if_cgem.c | 5 ----- sys/dev/cas/if_cas.c | 2 -- sys/dev/cxgb/cxgb_main.c | 5 ----- sys/dev/cxgbe/t4_main.c | 21 +++++---------------- sys/dev/cxgbe/t4_tracer.c | 6 ------ sys/dev/dc/if_dc.c | 5 ----- sys/dev/dpaa/if_dtsec.c | 6 ------ sys/dev/dpaa2/dpaa2_ni.c | 5 ----- sys/dev/ena/ena.c | 17 +++-------------- sys/dev/et/if_et.c | 5 ----- sys/dev/etherswitch/arswitch/arswitch.c | 6 ------ sys/dev/etherswitch/e6000sw/e6000sw.c | 2 -- sys/dev/etherswitch/e6000sw/e6060sw.c | 6 ------ sys/dev/etherswitch/infineon/adm6996fc.c | 6 ------ sys/dev/etherswitch/ip17x/ip17x.c | 6 ------ sys/dev/etherswitch/micrel/ksz8995ma.c | 6 ------ sys/dev/etherswitch/mtkswitch/mtkswitch.c | 6 ------ sys/dev/etherswitch/rtl8366/rtl8366rb.c | 6 ------ sys/dev/etherswitch/ukswitch/ukswitch.c | 6 ------ sys/dev/firewire/if_fwe.c | 7 +------ sys/dev/firewire/if_fwip.c | 4 +--- sys/dev/fxp/if_fxp.c | 5 ----- sys/dev/gem/if_gem.c | 2 -- sys/dev/gve/gve_main.c | 13 ++----------- sys/dev/iicbus/if_ic.c | 2 -- sys/dev/jme/if_jme.c | 6 ------ sys/dev/le/lance.c | 2 -- sys/dev/lge/if_lge.c | 5 ----- sys/dev/liquidio/lio_main.c | 5 ----- sys/dev/mge/if_mge.c | 6 ------ sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 5 ----- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 6 ------ sys/dev/msk/if_msk.c | 5 ----- sys/dev/mxge/if_mxge.c | 6 ------ sys/dev/my/if_my.c | 6 ------ sys/dev/neta/if_mvneta.c | 5 ----- sys/dev/netmap/if_ptnet.c | 6 ------ sys/dev/netmap/netmap_freebsd.c | 4 ---- sys/dev/nfe/if_nfe.c | 5 ----- sys/dev/nge/if_nge.c | 5 ----- sys/dev/ntb/if_ntb/if_ntb.c | 4 ---- sys/dev/oce/oce_if.c | 13 +++---------- sys/dev/ppbus/if_plip.c | 4 ---- sys/dev/qlnx/qlnxe/qlnx_os.c | 4 ---- sys/dev/qlxgb/qla_os.c | 3 --- sys/dev/qlxgbe/ql_os.c | 4 ---- sys/dev/qlxge/qls_os.c | 4 ---- sys/dev/re/if_re.c | 5 ----- sys/dev/rl/if_rl.c | 5 ----- sys/dev/sbni/if_sbni.c | 5 +---- sys/dev/sbni/if_sbni_isa.c | 7 +------ sys/dev/sbni/if_sbni_pci.c | 17 +++-------------- sys/dev/sbni/if_sbnivar.h | 2 +- sys/dev/sfxge/sfxge.c | 7 ------- sys/dev/sge/if_sge.c | 5 ----- sys/dev/sis/if_sis.c | 5 ----- sys/dev/sk/if_sk.c | 5 ----- sys/dev/smc/if_smc.c | 4 ---- sys/dev/ste/if_ste.c | 5 ----- sys/dev/stge/if_stge.c | 6 ------ sys/dev/sume/if_sume.c | 16 +++------------- sys/dev/ti/if_ti.c | 5 ----- sys/dev/tsec/if_tsec.c | 6 ------ sys/dev/usb/net/if_usie.c | 5 ----- sys/dev/usb/net/uhso.c | 4 ---- sys/dev/usb/net/usb_ethernet.c | 5 ----- sys/dev/usb/usb_pf.c | 6 ------ sys/dev/vge/if_vge.c | 6 ------ sys/dev/virtio/network/if_vtnet.c | 16 +++------------- sys/dev/vnic/nicvf_main.c | 17 +++-------------- sys/dev/vnic/thunder_mdio.c | 4 ---- sys/dev/vr/if_vr.c | 5 ----- sys/dev/vte/if_vte.c | 6 ------ sys/dev/xilinx/if_xae.c | 5 ----- sys/dev/xl/if_xl.c | 5 ----- sys/net/if_bridge.c | 4 ---- sys/net/if_disc.c | 5 ----- sys/net/if_edsc.c | 5 ----- sys/net/if_enc.c | 4 ---- sys/net/if_lagg.c | 4 ---- sys/net/if_loop.c | 3 --- sys/net/if_stf.c | 5 ----- sys/net/if_tuntap.c | 3 --- sys/net/if_vlan.c | 8 -------- sys/net/if_vxlan.c | 4 ---- sys/net/iflib.c | 4 ---- sys/net80211/ieee80211.c | 4 ---- sys/netgraph/ng_eiface.c | 5 ----- sys/netgraph/ng_iface.c | 4 ---- sys/netpfil/ipfw/ip_fw_bpf.c | 4 ---- sys/netpfil/pf/if_pflog.c | 3 --- sys/netpfil/pf/if_pfsync.c | 4 ---- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ---- 105 files changed, 33 insertions(+), 582 deletions(-) diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c index ce53e075c196..5752582c3fa2 100644 --- a/sys/arm/allwinner/if_emac.c +++ b/sys/arm/allwinner/if_emac.c @@ -942,11 +942,6 @@ emac_attach(device_t dev) emac_reset(sc); ifp = sc->emac_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "unable to allocate ifp\n"); - error = ENOSPC; - goto fail; - } ifp->if_softc = sc; /* Setup MII */ diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index 81c2e29e0f8c..9ab73cd62527 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -1029,11 +1029,6 @@ cpswp_attach(device_t dev) /* Allocate network interface */ ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - cpswp_detach(dev); - return (ENXIO); - } - if_initname(ifp, device_get_name(sc->dev), sc->unit); ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; diff --git a/sys/dev/ae/if_ae.c b/sys/dev/ae/if_ae.c index f8e83dc3c563..a85100daa8f1 100644 --- a/sys/dev/ae/if_ae.c +++ b/sys/dev/ae/if_ae.c @@ -328,12 +328,6 @@ ae_attach(device_t dev) goto fail; ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "could not allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index 7bb494d81de2..cd589dcb734d 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -593,12 +593,6 @@ age_attach(device_t dev) age_get_macaddr(sc); ifp = sc->age_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index c4e66fe8e1be..e6c0470d48c7 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -1565,12 +1565,6 @@ alc_attach(device_t dev) alc_get_macaddr(sc); ifp = sc->alc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index a04d9dc651d3..8b170c2f99a7 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -612,12 +612,6 @@ ale_attach(device_t dev) ale_get_macaddr(sc); ifp = sc->ale_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/altera/atse/if_atse.c b/sys/dev/altera/atse/if_atse.c index b13c1ca8c563..e7209780f838 100644 --- a/sys/dev/altera/atse/if_atse.c +++ b/sys/dev/altera/atse/if_atse.c @@ -1374,11 +1374,6 @@ atse_attach(device_t dev) /* Setup interface. */ ifp = sc->atse_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "if_alloc() failed\n"); - error = ENOSPC; - goto err; - } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/axgbe/if_axgbe.c b/sys/dev/axgbe/if_axgbe.c index 89d187801e3c..926f10826cfb 100644 --- a/sys/dev/axgbe/if_axgbe.c +++ b/sys/dev/axgbe/if_axgbe.c @@ -389,11 +389,6 @@ axgbe_attach(device_t dev) OF_getprop(node, "mac-address", sc->mac_addr, ETHER_ADDR_LEN); sc->prv.netdev = ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "Cannot alloc ifnet\n"); - return (ENXIO); - } - sc->prv.dev = dev; sc->prv.dmat = bus_get_dma_tag(dev); sc->prv.phy.advertising = ADVERTISED_10000baseKR_Full | diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 322ab8328080..721db7ff592b 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -1363,12 +1363,6 @@ bce_attach(device_t dev) /* Allocate an ifnet structure. */ ifp = sc->bce_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - BCE_PRINTF("%s(%d): Interface allocation failed!\n", - __FILE__, __LINE__); - rc = ENXIO; - goto bce_attach_fail; - } /* Initialize the ifnet interface. */ ifp->if_softc = sc; diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index 42dfcd26eabf..40aee47d2172 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -480,11 +480,6 @@ bfe_attach(device_t dev) /* Set up ifnet structure */ ifp = sc->bfe_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "failed to if_alloc()\n"); - error = ENOSPC; - goto fail; - } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 91b33492b2d2..f84a16b5fc85 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -3714,11 +3714,6 @@ bge_attach(device_t dev) /* Set up ifnet structure */ ifp = sc->bge_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(sc->bge_dev, "failed to if_alloc()\n"); - error = ENXIO; - goto fail; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index cfe642eafeb2..daed2ea9e5e4 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12989,7 +12989,7 @@ bxe_init(void *xsc) BXE_CORE_UNLOCK(sc); } -static int +static void bxe_init_ifnet(struct bxe_softc *sc) { if_t ifp; @@ -13009,10 +13009,7 @@ bxe_init_ifnet(struct bxe_softc *sc) BLOGI(sc, "IFMEDIA flags : %x\n", sc->ifmedia.ifm_media); /* allocate the ifnet structure */ - if ((ifp = if_gethandle(IFT_ETHER)) == NULL) { - BLOGE(sc, "Interface allocation failed!\n"); - return (ENXIO); - } + ifp = if_gethandle(IFT_ETHER); if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); @@ -13058,8 +13055,6 @@ bxe_init_ifnet(struct bxe_softc *sc) /* Attach driver debugnet methods. */ DEBUGNET_SET(ifp, bxe); - - return (0); } static void @@ -16285,12 +16280,7 @@ bxe_attach(device_t dev) bxe_get_phy_info(sc); /* initialize the FreeBSD ifnet interface */ - if (bxe_init_ifnet(sc) != 0) { - bxe_release_mutexes(sc); - bxe_deallocate_bars(sc); - pci_disable_busmaster(dev); - return (ENXIO); - } + bxe_init_ifnet(sc); if (bxe_add_cdev(sc) != 0) { if (sc->ifp != NULL) { diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c index b6a06618ed1d..66433e0f089e 100644 --- a/sys/dev/cadence/if_cgem.c +++ b/sys/dev/cadence/if_cgem.c @@ -1786,11 +1786,6 @@ cgem_attach(device_t dev) /* Set up ifnet structure. */ ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "could not allocate ifnet structure\n"); - cgem_detach(dev); - return (ENOMEM); - } if_setsoftc(ifp, sc); if_initname(ifp, IF_CGEM_NAME, device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 8071635c20e0..c45438ec539a 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -190,8 +190,6 @@ cas_attach(struct cas_softc *sc) /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 8c817d751cdc..cf10effeb089 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1018,11 +1018,6 @@ cxgb_port_attach(device_t dev) /* Allocate an ifnet object and set it up */ ifp = p->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "Cannot allocate ifnet\n"); - return (ENOMEM); - } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_init = cxgb_init; ifp->if_softc = p; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 7f949ad8e66c..17969d45ff0c 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2551,7 +2551,7 @@ cxgbe_probe(device_t dev) IFCAP_HWRXTSTMP | IFCAP_MEXTPG) #define T4_CAP_ENABLE (T4_CAP) -static int +static void cxgbe_vi_attach(device_t dev, struct vi_info *vi) { struct ifnet *ifp; @@ -2590,10 +2590,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) /* Allocate an ifnet and set it up */ ifp = if_alloc_dev(IFT_ETHER, dev); - if (ifp == NULL) { - device_printf(dev, "Cannot allocate ifnet\n"); - return (ENOMEM); - } vi->ifp = ifp; ifp->if_softc = vi; @@ -2699,8 +2695,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) pa.pa_type = PFIL_TYPE_ETHERNET; pa.pa_headname = ifp->if_xname; vi->pfil = pfil_head_register(&pa); - - return (0); } static int @@ -2709,13 +2703,11 @@ cxgbe_attach(device_t dev) struct port_info *pi = device_get_softc(dev); struct adapter *sc = pi->adapter; struct vi_info *vi; - int i, rc; + int i; sysctl_ctx_init(&pi->ctx); - rc = cxgbe_vi_attach(dev, &pi->vi[0]); - if (rc) - return (rc); + cxgbe_vi_attach(dev, &pi->vi[0]); for_each_vi(pi, i, vi) { if (i == 0) @@ -3646,11 +3638,8 @@ vcxgbe_attach(device_t dev) if (rc) return (rc); - rc = cxgbe_vi_attach(dev, vi); - if (rc) { - t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid); - return (rc); - } + cxgbe_vi_attach(dev, vi); + return (0); } diff --git a/sys/dev/cxgbe/t4_tracer.c b/sys/dev/cxgbe/t4_tracer.c index adb6d89b6362..92d440d92612 100644 --- a/sys/dev/cxgbe/t4_tracer.c +++ b/sys/dev/cxgbe/t4_tracer.c @@ -173,12 +173,6 @@ t4_cloner_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) goto done; ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - ifc_free_unit(ifc, unit); - rc = ENOMEM; - goto done; - } - /* Note that if_xname is not <if_dname><if_dunit>. */ strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname)); ifp->if_dname = t4_cloner_name; diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index aa8d6790ab9b..7956baff7def 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2383,11 +2383,6 @@ dc_attach(device_t dev) goto fail; ifp = sc->dc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c index 68a321cbe2bf..7f80b00941aa 100644 --- a/sys/dev/dpaa/if_dtsec.c +++ b/sys/dev/dpaa/if_dtsec.c @@ -678,12 +678,6 @@ dtsec_attach(device_t dev) /* Create network interface for upper layers */ ifp = sc->sc_ifnet = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(sc->sc_dev, "if_alloc() failed.\n"); - dtsec_detach(dev); - return (ENOMEM); - } - ifp->if_softc = sc; ifp->if_mtu = ETHERMTU; /* TODO: Configure */ ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST; diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c index ed9e641f0793..7d6c70ff3b6b 100644 --- a/sys/dev/dpaa2/dpaa2_ni.c +++ b/sys/dev/dpaa2/dpaa2_ni.c @@ -573,11 +573,6 @@ dpaa2_ni_attach(device_t dev) /* Allocate network interface */ ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "%s: failed to allocate network interface\n", - __func__); - return (ENXIO); - } sc->ifp = ifp; if_initname(ifp, DPAA2_NI_IFNAME, device_get_unit(sc->dev)); diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index fd4bca93ad93..934970ea0cf7 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -148,7 +148,7 @@ static int ena_ioctl(if_t, u_long, caddr_t); static int ena_get_dev_offloads(struct ena_com_dev_get_features_ctx *); static void ena_update_host_info(struct ena_admin_host_info *, if_t); static void ena_update_hwassist(struct ena_adapter *); -static int ena_setup_ifnet(device_t, struct ena_adapter *, +static void ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); static int ena_enable_wc(device_t, struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, @@ -2462,7 +2462,7 @@ ena_update_hwassist(struct ena_adapter *adapter) if_sethwassistbits(ifp, flags, 0); } -static int +static void ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, struct ena_com_dev_get_features_ctx *feat) { @@ -2470,10 +2470,6 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, int caps = 0; ifp = adapter->ifp = if_gethandle(IFT_ETHER); - if (unlikely(ifp == NULL)) { - ena_log(pdev, ERR, "can not allocate ifnet structure\n"); - return (ENXIO); - } if_initname(ifp, device_get_name(pdev), device_get_unit(pdev)); if_setdev(ifp, pdev); if_setsoftc(ifp, adapter); @@ -2517,8 +2513,6 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); ether_ifattach(ifp, adapter->mac_addr); - - return (0); } void @@ -3812,11 +3806,7 @@ ena_attach(device_t pdev) ena_sysctl_add_nodes(adapter); /* setup network interface */ - rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); - if (unlikely(rc != 0)) { - ena_log(pdev, ERR, "Error with network interface setup\n"); - goto err_customer_metrics_alloc; - } + ena_setup_ifnet(pdev, adapter, &get_feat_ctx); /* Initialize reset task queue */ TASK_INIT(&adapter->reset_task, 0, ena_reset_task, adapter); @@ -3853,7 +3843,6 @@ ena_attach(device_t pdev) err_detach: ether_ifdetach(adapter->ifp); #endif /* DEV_NETMAP */ -err_customer_metrics_alloc: free(adapter->customer_metrics_array, M_DEVBUF); err_metrics_buffer_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); diff --git a/sys/dev/et/if_et.c b/sys/dev/et/if_et.c index bfb205c09e94..08c4ff915840 100644 --- a/sys/dev/et/if_et.c +++ b/sys/dev/et/if_et.c @@ -234,11 +234,6 @@ et_attach(device_t dev) callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } /* * Initialize tunables diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index f25f053e9b82..57f7e7908414 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -175,12 +175,6 @@ arswitch_attach_phys(struct arswitch_softc *sc) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); for (phy = 0; phy < sc->numphys; phy++) { sc->ifp[phy] = if_alloc(IFT_ETHER); - if (sc->ifp[phy] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[phy]->if_softc = sc; sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index d309f862a810..8e6049707463 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -365,8 +365,6 @@ e6000sw_init_interface(e6000sw_softc_t *sc, int port) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->dev)); sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) - return (ENOMEM); sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c index c464ebd8c0ce..209b64cbd6de 100644 --- a/sys/dev/etherswitch/e6000sw/e6060sw.c +++ b/sys/dev/etherswitch/e6000sw/e6060sw.c @@ -216,12 +216,6 @@ e6060sw_attach_phys(struct e6060sw_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index 9acc513a02b7..399ca853af1f 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -173,12 +173,6 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index cf118b0bc2cf..e22d785e6572 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -172,12 +172,6 @@ ip17x_attach_phys(struct ip17x_softc *sc) sc->phyport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index 737c3f7a50f3..a151a488e527 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -219,12 +219,6 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c index 292fc8e0ee3a..af774da4eba7 100644 --- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -121,12 +121,6 @@ mtkswitch_attach_phys(struct mtkswitch_softc *sc) continue; } sc->ifp[phy] = if_alloc(IFT_ETHER); - if (sc->ifp[phy] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[phy]->if_softc = sc; sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index 65682973621a..b8ab134ff828 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -238,12 +238,6 @@ rtl8366rb_attach(device_t dev) /* PHYs need an interface, so we generate a dummy one */ for (i = 0; i < sc->numphys; i++) { sc->ifp[i] = if_alloc(IFT_ETHER); - if (sc->ifp[i] == NULL) { - device_printf(dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[i]->if_softc = sc; sc->ifp[i]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c index ab22ac5f97e9..5e0f4c4f350c 100644 --- a/sys/dev/etherswitch/ukswitch/ukswitch.c +++ b/sys/dev/etherswitch/ukswitch/ukswitch.c @@ -124,12 +124,6 @@ ukswitch_attach_phys(struct ukswitch_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 22fdbe503001..7add1c38678c 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -178,12 +178,7 @@ fwe_attach(device_t dev) /* fill the rest and attach interface */ ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - return (ENOSPC); - } ifp->if_softc = &fwe->eth_softc; - if_initname(ifp, device_get_name(dev), unit); ifp->if_init = fwe_init; ifp->if_start = fwe_start; @@ -201,7 +196,7 @@ fwe_attach(device_t dev) ifp->if_capenable |= IFCAP_VLAN_MTU; FWEDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 89b34aab4257..df258a64d2b6 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -153,8 +153,6 @@ fwip_attach(device_t dev) fwip = ((struct fwip_softc *)device_get_softc(dev)); unit = device_get_unit(dev); ifp = fwip->fw_softc.fwip_ifp = if_alloc(IFT_IEEE1394); - if (ifp == NULL) - return (ENOSPC); mtx_init(&fwip->mtx, "fwip", NULL, MTX_DEF); /* XXX */ @@ -199,7 +197,7 @@ fwip_attach(device_t dev) splx(s); FWIPDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 1b35a8552b42..7ce47dfee8e4 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -446,11 +446,6 @@ fxp_attach(device_t dev) fxp_serial_ifmedia_sts); ifp = sc->ifp = if_gethandle(IFT_ETHER); - if (ifp == (void *)NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } /* * Enable bus mastering. diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index ace7d482e6fb..75ee9773eeca 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -153,8 +153,6 @@ gem_attach(struct gem_softc *sc) /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); sc->sc_csum_features = GEM_CSUM_FEATURES; ifp->if_softc = sc; if_initname(ifp, device_get_name(sc->sc_dev), diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index cd7849778bce..f8a37b9f37a9 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -352,18 +352,13 @@ gve_get_counter(if_t ifp, ift_counter cnt) } } -static int +static void gve_setup_ifnet(device_t dev, struct gve_priv *priv) { int caps = 0; if_t ifp; ifp = priv->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(priv->dev, "Failed to allocate ifnet struct\n"); - return (ENXIO); - } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setsoftc(ifp, priv); if_setdev(ifp, dev); @@ -401,8 +396,6 @@ gve_setup_ifnet(device_t dev, struct gve_priv *priv) ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&priv->media, IFM_ETHER | IFM_AUTO); - - return (0); } static int @@ -794,9 +787,7 @@ gve_attach(device_t dev) if (err != 0) goto abort; - err = gve_setup_ifnet(dev, priv); - if (err != 0) - goto abort; + gve_setup_ifnet(dev, priv); priv->rx_copybreak = GVE_DEFAULT_RX_COPYBREAK; diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index e87a7490e780..eea92094483a 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -164,8 +164,6 @@ icattach(device_t dev) struct ifnet *ifp; ifp = sc->ic_ifp = if_alloc(IFT_PARA); - if (ifp == NULL) - return (ENOSPC); mtx_init(&sc->ic_lock, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c index 219ac675308d..5cef827d3649 100644 --- a/sys/dev/jme/if_jme.c +++ b/sys/dev/jme/if_jme.c @@ -807,12 +807,6 @@ jme_attach(device_t dev) goto fail; ifp = sc->jme_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index 63a742bad366..19c1e07f854c 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -112,8 +112,6 @@ lance_config(struct lance_softc *sc, const char* name, int unit) return (ENXIO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); callout_init_mtx(&sc->sc_wdog_ch, &sc->sc_mtx, 0); diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index f2924ffcd457..3805d96c94b2 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -514,11 +514,6 @@ lge_attach(device_t dev) } ifp = sc->lge_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; diff --git a/sys/dev/liquidio/lio_main.c b/sys/dev/liquidio/lio_main.c index 9b990282d7f5..92a3a4fb3776 100644 --- a/sys/dev/liquidio/lio_main.c +++ b/sys/dev/liquidio/lio_main.c @@ -1331,11 +1331,6 @@ lio_setup_nic_devices(struct octeon_device *octeon_dev) ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - lio_dev_err(octeon_dev, "Device allocation failed\n"); - goto setup_nic_dev_fail; - } - lio = malloc(sizeof(struct lio), M_DEVBUF, M_NOWAIT | M_ZERO); if (lio == NULL) { diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index 987511c775de..5f31711468c5 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -849,12 +849,6 @@ mge_attach(device_t dev) /* Allocate network interface */ ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "if_alloc() failed\n"); - mge_detach(dev); - return (ENOMEM); - } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c index bae22317574b..d68b3e0e0c21 100644 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c @@ -2143,11 +2143,6 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, priv = kzalloc(sizeof(*priv), GFP_KERNEL); *** 1193 LINES SKIPPED *** From nobody Tue Oct 8 10:09:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNBZS1ZVCz5ZFbm; Tue, 08 Oct 2024 10:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNBZS0FHnz4MFM; Tue, 8 Oct 2024 10:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+9QTPxcWgae/+c8zGdoiKh9VD5Poy/KAZMDpOV4tIQ0=; b=dmhqZKHc5toi6TaknBNlucTOmjTAyFghI721sD50/YFQvvheXzLE8Xw3edYFpBt6PzzP3H yPFhcERz9dQMhNvJa6rRv+Ev0yZURZi/89k8YVFS61tW+5E7BZNIGO4+gK62Ri0HPc+ZHL tZm7eYdyiHZX3Y6FhC9uwWjIfuNRSaAhUeljflcemam92rVVcUuzsq3gf5VPRYZW4Ah0Wh 2epttlxIhBctps3AsB6yF2P4+SxtxdxPelCl8tdTe9fOrQGOAJfgtl6nEVyE/5FojFQwN2 cflCAHKr0UJieQOnSiQvjUwuGMBvmij5T/Lqml59jeiKtphg7DL8TbLgf+3/eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+9QTPxcWgae/+c8zGdoiKh9VD5Poy/KAZMDpOV4tIQ0=; b=XvqA2oAtMBT9Y6SXtpTR0JdpgVBiUudOee5IW2ZC16CZvKW4CblFxoBJgXKbTvkT1vpRhA +qRF3zjGsQDfx3XxSuX35+kEySFqc4zKa53mO21rf2inTi4NY6aGe6qtrsupxuLNbKd4dk fja11e00gJ9urqmIR4+FlYzUy2SzAOQwXcFOWnTIrhD/4NmXNZfbj6diVvVR9ebovanVu4 X0j/saoYUJsOLVz6uWreyU+/TpSVyAMqPeOPWxszshg0rE3xO7qlUA4rIL9bJDiodAsofz 8iPz39d8dvaF9Zp1kvcydj/xc5zT0YtUtKgF+CpUeTQ1evSGI2YhFf1T0y3rLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728382160; a=rsa-sha256; cv=none; b=ZJGq+zEEy1E4arY9ii+tyDkdikNxezxO0HhFvQxEBNK7R5uBkVMrvwX6UziXfBQ8ljSm77 Hf+I6nLGUcOIDjsA/0m2KEnZgPbcwDNzvcCFr1dhGv8LGiFOo8OswPhvceqKUerWMCaFlX AUsXLpTnWEjU+mX5Ixl1UB5nD4d5V07Fvc14L4c3muyc0hU6+barUn9qWfSVbzuNLsdZhW W1H5TSH1rI2/yejyUYb0PGvCTciWVkM1qeFK5iqeSO6Py5bmRPf8zH1dplCKDOZHGyb/aj 4pz3WqZxqbvMSwriOpQ8VUSLeZsx2KjZTJQpFHaQt2EpIEIleeygiXmaTa9PZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNBZR6qs7zR26; Tue, 8 Oct 2024 10:09:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 498A9J7o059080; Tue, 8 Oct 2024 10:09:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498A9JQL059077; Tue, 8 Oct 2024 10:09:19 GMT (envelope-from git) Date: Tue, 8 Oct 2024 10:09:19 GMT Message-Id: <202410081009.498A9JQL059077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 36fe8266ef09 - stable/13 - hhook: Sprinkle const qualifiers where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 36fe8266ef0948ed40679dc2a827c4c056ee9296 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=36fe8266ef0948ed40679dc2a827c4c056ee9296 commit 36fe8266ef0948ed40679dc2a827c4c056ee9296 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 10:07:18 +0000 hhook: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 941f8aceac1b6c16ca4d96b52e60ab437c4f9207) (cherry picked from commit 18aa2a81c4651be2c7705f26f98175efa4f7a859) --- sys/kern/kern_hhook.c | 8 ++++---- sys/sys/hhook.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c index f4ad16d99a12..432b889856ff 100644 --- a/sys/kern/kern_hhook.c +++ b/sys/kern/kern_hhook.c @@ -128,7 +128,7 @@ hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd) * Register a new helper hook function with a helper hook point. */ int -hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags) +hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki, uint32_t flags) { struct hhook *hhk, *tmp; int error; @@ -185,7 +185,7 @@ hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags) * struct in the array. */ int -hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) +hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags) { struct hhook_head **heads_to_hook, *hhh; int error, i, n_heads_to_hook; @@ -243,7 +243,7 @@ tryagain: * Remove a helper hook function from a helper hook point. */ int -hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki) +hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki) { struct hhook *tmp; @@ -270,7 +270,7 @@ hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki) * virtual instances of the hook point if it is virtualised). */ int -hhook_remove_hook_lookup(struct hookinfo *hki) +hhook_remove_hook_lookup(const struct hookinfo *hki) { struct hhook_head *hhh; diff --git a/sys/sys/hhook.h b/sys/sys/hhook.h index 084023ccb546..f83389fec2e3 100644 --- a/sys/sys/hhook.h +++ b/sys/sys/hhook.h @@ -107,14 +107,14 @@ struct hhook_head { /* Public KPI functions. */ void hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd); -int hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, +int hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki, uint32_t flags); -int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags); +int hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags); -int hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki); +int hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki); -int hhook_remove_hook_lookup(struct hookinfo *hki); +int hhook_remove_hook_lookup(const struct hookinfo *hki); int hhook_head_register(int32_t hhook_type, int32_t hhook_id, struct hhook_head **hhh, uint32_t flags); From nobody Tue Oct 8 10:09:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNBZT3W3jz5ZFmm; Tue, 08 Oct 2024 10:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNBZT1dnbz4MFT; Tue, 8 Oct 2024 10:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qu75MJ4rJgGQnHUB8wn6ksM6JPtfzVWIkpbnsb/qA+w=; b=tFoWQ4uvy3b3UQv2Fqfd0iRwuHuuSoIH2olnAMSAu/C/3jaaVL5sN5zM47psBIq5GzKkIA Sa85xeT/CvTiMV9oIk+UllwT9hPAabLIc99RA1bGsJXPFTSirfK5JMXD3TCceE/JE8jWAS CyFZ4XIzFXPh4jFQ/R/8maIlx7BwEYVhA8VND0b4bc6GNpeLmHSdkPPcKZ9HtK+YlJmvTe N6FhBmSFUf7avR0vrkzbYVavXfaBKJY8pPU2oIXJk6IsCEi35GSp354mtGhpSEsQm55x9d Tt39TnjmPbwx62BIUlYJzSJjtmtaOeZnLRCRlkO+rj9oHarKqnAek2YTnLSBYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Qu75MJ4rJgGQnHUB8wn6ksM6JPtfzVWIkpbnsb/qA+w=; b=YIpox1kuwMxaiE42I8dXLdjVfpcSASUOmehqOXewjAoLeds73p1mk3WsFeQ7Jwmi0W1Saz ltLKBCBId7Po0jPoIcT6QDbpLM8o/wWAapTjx19tfQ2RPFg05SBHYgFVQkqfVMinwSGDKW p/y/eW8gkntHgjiqqbh+lprjwm2iP9JRYtwQ0586kcqgNnQPZ9B7nHbKtniiW8Eckxi8AP 3ufxuFJierxtdMPSrFvd49NoY/lewhKZtzKmW8kcyqBMU+SmTTlFPEPhGVh2Oq2PGygL4o +wX9nHjrAUOZZjXXgMOruBiMiLZln9zEhrcmgeeHu+5g3tmkfrVsxu9mEo35RA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728382161; a=rsa-sha256; cv=none; b=yVVMTeiyLX7GtFXFAr7+FzqWbGg63+Hk9kAFM8ttuEPNncZ/ncsf3Iaa+t/g5wcfCS52+j DMedTinzdgZNXrVOgT1cC1UWcbenUCTRHjDRgcE1E9aQA+j+cYorSNEQaCgpB5O15OrInm sdiLYawDWoUcYW0gatmsOELT/4QE1/Xrj5YX8ySMO1OfsYz2Dn0Qvh+E5Dh37TIqA1GUdW Uxi/GbDVy1SMbY4Bk9sFzW1gfUyZ5sUVkqsOeZTC1+BDTsBbw44FxB1tVLqZ21xW+ALOGQ elMtu8wLgwM6lAUIr47O6uNa2o0s29WFRnS2tIYz/WYkhSw0dg3mjLExcTlkUQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNBZT0crDzQhZ; Tue, 8 Oct 2024 10:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 498A9KPB059126; Tue, 8 Oct 2024 10:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498A9Kw5059123; Tue, 8 Oct 2024 10:09:20 GMT (envelope-from git) Date: Tue, 8 Oct 2024 10:09:20 GMT Message-Id: <202410081009.498A9Kw5059123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: d92fc5d447ae - stable/13 - khelp: Sprinkle const qualifiers where appropriate List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d92fc5d447aedd255676579aec0a06494cd6d469 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d92fc5d447aedd255676579aec0a06494cd6d469 commit d92fc5d447aedd255676579aec0a06494cd6d469 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 10:07:18 +0000 khelp: Sprinkle const qualifiers where appropriate No functional change intended. MFC after: 1 week (cherry picked from commit 89937323bddd41fd8b92430c3ece48d3e32c2c23) (cherry picked from commit 54c79d3ae419c81a7e6bbc8c60f0959462bf0b4d) --- share/man/man9/khelp.9 | 6 +++--- sys/kern/kern_khelp.c | 4 ++-- sys/sys/khelp.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/share/man/man9/khelp.9 b/share/man/man9/khelp.9 index 39515eef237c..d619f385d513 100644 --- a/share/man/man9/khelp.9 +++ b/share/man/man9/khelp.9 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 15, 2011 +.Dd October 1, 2024 .Dt KHELP 9 .Os .Sh NAME @@ -48,8 +48,8 @@ .Fn "int khelp_destroy_osd" "struct osd *hosd" .Fn "int32_t khelp_get_id" "char *hname" .Fn "void * khelp_get_osd" "struct osd *hosd" "int32_t id" -.Fn "int khelp_add_hhook" "struct hookinfo *hki" "uint32_t flags" -.Fn "int khelp_remove_hhook" "struct hookinfo *hki" +.Fn "int khelp_add_hhook" "const struct hookinfo *hki" "uint32_t flags" +.Fn "int khelp_remove_hhook" "const struct hookinfo *hki" .Fn KHELP_DECLARE_MOD "hname" "hdata" "hhooks" "version" .Fn KHELP_DECLARE_MOD_UMA "hname" "hdata" "hhooks" "version" "ctor" "dtor" .Sh DESCRIPTION diff --git a/sys/kern/kern_khelp.c b/sys/kern/kern_khelp.c index 3d75da141b48..3e815e140d93 100644 --- a/sys/kern/kern_khelp.c +++ b/sys/kern/kern_khelp.c @@ -254,7 +254,7 @@ khelp_get_id(char *hname) } int -khelp_add_hhook(struct hookinfo *hki, uint32_t flags) +khelp_add_hhook(const struct hookinfo *hki, uint32_t flags) { int error; @@ -268,7 +268,7 @@ khelp_add_hhook(struct hookinfo *hki, uint32_t flags) } int -khelp_remove_hhook(struct hookinfo *hki) +khelp_remove_hhook(const struct hookinfo *hki) { int error; diff --git a/sys/sys/khelp.h b/sys/sys/khelp.h index 2ef45806c35a..7aadb6a58faa 100644 --- a/sys/sys/khelp.h +++ b/sys/sys/khelp.h @@ -70,8 +70,8 @@ void * khelp_get_osd(struct osd *hosd, int32_t id); int32_t khelp_get_id(char *hname); -int khelp_add_hhook(struct hookinfo *hki, uint32_t flags); +int khelp_add_hhook(const struct hookinfo *hki, uint32_t flags); -int khelp_remove_hhook(struct hookinfo *hki); +int khelp_remove_hhook(const struct hookinfo *hki); #endif /* _SYS_KHELP_H_ */ From nobody Tue Oct 8 10:09:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNBZW19zSz5ZFbq; Tue, 08 Oct 2024 10:09:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNBZV2tV9z4MX9; Tue, 8 Oct 2024 10:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=appHaS4zFl0eJwgIbE+07dP5nj2QlIfJC+354rWHjpQ=; b=TRIsh4ohG2pOsSwNFSAXv7mzxHf4R8RlGnrB3GpMKqHku02hE8oOXtFKiUFIQduk81KXyp 7oTPVrtHJ56CALscMFs2tUYgEY8xUO3To6QHUnWl6jMhfBdqn6YtN1AzRuWqWTe+Hbf9/x KfB/cdbsG9pD6kvnU/PMC2tjA1pRUsIi/yRmOhj7ZDXIbwgmu88JfZ3HEnrWCtE0e/Qrmm SCS2jhgjzU80iNFoSKuP2AvLSgpuxSIqgBNswKjHe+tvFc2fgXxYz/GkhDYWGIX4fw49I1 RvmEGMMlL1LGn9lwYMT/mdKY6GGkqYXAw20NkP08BQS9vnyYHPUyH6uK2VYvSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728382162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=appHaS4zFl0eJwgIbE+07dP5nj2QlIfJC+354rWHjpQ=; b=ozpczyvKYtLJ23WZNcjY+G7sRwKEx7HBNz6fXPN73hPX5TJ+1aE92x0HCRxdNty2TZuvQp CLKgyQL7eedESghOyPjWjlAlbL2VpBEuhyhuSdyWiQYv8I+I+uuC7e4QwftLbKAZJHPqij otADuWZjQViAD/fNt/Wqg9Lf1dT60DXBnaLXgRfFaNNkPc/BxkBUbhNLsqAIxqDCHFGgwe PMMEnJ/rB4panX4jtIVGsU5QZRTufieqPw16VleEFer9c+ImWM5S3bmYQzwT0d3iDEf0MK lbbuMlHOFnfoGOXvTH0WvMUBsTddyB774QP+spvqrRUTXFJg5QOob/XY/qXtFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728382162; a=rsa-sha256; cv=none; b=QNg3Wljy7A9hoQV6LisZ9lrFxyW99au5cqRukN1DTbXOBlsOAIoMw8/ubK8DCn0nAAYQyQ UU9e5QF+2xlcG7GVAc4Gfdjq41523KQFDimMdZwpbDgdpsMuhw/u3f2ZY+8W/luj91xEcq dzcJ7Bi9YmvvnUAdU4bbg6cCbh+6t2+RoEJbO2KdN4X2J8Z8iDwwB8qlEmXEqyOcxLNYmG Jy/zJgtAQLu/Mpy2F9Pne5sncZKAdfBT7TPlk9VQAjEdcz8I03gDhEAp8QkoRU9EfRTSrV EPOwEMe66ZeKa9dQ750JWFzL4M4gBqEXOBztUe35II3Y+koWJ82EQqJYy5Fq3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNBZV1Ts1zR4N; Tue, 8 Oct 2024 10:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 498A9MLu059165; Tue, 8 Oct 2024 10:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498A9MvV059162; Tue, 8 Oct 2024 10:09:22 GMT (envelope-from git) Date: Tue, 8 Oct 2024 10:09:22 GMT Message-Id: <202410081009.498A9MvV059162@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: a31a4ddd39bb - stable/13 - if_enc(4): Make enc_add_hhooks() void List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a31a4ddd39bbdf0a5f860f980a3f7b1a97edc9a7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a31a4ddd39bbdf0a5f860f980a3f7b1a97edc9a7 commit a31a4ddd39bbdf0a5f860f980a3f7b1a97edc9a7 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-01 15:28:37 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-08 10:07:18 +0000 if_enc(4): Make enc_add_hhooks() void As for the consumer `enc_add_hhooks()`, `hhook_add_hook()` will never fail for the given parameters. Meanwhile, to build the module if_enc(4), at least option INET or INET6 is required, so no need for the error EPFNOSUPPORT. No functional change intended. Reviewed by: ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46770 (cherry picked from commit 7643141e9314f1eac0d9ac08457410509e6829ad) (cherry picked from commit d6374ee0517f8d991eafe022e2027dd1e64a2ad1) --- sys/net/if_enc.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c index acf62b1b9fcc..ba8b07c1848b 100644 --- a/sys/net/if_enc.c +++ b/sys/net/if_enc.c @@ -95,7 +95,7 @@ static int enc_output(struct ifnet *, struct mbuf *, const struct sockaddr *, struct route *); static int enc_clone_create(struct if_clone *, int, caddr_t); static void enc_clone_destroy(struct ifnet *); -static int enc_add_hhooks(struct enc_softc *); +static void enc_add_hhooks(struct enc_softc *); static void enc_remove_hhooks(struct enc_softc *); static const char encname[] = "enc"; @@ -310,13 +310,12 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data, return (0); } -static int +static void enc_add_hhooks(struct enc_softc *sc) { struct hookinfo hki; - int error; + int error __diagused; - error = EPFNOSUPPORT; hki.hook_func = enc_hhook; hki.hook_helper = NULL; hki.hook_udata = sc; @@ -325,28 +324,23 @@ enc_add_hhooks(struct enc_softc *sc) hki.hook_type = HHOOK_TYPE_IPSEC_IN; error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); hki.hook_type = HHOOK_TYPE_IPSEC_OUT; error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); #endif #ifdef INET6 hki.hook_id = AF_INET6; hki.hook_type = HHOOK_TYPE_IPSEC_IN; error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET6], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); hki.hook_type = HHOOK_TYPE_IPSEC_OUT; error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET6], &hki, HHOOK_WAITOK); - if (error != 0) - return (error); + MPASS(error == 0); #endif - return (error); } static void @@ -389,8 +383,7 @@ vnet_enc_init_proto(void *unused __unused) { KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); - if (enc_add_hhooks(V_enc_sc) != 0) - enc_clone_destroy(V_enc_sc->sc_ifp); + enc_add_hhooks(V_enc_sc); } VNET_SYSINIT(vnet_enc_init_proto, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_enc_init_proto, NULL); From nobody Wed Oct 9 04:02:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNfNy3yvYz5Ymp7; Wed, 09 Oct 2024 04:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNfNy3MRrz51Q3; Wed, 9 Oct 2024 04:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728446562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AsAFT60ZR5MNvJU3s0cAX9M0Jfv5Tn5KEfuJ8ynWk7Y=; b=MsU6Z4TrChv3ZQj5qqgoNjcAGjyT4oq+Ge/fgORbtlG624Oau8pdyQir4xn4997NeuwyRJ kty/5ueq/zga7j4G6UZqMxOEFRifjKo6iCyIe0KKDnOl7uXYQsRKbYiCCMOpV0j4/2pY3B GCOmfLzodNl/IfRJFWsgNOn6PRfxLFOMgAS119lxYmzpgvYsgNiUbjEu3LX+L2Wzm23EH0 6VTUpQ1lhv8+aTwXmcSEeoU0THYVbimFr6RHL1dVTqd59ujx4kLq+QG0rXit0TCISZllHb lkToJi1FwIe63xXX0sg0Kj3mKCNlTp12BB61qf+6nHsB64X2LzF94rcl8aecIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728446562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AsAFT60ZR5MNvJU3s0cAX9M0Jfv5Tn5KEfuJ8ynWk7Y=; b=GuRa8HrGkLPhM/LxHFxk6h9UEv8vNYQ2O7uZko6meB2lQXKJ0at6JMPNrlNNgNOrvglCa5 0IRPXrR8Q1eF7aQJXdKwbQokoXxeTDkVebYFc2+7c9Dmn+6/BPcTQhtxt+Xe5fd4Mpe7hl NuR9Onuaf8qNJP0hV1mn5qf/1hWnrUPvsqXv/xgrbuiI+PLOTQX5HG55H77OoOHyNY864M dRnIi7GMvGPEadG3Bb2MhQ0aEtL4/Y6ae450rqch8zCm2n+B3oT1+6UaHnpyQ1zmc/kewg NtkCh9AbW/XeuF9zritmAwMDkuFCbbjHDL7tvP2KU0YGvoqb9brae6WoQ7uv3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728446562; a=rsa-sha256; cv=none; b=B5TlEsFFXece07J0LyXtq1+KOyfWBZl0GxF5Xb41Ib2e+njhVzdbDDPqwlVKCxmuWgU3V6 l4UEu8TmggRC5+xJfa+GgqJiyeHDPo59t03b1H7pKz5/U5XKoBN78JHoH8MfYoX1sibiXU Kh/+s9Wuy6zpRMrPwsF62ykO7SCX+BWYUfXNuTrr1wjl+JpRezK4MqQ6KmG/zbUvwZ8g1d 2LXCn47H6IIzvC3FyfkJ6cwzFsiHWWdkHh0Y3wfdPtBWSqMXqvjNJNS05nlrkN9Cw2x4eE Mk6FXsHw/xRfkQrxwq9NGVRzlpcbqspX3YbxSES8lvvLocOk6ikPAvoaI753hA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNfNy2ypCzyZP; Wed, 9 Oct 2024 04:02:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49942gpd091804; Wed, 9 Oct 2024 04:02:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49942g9G091801; Wed, 9 Oct 2024 04:02:42 GMT (envelope-from git) Date: Wed, 9 Oct 2024 04:02:42 GMT Message-Id: <202410090402.49942g9G091801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 86c8cbe788db - stable/13 - if_epair: Remove unneeded NULL check for the allocated ifnet List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 86c8cbe788db4d2fd3eb32d92a66a72840665d1a Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=86c8cbe788db4d2fd3eb32d92a66a72840665d1a commit 86c8cbe788db4d2fd3eb32d92a66a72840665d1a Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2024-10-09 04:01:10 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-09 04:01:10 +0000 if_epair: Remove unneeded NULL check for the allocated ifnet This follows the recent MFC [1]. No functional change intended. This is a direct commit to stable/13. 1. f500e5c6c99b net: Remove unneeded NULL check for the allocated ifnet --- sys/net/if_epair.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index e4b37f976a8c..9482b30251b7 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -553,11 +553,6 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) sca = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); sca->ifp = if_alloc(IFT_ETHER); sca->num_queues = epair_tasks.tasks; - if (sca->ifp == NULL) { - free(sca, M_EPAIR); - ifc_free_unit(ifc, unit); - return (ENOSPC); - } sca->queues = mallocarray(sca->num_queues, sizeof(struct epair_queue), M_EPAIR, M_WAITOK); for (int i = 0; i < sca->num_queues; i++) { @@ -573,13 +568,6 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) scb = malloc(sizeof(struct epair_softc), M_EPAIR, M_WAITOK | M_ZERO); scb->ifp = if_alloc(IFT_ETHER); scb->num_queues = epair_tasks.tasks; - if (scb->ifp == NULL) { - free(scb, M_EPAIR); - if_free(sca->ifp); - free(sca, M_EPAIR); - ifc_free_unit(ifc, unit); - return (ENOSPC); - } scb->queues = mallocarray(scb->num_queues, sizeof(struct epair_queue), M_EPAIR, M_WAITOK); for (int i = 0; i < scb->num_queues; i++) { From nobody Wed Oct 9 09:17:34 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNnNG4PT3z5Z316; Wed, 09 Oct 2024 09:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNnNG3qPyz4G4L; Wed, 9 Oct 2024 09:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728465454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yccdoj/uJvc1fHfTVOgGO7KqOPP4rfnKahtnLTejq0=; b=W00Z3QmVes1AzVADCtlwxhhru4rX+IYU6sZISrMnyhqaIQtxtw10HScRnqZzCrCFsrOOIb wUftGuDnCDaPImyHMk12aZhZSkO7Z6fjni13TgqahtwfSM0ahW4ju/WtTjeBvDz3BwQess Rm/IWyFeifRk5cLF4pwdFqdxasNf2KK6qiWa/rf/gdMGsLz8crpDiC4t4gM4zCGMjpRgDw VrlCZDVpP0w/minvLphj00UolMKxjGJn+Wx/Osv5Qz5AlV2cP3DdT8Ai8uw8lW8DC9jJqp 8f/stNeQGRVPfGzVTTHJq30FY1oa0UBDnCS0o3zQAVAaPdTXuXNfVBGpN6wYuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728465454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8yccdoj/uJvc1fHfTVOgGO7KqOPP4rfnKahtnLTejq0=; b=vqMA3NwWbvMaDcT7oz47hZpFm4OTvxsmIbBhD0ESqo6ijo1LBehH7drO3pepg4x7z71LPn NqgfMqkNM39WyyrMDc1AC5Uilfz+fzfULvq37+lAymws5wRT9FotzF018MpBaijN6V933q VdZjCUnYLZ9IjQd0mMG8SP0MDUFne/yjOYCDbjU1J6kY1S0kgki71zM9Kpoyo9HhXuC2tD qkAg01tCfor9SjUWgdP2sGXCwRBkgG4TA3IplTr/37mTQMOuWME7AROPCGcy7WF1f2dbbh SpGbfDk+UKVpJYDXXZEyFy66dzJmU67xuCr+4C9B/uwG4DIRTk2CS+MEq1LsEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728465454; a=rsa-sha256; cv=none; b=uePd2915vxmaTHiivgBh2kIi69+HbrSsJQ8rc9Kf4S8fSI7aArASWnpHbFKP/Ac/UCJffW axtkjC4p0gMJk4EWi4f7q8hWkeFqHautr+JEI6hf32+NE9mssDYajnLNOJG6eThWuZ+J3k 47Fzug0QFnCFUjrPOiwu+eeJeRUOtyhbwjIvwoTebVPjojs6aN9j5R1UecG4oL2yhvjhQV sSJNxxkK+4aykbjQopKn6uYg/++I9RhD2WQILAuxIe6RoSd8CRHMAa92Jijala+PPWI7Xk rMv6w2vzfUn1nQGek+LNCmBeFclIgRzi2L6C+tV2DJgppx3eP1hnCFeU7jdvPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNnNG3R9Zz17XR; Wed, 9 Oct 2024 09:17:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4999HYg6018551; Wed, 9 Oct 2024 09:17:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4999HYuY018548; Wed, 9 Oct 2024 09:17:34 GMT (envelope-from git) Date: Wed, 9 Oct 2024 09:17:34 GMT Message-Id: <202410090917.4999HYuY018548@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: 0d4081ed6914 - stable/14 - sys: add conf/std.debug, generic debugging options List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 0d4081ed69147a2591dfc8b89cba42dc6a2ce757 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=0d4081ed69147a2591dfc8b89cba42dc6a2ce757 commit 0d4081ed69147a2591dfc8b89cba42dc6a2ce757 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2024-04-23 21:11:24 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2024-10-09 08:44:35 +0000 sys: add conf/std.debug, generic debugging options The new sys/conf/std.debug contains the list of debugging options enabled by default in -CURRENT, so they don't need to be listed individually in every kernel config. Introduce *-DEBUG variants of the major kernel configs. (cherry picked and modified from commit 4f8f9d708e6a4143f3b178bfab10d0a9b75ba2fe) Reviewed by: markj, imp, olce (previous version) Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46871 --- sys/amd64/conf/GENERIC-DEBUG | 9 +++++++++ sys/amd64/conf/MINIMAL-DEBUG | 9 +++++++++ sys/amd64/conf/NOTES | 11 +++++++++++ sys/arm/conf/GENERIC-DEBUG | 9 +++++++++ sys/arm64/conf/GENERIC-DEBUG | 9 +++++++++ sys/conf/std.debug | 29 +++++++++++++++++++++++++++++ sys/i386/conf/GENERIC-DEBUG | 9 +++++++++ sys/powerpc/conf/GENERIC-DEBUG | 9 +++++++++ sys/powerpc/conf/GENERIC64-DEBUG | 9 +++++++++ sys/powerpc/conf/GENERIC64LE-DEBUG | 9 +++++++++ sys/riscv/conf/GENERIC-DEBUG | 9 +++++++++ 11 files changed, 121 insertions(+) diff --git a/sys/amd64/conf/GENERIC-DEBUG b/sys/amd64/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..f7187677370b --- /dev/null +++ b/sys/amd64/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/amd64 +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG diff --git a/sys/amd64/conf/MINIMAL-DEBUG b/sys/amd64/conf/MINIMAL-DEBUG new file mode 100644 index 000000000000..a2533608f8af --- /dev/null +++ b/sys/amd64/conf/MINIMAL-DEBUG @@ -0,0 +1,9 @@ +# +# MINIMAL-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/amd64 +# + +include MINIMAL +include "std.debug" + +ident MINIMAL-DEBUG diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index c82be3945ac7..db93a47165d6 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -153,3 +153,14 @@ options KSTACK_PAGES=5 # Enable detailed accounting by the PV entry allocator. options PV_STATS + +##################################################################### +# Kernel sanitizers + +#options COVERAGE # Generic kernel coverage. Used by KCOV +#options KCOV # Kernel Coverage Sanitizer +# Warning: KUBSAN can result in a kernel too large for loader to load +#options KUBSAN # Kernel Undefined Behavior Sanitizer +#options KCSAN # Kernel Concurrency Sanitizer +#options KASAN # Kernel Address Sanitizer +#options KMSAN # Kernel Memory Sanitizer diff --git a/sys/arm/conf/GENERIC-DEBUG b/sys/arm/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..f36fe21b1640 --- /dev/null +++ b/sys/arm/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/ARMv6 +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG diff --git a/sys/arm64/conf/GENERIC-DEBUG b/sys/arm64/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..d954106b58db --- /dev/null +++ b/sys/arm64/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/arm64 +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG diff --git a/sys/conf/std.debug b/sys/conf/std.debug new file mode 100644 index 000000000000..813aa0e4af91 --- /dev/null +++ b/sys/conf/std.debug @@ -0,0 +1,29 @@ +# +# std.debug -- Enable debug options for -CURRENT. +# + +options BUF_TRACKING # Track buffer history +#options FULL_BUF_TRACKING # Track more buffer history +options DDB # Support DDB. +options FULL_BUF_TRACKING # Track more buffer history +options GDB # Support remote GDB. +options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default +options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence +#options DEBUG_VFS_LOCKS + +# Net80211 debugging +options IEEE80211_DEBUG + +# USB debugging +options USB_DEBUG +options HID_DEBUG + +# CAM debugging +options CAMDEBUG diff --git a/sys/i386/conf/GENERIC-DEBUG b/sys/i386/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..a988096e019e --- /dev/null +++ b/sys/i386/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/i386 +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG diff --git a/sys/powerpc/conf/GENERIC-DEBUG b/sys/powerpc/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..6388aaaffb55 --- /dev/null +++ b/sys/powerpc/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/powerpc +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG diff --git a/sys/powerpc/conf/GENERIC64-DEBUG b/sys/powerpc/conf/GENERIC64-DEBUG new file mode 100644 index 000000000000..5e0d43941200 --- /dev/null +++ b/sys/powerpc/conf/GENERIC64-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/powerpc64 +# + +include GENERIC64 +include "std.debug" + +ident GENERIC64-DEBUG diff --git a/sys/powerpc/conf/GENERIC64LE-DEBUG b/sys/powerpc/conf/GENERIC64LE-DEBUG new file mode 100644 index 000000000000..97d308864313 --- /dev/null +++ b/sys/powerpc/conf/GENERIC64LE-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/powerpc64le +# + +include GENERIC64LE +include "std.debug" + +ident GENERIC64LE-DEBUG diff --git a/sys/riscv/conf/GENERIC-DEBUG b/sys/riscv/conf/GENERIC-DEBUG new file mode 100644 index 000000000000..ab16a6cc5cfa --- /dev/null +++ b/sys/riscv/conf/GENERIC-DEBUG @@ -0,0 +1,9 @@ +# +# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file +# for FreeBSD/RISC-V +# + +include GENERIC +include "std.debug" + +ident GENERIC-DEBUG From nobody Wed Oct 9 11:54:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNrst3Rczz5YRtc; Wed, 09 Oct 2024 11:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNrst2tL7z4Syy; Wed, 9 Oct 2024 11:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728474898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LyO6/hmZ+dAtQiS4GIzH0Qh2eMULaqwEpu83kZbj7A=; b=GPDFYNZzAfq2oh14fkrwAM0asSrqb+0bsfJrb/0Y55xof1LeD7SIMxsFf5a8mlaLaBUl0v d0QpGO7lLw60fVCpwRCsfehewUczJBxQI8QiqSGK0eMfTxuZJy7tQqVI6mN68t2CZlVHDf U+JogXDxiX0Fx1FoOHmeX+ve7Z4C814RPNX6hYBkWzwL/Zz/zQTOGOLLh07+IpAqcOOdJr Z1+6HhO49ygkb5WOl/b4tO254mLtDMUwqbvV44Y8R0+hi3CkEVoEFgQO8OVTqapD9iQkya ZqJKynLCttbsQC2NYgQM1QRwDRgCRbujZEZafnFhqi4fqL6vYdQC4RH7fmMNWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728474898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8LyO6/hmZ+dAtQiS4GIzH0Qh2eMULaqwEpu83kZbj7A=; b=mCKAC/GgkBNy6Rg3hti2ihaLGMBkcKTVyytS4ZpzVGynJjJwrj/ut2+Ir0ypQ4QpyHB5l2 VywG5NAO0XWAIBVuongaCTd87hPojFoslIHzjH/uZt5xTz07h0U8AQBqXDY7XB8mIsoiJP flPx7dmXRMt3seF/UHbNM84Nbga8HMDht+aUcCN95IBr9goMiIvrZHKw2AhnF/NVMp9ZE0 4SV1EP1Y7aqvNdeNkQCSCOKkOp80NmPN4+BzbNmi0kbWxX3GcJE/8JSwe5rBSnxFU5Fg68 O4kBPjbswfJSZmuyInlnF8q/q8E938yx9Vy+aLXsOgu8F7rZRMjIxRt+JKi7uA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728474898; a=rsa-sha256; cv=none; b=Wi8EMrBVOIi13VS0niYQ8a5a5FzquT+72kKIi6y5F/3lYlv1dXFVQRgWXegq8AXWEMTB47 x6PLapfZH43a7If5qCVwO5aNxS8M8eSo5RT9JYAKsyx3Rjex295gRyC+kl8guatfl1Mxe/ pmZ3bd12Q+tdods7MWiDfUOwLnHR1mMLktzpVweycGo9lmiVorlhw1+C0tk68xNNnw/vsn gotYx33IgMaNxRBPNNJX2f3NTZtlSiVBXAagQWtMv7+I2S7DFDRRozNIrlWoid5ycAsJD/ KFc8IUe7dxo/axhOuWapemUiyJ9QMCz4Jxt1qeKFKlc9w42742C37gShvkMpTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNrst22q2z1CG3; Wed, 9 Oct 2024 11:54:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499BswWb089746; Wed, 9 Oct 2024 11:54:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499BswX3089743; Wed, 9 Oct 2024 11:54:58 GMT (envelope-from git) Date: Wed, 9 Oct 2024 11:54:58 GMT Message-Id: <202410091154.499BswX3089743@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Gmelin <grembo@FreeBSD.org> Subject: git: 484724578422 - stable/13 - fetch: correct env var name for --crl option to work List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48472457842226eb3445fd70dd995954020f0cb8 Auto-Submitted: auto-generated The branch stable/13 has been updated by grembo: URL: https://cgit.FreeBSD.org/src/commit/?id=48472457842226eb3445fd70dd995954020f0cb8 commit 48472457842226eb3445fd70dd995954020f0cb8 Author: Franco Fichtner <franco@opnsense.org> AuthorDate: 2024-10-07 09:36:19 +0000 Commit: Michael Gmelin <grembo@FreeBSD.org> CommitDate: 2024-10-09 11:50:06 +0000 fetch: correct env var name for --crl option to work Reviewed by: grembo MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46973 (cherry picked from commit 1d7a33888e09f86feb4c2c9f9640d936be07ce9d) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index bb7d27d896b6..d800ebf59f11 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1060,7 +1060,7 @@ main(int argc, char *argv[]) setenv("SSL_CLIENT_KEY_FILE", optarg, 1); break; case OPTION_SSL_CRL_FILE: - setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + setenv("SSL_CRL_FILE", optarg, 1); break; case OPTION_SSL_NO_SSL3: setenv("SSL_NO_SSL3", "", 1); From nobody Wed Oct 9 11:55:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XNrtM4Cd4z5YS7W; Wed, 09 Oct 2024 11:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNrtM3hr7z4T5n; Wed, 9 Oct 2024 11:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728474923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fJLGMb9iCqJBot16r0RXuHjPXF5g6C6c0b3id/1q460=; b=xN1l6UwJbGVmERw40Tlr/esDQNlls2F2kzcFAQ0GmYaawRmqNbAFr/QzzPz1h2Lnt7NtLv lyARlg1R2dzoCM+p0flVihxnXBFcgsdolqB8lYKPEEvkTf4n1xMl5XXsReV3cbldyY8cFO 5W0TmDVp3hpXtoPQon3kSZjwNyWHX3ik/5hFo7t54VDahM8bfZ+ryKRo+ez4REE5m0rZ+T atI1v1vb6bEJcu7uYrdPeuRiFh7D6QxEUrppFw4Z+08qlMwdriDcPcJJIQ6vhcA4i190z2 OuYoQVLnKbX72OM9f4eYg70DsOqfjnrGr70Pv5eLX9zfdLwhF3eyK7DudmCSmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728474923; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fJLGMb9iCqJBot16r0RXuHjPXF5g6C6c0b3id/1q460=; b=IkhhOzelaVDCcv+dcEWbJz8CDimz9vILrknVRr0Oq9T+BJpD2ye8LUfDrdwYrFb1fLusVX XQPKKKeMhaWFv4NFuoDHm/8vmxtJwnjZlhKXPBZ8P+aJbyqrfdNk1Bdkw2HkpWJ3VXCETH /l3iTKU6DBIbnEC5WxFX2Lnmyc+LkPisKXfOloRtNrdSoL3WmBjdxSXN8pbLdKUFb+3gsQ rJl+BCBfqLqiZWag51VVPRUsFRADU8pKaLwDHm93iu28QLN7CLMQKGDEXfgxv/WSpQI4ww /cWK1vJigrvCrTtGIZGFcGAhWFSRzBLytnjsp9C0N0bt0RCT/PsjiJ9tnZ7EJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728474923; a=rsa-sha256; cv=none; b=onlqC27fxn5+LfnSJYrq6R22rLQfeqMVWCkCKMSvNj6jIfIRsLuORilZX6EKXsC8TT6Wwj T+fm/dq1oRY7UEexReW+gtwhuFCXpkuZ6EFnDecHaLwcGdUow0BSvq1CbfF86jdz33S/IO ZoLejJFU1Hr10Y1+wZ4SPUTBgLIWLup8ir1MF/RtkeJXQezHZYT4WQZrSBqrOM6WHqqrfT gb03cSpkNVquRv/PC2NUD8/oOI/Th4gaU8z1AxIuZvkrF3Q09NjWgvmmGTABXVDdhyaj+i DbIpptJncPsdt/JitE9gTgi1nfwE0x8FAAKpogiFh3zCSU4eNvZxVUJN61BfvQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XNrtM3J8Jz1Bs4; Wed, 9 Oct 2024 11:55:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499BtNvK090018; Wed, 9 Oct 2024 11:55:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499BtNBk090015; Wed, 9 Oct 2024 11:55:23 GMT (envelope-from git) Date: Wed, 9 Oct 2024 11:55:23 GMT Message-Id: <202410091155.499BtNBk090015@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Gmelin <grembo@FreeBSD.org> Subject: git: 51676e0a3bd3 - stable/14 - fetch: correct env var name for --crl option to work List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: grembo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 51676e0a3bd38ab6deae27f72fb6fb6dd648825f Auto-Submitted: auto-generated The branch stable/14 has been updated by grembo: URL: https://cgit.FreeBSD.org/src/commit/?id=51676e0a3bd38ab6deae27f72fb6fb6dd648825f commit 51676e0a3bd38ab6deae27f72fb6fb6dd648825f Author: Franco Fichtner <franco@opnsense.org> AuthorDate: 2024-10-07 09:36:19 +0000 Commit: Michael Gmelin <grembo@FreeBSD.org> CommitDate: 2024-10-09 11:49:32 +0000 fetch: correct env var name for --crl option to work Reviewed by: grembo MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46973 (cherry picked from commit 1d7a33888e09f86feb4c2c9f9640d936be07ce9d) --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index bb7d27d896b6..d800ebf59f11 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1060,7 +1060,7 @@ main(int argc, char *argv[]) setenv("SSL_CLIENT_KEY_FILE", optarg, 1); break; case OPTION_SSL_CRL_FILE: - setenv("SSL_CLIENT_CRL_FILE", optarg, 1); + setenv("SSL_CRL_FILE", optarg, 1); break; case OPTION_SSL_NO_SSL3: setenv("SSL_NO_SSL3", "", 1); From nobody Wed Oct 9 23:13:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x34GtHz5Z6kV; Wed, 09 Oct 2024 23:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x33js3z4jSX; Wed, 9 Oct 2024 23:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wp8gHbtP3IeA/7GjB3DVnGOkdQuE46gdtHjSd/GTvbo=; b=QvkeTzdgePxXMEKPCwgEicCySBF/POYY32Pc+sjhV+kYSrn+1eep0moM2NHeaW9WCSDs0m ezQ8mjiF7I6xYXJaZ+ql88V9BZW5b34g/BP4+URGqScwyuJ9PZWJyANnI8GSB5gaxsVKGV dGUJALa5O5hHuYIDRJo4AQiK/pqZ9IcxzcYB1BXfUfKunGRrZHmsyPfqTUQqPIfjsyFDV2 9BXdZnbeer4U/a54e/BUIMq5Wa9N+an8wngO+9Qi03XfHUNz1AUH0QBTXFuHC1tZ1v1ABv fIY1H+CqcZ7uUbdLQIsTuFBU550WPoR4eOqQy81jkNAk/Kpb6VPJKGBpZpjHBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wp8gHbtP3IeA/7GjB3DVnGOkdQuE46gdtHjSd/GTvbo=; b=WOpFEWFRU5dP0LaqYFqhdeiuGAFMyPKkQsfPmT/87XWx6xozAvtnJ6fluzN5t+NDaMHbbz +9oy23Xm04N5mBxCkh3JU6JFIPMsdYu75LtnT62xmrU7mYdTyDYu2onWj5UVILmVG5CTtd ZkUXD/vYQNDlaPl02uiI+lyXlVlaoIn3GyTPI6xVt1dsJri+VTFZ8zRKuRQVb6TiEYPI7b YQYnBA6Dd/euPyBVcKs46wEDMBjHGyOhSfSA97NKVYPlCjjWwQ7r9NwTRTMKvBGwu3gag7 zpo21WqASHlKilGn8dICSvMT+u0Uh+5/ZYmXQJvNPhw2oSY/2KIpZ9fOaLugog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515623; a=rsa-sha256; cv=none; b=gNWAUaajqWGW12I+olttkTnywn46cPhbKRh37lu82gnZjsBFeyBeqtCHhNj4ycnrCxesi+ 3nrwQVEUBBYtR/ph9NVUT/hmwq0vxKStMHMY2Hi/VJi12tpP6VsrCnhFtDiUhIwQet0TGo E3ooldI1TZ1Bpq97XcvDcHM9PrDcPF69Lk/zs7eN34nJmcRXhtDb0KzS9KyeuWL2eI4EBD 1LZ8dJH36sGZm8ooxSDM5rA+0jqvdjSqoYu/n2lXCj9yYDI5jbM96O2y5MeGBPRoBUIrda uQWsi97WVoeons1nJVDrb9VqIPoG0pQ44tLDsoMWkNuHWphk+RSPQ4Xl6TWfhA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x33JtpzZJX; Wed, 9 Oct 2024 23:13:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDhU1044648; Wed, 9 Oct 2024 23:13:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDhOt044644; Wed, 9 Oct 2024 23:13:43 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:43 GMT Message-Id: <202410092313.499NDhOt044644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: 87b32aa4d409 - stable/14 - tools/sdiodevs2h.awk: fix after removal of $FreeBSD$ List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 87b32aa4d40974d1fc87a21ed457b067b95d248c Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=87b32aa4d40974d1fc87a21ed457b067b95d248c commit 87b32aa4d40974d1fc87a21ed457b067b95d248c Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-08-27 18:33:14 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:20 +0000 tools/sdiodevs2h.awk: fix after removal of $FreeBSD$ The input file used to have a $FreeBSD$ tag on the first line and we recorded that in the generated files to know which versions they were based on. With the removal of $FreeBSD$ the logic was not quite correct anymore; fix that to generate proper header files again. Sponsored by: The FreeBSD Foundation Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46300 (cherry picked from commit 499c337781bf8df7f97f612b93427b3f53dfd8bb) --- sys/tools/sdiodevs2h.awk | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 1cddd6c1f5d0..818bdef58762 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -44,9 +44,6 @@ function header(file) printf("/*\n") > file printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \ > file - printf(" *\n") > file - printf(" * generated from:\n") > file - printf(" *\t%s\n", VERSION) > file printf(" */\n") > file } @@ -233,13 +230,10 @@ line=0; while ((getline < srcfile) > 0) { line++; if (line == 1) { - VERSION = $0 - gsub("\\$", "", VERSION) if (dfile) header(dfile) if (hfile) header(hfile) - continue; } if ($1 == "vendor") { vendor(hfile) From nobody Wed Oct 9 23:13:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x45NC3z5Z6QL; Wed, 09 Oct 2024 23:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x44rdwz4jvZ; Wed, 9 Oct 2024 23:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/v0fNZ0fnouTJeCpKXwrvAcSk32+H6m+qUU/pWCUiyY=; b=SCeevW225yQjRTiezNFMfxM/SrHKMCxvj5IkHSifIEgBs7EoBUQKi2N8uh6w1wltmhXlxs HIKgteEwm97yO3Pgho49WOXLTNcrQjbChvX9ubLfK5NTiWdgx0bkY7k23P5U9R0Luobl47 bWDeTrT3zRR8IpDxDFo/Owp4+SJEz9WDkmmtB1rZNTk3hvBNCfwq1ZniMItNEbnrdjjfCB PmuiId3lTFROxzitJie0Jtngm1/WipYJZCUgyfSVPJc2Uuu1lMxvrjNnoCr4GoZ+L/kOrX Gz+HQ7BYLTDLHhVlxdMqrwbxH0+pnOur+Bl4R/gkSQjaDddEMamErJvVk7ooKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515624; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/v0fNZ0fnouTJeCpKXwrvAcSk32+H6m+qUU/pWCUiyY=; b=fg2N3Rsofvd94YDR/HHkySYMWyDJGnja0rkWOPlXiCg4wJP9Bd7vekHxaFeyxVFjqz2mc9 1rGOOp/Cr7NjoiePysgtlbjtZFbOAN30Kq7SWxvJffALbJILIzVxYJ+Va+VqQveLtLYovt POPec0wcnYMttyy8vJaxFbnyrvBKq8tZ7MSaQCNuXkiXy98ElUeV97tIDwsNGBOOVcaSgK 1n48D7lU7BD4DLTCEAbv0vCEkgrwxG0EGkvehzLVofKJUb5cshB/z3SxdZZtZHQkUWzPNz hPIqEhKCmS70bz4YcaX/c3Kni0JYepW7zBU6QQT/xbVf6Xte8Qg04xE5pqXE8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515624; a=rsa-sha256; cv=none; b=no5F5t3n0/aaKGyVFn4bz0N8+slZHxwjl5rSt0qR4prj3/1Du8Bactq0UPxPRND049keVD 71qG2dfCr9p4iuxMrLrffWUwFJLwiFlYmxELJEhQfwSc/rVbXU56mJvJXqQrHbxoyc3eFP VoQtbKQSo1gvzogJ7piHxPiNKynE7Y0HaT3EVD+o9lFCodrrUh+Qo2qk0MdwZGtPnsQnx5 bIfMkiUI8U3G5inXlv+Z1/KgGQt78BmBMEijm2JLflqnhO/vCMhWUl/ZpcdFDZPmHFlSEF JwSKC0g6b/migZIWZisEVZGp9uAm0XBtsfVLjA+Bukt7h6uAkxTQuut7Pvz76w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x44SdjzYZq; Wed, 9 Oct 2024 23:13:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDiHn044711; Wed, 9 Oct 2024 23:13:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDill044708; Wed, 9 Oct 2024 23:13:44 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:44 GMT Message-Id: <202410092313.499NDill044708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: 794e20f8071e - stable/14 - tools/sdiodevs2h.awk: adjust defined named for vendor and device IDs List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 794e20f8071e434ac4f72033264ab493bf1ea94e Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=794e20f8071e434ac4f72033264ab493bf1ea94e commit 794e20f8071e434ac4f72033264ab493bf1ea94e Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-08-27 18:35:49 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:28 +0000 tools/sdiodevs2h.awk: adjust defined named for vendor and device IDs Generate defined names which match the ones in the Linux drivers (a lot more); given we are likely to have drivers only based on those one way or another there is absolutely no reason to fight over differently generated names for device and vendor IDs. Sponsored by: The FreeBSD Foundation Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D46300 (cherry picked from commit 51cb6f5244575e1abc008598e90eb35452ffbcac) --- sys/tools/sdiodevs2h.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 818bdef58762..596d09531ab1 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -55,7 +55,7 @@ function vendor(hfile) vendors[nvendors, 1] = $2; # name vendors[nvendors, 2] = $3; # id if (hfile) - printf("#define\tSDIO_VENDOR_%s\t%s\t", vendors[nvendors, 1], + printf("#define\tSDIO_VENDOR_ID_%s\t%s\t", vendors[nvendors, 1], vendors[nvendors, 2]) > hfile i = 3; f = 4; @@ -105,7 +105,7 @@ function product(hfile) products[nproducts, 2] = $3; # product id products[nproducts, 3] = $4; # id if (hfile) - printf("#define\tSDIO_PRODUCT_%s_%s\t%s\t", \ + printf("#define\tSDIO_DEVICE_ID_%s_%s\t%s\t", \ products[nproducts, 1], products[nproducts, 2], \ products[nproducts, 3]) > hfile @@ -155,7 +155,7 @@ function dump_dfile(dfile) printf("const struct sdio_knowndev sdio_knowndevs[] = {\n") > dfile for (i = 1; i <= nproducts; i++) { printf("\t{\n") > dfile - printf("\t SDIO_VENDOR_%s, SDIO_PRODUCT_%s_%s,\n", + printf("\t SDIO_VENDOR_ID_%s, SDIO_DEVICE_ID_%s_%s,\n", products[i, 1], products[i, 1], products[i, 2]) > dfile printf("\t ") > dfile printf("0") > dfile @@ -189,7 +189,7 @@ function dump_dfile(dfile) } for (i = 1; i <= nvendors; i++) { printf("\t{\n") > dfile - printf("\t SDIO_VENDOR_%s, 0,\n", vendors[i, 1]) > dfile + printf("\t SDIO_VENDOR_ID_%s, 0,\n", vendors[i, 1]) > dfile printf("\t SDIO_KNOWNDEV_NOPROD,\n") > dfile printf("\t \"") > dfile j = 3; From nobody Wed Oct 9 23:13:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x6286Mz5Z6jw; Wed, 09 Oct 2024 23:13:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x55phCz4jdW; Wed, 9 Oct 2024 23:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjahnrHAgAS3oIrbfxjYlbaXHNaut7uvedbY3qOa0l8=; b=AA1oYCDfhHEV18RhH6XEnQPv4NBa3V5LdXdpCD6QgTO9n8v3E2zQYoiSRbPje4a1C5tau7 AKSE54uO0uSlrdfGUu1bLiFdP9+5HSe4fmV3uN59dMiLmFbb8Kx086MVTTnzcNWPXrPSgy 6YHrSAh3tVPgliszgYUXrNZRj37W7gI4DyAg0BkrrrrfCdf9X7LiN11IOVK9SpNyK5Bwau NRsH2nF6u92cZ5rp7L4fmGrroMv0j0joIykX4wQMuOvhqp7WM9qZu5jrRVuvo7YJ4UTGzQ LKuAYow6/6FRVExrQj1hUDmgG6YXLWBXnLUlI0dvu5M4nP1bGnx9m/liOkbuvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xjahnrHAgAS3oIrbfxjYlbaXHNaut7uvedbY3qOa0l8=; b=U8GTPu1kjKd5ml9XrZSN6o1qgtjlIaCOWO9uThBupRXRV2Su9Bc/muzBZDqR4ib1Qa3q8k aEGUMmNsX96S5RwJd0CL+s0weRwrFRFaqCgyx7vJq92u10v3b8UEwWIiLJbpNQzNc3s0wu yONIWjKdT2gN33cgJuNzmrq2ANidRtTqC0ABsk1GqZGx93oPc0B7f0kx1BEA22k5hni/vj ZDLSSAG324atzS1C94ct2KNmvE9871n2I9HnrrbaH3UBcIvrGq62cgezgZwedVskj7ZiSs wYtNRqprz3dPhd3fTNi7fYP+hUc7eU0NXlnTl+IAsqCuaTKNtGytnZglnFffLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515625; a=rsa-sha256; cv=none; b=ArYIpa+SVvj28Wttsvnk6icx3nI3XuOvcJGgqqHKqeDCultKUVdqnq+IOBpwjq+mS5gbUO uRd1b3aBHqusvOtlnmMF0y9mJxN+SOJWaN0SK2Q2r33bVI5nzwbiympWNyrYsA58cIT9NG aRf2nHuYRCXpGJf/JXZx5DBIJ/qfxTZFRf2VgwB09mnlp1dWOST5Rs4l3PUwnoiWhk6pTE b3nRohgBheEsbtPxcghWX1wEzEieCXPVBOm8MHfohuVP8+LfW7zxIgqnoByY085C9vt8yP IPNxxj9w3TXhdlqDQp9ya55rcD1N1NoIEmam36kDixWmMCVEvgQl+9pI33JKIQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x55Q8kzYZr; Wed, 9 Oct 2024 23:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDjxA044750; Wed, 9 Oct 2024 23:13:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDjq8044747; Wed, 9 Oct 2024 23:13:45 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:45 GMT Message-Id: <202410092313.499NDjq8044747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: dfc9df8106e7 - stable/14 - tools/sdiodevs2h.awk: introduce palias List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dfc9df8106e7afa1a6ef1388a30639909cd573b0 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dfc9df8106e7afa1a6ef1388a30639909cd573b0 commit dfc9df8106e7afa1a6ef1388a30639909cd573b0 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-08-27 18:41:17 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:36 +0000 tools/sdiodevs2h.awk: introduce palias Some of the defined names are not the direct 1:1 mapping with vendor and device names used by Linux device drivers. Introduce a p(roduct)alias so we can map the one device entry I came across without much extra hassle and generate a name device drivers know about: palias BROADCOM_CYPRESS_43439 CYPRESS_43439 Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46455 (cherry picked from commit b4ef1b1be753952a4aafa505817164624f712c37) --- sys/tools/sdiodevs2h.awk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sys/tools/sdiodevs2h.awk b/sys/tools/sdiodevs2h.awk index 596d09531ab1..99735dc09a62 100644 --- a/sys/tools/sdiodevs2h.awk +++ b/sys/tools/sdiodevs2h.awk @@ -149,6 +149,18 @@ function product(hfile) printf("\n") > hfile } +function palias(hfile) +{ + nproducts++ + + products[nproducts, 1] = $2; # vendor name + products[nproducts, 2] = $3; # product id + products[nproducts, 3] = $4; # id + if (hfile) + printf("#define\tSDIO_DEVICE_ID_%s\tSDIO_DEVICE_ID_%s\n", \ + $2, $3) > hfile +} + function dump_dfile(dfile) { printf("\n") > dfile @@ -243,6 +255,10 @@ while ((getline < srcfile) > 0) { product(hfile) continue } + if ($1 == "palias") { + palias(hfile) + continue + } if ($0 == "") blanklines++ if (hfile) From nobody Wed Oct 9 23:13:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x71j76z5Z6QN; Wed, 09 Oct 2024 23:13:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x66rydz4jh6; Wed, 9 Oct 2024 23:13:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h89M8Pc39GULYIrXv8YSsynkrX6CHLCGVKNV29HR/Us=; b=F92xhItHPyCi0t2NfRb0nAi94B7UPlpgGEGLG8XRoq6vGdO9fkOrJJpo8EkZk0cM+tblDq R6xGTWXOVF0XqmDslPl44duMtDelENSUWItXWG4BQTcFvyqEKFWtQefUxcuLAGJybBTdCP p7t0+s9AnKIOa+wUV/KRT8NHVWJmUROiSV5ogZRBZ3ANEEbt6tNpLeXawNDqSGwFkSHJ5X Ce7sQMwNmBk5crvvierN4/o+IUs8dpeGpPXE3IKWQk2raa93UuvGhrO/ofSTjwYRtMP57L gW2OP4pJm9Rpf5bPQGf1KTLqVctQDV8LkN/pGMlYJ8uEb5QwOW4dyJUOaEwOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=h89M8Pc39GULYIrXv8YSsynkrX6CHLCGVKNV29HR/Us=; b=o7kuC09M8elRQOwkdMyjrTtGNL7CgHfLfxtoC4BAT1oLyMVUfpb8cOt6TWekyUzJkPgEze 61AVsd7hp6f/na3mn7ztghhat82EE2vVYAAKhmkIpXT+kbdHKtDQqBXS/GS7hF0TSRD3pf Caex9gVU4BWmwDjeXmROyALmZoF9nicLe8lVbPV2Mi0YwFHeDV5now6FvYQ/ZripciajAE w6hOY9WACbLeosTchYMvpw/OaQLd7EIyoEzkm6CnOYe88C/nXmQtKJlrvf+bjP4YO+9qFM niDGst8hNwRdZ3996Trp4f+98Kf9jM2806gTywiutpHAHgqZRur6RU1rjSI0FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515627; a=rsa-sha256; cv=none; b=deqXJfD5141UxzJHLDsgnMTXaXFZjkS/AE44bCoAz4i1XFvloWbWL2lJH7Br3v7U5Md61a 2f6+1I+Gr6GWeRqErN9yV3tCUrkvVgQPA9foSTz6niOlgKTlJKGqoFjV/22VPXA/RguXR3 Q4d4VKPNgUOsNpg07WB78ZkB6oal3qI4cVtbExOaEODMiv9e2SB39GS0pgnmyeX87GZm5Y l5jgBQZybpknx2pImqoa2qS8X/s9EejWYCzqvmao8opX4eBZ0vOScfLsHdztiVNJGB3KMt mL+EXYUCRA0Yn5b3mgSOGuFQZJsfwHggo8z6okvdKmUWakPLKe6sn8rryTAeWQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x66TC0zZLd; Wed, 9 Oct 2024 23:13:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDkSD044798; Wed, 9 Oct 2024 23:13:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDkEi044795; Wed, 9 Oct 2024 23:13:46 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:46 GMT Message-Id: <202410092313.499NDkEi044795@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: 6a931f050b0f - stable/14 - sdiodevs: add more vendors and devices List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a931f050b0f1694bb449bc7dd129b6dc1ea2c0d Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=6a931f050b0f1694bb449bc7dd129b6dc1ea2c0d commit 6a931f050b0f1694bb449bc7dd129b6dc1ea2c0d Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-08-27 20:12:20 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:43 +0000 sdiodevs: add more vendors and devices Add IDs for Realtek, Atheros (QCA), and Mediatek. While I am not sure we'll ever support the ath10k and possibly mt76 SDIO devices, rtw88 ones can be found with SoCs (e.g. r2s-plus) and are actively being worked on. Update Broadcom/Cypress entries. Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46460 (cherry picked from commit a800b5bcd1b6638530d3a0759b17cd8d93b7e7ca) --- sys/dev/sdio/sdiodevs | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/sys/dev/sdio/sdiodevs b/sys/dev/sdio/sdiodevs index 194ef8e5d901..8c341e77d9f9 100644 --- a/sys/dev/sdio/sdiodevs +++ b/sys/dev/sdio/sdiodevs @@ -42,8 +42,11 @@ * List of TPLMID_MANF "vendor ID"s. * Please sort by vendor ID ascending. */ +vendor REALTEK 0x024c Realtek +vendor ATHEROS 0x0271 Atheros vendor BROADCOM 0x02d0 Broadcom vendor CYPRESS 0x02d0 Cypress/Broadcom +vendor MEDIATEK 0x037a MediaTek /* * -------------------------------------------------------------------------- @@ -51,6 +54,21 @@ vendor CYPRESS 0x02d0 Cypress/Broadcom * Please group by vendor in same order as above. */ +/* Realtek products */ +/* PR 251063 */ +product REALTEK RTW8723BS 0xb723 802.11bgn SDIO WLAN with Bluetooth 4.0 Single-Chip Controller +/* rtw88 */ +product REALTEK RTW8821BS 0xb821 +product REALTEK RTW8822BS 0xb822 802.11ac/abgn SDIO WLAN with Bluetooth 4.1 Single-Chip Controller +product REALTEK RTW8821CS 0xc821 802.11ac/abgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller +product REALTEK RTW8822CS 0xc822 802.11ac/abgn SDIO WLAN with Bluetooth x.x Single-Chip Controller +product REALTEK RTW8723DS_1ANT 0xd724 802.11bgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller +product REALTEK RTW8723DS_2ANT 0xd723 802.11bgn SDIO WLAN with Bluetooth 4.2 Single-Chip Controller + +/* Atheros/QCA products */ +product ATHEROS AR6005 0x050a Qualcomm Atheros 802.11ac WLAN SDIO +product ATHEROS QCA9377 0x0701 Qualcomm Atheros 802.11ac WLAN SDIO + /* Broadcom products */ product BROADCOM 43241 0x4324 BCM43241 fullmac SDIO WiFi product BROADCOM 4329 0x4329 BCM4329 fullmac SDIO WiFi @@ -61,13 +79,25 @@ product BROADCOM 4339 0x4339 BCM4339 fullmac SDIO WiFi product BROADCOM 4345 0x4345 BCM4345 fullmac SDIO WiFi product BROADCOM 4354 0x4354 BCM4354 fullmac SDIO WiFi product BROADCOM 4356 0x4356 BCM4356 fullmac SDIO WiFi +product BROADCOM 4359 0x4359 BCM4359 fullmac SDIO WiFi product BROADCOM 43143 0xa887 BCM43143 fullmac SDIO WiFi product BROADCOM 43340 0xa94c BCM43340 fullmac SDIO WiFi product BROADCOM 43341 0xa94d BCM43341 fullmac SDIO WiFi product BROADCOM 43362 0xa962 BCM43362 fullmac SDIO WiFi product BROADCOM 43364 0xa9a4 BCM43364 fullmac SDIO WiFi product BROADCOM 43430 0xa9a6 BCM43430 fullmac SDIO WiFi +product BROADCOM 43439 0xa9af BCM43439 fullmac SDIO WiFi product BROADCOM 43455 0xa9bf BCM43455 fullmac SDIO WiFi -product CYPRESS 4373 0x4373 CY4373 fullmac SDIO WiFi +product BROADCOM CYPRESS_4373 0x4373 BCMCY4373 fullmac SDIO WiFi +product BROADCOM CYPRESS_43012 0xa804 BCMCY43012 fullmac SDIO WiFi +product BROADCOM CYPRESS_43752 0xaae8 BCMCY43752 fullmac SDIO WiFi +product BROADCOM CYPRESS_89359 0x4355 BCMCY89359 fullmac SDIO WiFi + +product CYPRESS 43439 0xbd3d CY43439 fullmac SDIO WiFi +palias BROADCOM_CYPRESS_43439 CYPRESS_43439 + +/* MediaTek products */ +product MEDIATEK MT7663S 0x7603 MediaTek MT7663S SDIO WiFi +product MEDIATEK MT7921S 0x7901 MediaTek MT7921S SDIO WiFi /* end */ From nobody Wed Oct 9 23:13:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x829T4z5Z6Y3; Wed, 09 Oct 2024 23:13:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x80qnPz4jwN; Wed, 9 Oct 2024 23:13:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6XwJl/v1jA7D9YdeLo2MOBPu5MIihFG1X07Vz9b2KuA=; b=QuOgOuLPMgecbXBHdF9uMTIx/f3/CVXhSDQ057CEZXnP7Ol1o1xGl19c2WYCZQu0zTAGUH wPaS7UJP5nVkZIPLASCrT/DWom2MRilv0CUZLEbLhwcJBUclGYmpJfcuMXOGl7IKfYZr/S ADNV9YqQDx7DyVDICwuMRHi1uiUgrP7SP2LHh+DzThBkPQ7NC6UuHqnp1Sz1RortzJUjs/ sM06EdAYM1DoUz8akrGbeAI5WaFBbxtUcgMqPb0zHaFWVof4/TsCP5Mtf8xE0WxUGb2jFm Btd9DKrmUvsEvKEsH0LmgQkLiE1ry03KC130zV28vchTtbqinRJ8AY84j6j3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6XwJl/v1jA7D9YdeLo2MOBPu5MIihFG1X07Vz9b2KuA=; b=Fl2kddh+hMZ5CoEt3yfpG1ZCU85TRzr1wS0/3L8PwE6toq1vyid4RNK64auqKU3AZO5LIY MtS0qf6yOB0FI5GMJWPE6AipdWy+5O32ptRROWUa4e546Geu0DqHlZppXgYf+AKyU98NUO RMerKN1u9ZFItABieqhiVyYnISg3EMHqRsULyHFEwtabP6fcCDylBN2X270ul3sca+PorR OJAuUybe9WYW6jvhCb/cBBJePCQarpeARXNcXEUiULs59/fBerRimlRFOMTclxp8P30uUl uew/sVJiZXLbPYwOg+18pAhmWQZnJbvUsege3nE/BEpATgFWiSwWz49qp9bWfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515628; a=rsa-sha256; cv=none; b=oSUymS4e/aWQ+v9WgcFk0If84laFZQmJG0vODs0XIqO5/hEFx9HLDSabcIFM7C5z0bV87c NwI2sWZRUJ3TnlJHoP4bkSzEEidRFbUm55HwQ3yc3/N1a5+ci7UQ+/FrCr4oJr1buWolzO zXrpoiOD5SlQxANmhINXebmisxj2Mw6ohHO95T8dV9afK8P6gwc1PvrB2433qg2QqsjMK5 Dl1PX0sjSbSClqkuqbMSoE9WKRUtRk85e6NLPsELxj68+9amCJKFWqzkdvda+YbYu7tBp8 SXCgh/YR2jmaHOa/dvda9STPJtAJFJeZ6iOOoHCyF3B5CvzgF3X12jwHxFOJAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x80PRYzZ0x; Wed, 9 Oct 2024 23:13:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDlPr044856; Wed, 9 Oct 2024 23:13:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDlnb044853; Wed, 9 Oct 2024 23:13:47 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:47 GMT Message-Id: <202410092313.499NDlnb044853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: dd4d05b25fcd - stable/14 - mt76: add mt7615 to the pile of buildable drivers List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dd4d05b25fcde1085d8c2f4543d9edb94ac592f5 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dd4d05b25fcde1085d8c2f4543d9edb94ac592f5 commit dd4d05b25fcde1085d8c2f4543d9edb94ac592f5 Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-09-04 18:38:05 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:49 +0000 mt76: add mt7615 to the pile of buildable drivers Ignoring page_pools with the few needed adjustments and ignoring 7622 mt7615 seems to build as well. Add it so once we can connect it to the build people can start testing and debugging. (The actual work was done on a newer version of the mt76 drivers but it seems the to-build-changes equally apply here already). Requested by: Radu-Cristian Fotescu (freebsd-wireless, 2024-07-31) Sponsored by: The FreeBSD Foundation (cherry picked from commit 7728586800bd5bb4655cff6d661133ed10cc2ff7) --- sys/contrib/dev/mediatek/mt76/mt7615/eeprom.c | 15 ++++++++++++++ sys/contrib/dev/mediatek/mt76/mt7615/init.c | 6 ++++++ sys/contrib/dev/mediatek/mt76/mt7615/mac.c | 11 +++++++++++ sys/contrib/dev/mediatek/mt76/mt7615/mcu.c | 4 ++++ sys/contrib/dev/mediatek/mt76/mt7615/pci_init.c | 5 +++++ sys/contrib/dev/mediatek/mt76/mt7615/pci_mac.c | 3 +++ sys/modules/mt76/Makefile | 1 + sys/modules/mt76/mt7615/Makefile | 26 +++++++++++++++++++++++++ 8 files changed, 71 insertions(+) diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/eeprom.c b/sys/contrib/dev/mediatek/mt76/mt7615/eeprom.c index ccedea7e8a50..d5ec498aa9ef 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/eeprom.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/eeprom.c @@ -6,6 +6,9 @@ */ #include <linux/of.h> +#if defined(__FreeBSD__) +#include <linux/delay.h> +#endif #include "mt7615.h" #include "eeprom.h" @@ -63,7 +66,11 @@ static int mt7615_efuse_init(struct mt7615_dev *dev, u32 base) for (i = 0; i + 16 <= len; i += 16) { int ret; +#if defined(__linux__) ret = mt7615_efuse_read(dev, base, i, buf + i); +#elif defined(__FreeBSD__) + ret = mt7615_efuse_read(dev, base, i, (u8 *)buf + i); +#endif if (ret) return ret; } @@ -256,6 +263,7 @@ int mt7615_eeprom_get_power_delta_index(struct mt7615_dev *dev, return MT_EE_5G_RATE_POWER; } +#if defined(__linux__) static void mt7615_apply_cal_free_data(struct mt7615_dev *dev) { static const u16 ical[] = { @@ -311,9 +319,11 @@ static void mt7622_apply_cal_free_data(struct mt7615_dev *dev) eeprom[ical[i]] = otp[ical[i]]; } } +#endif static void mt7615_cal_free_data(struct mt7615_dev *dev) { +#if defined(__linux__) struct device_node *np = dev->mt76.dev->of_node; if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) @@ -328,6 +338,7 @@ static void mt7615_cal_free_data(struct mt7615_dev *dev) mt7615_apply_cal_free_data(dev); break; } +#endif } int mt7615_eeprom_init(struct mt7615_dev *dev, u32 addr) @@ -348,7 +359,11 @@ int mt7615_eeprom_init(struct mt7615_dev *dev, u32 addr) } mt7615_eeprom_parse_hw_cap(dev); +#if defined(__linux__) memcpy(dev->mphy.macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, +#elif defined(__FreeBSD__) + memcpy(dev->mphy.macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR, +#endif ETH_ALEN); mt76_eeprom_override(&dev->mphy); diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/init.c b/sys/contrib/dev/mediatek/mt76/mt7615/init.c index 18a50ccff106..517a9ec9e07f 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/init.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/init.c @@ -15,6 +15,7 @@ #include "mcu.h" #include "eeprom.h" +#if defined(__linux__) static ssize_t mt7615_thermal_show_temp(struct device *dev, struct device_attribute *attr, char *buf) @@ -64,6 +65,7 @@ int mt7615_thermal_init(struct mt7615_dev *dev) return 0; } EXPORT_SYMBOL_GPL(mt7615_thermal_init); +#endif static void mt7615_phy_init(struct mt7615_dev *dev) @@ -566,7 +568,11 @@ int mt7615_register_ext_phy(struct mt7615_dev *dev) * Make the secondary PHY MAC address local without overlapping with * the usual MAC address allocation scheme on multiple virtual interfaces */ +#if defined(__linux__) memcpy(mphy->macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, +#elif defined(__FreeBSD__) + memcpy(mphy->macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR, +#endif ETH_ALEN); mphy->macaddr[0] |= 2; mphy->macaddr[0] ^= BIT(7); diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/mac.c b/sys/contrib/dev/mediatek/mt76/mt7615/mac.c index 7ba789834e8d..5037104ed1a4 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/mac.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/mac.c @@ -10,6 +10,9 @@ #include <linux/devcoredump.h> #include <linux/etherdevice.h> #include <linux/timekeeping.h> +#if defined(__FreeBSD__) +#include <linux/delay.h> +#endif #include "mt7615.h" #include "../trace.h" #include "../dma.h" @@ -1575,9 +1578,17 @@ mt7615_mac_tx_free_token(struct mt7615_dev *dev, u16 token) mt7615_txwi_free(dev, txwi); } +#if defined(__linux__) static void mt7615_mac_tx_free(struct mt7615_dev *dev, void *data, int len) +#elif defined(__FreeBSD__) +static void mt7615_mac_tx_free(struct mt7615_dev *dev, u8 *data, int len) +#endif { +#if defined(__linux__) struct mt76_connac_tx_free *free = data; +#elif defined(__FreeBSD__) + struct mt76_connac_tx_free *free = (void *)data; +#endif void *tx_token = data + sizeof(*free); void *end = data + len; u8 i, count; diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/mcu.c b/sys/contrib/dev/mediatek/mt76/mt7615/mcu.c index 8d745c9730c7..704faf50f4f9 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/mcu.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/mcu.c @@ -232,9 +232,13 @@ void mt7622_trigger_hif_int(struct mt7615_dev *dev, bool en) if (!is_mt7622(&dev->mt76)) return; +#if defined(__linux__) regmap_update_bits(dev->infracfg, MT_INFRACFG_MISC, MT_INFRACFG_MISC_AP2CONN_WAKE, !en * MT_INFRACFG_MISC_AP2CONN_WAKE); +#elif defined(__FreeBSD__) + panic("%s: LinuxKPI needs regmap\n", __func__); +#endif } EXPORT_SYMBOL_GPL(mt7622_trigger_hif_int); diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/pci_init.c b/sys/contrib/dev/mediatek/mt76/mt7615/pci_init.c index f607eee3fb47..68f628c6f24e 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/pci_init.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/pci_init.c @@ -8,6 +8,9 @@ */ #include <linux/etherdevice.h> +#if defined(__FreeBSD__) +#include <linux/delay.h> +#endif #include "mt7615.h" #include "mac.h" #include "eeprom.h" @@ -92,9 +95,11 @@ int mt7615_register_device(struct mt7615_dev *dev) if (ret) return ret; +#if defined(__linux__) ret = mt7615_thermal_init(dev); if (ret) return ret; +#endif ieee80211_queue_work(mt76_hw(dev), &dev->mcu_work); mt7615_init_txpower(dev, &dev->mphy.sband_2g.sband); diff --git a/sys/contrib/dev/mediatek/mt76/mt7615/pci_mac.c b/sys/contrib/dev/mediatek/mt76/mt7615/pci_mac.c index 0019890fdb78..fe6bd71c7d97 100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/pci_mac.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/pci_mac.c @@ -9,6 +9,9 @@ #include <linux/etherdevice.h> #include <linux/timekeeping.h> +#if defined(__FreeBSD__) +#include <linux/delay.h> +#endif #include "mt7615.h" #include "../dma.h" diff --git a/sys/modules/mt76/Makefile b/sys/modules/mt76/Makefile index 95d6e10a6991..89eb22bc3e9a 100644 --- a/sys/modules/mt76/Makefile +++ b/sys/modules/mt76/Makefile @@ -1,5 +1,6 @@ SUBDIR= core +SUBDIR+= mt7615 SUBDIR+= mt7915 SUBDIR+= mt7921 SUBDIR+= mt7996 diff --git a/sys/modules/mt76/mt7615/Makefile b/sys/modules/mt76/mt7615/Makefile new file mode 100644 index 000000000000..6d7cb945a32d --- /dev/null +++ b/sys/modules/mt76/mt7615/Makefile @@ -0,0 +1,26 @@ +DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7615 + +.PATH: ${DEVDIR} + +WITH_DEBUGFS= 0 +WITH_DEV_COREDUMP= 0 + +KMOD= if_mt7615 + +# Common stuff. +SRCS= init.c main.c mac.c mcu.c eeprom.c + +# PCIe (7622_WMAC ignored) +SRCS+= dma.c mmio.c pci.c pci_init.c pci_mac.c + +# USB + SDIO ignored currently. + +.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0 +SRCS+= debugfs.c +CFLAGS+= -DCONFIG_MT7915_DEBUGFS=${WITH_DEBUGFS} +.endif + +CFLAGS+= -DKBUILD_MODNAME='"mt7615"' +CFLAGS+= -I${DEVDIR} + +.include <bsd.kmod.mk> From nobody Wed Oct 9 23:13:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7x92t0Rz5Z6Mx; Wed, 09 Oct 2024 23:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7x91cpMz4jbd; Wed, 9 Oct 2024 23:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPQ763zFQQcNNCPOH9tlrwbV/kRhZXY4B3pj40e4Iuo=; b=NCfA0mOGV9PJTTr6DK/gsjutQxXJ8++fCB51WGwPFUraU6NVvGQBaBQUFzMziu+uuD+LAu POz+kHLC4OfrM/ZWz5bZ78OJ7BiS/AjlLZAloy4pTuZAGRq0WwiwIOiAH2Yc4k5sSGQBjy 7i9NOWkP7TjCjckVLy1b3tokn9TdHx+b/vqT7m4HHixLcMDVmoAB/5VV6Ef/qdGcgyAmyS W/PF4T3ZaltsJ0sx5sWlvpZVjW4tmf6++wjyii87RI9KYptzuDuhSt0nz+hAyducf4B0vf eXu8nU9+Q8LteRhnEXWWYBYWzLRXRf8HI8xTO85HJPXez8FbHOrAmj8MjQsP/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NPQ763zFQQcNNCPOH9tlrwbV/kRhZXY4B3pj40e4Iuo=; b=k2Mh9cPVWldzCB9IEc2a9wEaGYOWkNOf9EtXLSsbBqivkpLlfHwKF90gpndVvSO1A2qXx/ D2ksn4PcCeNYUx2RVIG1XMS0AgEUgOogfMu59IKhFUlKRvs9/AarSOvkBDHSCgWlEH7b2L C/hrav/7I0AXMDDOAGcUPqUAoSkzl4CF2QVNoEz6Q4NWDkqQBw1xdCZ0+uBnurF/wEjR4x 42PvnSw+4glY0h9SngM49jfddMlB0AXLvcOlYaYj0C/yh0HvGhEdn6bGvYFOUdOPgK0rAf 1v3c8hbfKumqGToB5gz5DRv5h6TLdBxoflqCv7tIn/h6hUy/bWl9HRDQ1VYMQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515629; a=rsa-sha256; cv=none; b=EDwItKAKE/DQcdo9m7JrKXYWqHluARIqtiTSjddsISADEaFgEQDa63iUwCYNIt8X/7kFQH 4wevEBrdm4m6WK45mo27E/J6OaVhacRztOQSsLmhXgoHaFbj9+ifENLYcuvnkBHWruYW0o zn7sOg3WA9XSsqzmKp+x7My/BR6fhXT0wn4n1MUvzZ1u4VbMyU+HL+BCv85WcpI2/fAf2v tO8Y0u14qZCIcgO5JBUrLpA+wwM9+0DGms/ugC0WfMMcvnhnjvvXHvwP2lmBiuqlVeDDFx GU+TgbqjCO/tDrWBly4QfyEKF8Ov2b6s8BjP8yYDvAT5rVaYWlcuPoGZfn2j3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7x91Cf3zYZs; Wed, 9 Oct 2024 23:13:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDn06044907; Wed, 9 Oct 2024 23:13:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDnNF044904; Wed, 9 Oct 2024 23:13:49 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:49 GMT Message-Id: <202410092313.499NDnNF044904@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: c8c12a517b31 - stable/14 - LinuxKPI: 802.11: move functions between header files List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c8c12a517b311b7159d6d31ee4c0c252b9469a4e Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c8c12a517b311b7159d6d31ee4c0c252b9469a4e commit c8c12a517b311b7159d6d31ee4c0c252b9469a4e Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2024-09-27 17:47:30 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:18:58 +0000 LinuxKPI: 802.11: move functions between header files Move some ieee8022_{is,has,get}_... functions working on header fields from mac80211.h to ieee80211.h to avoid problems with #includes. No functional changes. Sponsored by: The FreeBSD Foundation (cherry picked from commit 0b325167f60def621536632460caf68e2fab4fb8) --- .../linuxkpi/common/include/linux/ieee80211.h | 351 +++++++++++++++++++++ sys/compat/linuxkpi/common/include/net/mac80211.h | 341 -------------------- 2 files changed, 351 insertions(+), 341 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index 9a43a571d390..ce6a18f798d1 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -37,6 +37,14 @@ #include <linux/bitops.h> #include <linux/if_ether.h> +/* linux_80211.c */ +extern int linuxkpi_debug_80211; +#ifndef D80211_TODO +#define D80211_TODO 0x1 +#endif +#define TODO(...) if (linuxkpi_debug_80211 & D80211_TODO) \ + printf("%s:%d: XXX LKPI80211 TODO\n", __func__, __LINE__) + /* 9.4.2.55 Management MIC element (CMAC-256, GMAC-128, and GMAC-256). */ struct ieee80211_mmie_16 { @@ -853,4 +861,347 @@ ieee80211_is_trigger(__le16 fc) return (fc == v); } +static __inline bool +ieee80211_is_action(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_probe_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_auth(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_assoc_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_assoc_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_reassoc_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_reassoc_resp(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_disassoc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_data_present(__le16 fc) +{ + __le16 v; + + /* If it is a data frame and NODATA is not present. */ + fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); + v = htole16(IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_deauth(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_is_beacon(__le16 fc) +{ + __le16 v; + + /* + * For as much as I get it this comes in LE and unlike FreeBSD + * where we get the entire frame header and u8[], here we get the + * 9.2.4.1 Frame Control field only. Mask and compare. + */ + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + + +static __inline bool +ieee80211_is_probe_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); + + return (fc == v); +} + +static __inline bool +ieee80211_has_protected(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); +} + +static __inline bool +ieee80211_is_back_req(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); + + return (fc == v); +} + +static __inline bool +ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) +{ + struct ieee80211_mgmt *mgmt; + __le16 fc; + + mgmt = (struct ieee80211_mgmt *)skb->data; + fc = mgmt->frame_control; + + /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ + /* XXX we do not care about IBSS yet. */ + + if (!ieee80211_is_mgmt(fc)) + return (false); + if (ieee80211_is_action(fc)) /* XXX FTM? */ + return (true); /* XXX false? */ + if (ieee80211_is_disassoc(fc)) + return (true); + if (ieee80211_is_deauth(fc)) + return (true); + + TODO(); + + return (false); +} + +static __inline bool +ieee80211_is_nullfunc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_qos_nullfunc(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); + + return (fc == v); +} + +static __inline bool +ieee80211_is_any_nullfunc(__le16 fc) +{ + + return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); +} + +static inline bool +ieee80211_is_pspoll(__le16 fc) +{ + __le16 v; + + fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); + v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL); + + return (fc == v); +} + +static __inline bool +ieee80211_has_a4(__le16 fc) +{ + __le16 v; + + fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); + v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); + + return (fc == v); +} + +static __inline bool +ieee80211_has_order(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_ORDER << 8)); +} + +static __inline bool +ieee80211_has_retry(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_RETRY << 8)); +} + + +static __inline bool +ieee80211_has_fromds(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); +} + +static __inline bool +ieee80211_has_tods(__le16 fc) +{ + + return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); +} + +static __inline uint8_t * +ieee80211_get_SA(struct ieee80211_hdr *hdr) +{ + + if (ieee80211_has_a4(hdr->frame_control)) + return (hdr->addr4); + if (ieee80211_has_fromds(hdr->frame_control)) + return (hdr->addr3); + return (hdr->addr2); +} + +static __inline uint8_t * +ieee80211_get_DA(struct ieee80211_hdr *hdr) +{ + + if (ieee80211_has_tods(hdr->frame_control)) + return (hdr->addr3); + return (hdr->addr1); +} + +static __inline bool +ieee80211_is_frag(struct ieee80211_hdr *hdr) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_first_frag(__le16 fc) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_ftm(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_is_timing_measurement(struct sk_buff *skb) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_has_pm(__le16 fc) +{ + TODO(); + return (false); +} + +static __inline bool +ieee80211_has_morefrags(__le16 fc) +{ + + fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); + return (fc != 0); +} + +static __inline u8 * +ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) +{ + if (ieee80211_has_a4(hdr->frame_control)) + return (u8 *)hdr + 30; + else + return (u8 *)hdr + 24; +} + + #endif /* _LINUXKPI_LINUX_IEEE80211_H */ diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 29fb335a8db9..c3b07b68090a 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1260,229 +1260,6 @@ ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif) /* -------------------------------------------------------------------------- */ -static __inline bool -ieee80211_is_action(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ACTION | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_probe_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_auth(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_AUTH | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_assoc_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_assoc_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_ASSOC_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_reassoc_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_reassoc_resp(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_REASSOC_RESP | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_disassoc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_DISASSOC | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_data_present(__le16 fc) -{ - __le16 v; - - /* If it is a data frame and NODATA is not present. */ - fc &= htole16(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_NODATA); - v = htole16(IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_deauth(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_DEAUTH | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_is_beacon(__le16 fc) -{ - __le16 v; - - /* - * For as much as I get it this comes in LE and unlike FreeBSD - * where we get the entire frame header and u8[], here we get the - * 9.2.4.1 Frame Control field only. Mask and compare. - */ - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_BEACON | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - - -static __inline bool -ieee80211_is_probe_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PROBE_REQ | IEEE80211_FC0_TYPE_MGT); - - return (fc == v); -} - -static __inline bool -ieee80211_has_protected(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_PROTECTED << 8)); -} - -static __inline bool -ieee80211_is_back_req(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_BAR | IEEE80211_FC0_TYPE_CTL); - - return (fc == v); -} - -static __inline bool -ieee80211_is_bufferable_mmpdu(struct sk_buff *skb) -{ - struct ieee80211_mgmt *mgmt; - __le16 fc; - - mgmt = (struct ieee80211_mgmt *)skb->data; - fc = mgmt->frame_control; - - /* 11.2.2 Bufferable MMPDUs, 80211-2020. */ - /* XXX we do not care about IBSS yet. */ - - if (!ieee80211_is_mgmt(fc)) - return (false); - if (ieee80211_is_action(fc)) /* XXX FTM? */ - return (true); /* XXX false? */ - if (ieee80211_is_disassoc(fc)) - return (true); - if (ieee80211_is_deauth(fc)) - return (true); - - TODO(); - - return (false); -} - -static __inline bool -ieee80211_is_nullfunc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_qos_nullfunc(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_QOS_NULL | IEEE80211_FC0_TYPE_DATA); - - return (fc == v); -} - -static __inline bool -ieee80211_is_any_nullfunc(__le16 fc) -{ - - return (ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)); -} - -static inline bool -ieee80211_is_pspoll(__le16 fc) -{ - __le16 v; - - fc &= htole16(IEEE80211_FC0_SUBTYPE_MASK | IEEE80211_FC0_TYPE_MASK); - v = htole16(IEEE80211_FC0_SUBTYPE_PS_POLL | IEEE80211_FC0_TYPE_CTL); - - return (fc == v); -} - static __inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) { @@ -1490,124 +1267,6 @@ ieee80211_vif_is_mesh(struct ieee80211_vif *vif) return (false); } -static __inline bool -ieee80211_is_frag(struct ieee80211_hdr *hdr) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_first_frag(__le16 fc) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_robust_mgmt_frame(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_ftm(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_is_timing_measurement(struct sk_buff *skb) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_has_pm(__le16 fc) -{ - TODO(); - return (false); -} - -static __inline bool -ieee80211_has_a4(__le16 fc) -{ - __le16 v; - - fc &= htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); - v = htole16((IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_DIR_FROMDS) << 8); - - return (fc == v); -} - -static __inline bool -ieee80211_has_order(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_ORDER << 8)); -} - -static __inline bool -ieee80211_has_retry(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_RETRY << 8)); -} - - -static __inline bool -ieee80211_has_fromds(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_DIR_FROMDS << 8)); -} - -static __inline bool -ieee80211_has_tods(__le16 fc) -{ - - return (fc & htole16(IEEE80211_FC1_DIR_TODS << 8)); -} - -static __inline uint8_t * -ieee80211_get_SA(struct ieee80211_hdr *hdr) -{ - - if (ieee80211_has_a4(hdr->frame_control)) - return (hdr->addr4); - if (ieee80211_has_fromds(hdr->frame_control)) - return (hdr->addr3); - return (hdr->addr2); -} - -static __inline uint8_t * -ieee80211_get_DA(struct ieee80211_hdr *hdr) -{ - - if (ieee80211_has_tods(hdr->frame_control)) - return (hdr->addr3); - return (hdr->addr1); -} - -static __inline bool -ieee80211_has_morefrags(__le16 fc) -{ - - fc &= htole16(IEEE80211_FC1_MORE_FRAG << 8); - return (fc != 0); -} - -static __inline u8 * -ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr) -{ - if (ieee80211_has_a4(hdr->frame_control)) - return (u8 *)hdr + 30; - else - return (u8 *)hdr + 24; -} /* -------------------------------------------------------------------------- */ /* Receive functions (air/driver to mac80211/net80211). */ From nobody Wed Oct 9 23:13:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XP7xB2mXLz5Z6W9; Wed, 09 Oct 2024 23:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XP7xB221Gz4k48; Wed, 9 Oct 2024 23:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PfKh9LRhp+B+GykHG6V2TdxtGT4vGAQtYi8C5cpz4qY=; b=D9HXOA6fpJIG2LqZlW8/zGLO1Re3Cormy1LnTfqOibS6CprVAzRkPnQeHxOCk9M6clR5JX MGeVLZChypI9bhA8h1bH2KQcM2ueEmCMP95sZXNkMNsPbdQ+a2HMW38dHzIVTWLTdZ7H6Q EIrOEt1MQNRTi3SbpFO7CWK0n9SugV46wr+W3BdYMkk3AmsWUBEg06xH98WtlSm0y1p+AY SVtk2txIDrN1fDsceGOlqKM5CjgJOz0tNbnn/ymmRGrn/U4mCp2CMLC9nVHbmuto3yZc5W J2JCWnBpXfjj5wW2l3oY9iozBIqh7JPhm7qx6/2z5kY2CpMqhPFG3RfHBfmY5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728515630; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PfKh9LRhp+B+GykHG6V2TdxtGT4vGAQtYi8C5cpz4qY=; b=Y+UuCURKewHGz+J+0gK+UoNKyQ3/4bfr7HJ3+w6dqPOXHOwwMf8PuJYgbSWbdgRV5FXlYS ikSB0v6pXip+DOXgXUEP3TJJw3hWoHLreHlaFrfwn3/vTyWkNF7sIuAFxbSOw2CkE5wT2i IuQGcoccaUmWuUB2xPYT+kyLub6uZ917/UvM8X33nSXgcPkW9ASdQLGumtGZYkLCiIkNMc kHZKJi7dyuOXr8nqIU2h9aMQnej1a5IDQcy604XqnuzOFI6/FMBkRQj3ViNzbq8zDXH6cT 5k8amnOV9kKXEzBxOuNGkXpQgpP3fs8fXY01c9Kf0dDnvT/3bA7W8qmtUzTNLg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728515630; a=rsa-sha256; cv=none; b=J+wM4Mjq+TnhnhH8A/lrRURQZRYwlhls3qCy4e7kqe8PoTHaeMWC1nTrVZXrJKXs0I85aZ ZHLpZSSUeg5TK2L/4b4xNrt0XY/pzTIbf+zANB2kAae9dCYhUf1OEEeL1T05uH6dGtr6hH hwlxZdM4J9J4lgtz153xSb77xZwkMYg5IMzHkvCj1/VvDlc1sLIWqy+brAHwE7OOXKbeWe Pu+I/baYSFiaUneyxnITc4sXd1G4BNeCWMlB/vRg8fH1rJn65z0C0lCZigOxibHn24DvIV E0vWRA0euD/aLk2cBYc3Y65eUVFtCyzp4CVUl7dhGkfkqTkWFqjiPD8FcL6raA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XP7xB1ckgzZJY; Wed, 9 Oct 2024 23:13:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 499NDotC044955; Wed, 9 Oct 2024 23:13:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 499NDoXS044952; Wed, 9 Oct 2024 23:13:50 GMT (envelope-from git) Date: Wed, 9 Oct 2024 23:13:50 GMT Message-Id: <202410092313.499NDoXS044952@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" <bz@FreeBSD.org> Subject: git: a92626b33e17 - stable/14 - linux80211: fix default deflink.rx_nss List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a92626b33e171489e5f440644d1429297b4be573 Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a92626b33e171489e5f440644d1429297b4be573 commit a92626b33e171489e5f440644d1429297b4be573 Author: Mikhail Pchelin <misha@FreeBSD.org> AuthorDate: 2024-09-06 18:04:52 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2024-10-09 19:19:21 +0000 linux80211: fix default deflink.rx_nss Native Linux implementation sets this as a maximum between 1 and ht/vht/eht rx SS'es, FreeBSD does the same, but uses 0 as a minimum, which leads setting it to 0 if we're not in ht/vht case. This 0 was breaking rtw89 driver, when it was trying to determine SS number by subtracting 1 from rx_nss and passing the value to the hardware. After this patch rtw89 association and simple ping work reliably, but more work is needed to make the driver robust with heavy traffic (iperf3) and being long idle. Reviewed by: bz Sponsored by: Future Crew LLC Differential Revision: https://reviews.freebsd.org/D46528 (cherry picked from commit f5a58c2da23930ee4870f2eb54788f4669b9aa33) --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 34e40b961bed..56bc9252511a 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -348,7 +348,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN], sta->deflink.smps_mode = IEEE80211_SMPS_OFF; sta->deflink.bandwidth = IEEE80211_STA_RX_BW_20; - sta->deflink.rx_nss = 0; + sta->deflink.rx_nss = 1; ht_rx_nss = 0; #if defined(LKPI_80211_HT) From nobody Thu Oct 10 09:11:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPPBn3dW4z5Yj6N; Thu, 10 Oct 2024 09:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPPBn1mFzz4mZQ; Thu, 10 Oct 2024 09:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0nU62IDd2pKtchuA0qtMb8e+0UqhvcNvtWAghK1Ec0w=; b=I1m/9Aza1AGFkTei7a2hpLPzwAEsNvsMSByru3Sy8BAcouTkrkm31nJS3c+31BRfOe3vG4 f+OBG23WXHJNaMpNofcOlONKCx5LKcvAyknacBeEdbmYyWne8Y+fKG16qPFWl0GkUtMtrP f9RdoG8SCM/B0ddwImx4McOt3nECjrzuVTGNLq8uZyMkpzJpM6F81yLjXZW+J+7KFeQf// y6LsptdZ6RKeUr24ovbTt9aM6zfAtxoOQ5/iGfaMisNftBI1mpXzqrDk9qXRnUml9pl3H2 W/UIl9j/+WbcThPxQiqRYZvLIgHMBIK8GRF3r3yzqm5UKUFVHPML5JYZ5DBS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0nU62IDd2pKtchuA0qtMb8e+0UqhvcNvtWAghK1Ec0w=; b=k93Jg4gqb0Qon5/DR7+VX1TemxsYvEjIFAvi3Kz/y7ShkSh99upFNXG7iQ/SxZlv/cLp0o n1xjBHOsniItUwz+lFsery4Ng9Vo2ChXCwFtOd0suIsHYIY8fEACvRjdr04lVc44/oNAl4 APX/CTYPxGUFMpJcR8y2OAbwTlJhJwr68u3sJPjeKLIJ1l4V6NKc4KU8jsEbI3aOlPbm3m 8z1n3Qjby6Ge3CXhAd3woUBIQrGAw5T15EWZpauW3vBtgm4mGqhKqNdZ/sMahg6L9YmPOY /x7vIUMCGJqZy+R0IGHhLEgArRRYA8Q313bcpQV9Qt+aE0WK0nnM9/YU46wDHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728551489; a=rsa-sha256; cv=none; b=DGtqhl9GyQik1Z+5oMYbvbYmiKV46XrHbeVPCMN6tECTjLorWEnQdw1EAIznsm+YOcHkGX 29DXPloMZ1OBNgNxOd83hheBMVZXOuCUF1F5iIXFApWB2TRKnajYaze66D1LH2cYLWRd6A 7rANZzHaZkq5k1nfbLK7nbVz92zry9K/xA9mhXJPzLN5X1JWsnn8IguBZgtEG2ZxcmcMEs n+kGyHqHDMFZuHqLYREtSrEl24j9375R5uZgBQUhkiHPPGliC/OM4xOo4bCAJE3NZsoSEI QS8W0WxxLmbgrlfGhFReMK3wXTfhhm/fhX5/dFq+S3F7Tpz56XGw1/J6IZNz3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPPBn1Mh4zrbJ; Thu, 10 Oct 2024 09:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A9BTlN063918; Thu, 10 Oct 2024 09:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A9BTbU063915; Thu, 10 Oct 2024 09:11:29 GMT (envelope-from git) Date: Thu, 10 Oct 2024 09:11:29 GMT Message-Id: <202410100911.49A9BTbU063915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 90f2414a0002 - stable/14 - sysctl.3: Remove KERN_QUANTUM List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 90f2414a000294685cb06d2ffe683004be5152e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=90f2414a000294685cb06d2ffe683004be5152e3 commit 90f2414a000294685cb06d2ffe683004be5152e3 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-09-27 03:00:40 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-10 09:10:32 +0000 sysctl.3: Remove KERN_QUANTUM (cherry picked from commit 2918dbc1ccd899865fc6e5854fc056800617944f) --- lib/libc/gen/sysctl.3 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index c2d43cc4e49c..4a9659947f06 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -348,7 +348,6 @@ information. .It Dv KERN_OSTYPE Ta string Ta no .It Dv KERN_POSIX1 Ta integer Ta no .It Dv KERN_PROC Ta node Ta not applicable -.It Dv KERN_QUANTUM Ta integer Ta yes .It Dv KERN_SAVED_IDS Ta integer Ta no .It Dv KERN_SECURELVL Ta integer Ta raise only .It Dv KERN_UPDATEINTERVAL Ta integer Ta no @@ -474,9 +473,6 @@ implies the current process. .It Dv KERN_PROC_ARGS Ta "A process ID" .It Dv KERN_PROC_PATHNAME Ta "A process ID" .El -.It Li KERN_QUANTUM -The maximum period of time, in microseconds, for which a process is allowed -to run without being preempted if other processes are in the run queue. .It Li KERN_SAVED_IDS Returns 1 if saved set-group and saved set-user ID is available. .It Li KERN_SECURELVL From nobody Thu Oct 10 09:11:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPPBp3MdZz5YjDy; Thu, 10 Oct 2024 09:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPPBp2mvLz4mTc; Thu, 10 Oct 2024 09:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mShvvAVlwoRLN1xauHZ69vnSLdp5JgFz08ZLgZ13QcQ=; b=ja3zhfXsY+QXt6LxHx5qV9NMAWACU6FfM6AqjH387tMixnrU7fP4LCiZIfcQGhJvjuHV+2 qln72cX1cwt9G5YbWVGwHtMEX/R0chGb+OQs+JsYBZISIiSDkQ+213/h8tHX8HQ8VXEWLG 4LPIwpluRIfLkSTkuTpoOzK55X/WoZgBQmOCkfCAu0RSeeZ8U96WuMia3HadrJooOBWbgy HHayleeu9ru0c/B/q1Z8ck/Ao4zx+vN+Uxqhvl5ecE9NNkb486275TsUcoa2WKEFT+O5Jo FxKf7UD3XOxiJclkKdKYLOV6A0e55gBmqmq6gniZxH5rBmhmwzyH8/wRf45RLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mShvvAVlwoRLN1xauHZ69vnSLdp5JgFz08ZLgZ13QcQ=; b=u67XYV5Ir+l03dYzksdBJkGUGJ828t9M2RKh4PQAsrxYJKXQaAQmT46ntKbqO9iWSfbxfs ABSitNMJWt8pR5uWmagkYaomcVEVHqrZX5tIsJCUk7vqcqusqF0GXPmL8CtuLkGHjsidcd 8DUN+7iDLdeX5z5w7mafoRDzL5h41xKFX6HfQaXodFecAYPPXkoKuuDhQ/n14eKIKTbB5m sTfIT5T6RcAvp2fq3P0Bb8+0brLddi0sNU47oM/tV8DDpWEDXO2wOHKCFdQ270FVwFAimP rJeoq2Dhd6eC8PwlMixu8w+KAIqxkZUFdh7eR8EEA2CpBXrBz/xRz6dvDG7OFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728551490; a=rsa-sha256; cv=none; b=u/j+FsOf5f/s/MYpjXzRM5k0+TqwBjTYCujNizN+eWeIsBU9x5t6qLPtI1DG39lpnTntId ICjBzfoZgHkrG5+4YFUA9/kxW3Z6OU1Qvdqtf2b4CjWJwLpwraAQocUlkYEiMvO4m/w/aJ SUpK9fg3WsuL+AIt8J2fJJv/1AnJpPWa8FUiN3aRhl21gaTMKfFmeD9Vve9XZc2ng4nd9B LeudI7AU0GclMaSO28GCICI6v1oX61S8lq307uHn+IhiEOp+GTTsEiJj/d9bCJ/BJaQZFT fPW5WNkVvR1+/OE/uv+liej5yB+DbWPQFdCv2nSHxruiTQ8Njo9B2rNGOjdqpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPPBp2NXKzs4t; Thu, 10 Oct 2024 09:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A9BUIf063972; Thu, 10 Oct 2024 09:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A9BUdh063969; Thu, 10 Oct 2024 09:11:30 GMT (envelope-from git) Date: Thu, 10 Oct 2024 09:11:30 GMT Message-Id: <202410100911.49A9BUdh063969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 387094ca8a8c - stable/14 - sysctl.3: document missing fixed oids from the kern. node List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 387094ca8a8c94d45d78b24313d2e7f70b60361e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=387094ca8a8c94d45d78b24313d2e7f70b60361e commit 387094ca8a8c94d45d78b24313d2e7f70b60361e Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-09-27 03:08:09 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-10 09:10:32 +0000 sysctl.3: document missing fixed oids from the kern. node (cherry picked from commit 4e2803878f547f2036d8e9bde4633e0ed96bc46c) --- lib/libc/gen/sysctl.3 | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 4a9659947f06..485cd7b455e4 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -327,6 +327,7 @@ information. .Bl -column "KERNXMAXFILESPERPROCXXX" "struct clockrateXXX" -offset indent .It Sy Second Level Name Ta Sy Type Ta Sy Changeable .It Dv KERN_ARGMAX Ta integer Ta no +.It Dv KERN_ARND Ta integer Ta no .It Dv KERN_BOOTFILE Ta string Ta yes .It Dv KERN_BOOTTIME Ta struct timeval Ta no .It Dv KERN_CLOCKRATE Ta struct clockinfo Ta no @@ -334,9 +335,13 @@ information. .It Dv KERN_HOSTID Ta integer Ta yes .It Dv KERN_HOSTUUID Ta string Ta yes .It Dv KERN_HOSTNAME Ta string Ta yes +.It Dv KERN_IOV_MAX Ta integer Ta yes .It Dv KERN_JOB_CONTROL Ta integer Ta no +.It Dv KERN_LOCKF Ta struct kinfo_lockf Ta no +.It Dv KERN_LOGSIGEXIT Ta integer Ta yes .It Dv KERN_MAXFILES Ta integer Ta yes .It Dv KERN_MAXFILESPERPROC Ta integer Ta yes +.It Dv KERN_MAXPHYS Ta integer Ta no .It Dv KERN_MAXPROC Ta integer Ta no .It Dv KERN_MAXPROCPERUID Ta integer Ta yes .It Dv KERN_MAXVNODES Ta integer Ta yes @@ -348,15 +353,28 @@ information. .It Dv KERN_OSTYPE Ta string Ta no .It Dv KERN_POSIX1 Ta integer Ta no .It Dv KERN_PROC Ta node Ta not applicable +.It Dv KERN_PS_STRINGS Ta integer Ta no .It Dv KERN_SAVED_IDS Ta integer Ta no .It Dv KERN_SECURELVL Ta integer Ta raise only .It Dv KERN_UPDATEINTERVAL Ta integer Ta no +.It Dv KERN_USRSTACK Ta integer Ta no .It Dv KERN_VERSION Ta string Ta no .El .Bl -tag -width 6n .It Li KERN_ARGMAX The maximum bytes of argument to .Xr execve 2 . +.It Li KERN_ARND +.Xr arc4rand 9 +Fills the buffer with random bytes from in-kernel random data generator. +This is an alternative interface for +.Xr read 2 +of +.Xr random 4 +device, which does not depend on accessibility and correct mounting options +of the +.Xr devfs 4 +node. .It Li KERN_BOOTFILE The full pathname of the file from which the kernel was loaded. .It Li KERN_BOOTTIME @@ -381,8 +399,18 @@ Get or set the host ID. Get or set the host's universally unique identifier (UUID). .It Li KERN_HOSTNAME Get or set the hostname. +.It Li KERN_IOV_MAX +The maximum accepted number of elements in an input-output vector (iovec), +see +.Xr readv 2 +and +.Xr writev 2 . .It Li KERN_JOB_CONTROL Return 1 if job control is available on this system, otherwise 0. +.It Li KERN_LOCKF +Returns the list of the file advisory locks currently known to kernel. +.It Li KERN_LOGSIGEXIT +Controls logging of process exit due to untrapped signals. .It Li KERN_MAXFILES The maximum number of files that may be open in the system. .It Li KERN_MAXFILESPERPROC @@ -391,6 +419,10 @@ This limit only applies to processes with an effective uid of nonzero at the time of the open request. Files that have already been opened are not affected if the limit or the effective uid is changed. +.It Li KERN_MAXPHYS +Specifies the maximum block I/O size. +Can be changed by the tunable +.Ev kern.maxphys . .It Li KERN_MAXPROC The maximum number of concurrent processes the system will allow. .It Li KERN_MAXPROCPERUID @@ -473,12 +505,18 @@ implies the current process. .It Dv KERN_PROC_ARGS Ta "A process ID" .It Dv KERN_PROC_PATHNAME Ta "A process ID" .El +.It Li KERN_PS_STRINGS +Reports the location of the process +.Vt ps_strings +structure after exec, for the ABI of the querying process. .It Li KERN_SAVED_IDS Returns 1 if saved set-group and saved set-user ID is available. .It Li KERN_SECURELVL The system security level. This level may be raised by processes with appropriate privilege. It may not be lowered. +.It Li KERN_USRSTACK +Reports the top of the main thread user stack for the current process. .It Li KERN_VERSION The system version string. .El From nobody Thu Oct 10 09:11:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPPBq5YX1z5YjNB; Thu, 10 Oct 2024 09:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPPBq3qJRz4mkh; Thu, 10 Oct 2024 09:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9EozY0ilxghL9vSet9zuS4Ul/vOnInWTEQroOeSsPI=; b=BpkYlgg9n98kz+2b3pvGY5z3G6yrI9aksG1J27WCY+dh2zVvMh6VY+uQ8iClxvXVMfktvM hTn4WTiFd7FN64F6gPjjQeo9ugKH+qca3DdJMQLuxfohzMLxxAS2Avy5dOQd/xmot//PDU eisGHvCnxNKhj+2U0y3XMsUvpZAZFgnxRJSZI8mbD+446PP9BVjDJUS7hocqwXhHIzgk/q UiMqM0NHdBlXhFi4mIQnvoUiQJZqKQSUQZqx3g4UFcPBHxE6YdpjFiAfmLXG1JRneD6epy WnsN4aZqNLCvv7b6wwtY/jlET1SPoRBelYeOgLobp/PURcha7d3g6x5lktpNHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551491; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9EozY0ilxghL9vSet9zuS4Ul/vOnInWTEQroOeSsPI=; b=FltD7dkGjGwGe+0Aeo/0BRYXGxLaGhlUnvkZkAPVSBHAjhiPyJZ+DR27wXoA4apyLHGHQ8 zlG3wId3EprZJXUyH7QM2xBWtsvRWqup8V3mFJ5XlTOAG1d+ortSyWETpmmxOtLBL9XxuC GumoUdYWTnS1ubQGf2vi2RwQnmHmGh8+BB1R3DglAdIXyQ4hdJXqicpW+V7EyqvengCqHg 7cEpdFJxoKKCJo8KEKUm972n9HuzPlbYNyWL+pgrKu0fAd2PVsNNrk6Kzrd6yWhYRx108e ArVPQPZ1cHB+Y/pIHubsCQIFDX5UX8dE71r781ssMB2r9uKRPCwcPiim0vQxtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728551491; a=rsa-sha256; cv=none; b=hFKef1SZNHPDJr1AIKiJLAtDPP5qYgTT2Ao7qiie7eGGOCMcr8gfLAXUqoxx3BUaODS2Ll /GYriE7UCrZWsLfpNRPP3UL/Gu1ia6Cy49cXEUkvjbgQN0BOfgo77P01+hRxP+wKoFpLVC FG9hXo/GEvpvm+649O3UKdzWsNxaUQCMlnbUN8RQs/6f8TZlc9pf1tcsSWlVNuy44GwJbr j6q462EwRAZ776RpEswIkemzgPcRn65IuZVfq8QFBo5eiOh5EG8H6tD/vSvI+FWgcyutru oaoDqMhQ0DH5a0BVtCGoNnrgBhw/KG7muTdcjQLFJob9+wnSUACYpOS/8xFRUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPPBq3PD3zrYc; Thu, 10 Oct 2024 09:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A9BV3P064022; Thu, 10 Oct 2024 09:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A9BVJL064019; Thu, 10 Oct 2024 09:11:31 GMT (envelope-from git) Date: Thu, 10 Oct 2024 09:11:31 GMT Message-Id: <202410100911.49A9BVJL064019@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: d19c86f203da - stable/14 - sysctl.3: document missing oids from kern.proc. node List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d19c86f203da8ed0adf6bcf1b98ebe8378b80309 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=d19c86f203da8ed0adf6bcf1b98ebe8378b80309 commit d19c86f203da8ed0adf6bcf1b98ebe8378b80309 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-09-27 03:32:15 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-10 09:10:33 +0000 sysctl.3: document missing oids from kern.proc. node (cherry picked from commit cdd9629921c6551abac583aeafc5c6bd380ccac2) --- lib/libc/gen/sysctl.3 | 114 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 98 insertions(+), 16 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index 485cd7b455e4..836b52128ada 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -479,31 +479,113 @@ whose size depends on the current number of such objects in the system. .It Dv KERN_PROC_ALL Ta None .It Dv KERN_PROC_PID Ta A process ID .It Dv KERN_PROC_PGRP Ta A process group +.It Dv KERN_PROC_SESSION Ta A session .It Dv KERN_PROC_TTY Ta A tty device -.It Dv KERN_PROC_UID Ta A user ID +.It Dv KERN_PROC_UID Ta An effective user ID .It Dv KERN_PROC_RUID Ta A real user ID +.It Dv KERN_PROC_GID Ta An effective group ID +.It Dv KERN_PROC_RGID Ta A real group ID .El .Pp -If the third level name is -.Dv KERN_PROC_ARGS -then the command line argument +For the following names, the miscellaneous information about the target +process, which is specified by the fourth level of the oid name, +is returned. +A process ID of +.Li \-1 +specifies the current process. +.Bl -column "Third Level NameXXXXXX" "TypeXXXXXX" -offset indent +.It Sy Third Level Name Ta Sy Fourth Level +.It Dv KERN_PROC_ARGS Ta "Set of strings" +.It Dv KERN_PROC_PATHNAME Ta "String" +.It Dv KERN_PROC_KSTACK Ta "struct kinfo_stack []" +.It Dv KERN_PROC_VMMAP Ta "struct kinfo_vmentry []" +.It Dv KERN_PROC_FILEDESC Ta "struct kinfo_file []" +.It Dv KERN_PROC_GROUPS Ta "gid_t []" +.It Dv KERN_PROC_ENV Ta "Set of strings" +.It Dv KERN_PROC_AUXV Ta "Elf_Auxinfo []" +.It Dv KERN_PROC_RLIMIT Ta "Integer" +.It Dv KERN_PROC_RLIMIT_USAGE Ta "rlim_t []" +.It Dv KERN_PROC_PS_STRINGS Ta "Integer" +.It Dv KERN_PROC_UMASK Ta "Integer/short" +.It Dv KERN_PROC_OSREL Ta "Integer" +.It Dv KERN_PROC_SIGTRAMP Ta "Integer" +.It Dv KERN_PROC_CWD Ta "String" +.It Dv KERN_PROC_NFDS Ta "Integer" +.It Dv KERN_PROC_SIGFASTBLK Ta "Integer" +.It Dv KERN_PROC_VM_LAYOUT Ta "struct kinfo_vm_layout" +.El +.Pp +.Bl -tag -compact +.It Dv KERN_PROC_ARGS +The command line argument array is returned in a flattened form, i.e., zero-terminated arguments follow each other. The total size of array is returned. It is also possible for a process to set its own process title this way. -If the third level name is -.Dv KERN_PROC_PATHNAME , -the path of the -process' text file is stored. -For -.Dv KERN_PROC_PATHNAME , -a process ID of +.It Dv KERN_PROC_PATHNAME +The path of the process' text file is returned. +.It Dv KERN_PROC_KSTACK +The in-kernel call stacks for the threads of the specified process. +.It Dv KERN_PROC_VMMAP +The description of the map entries for the process. +.It Dv KERN_PROC_FILEDESC +The file descriptors for files opened in the specified process. +.It Dv KERN_PROC_GROUPS +Groups associated with the process. +.It Dv KERN_PROC_ENV +The set of strings representing the environment of the specified process. +.Pp +Note that from the kernel point of view, environment exists only at the +time of +.Xr execve 2 +system call. +This node method tries to reconstruct the environment from the known +breadcrumbs left in the process address space, but it is not guaranteed +to succeed or to represent the current value as maintained by the program. +.It Dv KERN_PROC_AUXV +The set of ELF auxv entries. +See the note above about environment, which is also applicable to auxv. +.It Dv KERN_PROC_RLIMIT +Additinal OID name element must be supplied, specifiing the resource name +as in +.Xr getrlimit 2 . +The call returns the given resource limit for the process. +.It Dv KERN_PROC_RLIMIT_USAGE +Like +.Dv KERN_PROC_RLIMIT , +but instead of the limit, returns the accounted resource usage. +For resources which do not have a meaningful current value, .Li \-1 -implies the current process. -.Bl -column "Third Level NameXXXXXX" "Fourth LevelXXXXXX" -offset indent -.It Sy Third Level Name Ta Sy Fourth Level -.It Dv KERN_PROC_ARGS Ta "A process ID" -.It Dv KERN_PROC_PATHNAME Ta "A process ID" +is returned. +.It Dv KERN_PROC_PS_STRINGS +Returns the location of the +.Vt ps_strings +structure at the time of the last call to +.Xr execve 2 +in the specified process. +.It Dv KERN_PROC_UMASK +The current umask value, see +.Xr umask 2 . +.It Dv KERN_PROC_OSREL +The value of osrel for the process, that is the osrel the currently executed +image was compiled for. +Read from the note of the elf executable at +.Xr execve 2 +time. +Might be modified by the process. +.It Dv KERN_PROC_SIGTRAMP +Address of the signal trampoline in the process address space, +where, simplifying, the kernel passes control for signal delivery. +.It Dv KERN_PROC_CWD +Returns the current working directory for the process. +.It Dv KERN_PROC_NFDS +Returns the total number of opened file descriptors for the process. +.It Dv KERN_PROC_SIGFASTBLK +Returns the address of the +.Xr sigfastblock 2 +location, if active. +.It Dv KERN_PROC_VM_LAYOUT +Fills a structure describing process virtual address space layout. .El .It Li KERN_PS_STRINGS Reports the location of the process From nobody Thu Oct 10 09:11:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPPBr5hnjz5YjHc; Thu, 10 Oct 2024 09:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPPBr4mqgz4mV5; Thu, 10 Oct 2024 09:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pGsuLxWwVqM2q7wc1N3u5cCvlmfzV3UJNNdAYrMCgmo=; b=SMZp8k6FtYYVBdckpQeKaD3Rxgt5HkXqr5cGRWzznw4EQFxXYzaqz/m4ORtOwBHOthLcYe So5U8mIjx8b6tKUf/AY1oG7aBtQL/mplirJcegIOW1JJYPjI2VhZDPjoNCgBNJIPIISZqg kZBLj8tvjByaek4ncuqVIcu5LO8KPC/FpodVps6atXmnQzCeey+CAl+lYgFjSflhYBaFHs G9NCnKwse/kpdkoo/752H+Si0ldmYJQZszpcWdiU2+6NXrs1B9uj3HLMsSbsr+9gyYx/qK /qnG4aVbUjnYKS6B0phHvUi2khW5Oxvk6VVhJh6Q3VjTFCeR7gmPjKuSFB98xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pGsuLxWwVqM2q7wc1N3u5cCvlmfzV3UJNNdAYrMCgmo=; b=h8INrlrtS/dCznTAMEoXvB4g9AJD1PlylqJFWh6EEvWdb7fH347LP4AQTXgGqooavdjSSz tYgjx4giehLShH1jWbM5WXgFSpUayYAEV5d4CtryIovp9ZhyCws/aFWHyN7EGwQ+MsMLYT dPbaJzlwrA5AUd0cl1Act0f9Bal8CyiSn+Zmube1MOukDyj5oIYkR7Zd+Dh75DeCSu23o7 lR2kkV7BgHV4QZDcrfeZk160i23C3wNKLWZZd3dYF8iMbHbW3au3/jdtN8QzA5uLPvRmjC J+gfmIBaHVFjwIFqqWVPA55/Ebs/VjffCYWV8v6Rv8Ksmg9OEKYTEtMoToUKZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728551492; a=rsa-sha256; cv=none; b=BSIoSUc00+4+FByK+VKX03Sm970TyDLE93gRGZRMDZ9/h29SilkXo9kJkwsQPy2LrdxJH3 t+JxCmVMlDQFhVWj+sgGvhoMR3H0oQaDxOvzvgu0GDwN0jvIUACB7TLvGHVtfqk0YhPpqh j2Dc+fmmAuVgO7ts8Zp6kzLb1lkwFJfcJCbAuCVsm4xs9ZSmrIlfVid1y8css1+FKW1me8 dXEudG4xfKUTXHfR6CeuVrXYfgDSzx/uomdRSGoyBllrJ8RW+Sv4cpISBAK1W8hpXqWnG2 hB5BR4wEIvNH+T9fhodlMvQgEqCS9p1U+w2GTrPQs7aRrKShFIZSUCkE0E7a1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPPBr4McLzrYd; Thu, 10 Oct 2024 09:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A9BWqO064071; Thu, 10 Oct 2024 09:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A9BWYW064068; Thu, 10 Oct 2024 09:11:32 GMT (envelope-from git) Date: Thu, 10 Oct 2024 09:11:32 GMT Message-Id: <202410100911.49A9BWYW064068@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 27af5dad16cb - stable/14 - getrlimitusage.2: add the man page List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 27af5dad16cbce2b081c01a410a1449288444394 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=27af5dad16cbce2b081c01a410a1449288444394 commit 27af5dad16cbce2b081c01a410a1449288444394 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-09-27 19:12:21 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-10 09:10:33 +0000 getrlimitusage.2: add the man page (cherry picked from commit 3670421e21932c44225b9457c50dd67da3abcd84) --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/getrlimitusage.2 | 100 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 4e3ac43b2b80..33c0b9711d46 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -216,6 +216,7 @@ MAN+= abort2.2 \ getpriority.2 \ getrandom.2 \ getrlimit.2 \ + getrlimitusage.2 \ getrusage.2 \ getsid.2 \ getsockname.2 \ diff --git a/lib/libc/sys/getrlimitusage.2 b/lib/libc/sys/getrlimitusage.2 new file mode 100644 index 000000000000..2e3dc744ab23 --- /dev/null +++ b/lib/libc/sys/getrlimitusage.2 @@ -0,0 +1,100 @@ +.\" Copyright (c) 2024 The FreeBSD Foundation, Inc. +.\" +.\" This documentation was written by +.\" Konstantin Belousov <kib@FreeBSD.org> 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 AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd September 27, 2024 +.Dt GETRLIMITUSAGE 2 +.Os +.Sh NAME +.Nm getrlimitusage +.Nd Query usage of the current process' limited resources +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/resource.h +.Ft int +.Fn getrlimitusage "unsigned which" "int flags" "rlim_t *res" +.Sh DESCRIPTION +The +.Nm +system call allows the process to query current consumption of the resources +limited by the +.Xr setrlimit 2 +call. +.Pp +The +.Fa which +argument specifies the resource, same as for +.Xr getrlimit 2 +and +.Xr setrlimit 2 +calls, see their man page for the list of enforced resource types. +.Pp +The +.Fa flags +argument modifies the behavior of the call in the following ways: +.Bl -tag -width GETRLIMITUSAGE_XXXXXX +.It Va GETRLIMITUSAGE_EUID +Query the resource usage for user identified by effective UID of the process, +instead of the real UID (which is default for accounting). +.El +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The +.Fn getrlimitusage +system call will fail if: +.Bl -tag -width Er +.It Bq Er EFAULT +The address specified for +.Fa res +is invalid. +.It Bq Er EINVAL +The resource specified to +.Fn getrlimitusage +in the +.Fa which +argument is unknown. +.It Bq Er ENXIO +The resource specified to +.Fn getrlimitusage +in the +.Fa which +argument is not accounted, but only enforced in specific situations. +Examples of such resources are +.Va RLIMIT_FSIZE +and +.Va RLIMIT_CORE . +.El +.Sh SEE ALSO +.Xr procstat 1 , +.Xr getrlimit 2 , +.Xr setrlimit 2 . +.Sh HISTORY +The +.Fn getrlimitusage +system call appeared in +.Bx 15.0 . From nobody Thu Oct 10 09:11:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPPBt2xy9z5Yj8l; Thu, 10 Oct 2024 09:11:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPPBs5p33z4mb3; Thu, 10 Oct 2024 09:11:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dwvc6kY2emnv1907Ah5TAE1RuyMeqXYc1KQRtBkG++s=; b=xWIwVfe+bKbGphYQr6uRh5XHqTci8WqlqDN7WjvsakziGaHkA1FLx+DkIXdthiw/nErUm7 CQu5BJhVSfgACQSZV0Ldy1dQGnaRgoVxuqtWAbLPJhugRnFsiPhnzNtAq4kt3BiVaw7Yha t3PkhFFt3gqmU9xy0BaqAgskIH5wV2sDdnBOIBHlmpiMkBGegdBtn5nqZthD/hidnJ2XB4 I2JkRXWeeOtStE1GQbLPRecFCeQyJbEQgb6dYEcMEAfTxSkeZ5lWUBoUHFzyqhO6qYFviB PJjMfw/F/bc7ig45JbsMHK34mvoXkEtLMXKBrsuhz5lQo7STxH1MxQpV2dnawQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728551493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dwvc6kY2emnv1907Ah5TAE1RuyMeqXYc1KQRtBkG++s=; b=fiPiMuKlLf1pP6jXaqQMwj9AvJI2jVxmShwnUgVrl4dCWaYJ9L6ptsgGFtp63KTeyAxT/0 D8VrxLXzEzFUwSxlrC33EuUxYcaPxLkjUitidjGRIs8kau/xZO1SoT3u1+OCZxWg6GUs/P WWU+KVuhkYhnBkHSeEQ5zTAfAOyRzO5Z9hkFSVB+SgxgFuW8msGDdnG9oeDZbkjC6dVKUM Al95NrBlc4oS84hw/iUb4ms9w2RqWAyQiz6niu6V55DFtPWgKFZ8HMcjvFtXmd+woCOaST jlywAwYuoLkE9qk0ZUrXW2FLvWtJrGSFE+KU94tRba7JyUouDEz0hjTYrIMozw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728551493; a=rsa-sha256; cv=none; b=jk4Z/Dj71wqFTrJR8R9RlUbVRS1m/XBgJe0TGmugAwJ7zkSH2dFRr1WqRbDf9WtQRHkkpx UmTA3yT69Fyq1lfd1M/xGRx2cBfq5uvLOFdQnVxfp12x4N4xWdrYzfufea85CSpVWlRXjM CMSczCwBKuZkgfrvnhxFMyYTo6oZgIHGJUcJSonbA4JKigrX+iRYs7G55eofOsLmuXKhFI 6akBUtQmkZk0YDsWth9LeR13q71qCNLZ/Qu7YB1XCwV316tnRZ5bIksjFB8lqCuPAhid97 m0f0a9+VtvKu/4R6WKsojKV7yml3Mnx3YCE//syUZpDcyiS/gKgqPyg5Knw+Zg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPPBs5N8wzrwM; Thu, 10 Oct 2024 09:11:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A9BX1R064122; Thu, 10 Oct 2024 09:11:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A9BXhJ064119; Thu, 10 Oct 2024 09:11:33 GMT (envelope-from git) Date: Thu, 10 Oct 2024 09:11:33 GMT Message-Id: <202410100911.49A9BXhJ064119@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov <kib@FreeBSD.org> Subject: git: 8952296684ab - stable/14 - iommu_qi_seq_processed: use atomic to read hw-written seq number List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 8952296684ab0b0ec7800338c3dd3f42333547b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8952296684ab0b0ec7800338c3dd3f42333547b2 commit 8952296684ab0b0ec7800338c3dd3f42333547b2 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-10-03 03:51:20 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-10 09:10:33 +0000 iommu_qi_seq_processed: use atomic to read hw-written seq number (cherry picked from commit eb8326421e6b35b0dee1a8db669914a97bce5cdf) --- sys/x86/iommu/iommu_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 8ff15cc86cb8..db8f94eb584f 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -350,8 +350,8 @@ iommu_qi_seq_processed(struct iommu_unit *unit, x86c = IOMMU2X86C(unit); gen = x86c->inv_waitd_gen; - return (pseq->gen < gen || - (pseq->gen == gen && pseq->seq <= x86c->inv_waitd_seq_hw)); + return (pseq->gen < gen || (pseq->gen == gen && pseq->seq <= + atomic_load_64(&x86c->inv_waitd_seq_hw))); } void From nobody Thu Oct 10 10:03:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPQLf5Df9z5Ympt; Thu, 10 Oct 2024 10:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPQLf4Y5mz4sTg; Thu, 10 Oct 2024 10:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LuHvfl5opN5E9N5BbEXavgmnes8iGhd5iS9OMyr73Rc=; b=iUJwlkKCtJj4NMDfrYX2QM+P5QdL99A0gQUoxvSU1h6UpU8bxbfjfOW4bAKoxT+GaGPR9i 5UChqqOsChMLeJZXo+LLwjyHCo8WdGhczLStfguZmCKD1HCTK4/N3lU2+VvMBKRo8/JRNT BpHfzjhk2cPSqVXdMRt69uoS6GscUkHL8VQTeH32uIMWgZrI9hv2LeS3O1wzIPC92mcFA0 tGUVI9DvZljv59a5rKCpnQbydqArSrSECxi9VtwCq+hUcXjppRuAfL1N1iUoBdBrH94mJz lg7M0xjbUm9Pd+M3bltwwYKLjDA+jMJs5N/3CiYQI3+JVgv4rtBm41OB7Vlb6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LuHvfl5opN5E9N5BbEXavgmnes8iGhd5iS9OMyr73Rc=; b=kZon/edl+uxPc6dCpJyshNTI5+xLtwzBwjsajV1fao0WIv4UsnHtZIh4v1HYH/OHKa7hHo 1+0PLXmHU6waIGaW8GwfryyHlqbzon0rzYnvuusmk89o/sz/4A67wDY3XR4l4YAQWDNKuS wDL+iy2bBlPC/lhgAkTCa32YgXhBMndoMUUK1tBjQpcHuJKD3iJ3Iy7mnYSeFfMt5GjRgk pjVPrD943/Pt1cVGrb36dCD97yV3/f/uH/i3fRGMh98l+G/7M80cNWTL+rUNhMI5n6hxOD QYSBtyYBu8WV0CqlqLLbg6XFUz3iU9rbcpPxK6Ux9Uez7KFE5dPkibtxl4rpug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728554602; a=rsa-sha256; cv=none; b=w2hA7/XacwNCjMLczf3Acehet1sseG4Kv6fM3rI/bra7z9YZtrFFc70pnzvq4/TKa6n6dL BplEbQ6xyKTAMcV/mOTMXmUXsyFDLEs9Xtr2rDHICebAWjNZOdtNrrTdE1IL8GSc55olD1 ugzuAUp7kZkgnTD0yLrRczOS1LjCoFKPqQHoSd2dTMdnAM8J7SL0Q+LLgXayQk7DQx15Th XmFrWei8Az+oFw1BzszxtLTlLbH1W4DgaePZmYFb47oSg4OFIO/jxEbEKGyH90hVeC+e1Y DyuG/LHmAcerOWD0JtmLfauHra2uclqhiWdU5xTu2O7w1SYbi4x81uvMFydnFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPQLf3rlYzt25; Thu, 10 Oct 2024 10:03:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AA3MbF052649; Thu, 10 Oct 2024 10:03:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AA3M70052646; Thu, 10 Oct 2024 10:03:22 GMT (envelope-from git) Date: Thu, 10 Oct 2024 10:03:22 GMT Message-Id: <202410101003.49AA3M70052646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 7afcdd13a49c - stable/13 - ifnet: allocate index at the end of if_alloc_domain() List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7afcdd13a49c50c5c2396543ddeba1c283202eb7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7afcdd13a49c50c5c2396543ddeba1c283202eb7 commit 7afcdd13a49c50c5c2396543ddeba1c283202eb7 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2021-12-04 17:49:35 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-10 10:00:47 +0000 ifnet: allocate index at the end of if_alloc_domain() Now that if_alloc_domain() never fails and actually doesn't expose ifnet to outside we can eliminate IFNET_HOLD and two step index allocation. Reviewed by: kp Differential revision: https://reviews.freebsd.org/D33259 (cherry picked from commit 8062e5759cb4886ad4630d52c212d8ca77ef9c95) --- sys/net/if.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 78da7cf02bfb..4182f22c848e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -323,13 +323,6 @@ struct sx ifnet_detach_sxlock; SX_SYSINIT_FLAGS(ifnet_detach, &ifnet_detach_sxlock, "ifnet_detach_sx", SX_RECURSE); -/* - * The allocation of network interfaces is a rather non-atomic affair; we - * need to select an index before we are ready to expose the interface for - * use, so will use this pointer value to indicate reservation. - */ -#define IFNET_HOLD (void *)(uintptr_t)(-1) - #ifdef VIMAGE #define VNET_IS_SHUTTING_DOWN(_vnet) \ ((_vnet)->vnet_shutdown && (_vnet)->vnet_state < SI_SUB_VNET_DONE) @@ -345,13 +338,11 @@ MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); struct ifnet * ifnet_byindex(u_short idx) { - struct ifnet *ifp; if (__predict_false(idx > V_if_index)) return (NULL); - ifp = *(struct ifnet * const volatile *)(V_ifindex_table + idx); - return (__predict_false(ifp == IFNET_HOLD) ? NULL : ifp); + return (V_ifindex_table[idx]); } struct ifnet * @@ -414,6 +405,7 @@ static void ifnet_setbyindex(u_short idx, struct ifnet *ifp) { + ifp->if_index = idx; V_ifindex_table[idx] = ifp; } @@ -602,18 +594,6 @@ if_alloc_domain(u_char type, int numa_domain) else ifp = malloc_domainset(sizeof(struct ifnet), M_IFNET, DOMAINSET_PREF(numa_domain), M_WAITOK | M_ZERO); - restart: - IFNET_WLOCK(); - idx = ifindex_alloc(&old); - if (__predict_false(idx == USHRT_MAX)) { - IFNET_WUNLOCK(); - epoch_wait_preempt(net_epoch_preempt); - free(old, M_IFNET); - goto restart; - } - ifnet_setbyindex(idx, IFNET_HOLD); - IFNET_WUNLOCK(); - ifp->if_index = idx; ifp->if_type = type; ifp->if_alloctype = type; ifp->if_numa_domain = numa_domain; @@ -644,7 +624,19 @@ if_alloc_domain(u_char type, int numa_domain) ifp->if_counters[i] = counter_u64_alloc(M_WAITOK); ifp->if_get_counter = if_get_counter_default; ifp->if_pcp = IFNET_PCP_NONE; - ifnet_setbyindex(ifp->if_index, ifp); + +restart: + IFNET_WLOCK(); + idx = ifindex_alloc(&old); + if (__predict_false(idx == USHRT_MAX)) { + IFNET_WUNLOCK(); + epoch_wait_preempt(net_epoch_preempt); + free(old, M_IFNET); + goto restart; + } + ifnet_setbyindex(idx, ifp); + IFNET_WUNLOCK(); + return (ifp); } From nobody Thu Oct 10 10:03:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPQLg5tkRz5YmM1; Thu, 10 Oct 2024 10:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPQLg4bBMz4sjF; Thu, 10 Oct 2024 10:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpwwadqDy8vmUJma9XrMxriC8mThzCZVM657jegwJ2Y=; b=JonqwTfcoqQUCk8BUnIXdHe70CIPMy0dD0hl1FO2NdgiQPVdTlsDa2smA0iz3a98Urs9WF c12BkorM+Z+c3drM+0tMHASRAFO0IXZ8GuEsPBqrjSlapi8ZL4bqZiCFJ7nLiVicNg+FYk VS5H3358B3udijQ7irxTn7Txsv6hQ+Y1dIV89L0rjcPkf7vgR0gz2tz7/l/PzvxpeYZIBd mKfzMZugf4/TmyoZnW9ORVyrvxSz68AVrZQ067KIdi0cJ4N7CNd1Njm4liK5z5nA+ZJ8Zx YHxvKTeWM/MOHaTWcLO5M2u39ZRuUEcYAtO27Ko11TM55hw5mUS8LpTpuObsYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HpwwadqDy8vmUJma9XrMxriC8mThzCZVM657jegwJ2Y=; b=gsceA5ldDlPxpuy8dH16C0hy3Y+SpixEWSWzkcoEvYp7/rtWCBmNboNI+pQlIBswepnKPP 9ww9I+46nfVZVMvhXh0NM8oyw1NhKwAIEjngePW9kMOcOmfDAKrMgYLDprJUQdSQEnAazW X4aKPf3EjWaoa/JQxZLx/+FdqyUM1HJyTs7i4NhIngMTmAi5H5PxMqVU5Nu5/uItsdKdcb xvi5ldawe9SnyHj/g9iQldGrfqQVCaQJQvRNJCNHcvOC+0BPBYP+xdBqXHho8mxEgzE+zQ +4rDLyuSGvoNZlwHV29DjA/zlJZ253HQ5cAjPYm5vrMUm8bSS4JBsT8XNKvcng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728554603; a=rsa-sha256; cv=none; b=GxhN670E+VjSRQg8FFbwsFwz76gpnZNIqrhd+cduG1J8AyvktKrYzvNTAptuOBkNMKvGPs gJ1KjaRSO0Ii0JTGmW3SlSw6GcbpdW6cd+cSUPoIA9v4Eo6F3fh9LYu56smJ32OEqVnk/d CGXDmmaKCAXMCWIGrf80hISICeibS4O5kUjZbTKhRSDr6kNvOI0oFKjOUa4HNHrhNrjtaL vAfu12YB+YSqTEwRpfAZ935Z46EPxodWLnm60TpBTcilYpc+zoytNcwpDpEtI0mDxhhJR+ 4IDkHGvywN9r8xftk519DQOkHdCeujjQZG1EliPk+VnP3h/8sjgHPeHhz0LocQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPQLg4BbtztH1; Thu, 10 Oct 2024 10:03:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AA3N28052700; Thu, 10 Oct 2024 10:03:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AA3NJ7052697; Thu, 10 Oct 2024 10:03:23 GMT (envelope-from git) Date: Thu, 10 Oct 2024 10:03:23 GMT Message-Id: <202410101003.49AA3NJ7052697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 5a894ac4311e - stable/13 - if_vmove: improve restoration in cloner's ifgroup membership List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5a894ac4311e8c00489be779756b5e03c6e82570 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5a894ac4311e8c00489be779756b5e03c6e82570 commit 5a894ac4311e8c00489be779756b5e03c6e82570 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-01-25 05:06:59 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-10 10:00:47 +0000 if_vmove: improve restoration in cloner's ifgroup membership * Do a single call into if_clone.c instead of two. The cloner can't disappear since the interface sits on its list. * Make restoration smarter - check that cloner with same name exists in the new vnet. Differential revision: https://reviews.freebsd.org/D33941 (cherry picked from commit 54712fc42350acb4991d8bd8604b08562660e962) --- sys/net/if.c | 34 +++++++++++++--------------------- sys/net/if_clone.c | 47 +++++++++++++++++++++++------------------------ sys/net/if_clone.h | 3 +-- 3 files changed, 37 insertions(+), 47 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 4182f22c848e..d2b47a749873 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -277,8 +277,8 @@ static void do_link_state_change(void *, int); static int if_getgroup(struct ifgroupreq *, struct ifnet *); static int if_getgroupmembers(struct ifgroupreq *); static void if_delgroups(struct ifnet *); -static void if_attach_internal(struct ifnet *, int, struct if_clone *); -static int if_detach_internal(struct ifnet *, int, struct if_clone **); +static void if_attach_internal(struct ifnet *, bool); +static int if_detach_internal(struct ifnet *, bool); static void if_siocaddmulti(void *, int); static void if_link_ifnet(struct ifnet *); static bool if_unlink_ifnet(struct ifnet *, bool); @@ -797,7 +797,7 @@ void if_attach(struct ifnet *ifp) { - if_attach_internal(ifp, 0, NULL); + if_attach_internal(ifp, false); } /* @@ -852,7 +852,7 @@ if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *pmax) } static void -if_attach_internal(struct ifnet *ifp, int vmove, struct if_clone *ifc) +if_attach_internal(struct ifnet *ifp, bool vmove) { unsigned socksize, ifasize; int namelen, masklen; @@ -871,9 +871,11 @@ if_attach_internal(struct ifnet *ifp, int vmove, struct if_clone *ifc) if_addgroup(ifp, IFG_ALL); - /* Restore group membership for cloned interfaces. */ - if (vmove && ifc != NULL) - if_clone_addgroup(ifp, ifc); +#ifdef VIMAGE + /* Restore group membership for cloned interface. */ + if (vmove) + if_clone_restoregroup(ifp); +#endif getmicrotime(&ifp->if_lastchange); ifp->if_epoch = time_uptime; @@ -1118,7 +1120,7 @@ if_detach(struct ifnet *ifp) found = if_unlink_ifnet(ifp, false); if (found) { sx_xlock(&ifnet_detach_sxlock); - if_detach_internal(ifp, 0, NULL); + if_detach_internal(ifp, false); sx_xunlock(&ifnet_detach_sxlock); } CURVNET_RESTORE(); @@ -1135,7 +1137,7 @@ if_detach(struct ifnet *ifp) * the cloned interfaces are destoyed as first thing of teardown. */ static int -if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) +if_detach_internal(struct ifnet *ifp, bool vmove) { struct ifaddr *ifa; int i; @@ -1170,15 +1172,6 @@ if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) taskqueue_drain(taskqueue_swi, &ifp->if_linktask); taskqueue_drain(taskqueue_swi, &ifp->if_addmultitask); - /* - * Check if this is a cloned interface or not. Must do even if - * shutting down as a if_vmove_reclaim() would move the ifp and - * the if_clone_addgroup() will have a corrupted string overwise - * from a gibberish pointer. - */ - if (vmove && ifcp != NULL) - *ifcp = if_clone_findifc(ifp); - if_down(ifp); #ifdef VIMAGE @@ -1293,7 +1286,6 @@ finish_vnet_shutdown: static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { - struct if_clone *ifc; void *old; int rc; @@ -1302,7 +1294,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) * mark as dead etc. so that the ifnet can be reattached later. * If we cannot find it, we lost the race to someone else. */ - rc = if_detach_internal(ifp, 1, &ifc); + rc = if_detach_internal(ifp, true); if (rc != 0) return (rc); @@ -1340,7 +1332,7 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) ifnet_setbyindex(ifp->if_index, ifp); IFNET_WUNLOCK(); - if_attach_internal(ifp, 1, ifc); + if_attach_internal(ifp, true); CURVNET_RESTORE(); return (0); diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 9b067976b182..803d9b1f307a 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -621,49 +621,48 @@ done: return (err); } +#ifdef VIMAGE /* - * if_clone_findifc() looks up ifnet from the current - * cloner list, and returns ifc if found. Note that ifc_refcnt - * is incremented. + * if_clone_restoregroup() is used in context of if_vmove(). + * + * Since if_detach_internal() has removed the interface from ALL groups, we + * need to "restore" interface membership in the cloner's group. Note that + * interface belongs to cloner in its home vnet, so we first find the original + * cloner, and then we confirm that cloner with the same name exists in the + * current vnet. */ -struct if_clone * -if_clone_findifc(struct ifnet *ifp) +void +if_clone_restoregroup(struct ifnet *ifp) { - struct if_clone *ifc, *ifc0; + struct if_clone *ifc; struct ifnet *ifcifp; + char ifc_name[IFCLOSIZ] = { [0] = '\0' }; - ifc0 = NULL; + CURVNET_SET_QUIET(ifp->if_home_vnet); IF_CLONERS_LOCK(); LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { IF_CLONE_LOCK(ifc); LIST_FOREACH(ifcifp, &ifc->ifc_iflist, if_clones) { if (ifp == ifcifp) { - ifc0 = ifc; - IF_CLONE_ADDREF_LOCKED(ifc); + strncpy(ifc_name, ifc->ifc_name, IFCLOSIZ-1); break; } } IF_CLONE_UNLOCK(ifc); - if (ifc0 != NULL) + if (ifc_name[0] != '\0') break; } + CURVNET_RESTORE(); + LIST_FOREACH(ifc, &V_if_cloners, ifc_list) + if (strcmp(ifc->ifc_name, ifc_name) == 0 && + ((ifc->ifc_flags & IFC_NOGROUP) == 0)) + break; IF_CLONERS_UNLOCK(); - return (ifc0); -} - -/* - * if_clone_addgroup() decrements ifc_refcnt because it is called after - * if_clone_findifc(). - */ -void -if_clone_addgroup(struct ifnet *ifp, struct if_clone *ifc) -{ - if ((ifc->ifc_flags & IFC_NOGROUP) == 0) { - if_addgroup(ifp, ifc->ifc_name); - IF_CLONE_REMREF(ifc); - } + if (ifc != NULL) + if_addgroup(ifp, ifc_name); } +#endif /* * A utility function to extract unit numbers from interface names of diff --git a/sys/net/if_clone.h b/sys/net/if_clone.h index ad1689c61d3b..187f2518f057 100644 --- a/sys/net/if_clone.h +++ b/sys/net/if_clone.h @@ -114,8 +114,7 @@ void vnet_if_clone_init(void); int if_clone_create(char *, size_t, caddr_t); int if_clone_destroy(const char *); int if_clone_list(struct if_clonereq *); -struct if_clone *if_clone_findifc(struct ifnet *); -void if_clone_addgroup(struct ifnet *, struct if_clone *); +void if_clone_restoregroup(struct ifnet *); /* The below interfaces are used only by epair(4). */ void if_clone_addif(struct if_clone *, struct ifnet *); From nobody Thu Oct 10 10:03:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPQLj0v7tz5YmRB; Thu, 10 Oct 2024 10:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPQLh5VsMz4snt; Thu, 10 Oct 2024 10:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EuGn/rq0CE+ifq9LRBCm0kTsCsRG1RoUHvGlTU8cyVc=; b=sdX60hfn3jGDPuCdPJAkORimXCMSTzs42zWYNVr1E5mJH1ey48a5wzr9Un0bDOY/si+Spx JQLFtZlOlYC+Y6nqtAXVQMebSDcC6G+WQFGfMPbGPV8P5nnYptcVkGfoLRrdZGxGwuFfWH BO3vUYecjotxl/0Ornd8kDYwemR4ejTGHTlCiNbEUiTrqiYjOH78DR6QpQ39mZt25flQAN RAJAt3RssVVmNboBijg608Djlv/bTS+TeIkfrNX2xYsSXVyHE9Y9z8eVp5C1ASBEKrf/KF 9vgWReBhyqMKA/tDK7mKNkaZlk4qvOCtRQ5aIqep1kMXp8dEL/9v/1nvkf0x0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EuGn/rq0CE+ifq9LRBCm0kTsCsRG1RoUHvGlTU8cyVc=; b=qISh5P3eCeoINzjxydcOQR8i3Ken5TJdvgpfeQrqyT1QYfsjlekTJZuwCdpakg61aIiszJ ARkTzn68PVUeUqOxDnnvYHR65OlEzzWPAIuUxLaQc59ULHiyleLH1N5TfhGr9aTeuoEqar Pb/S6x2xw5m5ozvYPz332Q50C5rYmzI4eRyO7GFNaWvcd37zoUwsX5RZdlUf0FYq38Z9rR aSFly5xir6DH0ql2g1wOSus4J1CsHwoHlGWc2MB0YCe0v5D7pLm5Sy5Zp7DnYzQtV/j86K M7Wf1I5lvTMP6x4a+0LASxMyVDfjSQI2U9eELSM5//UV8KsXIWvXBGC07mKxhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728554604; a=rsa-sha256; cv=none; b=hHWL3hgVa/1Lwn24BGUTA+NnpIIaLSiXppZRVjnuU6ZGlD9JAGp7z5Lb4AypHFHAC4p95o ABG+iBaQuv/U5sj6QIlKgMAN8oYgn+E7v3c08FF7JAmPFTSHevy0g3SO+7NWkDDPG/RvD7 0QctlcyKknHoznwX03Xm+Pf48YLb1rnnG+/GYC2wcrwmsIyPJugag5QdBeG6BwXpTOKa79 vttyOBQu9H84CJmiX3jikC1XIj9ezh98LctK6roM0qZdXXY/HfsPclaVWpEJCxAIaYEtAn 0XNYYlZJqwmLxd4Mj0COkYQ3mdRa+dBchjxMoKcqXR5mD30Q9BowEpIJMU+t8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPQLh56Wczt26; Thu, 10 Oct 2024 10:03:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AA3Ol2052759; Thu, 10 Oct 2024 10:03:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AA3ObH052756; Thu, 10 Oct 2024 10:03:24 GMT (envelope-from git) Date: Thu, 10 Oct 2024 10:03:24 GMT Message-Id: <202410101003.49AA3ObH052756@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: ea980c17f48e - stable/13 - if_clone: correctly destroy a clone from a different vnet List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ea980c17f48e9307504d7567d8f2b37dc3181588 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=ea980c17f48e9307504d7567d8f2b37dc3181588 commit ea980c17f48e9307504d7567d8f2b37dc3181588 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-01-25 05:07:16 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-10 10:00:48 +0000 if_clone: correctly destroy a clone from a different vnet Try to live with cruel reality fact - if_vmove doesn't move an interface from previous vnet cloning infrastructure to the new one. Let's admit this as design feature and make it work better. * Delete two blocks of code that would fallback to vnet0, if a cloner isn't found. They didn't do any good job and also whole idea of treating vnet0 as special one is wrong. * When deleting a cloned interface, lookup its cloner using it's home vnet. With this change simple sequence works correctly: ifconfig foo0 create jail -c name=jj persist vnet vnet.interface=foo0 jexec jj ifconfig foo0 destroy Differential revision: https://reviews.freebsd.org/D33942 (cherry picked from commit 6d1808f051a5f8e3b546442b9bcab3d03f04ef8a) --- sys/net/if_clone.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 803d9b1f307a..98d2f4564db8 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -197,15 +197,6 @@ ifc_create_ifp(const char *name, struct ifc_data *ifd, LIST_FOREACH(ifc, &V_if_cloners, ifc_list) if (ifc->ifc_match(ifc, name)) break; -#ifdef VIMAGE - if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) { - CURVNET_SET_QUIET(vnet0); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) - if (ifc->ifc_match(ifc, name)) - break; - CURVNET_RESTORE(); - } -#endif IF_CLONERS_UNLOCK(); if (ifc == NULL) @@ -289,22 +280,15 @@ if_clone_destroy(const char *name) return (ENXIO); /* Find the cloner for this interface */ + CURVNET_SET_QUIET(ifp->if_home_vnet); IF_CLONERS_LOCK(); LIST_FOREACH(ifc, &V_if_cloners, ifc_list) { if (strcmp(ifc->ifc_name, ifp->if_dname) == 0) { break; } } -#ifdef VIMAGE - if (ifc == NULL && !IS_DEFAULT_VNET(curvnet)) { - CURVNET_SET_QUIET(vnet0); - LIST_FOREACH(ifc, &V_if_cloners, ifc_list) - if (ifc->ifc_match(ifc, name)) - break; - CURVNET_RESTORE(); - } -#endif IF_CLONERS_UNLOCK(); + CURVNET_RESTORE(); if (ifc == NULL) { if_rele(ifp); return (EINVAL); From nobody Thu Oct 10 10:03:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPQLk0vsxz5Ymq1; Thu, 10 Oct 2024 10:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPQLj6ZPSz4t03; Thu, 10 Oct 2024 10:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WNt+IcYq00owyJ7jOnOcHfdkTBzSxlu1XIAUuVNZbg=; b=FbSnLAZap+BrTbmQQ2qQ/7kRx+35aQy70lYuH4kuFN9vHNv2DGxgMaewBd5Rm1udyngk/K kiv478spgjcXWR0n6lhbn0j9G5V9FysrK5WTPtI4q6BQfk7hPFr7SbpnQx177V7Pl+Hbc0 cxdO77cpI/itThRZHKfzkYDWpMbNPDuhmeGyXjL097qCCoCwC8vBCBSq4ywehX4VBSonpW 8ClGnJQpXcV7Exh1jNhvP4752XHc49360Pw922uTk+6uCR3XUBUbMryUraEZtxtzCMR/Jd T6N9GzElbE2/CHVXfa+Q9aamh69m8zBxZZrBBH13CwaeKp7dnOMpxMDm1+y5RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WNt+IcYq00owyJ7jOnOcHfdkTBzSxlu1XIAUuVNZbg=; b=ehihCPJvx24HU5bKZdpvNPVMiPiOPSH3tW0cLwzlGw6py1hi8HfBFcMsaGvYmstAqHzfmL xaU9Iim1Ygu/CtIQdXY8G42/68HQLUJtwOjr9qr/p5p13+QG9Rt/DaO70eYQRz8berKjTu c8jErphH9T4tUwzEoNMUfT7gRVlpL45q0QEALviCTv+prHZDwthJ/DHYL0pvUTiXn7VIe2 PMIAhttgBiY3fy9IESrXQ52+5IvT80VNGYYHnzeV+qAccu3FPL2exQgD9Ulk0NRzApSQuX CyCiZdO1fcb6w3gcRB0Tmq1udxS/bp+BahCjrIOX4cNyRkS/LdnBdw1nDIbDkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728554605; a=rsa-sha256; cv=none; b=Z2T9sIMJD+4w6QlUIrLAe8ARBdrIKguU6n7nhwRZnM5AZNyKYO5A51NkrYTpU24ERt6Wta hFkn7zbwHMDTD/EofBqjXAJBOyr7DUbYWb7ycl9zeI4v8NTsukucjh7fBACGj96gq6PoxL seRWStTn/8NMmsPGmdqg/31EuU+RYE3PzqURBxYiFa+C8BttOnVvW9S9DhuhFL5VTH7nER +Xs+j02X/Tz7QUOt8prYhXMMrdf/A9npS5lBGfYgxRMmZEyq78m1O4qdGyiBTiapnc1ET/ DqW8XIp3gKjQt1rzmvXU8ux3Q81r20olRkzAvBfYPzXciM41TYAOc7SaV4VUTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPQLj69w6zt5F; Thu, 10 Oct 2024 10:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AA3Ph9052804; Thu, 10 Oct 2024 10:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AA3PoM052801; Thu, 10 Oct 2024 10:03:25 GMT (envelope-from git) Date: Thu, 10 Oct 2024 10:03:25 GMT Message-Id: <202410101003.49AA3PoM052801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 3e46d65d5619 - stable/13 - netstat: increase width of Netif column List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e46d65d56198760ad0a867a651dffb11fbd258d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=3e46d65d56198760ad0a867a651dffb11fbd258d commit 3e46d65d56198760ad0a867a651dffb11fbd258d Author: Lexi Winter <lexi@le-Fay.ORG> AuthorDate: 2024-05-08 09:44:29 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-10 10:00:48 +0000 netstat: increase width of Netif column The previous width of Netif (10 or 8) was too short for modern interface names; make it 12, which is long enough to display "epair0a.1000". This came up in practice with genet(4) interfaces, since the base interface name is long enough that with the previous limit, VLAN identifiers would be truncated at 1 character in the IPv6 output: "genet0.100" becomes "genet0.1". The width is now fixed, and doesn't depend on the address family, because there's no reason that length of the interface name would vary based on the AF. PR: 266474 Reviewed by: imp,zlei,Mina Galić Pull Request: https://github.com/freebsd/freebsd-src/pull/1223 (cherry picked from commit d33b87e8cf91a6bcb5eac0ecc0371c1041c61050) netstat: for -W, use IFNAMSIZ If -W is specified, use IFNAMSIZ as the width of the Netif column, instead of the default 12. (cherry picked from commit ae9c0ba8ef2f540f9030909cf07e3c59f876fd23) (cherry picked from commit 6b86b8f0f6b6bfd5d93e45c7f584ec5bffac2a62) --- usr.bin/netstat/nhops.c | 5 ++--- usr.bin/netstat/route.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/usr.bin/netstat/nhops.c b/usr.bin/netstat/nhops.c index 19a7a6891050..c4412bc68081 100644 --- a/usr.bin/netstat/nhops.c +++ b/usr.bin/netstat/nhops.c @@ -65,16 +65,15 @@ #include "common.h" /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; static int wid_gw; @@ -416,7 +415,7 @@ print_nhops_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; xo_open_instance("rt-family"); pr_family(fam); xo_open_list("nh-entry"); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 5c737b28df78..0a0ddc52f61f 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -183,16 +183,15 @@ pr_family(int af1) } /* column widths; each followed by one space */ +#define WID_IF_DEFAULT (Wflag ? IFNAMSIZ : 12) /* width of netif column */ #ifndef INET6 #define WID_DST_DEFAULT(af) 18 /* width of destination column */ #define WID_GW_DEFAULT(af) 18 /* width of gateway column */ -#define WID_IF_DEFAULT(af) (Wflag ? 10 : 8) /* width of netif column */ #else #define WID_DST_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18) #define WID_GW_DEFAULT(af) \ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18) -#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 10 : 8)) #endif /*INET6*/ static int wid_dst; @@ -283,7 +282,7 @@ p_rtable_sysctl(int fibnum, int af) wid_flags = 6; wid_pksent = 8; wid_mtu = 6; - wid_if = WID_IF_DEFAULT(fam); + wid_if = WID_IF_DEFAULT; wid_expire = 6; xo_open_instance("rt-family"); pr_family(fam); From nobody Thu Oct 10 10:03:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPQLl3DzVz5YmJc; Thu, 10 Oct 2024 10:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPQLl0L7kz4sr6; Thu, 10 Oct 2024 10:03:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARnYsu5/sKhpLWZ+OPteRByUiQ12AieP8dRRtz4+4Yg=; b=TtWADNGf3iHhbj+blkUd30ccDNE9/P+1jNsQZtnxwnwze1VnyR9nl0x267Y+4Nlc3MCIU0 R58YTQigCHMIZ3ar/pBSYGklgfSE7/KeJ+UiaMZL7YLtB6M+CXHNegCaXEUkX1ooTpe7kv QE5KT7/cc1RFS34cFNkLzqZOfDNkCX5ahCUgig+1IpbHL2Np3ah46WoXmvXbiQO2UfPX8u gZbiAjA3eATQMqJmR4MhKfZX+onxigF/4yw+E+R99wLYJuPbeakBmpfKN4jfC1J9RGZd+P txez0OcPOe8bD95VO5zy3LYI4J8bNEEjV6I2YWsmAXShiJlNKNTVQdqTjqPjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728554607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ARnYsu5/sKhpLWZ+OPteRByUiQ12AieP8dRRtz4+4Yg=; b=CX12OHbZNvXH/iPRkPwj259M14RChOobn15oO5Cae1RY6HqbfAyCpD820rZi1+gVfVdclX 0E4YX0BePcvGsyFTfH/MKD3Ay7LA6kWM2lf99fJLBtyKx80O/Y5s8EOV1R2oNw1S6O5ZGt n8DX94+T3xKuJzBs0NP+7mPGNV5rZRHkY98EqZ7tFmj4wFawdY7mTErGnLq8kHphxxqBZu 9JewNxy8pXbSxiCGyz41TrdO1fWNZ9hXF9dMshlFatGgNhXEt36fIRLZ2sxLULlfNYEPRc w68ninyB42lA1BOweFVt/EGAtxyPZlUSINPGXUhL4zFEAxWc2pfSmogfhbsMXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728554607; a=rsa-sha256; cv=none; b=aqMhOga1I51khhsdPCKe8TJrzNlhf5JfjJXhVnbeokYik0DaAUmZ3t/w+wXH1lnIOOpam8 OYst9ZCYpkMUuDMh6GkyQm7dzmPtyueR7Pp3jZnvR8Is6BunziCnX9tOw3C0+HORXASVzh fOHdE4pDCAoJGTNSYPoaGC1TvmWaWAemWaCSNC65CtSS+JGzpJ42Z1TxSVwPnsk6G2rBce vlF5K0NbMbca7ONSIw0CvuRcclZ88Gdtjvx/kcpvSe3tYvMwnn4leGwOm95+xeoN8HqL5p v2MTWCG94FHGgJo9X5Na++sdZgoK6IlKtwaRYKmMx+XOe8hjWlr29CN/KwFZ/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 4XPQLk73T5zt5G; Thu, 10 Oct 2024 10:03:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AA3QU2052844; Thu, 10 Oct 2024 10:03:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AA3Qtt052841; Thu, 10 Oct 2024 10:03:26 GMT (envelope-from git) Date: Thu, 10 Oct 2024 10:03:26 GMT Message-Id: <202410101003.49AA3Qtt052841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang <zlei@FreeBSD.org> Subject: git: 66ce3c8460bb - stable/13 - ifnet: Remove if_getamcount() List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66ce3c8460bb9d4b98dd6230b9a685aaa6bc8d06 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=66ce3c8460bb9d4b98dd6230b9a685aaa6bc8d06 commit 66ce3c8460bb9d4b98dd6230b9a685aaa6bc8d06 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-09-04 13:07:11 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2024-10-10 10:00:48 +0000 ifnet: Remove if_getamcount() All uses of this function were incorrect. if_amcount is a reference count which tracks the number of times the network stack internally set IFF_ALLMULTI. (if_pcount is the corresponding counter for IFF_PROMISC.) Remove if_getamcount() and fix up callers to get the number of assigned multicast addresses instead, since that's what they actually want. Sponsored by: Klara, Inc. Reviewed by: zlei, glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46523 (cherry picked from commit 408c909dc64f77d2696d6fec77a2e0b00255cf96) (cherry picked from commit b513c311d0db5c301c939b1cf44b2826e09011d3) --- sys/dev/bxe/bxe.c | 2 +- sys/dev/liquidio/lio_ioctl.c | 2 +- sys/net/if.c | 6 ------ sys/net/if_var.h | 1 - 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index daed2ea9e5e4..78e2423dc4a7 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12197,7 +12197,7 @@ bxe_set_rx_mode(struct bxe_softc *sc) if (if_getflags(ifp) & IFF_PROMISC) { rx_mode = BXE_RX_MODE_PROMISC; } else if ((if_getflags(ifp) & IFF_ALLMULTI) || - ((if_getamcount(ifp) > BXE_MAX_MULTICAST) && + (if_llmaddr_count(ifp) > BXE_MAX_MULTICAST && CHIP_IS_E1(sc))) { rx_mode = BXE_RX_MODE_ALLMULTI; } else { diff --git a/sys/dev/liquidio/lio_ioctl.c b/sys/dev/liquidio/lio_ioctl.c index 80ee9ed2dcfa..449bc0219798 100644 --- a/sys/dev/liquidio/lio_ioctl.c +++ b/sys/dev/liquidio/lio_ioctl.c @@ -481,7 +481,7 @@ lio_get_new_flags(struct ifnet *ifp) * Accept all multicast addresses if there are more than we * can handle */ - if (if_getamcount(ifp) > LIO_MAX_MULTICAST_ADDR) + if (if_llmaddr_count(ifp) > LIO_MAX_MULTICAST_ADDR) f |= LIO_IFFLAG_ALLMULTI; } if (if_getflags(ifp) & IFF_BROADCAST) diff --git a/sys/net/if.c b/sys/net/if.c index d2b47a749873..8a870bb4e1bc 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -4387,12 +4387,6 @@ if_getifaddr(if_t ifp) return ((struct ifnet *)ifp)->if_addr; } -int -if_getamcount(if_t ifp) -{ - return ((struct ifnet *)ifp)->if_amcount; -} - int if_setsendqready(if_t ifp) { diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 9785dac2c265..24fe259d0046 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -761,7 +761,6 @@ u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); u_int if_lladdr_count(if_t); u_int if_llmaddr_count(if_t); -int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); /* Functions */ From nobody Thu Oct 10 12:54:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPV7Y2m89z5Z1BC; Thu, 10 Oct 2024 12:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPV7Y2B6sz4R8P; Thu, 10 Oct 2024 12:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728564841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UlZ+BV+SQ8A9mh3I0qB5D4iuvL0Ol09nEdB9O0J0sf8=; b=Re3aCyuHBNqUDjIlM2PVJvTAHQO4OzXdDLRkCY1wlLnt8Qp/2UXnMmmhGgj1e2R7XHX0JA KzVmILRmZXrIBky/gP6oCk1xfa5f3GtvhE+y9+3dpqawkdgI+s7w28r6eDei9a+JebWCIL ztZiUrcchlTdZKcH9NDjlWwstvjukdb4n5YDjl64Rw0zBs0fxX0aH8UzJGz8qxy1YB3s3a oiMifcqS5i4HjVEEdYmXY14fDB237xxDYcurALkY6CZXvXMfTFadlYNq5ozadXULROh2FZ Fs+Cub7oMKGxT6p7o5E+avXAVXh+StEETVABDdCWf2Ur0DKtomxJobaadhYM6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728564841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UlZ+BV+SQ8A9mh3I0qB5D4iuvL0Ol09nEdB9O0J0sf8=; b=l38Mporq+i6pOL6AS4QI8h6FFoskHq7ZrZUHBDAqRUlaQdkV1rmliG6X4Q4R0ud2yQmp3u LboAUmM6Bk29V/Hax/zvxVznq6pWbeq77UJWLIvjGBex+44HEKCy6/4oCm9q3oXdElppX5 MYO6EjReJ6ymRXdzM2Qt2aZ2t+NrJ6ui5jcFJA+FywkySmh1K57uoFIEdP47lcE7Lwu7hV /eQ4upE6hjLNqmAz4FaJMv+q81NqCy1p/ctNjBs/YjLyVau1QpjM+/QHLpOLuHCUNqzq08 5ryxBZHUvuQyxFUHP/7LvsvK3JUalvNhPWdILpLyVaV+y7V8fP1AiscWYfRuiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728564841; a=rsa-sha256; cv=none; b=ozVeMdz6HZrZgG+evVdRq5LxAX+jkeLi/gpSvxILGZ9Fy91NORP2ufPnW486ogJanfnjZW gEhdsqrReFZPZV3kZhYLdaRW/FfRYOZJtMpXydO1gM3BAUrNEhw+kvf3RVIw63mbVdiNcO XXPyzPeng6LdiQEe/D/YFu5a6O4YlZ14EvuwKEFWqXinD+nk4Yj9OXV6E25MGNSRUrRI8j re0r5oCxkNoFlZDiUwy5lOoFAsttALbAMlgzrOyjAe8GuQqLc4ghFhAksjoJP63G1Ezom+ GOeyStAx7xax5S4cjRqFgRTHaSM0UL6xUXhMqoENA2IO9de8Juf+6SIct9+X2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPV7Y1nB8zyFq; Thu, 10 Oct 2024 12:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49ACs1CR040536; Thu, 10 Oct 2024 12:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49ACs184040533; Thu, 10 Oct 2024 12:54:01 GMT (envelope-from git) Date: Thu, 10 Oct 2024 12:54:01 GMT Message-Id: <202410101254.49ACs184040533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome <tsoome@FreeBSD.org> Subject: git: f37dc94abcae - stable/14 - loader: dosfs fails to access directory data with large cluster number List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f37dc94abcaedc31421f5433b23522fe2ee1506b Auto-Submitted: auto-generated The branch stable/14 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=f37dc94abcaedc31421f5433b23522fe2ee1506b commit f37dc94abcaedc31421f5433b23522fe2ee1506b Author: Toomas Soome <tsoome@FreeBSD.org> AuthorDate: 2024-10-03 11:54:11 +0000 Commit: Toomas Soome <tsoome@FreeBSD.org> CommitDate: 2024-10-10 12:52:50 +0000 loader: dosfs fails to access directory data with large cluster number fsize is using 2 bytes for cluster number, but with fat32 we actually do have 4 bytes and with large disks the high bytes will be in use. illumos issue: https://www.illumos.org/issues/16821 Sponsored by: MNX Cloud, Inc. (cherry-picked from commit 79a0d14fa05c75038caa52099289effb85732f88) --- stand/libsa/dosfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 7fbbf65989ae..2ee95bf2c601 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -815,7 +815,7 @@ fsize(DOS_FS *fs, DOS_DE *de) int n; if (!(size = cv4(de->size)) && de->attr & FA_DIR) { - if (!(c = cv2(de->clus))) { + if (!(c = stclus(fs->fatsz, de))) { size = fs->dirents * sizeof(DOS_DE); } else { if ((n = fatcnt(fs, c)) == -1) From nobody Thu Oct 10 12:55:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPV995Gcdz5Z10w; Thu, 10 Oct 2024 12:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPV993g1vz4RNj; Thu, 10 Oct 2024 12:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728564925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQ4b0ZV6GMCCDP3EmqOaxwE5jrR6EplE7Z9DHcWmO/0=; b=bFvnMvpZDTaUNymCi4OUU+RPbdcg58jQmpUq3KInd61Aul2XrA5E2801nXQ5Z8LbHnuzLq EiRjm1C2FgbKfnNeDWkUfXMF39Vv5ggGEcQx3nckHWC4Cs6wi/YogbeEfFRlWrZtE8Y/z8 JdJvcfzvWff43q0x1myodBuZcXOhVlK4VyNJ+vf13UMRiRU1AHcqXxtyhIFs6C+qBgqKFD 2J8oV+Xn9jkRS8g2x0cXhxctur7ZdETr9MBBPdmDgDeCE6F5mEpBlM5BvKThqpbMB7Gd6o 29laZeZ3cHCtUuqME5MTPE1a2DpOemV3thqJzAkEofSbr4+7f9KkcudPy8OyZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728564925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SQ4b0ZV6GMCCDP3EmqOaxwE5jrR6EplE7Z9DHcWmO/0=; b=LsmfRUCOH3yYg1CNeQbQzwcUapTTFyRtOzBhlfws7m91yi+0zO7k7V1w6H67Sl2zo0S2Nr ivOec2imiFGSMEtAM9jnh8Z3OvHpx26GJGl7mdNBoVG2JHvbph1/J+HMWlS0dBjv9XiBXk Z563V7/RYhzlURARQyknW2QGv2QCnw8a4y/02ZsDqCNaek7LuEUOOyU/sr3Y70TwMr4voj JwiIWNP82Nv8KeT69cv9RSfs1Bqs8zUtf0kPWPU9yWak93r1I7gwvzn2lIlQsqMZ3xsnRE LsmGSfVX8pFsVjG1dgq7tE/uMFCb+M4JPvMNF8KOtwtQcqCZPLepinHnhk4SUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728564925; a=rsa-sha256; cv=none; b=PYP+KQDmINIWXh/x5l09u3zojXGf65yZo/BdXqKj4tu3lKyPw4cbmqmyrgmvl/gqMDTC4p 311/ULlZIXbLqolBvvQI3GQH3JjQLADQyX5pD2EAZyCGa/HEHNXLAcOjK2sAYaq27hGT75 O+4WQbjCVc7OK6jmGtvYBUidfUjh6NBfxha728IHNoew6mdHWKsxdFTR9UBC1fsi2UIFqE iYH6bCs5SENVlv2aJStoe352nXrs2NaeN9COHFb1OJDOtJDGOtgmsBm4lRlfy3I0n2S8UD qEDzUl3TDBJbiFOJguwHp5VNhwyMz2nZvTt8P4soktE3lfi2lj1gQ7J0i5hFvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPV9938mYzyZp; Thu, 10 Oct 2024 12:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49ACtPrs040962; Thu, 10 Oct 2024 12:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49ACtP8V040959; Thu, 10 Oct 2024 12:55:25 GMT (envelope-from git) Date: Thu, 10 Oct 2024 12:55:25 GMT Message-Id: <202410101255.49ACtP8V040959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Toomas Soome <tsoome@FreeBSD.org> Subject: git: c66f901b8e41 - stable/13 - loader: dosfs fails to access directory data with large cluster number List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c66f901b8e4101435a1671fb943031198361beb1 Auto-Submitted: auto-generated The branch stable/13 has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=c66f901b8e4101435a1671fb943031198361beb1 commit c66f901b8e4101435a1671fb943031198361beb1 Author: Toomas Soome <tsoome@FreeBSD.org> AuthorDate: 2024-10-03 11:54:11 +0000 Commit: Toomas Soome <tsoome@FreeBSD.org> CommitDate: 2024-10-10 12:55:03 +0000 loader: dosfs fails to access directory data with large cluster number fsize is using 2 bytes for cluster number, but with fat32 we actually do have 4 bytes and with large disks the high bytes will be in use. illumos issue: https://www.illumos.org/issues/16821 Sponsored by: MNX Cloud, Inc. (cherry picked from commit 79a0d14fa05c75038caa52099289effb85732f88) --- stand/libsa/dosfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 06215b1ab0fd..6f7b207ff404 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -816,7 +816,7 @@ fsize(DOS_FS *fs, DOS_DE *de) int n; if (!(size = cv4(de->size)) && de->attr & FA_DIR) { - if (!(c = cv2(de->clus))) { + if (!(c = stclus(fs->fatsz, de))) { size = fs->dirents * sizeof(DOS_DE); } else { if ((n = fatcnt(fs, c)) == -1) From nobody Thu Oct 10 19:07:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPfQN4fHBz5YTTQ; Thu, 10 Oct 2024 19:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPfQN3rXwz4CcX; Thu, 10 Oct 2024 19:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etRjQaUdQ1sMP0smLWAny3u7SpmjX7q0ER847HplSQI=; b=yxllAKTwvOqOtowgQEMrl+DARrFcO27DM/CaoNmh2KHtkpQAgwFfGBf4Q+f1767l1YPc7B AaZxtH2nvo81C52Q6Nu+KrF67lFovDQZfGj+MsWbdl95RC2Z4iutGgJbD1IALoxlmMuRcD 4/UAjK7PX8UPsio0IyQx9dztd3FxHsxUUy9L7/y++D3my20w/tOFAOjVz7PHwy4cxJycbU LAIn/D+hyqOe4W3deOD2rPAnG1mSTkiesI0HK81025hmPcrcGRAzuOj4beXT77i31cg+jp BEmuVNvRpFzJS5gP9u1GBVHfH7aER8WDGpofLPtx9qmBEZqQziCVrddzGYzLJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=etRjQaUdQ1sMP0smLWAny3u7SpmjX7q0ER847HplSQI=; b=ZYkd64xmbBFYQD/QQciLOIbWkiD7nD/QDpyxEHzO4HFvPsnUAufxcHBgve+lj8bUGgtOQi AdT46eIDcwoGSJWCEobRdzAUZ0/qpHu0+K2js+UH3/ZSP9C6yORjFHm8xr6hj9cR+AJ3x5 JIzvKp0oCS1JF8BEaEZaMadkXDE8TdYm5Vhlc9piJ0pDTQXc7ycaDeCCRuqaJQH2J7PHQK EUub0eqgi+uYmuGhV1bnKpZDflxHqZ2L+ZrkUIuOHr5mhPappC3yMakSxrXKLnp7e9pTWn OjThm6JALrgBTeMesa7Ccqftgouz+j0GUinWTUiw+drF06DrCeO5aUprZa211A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728587244; a=rsa-sha256; cv=none; b=uqcQ+/BS2/l1Fp+vR56KfGV41GuZ/bJua4BU5lJSUsvlNaLLKbP/mcN2tyTx3SeZZkS3Sv rqEiYpL7v8xrTgE49PCt6Cel0HdhJykjZhGTUZSFj97mBaOQWjZKqdYrHQKfAb/BAsNxh/ VP4zJZ6AwZALrpJuGSO2PpXdcwGsvsUgLQrHhm11ydfrbSUEacmvAhDZg3KktMG7VqlJcF uGSyTQyk9+W7eUJhSzOfSknkwXoGUP94obi88fSkx+D4b+HQ2YKtqoDirjBLrbJ0GPJ5oG olnC+BAvZCWjJzBaAShdCOrUn7YjIK8wnXqY9y5P8wvUUbAyYsTjqWwQUckq3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPfQN3Rsdz18tJ; Thu, 10 Oct 2024 19:07:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AJ7ODp069680; Thu, 10 Oct 2024 19:07:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AJ7OAX069677; Thu, 10 Oct 2024 19:07:24 GMT (envelope-from git) Date: Thu, 10 Oct 2024 19:07:24 GMT Message-Id: <202410101907.49AJ7OAX069677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers <asomers@FreeBSD.org> Subject: git: cf2ed0edaefb - stable/14 - fusefs: fix an uninitialized memory access in fuse_vnop_deallocate List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf2ed0edaefbd273da4dc4fc51392fddb2165891 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=cf2ed0edaefbd273da4dc4fc51392fddb2165891 commit cf2ed0edaefbd273da4dc4fc51392fddb2165891 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2024-09-08 21:50:40 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2024-10-10 18:48:39 +0000 fusefs: fix an uninitialized memory access in fuse_vnop_deallocate If the FUSE_GETATTR issued to query a file's size during fuse_vnop_deallocate failed for any reason, then fuse_vnop_deallocate would attempt to destroy an uninitialized fuse_dispatcher struct, with a crash the likely result. This bug only affects FUSE file systems that implement FUSE_FALLOCATE, and is unlikely to be seen on those that don't disable attribute caching. Reported by: Coverity Scan CID: 1505308 (cherry picked from commit f93a50d69df2e996ff1d4f793d0dcb9de655ebdc) --- sys/fs/fuse/fuse_vnops.c | 2 +- tests/sys/fs/fusefs/fallocate.cc | 51 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 8eb37423618c..22564c65c44d 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -3082,8 +3082,8 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) false); } -out: fdisp_destroy(&fdi); +out: if (closefufh) fuse_filehandle_close(vp, fufh, curthread, cred); diff --git a/tests/sys/fs/fusefs/fallocate.cc b/tests/sys/fs/fusefs/fallocate.cc index ff5e3eb4f4bb..a05760207648 100644 --- a/tests/sys/fs/fusefs/fallocate.cc +++ b/tests/sys/fs/fusefs/fallocate.cc @@ -310,6 +310,57 @@ TEST_F(Fspacectl, erofs) leak(fd); } +/* + * If FUSE_GETATTR fails when determining the size of the file, fspacectl + * should fail gracefully. This failure mode is easiest to trigger when + * attribute caching is disabled. + */ +TEST_F(Fspacectl, getattr_fails) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + Sequence seq; + struct spacectl_range rqsr; + const uint64_t ino = 42; + const uint64_t fsize = 2000; + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1, 0); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(1) + .InSequence(seq) + .WillOnce(Invoke(ReturnImmediate([](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, attr); + out.body.attr.attr.ino = ino; + out.body.attr.attr.mode = S_IFREG | 0644; + out.body.attr.attr.size = fsize; + out.body.attr.attr_valid = 0; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([](auto in) { + return (in.header.opcode == FUSE_GETATTR && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).InSequence(seq) + .WillOnce(ReturnErrno(EIO)); + + fd = open(FULLPATH, O_RDWR); + ASSERT_LE(0, fd) << strerror(errno); + rqsr.r_offset = 500; + rqsr.r_len = 1000; + EXPECT_EQ(-1, fspacectl(fd, SPACECTL_DEALLOC, &rqsr, 0, NULL)); + EXPECT_EQ(EIO, errno); + + leak(fd); +} + TEST_F(Fspacectl, ok) { const char FULLPATH[] = "mountpoint/some_file.txt"; From nobody Thu Oct 10 19:11:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPfW215Zxz5YTdJ; Thu, 10 Oct 2024 19:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPfW20ZVSz4DCq; Thu, 10 Oct 2024 19:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oa+ym3VWHtd3F/AXXJZiBa8UKVeE3rELksiNGUKiBYQ=; b=wVm7l5rHSorvbroRcqmGr+MM9XCcK8achjX2KcGGAGyuh6lFa+yPrL/cHEVFlzYUuVanNP dU/fxu3VrdtBmArIOypRtk9cfcS+Nq7FAdjtw18Ay50HaDXl05e3BdEtYtRE+x/qKP9PsN 67pK/5zZ/u92aaFkGIjFzZCc7C3nRsRol5/KdSCDK9ZfgkQCKjf41oz/UfJXTwalEXsZE+ ehhNqZ4PyqcIrXmJT41d9IVtHeeGgr+8T8b9CZ6bajGxqZBwOL5PVtB0oJ7DR0KA2td2NT lAFZdI9AGxlmwnYoaHWNqjk0w1InI5ldWSn5jhuzAP8jLFe+ucvj7q06FtXy3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Oa+ym3VWHtd3F/AXXJZiBa8UKVeE3rELksiNGUKiBYQ=; b=mLdBHfK3n0aMmJSERuMX/Eyc81ijnZiTtWN7xMV80nnNU+3hEAuBW9BMtd7FLkb9s7JEEn pB6FV3VjpobSRBlePptJftQMY/yIyYQ+8BQ5UwCANUG5ABkWWJCyMKcf3kfdYD3MoRu6Nm 4nw5J/Fn7bNqdticyDZHyNiWEXLa08mEvFSfsFwiJ9hp10Z0G8AjOJf4fjovkgGueP3me6 zzHO5q5nbTArvOjpB80GAY0l1GWfwt1CwNxUs5PvxpuM0njefBcwf1IeSQ/TfAD/zLJ1ku 2hLnUl7yUzTkfi855QspZwHAyZa2RDOLsO7qf6ZJW7TTDD79GfsRvQjW72+KPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728587486; a=rsa-sha256; cv=none; b=qYwbOyKDicwIQcqKeYn+dYrrorIkDxAqJNuXWeP1vx+vb6gmS+tjztROblXd0v8LJGMVXg iL8mbsPT6gRvZW4/t2PttFV/IY117CqM7YVzdcaJiINZvJGmPW2gbeepeQdoZTIW7lLO+S iXGyPKhwygSm5RA7AMkDPK0Ndu6qfqRHg0TafSzYC4yNBtniymXZp2NuvoRENXhHeuOHlG Ug7yRK33fZprnnpT5p5qWFElcwsnh3O4t8l8p4eOeTzP9g6ak1FZYehPpAIHv5rNK4HwQU J6QBYzfUmk7ITABUufw8qa5zEuMcB2fA5a5SyzUd7Z++81kiX5Bm8y4f3iYMXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPfW202GVz19QG; Thu, 10 Oct 2024 19:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AJBPqH084711; Thu, 10 Oct 2024 19:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AJBPmt084708; Thu, 10 Oct 2024 19:11:25 GMT (envelope-from git) Date: Thu, 10 Oct 2024 19:11:25 GMT Message-Id: <202410101911.49AJBPmt084708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers <asomers@FreeBSD.org> Subject: git: 4421ce1328df - stable/14 - nfscl: fix uninitialized memory in nfsv4_loadattr List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4421ce1328dff275ae522222010b6b3b791730e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4421ce1328dff275ae522222010b6b3b791730e7 commit 4421ce1328dff275ae522222010b6b3b791730e7 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2024-09-08 20:42:38 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2024-10-10 19:08:12 +0000 nfscl: fix uninitialized memory in nfsv4_loadattr When processing an RPC response that did not include any Owner attribute, nfsv4_loadattr would return na_uid and na_gid uninitialized. The uninitialized values could then make their way into the NFS attribute cache via nfscl_loadattrcache. PR: 281279 Reported by: KMSAN Reviewed by: rmacklem Sponsored by: Axcient (cherry picked from commit 44328abfb7aca8150b07b83ff502c9185677e3fb) --- sys/fs/nfs/nfs_commonsubs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index f2305795e53e..9f0e98bc93ce 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -1320,6 +1320,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, * Just set default values to some of the important ones. */ if (nap != NULL) { + VATTR_NULL(&nap->na_vattr); nap->na_type = VREG; nap->na_mode = 0; nap->na_rdev = (NFSDEV_T)0; From nobody Thu Oct 10 19:16:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPfdP4Kzgz5YTt5; Thu, 10 Oct 2024 19:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPfdP3r1kz4F20; Thu, 10 Oct 2024 19:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxV5ECz7tVMIdHa8S15V/zYN5TCn+cAAsW3yvMpGYg8=; b=ZnTUyYEZslBGUAQ80U2cKHOW77kSoNSXtyrUtPZyNFUunp8mdGvJCIjIfTx+sKn0lJ/0CB Wx+93WhO7jGc3FXuXfuE7DMYAj4ogHtr65wGxkR3qQ4juXImq5I+4PD6wPBHzEmBlf4FlS XYWvA7K6ncnLEH3nNHh5t2wBeu70ZWejVfDZAUY7S/PN2z9AGRNJNh5Rke6fD8XPt5kK2V vwzZLzKp81pFnmB0anhmCLH2zhZZftQNQ3/rRb9BawEHQ/ZUtipR43E3xPt7sBG0cktw4y DZnAliZyWOfkflw5Ca6Q2Uhxang8dHY51lg99M6XTtk12Ub3nThJlXQWfU4Bgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728587817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HxV5ECz7tVMIdHa8S15V/zYN5TCn+cAAsW3yvMpGYg8=; b=T0ZlmT8JKJUKWh2ocuBpU0GfKzZk/1nRIQw0ja89JEKenIuNWKMX2ZELn7Vnw4m/iW+UmT Wb4FXuGkPVlRdRdOBFxLKyn0csWrnQaOf/rS/TuFgsEu8i2F/XINSxVT1YgyI0NuRGpOqF /KH0zRMqolYBaGnNI85Qs1ywJlqlrZxqN17Cq5nrT9ntstK8kfXa11G2pwCV1rZQZSfkR+ hzEZIKH0KLn/c0KDCj3CZ98GbvmrzkZUBI3iHAPROHBkjRTYFKU5DQkrF1dt5EvX2msAqd /kL984/zSWjlYAXTuA28Wth8Qb7mb2gaT86zUGw+IfI+xbJ3BQ+Y+IgZjJnRaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728587817; a=rsa-sha256; cv=none; b=HucdPpreEV7wopr0GYx44ACY6ARfWyvzCXvRCYN8QZ+uoBsIsAb+ZCfgJ8QX0KJTzMvViX vUU6W3TIRd+60wAwac1xzecsXFscU4YG9vvf4OOcL9APWagVtJjBhm9jTjXKgbcotitT91 9tz23i1UU3yqadp5qj9ekod8VvpaaVxbFaag2gbRcvxCFcU6P/I+OO1g/AyrSL1ja92tlD yOp4WATb1KpB1z4sCJw+sb4bq87u1qMk1BCoW4eMiCeSjQc8ntxT0dUBFsezhtqNtEBHtG KOoSnK5J8SBjPJr5aEt+Q2Kv12SweNmSTkG7iT3hOa1ZCymJsjq2IIR5dlDVHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPfdP3RXPz191k; Thu, 10 Oct 2024 19:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AJGvY6086587; Thu, 10 Oct 2024 19:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AJGvNI086584; Thu, 10 Oct 2024 19:16:57 GMT (envelope-from git) Date: Thu, 10 Oct 2024 19:16:57 GMT Message-Id: <202410101916.49AJGvNI086584@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers <asomers@FreeBSD.org> Subject: git: b64d88424dda - stable/14 - ctld: fix several process setup/teardown bugs List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b64d88424dda7785eba815cefcc99709780c2953 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b64d88424dda7785eba815cefcc99709780c2953 commit b64d88424dda7785eba815cefcc99709780c2953 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2024-08-07 15:21:08 +0000 Commit: Alan Somers <asomers@FreeBSD.org> CommitDate: 2024-10-10 19:11:37 +0000 ctld: fix several process setup/teardown bugs All of the below bugs could result in a system where ctld is not running, but LUNs and targets still exist in the kernel; a difficult situation to recover from. * open the pidfile earlier. Open the pidfile before reading the kernel's current state, so two racing ctld processes won't step on each others' toes. * close the pidfile later. Close it after tearing down the configuration, for the same reason. * If the configured pidfile changes, then rename it on SIGHUP rather than remove and recreate it. * When running in debug mode, don't close the pidfile while handling a new connection. Only do that in non-debug mode, in the child of the fork. * Register signal handlers earlier. Otherwise a SIGTERM signal received during startup could kill ctld without tearing down the configuration. PR: 271460 Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1370 (cherry picked from commit 5f89aea7b74aa4605b25af62e31303097a4a48cc) --- usr.sbin/ctld/ctld.c | 70 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index fdd3a49f8a48..9be0f6975437 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -1916,7 +1916,6 @@ conf_apply(struct conf *oldconf, struct conf *newconf) struct portal *oldp, *newp; struct port *oldport, *newport, *tmpport; struct isns *oldns, *newns; - pid_t otherpid; int changed, cumulated_error = 0, error, sockbuf; int one = 1; @@ -1925,32 +1924,25 @@ conf_apply(struct conf *oldconf, struct conf *newconf) log_init(newconf->conf_debug); } - if (oldconf->conf_pidfh != NULL) { - assert(oldconf->conf_pidfile_path != NULL); - if (newconf->conf_pidfile_path != NULL && - strcmp(oldconf->conf_pidfile_path, - newconf->conf_pidfile_path) == 0) { - newconf->conf_pidfh = oldconf->conf_pidfh; - oldconf->conf_pidfh = NULL; - } else { - log_debugx("removing pidfile %s", - oldconf->conf_pidfile_path); - pidfile_remove(oldconf->conf_pidfh); - oldconf->conf_pidfh = NULL; - } - } - - if (newconf->conf_pidfh == NULL && newconf->conf_pidfile_path != NULL) { - log_debugx("opening pidfile %s", newconf->conf_pidfile_path); - newconf->conf_pidfh = - pidfile_open(newconf->conf_pidfile_path, 0600, &otherpid); - if (newconf->conf_pidfh == NULL) { - if (errno == EEXIST) - log_errx(1, "daemon already running, pid: %jd.", - (intmax_t)otherpid); - log_err(1, "cannot open or create pidfile \"%s\"", - newconf->conf_pidfile_path); + if (oldconf->conf_pidfile_path != NULL && + newconf->conf_pidfile_path != NULL) + { + if (strcmp(oldconf->conf_pidfile_path, + newconf->conf_pidfile_path) != 0) + { + /* pidfile has changed. rename it */ + log_debugx("moving pidfile to %s", + newconf->conf_pidfile_path); + if (rename(oldconf->conf_pidfile_path, + newconf->conf_pidfile_path)) + { + log_err(1, "renaming pidfile %s -> %s", + oldconf->conf_pidfile_path, + newconf->conf_pidfile_path); + } } + newconf->conf_pidfh = oldconf->conf_pidfh; + oldconf->conf_pidfh = NULL; } /* @@ -2472,8 +2464,8 @@ handle_connection(struct portal *portal, int fd, close(fd); return; } + pidfile_close(conf->conf_pidfh); } - pidfile_close(conf->conf_pidfh); error = getnameinfo(client_sa, client_sa->sa_len, host, sizeof(host), NULL, 0, NI_NUMERICHOST); @@ -2808,6 +2800,7 @@ main(int argc, char **argv) struct isns *newns; const char *config_path = DEFAULT_CONFIG_PATH; int debug = 0, ch, error; + pid_t otherpid; bool dont_daemonize = false; bool test_config = false; bool use_ucl = false; @@ -2847,7 +2840,6 @@ main(int argc, char **argv) kernel_init(); TAILQ_INIT(&kports.pports); - oldconf = conf_new_from_kernel(&kports); newconf = conf_new_from_file(config_path, use_ucl); if (newconf == NULL) @@ -2856,6 +2848,22 @@ main(int argc, char **argv) if (test_config) return (0); + assert(newconf->conf_pidfile_path != NULL); + log_debugx("opening pidfile %s", newconf->conf_pidfile_path); + newconf->conf_pidfh = pidfile_open(newconf->conf_pidfile_path, 0600, + &otherpid); + if (newconf->conf_pidfh == NULL) { + if (errno == EEXIST) + log_errx(1, "daemon already running, pid: %jd.", + (intmax_t)otherpid); + log_err(1, "cannot open or create pidfile \"%s\"", + newconf->conf_pidfile_path); + } + + register_signals(); + + oldconf = conf_new_from_kernel(&kports); + if (debug > 0) { oldconf->conf_debug = debug; newconf->conf_debug = debug; @@ -2871,8 +2879,6 @@ main(int argc, char **argv) conf_delete(oldconf); oldconf = NULL; - register_signals(); - if (dont_daemonize == false) { log_debugx("daemonizing"); if (daemon(0, 0) == -1) { @@ -2927,6 +2933,10 @@ main(int argc, char **argv) error = conf_apply(oldconf, newconf); if (error != 0) log_warnx("failed to apply configuration"); + if (oldconf->conf_pidfh) { + pidfile_remove(oldconf->conf_pidfh); + oldconf->conf_pidfh = NULL; + } conf_delete(newconf); conf_delete(oldconf); oldconf = NULL; From nobody Thu Oct 10 19:53:54 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPgS25c8rz5YXvq; Thu, 10 Oct 2024 19:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPgS22vpYz4LC9; Thu, 10 Oct 2024 19:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728590034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BTdpXHxz62FpMfChfvwPGQyLhmdM2nr1VXK6I4Gl6Y=; b=OM2ZxihkMO2C/1y16p8ToQoxGa50+6iSu/q8q7KyKi9S0r7AaXEzTN5B3+gaDdFqi+mN/4 jQbdW7QHHMq6lMeiFx/XhQRTbxhW6rgMB7vONqGYT40EBNEHg1bHepCbUqd9Y3Er9gkN77 wlQqS0X/C3uJI9TC9lqG4Iw+NAZl6+z5As5COqTZ9DJwWMpdPkO5lc7xq7U0Jp+wkj6bdp 5XjXNA/AGi2WFMQyVoKmCB/4MpUsyN6iyUAYzGuwOZMTrh8r5+FKgg1niUOUNGW3bx5brr TGH/cP7Wdo7NX7BD/3c0cp0dXL3xohqn2LeQDdrWEC6EQQpiQf+40DgyQLN8yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728590034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6BTdpXHxz62FpMfChfvwPGQyLhmdM2nr1VXK6I4Gl6Y=; b=F2MDGaKQsdvSyGOuB57q/wU+VT/0qMraMDyQouI5eQiGS2OPLSuqDU2XVbpOwc1TFADXJz 2ASKsdcqY4IDqQo+IYQagRHjZWn/krxcXl/H4Q4PD0X7Q4uw73rgIk1hmRIYdYgYFnn6qO +hOXqSsVPpjGiMDTE+BuKOi3vPyW0zUkKZU5pmPZ2iN98xBSC0Vb32QE8efgWcxZR7R2Z9 SjEdMoL1Oz4lDY7k9+TtSTOopKGSaliJDYynDH1975vpjDeH+xmrbhf8HnT4NAOg9Aw6lQ LP01W1/8iFI/C0+i70Zspcj8hy1MQY1Mcahw9+sEoly//30qX+Aonc1Dzckzxg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728590034; a=rsa-sha256; cv=none; b=WRP/RrwsHy1VNTteUF5KkQd+qztPuedYxTjPRmt50ELy9N6z4vuD/E2gTeHl1TOaLNRiM2 NRaUcrcF5Tj/rJFO/uNr10hG2H7PWc61h5Wlyn1I3f+JiHdxlZIDeL5hRvHyGvDS4lF5pg bvegf4OgRDdD8NBClBVg2Q7QLocVIs7y9AT60RaHds7W2QgPr2uirqp8l6K5mabqfpjiMr l0QP3TLVSo78n7dRx/0hlSPH3uzrPHw1jZQ2ceGJAJj2JH1PI/K7isZ1XLNMVkXHUHUSNZ UMsJYnoj2FrVPfh9oIW0I+lyEQIb/XbtmENg7lnX+2Gjh1qC3W7n1eQ45IXy8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPgS22W1Rz1B7Y; Thu, 10 Oct 2024 19:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AJrsxf053504; Thu, 10 Oct 2024 19:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AJrsBd053501; Thu, 10 Oct 2024 19:53:54 GMT (envelope-from git) Date: Thu, 10 Oct 2024 19:53:54 GMT Message-Id: <202410101953.49AJrsBd053501@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert <cy@FreeBSD.org> Subject: git: 9a9a2165afe9 - stable/14 - unbound: Vendor import 1.21.1 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9a9a2165afe9bb4396a61c8b6508fa7f63c32e23 Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=9a9a2165afe9bb4396a61c8b6508fa7f63c32e23 commit 9a9a2165afe9bb4396a61c8b6508fa7f63c32e23 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2024-10-07 01:44:05 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2024-10-10 19:52:30 +0000 unbound: Vendor import 1.21.1 Release notes at https://nlnetlabs.nl/news/2024/Oct/03/unbound-1.21.1-released/ Security: CVE-2024-8508 Merge commit '9b8db746ac608ff7cdad3c9ac7ac395319e4ea0f' (cherry picked from commit 5a5c2279813012882e59aa7bb51d50c5baba3b1e) --- contrib/unbound/aclocal.m4 | 292 +++++----- contrib/unbound/configure | 416 +++++++++----- contrib/unbound/configure.ac | 5 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 2 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 2 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 2 +- contrib/unbound/install-sh | 174 +++--- contrib/unbound/ltmain.sh | 866 +++++++++++++++++++---------- contrib/unbound/util/configparser.c | 849 ++++++++++++++-------------- contrib/unbound/util/configparser.h | 4 +- contrib/unbound/util/data/msgencode.c | 77 +-- lib/libunbound/config.h | 6 +- 18 files changed, 1590 insertions(+), 1121 deletions(-) diff --git a/contrib/unbound/aclocal.m4 b/contrib/unbound/aclocal.m4 index bf3c57e2fd9f..364e37267d00 100644 --- a/contrib/unbound/aclocal.m4 +++ b/contrib/unbound/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.2 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -45,7 +46,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see <http://www.gnu.org/licenses/>. ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -195,6 +196,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -233,8 +235,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -786,7 +788,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1048,8 +1050,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1073,17 +1075,12 @@ _LT_EOF _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1132,12 +1129,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1251,7 +1248,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1268,7 +1266,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1298,7 +1296,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1315,7 +1313,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1327,7 +1325,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1349,7 +1347,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1357,7 +1355,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1365,7 +1363,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1385,14 +1383,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1460,7 +1458,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1499,9 +1497,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1720,7 +1731,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1763,7 +1774,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2213,26 +2224,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2555,7 +2575,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2565,14 +2585,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2591,7 +2611,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2628,7 +2648,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2661,7 +2681,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3463,7 +3483,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3497,14 +3517,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3518,7 +3538,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3565,7 +3585,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3692,13 +3712,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3724,7 +3744,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3964,7 +3984,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3982,20 +4002,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4019,7 +4039,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4037,9 +4057,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4326,7 +4346,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4409,7 +4429,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4745,7 +4765,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4928,7 +4948,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4936,7 +4956,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4993,15 +5013,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5053,7 +5073,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5165,6 +5185,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5179,7 +5200,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5222,7 +5243,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5234,7 +5255,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5250,7 +5271,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5382,7 +5403,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5565,12 +5586,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5611,7 +5632,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5659,7 +5680,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5870,6 +5891,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6636,8 +6658,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6735,6 +6757,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6765,7 +6788,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6902,7 +6925,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7042,13 +7065,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8186,6 +8209,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates @@ -8365,8 +8396,8 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -8797,7 +8828,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience], # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # @@ -8922,7 +8953,8 @@ m4_define([lt_dict_filter], # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -8931,23 +8963,23 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -9044,8 +9076,8 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 11 (pkg-config-0.29.1) +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> @@ -9087,7 +9119,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -9132,7 +9164,7 @@ dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place +dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], @@ -9188,7 +9220,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -9198,17 +9230,17 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - m4_default([$4], [AC_MSG_ERROR( + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -9219,8 +9251,8 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -9230,10 +9262,10 @@ _PKG_TEXT To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl ]) else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - $3 + $3 fi[]dnl ])dnl PKG_CHECK_MODULES @@ -9390,7 +9422,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9421,7 +9453,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/contrib/unbound/configure b/contrib/unbound/configure index 63051eca812d..b760920d1355 100755 --- a/contrib/unbound/configure +++ b/contrib/unbound/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for unbound 1.21.0. +# Generated by GNU Autoconf 2.71 for unbound 1.21.1. # # Report bugs to <unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues>. # @@ -622,8 +622,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.21.0' -PACKAGE_STRING='unbound 1.21.0' +PACKAGE_VERSION='1.21.1' +PACKAGE_STRING='unbound 1.21.1' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues' PACKAGE_URL='' @@ -771,6 +771,7 @@ RANLIB ac_ct_AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1508,7 +1509,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures unbound 1.21.0 to adapt to many kinds of systems. +\`configure' configures unbound 1.21.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1574,7 +1575,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.21.0:";; + short | recursive ) echo "Configuration of unbound 1.21.1:";; esac cat <<\_ACEOF @@ -1822,7 +1823,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.21.0 +unbound configure 1.21.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2479,7 +2480,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. *** 6781 LINES SKIPPED *** From nobody Thu Oct 10 19:54:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPgSc2Kn9z5YXRj; Thu, 10 Oct 2024 19:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPgSc1h9nz4LFw; Thu, 10 Oct 2024 19:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728590064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qhc0iaEXiLmc8HhuuUi/Hbsil9K+j44/Cf7X5kksKqk=; b=K3NLD6hvaim6MPvMCYkw6nxOBNTyn4V/7HT+b94I5DInEoXbua/JP6HQ7vuRQjYrNf37pR P5qMnWd4fIn8SCD/1a/4sSI80wYOLtrJT3C3zki77ZpZKKx53saWdmnHuotmWVeDruhJBT Ya1Em6hrQR3G8ACkXeHRNFeP+ZsBFHpBmbDs4cwe2VqTf+DbtdJsevDHDW6oLtTMOPnAKf /rnpbSqbYJY0QDUWopwWHNIj/r7QldJx+HigUvPmYMUgAicLOsCyyN05dE4DJcnZRneWcV RNcrkJTvBz1gBbsx+6l8tBZyrjVwvyOMbCUb67lyx66PvNfrIC/qO3GMMZ36qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728590064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qhc0iaEXiLmc8HhuuUi/Hbsil9K+j44/Cf7X5kksKqk=; b=Wt3WGlTYKRO+j1pMwm2+HkQz/+a0QkxgTllCi+tyaCPZfRTqE5X9I0m9omGb7g/ijsWHS5 xTOoY0v/ExumBCFCz+6mCBZNLReEqjljDzXAHVQ0QxYQIwyRo85o0JO8qqgReDN0PrFPlN kR8BnorABwKJdCudao0TeJqEv6IDo7DRXzo4mMyryCaXFVdjDr3BP0DrUm9qf7tP1F6oFX JaCl6k/eYgLLqc3/QzBtfTT7nsbFZMdgg8kJW5086Io9ZsjGCBbm/Uz25e0avpRIFVNSSo Xs6AZ7vtOfDlOjccYqBiSLrRj/saEMl4giBP1vc6jvxZez1F8BriGnuHLjM6cQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728590064; a=rsa-sha256; cv=none; b=U5azaZA+/QcY7vU2dkQXoBY198XRU4BglLAoNVy5A1sII3q+t+brvKlThrnh1ZrYYYcaCf ApinPTxG89Ibn8hWvjfP47DdW+pboHhONt+ySxr9X8wZcV4uUVUEA+AfJYzoKiRAzywCWr uSB8di9F0qBFrs24yvkgEG/C4G/CTx3FjlDjh3bADRPwG9uiGHI8GBhjxOewTXZt4cKmKg QYNHyPcbpcwHc/H4BgDl0L+wujP1smZZv+BUf3pNqCKI+h90vJfSQoCQdrBpym/dRMHSmF d+HZAFF7pQr3751T+/JTwF+1hWR2qZfQxY+XTOVrapeJMZA/jNyNepFwyJdsBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPgSc1HQvz1BB9; Thu, 10 Oct 2024 19:54:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AJsOZx053692; Thu, 10 Oct 2024 19:54:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AJsOIM053689; Thu, 10 Oct 2024 19:54:24 GMT (envelope-from git) Date: Thu, 10 Oct 2024 19:54:24 GMT Message-Id: <202410101954.49AJsOIM053689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert <cy@FreeBSD.org> Subject: git: d10c9c15a3a4 - stable/13 - unbound: Vendor import 1.21.1 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d10c9c15a3a44eab70aae89e53046e161835d534 Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d10c9c15a3a44eab70aae89e53046e161835d534 commit d10c9c15a3a44eab70aae89e53046e161835d534 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2024-10-07 01:44:05 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2024-10-10 19:53:24 +0000 unbound: Vendor import 1.21.1 Release notes at https://nlnetlabs.nl/news/2024/Oct/03/unbound-1.21.1-released/ Security: CVE-2024-8508 Merge commit '9b8db746ac608ff7cdad3c9ac7ac395319e4ea0f' (cherry picked from commit 5a5c2279813012882e59aa7bb51d50c5baba3b1e) --- contrib/unbound/aclocal.m4 | 292 +++++----- contrib/unbound/configure | 416 +++++++++----- contrib/unbound/configure.ac | 5 +- contrib/unbound/doc/README | 2 +- contrib/unbound/doc/example.conf.in | 2 +- contrib/unbound/doc/libunbound.3.in | 4 +- contrib/unbound/doc/unbound-anchor.8.in | 2 +- contrib/unbound/doc/unbound-checkconf.8.in | 2 +- contrib/unbound/doc/unbound-control.8.in | 2 +- contrib/unbound/doc/unbound-host.1.in | 2 +- contrib/unbound/doc/unbound.8.in | 4 +- contrib/unbound/doc/unbound.conf.5.in | 2 +- contrib/unbound/install-sh | 174 +++--- contrib/unbound/ltmain.sh | 866 +++++++++++++++++++---------- contrib/unbound/util/configparser.c | 849 ++++++++++++++-------------- contrib/unbound/util/configparser.h | 4 +- contrib/unbound/util/data/msgencode.c | 77 +-- usr.sbin/unbound/config.h | 6 +- 18 files changed, 1590 insertions(+), 1121 deletions(-) diff --git a/contrib/unbound/aclocal.m4 b/contrib/unbound/aclocal.m4 index bf3c57e2fd9f..364e37267d00 100644 --- a/contrib/unbound/aclocal.m4 +++ b/contrib/unbound/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.2 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -45,7 +46,7 @@ m4_define([_LT_COPYING], [dnl # along with this program. If not, see <http://www.gnu.org/licenses/>. ]) -# serial 58 LT_INIT +# serial 59 LT_INIT # LT_PREREQ(VERSION) @@ -195,6 +196,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl @@ -233,8 +235,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -786,7 +788,7 @@ _LT_EOF # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -1048,8 +1050,8 @@ int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF @@ -1073,17 +1075,12 @@ _LT_EOF _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac @@ -1132,12 +1129,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else @@ -1251,7 +1248,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot @@ -1268,7 +1266,7 @@ case $with_sysroot in #( fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( @@ -1298,7 +1296,7 @@ ia64-*-hpux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -1315,7 +1313,7 @@ ia64-*-hpux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -1327,7 +1325,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -1349,7 +1347,7 @@ mips64*-*linux*) echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -1357,7 +1355,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -1365,7 +1363,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -1385,14 +1383,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -1460,7 +1458,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -1499,9 +1497,22 @@ need_locks=$enable_libtool_lock m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} -: ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no @@ -1720,7 +1731,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -1763,7 +1774,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -2213,26 +2224,35 @@ m4_defun([_LT_CMD_STRIPLIB], striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) - else + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac + ;; + esac + fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) @@ -2555,7 +2575,7 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; @@ -2565,14 +2585,14 @@ m4_if([$1], [],[ ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' @@ -2591,7 +2611,7 @@ m4_if([$1], [],[ done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -2628,7 +2648,7 @@ m4_if([$1], [],[ ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -2661,7 +2681,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -3463,7 +3483,7 @@ beos*) bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -3497,14 +3517,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -3518,7 +3538,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' @@ -3565,7 +3585,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -3692,13 +3712,13 @@ else mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -3724,7 +3744,7 @@ else # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -3964,7 +3984,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -3982,20 +4002,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -4019,7 +4039,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ @@ -4037,9 +4057,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -4326,7 +4346,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -4409,7 +4429,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4745,7 +4765,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' @@ -4928,7 +4948,7 @@ m4_if([$1], [CXX], [ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) @@ -4936,7 +4956,7 @@ m4_if([$1], [CXX], [ ;; cygwin* | mingw* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -4993,15 +5013,15 @@ dnl Note also adjust exclude_expsyms for C++ above. case $host_os in cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) @@ -5053,7 +5073,7 @@ dnl Note also adjust exclude_expsyms for C++ above. _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -5165,6 +5185,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) @@ -5179,7 +5200,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -5222,7 +5243,7 @@ _LT_EOF _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes @@ -5234,7 +5255,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -5250,7 +5271,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -5382,7 +5403,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -5565,12 +5586,12 @@ _LT_EOF cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes @@ -5611,7 +5632,7 @@ _LT_EOF fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. @@ -5659,7 +5680,7 @@ _LT_EOF ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes @@ -5870,6 +5891,7 @@ _LT_EOF emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) @@ -6636,8 +6658,8 @@ if test yes != "$_lt_caught_CXX_error"; then cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -6735,6 +6757,7 @@ if test yes != "$_lt_caught_CXX_error"; then emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) @@ -6765,7 +6788,7 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes @@ -6902,7 +6925,7 @@ if test yes != "$_lt_caught_CXX_error"; then # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -7042,13 +7065,13 @@ if test yes != "$_lt_caught_CXX_error"; then _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' @@ -8186,6 +8209,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates @@ -8365,8 +8396,8 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -8797,7 +8828,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience], # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # @@ -8922,7 +8953,8 @@ m4_define([lt_dict_filter], # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -8931,23 +8963,23 @@ m4_define([lt_dict_filter], # @configure_input@ -# serial 4179 ltversion.m4 +# serial 4245 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' +[macro_version='2.4.7' +macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -9044,8 +9076,8 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# serial 11 (pkg-config-0.29.1) +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> @@ -9087,7 +9119,7 @@ dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29.1]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -9132,7 +9164,7 @@ dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place +dnl only at the first occurrence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], @@ -9188,7 +9220,7 @@ AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -9198,17 +9230,17 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - m4_default([$4], [AC_MSG_ERROR( + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -9219,8 +9251,8 @@ installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -9230,10 +9262,10 @@ _PKG_TEXT To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl ]) else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - $3 + $3 fi[]dnl ])dnl PKG_CHECK_MODULES @@ -9390,7 +9422,7 @@ AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -9421,7 +9453,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/contrib/unbound/configure b/contrib/unbound/configure index 63051eca812d..b760920d1355 100755 --- a/contrib/unbound/configure +++ b/contrib/unbound/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for unbound 1.21.0. +# Generated by GNU Autoconf 2.71 for unbound 1.21.1. # # Report bugs to <unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues>. # @@ -622,8 +622,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.21.0' -PACKAGE_STRING='unbound 1.21.0' +PACKAGE_VERSION='1.21.1' +PACKAGE_STRING='unbound 1.21.1' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl or https://github.com/NLnetLabs/unbound/issues' PACKAGE_URL='' @@ -771,6 +771,7 @@ RANLIB ac_ct_AR DLLTOOL OBJDUMP +FILECMD LN_S NM ac_ct_DUMPBIN @@ -1508,7 +1509,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures unbound 1.21.0 to adapt to many kinds of systems. +\`configure' configures unbound 1.21.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1574,7 +1575,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.21.0:";; + short | recursive ) echo "Configuration of unbound 1.21.1:";; esac cat <<\_ACEOF @@ -1822,7 +1823,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.21.0 +unbound configure 1.21.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -2479,7 +2480,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. *** 6781 LINES SKIPPED *** From nobody Thu Oct 10 20:28:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPhCw1skVz5Yb2L; Thu, 10 Oct 2024 20:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPhCw1LGSz4TCS; Thu, 10 Oct 2024 20:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728592108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAiFjVfqMAmekgYQoziCWG5F+IH//OTRDdr/Yam3eUA=; b=D4mZKkHrvRWv0lGGgtz2h626aFTPPVjyuLTCpPVmuO6Y10peESV1dYzUZJji+50tMTAah5 KWkZwosc5DCp7W/I+n3obw/aj36zUDgG85ygpOgpvhP+WBl6LCkvIOYDVZUZFmebHl4kg8 Uv/lqLAfzTx+QrS4gAVC+bFH6g1FYZ2/DGPlFjFajculUQ2W53ABi1jjN2Eqk/EPS2lnHY vGy7FWTkdt5oWF9N4vKCUtG/ZUCG7I/67yAYmqXqhDLksfGFMhuGDfE7LdSRxYUuil2Kui S9cCygMY9PIdTsZ2qa/Nyl5GbcOrdHuwnhGc8erjPQef95xxLr0Us98h/kA7Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728592108; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAiFjVfqMAmekgYQoziCWG5F+IH//OTRDdr/Yam3eUA=; b=qkzJWRbCw3vTe1bSSf/0qatvcT7fl/ow8A9vo0G3ULuQDMl9tsB5UPdraB9Z+6WF7A96w0 T57neilpsUY43KaiCh+IhyUZfj0DL8D6Lg+K9KFzHoYqVSPIamgnIjwzwZKAYdtoW7fKRL nq6CJsm0SLS37EkB36uWWJ7e9KwqmndxBTqoD1JfePLkYej7X6PWXPwI7oRl5vfN7/MhVr QzZ1qefdDcahiI5hO4rMLTW4k9Edf2ZohYTG7w3T2adlQ5CPBitTRQdM/KoI/j7XVC+y2L uCyWQOwYKfGeq2XHRFO3J5VOhYUh7I6CTKxi5zO84FLNsBYIBHjvEG3/QxSfnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728592108; a=rsa-sha256; cv=none; b=GEWYdkP9yi17Yuz/p9ZfxTFalYZ2uD4ugKgB7GqS/PV+HKHb6nrvBjuvjCiTW1Pb845n3A kppG5iBNQN6txoONkDlgoep6RmJ0zZTBykaEjIXPKEWUd4WqDvJpllmhQ7rpjelSqpxpn7 w+ImUrarTFn30OPFk5bhzu0aKFiuS2pwYlefe6VujeLFp+P+EuH3cvsbzlTL8ya/6/JDiJ Rq1/hCUkp23CquMA9LhxLrntbnDAyIti2+WG1qxxLPSkC204oMsCHa9Ge7MSCs2Uy8W4go ATu0UPICDRHSE1+0PP0tV0ckH7F/lmhJDgYRC49tU7wB3T4nF8znLQWPJf7UKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPhCw0sY8z1C7d; Thu, 10 Oct 2024 20:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AKSSXo005255; Thu, 10 Oct 2024 20:28:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AKSSse005251; Thu, 10 Oct 2024 20:28:28 GMT (envelope-from git) Date: Thu, 10 Oct 2024 20:28:28 GMT Message-Id: <202410102028.49AKSSse005251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: cde4ab289dfc - stable/14 - flua: Add wrappers for sys/utsname.h List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cde4ab289dfc3c802907fa19df166d18b85f59b8 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cde4ab289dfc3c802907fa19df166d18b85f59b8 commit cde4ab289dfc3c802907fa19df166d18b85f59b8 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-09-05 15:16:29 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-10 20:28:20 +0000 flua: Add wrappers for sys/utsname.h This allows one to invoke uname from lua scripts. Reviewed by: bapt, kevans, emaste MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42017 (cherry picked from commit 1726db7af6b3738eb04d962b351d7f4017e1fc77) --- libexec/flua/linit_flua.c | 1 + libexec/flua/modules/lposix.c | 47 ++++++++++++++++++++++++++++++++++++++++++- libexec/flua/modules/lposix.h | 1 + 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/libexec/flua/linit_flua.c b/libexec/flua/linit_flua.c index 671a0300783c..6bc300095c27 100644 --- a/libexec/flua/linit_flua.c +++ b/libexec/flua/linit_flua.c @@ -58,6 +58,7 @@ static const luaL_Reg loadedlibs[] = { /* FreeBSD Extensions */ {"lfs", luaopen_lfs}, {"posix.sys.stat", luaopen_posix_sys_stat}, + {"posix.sys.utsname", luaopen_posix_sys_utsname}, {"posix.unistd", luaopen_posix_unistd}, {"ucl", luaopen_ucl}, {NULL, NULL} diff --git a/libexec/flua/modules/lposix.c b/libexec/flua/modules/lposix.c index 5b6e80a0309f..fa3fd5f8e589 100644 --- a/libexec/flua/modules/lposix.c +++ b/libexec/flua/modules/lposix.c @@ -24,8 +24,8 @@ * */ -#include <sys/cdefs.h> #include <sys/stat.h> +#include <sys/utsname.h> #include <errno.h> #include <grp.h> @@ -130,12 +130,50 @@ lua_getpid(lua_State *L) return 1; } +static int +lua_uname(lua_State *L) +{ + struct utsname name; + int error, n; + + n = lua_gettop(L); + luaL_argcheck(L, n == 0, 1, "too many arguments"); + + error = uname(&name); + if (error != 0) { + error = errno; + lua_pushnil(L); + lua_pushstring(L, strerror(error)); + lua_pushinteger(L, error); + return (3); + } + + lua_newtable(L); +#define setkv(f) do { \ + lua_pushstring(L, name.f); \ + lua_setfield(L, -2, #f); \ +} while (0) + setkv(sysname); + setkv(nodename); + setkv(release); + setkv(version); + setkv(machine); +#undef setkv + + return (1); +} + #define REG_SIMPLE(n) { #n, lua_ ## n } static const struct luaL_Reg sys_statlib[] = { REG_SIMPLE(chmod), { NULL, NULL }, }; +static const struct luaL_Reg sys_utsnamelib[] = { + REG_SIMPLE(uname), + { NULL, NULL }, +}; + static const struct luaL_Reg unistdlib[] = { REG_SIMPLE(getpid), REG_SIMPLE(chown), @@ -150,6 +188,13 @@ luaopen_posix_sys_stat(lua_State *L) return 1; } +int +luaopen_posix_sys_utsname(lua_State *L) +{ + luaL_newlib(L, sys_utsnamelib); + return 1; +} + int luaopen_posix_unistd(lua_State *L) { diff --git a/libexec/flua/modules/lposix.h b/libexec/flua/modules/lposix.h index 6085bf045d79..e37caaae9d04 100644 --- a/libexec/flua/modules/lposix.h +++ b/libexec/flua/modules/lposix.h @@ -8,4 +8,5 @@ #include <lua.h> int luaopen_posix_sys_stat(lua_State *L); +int luaopen_posix_sys_utsname(lua_State *L); int luaopen_posix_unistd(lua_State *L); From nobody Thu Oct 10 20:28:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPhCx47p1z5Yb0D; Thu, 10 Oct 2024 20:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPhCx3bbxz4TYw; Thu, 10 Oct 2024 20:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728592109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xvHAtNDZBEa6SWZOJpTRS2jr6JC8VOQcCPMrmBwVPY=; b=JcvQjTf6dgU/bjGiFi9NmMscnIHmL0oMU6a+mPzrQbO5UvA2Bg8mptr+I82c0K49tyxTSM BlVzGCRZvxTeafvtcmLZ7c0pMdQC28iTUQaa3cREQAFe7eMa0qFmPgrfUvkanRQZpQA/kx y0PR6Sr4sm5uqykyfoYJcjzv9vPeDwsIJnasiNCo95iNA+IYWoy58fplE31unI3BoVAxKO qlTcYio6NB8+R/+962dH6dS18loL9VIuoTdUVoshl9BEbKNpAXiJDoHLthFJBO0RFAcNhs DmUjk24fUisj3aNaysHfZ9D3ucQePqhPm3nJGYzOOcTMaXj4TtCgCos2f12Vww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728592109; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3xvHAtNDZBEa6SWZOJpTRS2jr6JC8VOQcCPMrmBwVPY=; b=UIoMCcDexhojm9ASQwfjp2yvS8/BeYVV4mWFXDg9aC5PNPJsbXb1sgXnrEBe9pRttgu6HI yUZHGW03taXPNYNTZyCWJG4ZE4ss+gofEpbqraePdhj8dQaes5EJpStKe6dt5Vlt4ZQl9l tz/qiqRpxxNCEP3dqOslOJYGf/aySSzOTUO7kaTLpko9ehexyeh7xTTh5crLLTnucrsUxj xk1Z4txocjr1JbklqArRur4254nc+ZoUwoCBe4KkvXnwspCkCDNKpOK+HXbtU2Ya9maIvs 3OIKuP96K2GovlLVPsgAAoeiYBjiP5vpXGy8oT6zjmt2Fr3Pzw+7xBrnj21RVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728592109; a=rsa-sha256; cv=none; b=PK4dsdtebMC4GF/FG3mQInEUodb/+43Q7yqtJy+ReyBcG2XOt9OUoU8f3Ivvve8HczMV2a U2qNlB9wNeigdYnJ2biyBG9JIlfuMO5qAcW3wcYGQ8/wIhtaoMGVaCVsz7JTrAlTXChWie qZl5E+b5r2VcLOvXbp+WrkKe1Ax9BsYzowpXatCD0qXhiAt0tBLrG2PVUgPqxp1DK899gp eHv2Jw5gjueRKuhxrQfEcWZcTohLNyy4q0lOzFplWSsnYYavTPND2B5EFI6De6VyA04ftm NVietfm3ku06tLCSWiPHYIbCOBG1tu+iGHUi50SVEgxtN0ZFXF+gzGY2IMrFTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPhCx1qv5z1BWb; Thu, 10 Oct 2024 20:28:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AKSTdo005305; Thu, 10 Oct 2024 20:28:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AKSTis005302; Thu, 10 Oct 2024 20:28:29 GMT (envelope-from git) Date: Thu, 10 Oct 2024 20:28:29 GMT Message-Id: <202410102028.49AKSTis005302@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 012c194f39e8 - stable/14 - tty: delete knotes when TTY is revoked List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 012c194f39e872aad9e7a9798ef94662832bd11d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=012c194f39e872aad9e7a9798ef94662832bd11d commit 012c194f39e872aad9e7a9798ef94662832bd11d Author: Robert Wing <rew@FreeBSD.org> AuthorDate: 2023-12-19 00:40:46 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-10 20:28:20 +0000 tty: delete knotes when TTY is revoked Do not clear knotes from the TTY until it gets dealloc'ed, unless the TTY is being revoked, in that case delete the knotes when closed is called on the TTY. When knotes are cleared from a knlist, those knotes become detached from the knlist. And when an event is triggered on a detached knote there isn't an associated knlist and therefore no lock will be taken when the event is triggered. This becomes a problem when a detached knote is triggered on a TTY since the mutex for a TTY is also used as the lock for its knlists. This scenario ends up calling the TTY event handlers without the TTY lock being held and tripping on asserts in the event handlers. PR: 272151 Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41605 (cherry picked from commit acd5638e268a6706f6b7ad84947a8425e8d51ef7) --- sys/kern/tty.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 6848fbf558b0..b6e300321e9c 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -254,9 +254,6 @@ ttydev_leave(struct tty *tp) ttyoutq_free(&tp->t_outq); tp->t_outlow = 0; - knlist_clear(&tp->t_inpoll.si_note, 1); - knlist_clear(&tp->t_outpoll.si_note, 1); - if (!tty_gone(tp)) ttydevsw_close(tp); @@ -370,7 +367,7 @@ done: tp->t_flags &= ~TF_OPENCLOSE; static int ttydev_close(struct cdev *dev, int fflag, int devtype __unused, - struct thread *td __unused) + struct thread *td) { struct tty *tp = dev->si_drv1; @@ -393,8 +390,11 @@ ttydev_close(struct cdev *dev, int fflag, int devtype __unused, } /* If revoking, flush output now to avoid draining it later. */ - if (fflag & FREVOKE) + if ((fflag & FREVOKE) != 0) { tty_flush(tp, FWRITE); + knlist_delete(&tp->t_inpoll.si_note, td, 1); + knlist_delete(&tp->t_outpoll.si_note, td, 1); + } tp->t_flags &= ~TF_EXCLUDE; @@ -1121,6 +1121,8 @@ tty_dealloc(void *arg) ttyoutq_free(&tp->t_outq); seldrain(&tp->t_inpoll); seldrain(&tp->t_outpoll); + knlist_clear(&tp->t_inpoll.si_note, 0); + knlist_clear(&tp->t_outpoll.si_note, 0); knlist_destroy(&tp->t_inpoll.si_note); knlist_destroy(&tp->t_outpoll.si_note); From nobody Thu Oct 10 20:46:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPhcb6sCQz5Yc8q; Thu, 10 Oct 2024 20:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPhcb4d7Sz4Yt5; Thu, 10 Oct 2024 20:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728593183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8X1y6kYFNm26DePnA0MQ85AWdrpcoi3vTO927RC9Tyc=; b=svpBBHJ0zEAIRQtkYo1ns2RomhK9R95eGXR+k+GLi85+MdvA6fubYOcy4B0/lYa2Jv3bPs KtaXNbeWf+PnOob0Eh3y+3COL0FjjWztTrd0qKM7niwaHzl7x1CmhtbVhCfP5IcrEm8ifL NIdO6x6ZTu74Ktkmwi2XubgcbWDOea5WETQ0/aHp03MHuclSWQFG+S6QVD11wvPnrxAabD ZuX6RZfjjIjV5TevMZlgnfpiuGeEFu3zyUx9Ym24ae2LuMFDPKxU0YwLg4WdpjHo6CIHNk lYUx67gtizDNQJhclGw/oIQ1WnDjhjkufMqv8Rot57L5DB5vYsNf2av/iIikJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728593183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8X1y6kYFNm26DePnA0MQ85AWdrpcoi3vTO927RC9Tyc=; b=tQP8FLS5e4i9RIoHcn6YKnbXM8j87DZ1uUAeSt5Xjck6nuFttdelBKbrE0cRsrULdbKDmK g0fHCa3qxJpLhxsBrMzsUySeDJG75URuVHubMrhjYZ9lFzTbGK7JFT4KE3VShPyeOO/Ebq sMTObnHLEqkYwaLk6wdbbh6LglcNeoYiuJD0tu5FuTURZEh72QANv3VG8A4Tz9QnJXpr4k T1osPq1D6CnB/1zbdbkYKjW58rwi7b/XLgZOFe1KoUfqVd7XvqZsZY7kBFKP+d4vVt1fAe YCDml+V3fi+7NQwNWoxNEkAZKmVfdMn2t4IiNDAH8jnmwXR6lthYJ/GAmDII5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728593183; a=rsa-sha256; cv=none; b=niyEplU4j8FbJUzo2nBoySTIyezBjo6Sqx6DuT8EN2SuGUzjJ1HeIcMpJXB7Ow5rW7bYE4 78yFBafF519c3kXlKgLGiAfaLDlu3G8IG6Ubks520YPScvgf3fuByLJ3aJQjnrE7tivvIQ Bv5ric9r4X96cEP73rXKKwVYk4W3egjd2lh8JYSndUS6zymasjSNJKwWyhCNJ2ilSJk6Zh srvidVeWlfwEsgxFF9qRCThNnxwPgAVWxqz5y0HAGsZ67Ks3lU4FDZKX4FzC9JFUTScaEs v7fCRelXSSCH4TP3nUMDv6z9ZStZLvGiF4vZD/7xaBMbstZVsdbP09ouubt8bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPhcb3xBLz1Chv; Thu, 10 Oct 2024 20:46:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49AKkNL0038609; Thu, 10 Oct 2024 20:46:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49AKkNoi038606; Thu, 10 Oct 2024 20:46:23 GMT (envelope-from git) Date: Thu, 10 Oct 2024 20:46:23 GMT Message-Id: <202410102046.49AKkNoi038606@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 3e19aac2e84a - stable/13 - tty: delete knotes when TTY is revoked List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e19aac2e84a93d1f8ae6e227e0e1ff6e1356594 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3e19aac2e84a93d1f8ae6e227e0e1ff6e1356594 commit 3e19aac2e84a93d1f8ae6e227e0e1ff6e1356594 Author: Robert Wing <rew@FreeBSD.org> AuthorDate: 2023-12-19 00:40:46 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-10 20:44:14 +0000 tty: delete knotes when TTY is revoked Do not clear knotes from the TTY until it gets dealloc'ed, unless the TTY is being revoked, in that case delete the knotes when closed is called on the TTY. When knotes are cleared from a knlist, those knotes become detached from the knlist. And when an event is triggered on a detached knote there isn't an associated knlist and therefore no lock will be taken when the event is triggered. This becomes a problem when a detached knote is triggered on a TTY since the mutex for a TTY is also used as the lock for its knlists. This scenario ends up calling the TTY event handlers without the TTY lock being held and tripping on asserts in the event handlers. PR: 272151 Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D41605 (cherry picked from commit acd5638e268a6706f6b7ad84947a8425e8d51ef7) --- sys/kern/tty.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 8ed59fd166fa..42862ffb8a45 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -254,9 +254,6 @@ ttydev_leave(struct tty *tp) ttyoutq_free(&tp->t_outq); tp->t_outlow = 0; - knlist_clear(&tp->t_inpoll.si_note, 1); - knlist_clear(&tp->t_outpoll.si_note, 1); - if (!tty_gone(tp)) ttydevsw_close(tp); @@ -370,7 +367,7 @@ done: tp->t_flags &= ~TF_OPENCLOSE; static int ttydev_close(struct cdev *dev, int fflag, int devtype __unused, - struct thread *td __unused) + struct thread *td) { struct tty *tp = dev->si_drv1; @@ -393,8 +390,11 @@ ttydev_close(struct cdev *dev, int fflag, int devtype __unused, } /* If revoking, flush output now to avoid draining it later. */ - if (fflag & FREVOKE) + if ((fflag & FREVOKE) != 0) { tty_flush(tp, FWRITE); + knlist_delete(&tp->t_inpoll.si_note, td, 1); + knlist_delete(&tp->t_outpoll.si_note, td, 1); + } tp->t_flags &= ~TF_EXCLUDE; @@ -1121,6 +1121,8 @@ tty_dealloc(void *arg) ttyoutq_free(&tp->t_outq); seldrain(&tp->t_inpoll); seldrain(&tp->t_outpoll); + knlist_clear(&tp->t_inpoll.si_note, 0); + knlist_clear(&tp->t_outpoll.si_note, 0); knlist_destroy(&tp->t_inpoll.si_note); knlist_destroy(&tp->t_outpoll.si_note); From nobody Fri Oct 11 07:36:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPz2m119Pz5YR81; Fri, 11 Oct 2024 07:36:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPz2l6WDJz4mLp; Fri, 11 Oct 2024 07:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=go5QZ29X7jeTluPmLINmhh7qhij/QOEtVKC/OEaZBlc=; b=TuvBglhNH5/OIR8zJAx7/AO7ENASuL3a+BNeT3CMKVFNRFum7KTpi3gZWxFcx3AKOZF4kF vXvPvSRyseNyLYzP3tDb1XM7Jeic/5XshlzqQINgaB5kedPf2OOn5RPnqVu847qAqPKl0V LA0XBtOOg7dxLH4z9Q/fyREesKi927/w3VIM6XbibhNCpRflFrAzMTUCzBzecgZdZsKuc+ f57J3NbUKhlZMRBQtE2vUdawM358o84+/hD/yFsys7wTZw3lVoS1y1YbZyrb39o58nYRB3 Ji0Hc7gdqwCo/EtWkCjADCQ/9X6ine5NeF4BgXcoqmF9FJ3sHZndwdoRWCci8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=go5QZ29X7jeTluPmLINmhh7qhij/QOEtVKC/OEaZBlc=; b=w0SjR028aU2avr9CoVc/EEMU66so3jq9kEvU7vclCjt+zfrX3sV5zez534M4e1H/rAo3x8 WrZMcvu265+zeuWAEo+QHitSgVov7+HeqQ2oPj9yngCfviub9VpdgFvcGWDcKkGQ5qUYn9 ttpwnOqJKjjH5ZW1gihpKH7nuBL4CjTsO5aYbUx2+XM/MqXMgAWFOPBbzFvVNI+kPWsb/5 MP05yaDhfBbW1Qc4L3oFPiGak+3S3XSR3yg3ndib7l5Pp5H/RL3z8CG4ld8wNgyVQGdr1i 2CuxdU/cAv6Wq3jaG0gr0/jN+X+nZ7eHH7MyQlj2i24v4fkr4MYY6KXkAPlTXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728632191; a=rsa-sha256; cv=none; b=kRiCs2pKQi36Wazdo1wGxVsGaL7EBngAiQnZUCl5cWtPWSKWT0uNn1tyHZiNSt/7TSIkiW D84ZtAf8uzFJFiJVfhiLVhjOiBQ9wxcc5rnhLSb+Mg0UBKawhS0gOy4J/uHx6U6Vo5JQkH WIxxincMcme03k5jM+DN2oS94bNH9A25bWwSwtojLsCSK7LN8qBc+wkBS1wTI18kUq2bl3 9eXF4LJzmdEz2Q4WeFOFPWz+Ws9AbaFpoukYgfmf+Sjfnbey7eHB2VDvgxtF+sE1run5BZ lcpg7WtM0aFnj50UMJuwKL+frvYZhxkXg34Ryu79xkeXOGuiwSNqlGwSxjvUXg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPz2l66ybzYPJ; Fri, 11 Oct 2024 07:36:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49B7aVQ6040706; Fri, 11 Oct 2024 07:36:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49B7aV0w040703; Fri, 11 Oct 2024 07:36:31 GMT (envelope-from git) Date: Fri, 11 Oct 2024 07:36:31 GMT Message-Id: <202410110736.49B7aV0w040703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= <royger@FreeBSD.org> Subject: git: 329a3b0844e6 - stable/14 - xen: fix initialization of grant table frame array List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 329a3b0844e6671a3119a3f4da98e826c1c6199e Auto-Submitted: auto-generated The branch stable/14 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=329a3b0844e6671a3119a3f4da98e826c1c6199e commit 329a3b0844e6671a3119a3f4da98e826c1c6199e Author: Roger Pau Monné <royger@FreeBSD.org> AuthorDate: 2023-11-02 17:23:25 +0000 Commit: Roger Pau Monné <royger@FreeBSD.org> CommitDate: 2024-10-11 07:06:13 +0000 xen: fix initialization of grant table frame array The current sizing of the array used to store grant table frames is broken, as the calculation: max_nr_glist_frames = (boot_max_nr_grant_frames * GREFS_PER_GRANT_FRAME / (PAGE_SIZE / sizeof(grant_ref_t))); Is plain bogus, for once grant_ref_t is the type of the grant reference, but not the entry used to store such references in the grant frames. But even if the above calculation is switched to use grant_entry_v1_t, it would end up as: max_nr_glist_frames = (boot_max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_v1_t)) / (PAGE_SIZE / sizeof(grant_entry_v1_t))); Which is pointless (note GREFS_PER_GRANT_FRAME has been expanded to (PAGE_SIZE / sizeof(grant_entry_v1_t))). Just use boot_max_nr_grant_frames directly to size the grant table frames array. Fixes: 30d1eefe3937 ("Import OS interfaces to Xen services.") Sponsored by: Citrix Systems R&D (cherry picked from commit 1a12f0aea81b57d0dd2374047b8f4c97a037a8df) --- sys/dev/xen/grant_table/grant_table.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/dev/xen/grant_table/grant_table.c b/sys/dev/xen/grant_table/grant_table.c index 13ca966c1f90..1cf9fe5e339a 100644 --- a/sys/dev/xen/grant_table/grant_table.c +++ b/sys/dev/xen/grant_table/grant_table.c @@ -610,20 +610,12 @@ static int granttable_attach(device_t dev) { int i; - unsigned int max_nr_glist_frames; unsigned int nr_init_grefs; nr_grant_frames = 1; boot_max_nr_grant_frames = __max_nr_grant_frames(); - /* Determine the maximum number of frames required for the - * grant reference free list on the current hypervisor. - */ - max_nr_glist_frames = (boot_max_nr_grant_frames * - GREFS_PER_GRANT_FRAME / - (PAGE_SIZE / sizeof(grant_ref_t))); - - gnttab_list = malloc(max_nr_glist_frames * sizeof(grant_ref_t *), + gnttab_list = malloc(boot_max_nr_grant_frames * sizeof(grant_ref_t *), M_DEVBUF, M_NOWAIT); if (gnttab_list == NULL) From nobody Fri Oct 11 07:36:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPz2n2Ytyz5YR9b; Fri, 11 Oct 2024 07:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPz2n0TbLz4m9J; Fri, 11 Oct 2024 07:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5/ziNUyzQ6Ud1SzJhbX6GAwi1StZFS2uFYFFzcDd+tM=; b=tzd3lY8nwszhBhwxsqxGAq8ox2qM6ym68LJ/gpVEnlZ/GYubutw9ID6X79BpLPsTGn+nJS ba4S47Ne7Dx4DNXkgc9KVkM2W0TBd822CLMhPdR7stGRkJpUKvJEdbjdhGh7dkKFVBWTF/ DExTjHEEX8FPui1eHXj198OSMxwMeKurVGIDvG817TrtuNVJYqHAPG2A92EQTOxyp3GeHV UgBlk1+uDef3O25MYd01h7XLv7TjlPgV6UwnkkQiXafl+/V0pFDliRVbhm7ewzSD4E00gd C0l5xeEMRdms6pE0lpty3972iMRNILkPQocvJFsnrxBa5f10kN5jtsaNZ1rNWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5/ziNUyzQ6Ud1SzJhbX6GAwi1StZFS2uFYFFzcDd+tM=; b=FdC9PbOdoINapZGdNYSRHS52IEMANQgaeLe9g5F5K238xA/8/xbWOZspjrw2wFqzxxarRW KMLguzHhyKFnKv5WiS9UmlNxKOlJNk8/8yvXYf4TXs9YAIuzez+bVLzY8t5W0TprMyLeC0 +aek3R1QIcN8zTHQ5cxk6R2K5mldCYLGGNzDKuzzjVF/NMmLXL7OciblX7Z44MIa8rHMl5 mrkAsVG9QNC4I4kYMeJShJ9Y18wwhZgOGTcIu3U2bYLuJHEvK7UxrTFfFdGFOP9l6wFleP RiZnzFig6HpbOYBU2sIO2tAIb7+yqpVN1Au+0qIit+rQLpFebNEN53SFDbEcnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728632193; a=rsa-sha256; cv=none; b=aw0UrI5m5p9kqtCesrw2wKX6j5KZmpTNx3B0jhZZF7LqPzav1A+AM3z23If6GbaGM52H2l JsfS/HlA5ewgxQ2zexBgEmBZ9u1YXgIoAhPvGVfiW0AGYFEjiFpJxzUupI9ylo9bYAHxzN TplzOwvZHUdT1LNgifwFOx6SUjDumlzQZuO6Gi3ASBF3cTfhAoY38fWzf/kwJL0wwaxm+s Bp7yGkx1CxswTAx5n6MxXLHyN5dCCWUynL+XVJveixhhNw4Gqhf5gOSaBGdRgMSx/PGv8o 9M6icTGrsIiMKYWb2mrFy5IuGbNBAp5FUTMhP8XAoBSh69h401dBnvI5v2xcEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPz2n05d6zYLq; Fri, 11 Oct 2024 07:36:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49B7aWai040757; Fri, 11 Oct 2024 07:36:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49B7aWUP040754; Fri, 11 Oct 2024 07:36:32 GMT (envelope-from git) Date: Fri, 11 Oct 2024 07:36:32 GMT Message-Id: <202410110736.49B7aWUP040754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= <royger@FreeBSD.org> Subject: git: c1782c2d28a5 - stable/14 - xen-netfront: attempt to make cleanup idempotent List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c1782c2d28a59fab389aa6457f109afe3e9b43fc Auto-Submitted: auto-generated The branch stable/14 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=c1782c2d28a59fab389aa6457f109afe3e9b43fc commit c1782c2d28a59fab389aa6457f109afe3e9b43fc Author: Roger Pau Monné <royger@FreeBSD.org> AuthorDate: 2023-11-03 09:28:16 +0000 Commit: Roger Pau Monné <royger@FreeBSD.org> CommitDate: 2024-10-11 07:06:25 +0000 xen-netfront: attempt to make cleanup idempotent Current cleanup code assumes that all the fields are allocated and/or setup by the time cleanup is called, but this is not always true: a failure in mid-setup of the device will cause the functions to be called with possibly uninitialized fields. Fix the functions to cope with such sate, while also attempting to make the cleanup idempotent. Finally fix an error path during setup that would not mark the device as closed, and hence prevents the kernel from finishing booting. Fixes: 96375eac945c ("xen-netfront: add multiqueue support") Sponsored by: Citrix Systems R&D (cherry picked from commit 318bbb6d5a1eae77eb5dc687bcc63c0f99558e21) --- sys/dev/xen/netfront/netfront.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index da0f1680a87e..e13fb8765bae 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -597,8 +597,10 @@ talk_to_backend(device_t dev, struct netfront_info *info) num_queues = max_queues; err = setup_device(dev, info, num_queues); - if (err != 0) + if (err != 0) { + xenbus_dev_fatal(dev, err, "setup device"); goto out; + } again: err = xs_transaction_start(&xst); @@ -725,7 +727,10 @@ disconnect_rxq(struct netfront_rxq *rxq) xn_release_rx_bufs(rxq); gnttab_free_grant_references(rxq->gref_head); - gnttab_end_foreign_access(rxq->ring_ref, NULL); + if (rxq->ring_ref != GRANT_REF_INVALID) { + gnttab_end_foreign_access(rxq->ring_ref, NULL); + rxq->ring_ref = GRANT_REF_INVALID; + } /* * No split event channel support at the moment, handle will * be unbound in tx. So no need to call xen_intr_unbind here, @@ -740,6 +745,7 @@ destroy_rxq(struct netfront_rxq *rxq) callout_drain(&rxq->rx_refill); free(rxq->ring.sring, M_DEVBUF); + rxq->ring.sring = NULL; } static void @@ -771,6 +777,8 @@ setup_rxqs(device_t dev, struct netfront_info *info, rxq->id = q; rxq->info = info; + + rxq->gref_head = GNTTAB_LIST_END; rxq->ring_ref = GRANT_REF_INVALID; rxq->ring.sring = NULL; snprintf(rxq->name, XN_QUEUE_NAME_LEN, "xnrx_%u", q); @@ -827,7 +835,10 @@ disconnect_txq(struct netfront_txq *txq) xn_release_tx_bufs(txq); gnttab_free_grant_references(txq->gref_head); - gnttab_end_foreign_access(txq->ring_ref, NULL); + if (txq->ring_ref != GRANT_REF_INVALID) { + gnttab_end_foreign_access(txq->ring_ref, NULL); + txq->ring_ref = GRANT_REF_INVALID; + } xen_intr_unbind(&txq->xen_intr_handle); } @@ -837,9 +848,14 @@ destroy_txq(struct netfront_txq *txq) unsigned int i; free(txq->ring.sring, M_DEVBUF); + txq->ring.sring = NULL; buf_ring_free(txq->br, M_DEVBUF); - taskqueue_drain_all(txq->tq); - taskqueue_free(txq->tq); + txq->br = NULL; + if (txq->tq) { + taskqueue_drain_all(txq->tq); + taskqueue_free(txq->tq); + txq->tq = NULL; + } for (i = 0; i <= NET_TX_RING_SIZE; i++) { bus_dmamap_destroy(txq->info->dma_tag, @@ -878,6 +894,7 @@ setup_txqs(device_t dev, struct netfront_info *info, txq->id = q; txq->info = info; + txq->gref_head = GNTTAB_LIST_END; txq->ring_ref = GRANT_REF_INVALID; txq->ring.sring = NULL; From nobody Fri Oct 11 07:42:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPzB20DGWz5YRcn; Fri, 11 Oct 2024 07:42:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPzB16XBmz4nns; Fri, 11 Oct 2024 07:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ybsybKTXjNrzlnpo8lkXdJ4LH70ExT/qm5f/VcZawu0=; b=dvHxgtxa0nsoxxHeygOWmRp1M8CBWqByCbhOIm0J7lk2DuSkK/YyUgEcR+nQBi/EAG66ay J6Vzsy7RJWurBDBoLihiwRZHyNzjw4t2JSkVDA2Sd56Vleel/CPcCsSfyXP5tvoNt5VsLd Qmvb6cJxjkk+S+jsFTxTd+nsyTW2+ILXehptFiWNPyCKT0NuvZxmM+3brC7LkZXXa1r64M VbJ+z0GrHCVFr8zZ695fEjaWmVr/5TI/JOJduh8+R1TRDWYLHzZHWUXSgIYzxCBcOtc9sX MkQssPJfYFu6/kY5WN09ACOTxqcvig+gH8VulN6vhcqMBdqZFzNioqqzjebS9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632569; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ybsybKTXjNrzlnpo8lkXdJ4LH70ExT/qm5f/VcZawu0=; b=dr26bORNa6AOZSn6LJfTvF7Cm0i0kuAU7jJ0hgghTDIpCHhW8qZ9AukTXTvQgrV89SFIgY 5IeYL/YWYejhaq9fb04fKVIntTYdC2C7Q1xCx9t+m3h54PJpuzlcHc/bx3BFeAuYp7Cn0r SG7czlpcXgeVt1NMSyvM9W/Z7528ne2xox/KO2+NaawXwiBRErgTL1lxsLOlsMUxnnc/+U 7Z0oDYCyCQY3VSTbpUXBZ7XUuDyRG4iVL3sEhJjt/y6b+7UGxKMM7H8oeXg/5YyVun/lTL yusXlJB70WDhfn4lmCwp2LVcDiaLz8HwDcYoOeJXlJSaRvFuzfjFEv97tuA/fg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728632569; a=rsa-sha256; cv=none; b=RrvV1DyrHsJoDfNfDrEGJ9kzHRnCYRmIzKn9Pu9sLZzZirGOOdVAv7N7v+Q9pv9gNYJupZ e0eTs7+Jie99NRi+F8BDjsWuk0QKNVW9LzwGC7ClAVnJTZjunRYBc7l9xpi4dv9Ij8BSOh gJiLKgHEWoByn88UIrCjQG7eCufIlQ4szT9WzzmWs62fa4eEGsdahuD2/sIo5VQveQvKcj ZHz7tckHGBNp5DAeZ+L6VM6mMYtdACElaISPUW+uN0SUwVXJ7tqG/YzhExceG/H11BeHmt VQHhhMY8zaJYMSOi+ZipjmA12UGJkynXZ/TJXip70P5q+b9X9hDwkE3sxlBB2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPzB167Q8zYrk; Fri, 11 Oct 2024 07:42:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49B7gnxp056835; Fri, 11 Oct 2024 07:42:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49B7gno1056832; Fri, 11 Oct 2024 07:42:49 GMT (envelope-from git) Date: Fri, 11 Oct 2024 07:42:49 GMT Message-Id: <202410110742.49B7gno1056832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= <royger@FreeBSD.org> Subject: git: 72e277f41aa5 - stable/13 - xen-netfront: attempt to make cleanup idempotent List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 72e277f41aa5c31068c7f9c7e237d2926450a1d8 Auto-Submitted: auto-generated The branch stable/13 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=72e277f41aa5c31068c7f9c7e237d2926450a1d8 commit 72e277f41aa5c31068c7f9c7e237d2926450a1d8 Author: Roger Pau Monné <royger@FreeBSD.org> AuthorDate: 2023-11-03 09:28:16 +0000 Commit: Roger Pau Monné <royger@FreeBSD.org> CommitDate: 2024-10-11 07:41:17 +0000 xen-netfront: attempt to make cleanup idempotent Current cleanup code assumes that all the fields are allocated and/or setup by the time cleanup is called, but this is not always true: a failure in mid-setup of the device will cause the functions to be called with possibly uninitialized fields. Fix the functions to cope with such sate, while also attempting to make the cleanup idempotent. Finally fix an error path during setup that would not mark the device as closed, and hence prevents the kernel from finishing booting. Fixes: 96375eac945c ("xen-netfront: add multiqueue support") Sponsored by: Citrix Systems R&D (cherry picked from commit 318bbb6d5a1eae77eb5dc687bcc63c0f99558e21) --- sys/dev/xen/netfront/netfront.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index f6778fd3759d..391bc17e02d9 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -539,8 +539,10 @@ talk_to_backend(device_t dev, struct netfront_info *info) num_queues = max_queues; err = setup_device(dev, info, num_queues); - if (err != 0) + if (err != 0) { + xenbus_dev_fatal(dev, err, "setup device"); goto out; + } again: err = xs_transaction_start(&xst); @@ -667,7 +669,10 @@ disconnect_rxq(struct netfront_rxq *rxq) xn_release_rx_bufs(rxq); gnttab_free_grant_references(rxq->gref_head); - gnttab_end_foreign_access(rxq->ring_ref, NULL); + if (rxq->ring_ref != GRANT_REF_INVALID) { + gnttab_end_foreign_access(rxq->ring_ref, NULL); + rxq->ring_ref = GRANT_REF_INVALID; + } /* * No split event channel support at the moment, handle will * be unbound in tx. So no need to call xen_intr_unbind here, @@ -682,6 +687,7 @@ destroy_rxq(struct netfront_rxq *rxq) callout_drain(&rxq->rx_refill); free(rxq->ring.sring, M_DEVBUF); + rxq->ring.sring = NULL; } static void @@ -713,6 +719,8 @@ setup_rxqs(device_t dev, struct netfront_info *info, rxq->id = q; rxq->info = info; + + rxq->gref_head = GNTTAB_LIST_END; rxq->ring_ref = GRANT_REF_INVALID; rxq->ring.sring = NULL; snprintf(rxq->name, XN_QUEUE_NAME_LEN, "xnrx_%u", q); @@ -769,7 +777,10 @@ disconnect_txq(struct netfront_txq *txq) xn_release_tx_bufs(txq); gnttab_free_grant_references(txq->gref_head); - gnttab_end_foreign_access(txq->ring_ref, NULL); + if (txq->ring_ref != GRANT_REF_INVALID) { + gnttab_end_foreign_access(txq->ring_ref, NULL); + txq->ring_ref = GRANT_REF_INVALID; + } xen_intr_unbind(&txq->xen_intr_handle); } @@ -778,9 +789,14 @@ destroy_txq(struct netfront_txq *txq) { free(txq->ring.sring, M_DEVBUF); + txq->ring.sring = NULL; buf_ring_free(txq->br, M_DEVBUF); - taskqueue_drain_all(txq->tq); - taskqueue_free(txq->tq); + txq->br = NULL; + if (txq->tq) { + taskqueue_drain_all(txq->tq); + taskqueue_free(txq->tq); + txq->tq = NULL; + } } static void @@ -813,6 +829,7 @@ setup_txqs(device_t dev, struct netfront_info *info, txq->id = q; txq->info = info; + txq->gref_head = GNTTAB_LIST_END; txq->ring_ref = GRANT_REF_INVALID; txq->ring.sring = NULL; From nobody Fri Oct 11 07:42:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPzB0616Dz5YRl7; Fri, 11 Oct 2024 07:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPzB05DD2z4ngd; Fri, 11 Oct 2024 07:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHJykXbyCQSylXutRA7oF9RJktruKronxqusmNB00w0=; b=p4Obtykn/EMAkDtvXBWo6ldKvrW+5TOMe+4ZDflV76SeKlMoT5ASRADrHmVtldkFfO6upa vmSIp0Ez+PY5QWqBamqpdg8IyuQkU4j5ARbB21f/wy+Wqo150vDkfvBmnaBPjUtPLps73I poJXm7xggNrdq+M//Ix2hPoYdr0T9x01V/TAUEVrM//Dqj6Y3DcAvRfsurdA0WDwTuxsKE 1krPO2s8LN7HwMNNpTMx+jilCNEwABWIRwi2pHg7v6tGosvoyxhwm6b5A/YQeyRngLUDop rG6HvuFgFCHt3AUCavFjGN96IRPsHEC7UJg0sFLRUZqLsoNB+SDoPsBEZ6LyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728632568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MHJykXbyCQSylXutRA7oF9RJktruKronxqusmNB00w0=; b=TIY9vWw/mokRuVSWURLRT+zp2HjIX3vT6jOchCtPNhHdIuyQMmsKNiuArp1tKdAbOQgdyC suIQo8kcER3MVwZeOVmXtilzNOag7xDF/D4w72Kkytl8b730b0Lm3gA9fjy++I95hqmKY7 IPYlij6xiXwR8OpMIvs917SMlzO1SfyrqUN3BqVTF+m87jzmXz7Ra9SaKEPmZYWTTL+snW sOfUZ5qna/7vFHUK4mZnX8IN3v2I9be5v0Rx++Yua+YEYCkjk72RKQ+wuOzVF+h7x+wgrZ q+wBJIJJmuxkEkL96oF0ZhuMuSqGARuxdj+gHMm74wbyuhBLBA5ux89cPBJVKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728632568; a=rsa-sha256; cv=none; b=WRM1RUVXfE8naDY8L4Iz8Z0hY9ctD+E6wZ70TLJso4FRI4TBMhBDaF8kxZRvJ/6SCWBhsP WCULQduaWrLLYPGE/ELsajIHl2SLghg1F2aatYK2vStq2GIVZ15tq9hsGu8yPvptQcje5/ zIoOtI4gOi/7AUPbpHHIaLmaraP2uv6hh2Y9jh6Q7TCA7EcBv1fpvbGkq15m640nv0+P46 OXaoMiRpYeQcmrxJpz7TZLBZpchYwkKJ7ppTsjSGqMAJFBhhHVv6av4csGcLl2dRxmBRQA EsnPLTELpOXYn9Q1W9ppuIN3g13o5MVfWLmCh5WmVEAkpqXvIGU4+ksfGGHVUw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPzB04qLdzZ68; Fri, 11 Oct 2024 07:42:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49B7gmHm056784; Fri, 11 Oct 2024 07:42:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49B7gmwu056781; Fri, 11 Oct 2024 07:42:48 GMT (envelope-from git) Date: Fri, 11 Oct 2024 07:42:48 GMT Message-Id: <202410110742.49B7gmwu056781@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= <royger@FreeBSD.org> Subject: git: 7174b9817cdd - stable/13 - xen: fix initialization of grant table frame array List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 7174b9817cddb72abb9f0d8cec8689b498de1d97 Auto-Submitted: auto-generated The branch stable/13 has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=7174b9817cddb72abb9f0d8cec8689b498de1d97 commit 7174b9817cddb72abb9f0d8cec8689b498de1d97 Author: Roger Pau Monné <royger@FreeBSD.org> AuthorDate: 2023-11-02 17:23:25 +0000 Commit: Roger Pau Monné <royger@FreeBSD.org> CommitDate: 2024-10-11 07:40:16 +0000 xen: fix initialization of grant table frame array The current sizing of the array used to store grant table frames is broken, as the calculation: max_nr_glist_frames = (boot_max_nr_grant_frames * GREFS_PER_GRANT_FRAME / (PAGE_SIZE / sizeof(grant_ref_t))); Is plain bogus, for once grant_ref_t is the type of the grant reference, but not the entry used to store such references in the grant frames. But even if the above calculation is switched to use grant_entry_v1_t, it would end up as: max_nr_glist_frames = (boot_max_nr_grant_frames * (PAGE_SIZE / sizeof(grant_entry_v1_t)) / (PAGE_SIZE / sizeof(grant_entry_v1_t))); Which is pointless (note GREFS_PER_GRANT_FRAME has been expanded to (PAGE_SIZE / sizeof(grant_entry_v1_t))). Just use boot_max_nr_grant_frames directly to size the grant table frames array. Fixes: 30d1eefe3937 ("Import OS interfaces to Xen services.") Sponsored by: Citrix Systems R&D (cherry picked from commit 1a12f0aea81b57d0dd2374047b8f4c97a037a8df) --- sys/dev/xen/grant_table/grant_table.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/dev/xen/grant_table/grant_table.c b/sys/dev/xen/grant_table/grant_table.c index c68c9331233b..df6c13dd8507 100644 --- a/sys/dev/xen/grant_table/grant_table.c +++ b/sys/dev/xen/grant_table/grant_table.c @@ -631,20 +631,12 @@ static int granttable_attach(device_t dev) { int i; - unsigned int max_nr_glist_frames; unsigned int nr_init_grefs; nr_grant_frames = 1; boot_max_nr_grant_frames = __max_nr_grant_frames(); - /* Determine the maximum number of frames required for the - * grant reference free list on the current hypervisor. - */ - max_nr_glist_frames = (boot_max_nr_grant_frames * - GREFS_PER_GRANT_FRAME / - (PAGE_SIZE / sizeof(grant_ref_t))); - - gnttab_list = malloc(max_nr_glist_frames * sizeof(grant_ref_t *), + gnttab_list = malloc(boot_max_nr_grant_frames * sizeof(grant_ref_t *), M_DEVBUF, M_NOWAIT); if (gnttab_list == NULL) From nobody Fri Oct 11 13:40:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ7744tHQz5Ytvt; Fri, 11 Oct 2024 13:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ77447fMz4bf6; Fri, 11 Oct 2024 13:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728654048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qLG/baVGT0hYD/7ETrZKPWWkjaaCCskDvVqvxFN3Am8=; b=gElIYFebeoqJqU4stJyM04mx1KqZi18Ko28x1AHzL/XGE8adT0bpWxtNMHjTIT+ZpPm3Qz FAZukUXcjvx14m+3ZPFbezMY1HTi0+0PbByFra4zUvCHCcQByVjNQ1K0bXq63TRdZt/ODA UfC7ca3rFfZjqADEgTOVT0Dce7iL4AFPr8eQX4BgnXOPEQ1Rt9vnZKO2vbMt4rPhraiXom yWQ/AexqLyjgqLfEwqErYhHjamAyXlEgstnPkn9oW2YxFusI7U1R9Q/ZpYoeBhabZUV2yu UOUER7U9Dbnt/xmrqgM2N6DyEeP/9/lys3ILJciCTfCp6uJxjO19W/Oh079wNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728654048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qLG/baVGT0hYD/7ETrZKPWWkjaaCCskDvVqvxFN3Am8=; b=uiyEtfjDQlq2M7n/oE1qDa+3+uE7P0DzVhUe4SObGsTkNqBoyOvBwjMDxqtDP1BS1WEs56 SyiMYR0zbTBCs07dFoSPVL53Gy1tKoh+VPmX4fyj/1o1XBS0rTEfHIElKQHdkPmiWI6qmb e41TJRNNhsKHgLuthjMdSUFA1AJdZjfwful+1y97dLUjXGsJSOqAYg2+DZDJCBR7zM/b3a FJKG+pDUh980I6TgrEL2matbidtW1vpUe0Ixtj/oGSBsQSThmpLUgwfIr+8bnJgspKUF1r YVE0wy/h5PpPHrJdSEJtf/cy1ZoRe1kDMEU7l4vqxklVXC9HsJOjnLLTwiB3eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728654048; a=rsa-sha256; cv=none; b=ZD6Q+dhypbzq+S2UkWbmPYNRvHuOvIPbku1YvNbVUZlt5dS2+MYR6nWpFNixZLeOwRhS0n 3Tg2o/2wHkLh9E57KXKJ3B92gRSvFuZSfrG7r3mAvvVRBDxL2d9l6lkH6iXP8l61st7uY6 1wwl40Bj38lwjeGZYX1yb06WveXgfTF1misT/aVx43uRYxIVXv2ugcaqQfYtqBlvM2SB01 wKVu9vkjKSBIkxacXAGosxhRGC2Jk68OLULm42tuxJw+T4ua0YidyknNMQZdmgzMmfSAPh I5nCtUfm5zmatB8FsSNUM2uH9f0kPi35JLqQBUwWjIl4O80albRgLY3KrEpHRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ7743KqpzkTN; Fri, 11 Oct 2024 13:40:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BDemDr062194; Fri, 11 Oct 2024 13:40:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BDemxM062191; Fri, 11 Oct 2024 13:40:48 GMT (envelope-from git) Date: Fri, 11 Oct 2024 13:40:48 GMT Message-Id: <202410111340.49BDemxM062191@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost <kp@FreeBSD.org> Subject: git: ff5a685270a3 - stable/14 - if_vlan: handle VID conflicts List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ff5a685270a3946bf7941e82bb77528670b3aba3 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ff5a685270a3946bf7941e82bb77528670b3aba3 commit ff5a685270a3946bf7941e82bb77528670b3aba3 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2024-05-21 11:31:13 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2024-10-11 10:04:09 +0000 if_vlan: handle VID conflicts If we fail to change the vlan id we have to undo the removal (and vlan id change) in the error path. Otherwise we'll have removed the vlan object from the hash table, and have the wrong vlan id as well. Subsequent modification attempts will then try to remove an entry which doesn't exist, and panic. Undo the vlan id modification if the insertion in the hash table fails, and re-insert it under the original vlan id. PR: 279195 Reviewed by: zlei MFC atfer: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D45285 (cherry picked from commit bdd12889eaa64032b3d09ef47e9a6f7081863378) --- sys/net/if_vlan.c | 10 ++++++++++ tests/sys/net/if_vlan.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 206d46e7f9be..c586b513e008 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -1702,10 +1702,20 @@ vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid, ifv->ifv_proto = proto; if (ifv->ifv_vid != vid) { + int oldvid = ifv->ifv_vid; + /* Re-hash */ vlan_remhash(trunk, ifv); ifv->ifv_vid = vid; error = vlan_inshash(trunk, ifv); + if (error) { + int ret __diagused; + + ifv->ifv_vid = oldvid; + /* Re-insert back where we found it. */ + ret = vlan_inshash(trunk, ifv); + MPASS(ret == 0); + } } /* Will unlock */ goto done; diff --git a/tests/sys/net/if_vlan.sh b/tests/sys/net/if_vlan.sh index 458e3cc36bc6..41dac6222cbb 100755 --- a/tests/sys/net/if_vlan.sh +++ b/tests/sys/net/if_vlan.sh @@ -297,6 +297,42 @@ bpf_pcp_cleanup() vnet_cleanup } +atf_test_case "conflict_id" "cleanup" +conflict_id_head() +{ + atf_set descr 'Test conflicting VLAN IDs, PR #279195' + atf_set require.user root +} + +conflict_id_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + vnet_mkjail alcatraz ${epair}b + vlan_a=$(jexec alcatraz ifconfig vlan create) + vlan_b=$(jexec alcatraz ifconfig vlan create) + + jexec alcatraz ifconfig ${vlan_a} vlan 100 vlandev ${epair}b + jexec alcatraz ifconfig ${vlan_b} vlan 101 vlandev ${epair}b + + atf_check -s exit:1 -o ignore -e ignore \ + jexec alcatraz ifconfig ${vlan_a} vlan 101 + + atf_check -s exit:0 -o match:"vlan: 100" \ + jexec alcatraz ifconfig ${vlan_a} + + atf_check -s exit:0 -o ignore -e ignore \ + jexec alcatraz ifconfig ${vlan_a} vlan 100 +} + +conflict_id_cleanup() +{ + vnet_cleanup + +} + atf_init_test_cases() { atf_add_test_case "basic" @@ -306,4 +342,5 @@ atf_init_test_cases() atf_add_test_case "qinq_dot" atf_add_test_case "qinq_setflags" atf_add_test_case "bpf_pcp" + atf_add_test_case "conflict_id" } From nobody Fri Oct 11 15:26:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9Sp3qL0z5Z2Bm; Fri, 11 Oct 2024 15:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9Sp38QMz4nbH; Fri, 11 Oct 2024 15:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fdTydFQKd7xDcJm34ywAo5bda/vWBiR0lbWAAiAb26w=; b=Z3imhT6ylIWcgeFBE1SvSXp1zUxTMARHy1bl8CwasM7tYuhqBxyqAS1ETk3S2Yr/yryMni 1TIKZNfvoRPy2B1eKP8caTYV0jrPNPI/PpIMf8OyhGdyua92ScRHf0HyktLrpmZmeeFvci t7jlAu8Z1k+DIFzzUtEedH3WMVV/D5pI9ekEtO87M4pjMiC8mOgTzW0so6Pii8l+ryzdni razRLVYP27dGNFO8RcwmggOmc+Kcu4VCcbssRvg58CxGK6/yGsRh+AUFlp/L12ykqSoF1e 5PSl6lQCq1HfCc+Vjotl1cryLGtxDCVEBUShu9ewaoFLqF4p8sKHGkegsIwVkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fdTydFQKd7xDcJm34ywAo5bda/vWBiR0lbWAAiAb26w=; b=oYUwmhM22+EYcZ1kdJ+yvPTi0fZQfBsOlLq14lgMIyQt6/aOPcltFHjIjWLQ4MMUyBYhSS NDQMGt7sBoFTcHTxxoe0DHPkZ77wpOcf4dEKPMC4hp1pkjY+66t2n6J9guD0ZTu5IoRwOz EpFA03Fsckfrjy0SkBztco5rhADOxuuTD0I9xRdN6OClGA2N0T/e73oG89ghCvBl4G7+25 5NUUoeQhUNhaPLOPe6fRCKPSykERD3euN53qn7GdReRe7DTew1CyiKrfZjODbBj7bTQFGn hJra3vu/+XJBJ18pmvnk/wYdigq+XQnO3Dr5gUvCjtGBf7asfdAmlrZjyOjW9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728660378; a=rsa-sha256; cv=none; b=DJCXY422iTlu0MnVNYLg3UnTXkGG140uutTgJc+GM2Yfj0c9UelW0IjFPHXTXeXEMuHY5q fMF2lnokn9eaiEHwWV5mQaG9K3mI2+c6Q9+rVGUjpQQQPOENjJIpHc70qcOH5EUzIsfHV5 K+kqcmPkYnNKOwE0TXz74sv+tPdb+F/j5KZmuL24Ix9vTFeN37pVg5I7VikO6kYiIXtCK+ 3xIuR2A8TMq6TWATA/z6zN5KtSW1f/LLtIK7T9xC+BK//c1LNlvX4uHgOm0gqR6bH4kOIK 9x9PgbzErYS7bsiXbuUrOfl9W9At13CZFlFflg2cW7mwdiyoApAnjJqenFemNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9Sp2lzYznKQ; Fri, 11 Oct 2024 15:26:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFQIrB037764; Fri, 11 Oct 2024 15:26:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFQIhr037761; Fri, 11 Oct 2024 15:26:18 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:26:18 GMT Message-Id: <202410111526.49BFQIhr037761@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: e7f3888b31c2 - stable/14 - capsicum-test: skip SCTP tests if SCTP not available List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7f3888b31c23ef3e26dc2bc04accf03ef943517 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e7f3888b31c23ef3e26dc2bc04accf03ef943517 commit e7f3888b31c23ef3e26dc2bc04accf03ef943517 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 20:04:05 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:24:55 +0000 capsicum-test: skip SCTP tests if SCTP not available Skip the test rather than failing if SCTP is not available (e.g., if sctp.ko is not loaded). Also submitted upstream as https://github.com/google/capsicum-test/pull/61 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46999 (cherry picked from commit 1d83090d850f627b6d6ebe7837e807df5d29799f) --- contrib/capsicum-test/sctp.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/capsicum-test/sctp.cc b/contrib/capsicum-test/sctp.cc index 5f0d169456a8..76302059fa19 100644 --- a/contrib/capsicum-test/sctp.cc +++ b/contrib/capsicum-test/sctp.cc @@ -61,6 +61,9 @@ static int SctpClient(int port, unsigned char byte) { TEST(Sctp, Socket) { int sock = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); + if (sock == -1 && errno == EPROTONOSUPPORT) { + GTEST_SKIP() << "socket(..., IPPROTO_SCTP) -> EPROTONOSUPPORT"; + } EXPECT_OK(sock); if (sock < 0) return; From nobody Fri Oct 11 15:26:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9Sq4Gnrz5Z2F6; Fri, 11 Oct 2024 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9Sq3p0Sz4nly; Fri, 11 Oct 2024 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4bvVizXYiHO0w8WcBJ010brsyehAvwBi/cOLY4W6Vg=; b=jljE+q313rIvARctx0/tvx29gJynW6B7z4fQj54GkArCHnL6mIk5WxhCxFJImWcaw57IuN zZTaox4b0kJTTWZoUQ8D2POT0zaU9+8BlH3qhY5murz5RXj9qK+knTP1c029wav9JixVX+ CdEEpFqqhzQrdVoJbL4gZ3jKS5Yq2dOVWwxRqOcCcDUj8JNA+iVmRqyUTS+0+F7RHy03Sj erL54Pt+vf4zVfbANl/ugXWBnSrzbJ+LncORpPzypzIHYD0eeGu9IljD2L+aALNssUiJh8 rkZhCZfJueCqpZZ2OM8pOLvLElogGbpxrpYLXsCRZztOEf29yHEaIp+rVXF9jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=O4bvVizXYiHO0w8WcBJ010brsyehAvwBi/cOLY4W6Vg=; b=vVu+qzhJfMDB6mH8Kh1NdXadVNIFkNhXSUNh4RZ3Re32JnIK1yOo6PvIDLGXN0ecw1l/Z9 w4883XgQXWN7glmbgzCEwLeprOLrPtx948MVL5/X6/NRmujvNTCw2Q340MJ2WVLRfBPPd3 a1Cl7KFgxzNy8W6I3NkwaCkvEmL/Ir9N28f4rFBy/++KKoYKL/bFZNnKgoq5N75JTjZeCB qL0YNvS44M+5UCo7DEfNb0q+T1V9dImPXB4I2Ka7z1u4dkskWiFc+Sb4JKJkM0bKhuDqdk A1l0o0at4ZMKSUKIV8MNhS5QXYfLomO39yKLj1CjGDQZY0crQ9z31XgHkkgVuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728660379; a=rsa-sha256; cv=none; b=A4ydkpCXKKcq7PxdNEueD7GGUJEyrY3YBqGzny2EVuAFgmXMik9iLRlE95ghFtr5cCCgbF CKiWBOlH4RLDM2+vqw9ltizKBXMLH4ry/HDpoU6vAzlUOj4dWVotYGYDO5hIzkLC1UufFK DqPP7aT0VEcECtCWoAqj1PnmJ5ivV5TXuAlXBBjCUQXpugZSRyimWC86SkYne7ph+XO1VN ut1r7xlBe19h2SCPNgrni4put4ShbGU63i2fFkkXBzsbTnyV0UA1DFKPkUa1fhfzhkmJu/ hkRM0cbTnIgyzftia3N2fnAjNMskJ8lc+15bM2Iw9vxtuToOtOFfjBuEHzBn6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9Sq3Pc7zmx9; Fri, 11 Oct 2024 15:26:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFQJwp037804; Fri, 11 Oct 2024 15:26:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFQJbv037801; Fri, 11 Oct 2024 15:26:19 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:26:19 GMT Message-Id: <202410111526.49BFQJbv037801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: a8458496b4d9 - stable/14 - capsicum-test: include SCTP tests List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8458496b4d98962ca194e93b039dba172d7753d Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a8458496b4d98962ca194e93b039dba172d7753d commit a8458496b4d98962ca194e93b039dba172d7753d Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 19:18:33 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:24:55 +0000 capsicum-test: include SCTP tests HAVE_SCTP is #defined in syscalls.h, so move the #ifdef after the inclusion of the header that #defines it. Issue https://github.com/google/capsicum-test/issues/60 is open upstream in case a slightly different version is needed for Linux. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46995 (cherry picked from commit e4550c9aa06af54d066c794f1da14f7c91bb5bc0) --- contrib/capsicum-test/sctp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/capsicum-test/sctp.cc b/contrib/capsicum-test/sctp.cc index 76302059fa19..c8c642454a80 100644 --- a/contrib/capsicum-test/sctp.cc +++ b/contrib/capsicum-test/sctp.cc @@ -1,6 +1,5 @@ // Tests of SCTP functionality // Requires: libsctp-dev package on Debian Linux, CONFIG_IP_SCTP in kernel config -#ifdef HAVE_SCTP #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> @@ -12,6 +11,7 @@ #include "capsicum.h" #include "capsicum-test.h" +#ifdef HAVE_SCTP static cap_rights_t r_ro; static cap_rights_t r_wo; static cap_rights_t r_rw; From nobody Fri Oct 11 15:26:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9Ss1Xcyz5Z2L4; Fri, 11 Oct 2024 15:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9Sr6CKnz4p0V; Fri, 11 Oct 2024 15:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WLXBV2Qpntb2M/jXvBLMjic0fu79SlasStvLkvn62YY=; b=oNqQIlGgHnw4ROPZUqAcrENm+9yeLeMLEMe7BxbgpmvdZ0VNbH/9SdXbaoBor7IjlMPs+D uMBaSu38qCZmjCLBerFncIeGnu/jpgO8t+3mtKhXCk2+DMLegL6aAw2HuVydKhuMR1gNlF oFJi4ObIK2OyLZQsT2SaLMUxKJwJKrXFyYuyWx4Ce8AkjRiQztyALMe0dBAvBqPNyLcbMV LVX3FpsWeCVyrIX6ZYGpBe/D6YU6Mk9yhKpFCliaz/CGBJ7aYNJ3luVB8MxbMbY6KRExp7 +GMlCThu6gL5Tx6rwLSQQ73YDT5Ffbd6ctj4LfypD+yRkF7whjf4RyzbB5G24g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WLXBV2Qpntb2M/jXvBLMjic0fu79SlasStvLkvn62YY=; b=JtJHdUUSkoFn+Hj4xJWMjs8qalHWzDck6tkk5qGdke7wSVVYXPRPo1v9XeRBX9sg3aqxYn We7+Ils3GZWczG7qkKyi7eDiAhh+CY7ComRncPoa0dexzfCfCLol/56EctJCiZKjHo0iZG 19TIXXALIpnFu7sdd1GK/iSnYrb9Qbt9OiN/R44T/wKizqmVr4pCPt9heJN8qzxnrgVvrM 5YdhyjNcRIA/DxdPBSSiqsllxrLkgEhxP/FIr3vea4vhnhtogJJT1BcmRx6/YlFCzb7fgb FhMewTVoRYgF0Ka8S+vUfAjRI55xGydE96qhi2dqEXugTkDUroLytMlvi/9QTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728660380; a=rsa-sha256; cv=none; b=grARErvk3fJ7NpvWgHcfpfgF6FbZJr4dZCaU0gVr+rBCkLSz3+u60MbdMKhIzefnkX+gY1 7j664rXk+XqDWYY6+rF77/CaSxgW3g3cnAkZREn6tEoyme5v3/q8USNIryMMeqOH1ZsvKC EE6S//F89AVY/MJs3zqdJnjW4I+YJ7zkvh/AuVQy75m4gEsvPIigVlaTrRWppfGrMBduEP ZCXPX8UaGsSWogApETLXDhwkAL80g1UeQc1E68MitSesk/1sbM0xJ5WW3rHat8qVV3ApcC AY2CCW3/3IAVwVvEPCwxrdi5Vmt//H6Sxvp0IpMeCBsNETJim3YLJAFmrg0ssw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9Sr4QcSzmsH; Fri, 11 Oct 2024 15:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFQKQ2037849; Fri, 11 Oct 2024 15:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFQK6B037846; Fri, 11 Oct 2024 15:26:20 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:26:20 GMT Message-Id: <202410111526.49BFQK6B037846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: fbc593342cbf - stable/14 - capsicum-test: rights are propagated on accept(2) List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fbc593342cbf1ba962cf3266a245402169c0ffcf Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fbc593342cbf1ba962cf3266a245402169c0ffcf commit fbc593342cbf1ba962cf3266a245402169c0ffcf Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 18:26:58 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:24:55 +0000 capsicum-test: rights are propagated on accept(2) As of commit 85b0f9de11c3 ("capsicum: propagate rights on accept(2)") a capability is generated from accept(cap_fd,...). Enable the corresponding test code. PR: 201052 Reviewed by: oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46994 (cherry picked from commit 6684779b321590c71f162390bcf28feee2a3b967) --- contrib/capsicum-test/capsicum-freebsd.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/contrib/capsicum-test/capsicum-freebsd.h b/contrib/capsicum-test/capsicum-freebsd.h index 96ceb9b6d5f1..da7bb38f073b 100644 --- a/contrib/capsicum-test/capsicum-freebsd.h +++ b/contrib/capsicum-test/capsicum-freebsd.h @@ -59,10 +59,9 @@ typedef unsigned long cap_ioctl_t; // Too many links #define E_TOO_MANY_LINKS EMLINK -// TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on accept. -// FreeBSD does not generate a capability from accept(cap_fd,...). -// https://bugs.freebsd.org/201052 -// #define CAP_FROM_ACCEPT +// As of commit 85b0f9de11c3 ("capsicum: propagate rights on accept(2)") +// FreeBSD generates a capability from accept(cap_fd,...). +#define CAP_FROM_ACCEPT // TODO(FreeBSD): uncomment if/when FreeBSD propagates rights on sctp_peeloff. // FreeBSD does not generate a capability from sctp_peeloff(cap_fd,...). // https://bugs.freebsd.org/201052 From nobody Fri Oct 11 15:28:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9W02LBTz5Z2fZ; Fri, 11 Oct 2024 15:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9W01kMXz4pT3; Fri, 11 Oct 2024 15:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48Vu323yHvSPOFva9ivl7k3jbOVq3XjFGHaBJ5CuNY4=; b=JsBwp8gkAj3T6CJk6gk3SPYaCw7juERIOxj2X5HUgbw2MzuCiueJuOvNf6illkHmLviKoh CQULnvDoD2nAJvbW2T9TWI7se0dCdaeQGclnzZh1UfZD8xy/7b2T7dEyHr7LWPAvNBVLpJ H+GpUwmKIVeyIQI0tLFf4jCMZKbV1OPkqNwBq5O5FCiLSh8tnpqNFHdzWES1AZaB+l/d37 4W45eiJ5x+ihgvj9af7mUXpTCz+25s8UK0v/yq2+C3dsthy4Q3peJWBHNY5g1eQEfS34Hk E4/Os4ZkRcjeOIMwNU1KAdMnc3Hzj03IlYgoZdCbHILCwocVVBEAL40h7QY0ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=48Vu323yHvSPOFva9ivl7k3jbOVq3XjFGHaBJ5CuNY4=; b=cwbsUn4i8lCelKqBbj9XjzfZGQ9dIoa9C9YahGr0st2zbEf5dtVeNufXOFOpo9SSqdhFUL S8hIkyBqyy8jebEVsWJFIo6SkqnTF2QUo5Wfxq4yB7a4tWCmdO/TbQzJn6xFXrgFqwzmUx w8WmI2LqEF20+uD41zvJk+qT7xRIq5wqLSmfMFQDQ6vpgrBdlym7JrymqPXLHmCOi3ygKY Rn0GswUIEOrdyOa2Yoya5DifQwt3+hTcDnINsJGmFgY+satcMvdcDB9blPw3mXUadyFtMB 9h981nANBPBkpOt5N6/HWnP8czGKMG6sa9G3a2YN1Js0W019cgLTkqAdQfKUxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728660492; a=rsa-sha256; cv=none; b=FLUaHgj0xcf5tFB688zq3L6ixfIu15Gae8NetDWzX+xXHHSN11dkePd18kpY2KmGQ4SE/c bfw+KyqTz0EQ3HpYItulzQbVG6DMll09BPaA/mreMG3WCQYVuR30KQDvYyHO+fyweVY8DE J4fLT7cbgnv1XwVajMCgMDD/n+BA8WN3XWaLhQYTeyRGSuuLH8EkKqFesVHJ5XzZn3+ftb Q+b3+O/iTSD0PAwayMn+Q22vXNvLtc8zPBdLUz/M56ZVDi+771+VP014YH3FVT6d2n8nyp 1nk07NBlFb9xyu4OLI+X96PR4YbJevIGWTU5DbrEqwy3qiujQoXL34G9+1nPog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9W01KtrznJr; Fri, 11 Oct 2024 15:28:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFSCm9038260; Fri, 11 Oct 2024 15:28:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFSCgB038257; Fri, 11 Oct 2024 15:28:12 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:28:12 GMT Message-Id: <202410111528.49BFSCgB038257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: fef1f3fecd5b - stable/14 - pkg: prefer .pkg extension List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fef1f3fecd5b6e7bf040f6dd2e31177332c3c0ec Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fef1f3fecd5b6e7bf040f6dd2e31177332c3c0ec commit fef1f3fecd5b6e7bf040f6dd2e31177332c3c0ec Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 15:11:09 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:27:41 +0000 pkg: prefer .pkg extension .pkg is the default extension as of commit c244b1d8a387, falling back to .txz if not found. PR: 281924 Reviewed by: bapt Fixes: a2aac2f5e564 ("pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz") Fixes: c244b1d8a387 ("pkg: settle the uniq extension to .pkg instead of .bsd") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46977 (cherry picked from commit f5c847ae849aab9354d0956afd683f1c90bfd91e) --- usr.sbin/pkg/pkg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 0689c67cf822..b78565b9437a 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -896,7 +896,7 @@ static const char args_bootstrap_message[] = static const char args_add_message[] = "Too many arguments\n" -"Usage: pkg add [-f] [-y] {pkg.txz}\n"; +"Usage: pkg add [-f] [-y] {pkg.pkg}\n"; static int pkg_query_yes_no(void) @@ -1168,7 +1168,7 @@ main(int argc, char *argv[]) if (add_pkg) { if (pkgarg == NULL) { - fprintf(stderr, "Path to pkg.txz required\n"); + fprintf(stderr, "Path to pkg.pkg required\n"); exit(EXIT_FAILURE); } if (access(pkgarg, R_OK) == -1) { From nobody Fri Oct 11 15:28:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9W13q83z5Z2S6; Fri, 11 Oct 2024 15:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9W13Mtvz4pZ7; Fri, 11 Oct 2024 15:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z1oRj+eI8+BAm2sp7iLnG80EoUaUxE/HnoGs9DFevIs=; b=GOwvGf6EOiOjpi+Dtmt5rIXJkv875g9VfuL3pJYJ15nhUzlR6J0DPuc2tR96HnScEFk2r3 Aq8bxUHgKItgmqj6Uu6bzimb3OZpXN9AzzEnMHI36fZtWk3xdsOzxbcLn2S3cEHfBdaRFY IQ8p6YfEzTb22yoMt4pd1RYJ3gSKS72vDxSjwopLlDC3BurB2/qJMxJvhyQxbLv4u/yt0H wW+QLWxXwvn25IEedPTxnirbIqZV9lZxmdl9xc3SIhW7+6moZzSmVQx+kdQZkz2r+CSlGG ykkGBKAzaBKABG1xPMqajxcd0W+sck9ck38TYTDy3En5nWx+JVD5iAjnLDK89g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728660493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z1oRj+eI8+BAm2sp7iLnG80EoUaUxE/HnoGs9DFevIs=; b=m7f49VBvnNjybC1cqqi7jsJ0tRIuRp/VdgGnAn4ENRDY6LX+kmQ5xW0TsSOJ6o9ZypwHzZ hhuCegrau4amPSHBym9Wcd46E46qwEjzsjUfeHd/HmHs6CYvWAEO8VwZfbD4CkWUM11aLu eywlEIvtTgx6B/ojswvKrVvovFOqIiINtDBbTa51XxKa3uOIpqpvD/LNB2qtjrFrEt24BL abD9mEH3CXvaCZx8UgiVYrY8djC8zaiOF2LaV9MksmZ9PeJ20i7qM5lk4g6KSp1yULkkg5 aREW4y00MyPS4MDFg6fmFOyJR/kzRBTsSwStVcy2aTJLrtp9r+n0wuGX1ogekA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728660493; a=rsa-sha256; cv=none; b=auAwe2ZtoP6SmX1qJXyXt4H8Abf6wubLWQ5lKTVgii3EbskBFGsG/a+fV87CG3MNmqXQEw 73X5VlTY9M1ALCS7dmX09FjuzPT85sVsjNj7kWUybNpMVUs0NA6IWN+nuWd0TrEUs2EhG6 mdKkzMCd2fuq8O7U9ChfnWE4Ht4y2MojCohF6knaYuPopoc0X9KwGkRdXpjNLdvn9ZJwtc U+rvZSLWX59SGEVP7qcDd/dI3QdWeNzSpFewpD2AJEo7PEMMeFEZcQo87IIR4VPZ8f71ri ozKex0uD5SdcEGuFms7whtreEjMx+sXopYnR5DtdzSBXuUhMABYD6BwnTAX1WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9W12Jdzzn6W; Fri, 11 Oct 2024 15:28:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFSDmE038299; Fri, 11 Oct 2024 15:28:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFSDHW038296; Fri, 11 Oct 2024 15:28:13 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:28:13 GMT Message-Id: <202410111528.49BFSDHW038296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: 2f29060f4613 - stable/14 - pkg: improve error message List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2f29060f46138bbfc52c5944825293d598cc68de Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2f29060f46138bbfc52c5944825293d598cc68de commit 2f29060f46138bbfc52c5944825293d598cc68de Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 16:33:12 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:27:42 +0000 pkg: improve error message Print the complete list of url that have failed PR: 281924 Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D46983 (cherry picked from commit be9243409d6be99f5d7815b6d074a85a6e84f7ce) --- usr.sbin/pkg/pkg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index b78565b9437a..bb42526f56cb 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -856,7 +856,11 @@ bootstrap_pkg(bool force, const char *fetchOpts) goto cleanup; fetchfail: - warnx("Error fetching %s: %s", url, fetchLastErrString); + for (int j = 0; bootstrap_names[j] != NULL; j++) { + warnx("Attempted to fetch %s/Latest/%s", packagesite, + bootstrap_names[j]); + } + warnx("Error: %s", fetchLastErrString); if (fetchLastErrCode == FETCH_RESOLV) { fprintf(stderr, "Address resolution failed for %s.\n", packagesite); fprintf(stderr, "Consider changing PACKAGESITE.\n"); From nobody Fri Oct 11 15:42:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9q72gZJz5Z37s; Fri, 11 Oct 2024 15:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9q727P5z4tnt; Fri, 11 Oct 2024 15:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728661331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J7FTP5ma12LccVMVT1orpL9L0W0vXUPd7THbnLH69zw=; b=X3nXy4XCjzy2HeWEvlBRbsiU3shprPU3OZdS2v2CPvn2izxWGqPRs8d3NjV9ffbVsnGtOZ JhQ3yiJSu2bhYcKCRYh/5J1l5ELanJsMiX9wMGaWkdjACblcWX7Ogc2J9LDG7NWDYQxupM k0na0ao4jTPsg8jjHumRW9RrTzsW0PiQGO4qXwjFBvAf17wSDcUbd9bfRHeUXoU1GuRdck e3lqxFWRrJCvPr3AQDT6UGQImYjv0jIEyIl8oqiBCtjupbaqeculW1YdwhLSuEPAXb4+uc eZ5kwzF86DuLTCElzoQHUsGzMPmk1Xe+lfSUznuQbRlBtsdZB+Px6QAAr5AmNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728661331; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J7FTP5ma12LccVMVT1orpL9L0W0vXUPd7THbnLH69zw=; b=CkKkJ41riRWnMgy4ezoBYtt16BZ/OWX6icXaxyTeh++ALXoPL9BAcEwAcOd2gfZrWRXJyY yK4PuSFo0ET4RodL/FYfxvmRBMv1eiBeTaIOcli9jx6eKT0LeFF+i6vPyaKWhVcOVeJj4U u7gL2E5RycXI2Lvm8e3Wx2U54lcaZHrcfxmTOt1E0XLtAdNPTFzm1MObD6HQybdowDL0J/ daR83/gLSzbEsv2FwWsRX5kPERozm9YFg7xQiV5txHom34z0qCftqUOU1U+6gCoEYY51Oj LNqfzuY/fyaP2pwIqEqqZpagJxgJHsNLYBbSF+SqSje55BQqBM9XOeiTpbCymg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728661331; a=rsa-sha256; cv=none; b=EA6p+9JKpQrxGbVYBYKh33O17IruXaEmRKQAe1+VxnBESSfCNZGoG+lfWsDx1LGEXuzbGQ 2vNBRpvRzOg1Q5dEyX/bWYq85q8hQyf7vEFZ5Tz29gBVufwYNsvm++YGa8Xwa0GeFZ/E9B ET45oqJNHbY0OmNI4qp0GhPJTcFnL0YIDNqf41Vgq0o64U2+vThjklc5CEpfpl2RzDPFYH 9pLwfvXis28XX7x9mBdm/qYP2MQyXwKDlfIQwI8UOhkvoGZUjxI1YXRhKklEY2dKkl6DqJ r/teNpJzAkdQOT6Qrdqw0pEJL7MvS5bA/e2VhMDQbqIJrzwa2JcXBULfJJmIyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9q71kp4zng8; Fri, 11 Oct 2024 15:42:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFgBek067788; Fri, 11 Oct 2024 15:42:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFgBC4067785; Fri, 11 Oct 2024 15:42:11 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:42:11 GMT Message-Id: <202410111542.49BFgBC4067785@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: a5be19efbb7c - stable/14 - bhyve/nvme: Fix out-of-bounds read in NVMe log page List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a5be19efbb7c6b07d574ef048b2ebade00440873 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a5be19efbb7c6b07d574ef048b2ebade00440873 commit a5be19efbb7c6b07d574ef048b2ebade00440873 Author: Chuck Tuffli <chuck@FreeBSD.org> AuthorDate: 2024-09-19 15:11:30 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:34:27 +0000 bhyve/nvme: Fix out-of-bounds read in NVMe log page The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c is vulnerable to buffer over-read. The value logoff is user controlled but never checked against the value of logsize. Thus the difference: logsize - logoff can underflow. Due to the sc structure layout, an attacker can dump internals fields of sc and the content of next heap allocation. Reported by: Synacktiv Reviewed by: emaste, jhb Security: HYP-07 Sponsored by: Alpha-Omega Project, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46021 (cherry picked from commit b0a24be007d83f7929de5b3fc320a29e6868067d) --- usr.sbin/bhyve/pci_nvme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 45ab1b11fda4..b8eb24d91b49 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1398,7 +1398,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, logsize *= sizeof(uint32_t); logoff = ((uint64_t)(command->cdw13) << 32) | command->cdw12; - DPRINTF("%s log page %u len %u", __func__, logpage, logsize); + DPRINTF("%s log page %u offset %lu len %u", __func__, logpage, logoff, logsize); switch (logpage) { case NVME_LOG_ERROR: @@ -1410,7 +1410,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->err_log + logoff, - MIN(logsize - logoff, sizeof(sc->err_log)), + MIN(logsize, sizeof(sc->err_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: @@ -1433,7 +1433,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log + logoff, - MIN(logsize - logoff, sizeof(sc->health_log)), + MIN(logsize, sizeof(sc->health_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: @@ -1445,7 +1445,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->fw_log + logoff, - MIN(logsize - logoff, sizeof(sc->fw_log)), + MIN(logsize, sizeof(sc->fw_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_CHANGED_NAMESPACE: @@ -1457,7 +1457,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->ns_log + logoff, - MIN(logsize - logoff, sizeof(sc->ns_log)), + MIN(logsize, sizeof(sc->ns_log) - logoff), NVME_COPY_TO_PRP); memset(&sc->ns_log, 0, sizeof(sc->ns_log)); break; From nobody Fri Oct 11 15:43:16 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQ9rN5x3wz5Z3Wg; Fri, 11 Oct 2024 15:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQ9rN57Fzz4vF9; Fri, 11 Oct 2024 15:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728661396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1dqqMMq4ks7JhRCmq+yskYBjgBsJLrlXXF2MzykxY0=; b=q7qYrddaMbNs2KbdmhF8zpO2fwP7GFVbZKvDFwf8RIirVpOtMIetXYQl1/jDAUW7t7Cpwa pP0Clg65z+Powy69hWDZTYJikN7NGNfi6qjUybqqiqc7obe6QcbRIhJIY1IVIIPcSSiOct Ymjhud1vjaE8t3qhggUuLYrtq+QSZTf0W+Zs5OrqjMB4T5pU72THXxNTaY+RwdoCrPb3aO ovy8c5BqEDd6rXafVa7svvM//Mm4VqZBuu9WJzAa1J3zOSIpWc/FSpyFMuf1Y0Q1vm1cyl /XtVjsmAwP7Q2QOyzOb1lZ6x4nAKBpoMaENWRZ8w6o6ntUk4l5p/oepFw2e8/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728661396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=P1dqqMMq4ks7JhRCmq+yskYBjgBsJLrlXXF2MzykxY0=; b=ZJYTD9ZzDXRL6bu1K5EoEFZUWDHQo80XBAPbD12j1gTGfpojtGvnzvUx1iTgngAjYg0jIx oSHJUUP7zIIJir5TePM477tmiudNbpkfQrm17XdXeWJyOk/Qg3IBPp/WkrwshzNsO5yArL PahAZ3MxaxNbqLnmLNvaY+03YKMVnaNUfX2Nz8gFoJ+hym4vtmwsi9ecsd9Nmv2/3vrfNX aBL6+aouFIKqRs3SF8DtwQ3ngoX13YRVHx4qpPWipDdHlXpoJy7df249vyJVoPRgWrhCDp 7f1r1DGgMrJJJ5SrYXB4KDvYClPLTvRVhqtxXDKelntEU3l9LCJkZudFawWwuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728661396; a=rsa-sha256; cv=none; b=Y+q41gvn3xyOkncElEkLkCHmXVD4SS3evgaicRi8Ae/BI7nctVoj8iRedSBCPGTNfEooIg dZNmjcXFUHw4g3ER6ameb6fEIfErNnoTf7Ke88+lwmTp7HHS4Q/X69wxD9QLRFF3cjAfad h9OHbqRhOaYUyVPtCR/LxtJb6Zxnx4vud4/fHkzRtPqD1ajQnUMROpeUwJlKXV8hluTKMe 9Z9a+gyv+rX1VaObkbLULt0P92Y0r6nK6qr0u8tObcPiaL/LQGBfXqREwJeS7swxkMigwB ue3I659SH/gYV8W29UGXf9xbqXasSfGZV5mtUSrNN3GIPjvLZpwsHgdfjzcreA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQ9rN4QhFzmyB; Fri, 11 Oct 2024 15:43:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFhGJl071230; Fri, 11 Oct 2024 15:43:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFhG4o071227; Fri, 11 Oct 2024 15:43:16 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:43:16 GMT Message-Id: <202410111543.49BFhG4o071227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: c8f75686adc6 - stable/13 - bhyve/nvme: Fix out-of-bounds read in NVMe log page List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8f75686adc6bc2078ade279d838cbc5b1745e71 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=c8f75686adc6bc2078ade279d838cbc5b1745e71 commit c8f75686adc6bc2078ade279d838cbc5b1745e71 Author: Chuck Tuffli <chuck@FreeBSD.org> AuthorDate: 2024-09-19 15:11:30 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:42:40 +0000 bhyve/nvme: Fix out-of-bounds read in NVMe log page The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c is vulnerable to buffer over-read. The value logoff is user controlled but never checked against the value of logsize. Thus the difference: logsize - logoff can underflow. Due to the sc structure layout, an attacker can dump internals fields of sc and the content of next heap allocation. Reported by: Synacktiv Reviewed by: emaste, jhb Security: HYP-07 Sponsored by: Alpha-Omega Project, The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46021 (cherry picked from commit b0a24be007d83f7929de5b3fc320a29e6868067d) (cherry picked from commit a5be19efbb7c6b07d574ef048b2ebade00440873) --- usr.sbin/bhyve/pci_nvme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c index 3db306a19119..cbe4d87b6f60 100644 --- a/usr.sbin/bhyve/pci_nvme.c +++ b/usr.sbin/bhyve/pci_nvme.c @@ -1454,7 +1454,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, logsize *= sizeof(uint32_t); logoff = ((uint64_t)(command->cdw13) << 32) | command->cdw12; - DPRINTF("%s log page %u len %u", __func__, logpage, logsize); + DPRINTF("%s log page %u offset %lu len %u", __func__, logpage, logoff, logsize); switch (logpage) { case NVME_LOG_ERROR: @@ -1466,7 +1466,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->err_log + logoff, - MIN(logsize - logoff, sizeof(sc->err_log)), + MIN(logsize, sizeof(sc->err_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_HEALTH_INFORMATION: @@ -1489,7 +1489,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->health_log + logoff, - MIN(logsize - logoff, sizeof(sc->health_log)), + MIN(logsize, sizeof(sc->health_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_FIRMWARE_SLOT: @@ -1501,7 +1501,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->fw_log + logoff, - MIN(logsize - logoff, sizeof(sc->fw_log)), + MIN(logsize, sizeof(sc->fw_log) - logoff), NVME_COPY_TO_PRP); break; case NVME_LOG_CHANGED_NAMESPACE: @@ -1513,7 +1513,7 @@ nvme_opc_get_log_page(struct pci_nvme_softc* sc, struct nvme_command* command, nvme_prp_memcpy(sc->nsc_pi->pi_vmctx, command->prp1, command->prp2, (uint8_t *)&sc->ns_log + logoff, - MIN(logsize - logoff, sizeof(sc->ns_log)), + MIN(logsize, sizeof(sc->ns_log) - logoff), NVME_COPY_TO_PRP); memset(&sc->ns_log, 0, sizeof(sc->ns_log)); break; From nobody Fri Oct 11 15:53:46 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQB4V4dsKz5Z40V; Fri, 11 Oct 2024 15:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQB4V48xPz4wJ1; Fri, 11 Oct 2024 15:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728662026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsAzMNTf+m4ZlbZsIyZFEI2apPVgmj5PlUb3sXT0VA8=; b=rBph1Z0+VraiMcBNHh4lYfBYRBWMQm+iMtItNbx5oO/fiJLvMHK6EJZR+LOIo1waYJgLfT 8Dim8PH183cSBaLpw47PmJUJHFB90dx9AdKG+TNl0QB/ZqLm6BaQ30icjGcQUMz5rMfgG2 MOleHozK3ewjZ38JRv0aAc1GIWzCBuSfrk8qF+irdlY4sDt2OKcMcrv4wPJY9Y+cLwux2/ PB0tZ3J1A0AVN2K2P3n01RWKZdLXMSJJzdMg5PTD0I1bkncYaTsPRPWfTaEieA0sZe8OAw nIgBRVJ9XGakHmL6MH6TTzb4MPGEl9iQigceH49lNibCekb1YZqjEUu5EwrBvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728662026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bsAzMNTf+m4ZlbZsIyZFEI2apPVgmj5PlUb3sXT0VA8=; b=o4uOd5kojumSvzR5LmlqCYcr9ItWXVi0xImQT8beq3FebrWfGXvazxwwxnXlayaqoVGwH3 IOlw4rFbpcsKnXQ8NZG/SnSZun+W4i2KNl7GAUi1rx0+iOZ2PIuqeZ7sMXY4fPLb+0nVmK bI53NSodB7r91JD3MuaKQRNAEuu4RVVRNkYeac0uCwhCB5xRAGEYt2HX7M3I+kWh0Ps/4D 15uu89mjiRfWY2IvzGD4E7fG0Ux7qeWqrOOPAXqlfSGQg5JMl/349n2SewS+qItolFM9lM g5G/bNu2Bw55O3MDwwpOkV7vA3+mKQJ/0bWGc8h+SOHVegRlK3TpMffMD+XEdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728662026; a=rsa-sha256; cv=none; b=DURGw7X6dNczJJOQmiOYVy/9zwP6Y00feUPnoGCg7nopGc+FIBgdaFHjGa2ooJkvkdp55H m+tYGrxzS4LomWS5K19lHn3QGW/4ES/Xx9rBjFXFsQSX2825EUp/oViooIUKateB9M7E8D 5tbUyvAtxQcgp9tv63oScS+9Q4oUE73rB6m2RGNYh9tUVGra1kLMDl7WDcJHvmSEmmpDFj kXyMvs4upvhG+AInyWoBuqwNtUBeEazJgRGdKOmD8aN9SvghcWTQ5oTiXhwH2iRqaoqnlf s87MeW7IFCE0zw0KdrmW73GKBUCR3glvhKcigOSjLviFhGM26RYbIG8MkuPhnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQB4V3lMbznrb; Fri, 11 Oct 2024 15:53:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFrk8V087827; Fri, 11 Oct 2024 15:53:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFrkgf087824; Fri, 11 Oct 2024 15:53:46 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:53:46 GMT Message-Id: <202410111553.49BFrkgf087824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: 2e7f4728fa73 - stable/14 - ctl: limit memory allocation in pci_virtio_scsi List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2e7f4728fa738a7a7b6c4e4c46eb68952386efce Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2e7f4728fa738a7a7b6c4e4c46eb68952386efce commit 2e7f4728fa738a7a7b6c4e4c46eb68952386efce Author: Pierre Pronchery <pierre@freebsdfoundation.org> AuthorDate: 2024-07-19 17:32:27 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:53:17 +0000 ctl: limit memory allocation in pci_virtio_scsi The virtio_scsi device allows a VM guest to directly send SCSI commands (ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl (ctl.ko). All kernel commands accessible from the guest are defined by ctl_cmd_table. The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows the caller to call malloc() with an arbitrary size (uint32_t). This can be used by the guest to overload the kernel memory (DOS attack). Reported by: Synacktiv Reviewed by: asomers Security: HYP-08 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46044 (cherry picked from commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47) --- sys/cam/ctl/ctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index de759f81bc86..5c33645f0f0d 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8314,6 +8314,18 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) param_len = scsi_4btoul(cdb->length); + /* validate the parameter length */ + if (param_len != 24) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 5, + /*bit_valid*/ 1, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; From nobody Fri Oct 11 15:56:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQB7h57vBz5Z4N5; Fri, 11 Oct 2024 15:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQB7h4Yhdz4xjb; Fri, 11 Oct 2024 15:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728662192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DWa18XDAYE7B6dNaQ0hAU7VXPrQ4IwhEd3VJhkoRNVg=; b=rrt1rJy++SqA1BoE13D3pjcUpZYYyHhLVEdsvAuesKKoRFeng+L8xsvlzIBjhebqG5z6+v mu0bQBdw0oeU834zLwEnQDL+C6W3Yp4xVUHkGenlHCjQ1IEDbnpZ2+nRo0jO13DA9MDCYA nbDkYonKv+xJR1STpXV9Lbz4klDBOi97nA+IuFGWS62zqQ9dCw0p7UWWFDIOvDbHtwu4sW rd8Y6MduKTZOuPJbk4Ud1HOaJZsoYRlolONQ1iKU0qHt1XBcKI+Jv0pl3hSHy/7OKLjjo+ 6TAB7vTHT+z5lVaXadC9wkXMYIX6YUx8HtOnu/655ZzAiF+KTH+aout/0aMIrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728662192; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DWa18XDAYE7B6dNaQ0hAU7VXPrQ4IwhEd3VJhkoRNVg=; b=RJDe8pSLh8niHwXdTz8WFIfFfH69Vw2AIf7DY6+u6iQtgCr8gfr2hL2rE+/yPS6gSPPi2U zQkJhJNUr1u60lUPE7ZMIxfU+0hL3/WKTMo5olEMZkQ+J4czMxxTeihnZA5cvul0SBqOhX fFx+f01TwrKd/efwgh0RhsP+/S9M5KPHngGVFSyhE8Er5BCThMtoLDDR9Bfw9TxxAZndwm iGqM9bhfr2Qsx2n6Li/r7KhqAx/luLTLGXAb54maMCtEVHPFefG1ETN1z5BryfJT02+xzd 0nezDq+RgbM8P+DdjDlL4Yv8Jf2QRjYdq1dVRyFkOstwgxPqsFgwVvFMGbaqag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728662192; a=rsa-sha256; cv=none; b=k/E09dOrmqx2Dr6h4BpdE0zix9AKHBOcIN9xoBvU4QN7iEC28rxLLAphzW9FPgP7IArP9m ivqmMk2z1nf3pNUwDFD9jvsySfPblimrCIOCnx3/95F9DrFUvwxck7FGG+nGvjx8HAfvPp pRG2NH+m1rw+uRpUGFh0AbNT66xwMGjkzAGrmp/onQTiXHKmkqmULELJgv3HaUgAdIKPTO U3+X6ylCAFBJUsBcZivw/Cjo7x/ErA7BJgEBy66PPTy0QT5hYCQJvulbQPF3MmYDM2gUMS O1jLUL204MfuCC9ujbyi6TOk9m/kJohPxNiH/0Td1wHUzPI/ijsvjRmxzdRtcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQB7h4100znXY; Fri, 11 Oct 2024 15:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BFuWYD088639; Fri, 11 Oct 2024 15:56:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BFuWQt088636; Fri, 11 Oct 2024 15:56:32 GMT (envelope-from git) Date: Fri, 11 Oct 2024 15:56:32 GMT Message-Id: <202410111556.49BFuWQt088636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: 367d8c86a182 - stable/13 - ctl: limit memory allocation in pci_virtio_scsi List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 367d8c86a182813d88f728fdb2c3ef1a4679a852 Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=367d8c86a182813d88f728fdb2c3ef1a4679a852 commit 367d8c86a182813d88f728fdb2c3ef1a4679a852 Author: Pierre Pronchery <pierre@freebsdfoundation.org> AuthorDate: 2024-07-19 17:32:27 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 15:53:53 +0000 ctl: limit memory allocation in pci_virtio_scsi The virtio_scsi device allows a VM guest to directly send SCSI commands (ctsio->cdb array) to the kernel driver exposed on /dev/cam/ctl (ctl.ko). All kernel commands accessible from the guest are defined by ctl_cmd_table. The command ctl_persistent_reserve_out (cdb[0]=0x5F and cbd[1]=0) allows the caller to call malloc() with an arbitrary size (uint32_t). This can be used by the guest to overload the kernel memory (DOS attack). Reported by: Synacktiv Reviewed by: asomers Security: HYP-08 Sponsored by: The Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46044 (cherry picked from commit 64b0f52be2c9d7bcecebfeef393f8ec56cb85f47) (cherry picked from commit 2e7f4728fa738a7a7b6c4e4c46eb68952386efce) --- sys/cam/ctl/ctl.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index ed97bb7c2115..13b7995fd74c 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -8313,6 +8313,18 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio) param_len = scsi_4btoul(cdb->length); + /* validate the parameter length */ + if (param_len != 24) { + ctl_set_invalid_field(ctsio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 5, + /*bit_valid*/ 1, + /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; From nobody Fri Oct 11 16:18:30 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQBd23j3bz5Z5Yj; Fri, 11 Oct 2024 16:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQBd2381Vz51fP; Fri, 11 Oct 2024 16:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728663510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4U4fpwKE+xiEBNMVQVDPTGfAEweykrtTm3RXM+M5W44=; b=ObRKiEOo4sm6+D+RYns83Vnx1pA42z5srBiIY1d4wA+FHvCIeGJCy1LOi3Ht/S94JHqPTY YtMgxm0dCsERhiof6yttgVOxHpWmU3DXsOLViYCz3py0U/Jfn5kwIHivfCT39+bjmKl/Fh DcFkxVg/VIYKnssyV/nx5hnABM4V9hld+PFDMnY6uTrBid3O6Dv0sP7g9HJY/Gro9lS2XT 66xVDufpfbZdTBCRdB1JOpIi/XE65UqhormYQu6F0lfiHgsw4y45yVQJ87DNaHSIUJjB4W eK2pMnhzMBNat0YXrGm2fv0vfZSdfLm2xzLB3R2PzOamKc1HYOWtCWW9eUGtig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728663510; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4U4fpwKE+xiEBNMVQVDPTGfAEweykrtTm3RXM+M5W44=; b=dneoMcJ5mbgYgnfy3T66q1swD3dbcVukztxmhenK7tkoCQr/rZQFdxqOCUVsW6kIoVXIBZ hHFLmc/qNABY/34l7pV5QGHX5U+HgxjqB3mvdKrdmRz80V+7ja/O6Jk4FubYH5PBlVCcjG tyZDUbQ8WKFVy+7mSdybIeItFUL1wZT4D54YhjWS/xecf3/xtya7wutNqAe8LT45LQP1Af tV6HkzMUeKUJGQBC6LE12qDAdqvp5QSZH2fMrhekHO+mKheBRL+9NBavphiLaG+5G9LPga XtsherrBfNyB6mEEWqDxd+tQ8wTe0O4TbVkX+1YdPn660tCqKGiHkVAtBByw5A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728663510; a=rsa-sha256; cv=none; b=y1aYTc0LA+mWyxprptDFub699SyKdeR2YiMfwwcecYj5UReFsfQ4MwwkqQYKn1cnKtghI7 UbhcpMZhkraaoaTI62WRQlmvse1IKfdxJ+A/V1PyXEHNJ/WRXnvdAgicxp50FdwJACzE16 qILlokyEKkMuBd8Zd9q7VarQihfwWSazoRs+69r4KNjqKmAcCLacDAVQncNbbQPkVvZwz+ oKJidvvkNIhjVVt8A8olDMKAm03O6VmGh0pR6ivbg8vvkKZIYEAO6DAWyX7k0YESWwAdO+ upCgb3K1lUz0oSr94cIx/xgYMXn1HVaIkE4ES2PKaOZy5EOw3+COCrZLMWfjdg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQBd21wkhzpKJ; Fri, 11 Oct 2024 16:18:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BGIUaR023936; Fri, 11 Oct 2024 16:18:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BGIUj3023933; Fri, 11 Oct 2024 16:18:30 GMT (envelope-from git) Date: Fri, 11 Oct 2024 16:18:30 GMT Message-Id: <202410111618.49BGIUj3023933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: 911ebc3d8cb3 - stable/13 - pkg: prefer .pkg extension List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 911ebc3d8cb3907ec44a772aafe2310b3c8fe27c Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=911ebc3d8cb3907ec44a772aafe2310b3c8fe27c commit 911ebc3d8cb3907ec44a772aafe2310b3c8fe27c Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 15:11:09 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 16:17:40 +0000 pkg: prefer .pkg extension .pkg is the default extension as of commit c244b1d8a387, falling back to .txz if not found. PR: 281924 Reviewed by: bapt Fixes: a2aac2f5e564 ("pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz") Fixes: c244b1d8a387 ("pkg: settle the uniq extension to .pkg instead of .bsd") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46977 (cherry picked from commit f5c847ae849aab9354d0956afd683f1c90bfd91e) (cherry picked from commit fef1f3fecd5b6e7bf040f6dd2e31177332c3c0ec) --- usr.sbin/pkg/pkg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 519445e97484..7867b89e07d4 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -894,7 +894,7 @@ static const char args_bootstrap_message[] = static const char args_add_message[] = "Too many arguments\n" -"Usage: pkg add [-f] [-y] {pkg.txz}\n"; +"Usage: pkg add [-f] [-y] {pkg.pkg}\n"; static int pkg_query_yes_no(void) @@ -1156,7 +1156,7 @@ main(int argc, char *argv[]) if (add_pkg) { if (pkgarg == NULL) { - fprintf(stderr, "Path to pkg.txz required\n"); + fprintf(stderr, "Path to pkg.pkg required\n"); exit(EXIT_FAILURE); } if (access(pkgarg, R_OK) == -1) { From nobody Fri Oct 11 16:18:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQBd35Dj9z5Z5N8; Fri, 11 Oct 2024 16:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQBd33z3pz51Sw; Fri, 11 Oct 2024 16:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728663511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QgHYn3zP8VM8JNkp6WvPKirF5f2SieAdqfuGGl63x6A=; b=CXwyW4GUHaohawRrGttdMkfR/nLQj7dO/HA0TlGmGDuSCwd0bVFs9PJq+1DcIdyVKMeRsw JW6tCe8suf6AAqnF0rUQ3rnOZ9YFTspAcbk/1oDAdy9GrVtEFthtKqsStmDPs+F1e0OAgu hbFTHvXrj/K4FSuV5YiM+Q6fHdrMMMZ4iA9Ah+m4xrETF3NxTf/PQDc622w/efn7EappZj a/TPTameTBfYu6uInSL99nd4oOEBuSY+yAuaWQqSz+IUZRPMKDYHWp8afxoNeLShVzwr2x 1c9UVaHryompMFdSV/qhFRXAzg2ewyl4OiDtBlL+5PNT2ynw0hNZZZMnBy2xlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728663511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QgHYn3zP8VM8JNkp6WvPKirF5f2SieAdqfuGGl63x6A=; b=dC2R3doX0ISO8WCU7bhnNY0+bj6BzzdiMqdsxJQl7cnDtafyZL6fNVprIpv0Osu+Zf3VZ2 69hXjwyAfXq5JbKa1u1nD5QgMTNhgdgLnl1bveQaAqC9QWkLMnTzdERuEGejytlk/qOt1+ vMQ8KUlYt+HxZgKWp+/d4GPNcEOTcSzo6elpdrYH/aLqCvOcHeGYKTbtv9/RxFPiL+MozJ DTxeku4adFm/o3jvwjfKCqB3zBYW7mfJEKcso+H3aW3tMlRlk/0ASFuoW+DzgfQ+mRnyXK tVlqbYHOyR6sx07hrLkJTjpESh/9tS1pjk+9a04RK+/jLIhPu43TXgiNE2wqeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728663511; a=rsa-sha256; cv=none; b=VnT1JSDAQRo34NDFbXeI+c6VZGoxMMroZ/VRzUtMeA+pgK/GxQOWfhrKDsFWwAn4762EKT 83B0Qe9V6obWUYg1fgUJdrGGnIWjY8nW+X42UoWD1cgExPYcMLZ2cdG9iA/Ame20bepF8y c7qr5A92tLMq6wc0+DcisVFFKHpQT/hn4zqegP/d3CQ/hJYJzp4pB5+6U6f7QpVgJccbAV OZkmn+f2Gr+5CYDVHPnCqcEDhKK9LmhsTkUfJ55bRuFUDebGq7FH8+QIGNr9fDi8rC1xGV FQ2khvtSZxrCm4s+Y+RI1CeX1YUnH3KmbmclO6Ub8GudwyGHGrKu4O0shP9ebw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQBd32sQZzpKK; Fri, 11 Oct 2024 16:18:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BGIVQU023975; Fri, 11 Oct 2024 16:18:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BGIVt1023972; Fri, 11 Oct 2024 16:18:31 GMT (envelope-from git) Date: Fri, 11 Oct 2024 16:18:31 GMT Message-Id: <202410111618.49BGIVt1023972@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste <emaste@FreeBSD.org> Subject: git: 40b58e3183ac - stable/13 - pkg: improve error message List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 40b58e3183ac23dbb14d1be2c35dcef7efb6111d Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=40b58e3183ac23dbb14d1be2c35dcef7efb6111d commit 40b58e3183ac23dbb14d1be2c35dcef7efb6111d Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2024-10-07 16:33:12 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2024-10-11 16:17:56 +0000 pkg: improve error message Print the complete list of url that have failed PR: 281924 Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org> Differential Revision: https://reviews.freebsd.org/D46983 (cherry picked from commit be9243409d6be99f5d7815b6d074a85a6e84f7ce) (cherry picked from commit 2f29060f46138bbfc52c5944825293d598cc68de) --- usr.sbin/pkg/pkg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 7867b89e07d4..1915893af283 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -854,7 +854,11 @@ bootstrap_pkg(bool force, const char *fetchOpts) goto cleanup; fetchfail: - warnx("Error fetching %s: %s", url, fetchLastErrString); + for (int j = 0; bootstrap_names[j] != NULL; j++) { + warnx("Attempted to fetch %s/Latest/%s", packagesite, + bootstrap_names[j]); + } + warnx("Error: %s", fetchLastErrString); if (fetchLastErrCode == FETCH_RESOLV) { fprintf(stderr, "Address resolution failed for %s.\n", packagesite); fprintf(stderr, "Consider changing PACKAGESITE.\n"); From nobody Fri Oct 11 22:11:25 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSF4MWtz5ZTlr; Fri, 11 Oct 2024 22:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSF3YF5z4V8x; Fri, 11 Oct 2024 22:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWxTH6XBAe1G5Juo4GHnrA0yY5cUpBm5RVHg/atFCpk=; b=QTxEfPh60pBzfoRSFY8oJQAKHgHldq20ebB83TKBlH/7n5T2RXUuatx2fnnOD5N9hCxpSY T16SFj0DoDmzJHsiHENUzvjiamrOYR35zmK29lGn2bGDYbX5iawN4BHB78cKHpm40qacGN J3uu/tQ3XC145eyaf+hx5sohLT2SIuu4+LIYp5cUPP3fhZTAtMDwlbGmq7t8RHcJdqjnI5 xr+8LydecbuqKfjrmjVC+kbpRjqhGPkG9eKZ9QP1W3Ws6GUcQAzsz9XXIqX9jqqR1SC1c+ QS35ABvxA3yRb/h76DML4c156POx2UPYjBWq+t5BM2W69LIJOcKDNMpSSOpQtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iWxTH6XBAe1G5Juo4GHnrA0yY5cUpBm5RVHg/atFCpk=; b=VgCNOUaBxFogD2KJ+wBTDFR8u9Sxk6m99pOkCF/rzQBan+1hGTppzjeMOIOpe3yf7QNGUA umb05uOc9eYQgiJbTAUzBuspZjzv2YXa/egIn/O1o2IdDoMyUgRWQZRMv0O44XZ340kl2A 8J3N/lxx4caEU7LfO9HExQPO75keHnw3o2LuXOMpqlc0wJLyFriGPfKX+oy76vmNEHOvvc 2g8U/DrYKKezNYYaYFN2Dn5MMt/u9Z/Tig8InDIaLPyWZOUEkubhfHBHovxqGwMlPmGQkq piweeXxGkAhX7P9AeNrbaZIILCiurgapqrKAUn6Th/8wQlkuM+7B5pu690o2CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684685; a=rsa-sha256; cv=none; b=vgnhMH3DBBRS+2SSMg4H+ay/GxVP7Ncm10xnCPWdl/90iji58iGicVmZ1TvJ4K8DhNIW96 zL2NRw6nU+JPrCSF982ck3eB/oHZ7S+JorfSfNlumUYyFd3jU4R4hhVE4xX+RmJmftwM0Z 9yya2IKaeiFTzcBaTat1reh7PNuRqboK+1PU6R6eekIeBBoTPI5n4wsIgoAhPv6OXMyEr/ h7PPliw0L/qkLyzVzfyCP468XfSBzqYz45lvbrSHxy/Oi6DxTzvY0FmvJcYkkyIVKF+vNp pYRVpDENgu1QJfwetzM/N15cCoSDy9TuGaVbBGH0D0uqb/6bJLBo/uC84ALsCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSF38hQzyjC; Fri, 11 Oct 2024 22:11:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBPNK028926; Fri, 11 Oct 2024 22:11:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBPam028923; Fri, 11 Oct 2024 22:11:25 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:25 GMT Message-Id: <202410112211.49BMBPam028923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: e92dd815de89 - stable/14 - mitigations.7: explain installing firmware + spdx List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e92dd815de891be18ef66dcda8ddea5e4c9c66d6 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e92dd815de891be18ef66dcda8ddea5e4c9c66d6 commit e92dd815de891be18ef66dcda8ddea5e4c9c66d6 Author: Alexander Ziaee <concussious@runbox.com> AuthorDate: 2024-09-15 01:23:52 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:21 +0000 mitigations.7: explain installing firmware + spdx MFC after: 3 days Reported by: imp (ucode is for security) Reported by: emaste (ucode is not minix) Reported by: delphij (please ucode asap) Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1411 (cherry picked from commit b15aff050530a791262e166ee0c8fed3a118e7d6) --- share/man/man7/mitigations.7 | 48 +++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index 9dceffb368a9..7156327a7795 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifer: BSD-2-Clause +.\" .\" Copyright © 2023 The FreeBSD Foundation .\" .\" This documentation was written by Ed Maste <emaste@freebsd.org>, and @@ -41,6 +44,7 @@ or per-process basis, some are optionally enabled or disabled at compile time, and some are inherent to the implementation and have no controls. .Pp The following vulnerability mitigations are covered in this document: +.Pp .Bl -bullet -compact .It Address Space Layout Randomization (ASLR) @@ -59,9 +63,11 @@ Stack Overflow Protection .It Supervisor Mode Memory Protection .It -Hardware Vulnerability Mitigation Controls -.It Capsicum +.It +Firmware and Microcode +.It +Architectural Vulnerability Mitigations .El .Pp Please note that the effectiveness and availability of these mitigations may @@ -330,18 +336,14 @@ kernel. .Pp These features are automatically used by the kernel. There is no user-facing configuration. -.Ss Hardware vulnerability controls -See -.Xr security 7 -for more information. .\" .Ss Capsicum Capsicum is a lightweight OS capability and sandbox framework. See .Xr capsicum 4 for more information. -.Pp .Sh HARDWARE VULNERABILITY MITIGATIONS +.Ss Firmware and Microcode Recent years have seen an unending stream of new hardware vulnerabilities, notably CPU ones generally caused by detectable microarchitectural side-effects of speculative execution which leak private data from some other thread or @@ -349,18 +351,36 @@ process or sometimes even internal CPU state that is normally inaccessible. Hardware vendors usually address these vulnerabilities as they are discovered by releasing microcode updates, which may then be bundled into platform firmware updates -.Pq historically called BIOS updates for PCs . +.Pq historically called BIOS updates for PCs +or packages to be updated by the operating system at boot time. +.Pp +Platform firmware updates, if available from the manufacturer, +are the best defense as they provide coverage during early boot. +Install them with +.Pa sysutils/flashrom +from the +.Fx +Ports Collection. +.Pp +If platform firmware updates are no longer available, +packaged microcode is available for installation at +.Pa sysutils/cpu-microcode +and can be loaded at runtime using +.Xr loader.conf 5 , +see the package message for more details. .Pp The best defense overall against hardware vulnerabilities is to timely apply -these updates when available and to disable the affected hardware's problematic -functionalities when possible (e.g., CPU Simultaneous Multi-Threading). +these updates when available, as early as possible in the boot process, +and to disable the affected hardware's problematic functionalities when possible +(e.g., CPU Simultaneous Multi-Threading). Software mitigations are only partial substitutes for these, but they can be helpful on out-of-support hardware or as complements for just-discovered vulnerabilities not yet addressed by vendors. Some software mitigations depend on hardware capabilities provided by a microcode update. -.Pp -FreeBSD's usual policy is to apply by default all OS-level mitigations that do +.Ss Architectural Vulnerability Mitigations +.Fx Ap s +usual policy is to apply by default all OS-level mitigations that do not require recompilation, except those the particular hardware it is running on is known not to be vulnerable to .Pq which sometimes requires firmware updates , @@ -449,6 +469,10 @@ should be considered when configuring and deploying them in a .Fx system. .Pp +Additional mitigation knobs are listed in the +.Sx KNOBS AND TWEAKS +section of +.Xr security 7 . .Sh SEE ALSO .Xr elfctl 1 , .Xr proccontrol 1 , From nobody Fri Oct 11 22:11:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSH0Z8Sz5ZTjr; Fri, 11 Oct 2024 22:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSG5cCmz4VLj; Fri, 11 Oct 2024 22:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VU3fpkOCGH4JJVvtn3Oxi2Vpa6kJgAhVLEkJ+HJtmI=; b=hc4M8ERPt1Weu+etF2NnEi49WUACj/W0KyZM7ERtIrKN9mhBi4KwlvEsBptrceppTZxtDX Dc/rWigdrWwka1jSwk/FJsAuFD2L8lCb4kn0w5/E7foKDeK+M3yriHxm6ZcGE+zKyyjvyo YINgrDldo7LPePv0ojFV2hOuecgMUinY3Q7fCCnRscPPM5EPZKNq30iN6Yi2IjwkubrQUX p+476DuCUQ0Yp5MfUS6+2B6aul2qH/YXAs/X7AyjE42uPzPgHU7yfiHENzhNIo2HbCA93O KnqWBd0dJsYlUuF1PxUtr3oo5XVJTnPiJHJoIyH6Ft94IeFJrOp+w0fTNX4EcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8VU3fpkOCGH4JJVvtn3Oxi2Vpa6kJgAhVLEkJ+HJtmI=; b=tKtWq3TvTFR5XCWoFvyQuLccTiGZpU7uDIj95qRaL73ceyhLg/jkXCsoGrvjDoMTN4iypM j0u0xfm6hn65E4+w7SzMdVWkwgH5DikiROGMn6Cu9s2lz2jpj8YpzhCFV8bp7AH2WCkHca VLdvjpQljMQ99uC5L1loIq7m/69TQskxkw6VyT31BBCFcdmpeS4XT0XU+WSEvndHXs+CqY T2CNrfcVhM2XSL+3QBb4p119vepbDh1OF67PfAZGcNo2CVDsOfYlIdc7Zq4biNniiJUOjr IqmQWEpdzX9lezPK+jJx42z933wuPMnFb0eL7IjiC7ufp47DCzje07ob21kOLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684686; a=rsa-sha256; cv=none; b=N66lD0kR48NDvCQLT4742Gc/Qg85ZPJFjaHqaSXo8gRT28Ue5lVOyIO9Tio+cEMpg07iSV TYgjdys1tGLFKLLF4kFZ4j1EAbvLuXQqC7X0+kUK9pks4uirWT48PGRnq0GDZPf/oJKg00 BvBXPet/hm2/6E8545wDLGGfFSAeQ7ma2vpxIqb2cHNwyndw6LCdTuFzCpOHgSWADMdGTj Nb+OjYJhVQpiJyfdd81MQgbP5FnLBNdNceiPGGap12zvLddoi3vyzQ7PcU8aocvSzmdYwa cwHxJzHguSZtFj4XspDn3SnpztsRj9PXPansk7kzijFMdAzQ4xKTFp5iFvuvsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSG4Pwyz105B; Fri, 11 Oct 2024 22:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBQWv028971; Fri, 11 Oct 2024 22:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBQHS028968; Fri, 11 Oct 2024 22:11:26 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:26 GMT Message-Id: <202410112211.49BMBQHS028968@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 5439ebff8512 - stable/14 - jail.conf.5: minor cleanup (spdx, macros, xrefs) List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5439ebff8512fcbbce0ce77b6f050edecfc5c78d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5439ebff8512fcbbce0ce77b6f050edecfc5c78d commit 5439ebff8512fcbbce0ce77b6f050edecfc5c78d Author: Alexander Ziaee <concussious@runbox.com> AuthorDate: 2024-08-07 19:14:38 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:22 +0000 jail.conf.5: minor cleanup (spdx, macros, xrefs) + expand see also section with other relevant pages and the handbook + tag paths with the path macro so they can be searched with apropos + tag spdx, one sentance per line MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1371 (cherry picked from commit 944c74b7d93c60709b966a5a522110e4fe1038b2) --- usr.sbin/jail/jail.conf.5 | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index 0b82a972020c..dda2c0366dd1 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2012 James Gritton .\" All rights reserved. .\" @@ -22,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 5, 2023 +.Dd September 21, 2024 .Dt JAIL.CONF 5 .Os .Sh NAME @@ -169,17 +172,17 @@ A line of the form .Pp will include another file (or files) in the configuration. The filename should be either absolute, or relative to the -configuration file's directory. It cannot contain variable -expansions, but may contain +configuration file's directory. +It cannot contain variable expansions, but may contain .Xr glob 3 patterns. .Pp The included file must exist, though a filename glob may match zero or -more files. This allows inclusion of any/all files in a directory, -such as -.Dq /etc/jail.conf.d/*.conf , +more files. +This allows inclusion of any/all files in a directory, such as +.Dq Pa /etc/jail.conf.d/*.conf , or conditional inclusion of a single file, such as -.Dq jail.foo[.]conf . +.Dq Pa jail.foo[.]conf . .Ss Comments The configuration file may contain comments in the common C, C++, and shell formats: @@ -238,10 +241,19 @@ bar { \[char46]include "/usr/local/etc/jail.*.conf"; .Ed .Sh SEE ALSO -.Xr jail_set 2 , +.Xr jail 2 , +.Xr jail 3 , +.Xr jail 3lua , .Xr rc.conf 5 , .Xr jail 8 , -.Xr jls 8 +.Xr jexec 8 , +.Xr jls 8 , +.Xr zfs-jail 8 +.Pp +The +.Dq Jails and Containers +chapter of the +.%B FreeBSD Handbook . .Sh HISTORY The .Xr jail 8 From nobody Fri Oct 11 22:11:27 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSJ1knYz5ZV9p; Fri, 11 Oct 2024 22:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSH6pSZz4V6h; Fri, 11 Oct 2024 22:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YfS/fiQVHQdy6WnNxQ3nauZykpSt0YMKa3uGpNA3Hko=; b=JYRMZv4yNHOETafzxFLvnWgQp5F0TkA8Z+9pBxfsRIpEb7WyxTPl9JWTdhwIF6nfiBRXGX 27rMkjRn039NhuGbE9Yl7HrbNvIp9v2AP9soxO4qOB36GfNGJaAORu3WKDmp8MDvUrthJs mV7IKDn9y0fRW2CRfE7pA6/k3fqHzCbFkZLruU54WEwpFiYGA46/Ta5Vmm25HeEOchQEca vPNtFHZ4cXsuKICLBz6XwIyHwe10nagm+OgjYeZk8aVMC3rl+wY//x5J/VTTtghTvrQJB8 y9vj5Y7UDK+i2qC/sfyIDT5zFmeW5gkToPPeEvlbqTHmgAZ+4zwL3cGDDlqjBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YfS/fiQVHQdy6WnNxQ3nauZykpSt0YMKa3uGpNA3Hko=; b=nC/1Jl7tlX2Is5LPN0qwb4+WgoHqTk96V9Vu+rGnXP9RuUKnjIdzmUH2n1QZq0m6aVf2qI 6jOZeYaAUB9FmYuK7jlgGV6zzasW7u/JlGXRTzHtMyovb8m2JipLPFVMfJiDwTpu4SNahE n51ONHPMSSM4SSvhVNln4qoVnNgaeGHpETji3Kvln/Si01lLspXDBhafswD/ckm/Hbiifn Zv9WbZ3wyuFO+ZWDHs/j8zfjm2npAnfiqisb0fs0TVfAbGsgvs77Be+7zQcCue93koCnUX MS1axNACIkHGfwKoAcFQzsX8Kvrw47gYZZLbr6GqrdG9dO7cm8sce78+EOe3FA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684688; a=rsa-sha256; cv=none; b=fS7OyNJ9n2BHBfrWqi6VS6jhbiE7aCShbUqNsYFeOyocSdmTOgE6zgYsZjHODXan7TEhpq 5DhaorrUCH4k4rCgQD61n1vPIvmzeTkHzm30cndQshg/GgAq68t9kp0m+NJvPankRWkB/a MTu/Q16n75QCgYSyqAwrW82gmQrp9j+57JhXokg5KbmvkFJpI/O8fPZjs8XqjW/ddM2Hn2 CFp5LNLmEJA3wjrmSY0GSJjsXsi3EJuJCXRXZuGG4KODVsW+sl3n0CixLpI0KEI5+CpL8i SixIsxRXfksqD9C/k7sFI0NPG7zY2Y+hd1AaULlK1E1rV3tV49kqD73dqQ2OBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSH56yCz105C; Fri, 11 Oct 2024 22:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBRYr029007; Fri, 11 Oct 2024 22:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBRH8029004; Fri, 11 Oct 2024 22:11:27 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:27 GMT Message-Id: <202410112211.49BMBRH8029004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 83a8160fe6f3 - stable/14 - jail.conf.5: cleanup introduction List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83a8160fe6f3d23b9b7cd8a97f92ee4a32f1aa9d Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=83a8160fe6f3d23b9b7cd8a97f92ee4a32f1aa9d commit 83a8160fe6f3d23b9b7cd8a97f92ee4a32f1aa9d Author: Ingo Schwarze <schwarze@usta.de> AuthorDate: 2024-09-14 01:12:18 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:22 +0000 jail.conf.5: cleanup introduction Suggested by ingo on mandoc-tech@ MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1422 (cherry picked from commit e36af20691d8922ecf416170a56d06aca62a0ccd) --- usr.sbin/jail/jail.conf.5 | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/usr.sbin/jail/jail.conf.5 b/usr.sbin/jail/jail.conf.5 index dda2c0366dd1..1bce1535455a 100644 --- a/usr.sbin/jail/jail.conf.5 +++ b/usr.sbin/jail/jail.conf.5 @@ -30,29 +30,29 @@ .Os .Sh NAME .Nm jail.conf -.Nd configuration file for -.Xr jail 8 +.Nd configuration file for system jails .Sh DESCRIPTION -A +The +.Nm +file consists of one or more jail definitions statements for use by the .Xr jail 8 -configuration file consists of one or more jail definitions statements, -and parameter or variable statements within those jail definitions. -A jail definition statement looks something like a C compound statement. -A parameter statement looks like a C assignment, -including a terminating semicolon. +management program. +A jail definition statement consists of a single word, the name of the jail, +an opening curly brace, a list of at least two parameter assignments, +and a closing curly brace. +A parameter assignment consists of a single word, the parameter name, +an equals sign, a value enclosed in double quotes, and a terminating semicolon. .Pp -The general syntax of a jail definition is: -.Bd -literal -offset indent -jailname { - parameter = "value"; - parameter = "value"; - ... -} +The syntax of a jail definition is as follows: +.Bd -unfilled +. Ar jailname Cm \&{ +.Bd -unfilled -offset indent -compact +.Ar parameter Cm = Qq Ar value ; +\&... +.Ed +.Cm \&} .Ed .Pp -Each jail is required to have a -.Va name -at the front of its definition. This is used by .Xr jail 8 to specify a jail on the command line and report the jail status, From nobody Fri Oct 11 22:11:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSK0ltRz5ZTnt; Fri, 11 Oct 2024 22:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSJ6b5mz4VCw; Fri, 11 Oct 2024 22:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VHlliSu4JJHPaQ/WrxvIQkSHt+iCDzxJgiOuuDsRGk=; b=WTHRdTnAq+yMCzPrymjXGoIJzWt2ejMZaT3Ki+C1bwIK07acmDdts4C1tWvpR/Vo02Tk7m ig9oHbgd+FCP4cPbm1b0Wgu6C/XOEAESeVgGhMDZw6A6u0/HDEpdxTnCpZsaozqc9evl4W HDUAaic47IBbY6UJiIR6ngp8LbKAyL/sx+E40wqi1CzYwN6d4CnmG0uBnulgapcl8lB7iX +B/qpmnwqLiRGyrXDaNp2+3YNMI6L1b4q9rzCLNedMbJSNhFC3dAPxdN1ud/0PJBb3+7kZ g8MPuuSy5uXwL/4JLBgALyARtS922RMiMQTu1+WB80aOPkvYbAQZD88MaKm2LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6VHlliSu4JJHPaQ/WrxvIQkSHt+iCDzxJgiOuuDsRGk=; b=j+TvMagH5Ii80BwV3L5DZyycC9YMEIgm6TZyIWPuM0w7SYPRr89gd6gDsVIXyr9tzbc33H sj7LXqBKQHXWyuOTDLrzYfFqqs1pSoIxO58cPLbK7nc3nbt5pFqQWPiXu9ttKR+C1n6p4o D7rg5Do4skxOZl3f2Boa32r1aAd4O4aa+8h25gbldBs+QVaU+daD2/y1Vx0NXDz/bIBAS/ X7ipQGgQTzTxgKcxEg8qbo89tCwUsd5Y4Kj82S5nQ+bbNZo8C0RRBnvER6e+lFUS5+ZbRe qHopLccqHHsdB/OBilKzN0X8pxHA2y1TtTmZ/wXLombDupsNWhuHOAC5fM8Omg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684688; a=rsa-sha256; cv=none; b=eKiUgJ0+lSFqUD2pvRat1D0TctMNJ0MXftpsWtXL25lyjEV8bvJQWD0tT02JMZp576iCGm TfoY0xV+vJFDDLgLA2aOQsF9VC8Oj2fTT93V8GcUTGFzA8Rb1tHZk0i0YzB73ZpXoI3Bm5 urFa/tz7LxpijpX2Yzi7WusdURay1j7ADptcBBVrtqgdj7YzIl2fLPXYjFb/tuj4XJslqq VuIIsSWVuvN2v4kf09Tuf9+094xtKZf4nT6ee1UkOJksupfK/7zgNZnOhX+pUgdnljGJDy HJGiprJj0fXqOMjmcp+8RrsmyB4/I0OJ7qXeRg9IwMmKrrVyQzDxniKzm4ZMVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSJ668Vz105D; Fri, 11 Oct 2024 22:11:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBSAB029062; Fri, 11 Oct 2024 22:11:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBSLx029059; Fri, 11 Oct 2024 22:11:28 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:28 GMT Message-Id: <202410112211.49BMBSLx029059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: d032508ef0aa - stable/14 - hv_netvsc.4: mlink to hn(4)/if_hn(4) + tag spdx List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d032508ef0aacdfd02c765182e6aa012509c54fd Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d032508ef0aacdfd02c765182e6aa012509c54fd commit d032508ef0aacdfd02c765182e6aa012509c54fd Author: Alexander Ziaee <concussious@runbox.com> AuthorDate: 2024-08-11 06:01:40 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:22 +0000 hv_netvsc.4: mlink to hn(4)/if_hn(4) + tag spdx dmesg for this device says: > hn0: <Hyper-V Network Interface> on vmbus0 Add links so that `man hn` and `man if_hn` work. MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1377 (cherry picked from commit 83e93d53f67448a7546c32cd44cb145eceb6c8fb) --- share/man/man4/Makefile | 2 ++ share/man/man4/hv_netvsc.4 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index efe0625cc620..5f3d4b221465 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -687,6 +687,8 @@ MLINKS+=gpioths.4 dht11.4 MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hpet.4 acpi_hpet.4 +MLINKS+=hv_netvsc.4 hn.4 \ + hv_netvsc.4 if_hn.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=${_attimer.4} ${_i8254.4} MLINKS+=ip.4 rawip.4 diff --git a/share/man/man4/hv_netvsc.4 b/share/man/man4/hv_netvsc.4 index 226fa016f695..e5c7004713c5 100644 --- a/share/man/man4/hv_netvsc.4 +++ b/share/man/man4/hv_netvsc.4 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2012 Microsoft Corp. .\" All rights reserved. From nobody Fri Oct 11 22:11:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSL2g5Cz5ZTgV; Fri, 11 Oct 2024 22:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSL0SN3z4VP0; Fri, 11 Oct 2024 22:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sgdKMWG5P6laWY2xfdeb4kkw/g3U2OOyXKOhtF5oiU=; b=oer2Esd6fgqj6fT4gOOL9n0QmmnrbZaIZKR6WEsjWu10lrTWIQ1H3aaCJX/CdxhDQuyEcS QZFNRdQvxrCP9DHGfhHHcDrz7sqENAPjd9VUzQGInpyr9HF0MXN/ksq1WiMWwcIRSqzKHa 2/27OVFlXGKEEw/jyz6oY5L0hEtMZTQ/9oRTaegSJ5ZbegrGbg7UavG4jrlov1n7ztL44l sQ/1ErGbcxhh39eJflBfTc524/9h/SWy4KQJUDLyS2+0RGt/uVIcWvZimQbaHvWQBJroSg UinPUL+S5BxbrhPHsPppQu+RPzYV6C6Lr+m0DbeIOBuZOz3uy2YcqlCtmFzVkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7sgdKMWG5P6laWY2xfdeb4kkw/g3U2OOyXKOhtF5oiU=; b=OVoiTuVGIeyGXd3mYLdeg9wPHWP5dt+WUczOi6ugalJPZuRA6sp48PZWgazVSOp0IALf2d pBm3SpaI1vNB4sz+V0D8PZjuOq6QNtXeEk6sIVgJuXkXHHUu0dwa0tArRHp8JrJsnLkcFB tWm5fRS6ZpkNSL1uhjyaPVBKYtAeVZYVUFwKF9lCr4R9euhGszDyqS/AibmFYQQqK11X23 x/axOH03E8Gtr12FGQEK6Nqg8uP00c9tl/Z3KtylaAKGI7umok0V7VXEwkhNbO3aXBmrq1 sCPgAfr9povKLcaPgPGqlyj/jzGMNOYXEfkHFrElWWggUfVa74tF2xEipX9xjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684690; a=rsa-sha256; cv=none; b=ricavpuLPvx8NRhI1scLF5H+5Sf7Rrgp3qoq3Cn9d0lt7Op+bLUCmPvjstPp8DdX+wudby l0nhISlsmD9neg1AdnBGhqBgC+LI0f9O8zP7rYuu9NgT+5S+b7LmKeKag6TlASam6reNPE WclqMc/wUs4CrvBIp4oOS+TXAFlik800XbgDYEqi2KSpHNa7g0Ij8lmMP1kxyYSmpk4+wN kqu+3LrgdExVlkqE7cAmIr53wV0q5qqAenLP0UOujO9us1xxOeai4apMQuK523yZUG+j3a LC+WfRq6hKfvUFiABng9wqV853s9rp4ZmMESxzbMrH4+LyMm8vH3S4ZNeh+5Ew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSL02JGz1081; Fri, 11 Oct 2024 22:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBTbo029110; Fri, 11 Oct 2024 22:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBTmA029107; Fri, 11 Oct 2024 22:11:29 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:29 GMT Message-Id: <202410112211.49BMBTmA029107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 95273f59d0fb - stable/14 - sysctl.8: mark sysctls as vars per style.mdoc(7) List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 95273f59d0fb0172ed79a7f6b0812745a5795c25 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=95273f59d0fb0172ed79a7f6b0812745a5795c25 commit 95273f59d0fb0172ed79a7f6b0812745a5795c25 Author: Alexander Ziaee <concussious@runbox.com> AuthorDate: 2024-09-14 18:33:21 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:23 +0000 sysctl.8: mark sysctls as vars per style.mdoc(7) + while here, fix alignment and tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1421 (cherry picked from commit 2a680c5c37ea020467fce545734afea019d3a3ea) --- sbin/sysctl/sysctl.8 | 154 ++++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 76 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index ed768510eb6c..fef7d3842c49 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -52,11 +55,10 @@ privilege to set kernel state. The state to be retrieved or set is described using a .Dq Management Information Base .Pq Dq MIB -style name, described as a dotted set of -components. +style name, described as a dotted set of components. .Pp The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-f filename" .It Fl A Equivalent to .Fl o a @@ -204,77 +206,77 @@ String and integer values can be set using .Nm . .Bl -column security.bsd.unprivileged_read_msgbuf integerxxx .It Sy "Name Type Changeable" -.It "kern.ostype string no" -.It "kern.osrelease string no" -.It "kern.osrevision integer no" -.It "kern.version string no" -.It "kern.maxvnodes integer yes" -.It "kern.maxproc integer no" -.It "kern.maxprocperuid integer yes" -.It "kern.maxfiles integer yes" -.It "kern.maxfilesperproc integer yes" -.It "kern.argmax integer no" -.It "kern.securelevel integer raise only" -.It "kern.hostname string yes" -.It "kern.hostid integer yes" -.It "kern.clockrate struct no" -.It "kern.posix1version integer no" -.It "kern.ngroups integer no" -.It "kern.job_control integer no" -.It "kern.saved_ids integer no" -.It "kern.boottime struct no" -.It "kern.domainname string yes" -.It "kern.filedelay integer yes" -.It "kern.dirdelay integer yes" -.It "kern.metadelay integer yes" -.It "kern.osreldate integer no" -.It "kern.bootfile string yes" -.It "kern.corefile string yes" -.It "kern.logsigexit integer yes" -.It "security.bsd.suser_enabled integer yes" -.It "security.bsd.see_other_uids integer yes" -.It "security.bsd.see_other_gids integer yes" -.It "security.bsd.see_jail_proc integer yes" -.It "security.bsd.unprivileged_proc_debug integer yes" -.It "security.bsd.unprivileged_read_msgbuf integer yes" -.It "vm.loadavg struct no" -.It "hw.machine string no" -.It "hw.model string no" -.It "hw.ncpu integer no" -.It "hw.byteorder integer no" -.It "hw.physmem integer no" -.It "hw.usermem integer no" -.It "hw.pagesize integer no" -.It "hw.floatingpoint integer no" -.It "hw.machine_arch string no" -.It "hw.realmem integer no" -.It "machdep.adjkerntz integer yes" -.It "machdep.disable_rtc_set integer yes" -.It "machdep.guessed_bootdev string no" -.It "user.cs_path string no" -.It "user.bc_base_max integer no" -.It "user.bc_dim_max integer no" -.It "user.bc_scale_max integer no" -.It "user.bc_string_max integer no" -.It "user.coll_weights_max integer no" -.It "user.expr_nest_max integer no" -.It "user.line_max integer no" -.It "user.re_dup_max integer no" -.It "user.posix2_version integer no" -.It "user.posix2_c_bind integer no" -.It "user.posix2_c_dev integer no" -.It "user.posix2_char_term integer no" -.It "user.posix2_fort_dev integer no" -.It "user.posix2_fort_run integer no" -.It "user.posix2_localedef integer no" -.It "user.posix2_sw_dev integer no" -.It "user.posix2_upe integer no" -.It "user.stream_max integer no" -.It "user.tzname_max integer no" -.It "user.localbase string no" +.It Va "kern.ostype string no" +.It Va "kern.osrelease string no" +.It Va "kern.osrevision integer no" +.It Va "kern.version string no" +.It Va "kern.maxvnodes integer yes" +.It Va "kern.maxproc integer no" +.It Va "kern.maxprocperuid integer yes" +.It Va "kern.maxfiles integer yes" +.It Va "kern.maxfilesperproc integer yes" +.It Va "kern.argmax integer no" +.It Va "kern.securelevel integer raise only" +.It Va "kern.hostname string yes" +.It Va "kern.hostid integer yes" +.It Va "kern.clockrate struct no" +.It Va "kern.posix1version integer no" +.It Va "kern.ngroups integer no" +.It Va "kern.job_control integer no" +.It Va "kern.saved_ids integer no" +.It Va "kern.boottime struct no" +.It Va "kern.domainname string yes" +.It Va "kern.filedelay integer yes" +.It Va "kern.dirdelay integer yes" +.It Va "kern.metadelay integer yes" +.It Va "kern.osreldate integer no" +.It Va "kern.bootfile string yes" +.It Va "kern.corefile string yes" +.It Va "kern.logsigexit integer yes" +.It Va "security.bsd.suser_enabled integer yes" +.It Va "security.bsd.see_other_uids integer yes" +.It Va "security.bsd.see_other_gids integer yes" +.It Va "security.bsd.see_jail_proc integer yes" +.It Va "security.bsd.unprivileged_proc_debug integer yes" +.It Va "security.bsd.unprivileged_read_msgbuf integer yes" +.It Va "vm.loadavg struct no" +.It Va "hw.machine string no" +.It Va "hw.model string no" +.It Va "hw.ncpu integer no" +.It Va "hw.byteorder integer no" +.It Va "hw.physmem integer no" +.It Va "hw.usermem integer no" +.It Va "hw.pagesize integer no" +.It Va "hw.floatingpoint integer no" +.It Va "hw.machine_arch string no" +.It Va "hw.realmem integer no" +.It Va "machdep.adjkerntz integer yes" +.It Va "machdep.disable_rtc_set integer yes" +.It Va "machdep.guessed_bootdev string no" +.It Va "user.cs_path string no" +.It Va "user.bc_base_max integer no" +.It Va "user.bc_dim_max integer no" +.It Va "user.bc_scale_max integer no" +.It Va "user.bc_string_max integer no" +.It Va "user.coll_weights_max integer no" +.It Va "user.expr_nest_max integer no" +.It Va "user.line_max integer no" +.It Va "user.re_dup_max integer no" +.It Va "user.posix2_version integer no" +.It Va "user.posix2_c_bind integer no" +.It Va "user.posix2_c_dev integer no" +.It Va "user.posix2_char_term integer no" +.It Va "user.posix2_fort_dev integer no" +.It Va "user.posix2_fort_run integer no" +.It Va "user.posix2_localedef integer no" +.It Va "user.posix2_sw_dev integer no" +.It Va "user.posix2_upe integer no" +.It Va "user.stream_max integer no" +.It Va "user.tzname_max integer no" +.It Va "user.localbase string no" .El .Sh FILES -.Bl -tag -width ".In netinet/icmp_var.h" -compact +.Bl -tag -width "<netinet/icmp_var.h>" -compact .It In sys/sysctl.h definitions for top level identifiers, second level kernel and hardware identifiers, and user level identifiers @@ -298,20 +300,20 @@ definitions for fourth level UDP identifiers For example, to retrieve the maximum number of processes allowed in the system, one would use the following request: .Pp -.Dl "sysctl kern.maxproc" +.Dl Va "sysctl kern.maxproc" .Pp To set the maximum number of processes allowed per uid to 1000, one would use the following request: .Pp -.Dl "sysctl kern.maxprocperuid=1000" +.Dl Va "sysctl kern.maxprocperuid=1000" .Pp Information about the system clock rate may be obtained with: .Pp -.Dl "sysctl kern.clockrate" +.Dl Va "sysctl kern.clockrate" .Pp Information about the load average history may be obtained with: .Pp -.Dl "sysctl vm.loadavg" +.Dl Va "sysctl vm.loadavg" .Pp More variables than these exist, and the best and likely only place to search for their deeper meaning is undoubtedly the source where From nobody Fri Oct 11 22:11:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSM35b5z5ZTgW; Fri, 11 Oct 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSM1LgVz4VDL; Fri, 11 Oct 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DQaEJetUGqv4krZWyvKLv036Jlmna2RmCH/4ZvVYXy0=; b=Fv1jibvMe5wiPiZO27xXXzzTo4ffOTuI/9gd+Ukk92Tug2UIHeHpTAZu3fcl3n5N+e6qvt h46zvKZuwR7oDRqhoHJZ6Yu+xwrg1oMSlO6lMc0H53cMBZKBrPmAJRkLpBxfrHUcsiD1ks GCdwALfb4YW4Pyq0MlQfO+B39/a9lcNTd6SbcLLPLAMyMXF+ylXsbFYEFsdBqcHXm655Gb SStK0pRkaNol2dLjVf08E3lUTwMSl0/YiRhguJsV9zsNQc/ECLyUtnJIuvoYZwMqQqR2Rx Q5QbmHg6dA0g1baM6FfNo4tNjmRjPuN06BZAKsmhdSMBcjz5xc/+EfAq1ANX7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DQaEJetUGqv4krZWyvKLv036Jlmna2RmCH/4ZvVYXy0=; b=Wbe1sZeBSUVYs+LvsTUujkDgNkdKUwkTPhOI6MF0IZDG8/24R5o16AwdWjsDKlCGCYR9c+ Fgn/AakSegvZ53ISSsfSihXxAk/y+gl3w5YTbZY+IH5IG5YG9PoXFHOxfFEk5DaMSfJIZf Zf1M/K9/AxRv7kC2KQ69+BsujlZ6mWGagpDU4k43BebT+WXw/+WsowdXO96cg4ThBwvAU+ GpMfrxkIxe6U4qPi0rrH0DDXQQK0jYBubZepH6EEEiKMDhemtZ6BZeQCyD1Xzn4N6ZhPF5 LqnTfilN+X3rOVfYqbrUpl1rek80kVootC+sO1CMsIN6de/Yi+Ml63tdRTBWag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684691; a=rsa-sha256; cv=none; b=ozbTnHjfY+NYFgEbkEhBSdxIkAQiVqjLmeq6SIY8B7r0DxBYnFhap9TOW2wSKsQPVuEgtW rOsL3aqESeazHPr8y/JNOTZHwTCP2Uj/OxzMHs6Kr9E1/5AqUUudHoWIzd2ifJBI5mv9Tq rzFTJ5/he+0+PlEt2UqyjhJFcH2lqAHnfIUEJmH4K6R1lD+nwGz6bp3Zi1gPEBCiYbBeyj 9UYpRqLdowPxCUMfVhdPjb1xMZI8BLxqmLDx3O0kk6UfdMHnmKseY1/ObsM2PeXZ4Nu2nk qfBovSnNYUfEU+15y3DLhgWm00DB6BJQGFw/uMwZ36kLQgPSKnVP28iJNwwVrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSM0yHxzyrJ; Fri, 11 Oct 2024 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBV5a029152; Fri, 11 Oct 2024 22:11:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBVoC029149; Fri, 11 Oct 2024 22:11:31 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:31 GMT Message-Id: <202410112211.49BMBVoC029149@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 197de660d2bf - stable/14 - hn: fix build on !x86 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 197de660d2bfcf027af5224902950d36dc0611c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=197de660d2bfcf027af5224902950d36dc0611c3 commit 197de660d2bfcf027af5224902950d36dc0611c3 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2024-09-21 13:54:32 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:10:23 +0000 hn: fix build on !x86 hv_netvm aren't installed on !x64. Do the canonical thing with the links. Fixes: 83e93d53f674 Sponsored by: Netflix (cherry picked from commit e47939b3b110689b63bb14d0cf9f55ace4c7a8a2) --- share/man/man4/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 5f3d4b221465..d4b5e39e94d9 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -687,8 +687,8 @@ MLINKS+=gpioths.4 dht11.4 MLINKS+=gpioths.4 dht22.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hpet.4 acpi_hpet.4 -MLINKS+=hv_netvsc.4 hn.4 \ - hv_netvsc.4 if_hn.4 +MLINKS+=${_hv_netvsc.4} ${_hn.4} \ + ${_hv_netvsc.4} ${_if_hn.4} MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=${_attimer.4} ${_i8254.4} MLINKS+=ip.4 rawip.4 @@ -812,6 +812,7 @@ _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 _ftgpio.4= ftgpio.4 _ftwd.4= ftwd.4 +_hn.4= _hn.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 @@ -827,6 +828,7 @@ _hwpstate_intel.4= hwpstate_intel.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 +_if_hn.4= if_hn.4 _if_nfe.4= if_nfe.4 _if_urtw.4= if_urtw.4 _if_vmx.4= if_vmx.4 From nobody Fri Oct 11 22:11:32 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLSN70dNz5ZTk8; Fri, 11 Oct 2024 22:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLSN2Q3kz4VKR; Fri, 11 Oct 2024 22:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pflFShCzJTc0+WaQJWse0gmaeF1RXewnH+LFbz2H+Xk=; b=eU7cluP+OoLQSr1SLju3ZlQhxY8E+Z6sgEBBeXv4C7zbjVmJRtR+1gJzatR+oZEB/P+WaO s6cYp/5yz93PzRiEv5QtnVXd9dDHyAj97WuixIgfoImW2AInIoCjeaaPpGRhY5U6WsD4V4 O285Uj1M1yCjbYNCM6XeW0TRmtPWYSDBUx0kya9g2ZCexOatUH9SCSBqyeb0OzzTinNVsY ThO8IUjVtvdglB1s+rH0Laa3lZU7PfX8KnVck31gc6HB1/DB/FR9E5MVWmem+VOnkLOK5Y xoVUdlxcP+l1NFKCLzT0ISvQ0yqiWBNKobHJ88RWSoWNa4w93tiCXaU5kuki4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pflFShCzJTc0+WaQJWse0gmaeF1RXewnH+LFbz2H+Xk=; b=qHaWeC2a4kFEw3Ckz/7/wOd2aJouTsMKYXTKwdbQb4RQsQ/cluf3dEb9myyUwrTHmsQRXT 0eI7y/Lr0AsKKXtjqPZPMbEQdws0wcsNwUY+ripXIPlEdIWUw9O9EwQz0IZickHn2tl92L RCkjSIvgiuGDcAR0/cWErblfxRtZN5I9ct0nkoc8rhs7PmCytWtpP2Ze0wdvo8+ihFF9l6 gnTYDCndVrzH3XMKYFapxvUo5Ir61QcZq1bcSj1MwfQZiWHeTRELAldomqdvtLte7AgsqK UjYPu6g/1oUe4LnT7bbynIJOZr48dk7EBqP7qiWrmoIUdIpRWunmIQjTb/mxvg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684692; a=rsa-sha256; cv=none; b=vd3RqrM+pzp+SyRII1Riv1Hu1kiUWky7CrP4WQ0GLdhNqi3z6k8SVbUoS3QKasb219Tx6s xuBFf5VBBgXRgizs76b75X9AAGljScGdzS3GwCToN3Y1gVCAP84e6/TznrhlswxrHZgbFR L4uvfKfa5mwFF5xn5tZMoN7pOGge0oudzbpqe+xjhWDWGDG54NcPS3iZObmxq6zFYTvYDz r5jz5Wavr9vpRdSYarqvgKWsu+EPnJTzeUZHLPFZjNYeR4aE9RZUUFEYdXKGfz9NZYKvWi 75qoxjVKhQkc27VoXAeDQ703DknE/dKv0U08hqVoM8dsFGgwZRUvbBATODz4JQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLSN21fMzyrK; Fri, 11 Oct 2024 22:11:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMBW20029197; Fri, 11 Oct 2024 22:11:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMBW67029194; Fri, 11 Oct 2024 22:11:32 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:11:32 GMT Message-Id: <202410112211.49BMBW67029194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 03b4f232354c - stable/14 - uncompress: Avoid reading an extra byte List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 03b4f232354ce68fe1cb462038654f6527f63579 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=03b4f232354ce68fe1cb462038654f6527f63579 commit 03b4f232354ce68fe1cb462038654f6527f63579 Author: David Jones <drj@ravenbrook.com> AuthorDate: 2024-10-11 15:49:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:11:02 +0000 uncompress: Avoid reading an extra byte When reading the next code in a stream, avoid reading an extra byte if we're going to throw it away. When there's no more bits to extract from the stream, bits will be 0 and we'll mask the read byte with 0 anyway. At worst, this will avoid reading one past the end of gbuf array (which is not possible in well formed streams). PR: 127912 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47041 (cherry picked from commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba) --- usr.bin/compress/zopen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c index a5b34ef83ecb..0d0900cabfa1 100644 --- a/usr.bin/compress/zopen.c +++ b/usr.bin/compress/zopen.c @@ -623,7 +623,8 @@ getcode(struct s_zstate *zs) } /* High order bits. */ - gcode |= (*bp & rmask[bits]) << r_off; + if (bits > 0) + gcode |= (*bp & rmask[bits]) << r_off; roffset += n_bits; return (gcode); From nobody Fri Oct 11 22:13:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQLV70nlmz5ZV1p; Fri, 11 Oct 2024 22:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQLV674zWz4Xcf; Fri, 11 Oct 2024 22:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FUgKCo1aifGjEFiJ+IF2LTe/RhrDy7AcNvbKHmnMCHA=; b=G4NSnedzggjYbgXm0Aiv3/IXyiRYnktC9uKyEjixB9tmiCUsy4HyHd5baoJol7n9JImZyR K+swYKN8kzx7NaAPxXrEAsiE0xcgSwfaKwQlyZRBybL4mV29jv3H1DbDj+saXFDBJfQrdl 1uFIlhyguBV070XcKKtivNbXxiRA/VnAyXwQBP68+/Bg8pUixrLELE8NIUeNfjCc5sRazs ZkTCleOl5dmEppi/hZjkCePGNC7dYoSI73CCCllTOJxv9QT3cypCY6SrTdtQ5uwZgC9Ej5 l73O+9gfQkfqRGqez4Wsjx/Q+PIRSWyeFkPrgogONyDhe6TsLUy1F1/DDj1g8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728684783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FUgKCo1aifGjEFiJ+IF2LTe/RhrDy7AcNvbKHmnMCHA=; b=VBw0fdQKs/tSjlYUngfXkS304ETzv4NhFdffGUDfufGS0ck3B1REqHfROF/IpTpxIuW4eh nfbAFpfLu4TqGFYonXrsMNd3ihGFlKpTv1PhrRg4bm5z/K0AYd4dBd9RbIwVPWaMzXlfL5 zLCpwHyKt6qZGjBTQzgyAGzjZHKCsfU72YJpw2TlKS/1qR6b1bLy7OEYCIrGkOqwwYubxQ DA1MKa4qRWELr8Vy9w4gcpC+QfooVbvd67r/WZtI8mkOGqmYb/ZWIcIaiqDgbgS32Gd+LS DUYV4jqw+fFWt0RHO+RsdtFiSivRW1xbtocmceH/jvuZeh+5es23KlgdVDMcaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728684783; a=rsa-sha256; cv=none; b=GP/bz1RXj475FX/4N4HtILIqc6wxrYizifw49nZJQ5SBXQ1sFcAuLZl1eC/if24scbnL4e cui3NH1OpbrY1jSWbJxUzxdMXt3eiBIQhBXzifb0xyouXO9BFMlf2/9mLAUaV+MKeIjhXW y3Pdn3MVszQOZ5Whbqqc3LtKFOwx1DoQFbi4hAeJVRevAvO0YfVNgx2gjSWsT4lcE8sdkt Ho5+DvpI8HDF/GffkX/4KIV+vwlMzDX5DXytM3F9JL1owi1JmMQ/MDVI4bYlHc5370UQSU AYcQp+oGhyx1knko7bJgIirgBxPsRLenuhfE5TKQWDiwDh49JmMRWrXboJpsjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQLV66hqnz10NP; Fri, 11 Oct 2024 22:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BMD2tg035440; Fri, 11 Oct 2024 22:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BMD22A035437; Fri, 11 Oct 2024 22:13:02 GMT (envelope-from git) Date: Fri, 11 Oct 2024 22:13:02 GMT Message-Id: <202410112213.49BMD22A035437@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh <imp@FreeBSD.org> Subject: git: 7e229794ca37 - stable/13 - uncompress: Avoid reading an extra byte List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7e229794ca37d25265b0472bce26e8fd2b9bee2c Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7e229794ca37d25265b0472bce26e8fd2b9bee2c commit 7e229794ca37d25265b0472bce26e8fd2b9bee2c Author: David Jones <drj@ravenbrook.com> AuthorDate: 2024-10-11 15:49:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-10-11 22:12:41 +0000 uncompress: Avoid reading an extra byte When reading the next code in a stream, avoid reading an extra byte if we're going to throw it away. When there's no more bits to extract from the stream, bits will be 0 and we'll mask the read byte with 0 anyway. At worst, this will avoid reading one past the end of gbuf array (which is not possible in well formed streams). PR: 127912 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47041 (cherry picked from commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba) --- usr.bin/compress/zopen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/compress/zopen.c b/usr.bin/compress/zopen.c index a5b34ef83ecb..0d0900cabfa1 100644 --- a/usr.bin/compress/zopen.c +++ b/usr.bin/compress/zopen.c @@ -623,7 +623,8 @@ getcode(struct s_zstate *zs) } /* High order bits. */ - gcode |= (*bp & rmask[bits]) << r_off; + if (bits > 0) + gcode |= (*bp & rmask[bits]) << r_off; roffset += n_bits; return (gcode); From nobody Sat Oct 12 00:44:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQPsL0QjBz5YRMn; Sat, 12 Oct 2024 00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQPsK74XLz4l2h; Sat, 12 Oct 2024 00:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728693894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSI5Rsdeentb4EjmHhZXDMQhOVE6Tp1FmqkyFcJwvWc=; b=kTMqLuS3mE1BzMPIxitGz4+922v+dlqamXarMdWvP4KlfviJh4ZllLWftVcZGo0lP8SYNx cA8luovJj8BKV2t4Iq6oS9qYvxZ3xtAVeRvsdSoQT8oYNiCCDnkcFm9LRTD9mihajuAFWK YtjSDxbutZo2jS7C58WLDTQjUv5m5d/V8o1bCSApJogCkWqiHDz7N9FI6VOwyXxn0tLS1h muh7fPwWRViPGhz6v1vgEHuV7rirYU/wipRLb0sy8GjUap9Wkoja1n4/tfk1ItC15JYAmu wi2DKXVzHbRhJ2TK4tWXYmJ5exrrW5S3fNC4OgzahGayaNFA7cAF+ou/FmfILw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728693894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QSI5Rsdeentb4EjmHhZXDMQhOVE6Tp1FmqkyFcJwvWc=; b=LRLFSuV/SZ+g3A8SWNkxbZt4r4FgsFRoFe7KJQqzQn1XnduoaZzJOJ9LGCLT0rTb+rCxI8 Bwc6z5wFjxfwd3rCq0J8zjLELtOdFC/czNfyIgAZqxjcOrIYCeii3FoE9glgycA7rCksbd /XR6C3A56EJEiR6+yC4opQWrhGJFDQE/ZPln3fJmaW5mhnDtlU6lqwzWZBMnUg17zEzo8t bKEj/Ra6y1dpAtjoaNOCU2jzPvFPOWM6oc4Rv26gJ3YUCT3FJPV6SBo/D8372VaA4+S82p M34Q5+Wysp8oAX+dhDCEBY/Ytol1xD1oDFegCL2Oj/k4Tg942qrFtECaVGyxFA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728693894; a=rsa-sha256; cv=none; b=OiiAkvMKblPPeaerTLRK01NY0V5rkkmuFUbl+vLlx23rSxH4Dnt+CkMIhqimocndJbQAt7 0S9ZXb/qeXRTCg/88A/0E5qxCrrtNQ+kQPlSERWemhl3WuDErLz4X7hvYnITFQpJT5RlxY +WeF5yNnVD1ReYFEKlcx6Y5k3d7PY02BWPOm2btDOe+69syUIVioPEmA3aTY9zCKbq634a TjjGrSrhkrfe7bJzAFcSKbUy2n35k4wEx21y2VBL8WLksD7nF7LJYrw3ULU80h5daanzNv isd/A+W/SkHRW8fFH1ZzuZWsxhmt1fXHe+EU6KjaEmWv27VIoBfnLXUqOX9sVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQPsK6gbdz13sS; Sat, 12 Oct 2024 00:44:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49C0irCk088435; Sat, 12 Oct 2024 00:44:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49C0irXQ088431; Sat, 12 Oct 2024 00:44:53 GMT (envelope-from git) Date: Sat, 12 Oct 2024 00:44:53 GMT Message-Id: <202410120044.49C0irXQ088431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: e7474c619270 - stable/14 - nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e7474c619270c5c325ce844b77eecc2dcf98147c Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e7474c619270c5c325ce844b77eecc2dcf98147c commit e7474c619270c5c325ce844b77eecc2dcf98147c Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2024-09-30 22:49:57 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-10-12 00:43:27 +0000 nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1 nfsrv_freeopen() was being called after the mutex lock was released, making it possible for other kernel threads to change the lists while nfsrv_freeopen() took the nfsstateid out of the lists. This patch moves the code around "if (nfsrv_freeopen(stp, vp, 1 p) == 0) {" into nfsrv_freeopen(), so that it can remove the nfsstateid structure from all lists before unlocking the mutex. This should avoid any race between CLOSE and other nfsd threads updating the NFSv4 state. The patch does not affect semantics when vfs.nfsd.enable_locallocks=0. PR: 280978 Tested by: Matthew L. Dailey <matthew.l.dailey@dartmouth.edu> (cherry picked from commit eb345e05ac6602eeef0c33fce9025bbc8ec44d0f) --- sys/fs/nfsserver/nfs_nfsdstate.c | 62 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 6b40e0f64141..6cd8c1c861ec 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -139,7 +139,7 @@ static void nfsrv_dumpaclient(struct nfsclient *clp, struct nfsd_dumpclients *dumpp); static void nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p); -static int nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, +static void nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p); static void nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p); @@ -1566,7 +1566,7 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p) while (nstp != LIST_END(&stp->ls_open)) { tstp = nstp; nstp = LIST_NEXT(nstp, ls_list); - (void) nfsrv_freeopen(tstp, NULL, cansleep, p); + nfsrv_freeopen(tstp, NULL, cansleep, p); } if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); @@ -1581,12 +1581,11 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p) * are no other opens on the file. * Returns 1 if it free'd the nfslockfile, 0 otherwise. */ -static int +static void nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p) { struct nfsstate *nstp, *tstp; struct nfslockfile *lfp; - int ret; LIST_REMOVE(stp, ls_hash); LIST_REMOVE(stp, ls_list); @@ -1595,35 +1594,46 @@ nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p) lfp = stp->ls_lfp; /* * Now, free all lockowners associated with this open. + * Note that, if vp != NULL, nfsrv_freelockowner() will + * not call nfsrv_freeallnfslocks(), so it needs to be called, below. */ LIST_FOREACH_SAFE(tstp, &stp->ls_open, ls_list, nstp) nfsrv_freelockowner(tstp, vp, cansleep, p); + if (vp != NULL) { + KASSERT(cansleep != 0, ("nfsrv_freeopen: cansleep == 0")); + mtx_assert(NFSSTATEMUTEXPTR, MA_OWNED); + /* + * Only called with vp != NULL for Close when + * vfs.nfsd.enable_locallocks != 0. + * Lock the lfp so that it will not go away and do the + * nfsrv_freeallnfslocks() call that was not done by + * nfsrv_freelockowner(). + */ + nfsrv_locklf(lfp); + NFSUNLOCKSTATE(); + NFSVOPUNLOCK(vp); + nfsrv_freeallnfslocks(stp, vp, cansleep, p); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSLOCKSTATE(); + nfsrv_unlocklf(lfp); + } + /* * The nfslockfile is freed here if there are no locks * associated with the open. * If there are locks associated with the open, the * nfslockfile structure can be freed via nfsrv_freelockowner(). - * Acquire the state mutex to avoid races with calls to - * nfsrv_getlockfile(). */ - if (cansleep != 0) - NFSLOCKSTATE(); if (lfp != NULL && LIST_EMPTY(&lfp->lf_open) && LIST_EMPTY(&lfp->lf_deleg) && LIST_EMPTY(&lfp->lf_lock) && LIST_EMPTY(&lfp->lf_locallock) && LIST_EMPTY(&lfp->lf_rollback) && lfp->lf_usecount == 0 && - (cansleep != 0 || nfsv4_testlock(&lfp->lf_locallock_lck) == 0)) { + nfsv4_testlock(&lfp->lf_locallock_lck) == 0) nfsrv_freenfslockfile(lfp); - ret = 1; - } else - ret = 0; - if (cansleep != 0) - NFSUNLOCKSTATE(); free(stp, M_NFSDSTATE); NFSD_VNET(nfsstatsv1_p)->srvopens--; nfsrv_openpluslock--; - return (ret); } /* @@ -1636,7 +1646,8 @@ nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep, LIST_REMOVE(stp, ls_hash); LIST_REMOVE(stp, ls_list); - nfsrv_freeallnfslocks(stp, vp, cansleep, p); + if (vp == NULL) + nfsrv_freeallnfslocks(stp, vp, cansleep, p); if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); free(stp, M_NFSDSTATE); @@ -3431,7 +3442,6 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, { struct nfsstate *stp; struct nfsclient *clp; - struct nfslockfile *lfp; u_int32_t bits; int error = 0, gotstate = 0, len = 0; u_char *clidp = NULL; @@ -3526,9 +3536,7 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, NFSBCOPY(clp->lc_id, clidp, len); gotstate = 1; } - NFSUNLOCKSTATE(); } else if (new_stp->ls_flags & NFSLCK_CLOSE) { - lfp = stp->ls_lfp; if (retwriteaccessp != NULL) { if ((stp->ls_flags & NFSLCK_WRITEACCESS) != 0) *retwriteaccessp = 1; @@ -3536,20 +3544,10 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, *retwriteaccessp = 0; } if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) { - /* Get the lf lock */ - nfsrv_locklf(lfp); - NFSUNLOCKSTATE(); ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); - NFSVOPUNLOCK(vp); - if (nfsrv_freeopen(stp, vp, 1, p) == 0) { - NFSLOCKSTATE(); - nfsrv_unlocklf(lfp); - NFSUNLOCKSTATE(); - } - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + nfsrv_freeopen(stp, vp, 1, p); } else { - (void) nfsrv_freeopen(stp, NULL, 0, p); - NFSUNLOCKSTATE(); + nfsrv_freeopen(stp, NULL, 0, p); } } else { /* @@ -3567,8 +3565,8 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, if ((nd->nd_flag & ND_NFSV41) != 0 && stp->ls_stateid.seqid == 0) stp->ls_stateid.seqid = 1; - NFSUNLOCKSTATE(); } + NFSUNLOCKSTATE(); /* * If the client just confirmed its first open, write a timestamp From nobody Sat Oct 12 00:46:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQPty1g3Mz5YS11; Sat, 12 Oct 2024 00:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQPtx61KQz4lWC; Sat, 12 Oct 2024 00:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728693977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8cpHaepQYapEJmnhGezo8VaVEZ30SioQy+iujRDaIA=; b=uH8V+p8Wh8AaE7YkJBVoN8HpZfp8h4O/RkJxwqjpDT290NxukRILCRsFRV5E0nSMbYiLCc PIjQngFFpVDztvXI8UxvwfJuiJL4KyA5FjOWybRn6zIEjDwlPpwFpcl7KTTq99bMgKi+KX FPJtwFq5UVn25nfp+daKJlO1+3w9Qtf10bI+wceDej4AyJQjwxRa25uImyL+pu5iVywMTW Cpt68R676TO6YMi2bqhcbbDnXJ0rdcTo2BbrlgOCTc0gd7fi1iuqUArHZclDHx1+uv6vHe l+aYtzkTAx80hDymKq19/M3dRGO9/PL4cVbcgTQG0z6Qj3Fa4QgK6LFuI5Jj4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728693977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m8cpHaepQYapEJmnhGezo8VaVEZ30SioQy+iujRDaIA=; b=XmgK4OKlSJe9cicb3iJixmHBwMmQ0kaF2WvpETz7tmq+LCSI2Cls/PEJdXtI7Htpb0/it9 M9Fby+0hHAzM5BsXEy7+EjeREdqbEt8yg+UZu2iTaBXIv+X1WKYyzYoC3e+KOiWx67C/74 bFxkAPjDy43AL27vTaIjBky3oezr9/wpHmaRGd0zgNpTOevzzPS9LqALU+w7Cd1/9awAhO lrCQGpzvDwsecMQlf5lJg8tgT+B1sJwtE6tMECR+wboa33NBFu4LJ5wM4KGlxllhTAQ/KW jbCwskIJdPfe6PBGNXE3kp2cmsrrnbR1H58VPSGKxqLrjae0BSWkk2oYlXmrZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728693977; a=rsa-sha256; cv=none; b=jKJQ0cG+ICO0+S55ygJV0JEu/0RIZ7VWIuU2KnkZvpf5t+U9Q5/GFq/839BA7mhQU8H+YN FAUCBSRDParoGjaPaflfk7GHgXpprlxveQFFScMsf57Mg7ZSHGONh+Yd3PgIn4oy6vyq9B MLSSZRK9ZgMnrAdfKXwEpZql6KtfqiUzZDF1NH7xjZvB9HsX1+QzCLTNC2m88F31Yy8jq8 mAObORRXF8ztWpe+x6wggj5T9D/15JG/goxQSRBGOHHYKxTLvrjRZtB8v2eUVfozx+m1OA Nvfw+4oLR1YcgIwQflJ5NhUz0epcSsKWHcn/7ZdSxTVeLiV36bbx72dbBY9pjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQPtx270mz14KQ; Sat, 12 Oct 2024 00:46:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49C0kHLT088761; Sat, 12 Oct 2024 00:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49C0kH8A088758; Sat, 12 Oct 2024 00:46:17 GMT (envelope-from git) Date: Sat, 12 Oct 2024 00:46:17 GMT Message-Id: <202410120046.49C0kH8A088758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 83ac4cebe84e - stable/14 - Revert "nfscl: Enable support for the Lookup+Open RPC" List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 83ac4cebe84e651e4130e0e31e0c3ceff7affaa1 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=83ac4cebe84e651e4130e0e31e0c3ceff7affaa1 commit 83ac4cebe84e651e4130e0e31e0c3ceff7affaa1 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2024-09-28 22:01:36 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-10-12 00:45:22 +0000 Revert "nfscl: Enable support for the Lookup+Open RPC" This reverts commit 9792c7d3eb41dc1e3709e00a98734c3312d1b4fe. The email thread "panic: nfsv4root ref cnt cpuid=1" on freebsd-fs@freebsd.org descibes crashes that occurred for a NFSv4.1 client mount using "oneopenown" where the same file is re-opened many times by different processes. The crashes appear to have been caused by the use of the Lookup+Open RPC (which only happens for mounts using the "oneopenown" option). There appears to be a race between closure of the open and the open acquired by the Lookup+Open RPC. Since Lookup+Open RPCs are only an optimization and can only be done for "oneopenown" at this time, this patch reverts enabling of them. It may be possible to fix the code so that Lookup+Open works reliably, so the code is left in place (although it will never be executed) for now. Reported by: J David <j.david.lists@gmail.com> (cherry picked from commit 6df05714da160a8ac3e27ee34ff903bd0e760002) --- sys/fs/nfsclient/nfs_clvnops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 13341dfc26e0..bf24a161b94b 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1309,6 +1309,11 @@ nfs_lookup(struct vop_lookup_args *ap) } openmode = 0; +#if 0 + /* + * The use of LookupOpen breaks some builds. It is disabled + * until that is fixed. + */ /* * If this an NFSv4.1/4.2 mount using the "oneopenown" mount * option, it is possible to do the Open operation in the same @@ -1328,6 +1333,7 @@ nfs_lookup(struct vop_lookup_args *ap) openmode |= NFSV4OPEN_ACCESSWRITE; } NFSUNLOCKMNT(nmp); +#endif newvp = NULLVP; NFSINCRGLOBAL(nfsstatsv1.lookupcache_misses); From nobody Sat Oct 12 00:51:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQQ0p3x0xz5YSL2; Sat, 12 Oct 2024 00:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQQ0p3QbYz4mLy; Sat, 12 Oct 2024 00:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728694282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HfP+49w4xu3s7tkjpENF/xvsf6ndgvlJ6wzmPglWtk8=; b=iziqhUlQLkYp1HpoXRSdl1cpgQCL0LNBO5O8Kmb0DNq+mEtxwjQqcHoGJqOuZJ81LTTzxv I03GhRyKFHkZAGfVdsM9I/2mPQE3uOeKjImUeiy1PcIyTGD1TGJVzKkHjTJJvTA861am/s 4S0KsXk1wF+CEsdTzWtEsVDDA9mhX+kxDM8MxKxKGBqbtuyYi07XcC+WAXkMi46M1CMMaZ vr79yL2yr+vp8PsKJvq71Tv0s3MPW6B2W+5jNyz1w7G5g+XKzv52NMCvBSciyCf2NeiEt/ HA3pHxDgd+tZu5EcrUvWO7tMhuSzsZgTpyEa+aX/RUDmD1+NFCs1BftctXnl5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728694282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HfP+49w4xu3s7tkjpENF/xvsf6ndgvlJ6wzmPglWtk8=; b=OlpzcZg+ovy/5+fIGMkzBDXpkWT5JY9ow63d5Kspq4dLpeXub/k59vr/XYaY6oCQQgSmw2 uA2iAiiROKTR0MpJdEXcUxwcI1eCElB63eLA+G8a+tNgP/IQX1AzHbZq2vhm3ujrKrSHgM Gwn07SJhcrwGYXwm1JfDAy82FViLpQRVMtH87HdxyxTF1M0ECW5UEw7gLgT92fjMK2MkBd 8uCXyCGTO7NdZG+V0nJqmPqp4qi1rZs2YPaKbN6UhI3e/KxgrBPoWz0OGzmMZYW/80F2tD NtJEWCJyZsKJsROmabgH2N0hlv7ydrJVVx3Wi++xl6LSbqiuvah71Z55KfPjQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728694282; a=rsa-sha256; cv=none; b=JFmUJ2F1G4DSX7RMI3zX4PezN6QHdVNgWJUmk35e7qEshr4Kixb9iLR1sXwtq03wytFrOd sFcZ8HrZ9duiPGyzrZENDFkHD0LJtkt+O81BpVJ2+hmBUFaTnxGZodLf9TrR8ScDfowqoI GC4ssnf5DsxlwjjG9S3CjepvRK+SlSb0blD56LXnLb/NLipMBpiH2GsDZWMTRu87H+PtsM TDd1HUm/BocBwx4Ax0r8PfCK6vax66eCyZWJ0bOJ5zBgiYcTwhd0HMx6SmPQ9VycvtrSfF hspnpyOiIQJrEXvuv8MoB+kc4/nc3aHz2OzSsLRe4J72snaTtKy499ZUyAgpWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQQ0p32Jpz14Kj; Sat, 12 Oct 2024 00:51:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49C0pM33003596; Sat, 12 Oct 2024 00:51:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49C0pMHu003593; Sat, 12 Oct 2024 00:51:22 GMT (envelope-from git) Date: Sat, 12 Oct 2024 00:51:22 GMT Message-Id: <202410120051.49C0pMHu003593@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: cc07d914bc80 - stable/13 - nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cc07d914bc80f0c644584de6eab2efd30e911d8d Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=cc07d914bc80f0c644584de6eab2efd30e911d8d commit cc07d914bc80f0c644584de6eab2efd30e911d8d Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2024-09-30 22:49:57 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-10-12 00:49:55 +0000 nfsd: Fix close handling when vfs.nfsd.enable_locallocks=1 nfsrv_freeopen() was being called after the mutex lock was released, making it possible for other kernel threads to change the lists while nfsrv_freeopen() took the nfsstateid out of the lists. This patch moves the code around "if (nfsrv_freeopen(stp, vp, 1 p) == 0) {" into nfsrv_freeopen(), so that it can remove the nfsstateid structure from all lists before unlocking the mutex. This should avoid any race between CLOSE and other nfsd threads updating the NFSv4 state. The patch does not affect semantics when vfs.nfsd.enable_locallocks=0. PR: 280978 Tested by: Matthew L. Dailey <matthew.l.dailey@dartmouth.edu> (cherry picked from commit eb345e05ac6602eeef0c33fce9025bbc8ec44d0f) --- sys/fs/nfsserver/nfs_nfsdstate.c | 62 +++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 44f8aeb2a70d..ac02f390fb72 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -139,7 +139,7 @@ static void nfsrv_dumpaclient(struct nfsclient *clp, struct nfsd_dumpclients *dumpp); static void nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p); -static int nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, +static void nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p); static void nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p); @@ -1549,7 +1549,7 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p) while (nstp != LIST_END(&stp->ls_open)) { tstp = nstp; nstp = LIST_NEXT(nstp, ls_list); - (void) nfsrv_freeopen(tstp, NULL, cansleep, p); + nfsrv_freeopen(tstp, NULL, cansleep, p); } if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); @@ -1564,12 +1564,11 @@ nfsrv_freeopenowner(struct nfsstate *stp, int cansleep, NFSPROC_T *p) * are no other opens on the file. * Returns 1 if it free'd the nfslockfile, 0 otherwise. */ -static int +static void nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p) { struct nfsstate *nstp, *tstp; struct nfslockfile *lfp; - int ret; LIST_REMOVE(stp, ls_hash); LIST_REMOVE(stp, ls_list); @@ -1578,35 +1577,46 @@ nfsrv_freeopen(struct nfsstate *stp, vnode_t vp, int cansleep, NFSPROC_T *p) lfp = stp->ls_lfp; /* * Now, free all lockowners associated with this open. + * Note that, if vp != NULL, nfsrv_freelockowner() will + * not call nfsrv_freeallnfslocks(), so it needs to be called, below. */ LIST_FOREACH_SAFE(tstp, &stp->ls_open, ls_list, nstp) nfsrv_freelockowner(tstp, vp, cansleep, p); + if (vp != NULL) { + KASSERT(cansleep != 0, ("nfsrv_freeopen: cansleep == 0")); + mtx_assert(NFSSTATEMUTEXPTR, MA_OWNED); + /* + * Only called with vp != NULL for Close when + * vfs.nfsd.enable_locallocks != 0. + * Lock the lfp so that it will not go away and do the + * nfsrv_freeallnfslocks() call that was not done by + * nfsrv_freelockowner(). + */ + nfsrv_locklf(lfp); + NFSUNLOCKSTATE(); + NFSVOPUNLOCK(vp); + nfsrv_freeallnfslocks(stp, vp, cansleep, p); + NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSLOCKSTATE(); + nfsrv_unlocklf(lfp); + } + /* * The nfslockfile is freed here if there are no locks * associated with the open. * If there are locks associated with the open, the * nfslockfile structure can be freed via nfsrv_freelockowner(). - * Acquire the state mutex to avoid races with calls to - * nfsrv_getlockfile(). */ - if (cansleep != 0) - NFSLOCKSTATE(); if (lfp != NULL && LIST_EMPTY(&lfp->lf_open) && LIST_EMPTY(&lfp->lf_deleg) && LIST_EMPTY(&lfp->lf_lock) && LIST_EMPTY(&lfp->lf_locallock) && LIST_EMPTY(&lfp->lf_rollback) && lfp->lf_usecount == 0 && - (cansleep != 0 || nfsv4_testlock(&lfp->lf_locallock_lck) == 0)) { + nfsv4_testlock(&lfp->lf_locallock_lck) == 0) nfsrv_freenfslockfile(lfp); - ret = 1; - } else - ret = 0; - if (cansleep != 0) - NFSUNLOCKSTATE(); free(stp, M_NFSDSTATE); NFSD_VNET(nfsstatsv1_p)->srvopens--; nfsrv_openpluslock--; - return (ret); } /* @@ -1619,7 +1629,8 @@ nfsrv_freelockowner(struct nfsstate *stp, vnode_t vp, int cansleep, LIST_REMOVE(stp, ls_hash); LIST_REMOVE(stp, ls_list); - nfsrv_freeallnfslocks(stp, vp, cansleep, p); + if (vp == NULL) + nfsrv_freeallnfslocks(stp, vp, cansleep, p); if (stp->ls_op) nfsrvd_derefcache(stp->ls_op); free(stp, M_NFSDSTATE); @@ -3537,7 +3548,6 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, { struct nfsstate *stp; struct nfsclient *clp; - struct nfslockfile *lfp; u_int32_t bits; int error = 0, gotstate = 0, len = 0; u_char *clidp = NULL; @@ -3632,9 +3642,7 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, NFSBCOPY(clp->lc_id, clidp, len); gotstate = 1; } - NFSUNLOCKSTATE(); } else if (new_stp->ls_flags & NFSLCK_CLOSE) { - lfp = stp->ls_lfp; if (retwriteaccessp != NULL) { if ((stp->ls_flags & NFSLCK_WRITEACCESS) != 0) *retwriteaccessp = 1; @@ -3642,20 +3650,10 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, *retwriteaccessp = 0; } if (nfsrv_dolocallocks != 0 && !LIST_EMPTY(&stp->ls_open)) { - /* Get the lf lock */ - nfsrv_locklf(lfp); - NFSUNLOCKSTATE(); ASSERT_VOP_ELOCKED(vp, "nfsrv_openupdate"); - NFSVOPUNLOCK(vp); - if (nfsrv_freeopen(stp, vp, 1, p) == 0) { - NFSLOCKSTATE(); - nfsrv_unlocklf(lfp); - NFSUNLOCKSTATE(); - } - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + nfsrv_freeopen(stp, vp, 1, p); } else { - (void) nfsrv_freeopen(stp, NULL, 0, p); - NFSUNLOCKSTATE(); + nfsrv_freeopen(stp, NULL, 0, p); } } else { /* @@ -3673,8 +3671,8 @@ nfsrv_openupdate(vnode_t vp, struct nfsstate *new_stp, nfsquad_t clientid, if ((nd->nd_flag & ND_NFSV41) != 0 && stp->ls_stateid.seqid == 0) stp->ls_stateid.seqid = 1; - NFSUNLOCKSTATE(); } + NFSUNLOCKSTATE(); /* * If the client just confirmed its first open, write a timestamp From nobody Sat Oct 12 12:11:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQj5J0QnWz5ZHKZ; Sat, 12 Oct 2024 12:11:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQj5H722Yz4f4Q; Sat, 12 Oct 2024 12:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728735076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA1/TCj5WY5RJaa01ipqtghNYGDIKHHVoAyhBzO+o4I=; b=Hlh1tI+2rnvcb2dQmXrt0aUj30cc18X/oBTkpvDly8qdSWbr5t1oWC4D/NO9bZJB4DKyfc g5aRCHiCZgwol28EJx/rYqroPeuw18ubeLN9Wds8KeRWXF56HeU3yllQxOU+0MRL9x/W3i T+5nodjGqOJkORpfBylrOvNz442VmR+w6B6tiu8tErwdS3YonqOC6WC/ZIFuwMBNcTUEsz hmdpP7LWOSPfdsLexDOLMgkfQ5OCbxW3a/Roh0XN/PNLeKK0CjzdU9FK329DK9isoe12mv YdsgThMeb3W8aXwsn7bDbyYnwPfYsRjr8JS0kUXJAmzF9dsFyw38Ma1iwhrCHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728735076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TA1/TCj5WY5RJaa01ipqtghNYGDIKHHVoAyhBzO+o4I=; b=rGZIxleZwE6f0N83KS5aa+fVzn+WLBRX5uJJ9GVOQyXbFLkr9JOm6PF7z8aVFaDwmzD9iN INGJOP7HJJdYZfIK2nL9JopqW+5OeFQGMgXtfHvxvSMpzEuXxUGSo6vpJOXv7Kf5DLRFN0 28Y4rnfb6dRD92Q3ckny/67i4bp5hxQRfkCTf48UKOcw6kk8z8GtB6AFeoELPFN07tF97X 8kWfxbaCzMJ01jn2AMNe2YY1vOdGXBdq0jVGu4RUaXRVBVrOiMdIHVMHbVPlBzp2SSHk7w xJCYJE7GVuwsOQzMVNpi3AIPlIs+JSbR+07erRjBEW9Lu14mG4LICn30Ah1Aqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728735076; a=rsa-sha256; cv=none; b=FT+7nrDw+Jq3ywqgMJMK1iori/o+XDjH4oolL6a+xTs3YAXXdUxAfNm8gdODhcJFxjVL/h +aU1YQW6rnWRG5LEihYgQ5R7zmIXcs4fV4eudBalu60gj7jW9cYYsK/3jQ6SHFEN8CBDP4 e7wM9zQnPmKUcufl5nF9tvWfMhbSP5yu2JqIH4V1bShpXyf+A/hkrRBQBPjhJq0Xz3OlAm G9xTU6rYgplq7bbTA+nauqYlU1jkzuJjRzwCqd/8asaAmve7GPoEDfQ9hkY7wk50OM7Wvs GJgKdUTSCcGOyGWJH1OahtHuCGwS5G2c+xIopewTQQBxZXUtJkDzwNRKf3YZig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQj5H6Wvyz1NKv; Sat, 12 Oct 2024 12:11:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CCBFiZ052924; Sat, 12 Oct 2024 12:11:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CCBFLS052921; Sat, 12 Oct 2024 12:11:15 GMT (envelope-from git) Date: Sat, 12 Oct 2024 12:11:15 GMT Message-Id: <202410121211.49CCBFLS052921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov <michaelo@FreeBSD.org> Subject: git: 36c370fa3e97 - stable/14 - dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 36c370fa3e9750543b447e9efdcbe83463836388 Auto-Submitted: auto-generated The branch stable/14 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=36c370fa3e9750543b447e9efdcbe83463836388 commit 36c370fa3e9750543b447e9efdcbe83463836388 Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-09-23 12:37:34 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-10-12 12:11:04 +0000 dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 Ignore DHCP options 124 and 125 to shut up the warning messages. These options are defined in the RFC 3925. PR: 281361 Reviewed by: jrm (mentor), otis (mentor), thj Tested by: jlduran@gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46760 (cherry picked from commit 38c63b52830c85013f30bc62b2b32f3936d84e65) --- sbin/dhclient/dhclient.c | 2 ++ sbin/dhclient/dhcp.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 4a674cec5888..93988d5ce7a4 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2641,6 +2641,8 @@ check_option(struct client_lease *l, int option) case DHO_DHCP_USER_CLASS_ID: case DHO_URL: case DHO_SIP_SERVERS: + case DHO_V_I_VENDOR_CLASS: + case DHO_V_I_VENDOR_OPTS: case DHO_END: return (1); case DHO_CLASSLESS_ROUTES: diff --git a/sbin/dhclient/dhcp.h b/sbin/dhclient/dhcp.h index 99b69613934f..02ea42a66079 100644 --- a/sbin/dhclient/dhcp.h +++ b/sbin/dhclient/dhcp.h @@ -174,6 +174,8 @@ struct dhcp_packet { #define DHO_DOMAIN_SEARCH 119 #define DHO_SIP_SERVERS 120 #define DHO_CLASSLESS_ROUTES 121 +#define DHO_V_I_VENDOR_CLASS 124 +#define DHO_V_I_VENDOR_OPTS 125 #define DHO_END 255 /* DHCP message types. */ From nobody Sat Oct 12 12:15:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQjB327KWz5ZHnZ; Sat, 12 Oct 2024 12:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQjB31QFhz4fSZ; Sat, 12 Oct 2024 12:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728735323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jWXZ/bLTbGhrnGeMOdkxugoD6pPpFMdMi/+H+x5ayY=; b=bY+EjOJRauLXnEOWtoEfgFqUCPGMlKrGkCnv49BJHGdISG4WdyKa3+u2Af4mL4o45Kbw6X N1n2FzdZwhWjavtNhh8pZ94RBXLM8BEREZtK2K/N15jNVKQwBqe0E56dott3/XbQmBJcyQ 4RyDwL2N353ZJPCW0scZjHkeYOx2cSEnA7OhgFnFz05+Ug5u8B/eoCwJouavAbBL5E0XBU ZKpSogt+WLnXZwcCaaSNPBMLIeurgy+BhnySw/0tJLjF4TSnbwX590OzHP2IcBVtYWyCge uVWZudzJ/oWHLyrdd2pEB2bhtiYutPg3V34VudXFeWTH+rKl9VJJgeInmBPSXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728735323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2jWXZ/bLTbGhrnGeMOdkxugoD6pPpFMdMi/+H+x5ayY=; b=PWKwfG/2uVn3GOSc23UklnXj6w8s0llo2591FfffFJjk6WBy+Z9FnNoEUEQTnI59nbTE/B ZaC02eeQvXkFdpUo6evdEWjGbelVqajw/4Vvs48lhN4WqGp0RnlSoAZex5A0I/lxuJpVPu QKPY07sVfU2USyHcoKFoM3vCpsNFnbnou+06QH6BVUojBSyv/q9VtweyNyr8NsjG30bzGk of3GM1iTMK9pWZIwIIuknOBtQzdiLEKrVR3WDBBWNbdVADFPsqnuqGln2o9emv5FHUAfFQ ZEh/0rMNgqPZtwTRRWLssfYkt5/aqb7KnJnG9MJSTqxee1UX5iaAVy+DrjSUDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728735323; a=rsa-sha256; cv=none; b=FGAVJHKMNCn6CIFcNJwv4CUarXsaci59nehXdaGM/QeIZps+deKJGcbsSvOlmibTMo3RJG WKe3quEA+XlrAQb77RMATw0+dlV3FcjO+8aKIBmPTOTfWpqqpFlFRe3kH2Qj8+8Ro8SJzB 97tCWXKx0OpJgd35kkfUaPfJIO7faZOROeuDDNpWzQoRh5y4lfg861fVwb//X9wDXnUbCt Yj3Q/SJOduWemKGIaabOCLVZ9slbRbpp/mer4Aa6vgLLzP0SAIrjffGn3Irm+nX+XKDwT4 tS246yXuatUPH28UgmwUyjXmOy91HTxrpV+1zwwcCs1zyGG0xeSuguHAm42iIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQjB312CZz1PLF; Sat, 12 Oct 2024 12:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CCFNM0057649; Sat, 12 Oct 2024 12:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CCFNIe057646; Sat, 12 Oct 2024 12:15:23 GMT (envelope-from git) Date: Sat, 12 Oct 2024 12:15:23 GMT Message-Id: <202410121215.49CCFNIe057646@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Michael Osipov <michaelo@FreeBSD.org> Subject: git: 9525f5726a85 - stable/13 - dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9525f5726a85c0e7f9fb2033add80cd51cce3844 Auto-Submitted: auto-generated The branch stable/13 has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=9525f5726a85c0e7f9fb2033add80cd51cce3844 commit 9525f5726a85c0e7f9fb2033add80cd51cce3844 Author: Michael Osipov <michaelo@FreeBSD.org> AuthorDate: 2024-09-23 12:37:34 +0000 Commit: Michael Osipov <michaelo@FreeBSD.org> CommitDate: 2024-10-12 12:15:07 +0000 dhclient: Ignore vendor-identifying DHCP options defined in RFC 3925 Ignore DHCP options 124 and 125 to shut up the warning messages. These options are defined in the RFC 3925. PR: 281361 Reviewed by: jrm (mentor), otis (mentor), thj Tested by: jlduran@gmail.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46760 (cherry picked from commit 38c63b52830c85013f30bc62b2b32f3936d84e65) --- sbin/dhclient/dhclient.c | 2 ++ sbin/dhclient/dhcp.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 576d7260086c..141403d8c86b 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -2632,6 +2632,8 @@ check_option(struct client_lease *l, int option) case DHO_DHCP_USER_CLASS_ID: case DHO_URL: case DHO_SIP_SERVERS: + case DHO_V_I_VENDOR_CLASS: + case DHO_V_I_VENDOR_OPTS: case DHO_END: return (1); case DHO_CLASSLESS_ROUTES: diff --git a/sbin/dhclient/dhcp.h b/sbin/dhclient/dhcp.h index 99b69613934f..02ea42a66079 100644 --- a/sbin/dhclient/dhcp.h +++ b/sbin/dhclient/dhcp.h @@ -174,6 +174,8 @@ struct dhcp_packet { #define DHO_DOMAIN_SEARCH 119 #define DHO_SIP_SERVERS 120 #define DHO_CLASSLESS_ROUTES 121 +#define DHO_V_I_VENDOR_CLASS 124 +#define DHO_V_I_VENDOR_OPTS 125 #define DHO_END 255 /* DHCP message types. */ From nobody Sat Oct 12 22:30:22 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQyqf4Fyhz5Z4VR; Sat, 12 Oct 2024 22:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQyqf3Ygjz4bkl; Sat, 12 Oct 2024 22:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728772222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIhLEHS6cZDQPoxTKE6wVwtVKsd6Kz9kRSQhZbge1dQ=; b=JePAqyYk5FC49CWHOub7UMPxwqL3JeCYh+1B43YO0DOGTD2jExTd01aQ3UTHDhfXTOhmh5 3a/LI4tlzGI2wG7Iwld63c4YHw9OnSsDzU3WWo6aqGsN/JqEc4OdHP4Hxj4fmYnmnmfZAu qhpmqv37p0H/bFLEw6hoRzEdoZWjU0h4Vn9nS+yiZLKkZixbUC88ypSHyzcEwdja/7w7Dk gdm9rPVUlVFJYO5eKSUboLJWKRSAxGmrOC6GP4NmrAYa2nm9Ze87Fdn+/22fWazHWb1/9H az3sj+kKJdHJKQFB8BbIJNxA/6ZBCAhuYbKnc9tuv4zWnDaG3Yh1UucdguC26g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728772222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vIhLEHS6cZDQPoxTKE6wVwtVKsd6Kz9kRSQhZbge1dQ=; b=UqCsHrGE1qXpF78p2DsbTJqWbt3lHwztUmqs6RATq61Qq19+X1ErXzii7Xb/pmGm+Z1+mN /jmaqAyhS9BycTQ9/Jp2LDSSeHEa1KU0nRdVLSsi5E9nSDGLcqigSL/sb4FL1AJ5e8yvXe VlqL7njctNkkx1uCVtUjJ9fKLVzU5dClO62eAWN98mQcaXHeQfh3vqwTddvUx+x4SZCu1Z 4+mWPR0T79mnpDm648cVKbDdQTtKLHGPUgJx4UJEdAXgiHSwB7UtZYdZDIy2hRjINNTvnT C7plXAVi5C9V0jBCgd4HkQbwPgyg0uF6kwxc8Q6yn8OilPAwApHvn/afvP4lfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728772222; a=rsa-sha256; cv=none; b=XumKrHa1ry8+pV3xMIOv5nrsMc6yBRcBZyPN48c0NYnVT/JYDX6Gq9BhyFQGlQEYehFqMq kDzjRD3zR1oRZU8CGsyGENlgfRlhO79UC7grC0UVN6YH4xAFQ+/Ox+0qye9bEs8Ju0hPgb T4q58UrqSHdcHvNYeXttBAh0NitpCOQi0w9INuddHFF53/zudZlMB6GiDoDxHivc7rHqGK IqzF5bbrQrjazrtTu0+hZ46Rr9OYMUXeNQNmCo0Yu+WjuunGEqdr2nFKcED5m5Mf1TgVfI PhvbVHfDZdOUppgz3DH4NsNF9VgbC/Tt2UH4Qw633o2v3Tlk8JBLqEA+uPQxgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQyqf32yHzSqV; Sat, 12 Oct 2024 22:30:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CMUMir099231; Sat, 12 Oct 2024 22:30:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CMUMFE099228; Sat, 12 Oct 2024 22:30:22 GMT (envelope-from git) Date: Sat, 12 Oct 2024 22:30:22 GMT Message-Id: <202410122230.49CMUMFE099228@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick <mckusick@FreeBSD.org> Subject: git: 54416c6e1379 - stable/14 - Ensure that soft updates are not enabled by default when using mdmfs(8) List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/14 X-Git-Reftype: branch X-Git-Commit: 54416c6e137980197ee7a3cdc124174642f32af2 Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=54416c6e137980197ee7a3cdc124174642f32af2 commit 54416c6e137980197ee7a3cdc124174642f32af2 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2024-10-03 15:05:42 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2024-10-12 22:30:06 +0000 Ensure that soft updates are not enabled by default when using mdmfs(8) When soft updates began being enabled by default that change carried over to mdmfs(8) which does not want or need them. This fix ensures that they are only enabled in mdmfs(8) when requested with the -U flag. Reported by: Ivan Rozhuk Tested by: Michael Proto PR: 279308 (cherry picked from commit 5b21d4ad060acb06c72e0458daebec9bcbf0cefd) --- include/paths.h | 3 +++ sbin/mdmfs/mdmfs.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/paths.h b/include/paths.h index 55f7d1175617..0f930ed5c03d 100644 --- a/include/paths.h +++ b/include/paths.h @@ -92,6 +92,7 @@ #define _PATH_SENDMAIL "/usr/sbin/sendmail" #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" +#define _PATH_TUNEFS "/sbin/tunefs" #define _PATH_UNIX "don't use _PATH_UNIX" #define _PATH_UFSSUSPEND "/dev/ufssuspend" #define _PATH_VI "/usr/bin/vi" @@ -141,6 +142,8 @@ __END_DECLS #define _PATH_REBOOT "/rescue/reboot" #undef _PATH_RM #define _PATH_RM "/rescue/rm" +#undef _PATH_TUNEFS +#define _PATH_TUNEFS "/rescue/tunefs" #undef _PATH_VI #define _PATH_VI "/rescue/vi" #undef _PATH_WALL diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c index dbd206f953d2..ceb33362e627 100644 --- a/sbin/mdmfs/mdmfs.c +++ b/sbin/mdmfs/mdmfs.c @@ -105,7 +105,7 @@ main(int argc, char **argv) bool detach, softdep, autounit, newfs; const char *mtpoint, *size_arg, *skel, *unitstr; char *p; - int ch, idx; + int ch, idx, rv; void *set; unsigned long ul; @@ -358,6 +358,13 @@ main(int argc, char **argv) do_mdconfig_attach(mdconfig_arg, mdtype); if (newfs) do_newfs(newfs_arg); + if (!softdep) { + rv = run(NULL, "%s %s /dev/%s%d", _PATH_TUNEFS, + "-n disable", mdname, unit); + if (rv) + errx(1, "tunefs exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); + } do_mount_md(mount_arg, mtpoint); } From nobody Sat Oct 12 22:33:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQytx1f4Lz5Z54j; Sat, 12 Oct 2024 22:33:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQytw6sbjz4ccx; Sat, 12 Oct 2024 22:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728772393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ExU5N+lXbLZDhA3ihqNezTMJaofwBD/pIRe8a4RYbo=; b=PIdBLXYTFDSSlEfWDvLWAA5pXAdkQxEeCU5JgN03Ap3RuG4Q47Y+Y0fixS49qt+3/wluga LyCDRnW9sj5oTmlGM9hyyksuwXg99pTEJ79scQaxdSoGXXa1ud3tYK9f8CobDSsANgWVY6 RaYRoeVo4Jg2Oz2hDG8fPwqmKs8fc8ldylYdarIfMvZdTw9ZDvcHlsistUFFqvdDBeJ+sV NJbQ3jiQ0d7oiTUqoug8zKqARe3/GP/e73GoP5jiEyfjQH2iykO8bcXXBv1LVQFtNSBZV4 w63u5IrvFnYmLg8dAfXT+nbtiDa+u+9iaZOPqVHKd2moYhKui06r4QQ7ZGWs4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728772393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6ExU5N+lXbLZDhA3ihqNezTMJaofwBD/pIRe8a4RYbo=; b=aGYTkY4p9PR3P0OY87LGg4yPQIHiduvwBsF+LF3EuEK2z50jmLf6Z/Do+idCLUskNfw8HD SuyhixZqy4Sx6Nb+WBLIdsZi8GFl2ZMt4CXCzEg7P4kCNfvfMpmJ4loK2L4c3hXKaUcgnu YVL56ZiGd8RUY4yROOLuAPbE3UjU8fCVOoQiqSnrOFpPknAIt+k7NN8Nle51NmQWWqM/3k QN/45eEbVEEjgP+a3DlhOpwy+lFgS3w6zykq1n0a0C/bYpaRJU85+XHVkjZYZV0bm+tsys EkXDrF83uXG5VDQ/neaTWJDu9KPTeLMbxFlnvk36jQo13rEKwjCd4K5waZuadA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728772393; a=rsa-sha256; cv=none; b=Fhv/IHGJXeqmhGExMmDKDSmRaBg1JYGYRwQIIKDAvJM8Qstkkleh1F5+N3hXb7pUoIrrhS EByMBUMaa+voTG2c4x/4DTRz6j9YD2yN3wg4O//DOMcsgo3Q0ZJ1GpzvbW3AzyqFnlsHGO J+cmFjblBPjno4Hw+sUZNBbRZy88JIp0QPm1yELccU+58dgPJxJ5b4NL0C+2u6ElrKFz2Y Au5FEzFpFzFAu0ZH9+5q3CCDvQfotBV2PsidhhQm1L6ExlfDNee6VKdrIx9/TGiGqqRBVG pn7hXv0BXxbJhJg8Jeku5VTfa+RJ0hNlddeiDABe5D8ZjLr4azkdHfgEFD+tog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQytw6SjPzSlb; Sat, 12 Oct 2024 22:33:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CMXCnY007174; Sat, 12 Oct 2024 22:33:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CMXCKX007171; Sat, 12 Oct 2024 22:33:12 GMT (envelope-from git) Date: Sat, 12 Oct 2024 22:33:12 GMT Message-Id: <202410122233.49CMXCKX007171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick <mckusick@FreeBSD.org> Subject: git: 51b1d399b2de - stable/13 - Ensure that soft updates are not enabled by default when using mdmfs(8) List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 51b1d399b2de88695030a23430fd6bd9cfb15293 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=51b1d399b2de88695030a23430fd6bd9cfb15293 commit 51b1d399b2de88695030a23430fd6bd9cfb15293 Author: Kirk McKusick <mckusick@FreeBSD.org> AuthorDate: 2024-10-03 15:05:42 +0000 Commit: Kirk McKusick <mckusick@FreeBSD.org> CommitDate: 2024-10-12 22:33:05 +0000 Ensure that soft updates are not enabled by default when using mdmfs(8) When soft updates began being enabled by default that change carried over to mdmfs(8) which does not want or need them. This fix ensures that they are only enabled in mdmfs(8) when requested with the -U flag. Reported by: Ivan Rozhuk Tested by: Michael Proto PR: 279308 (cherry picked from commit 5b21d4ad060acb06c72e0458daebec9bcbf0cefd) --- include/paths.h | 3 +++ sbin/mdmfs/mdmfs.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/paths.h b/include/paths.h index e38fb733b54c..7f73eaaf0986 100644 --- a/include/paths.h +++ b/include/paths.h @@ -92,6 +92,7 @@ #define _PATH_SENDMAIL "/usr/sbin/sendmail" #define _PATH_SHELLS "/etc/shells" #define _PATH_TTY "/dev/tty" +#define _PATH_TUNEFS "/sbin/tunefs" #define _PATH_UNIX "don't use _PATH_UNIX" #define _PATH_UFSSUSPEND "/dev/ufssuspend" #define _PATH_VI "/usr/bin/vi" @@ -141,6 +142,8 @@ __END_DECLS #define _PATH_REBOOT "/rescue/reboot" #undef _PATH_RM #define _PATH_RM "/rescue/rm" +#undef _PATH_TUNEFS +#define _PATH_TUNEFS "/rescue/tunefs" #undef _PATH_VI #define _PATH_VI "/rescue/vi" #undef _PATH_WALL diff --git a/sbin/mdmfs/mdmfs.c b/sbin/mdmfs/mdmfs.c index dbd206f953d2..ceb33362e627 100644 --- a/sbin/mdmfs/mdmfs.c +++ b/sbin/mdmfs/mdmfs.c @@ -105,7 +105,7 @@ main(int argc, char **argv) bool detach, softdep, autounit, newfs; const char *mtpoint, *size_arg, *skel, *unitstr; char *p; - int ch, idx; + int ch, idx, rv; void *set; unsigned long ul; @@ -358,6 +358,13 @@ main(int argc, char **argv) do_mdconfig_attach(mdconfig_arg, mdtype); if (newfs) do_newfs(newfs_arg); + if (!softdep) { + rv = run(NULL, "%s %s /dev/%s%d", _PATH_TUNEFS, + "-n disable", mdname, unit); + if (rv) + errx(1, "tunefs exited %s %d", run_exitstr(rv), + run_exitnumber(rv)); + } do_mount_md(mount_arg, mtpoint); } From nobody Sun Oct 13 13:12:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRLPd4LrNz5YwbV; Sun, 13 Oct 2024 13:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRLPd3RRYz4xmw; Sun, 13 Oct 2024 13:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728825157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ABew1lrChuDfQoOognQHy7AVxEDoEJquC8yZ5+SGRIU=; b=EgMGaZHKiuSpxFvgee8oFpMNXzXE2Io2+ms3YkdSA+VH2EIO/g+KamjxCYYqoMT1ZaWmOP sK9VZKPZ4OwmwlHzgmCMgF4AiA+9VIdPiyj6vGqrITTWxKHd6Qt8/dy6MLsrS5wWiHOc4J B9WGromuS7V+s/kFj68BQWaebmMzVG1Kjc/1tjbEPp1R/tWAQxPW5MCGzgiLVG/3W6DP8n oUPX7YfqFtJkypTIx2Q1Pw+9F4ZNx2UIG4Wt9m//Q6IpG6X2aZkU0VhO/P/QH8qzE4IZvr 7mpDznk0OEx7ZOaipKjqqZXeoAhLbNrzYOXvswx5WQsPhIYo5EnbH1f8tt3iyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728825157; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ABew1lrChuDfQoOognQHy7AVxEDoEJquC8yZ5+SGRIU=; b=xXavdFRKVVYEgRifpV13O8eUZTpny1VWKMnplAvL8BNCDOxzW4Y5BUu+50sa2gw82itGib PIy23vZj3C9sTWZVWHKjWQYAXhZp2m+6hLJrdipiBBE7M/uH2EoMz3mFfJ33m/gN8bdCV6 YNSiH7jmLYuQQO9oT6IWk2NjwO2yioQ10SVpARg23znv8shebrsESEMn7t6wugDIdRE+G2 P0w5oYlL+k1jWHeHpE4oiJmpE9dcXuIeV0ZYxs1HGNRpK9xXUDk5bxBfwbHGXzBnIMxTOr KiSBaJmphXDA2qlMeCc32fwMXEHiPe55K5HH7JSAdyL+Ih5XJ6UswrRUbArIOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728825157; a=rsa-sha256; cv=none; b=AP2bD2yHCT72SfTgLl+Qp1sdYwB+8VoNyu0325TWV9wbNbG6pwsio3mRlURInJ67kCxpeN /wMyl2F1lLYx8LcqF0rolf9GyTKT90B/soPQ13omHT36CJIMXJIHkU6qbD39Uji7k9RmYr 4QBKa7l1VJrKYeVW2diul35ymYpli7PIu7Hh59Nv4k7mCZJbynRIjsPjIuPxRy90768z3X Gl24qnv211ldzVtnAJ33FNKOWWcB+5Hpf4Vd63APv24Qt1gKjw83Gq9DIsmWM/Rk8m8sdy eetrF4BP4852zqYWTpbffZGUSsuauO592X9eyaIQatHWo7F7qvEwMIqmuSSiTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XRLPd31v8zvbC; Sun, 13 Oct 2024 13:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DDCbId095632; Sun, 13 Oct 2024 13:12:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DDCb52095629; Sun, 13 Oct 2024 13:12:37 GMT (envelope-from git) Date: Sun, 13 Oct 2024 13:12:37 GMT Message-Id: <202410131312.49DDCb52095629@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: b40faa5f014b - stable/14 - sesutil: Fix a typo in an error message List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b40faa5f014b923223c4a53b6d351abb2add431d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b40faa5f014b923223c4a53b6d351abb2add431d commit b40faa5f014b923223c4a53b6d351abb2add431d Author: Jeremy Faulkner <gldisater@gmail.com> AuthorDate: 2024-10-06 13:22:33 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-13 13:12:17 +0000 sesutil: Fix a typo in an error message PR: 281658 MFC after: 1 week (cherry picked from commit 7d893fce0d1126959733efec7105b56d0de7a3cb) --- usr.sbin/sesutil/sesutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index b6cdd2cf3314..24ac52bd9b5c 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -316,7 +316,7 @@ sesled(int argc, char **argv, bool setfault) } globfree(&g); if (ndisks == 0 && all == false) { - xo_errx(EXIT_FAILURE, "Count not find the SES id of device '%s'", + xo_errx(EXIT_FAILURE, "Could not find the SES id of device '%s'", disk); } From nobody Sun Oct 13 13:12:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRLPm3DGMz5Ywdk; Sun, 13 Oct 2024 13:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRLPm1LFnz4xrH; Sun, 13 Oct 2024 13:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728825164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=azH8MhTcQ2wxbdqWPCnQoFahg1HJPSSiTg2PQVMSN6E=; b=UXVfmj4pzhzIqHbTqtAylKE+GHY4fpEflZdqyWuJBAN2g8I7c/pZ+b/oF74hEiw7LTczVF jK7gB4zIEHEY71+4Osvw15ZOI3g637MGC3Kob0MKOp55dj8vJ8Hbm9VFbsPz/FFJqAY1/+ HIWCbjPlaPuO8kmKQubNyBRTvFSSq5iDXu6hINWiS6VWA9Y3h9/wUhCFyjS9NNUQDXGobm 1dXtTcXE7pWr4eoiIXlBch8D5Ob18+VGIZShWViWKwtIqwsgRxqeGzPEwYBts6W6r8gCQ3 9/Sicj5FvseqgC7Gdmo+PKOm/fFBMFVhfXm1MaiAeQxmiBsmdWr9M2jriD11qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728825164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=azH8MhTcQ2wxbdqWPCnQoFahg1HJPSSiTg2PQVMSN6E=; b=y4zT68oTD9u6tJyUiVOu87mHv3IuUqE4HSVHkzAKLeGEaelg70ZVCJaB9BUckPM+PPq7Xd iMqBk/wxH3AOJpYMpQBVas1AZwmLXKVb3Tdh2Nzs3k1p4WNa5c7ghCznIeXwjysqGSTYZL +gX66uayyYkWAgzyDvdXdqI4/Z5sYPsqyrcwLC7PwwQm43puRXVdjAhqgXpwuDB/U7KcWs pbOTOlbXOJOVSgHyNB7I1ygZ5uITkAokRNnHueK715qt/DQYIRm8eUblEPl01pkp2xo5HE Mhs4saZQx72Wlck5RQ9cZJEvCYaOlhhYVKbxdhXmIWQV1Kmsjr856ePCBp0Odw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728825164; a=rsa-sha256; cv=none; b=iRSDqhTjB4C3lcoIURcQiA2EC3a8jn4gB9Vj7KtlCEApPKWJO1QAoGIv8/18xZW4U/99xN bt7tr7fmAiI6GEHkWrNkvAVj437x4mXl3gjfA3gcVj23mDVAJIcgI42eFyQ8jpkqho0w41 zqWWE/ypi46HlnLOzUFRnd6PzF5IpQ8TETDqDXnbovudtz7Oq8byuADcQTRH/aRnyljTBx NnWu+3Zke5n5Y4tDMhb1UYSwdKkXXyh6h+cPVdBF9GePkmQ4LjCGpgHg/PSe2nTWJkLJwQ g9c4wUUuewmW3oNYTmSDakitmyJ75sPkFIlBQQf1UJf/igp8gXGnhsNOPQ831g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XRLPm0xzrzvbD; Sun, 13 Oct 2024 13:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DDCiwS095793; Sun, 13 Oct 2024 13:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DDCi2X095790; Sun, 13 Oct 2024 13:12:44 GMT (envelope-from git) Date: Sun, 13 Oct 2024 13:12:44 GMT Message-Id: <202410131312.49DDCi2X095790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: aa751cdcab8d - stable/13 - sesutil: Fix a typo in an error message List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa751cdcab8de3aa1aec5b35f5e0800828700201 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aa751cdcab8de3aa1aec5b35f5e0800828700201 commit aa751cdcab8de3aa1aec5b35f5e0800828700201 Author: Jeremy Faulkner <gldisater@gmail.com> AuthorDate: 2024-10-06 13:22:33 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-13 13:12:23 +0000 sesutil: Fix a typo in an error message PR: 281658 MFC after: 1 week (cherry picked from commit 7d893fce0d1126959733efec7105b56d0de7a3cb) --- usr.sbin/sesutil/sesutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/sesutil/sesutil.c b/usr.sbin/sesutil/sesutil.c index 863b95a0f8b0..a527c5d39a51 100644 --- a/usr.sbin/sesutil/sesutil.c +++ b/usr.sbin/sesutil/sesutil.c @@ -316,7 +316,7 @@ sesled(int argc, char **argv, bool setfault) } globfree(&g); if (ndisks == 0 && all == false) { - xo_errx(EXIT_FAILURE, "Count not find the SES id of device '%s'", + xo_errx(EXIT_FAILURE, "Could not find the SES id of device '%s'", disk); } From nobody Sun Oct 13 16:25:26 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRQh666npz5Z8lC; Sun, 13 Oct 2024 16:25:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRQh65L9nz42xc; Sun, 13 Oct 2024 16:25:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728836726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkJCald7iDuJq0lJ0MKuhuFNkJSx+ghw9E+thFqt+4g=; b=pP4yPzo/dKDxIA4jcUU8E3YcCRRIzOFZKum9GtI/Vn221bc2dPyD0E+4CUcKk2+umCmHsR c8Fo5hkjNP47P+lBihga4EfQqNHJ1R5rz4P+hP25kyDzHbU/RViyjM8Mnh454/sYeDbMzA 5uvOWI8wL1tNVWmsDWQyb6KVqMvzAuDCHQY6tLNU8DkLs/bjgCHUEOOHwYQ80rs2lcyPKL jD320AXefq1IEaMfbuvTRGfnygw/RFhhiVDTXtrHvLjZI19hnnZfQFDU+HA+9fekUNZFMf 2tDrKVr2vGxTbK10CUrXYCHgIRj3Z7HXVI0MGIbFkXkpf6khEKeCEfAzcAszaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728836726; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DkJCald7iDuJq0lJ0MKuhuFNkJSx+ghw9E+thFqt+4g=; b=OHzmp/CQcvZaVBkmjSsLsMirMcGKGg+TDkSJ1voCT5bzdfGrhqpEu4GiWBp0cPpeFFP0Pm okBBIhab8QKYnEVFW1mREgpkbpa4UQXIxAMtzAisgUIZrociO8ja7+Y2cKdo/3TE5zy8Ij mu1QBZHItj43tSMMIYAC8nYSsmKWn67nyabTKuBy8BqKK8AeMvqUyd2xC8kt0X3o//pjBQ O2UVF6Vn+iSne89+juntQ1D29qB5H2zHXJd5AZWvs99SSvfd+YXDEqSAibbw91y0zZdQZa VvXlhJDoUIiSRELtSuTb7iqVgNZJ0nFMzNYgDxgt2F5+EGgh6IAG/xZaGIBO7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728836726; a=rsa-sha256; cv=none; b=Wngt/YMP4UDoqAD8SyD1wwoWfUAph1VZnGKzwdKQU81kLM0RRiF+dVIHg8+OQGcqCPkJ3K 9JbM+X6X3SbpeBvs8zPO6EWodIi/3JqbcODXMOZakGc2ZKqOegu7PRqv38uu9tSIGLKl4F djzX+TuNx1NzhRlto4LVEp+2BhfRt/JCHE6npETIInLYZBM/ApGDs8IpCdoViWW7vvK5mN fGiL+8UCD31WyDjGNx0ubSp429JWjeY7PzesbdekCMFzAhPw0qKQ489Mx9vOKVjrfGV+43 4epX/QEvVo7qVSs7ejGgWPiHxW5WrWq39LSZnzvKZn4MLitS8ReosXyB7fdJ0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XRQh64q7cz11kP; Sun, 13 Oct 2024 16:25:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DGPQsk017950; Sun, 13 Oct 2024 16:25:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DGPQ3K017947; Sun, 13 Oct 2024 16:25:26 GMT (envelope-from git) Date: Sun, 13 Oct 2024 16:25:26 GMT Message-Id: <202410131625.49DGPQ3K017947@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston <markj@FreeBSD.org> Subject: git: 2ee5293d3a9c - stable/14 - netbsd-tests: Remove an xfail annotation List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2ee5293d3a9cd42b84f2350620d84c805bd0aa16 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2ee5293d3a9cd42b84f2350620d84c805bd0aa16 commit 2ee5293d3a9cd42b84f2350620d84c805bd0aa16 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-08-29 16:45:09 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-13 16:25:18 +0000 netbsd-tests: Remove an xfail annotation The test passes after commit 5ab6ed93cd36 ("faccessat(2): Honor AT_SYMLINK_NOFOLLOW"). Reported by: Jenkins (cherry picked from commit 460464b2e031881d03ffb24ec4ca5b7cbeadb5b7) --- contrib/netbsd-tests/lib/libc/c063/t_faccessat.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c index 7de4f61637a4..5e6829f7ea45 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c @@ -166,9 +166,6 @@ ATF_TC_BODY(faccessat_fdlink, tc) ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, 0) == -1); ATF_REQUIRE(errno == ENOENT); -#ifdef __FreeBSD__ - atf_tc_expect_fail("Depends on non-standard behavior not mentioned in POSIX.1-2008"); -#endif ATF_REQUIRE(faccessat(dfd, BASELINK, F_OK, AT_SYMLINK_NOFOLLOW) == 0); ATF_REQUIRE(close(dfd) == 0); From nobody Sun Oct 13 20:50:50 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRXZL6V3Zz5YWsh; Sun, 13 Oct 2024 20:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRXZL5kwGz4Ynh; Sun, 13 Oct 2024 20:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728852650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ve1F/4X9HLluTyVF8cV0G2KU9gENZlQTbU/h5zJRmPc=; b=Faq+KqFrPoGgV5i4Rkn6e2NZL1V113fgXcl3U46lKF04NoZ5X+b856NAQdlAGgZxTMXdb5 K7a5KXDUe86IFUGCmALbr4kWoIgzXXk12/in042JBQ6vMlwDCQVmT7xsajEsztyJi9wIuT QIOLjLTt74R2pxQR4P52IFO4xMnbAVsvYx/kYdwvnhVbuK3fJaSaNbGrtEUSQubie2zq9O vVHjz6OqOEr31FnfNUtWN2ufVNt5GZgwd0I32sZ/a67b4WBYPiMH+aGo+SYxd8RmPfFOGx Dd2TZ1H8qg1+oSeRZj5FZWGu/mPk/2bw1O8pWfNJ8di7YJT23ASIRAN61ayJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728852650; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ve1F/4X9HLluTyVF8cV0G2KU9gENZlQTbU/h5zJRmPc=; b=yDM5RVPXuXVXhxeIXNHl7AF4dFiyhZCnXscKfgRaGX/Xw1LAi1XwAm1I54fW3E9QsW8q78 PWpR3sKZVZQHTO9KlWuOo1rvgJVXQD1oRGJpIrL+lbXQI3B9BU5nERBznJaeKW1X8qIWU2 7INME/JPbKsxKClCsaWrxo/MWimDNwfbni1MAXXsBmbIjnHSylQip48qCLiKCNRJK9C7xq 6WHxsru9G1wicnmtpU2RTVpczszK+kTzPKPdhgDQejQxI083PZPnxJ/kp398OIDAulsKoD 6h62eltLag4ktJJbFPdAuRLhQeshJ6ttsLNSh83jEzaYxfGZjRNBqxZwHNDhUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728852650; a=rsa-sha256; cv=none; b=tj7r2YFHFa+AM8yHCFOt7VWtmXwNLk+C2sKhatkW3rw78exfMB1kmnFsSGzozJrGh4srlr K1+BvPGYOAc8waIJ/VEnFhQj3XezQFmK83+hKJiYWRraxNaoM2p3+chNw5zF9sXKl+2UWT +SgZ13hg92esk6KXfL/iwLjcRe7i+xmHxk73kfGyKQIJjNJN6g8pdBJAs11y7dlxh7s0Ya rTSmj0DjZUb0upV3FCaNW+txayQCKlp0aaTHqQYmYz/5/OD2OXQrQs2ywDwMgwfMJSOuIU 78ltx+YrgNBAipW00GX6vDX9K2VRdic94087uvVEKz3cuu9vARygyWTE4WhUKg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XRXZL5Kwxz18Qg; Sun, 13 Oct 2024 20:50:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DKooq4070933; Sun, 13 Oct 2024 20:50:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DKooFw070930; Sun, 13 Oct 2024 20:50:50 GMT (envelope-from git) Date: Sun, 13 Oct 2024 20:50:50 GMT Message-Id: <202410132050.49DKooFw070930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 5a2cd24c46e3 - stable/14 - nfsd.c: Synchronize error handling List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5a2cd24c46e301c02fde1c4ed4234ebabc1e4f89 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=5a2cd24c46e301c02fde1c4ed4234ebabc1e4f89 commit 5a2cd24c46e301c02fde1c4ed4234ebabc1e4f89 Author: Joyu Liao <joyul@juniper.net> AuthorDate: 2024-09-29 20:11:54 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-10-13 20:47:01 +0000 nfsd.c: Synchronize error handling Synchronize the error handling in nfsd. If you check other error handlings in those same condition blocks, it uses nfsd_exit instead, which will call killchildren() and call the rpcbind service to do the service un-mapping. --- usr.sbin/nfsd/nfsd.c | 72 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index be26e0be77e8..c1995580e142 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -558,18 +558,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp = getnetconfigent("udp"); - if (nconf_udp == NULL) - err(1, "getnetconfigent udp failed"); + if (nconf_udp == NULL) { + syslog(LOG_ERR, "getnetconfigent udp failed"); + nfsd_exit(1); + } nb_udp.buf = ai_udp->ai_addr; nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp); } } @@ -632,20 +638,26 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp6 = getnetconfigent("udp6"); - if (nconf_udp6 == NULL) - err(1, "getnetconfigent udp6 failed"); + if (nconf_udp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent udp6 failed"); + nfsd_exit(1); + } nb_udp6.buf = ai_udp6->ai_addr; nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp6); } } @@ -704,18 +716,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp = getnetconfigent("tcp"); - if (nconf_tcp == NULL) - err(1, "getnetconfigent tcp failed"); + if (nconf_tcp == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp failed"); + nfsd_exit(1); + } nb_tcp.buf = ai_tcp->ai_addr; nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp); } } @@ -782,18 +800,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp6 = getnetconfigent("tcp6"); - if (nconf_tcp6 == NULL) - err(1, "getnetconfigent tcp6 failed"); + if (nconf_tcp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp6 failed"); + nfsd_exit(1); + } nb_tcp6.buf = ai_tcp6->ai_addr; nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp6); } } From nobody Sun Oct 13 21:00:29 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRXnT5DRsz5YXTK; Sun, 13 Oct 2024 21:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRXnT3Kx5z4bWX; Sun, 13 Oct 2024 21:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728853229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJv2MTGK9UFtbb7jtZ+1yGQKhVPIknAnv6ustbgq/Dw=; b=hzakKrm8bdorkOOGfseEX5u9FDnsnDDZ9NZoFZVDbNIo4rv6FdVBK9+3Sdh/hGxlzjrFQd BPTB8Eb70lKJsji4JMn3KwyfPq39EL4KeLtiUF2cih30h6zXFKp59qwg49XJtpWc8XJX1O 6T4vusxz+v2/zyN+puYbb1o6/kleJFZGR/A6GQ4QyqvWLMZserxb6f4/Aw1QJ7Eh5LlQ3Q XjXdyNlXEMXHu/oZfArja6s5tfccfnvDkzj+/fkPYgZMx9clv/tTgBrvj9hyq/YdmZx2mt UDY6sKDZ4B+K/9KtUeFcyjJBHT1ZvlnkfHJydoj+2U3/Y8RJxxKva8PyUMP7ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728853229; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SJv2MTGK9UFtbb7jtZ+1yGQKhVPIknAnv6ustbgq/Dw=; b=ZPDcR3Y3j6cynO8GvHcQo6IOrOzTMGk3qnmh3vZ3kyD30+L/yjKLGDyCFrQahU1PPvMnc2 42ReOrYbBNxhkfEi0S142rpEoTLMwFwvPeuLwR0XoWSxT2n0yyi0fH/O3IUKigHJYv4gBK KsRdMTw9LQI+lObf5J6pRT3Ga0efIckeCS4gGRH7ZtOZTCbdtPc72Ild6yg9EaYjuvl8LQ 1MpLs215/A4fGMv/bcXU/iW7hSwB7AsLWHhQoo/BPafClF7tBM+xwMCOY6tLzy1qtKSMh4 t/ZW9RhZKvvmRHTHupfs0wqLZvzSus5fSq6YeBjWBfAns4z5G2ghZ3JMVCzQjQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728853229; a=rsa-sha256; cv=none; b=c9Vmc2jnROouoaTgMXF0Gtf58wOpFy+3SWkQgOnSstmZ66WfRt8O9RO5lKReb/aICcxcJZ dcxbJ7bVSbG+hx32vxCsgDAdDprTMwYX7pOPtIF8b/gfTdkEAdECLSoEBhWj82tzZQnVl9 oGlyZrYSzTScHvUq6JCn23eBCz7DHYuS9WJECQRUQtlpMnWku+yxPKw8XSvEkAJjSkop00 98vXELqkP5XggS2Ng71++ZMjh1u6jy+faJZ/3fFzZ1vwlRhw2PXHzP5BpnXgAyZSOKB55H ILG/uBxhIeBtwBQ74VHE/sW/bYXcb2eeVb0jcUTxXRsLYAqXO0TelPukwZhm+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 4XRXnT2fdCz18DM; Sun, 13 Oct 2024 21:00:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DL0Tk8086766; Sun, 13 Oct 2024 21:00:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DL0T6A086763; Sun, 13 Oct 2024 21:00:29 GMT (envelope-from git) Date: Sun, 13 Oct 2024 21:00:29 GMT Message-Id: <202410132100.49DL0T6A086763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem <rmacklem@FreeBSD.org> Subject: git: 6b0b026ae1a4 - stable/13 - nfsd.c: Synchronize error handling List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6b0b026ae1a492736e955bda60a60d1b5aecea5d Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=6b0b026ae1a492736e955bda60a60d1b5aecea5d commit 6b0b026ae1a492736e955bda60a60d1b5aecea5d Author: Joyu Liao <joyul@juniper.net> AuthorDate: 2024-09-29 20:11:54 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2024-10-13 20:58:47 +0000 nfsd.c: Synchronize error handling Synchronize the error handling in nfsd. If you check other error handlings in those same condition blocks, it uses nfsd_exit instead, which will call killchildren() and call the rpcbind service to do the service un-mapping. --- usr.sbin/nfsd/nfsd.c | 72 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 24 deletions(-) diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index be26e0be77e8..c1995580e142 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.sbin/nfsd/nfsd.c @@ -558,18 +558,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp = getnetconfigent("udp"); - if (nconf_udp == NULL) - err(1, "getnetconfigent udp failed"); + if (nconf_udp == NULL) { + syslog(LOG_ERR, "getnetconfigent udp failed"); + nfsd_exit(1); + } nb_udp.buf = ai_udp->ai_addr; nb_udp.len = nb_udp.maxlen = ai_udp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp, - &nb_udp)) - err(1, "rpcb_set udp failed"); + &nb_udp)) { + syslog(LOG_ERR, "rpcb_set udp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp); } } @@ -632,20 +638,26 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_udp6 = getnetconfigent("udp6"); - if (nconf_udp6 == NULL) - err(1, "getnetconfigent udp6 failed"); + if (nconf_udp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent udp6 failed"); + nfsd_exit(1); + } nb_udp6.buf = ai_udp6->ai_addr; nb_udp6.len = nb_udp6.maxlen = ai_udp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_udp6, - &nb_udp6)) - err(1, + &nb_udp6)) { + syslog(LOG_ERR, "rpcb_set udp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_udp6); } } @@ -704,18 +716,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp = getnetconfigent("tcp"); - if (nconf_tcp == NULL) - err(1, "getnetconfigent tcp failed"); + if (nconf_tcp == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp failed"); + nfsd_exit(1); + } nb_tcp.buf = ai_tcp->ai_addr; nb_tcp.len = nb_tcp.maxlen = ai_tcp->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp, - &nb_tcp)) - err(1, "rpcb_set tcp failed"); + &nb_tcp)) { + syslog(LOG_ERR, "rpcb_set tcp failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp); } } @@ -782,18 +800,24 @@ main(int argc, char **argv) nfsd_exit(1); } nconf_tcp6 = getnetconfigent("tcp6"); - if (nconf_tcp6 == NULL) - err(1, "getnetconfigent tcp6 failed"); + if (nconf_tcp6 == NULL) { + syslog(LOG_ERR, "getnetconfigent tcp6 failed"); + nfsd_exit(1); + } nb_tcp6.buf = ai_tcp6->ai_addr; nb_tcp6.len = nb_tcp6.maxlen = ai_tcp6->ai_addrlen; if (nfs_minvers == NFS_VER2) if (!rpcb_set(NFS_PROGRAM, 2, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } if (nfs_minvers <= NFS_VER3) if (!rpcb_set(NFS_PROGRAM, 3, nconf_tcp6, - &nb_tcp6)) - err(1, "rpcb_set tcp6 failed"); + &nb_tcp6)) { + syslog(LOG_ERR, "rpcb_set tcp6 failed"); + nfsd_exit(1); + } freeaddrinfo(ai_tcp6); } } From nobody Sun Oct 13 23:46:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XRcSp1ztwz5Ym0L; Sun, 13 Oct 2024 23:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XRcSp1BgZz41Gt; Sun, 13 Oct 2024 23:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728863178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jg17VrNFXOdGuiHKg7KWXuaiMepF8tcotueJLGw5FkY=; b=letUOX2zTflMsHTTYHdBxxoPQkVUX+SospZycg3rCm1u5hGiGGFD/MRP+Xt1CRu/6k2Kph DELo7EfTy0OZcEkFOgrP3qIokkwez5ijAEMI/pUFMpGYgtK/TJAHgKNLKCAgv1MSDYUg9W 1KQ4PyJwROjAPGILmrpbxuSdzyUWa7D/3QuJhCkcgSd4Cun+Nu6y0jJq+G9HwYgc+sk1Ql pzv32lhKkfQzE6hgVlOx6CcnsEVyqzcfGq0GNjruB04uUTWHrfpLLjlkzy8Co9pLn1X9UH vfoHyNYz/mEkTpkKZrEMH7qi01Xl2SjIR2g9s1K9QjNM9ZxN688bAUsJJfx9Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728863178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jg17VrNFXOdGuiHKg7KWXuaiMepF8tcotueJLGw5FkY=; b=xQCXy217HsCfMa6dXFvrWnRkrFNx7vAbXzn9Bvv9qaY+PLgoIIK0gDDOUXucuwf6GOajd1 /JL1nAQr/R8jMeK0hyuffulBfQL2Y/3OC6wJsij6cFbT9S7Qd043uXLZCfE13EbVgMWVHp uO3/EitNkPGnobPBL8oOgjtTKHXFQlkOILO8HzmaMobwvlf84x8UraW6XGqy6gJRwC9cMc GhwP1F1ar7lxQOeez5KqujUXaQ3Dh9UlUhmw1BmnhfqnZ+PJCvlBKEn+49Pk2k51KnZT1m U5Iwb9NMYdc4dc4Li8f/aDD+Ao5b8tqN9ruwUWkDrQL7Z2ljbq6zidkvK9hTnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728863178; a=rsa-sha256; cv=none; b=SP+0xRMqsDVr93uCq/9XajFj0gSpB9YM4ZVWfv+fBrUxlZVXqJlEH633yomSlRl0yPQtS0 fYhWBLVa2z54C6K+5s1XSsznD0fYWY851YzquaXcwBMpk9M5uy+0IeR7xBDcG0rDErYNhT 0vZ7xUuw0e7gjMsj3SID+wN6wl1mdAld9TTwE1i6iUCW8Z1dpLTAN2EGgegK8gdz+dV9Hl 3DPbr3UcmMkO00RbcaVZM0R6TMq2pwD2XtJ2LO285TScgSRXRlWG8Fy0ciqre4+GRsJX+n 2hTAvxA/Hs6uAJp7J2ClMm3a6H3V0Zp6N/JekR2Hl8WQvoyr8tcu0wA5woeE6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XRcSp0ggXzDnw; Sun, 13 Oct 2024 23:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49DNkHbZ066052; Sun, 13 Oct 2024 23:46:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49DNkHEG066049; Sun, 13 Oct 2024 23:46:17 GMT (envelope-from git) Date: Sun, 13 Oct 2024 23:46:17 GMT Message-Id: <202410132346.49DNkHEG066049@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton <jamie@FreeBSD.org> Subject: git: 16e1424d24b9 - stable/14 - jail: expose children.max and children.cur via sysctl List-Id: Commits to the stable branches of the FreeBSD src repository <dev-commits-src-branches.freebsd.org> List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: <mailto:dev-commits-src-branches+help@freebsd.org> List-Post: <mailto:dev-commits-src-branches@freebsd.org> List-Subscribe: <mailto:dev-commits-src-branches+subscribe@freebsd.org> List-Unsubscribe: <mailto:dev-commits-src-branches+unsubscribe@freebsd.org> X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 16e1424d24b9ab6e90f0bbb5d1a8d11479ea34e5 Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=16e1424d24b9ab6e90f0bbb5d1a8d11479ea34e5 commit 16e1424d24b9ab6e90f0bbb5d1a8d11479ea34e5 Author: Jamie Gritton <jamie@FreeBSD.org> AuthorDate: 2024-10-13 23:45:58 +0000 Commit: Jamie Gritton <jamie@FreeBSD.org> CommitDate: 2024-10-13 23:45:58 +0000 jail: expose children.max and children.cur via sysctl Submitted by: Igor Ostapenko <igor.ostapenko_pm.me> Differential Revision: <https://reviews.freebsd.org/D43565> (cherry picked from commit ab0841bdbe8460db6eb77e0228a08812ce74d583) --- sys/kern/kern_jail.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 1f775f78e581..a4bd27734e8e 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -4425,6 +4425,35 @@ SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, sysctl_jail_default_level, "I", "Ruleset for the devfs filesystem in jail (deprecated)"); +SYSCTL_NODE(_security_jail, OID_AUTO, children, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "Limits and stats of child jails"); + +static int +sysctl_jail_children(SYSCTL_HANDLER_ARGS) +{ + struct prison *pr; + int i; + + pr = req->td->td_ucred->cr_prison; + + switch (oidp->oid_kind & CTLTYPE) { + case CTLTYPE_INT: + i = *(int *)((char *)pr + arg2); + return (SYSCTL_OUT(req, &i, sizeof(i))); + } + + return (0); +} + +SYSCTL_PROC(_security_jail_children, OID_AUTO, max, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, offsetof(struct prison, pr_childmax), sysctl_jail_children, + "I", "Maximum number of child jails"); +SYSCTL_PROC(_security_jail_children, OID_AUTO, cur, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + NULL, offsetof(struct prison, pr_childcount), sysctl_jail_children, + "I", "Current number of child jails"); + /* * Nodes to describe jail parameters. Maximum length of string parameters * is returned in the string itself, and the other parameters exist merely