aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* makefs: correct iso9660 Rock Ridge TF timestampsEd Maste2023-03-232-10/+10
| | | | | | | | | | | | | The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were incorrect, and timestamps were written in the wrong order. See RRIP 4.1.6 Description of the "TF" System Use Entry for details. PR: 203531 Reported by: Thomas Schmitt <scdbackup@gmx.net> Reviewed by: jrtc27, kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39221
* daemon: reformat longoptsKyle Evans2023-03-231-17/+17
| | | | | Use a single tab instead of eight spaces, these aren't line continuations.
* daemon: decouple init logic from main loopIhor Antonov2023-03-231-86/+109
| | | | | | | | | | | | | main() func contained both initialization and main loop logic. This made certain operations like restarting problematic and required dirty hacks in form of goto jumps. This commit moves the main loop logic into daemon_eventloop(), cleans up main, and makes restart logic clear: daemon_mainloop() is run in a loop with a restart condition checked at the end. Reviewed by: kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/699
* contrib/tzdata: import tzdata 2023aPhilip Paeps2023-03-2320-253/+504
|\ | | | | | | | | | | Changes: https://github.com/eggert/tz/blob/2023a/NEWS MFC after: 1 day
| * Import tzdata 2023avendor/tzdata/tzdata2023aPhilip Paeps2023-03-2321-254/+505
| |
* | LinuxKPI: remove now implemented dummy headers.Bjoern A. Zeeb2023-03-232-0/+0
| | | | | | | | | | Both iommu.h and kconfig.h now exist in the common code. There is no need for the duplicate (empty) headers anymore.
* | rtw89: fix -Wunused-but-set-variableBjoern A. Zeeb2023-03-231-0/+5
| | | | | | | | | | | | | | Fix a -Wunused-but-set-variable warning by adding the field to the debug logging as is done for other versions handler functions. MFC after: 3 days
* | ifconfig: ifieee80211: print bssid nameBjoern A. Zeeb2023-03-231-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In certain setups (e.g., autonomous APs) it is extremly helpful to have a way to map the BSSIDs to names for both normal status output as well as the scan list. This often allows a quicker overview than remembering (or manually looking up) BSSIDs. Call ether_ntohost() on the bssid and consult /etc/ethers and print "(name)" after the bssid for the status output and "(name)" at the end of the line after the IE list. MFC after: 10 days Reviewed by: adrian, cy Differential Revision: https://reviews.freebsd.org/D39192
* | vfs: decouple freevnodes from vnode batchingMateusz Guzik2023-03-222-23/+35
| | | | | | | | | | | | | | | | | | | | | | In principle one cpu can keep vholding vnodes, while another vdrops them. In this case it may be the local count will keep growing in an unbounded manner. Roll it up after a threshold instead. While here move it out of dpcpu into struct pcpu. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D39195
* | Rewrite function definitions with identifier lists.Kirk McKusick2023-03-228-63/+57
| | | | | | | | | | | | | | | | A few functions snuck in with K&R style definitions. Also add some missing memory frees. MFC after: 1 week
* | misc/organization: add bofh as a new portmgr memberRene Ladan2023-03-221-1/+1
| | | | | | | | Hat: portmgr-secretary
* | sys: Retire OPENZFS_CWARNFLAGS now that it is empty.John Baldwin2023-03-2217-18/+1
| | | | | | | | | | Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D39217
* | sys: Stop enabling -Wnested-externs.John Baldwin2023-03-224-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | clang doesn't implement this warning, so violations are only caught by GCC. It is also no longer a common practice to use this as it was in the original BSD code, so the need for the warning is not as important as when it was used to do cleanups 20 years ago. A recent commit (c3179891f897d840f578a5139839fcacb587c96d) triggers this warning on GCC, but that commit uses nested externs purposefully. Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D39214
* | bhyve: Don't return -ENOMEM from qemu_fwcfg_add_file.John Baldwin2023-03-221-1/+1
| | | | | | | | | | Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D39212
* | bhyve: Accept a variable-length string name for qemu_fwcfg_add_file.John Baldwin2023-03-222-3/+5
| | | | | | | | | | | | | | | | | | | | It is illegal (UB?) to pass a shorter array to a function argument that takes a fixed-length array. Do a runtime check for names that are too long via strlen() instead. Reviewed by: markj Reported by: GCC -Wstringop-overread Differential Revision: https://reviews.freebsd.org/D39211
* | libpfctl: Don't pass stack garbage to free.John Baldwin2023-03-221-2/+0
| | | | | | | | | | | | | | | | GCC 9 on stable/12 reports a -Wmaybe-uninitialized error for the call to free in _pfctl_clear_states. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D39198
* | arpa: garbage collect ns_newmsg/ns_rdata declsVal Packett2023-03-222-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These were brought in by the libbind import, but these functions were never actually implemented anywhere, only header declarations and symbol map entries were imported. Fixes: 046c3635cdb2 ("Bring final version of libbind:") Fixes: e45764721aed ("Update our stub resolver to final version of ...") Reported by: ld.lld 16 being --no-undefined-version by default Sponsored by: https://www.patreon.com/valpackett Reviewed by: emaste Pull request: https://github.com/freebsd/freebsd-src/pull/700 Differential Revision: https://reviews.freebsd.org/D38407
* | amd64: reduce header pollution in _stdint.hBrooks Davis2023-03-221-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In 38d1ac34ff82bd2aeb308b52a65b686060e52873 SIGATOMIC_{MIN,MAX} were defined in terms of LONG_{MIN,MAX}. Later, they were switched to __LONG_{MIN,MAX} in 78fe75bc280264e7471b3069e148cae32e8ae211 where an include of machine/_limits.h was added. Switch to using fixed width INT64_{MIN,MAX} and remove the header pollution. No functional change. Reviewed by: theraven, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39196
* | riscv: Fix sig_atomic_t limit definitionsBrooks Davis2023-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sig_atomic_t is defined as a long and thus is 64-bit on arm64. For some reason its limit was incorrectly specified as a 32-bit number. This had the unfortunate side effect of causing gnulib to override most of the definitions in stdint.h. On CheriBSD this breaks all software that uses gnulib in annoying and hard to debug ways. Technically updating the limits might be an ABI change, but these defines are largely unused (the only use in tree is in the libc++ test suite where it's use an assertion that will fail due to this bug). Further, since the underlying type remains the same, we're just increasing the range of values a paranoid program might use. Reviewed by: emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39194
* | arm64: Fix sig_atomic_t limit definitionsBrooks Davis2023-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sig_atomic_t is defined as a long and thus is 64-bit on arm64. For some reason its limit was incorrectly specified as a 32-bit number. This had the unfortunate side effect of causing gnulib to override most of the definitions in stdint.h. On CheriBSD this breaks all software that uses gnulib in annoying and hard to debug ways. Technically updating the limits might be an ABI change, but these defines are largely unused (the only use in tree is in the libc++ test suite where it's use an assertion that will fail due to this bug). Further, since the underlying type remains the same, we're just increasing the range of values a paranoid program might use. Reviewed by: andrew, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39193
* | arm64: Use the new PCB macros in swtch.SAndrew Turner2023-03-222-24/+25
| | | | | | | | | | | | | | Rather than hard coding the location of these registers in the array use the new macros to find the correct offset. Sponsored by: Arm Ltd
* | Add macros for arm64 pcb register offsetsAndrew Turner2023-03-224-8/+12
| | | | | | | | | | | | | | Add macros for offsets of macros we set in the arm64 pcb pcb_x array. This will simplift reducing the size of this array in a later change. Sponsored by: Arm Ltd
* | sftp: add description of memory leak fixEd Maste2023-03-221-1/+10
| |
* | sftp: avoid leaking path arg in calls to make_absolute_pwd_globEd Maste2023-03-221-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Coverity reports: Overwriting tmp in tmp = make_absolute_pwd_glob(tmp, remote_path) leaks the storage that tmp points to. Consume the first arg in make_absolute_pwd_glob, and add xstrdup() to the one case which did not assign to the same variable that was passed in. With this change make_absolute() and make_absolute_pwd_glob() have the same semantics with respect to freeing the input string. This change was reported to OpenSSH in https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-November/040497.html but was not acted on. It appears that OpenBSD subsequently received a Coverity report for the same issue (their Coverity ID 405196) but fixed only the specific instance reported by Coverity. This change reverts OpenBSD's sftp.c 1.228 / OpenSSH-portable commit 36c6c3eff5e4. Reported by: Coverity Scan CID: 1500409 Reviewed by: markj MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37253
* | bhyve: Sleep briefly in the VMEXIT_DEBUG handlerMark Johnston2023-03-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of commit 0bda8d3e9f7a ("vmm: permit some IPIs to be handled by userspace") and commit 9cc9abf409cc ("bhyve: create all vcpus on startup"), we have a misbehaviour where AP vCPU threads spin until they receive a SIPI. In particular, since they are "suspended", they simply call the VMEXIT_DEBUG handler in a loop, but the handler is a no-op by default. This is tricky to fix since the gdb stub isn't aware of whether a given vCPU is supposed to be running. For 13.2's sake, introduce a simple workaround wherein the VMEXIT_DEBUG handler sleeps for a short period. This ensures that host CPU usage remains sane when VMs are starting without penalizing users of VMEXIT_DEBUG too much. Reviewed by: corvink, jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39174
* | fdescfs: Fix a file ref leakMark Johnston2023-03-221-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In fdesc_lookup(), vn_vget_ino_gen() may fail without invoking the callback, in which case the ref on fp is leaked. This happens if the fdescfs mount is being concurrently unmounted. Moreover, we cannot safely drop the ref while the dvp is locked. So: - Use a flag variable to indicate whether the ref is dropped. - Reorganize things to handle the leak. Reported by: C Turt <ecturt@gmail.com> Reviewed by: mjg, kib Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39189
* | path_test: Add a test case for openat(O_EMPTY_PATH) in capability modeMark Johnston2023-03-221-0/+75
| | | | | | | | MFC after: 1 week
* | etdump: exit on error if section header or entry offset is OOBEd Maste2023-03-221-4/+10
| | | | | | | | | | | | | | | | | | PR: 263663 Reported by: Robert Morris <rtm@lcs.mit.edu> Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35868
* | stress2: Fix syntax error. Remove redundant backupPeter Holm2023-03-222-7/+5
| |
* | stress2: Fix compiler warningPeter Holm2023-03-221-1/+1
| |
* | _endian.h: Include sys/ctypes.h for visibility macrosWarner Losh2023-03-221-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by the forthcoming POSIX Issue 8. In addition, they are provided in the BSD compilation environments. However, depending on the order includes happend, sys/cdefs.h may or may not be included when endian.h is included. Include it here so we can safely test __BSD_VISIBLE. Add visibility when we're compiling in the future for issue 8, but since the date number for issue 8 hasn't been fixed, use strictly greater than the issue 7 date.of 200809. This had the side effect of sometimes (in the traditional BSD compliation environment) #if BYTE_ORDER == LITTLE_ENDIAN and #if BYTE_ORDER == BIG_ENDIAN both being true because none of these were defined. This fixes that. It also fixes including it after <stdio.h> but not before. PR: 269249 MFC After: 1d (build related) Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D39176 Sponsored by: Netflix
* | Remove /usr/lib/dtrace/ipfw.d for WITHOUT_DTRACE.John Baldwin2023-03-221-0/+1
| | | | | | | | | | | | Reviewed by: brooks Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39099
* | netmap: fix copyin/copyout of nmreq options listVincenzo Maffione2023-03-212-29/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code unsuccesfully attempted to report a precise error for each option in the user list. Moreover, commit 253b2ec199b broke some ctrl-api-test (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260547). With this patch we bail out as soon as an unrecoverable error is detected and we properly check for copy boundaries. EOPNOTSUPP no longer immediately returns an error, so that any other option in the list may be examined by the caller code and a precise report of the (un)supported options can be returned to the user. With this patch, all ctrl-api-test unit tests pass again. PR: 260547 Submitted by: giuseppe.lettieri@unipi.it Reviewed by: vmaffione MFC after: 14 days
* | linuxkpi: Define `pat_enabled()`Jean-Sébastien Pédron2023-03-212-0/+19
| | | | | | | | | | | | | | | | | | This new <asm/memtype.h> header is included from <linux/pci.h> because that's how it is included in Linux too. DRM drivers depend on this. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D39052
* | tcp_wrappers: Use ANSI (c89) definitions for one more functionEd Maste2023-03-211-2/+1
| | | | | | | | | | Fixes: 14f102eacc84 ("tcp_wrappers: Use ANSI (c89) function definit...") Sponsored by: The FreeBSD Foundation
* | ktls: Fix interlocking between ktls_enable_rx() and listen(2)Mark Johnston2023-03-213-14/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TCP_TXTLS_ENABLE and TCP_RXTLS_ENABLE socket option handlers check whether the socket is listening socket and fail if so, but this check is racy. Since we have to lock the socket buffer later anyway, defer the check to that point. ktls_enable_tx() locks the send buffer's I/O lock, which will fail if the socket is a listening socket, so no explicit checks are needed. In ktls_enable_rx(), which does not acquire the I/O lock (see the review for some discussion on this), use an explicit SOLISTENING() check after locking the recv socket buffer. Otherwise, a concurrent solisten_proto() call can trigger crashes and memory leaks by wiping out socket buffers as ktls_enable_*() is modifying them. Also make sure that a KTLS-enabled socket can't be converted to a listening socket, and use SOCK_(SEND|RECV)BUF_LOCK macros instead of the old ones while here. Add some simple regression tests involving listen(2). Reported by: syzkaller MFC after: 2 weeks Reviewed by: gallatin, glebius, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38504
* | OpenSSL: Regen an assembly file for armJung-uk Kim2023-03-211-1/+1
| | | | | | | | X-MFC with: af19988f6cd3
* | OpenSSL: aes/asm/bsaes-armv7.pl: Replace adrl with addKornel Dulęba2023-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "adrl" is a pseudo-instruction used to calculate an address relative to PC. It's not recognized by clang resulting in a compilation error. I've stumbled upon it when trying to integrate the bsaes-armv7 assmebly logic into FreeBSD kernel, which uses clang as it's default compiler. Note that this affect the build only if BSAES_ASM_EXTENDED_KEY is defined, which is not the default option in OpenSSL. The solution here is to replace it with an add instruction. This mimics what has already been done in !BSAES_ASM_EXTENDED_KEY logic. Because of that I've marked this as trivial CLA. No objections from: jkim Obtained from: OpenSSL commit 27093ba73372935fe4ef91d0a45ce6ea90a1ac8e Differential Revision: https://reviews.freebsd.org/D39091
* | netlink: reduce the default debugging levelsAlexander V. Chernikov2023-03-212-2/+2
| | | | | | | | | | Reported by: kp MFC after: 2 weeks
* | lorder: add deprecation noticeEd Maste2023-03-211-1/+6
| | | | | | | | | | | | | | | | | | | | lorder has not been used by the base system since 0e1e341b486c and hasn't really been necessary for a very long time. PR: 259254 [exp-run] Reviewed by: arichardson (earlier) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30080
* | ldd: clarify format optionsEd Maste2023-03-212-3/+4
| | | | | | | | | | | | | | | | | | -f may be specified zero, one, or two times. Make this clear in the usage. Reviewed by: markj, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34733
* | tcp_wrappers: Use ANSI (c89) function definitionsEd Maste2023-03-2135-330/+128
| | | | | | | | | | | | | | | | Although this code is in contrib/ there is no active upstream. Reviewed by: brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36047
* | gvinum: correct assertionsEd Maste2023-03-212-3/+3
| | | | | | | | | | | | | | | | | | | | | | Pointer addresses are always >= 0. Assert that the value is >= 0 instead. PR: 207855, 207856 Reviewed by: imp Reported by: David Binderman Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37677
* | powerpc/pmap: Account for a potential NULL pmap in pmap_sync_icacheJustin Hibbits2023-03-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | It's apparently possible for pcpu->pc_curpmap to be NULL at some point, leading to a panic. Account for this as is done with the other 64-bit AIM pmap. Reported by: pkubaj Tested by: pkubaj Fixes: 6f0b2a235a1 ("Add pmap_sync_icache() for radix pmap") MFC after: 3 days
* | pmap_mapdev_attr() doesn't use any of its arguments.David E. O'Brien2023-03-211-1/+2
| |
* | daemon: move signal setup into a functionIhor Antonov2023-03-211-63/+79
| | | | | | | | | | | | No functional change intended. Reviewed by: kevans
* | if_re: Drop redundant assignments for ifq_maxlen and ifq_drv_maxlenZhenlei Huang2023-03-211-1/+0
| | | | | | | | Fixes: 4519a073c326b Mechanically convert if_re(4) to DrvAPI
* | mountd.8: Update for mountd running in jailsRick Macklem2023-03-201-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Mountd can now be run in an appropriately configured vnet jail. This man page update adds some information for this case. This is a content change. Reviewed by: markj MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D39168
* | x86/pci_early_quirks: Support Intel 11th+ genJean-Sébastien Pédron2023-03-202-0/+121
| | | | | | | | | | | | | | | | | | Newer Intel CPUs/iGPUs use a new method to determine the base address of the stolen memory. This code was ported from Linux. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D39057
* | linuxkpi: Define `seq_has_overflowed()` and `single_open_size()`Jean-Sébastien Pédron2023-03-202-12/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | This required non-trivial changes to `linux_seq_file.c` to manage a new `(struct seq_file)->size` field. This field is read directly by DRM drivers, so we can't alias it to a call to sbuf_len(9). `single_open_size()` also depended on the ability to allocate the sbuf with a specified size instead of relying on `sbuf_new_auto()`. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D39056