This is a display of mostly-automatically-classified git commits from 2026-06-15 to 2026-06-21.
Table of contents and commits per category:
| (3) | Highlighted commits (these are copies, not in stats) | |
| 0 | 0.0% | Userland programs |
| 10 | 5.0% | Documentation |
| 70 | 35.2% | Hardware support |
| 10 | 5.0% | Networking |
| 15 | 7.5% | System administration |
| 8 | 4.0% | Libraries |
| 5 | 2.5% | Filesystems |
| 59 | 29.6% | Kernel |
| 5 | 2.5% | Build system |
| 1 | 0.5% | Internal organizational stuff |
| 7 | 3.5% | Testing |
| 5 | 2.5% | Style, typos, and comments |
| 2 | 1.0% | Contrib code |
| 2 | 1.0% | Reverted commits |
| 0 | 0.0% | Unclassified commits |
| 199 | 100% | total |
| Technical notes about this page |
For extra visibility, these are copies of commits found in
other sections. Most (if not all) come from the commit message
containing "Relnotes:", or commits modifying
UPDATING.
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste
Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
Change powerpc64le's long double from 64-bit double to IEEE 754 binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64. Gated on FreeBSD 16 and powerpc64le only. Differential Revision: https://reviews.freebsd.org/D57388 Reviewed by: adrian Relnotes: yes
Note: We confusingly have the instructions to build the system in the build manual, the UPDATING file, and the Makefile. These will get out of sync and will be harmful when they do. Fixes: https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default") Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D57644
Commits about commands found in man section 1 (other than networking).
-- no commits in this category this week --
Man pages, release notes, etc.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: emaste Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
Also unwind some parentheticals. MFC after: 3 days
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295944 MFC to: 15 MFC after: 3 days
sh: Improve function documentation * Mention that the function body can be in parentheses. It is already implied since the function body can be any valid statement, but it may not be obvious to a reader who has only ever seen functions that used curly brackets and assumes that they are part of the function syntax. * Remove the incorrect claim that a local statement may only occur at the top of a function. * Show that a value may be assigned to a variable in a local statement. * While here, replace unpaired double quotes with \(dq to avoid confusing syntax highlighters. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296050 MFC after: 1 week Reviewed by: ziaee, jilles Differential Revision: https://reviews.freebsd.org/D57596
sh: Belatedly bump manual page date Fixes: https://cgit.freebsd.org/src/commit/?id=556e793d803e ("sh: Improve function documentation")
While here, fix missing comma typo. Reviewed by: 0mp, ziaee Approved by: 0mp, ziaee MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc (partially) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57384
MFC after: 3 days Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D57675
Reviewed by: ziaee, ngie Approved by: ziaee Fixes: https://cgit.freebsd.org/src/commit/?id=2f7a796b590e ("thunderbolt.4: Initial manual for HW Relnotes") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57668
The current verbiage somewhat indicates that always adjusts the time, which hasn't been true as far back as I had the energy to `git blame`. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57676
POSIX and the C standard now refer to objects and sequences rather than confusingly revering to strings. Also update bcopy(3) and bzero(3). Reviewed by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57680
Hardware drivers and architecture-specific code.
The malloc() failure path returned error, which is 0 at this point, so callers would treat the allocation failure as success. Return ENOMEM instead to correctly propagate the out-of-memory condition. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D42282
if_bnxt/bnxt_re: add support for driver snapdump Add a logging module which helps to log and collect the driver`s various events and state of device data structures. APIs help modules like l2, RoCE etc. to register and add logs into thg buffers. A segment header is added to the data available in buffers. The final log messages are arranged in following fashion |SegHeader0|Data0|SegHeader1|Data1| Logging module provides two different kinds of buffers: a) A large contiguous memory chunk is used to form circular buffers. Module need to provide a number of buffers while registering to the logging module.Please note that, since memory for the buffers remains with the module as long as it is registered, memory footprints of the driver could be higher so the modules should allocate an appropriate number of buffers. Also, due to limited space, modules should only log important events/messages into the buffer. Modules must use bnxt_log_add_mssg() to add the message into the list. b) Live buffer - They are allocated during coredump retrieval and freed after the coredump data is returned to the user. This helps to collect live data from the driver. Modules must use the bnxt_log_live() function to add the log messages. When coredump is retrieved all the messages available in above buffers are copied into the coredump buffer. Test Plan: Generate the coredump using below niccli command ./niccli.freebsd -i 1 debug --coredump and then verify the coredump contents using the Broadcom's Coredump decoder. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56682
if_bnxt: Add Firmware crashdump collection support This patch adds support for DDR-based firmware coredump memory handling. It detects firmware coredump capability, allocates host DDR (DMA) memory for crash dumps, and programs the firmware with the allocated memory during attach. The allocated memory is released during driver detach. Also, This patch adds functions to retrieve crash dump data from host DDR memory. The implementation handles data copying from page tables and checks dump availability. Main function bnxt_get_coredump() copies stored crash dump data from DDR memory to the application buffer. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56684
if_bnxt: add bnxt logger module files to sys/conf/files for built-in kernel builds
The bnxt snapdump and coredump support patches added bnxt_log/{_data}.c. and listed it in
sys/modules/bnxt/bnxt_en/Makefile, but missed to add these files in sys/conf/files.
Fix up the issue by adding bnxt_log/{_data}.c in sys/conf/files.
Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
if_bnxt: add few source files to version control
Commits- f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
and 03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
missed to add few files under version control, those files are
added now:
sys/dev/bnxt/bnxt_en/bnxt_log.c
sys/dev/bnxt/bnxt_en/bnxt_log.h
sys/dev/bnxt/bnxt_en/bnxt_log_data.c
sys/dev/bnxt/bnxt_en/bnxt_log_data.h
sys/dev/bnxt/bnxt_en/bnxt_coredump.c
sys/dev/bnxt/bnxt_en/bnxt_coredump.h
bnxt_coredump.c entry is added in sys/conf/files as well.
Fixes: https://cgit.freebsd.org/src/commit/?id=f85e66e655c9 ("if_bnxt/bnxt_re: add support for driver snapdump")
Fixes: https://cgit.freebsd.org/src/commit/?id=03839879a2dd ("if_bnxt: Add Firmware crashdump collection support")
Update hsi headers MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56683
if_bnxt: Fix the Unknown command 0x80000000 ioctl command error With the latest niccli version, user will observe below Unknown command command error when try to list the devices. if_bnxt: Unknown command 0x80000000 Here, niccli is issuing command opcode as 0x80000000 but driver is expecting 0x20000000 command opcode. So, replaced _IOW(0,0,0) with the _IOC(IOC_IN,0,0,0). Fixes: https://cgit.freebsd.org/src/commit/?id=d53d7b4 ("bnxt: Fix up ioctl opcodes to support IOC_VOID along with IOC_IN") MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56685
if_bnxt: Add support for HWRM passthrough with multiple DMA buffers Added support for HWRM passthrough commands with multiple DMA buffers. Also, changed the mgmt_lock to sleepable exclusive lock. MFC after: 2 weeks Reviewed by: gallatin, ssaxena Differential Revision: https://reviews.freebsd.org/D56686
ntsync(9): properly handle timeouts Reported by: Alex S <iwtcex@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 3 days
ntsync(9): free wait state on error from copyin of the object's array Sponsored by: The FreeBSD Foundation MFC after: 3 days
ntsync(9): do not double-free obj when finstall() failed Reported by: Alex S <iwtcex@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 3 days
Reviewed by: bz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57478
Commit 6024e3f99a1e ("Add audio group") introduced GID_AUDIO, initially
for virtual_oss(8) loopback devices. Now make all of them with
GID_AUDIO.
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste
Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/35
uvideo: import uvideo(4) driver from OpenBSD Port the uvideo(4) driver from OpenBSD. This provides native USB Video Class (UVC) support for webcams and video capture devices. The main changes are adaptation for: - USB transfer callback model - isoc data extraction via usbd_copy_out(), - V4L2 struct alignment for ABI compatibility with v4l_compat. Note that this implementation can coexist with webcamd. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56960
uvideo: add kqueue support Add EVFILT_READ kqueue filter so applications using kqueue/kevent can efficiently wait for video frames instead of polling. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56961
uvideo: add Camera Terminal controls Implement UVC Camera Terminal (CT) controls per UVC 1.5 specification Table A-12. This adds support for camera-specific controls that are separate from the Processing Unit controls already supported. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D56962
uvideo: add missing formats to be in par with webcamd's uvcvideo
uvideo: increase isochronous transfer depth for throughput Increase NFRAMES_MAX from 40 to 128 and IXFERS from 3 to 5 to keep more packets in flight on the USB bus. This brings throughput from ~13.5 MB/s to ~21 MB/s (for comparison on the same camera webcamd provided ~20MB/s. The linux driver also uses 5 IXFERS (but only 32 NFRAMES_MAX) Tested by: manu
uvideo.4: Initial manual page Fixes: https://cgit.freebsd.org/src/commit/?id=b711ef9c75ba (import uvideo) Reviewed by: 0mp, bapt, kevans Differential Revision: https://reviews.freebsd.org/D57622
Set the correct value in the TX descriptor for the vlan header. PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295175
The node pointer is guaranteed to be non-NULL by the net80211 stack. The original check was also ineffective as it dereferenced ni->ni_vap before the NULL check. Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D54547
Below is the commit message: ``` Wtap originally only supported mesh/ad-hoc mode, and cannot be combined with wpa_supplicant(8) and hostapd(8) since it's unaware of encryption/decryption. This commit adds support for hostap and sta mode with WPA/WPA2, thus wtap(4) can now be used with hostapd(8) and wpa_supplicant(8). ``` Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36243
Implement monitor mode by simply adding IEEE80211_C_MONITOR to ic->ic_cap. To get additional informations when capturing 802.11 frames, radiotap is inserted by wtap_tx_tap() when TX and wtap_rx_tap() when RX. There are some type faults in struct wtap_rx_radiotap_header which are mainly mistakenly store unsigned values into signed integers. I have fixed them (wtap(4)) by complying with the types defined in https://www.radiotap.org/fields/defined. Becuase the struct wtap_rx_radiotap_header comes from ath(4), there may be another patch to fix the type faults in ath(4). Differential Review: https://reviews.freebsd.org/D36469
This follows commit 3296fda0c309c873ae37a0a4e25ded3ae04b421c. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289236 Reviewed by: kib MFC after: 3 days
The 'hw.acpi.suspend_state' sysctl knob was re-introduced with a bug. Its handler, acpi_suspend_state_sysctl(), expects the ACPI softc in 'arg1', but the knob was registered with NULL there. This causes a panic (NULL dereference) when reading the knob if the suspend state has been set to S1 or S2 or equivalently the suspend sleep type to STANDBY. Fix it by passing the ACPI softc as 'arg1' when registering the knob. Reviewed by: obiwac Fixes: https://cgit.freebsd.org/src/commit/?id=9e1e29bd5ec6 ("acpi: Add back `hw.acpi.suspend_state` sysctl") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57412
This is done in preparation of having some machine-dependent code access
these arrays through the softc.
Before this change, these arrays were static. We chose to make them
part of the softc, instead of just exporting them ('acpi_quirks' remains
a known offender; some better way forward is to declare the whole ACPI
softc as static).
Some sysctl handlers now need to be passed the softc to access the
arrays, and some already needed to be passed a pointer to a field in the
softc. As sysctl handlers are provided with a single pointer (arg1) and
a single integer (arg2), and now that the softc has to be passed into
the pointer argument (arg1), point indirectly to the wanted softc's
field by passing its offset in the integer argument (arg2).
To preserve the statically sized array in the signature of
power_pm_register(), and consequently avoid constructing such a dummy
array in early initialization (after this change, we can't pass
acpi_supported_stypes[] anymore as there is no existing ACPI softc at
this point), just remove the early ACPI registration via
power_pm_register(). This existed in the past as a hack to ensure ACPI
would be registered in priority, but for a long time now ACPI has been
the only subsystem that registers itself to the generic power
infrastructure, so this early registration has not been needed.
Reviewed by: obiwac
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57413
sound: Start each channel individually Unlock all members before starting any of them. Holding multiple channel locks while calling chn_start() on a virtual channel can trigger the parent, which acquires PCM_LOCK() while other virtual channels are still locked -- a lock order reversal. Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57399
sound: Include more information in kevent returned from the kernel Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57362
sound: Adjust mmap example to use kqueue Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D57410
- Skip firmware reload if MCU already initialized - Fix firmware_put() memory leaks on error paths - Increase MCU init timeout to 15 seconds - Use debug macros instead of device_printf for verbose output - Remove unused 'ret' variable - Fix space indentation to tabs per style(9) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57597
When hw.est.msr_info=1 is set, est_msr_info() extracts the bus clock from MSR_PERF_STATUS upper bits. On secondary CPUs, the MSR may contain zero in the frequency ratio field, causing a divide-by-zero panic. Observed in pre Skylake Intel cpu. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57614
On modern Intel CPUs that use HWP (hwpstate_intel: /usr/src/sys/x86/cpufreq/hwpstate_intel.c) instead of EST, this message prints unconditionally during probe even though it is expected and harmless. Gated behind bootverbose to reduce console noise on systems where EST is present but considered legacy. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57616
nvme: Use newbus to ask if a device is storage As NVMe is in more places, it has a variety of attachments. On non PCI busses, we assume we're a storage device. For PCI, we look at the interface ID. Add newbus glue to make this happen. Sponsored by: Netflix Discussed with: jhb Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D56994
nvme: Move default is_storage method to nvme_private.h Since CODE entries wind up in the nvme_if.c file, we got warnings when it wasn't used (which is always). Move it into nvme_private and change its name to nvme_is_storage_default to put it into the nvme_ namespace. Fixes: https://cgit.freebsd.org/src/commit/?id=949804c81909 Sponsored by: Netflix
Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: NVIDIA Networking
- Add descriptions for ConnectX-9. - Add ConnectX-9 for libmlx5 Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: Nvidia networking MFC after: 1 week
Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: Nvidia networking MFC after: 1 week
eth_proto_oper is used to derive the active media mode, but an empty mask leaves no valid bit for ilog2() to consume. Treat this as an invalid carrier update, reset the active media state, and report the unexpected PTYS value. Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: NVIDIA Networking
arm64: Support building sys/sysl instructions Add support to build system instructions from a macro. These are based on the existing support for msr/mrs instructions with adjustments for the different instruction format. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D57017
arm64: Add FEAT_ALWAYS_ENABLE to cpu_feat A use for it has been found in the GICv5 driver where we need to read the Interrupt Affinity ID early in the boot on the secondary CPUs. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54249
arm64: Add an initial GICv5 driver Add an initial driver for the GICv5 interrupt controller. This provides host-only support for the GICv5 interrupt controller. It is specified in the ARM-AES-0070 document & based on version 00eac0. In the GICv5 there are 3 interrupt spaces: PPI, SPI, and LPI. Unlike previous interrupt controllers they don't share a single interrupt ID range, so PPI IRQ 1 and SPI IRQ 1 are different interrupts. There is a common irqsrc stricture that encodes this information as it is common across the interrupt types. Unlike previous GIC versions there are no software generated interrupts that can target a configurable collection of CPUs. These have been replaced with LPIs, where each CPU will have one allocated for each IPI type. This driver handles the CPU interface and interrupt routing service (IRS). The CPU interface provides the interface to manage and handle interrupts, while the IRS handles routing LPIs and SPIs to the target CPU. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54250
arm64: Add an initial GICv5 ITS driver Add a driver to support the GICv5 interrupt translation service (ITS). The ITS is responsible to handling ITS events & translating them to an interrupt to be delivered to the interrupt routing service (IRS). An example event is a MSI or MSI-X is delivered. The ITS will generate an LPI depending on which device sent the interrupt and the value the device wrote. This is a similar concept to the GICv3 ITS, however the implementation details are different so it needs a new driver. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54251
arm64: Add an initial GICv5 IWB driver Add a driver to support the GICv5 interrupt wire bridge (IWB). The IWB translates the change in state of an input wire and sends a MSI to the interrupt translation service (ITS) to be translated to an LPI. Unlike other MSI sources each wire has a fixed Event ID value it will write in the MSI data. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54252
While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55492
While the majority of virtio platforms will be fully coherent, some may require cache maintenance or other specific device memory handling (eg for secure partitioning). Using bus_dma allows for these usecases. The virtio buffers are marked as coherent; this should ensure that sync calls are no-ops in the common cases. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55564
The thunderbolt implementation is not 100% complete and causes some suspend/resume issues. Comment out the device until it is better fleshed out and some of the core issues with it are resolved. MFC after: 1 week Requested by: obiwac Differential Revision: https://reviews.freebsd.org/D57650
The ns8250 driver avoids clearing IER bit 0x10 to account for the split "receiver time-out interrupt enable" bit, but it never sets it in `ier_rxbits` even though a comment in `ns8250_init` implies so. Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart. Differential Revision: https://reviews.freebsd.org/D57629 Reviewed by: imp MFC after: 2 weeks
Add fw_net.h with common inline helpers used by both if_fwe and if_fwip: ISO chunk init, TX xfer allocation, xferlist free, send queue drain, and DEVICE_POLLING ioctl handling. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D57615
Change powerpc64le's long double from 64-bit double to IEEE 754 binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64. Gated on FreeBSD 16 and powerpc64le only. Differential Revision: https://reviews.freebsd.org/D57388 Reviewed by: adrian Relnotes: yes
Reviewed by: emaste, imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57710
VPC is enabled by default, and the only way to turn it off is through a loader hint. That being said, there is no benefit to turning it off in the first place, because VPC provides more fine-grained volume control, as well as access to the SNDCTL_DSP_[SET|GET][REC|PLAY]VOL ioctls and dsp_ioctl_channel(). Sponsored by: The FreeBSD Foundation MFC after: 1 week
efi_init() might return error after initializing the mutex, in which case MOD_UNLOAD() is not processed, and the mutex is not destroyed. Similarly, efi_uninit() skips any processing if efi_runtime was left as NULL, leaving mutex not destroyed. Initialize the mutex in MOD_LOAD case, and destroy in MOD_UNLOAD, also handling errors. Reviewed by: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57704
sound: Use and lock only the appropriate channel in dsp_mmap_single() dsp_mmap_single() mmaps one of the channels associated with a dsp_cdevpriv, based on the nprot argument. PROT_WRITE and PROT_READ|PROT_WRITE select the output channel for mmaping, and PROT_READ the input one. Instead of locking and modifying the flags of all dsp_cdevpriv channels, do it only for the one we actually use. While here, retire the now unused dsp_lock_chans() and dsp_unlock_chans(). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
sound: Re-arrange a calculation in dsp_mmap_single() This makes it easier to read. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
sound: Handle CHN_F_MMAP_INVALID after cdev_pager_allocate() We drop the channel lock to execute cdev_pager_allocate(). By the time we pick up the lock again, CHN_F_MMAP_INVALID might be set, so make sure we fail and free the vm handle. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
Two related fixes to `aq(4)`'s RSS indirection table handling: 1. Fix an out-of-bounds stack write in `aq_hw_rss_set()`. RSS table entries are 3 bits (8 queues max), but with more than 8 RX rings `rss_table[]` holds larger values; the 32-bit write then spills one `uint16_t` past `bitary[]` and corrupts the stack, so the NIC never links or the kernel panics. Mask each value to 3 bits and pack 16 bits at a time to keep the write in bounds. 2. Build the indirection table in `aq_if_attach_post()` with a modulo over `min(rx_rings_count, HW_ATL_RSS_INDIRECTION_QUEUES_MAX)` instead of `i & (rx_rings_count - 1)`, which assumed a power-of-two ring count. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57240
Rework the MSI-X and queue-count handling to use the standard iflib
interrupt model and to keep every ring serviced.
- Cap isc_n{tx,rx}qsets_max at the RSS indirection-table size
(HW_ATL_RSS_INDIRECTION_QUEUES_MAX, 8) instead of HW_ATL_B0_RINGS_MAX.
RSS only steers RX traffic to eight rings, so on hosts with more CPUs
the surplus TX rings never make progress: iflib flowid-steers TCP
flows across every TX ring, and a flow landing on a surplus ring has
its segments queued but never transmitted, hanging the connection.
- Add a TX-specific ifdi_tx_queue_intr_enable that reads
tx_rings[txqid]->msix. It was wired to the RX handler, which indexes
rx_rings[] with the qid; safe only while tx_rings_count ==
rx_rings_count, otherwise the lookup walks past rx_rings[] and feeds a
garbage msix value into the IRQ mask register.
- Fix three MSI-X / admin-IRQ bugs: the TX softirq was attached to
rx_rings[i]->irq (overwriting the RX handle and leaving the TX handle
uninitialized); the admin-IRQ failure path dereferenced
rx_rings[rx_rings_count], one past the end; and aq_linkstat_isr cleared
the admin interrupt by writing the raw vector number instead of
BIT(vector).
- Allocate one IFLIB_INTR_RXTX vector per RX/TX queue pair like every
other in-tree iflib driver (em/ix/igc, vmxnet3) instead of an
IFLIB_INTR_RX vector per RX ring plus a hand-wrapped IFLIB_INTR_TX
softirq per TX ring. iflib's iflib_fast_intr_rxtx() then services TX
completions on the shared vector through isc_txd_credits_update().
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57434
Convert the driver's internal error-handling chain from the Linux negative-errno convention to FreeBSD positive errno everywhere. - All `return (-EXXX)` become `return (EXXX)`, `int err = -EXXX` loses the sign, and `if (err < 0)` checks become `if (err != 0)` across aq_fw.c, aq_fw1x.c, aq_fw2x.c and aq_hw.c. - mac_soft_reset_flb_ returns ETIMEDOUT/0 instead of a bool so it matches its RBL sibling. - The ETIME and EOK aliases in aq_common.h are removed; all sites use ETIMEDOUT and 0 directly, and the `rc = -rc` sign flips in aq_if_attach_pre are dropped. Turn AQ_HW_WAIT_FOR into a statement expression evaluating to 0 on success or ETIMEDOUT on timeout, assigned explicitly at all seven call sites, instead of silently assigning ETIMEDOUT to a variable named err in the caller scope. A statement expression rather than an inline function because every call must re-evaluate its condition each iteration -- one even assigns hw->mbox_addr as a side effect. Fix two correctness bugs surfaced by the conversion: - fw1x_get_stats gated its stats copy with `if (err >= 0)`, correct under negative errno but accepting every positive errno after the flip. Change to `if (err == 0)`. - fw2x_reset returned 0 regardless of capability-download failure, silently leaving fw_caps = 0. Return the real err. Harden aq_if_attach_pre: bit_alloc(4096, M_AQ, M_NOWAIT) was unchecked, so under OOM a later `ifconfig vlanN create` would NULL-deref the bitstring; check for NULL and fail with ENOMEM. The fail label's hardcoded `return (ENXIO)` becomes `return (rc)` so each error path reports its real errno. Remove the dead error checks in aq_hw_offload_set: the `if (err != 0) goto err_exit` blocks after the void tpo_/rpo_/tdm_ register-write helpers were unreachable (err is never set), and the real error capture is the aq_hw_err_from_flags call at the function tail. Drop the now-orphaned err_exit label. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57435
Independent correctness fixes, plus robustness against a non-responding
device, malformed descriptor writeback, and torn MMIO reads, and the move
to the FreeBSD bus_space(9) register abstraction.
Correctness:
- aq_hw_ver_match returned true if any of major/minor/build was >=
expected; compare lexicographically so e.g. 2.0.1 is correctly seen as
older than 2.1.0.
- The VLAN hardware-filter iteration used the vlan tag directly as the
bitstring index; use vlan_tag + 1 so the active-VLAN bookkeeping lines
up with the table.
- aq_initmedia only registered IFM_AUTO in full-duplex/pause variants, so
a bare "ifconfig aq0 media autoselect" matched no entry and returned
ENXIO. Add the bare IFM_ETHER|IFM_AUTO entry, matching ix/em/igc/ixv.
- Convert the per-ring diagnostic counters to counter(9): per-CPU,
tear-free, no atomics on the increment path, fixing a data race and a
32-bit torn read against the locklessly-read sysctls. Drop three
counters that were never populated (jumbo_pkts, tx_drops, tx_queue_full).
Hardening and modernization:
- Implement aq_hw_err_from_flags (previously a stub returning 0 that left
~24 call sites as no-ops): detect a non-responding device in the
register read path (all-ones, confirmed against reg 0x10) and latch a
sticky AQ_HW_FLAG_ERR_UNPLUG -> ENXIO; aq_if_init clears it so a
transient detection cannot permanently wedge the device.
- Bound the RX fragment loop in aq_isc_rxd_pkt_get (EBADMSG once i reaches
isc_rx_nsegments) so a malformed never-EOP stream cannot write past the
fragment array.
- Bound the TX completion count in aq_isc_txd_credits_update against the
raw HW head pointer (reject head >= tx_size) so a glitched head cannot
make iflib free still-in-flight TX mbufs.
- Remove the dead hardware-RSC branch in aq_isc_rxd_available; it followed
wb.next_desp, a raw device value used as an index, but RSC is never
enabled so rsc_cnt is always 0. Advance sequentially like the other
in-tree iflib drivers; this drops the last raw-hardware-pointer
dereference in the RX path.
- Flush MMIO after interrupt-status acks (AQ_HW_FLUSH) so the write lands
before the vector is re-armed under auto-mask-clear; retry the high word
in read64_ against a torn lo/hi pair; document the non-atomic IMR
read-modify-write in itr_irq_map_en_{rx,tx}_set.
- Replace the raw-pointer MMIO (the Linux readl/writel idiom) with
bus_space(9): store the BAR tag and handle in struct aq_hw and route
AQ_READ_REG/AQ_WRITE_REG through bus_space_read_4/write_4. No functional
change on amd64.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57436
aq(4): enable jumbo frames, software LRO, and suspend/resume - Configure the RX buffer size from the interface MTU and enable jumbo frames up to 9000 bytes, replacing the fixed standard-frame setup. - Advertise IFCAP_LRO so iflib coalesces received TCP segments with its software tcp_lro(9), like every other in-tree iflib driver (ix/igc/em/vmxnet3); aq does no hardware LRO. iflib builds the per-RX-queue LRO context unconditionally, so the capability bit is all that is required; enabled by default via isc_capenable, toggle at runtime with ifconfig. - Add suspend/shutdown/resume handlers, replacing the unimplemented- function placeholders. aq_if_shutdown/aq_if_suspend stop the interface and deinitialize the hardware; aq_if_resume re-resets the F/W, re-reads the mailbox address and re-selects fw_ops via aq_hw_mpi_create() before iflib re-inits, because the runtime init path (aq_hw_init) reuses the cached mailbox/fw_ops and a D3 power cycle can clear them. iflib calls IFDI_RESUME unconditionally, so this also covers resuming while the interface was administratively down. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57437
aq(4): modernize and de-Linuxify the vendor driver Dead-code removal, device_printf(9) logging, style(9) de-Linuxification, const F/W-ops tables, and readability cleanups. No change for valid traffic. Dead code and logging: - Remove the sub-gigabit TSO-masking block in the link-state ISR: it cleared IFCAP_TSO from the static isc_capabilities record (read only at attach / SIOCSIFCAP, never on the datapath), so it never gated TSO and only corrupted the validation mask. The Atlantic has no sub-gigabit TSO erratum. - Tidy the RX buffer-size handling: drop the dead switch(MCLBYTES) in aq_if_rx_queues_alloc, rename rx_max_frame_size -> rx_buf_size, and bound the per-fragment length from the wb.pkt_len writeback (EBADMSG on underflow or a final fragment longer than the RX buffer). - Drop every __FreeBSD__/__FreeBSD_version branch (FreeBSD 14.0 baseline); the pre-13 arms used pre-opaque-if_t APIs since removed and one never built. - Route all log messages through device_printf(9) (MAC via %6D), adding a device_t to struct aq_hw; drop the dead AQ_XXX_UNIMPLEMENTED_FUNCTION and aq_log_error macros and the per-ring init console spam. - Minor: comma -> semicolon in aq_if_attach_pre; (uint64_t) -> (uint32_t) TX high-word cast; MODULE_VERSION(atlantic, 1); remove unused/duplicate #includes. style(9) and types: - Remove all typedef'd struct/enum/union types (aq_dev_t, the speed/fc/ debug enums, the volatile RX/TX descriptor types, the firmware-file types) in favor of bare tags; for the DMA descriptors the volatile qualifier moves to the pointer/use sites. Drop the _s/_e tag suffixes and the "#define aq_hw_s aq_hw" alias. Rename the OOP-style *self parameter to hw. Replace usec_delay/msec_delay/ARRAY_SIZE/LOWORD with FreeBSD equivalents (BIT kept). __attribute__((__packed__)) -> __packed. F/W-ops vtable: - Rename the leftover hal parameter to hw; make aq_fw1x_ops/aq_fw2x_ops const (read-only data); drop the always-true "fw_ops &&" and always-present dispatch guards (only led_control, absent in F/W 1.x, keeps its NULL check). Readability: - aq_isc_rxd_pkt_get: fold the four identical RX-error blocks into one rx_err: label. aq_isc_rxd_available: hoist the shared descriptor advance out of the EOP test and drop the redundant continue. aq_hw_offload_set: drop the dead "int err = 0". Fix a stale "10 ms" comment on a 50 ms DELAY and the redundant literal parentheses. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57438
aq(4): take F/W statistics off the iflib core lock (kick-and-read) The once-per-second statistics refresh ran the whole F/W-mailbox transaction under iflib's CTX (sx) lock: fw2x_get_stats toggled the MPI STATISTICS control bit and busy-polled the state register for the acknowledgement (up to ~25 ms) before downloading the counters, so a slow F/W response blocked datapath reconfigure / ioctls for the duration. The per-cast and error counters have no direct-register source -- the reference Linux atlantic driver and our port both read them out of the F/W mailbox, and the MSM registers the chip exposes are never used for the periodic counters. So rather than poll, adopt the kick-and-read shape the iflib peer with the same constraint uses (vmxnet3): consume the snapshot the F/W produced for the *previous* request, then toggle the bit to request the next one -- no wait. The F/W finished that previous refresh ~1 s ago, so the download needs no poll, and the toggle write stays serialized against set_mode by the CTX lock exactly as before. This removes the 25 ms poll (and the toggle_mpi_ctrl_and_wait_ helper) from under the lock; only the fast 16-dword download remains. Cost: the counters lag one 1 s cycle, invisible for monitoring, and a torn read is already rejected by aq_update_hw_stats' monotonic-delta check. Validated on AQC107: a fixed 500 MiB RX transfer advances good_octets_rcvd by 549.6 MB -- 500 MiB plus the ~4.8% Ethernet framing overhead -- with rx_err=0 and traffic at line rate. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57439
aq(4): add a runtime dev.aq.N.debug trace control The trace_* family (trace/trace_error/trace_warn/trace_detail, used in the F/W and init/config paths) was gated behind the compile-time AQ_CFG_DEBUG_LVL, which is 0, so the dbg_level_/dbg_categories_ runtime variables were dead and tracing could only be enabled by recompiling. Decouple trace_base_ from AQ_CFG_DEBUG_LVL so it is always compiled and gated purely at runtime on dbg_level_/dbg_categories_, make those two variables writable (no longer const, default level 0 = off), and expose them as dev.aq.N.debug (verbosity) and dev.aq.N.debug_categories (subsystem mask) sysctls. The datapath-heavy AQ_DBG_ENTER/PRINT/DUMP macros and the trace_aq_*_descr descriptor dumps stay behind AQ_CFG_DEBUG_LVL (still 0), so the per-packet paths are untouched -- trace_* is only used off the datapath. The two variables are global (the trace macros reference them directly), so the per-device sysctls share one backing store, which is fine for a debug knob. Validated on AQC107: dev.aq.0.debug defaults to 0 with no trace output; setting it to 6 emits the F/W init/reset/capabilities traces on the next F/W operation; setting it back to 0 silences them; traffic unaffected at line rate, rx_err=0. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57440
aq(4): naming and exposure Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D57656
On controllers with the LPSS "additional registers" (Skylake and later, IG4_HAS_ADDREGS), ig4iic_suspend() places the controller in the device idle state (IG4_DEVICE_IDLE) and asserts core reset. While idle the DesignWare core is power-gated: its register bank reads back as zero and writes are dropped until the core is taken out of the idle state again. ig4iic_set_config(), called from ig4iic_resume(), only performs that un-idle handshake when it observes IG4_RESTORE_REQUIRED set in DEVIDLE_CTRL. Some platforms (e.g. Intel Alder Lake-P) do not raise that status across suspend-to-idle (S0ix). The core is then left gated: set_config()'s register writes have no effect, it nevertheless returns success, and every subsequent transfer fails with IIC_ETIMEOUT, leaving child I2C-HID devices (touchpad, touchscreen) dead after resume. Give ig4iic_set_config() a force_restore argument and pass it from ig4iic_resume() so the un-idle handshake runs unconditionally for IG4_HAS_ADDREGS controllers, regardless of the RESTORE_REQUIRED status. This keeps the handshake and its reset/restore sequence in one place instead of duplicating it in the resume path. The DesignWare core's register bank stays inaccessible (reads back as zero) until it leaves reset, which happens when ig4iic_set_config() deasserts the core reset. Rather than waiting a fixed, guessed interval, poll the fixed component-type signature (IG4_REG_COMP_TYPE == IG4_COMP_TYPE) immediately after that deassert and continue as soon as the core is ready. On Alder Lake-P the core is ready with no measurable delay; the bounded poll keeps this correct on slower parts, and warns if the core never leaves reset. While integrating these I2C-HID touch devices, also raise hid(4)'s MAXLOCCNT from 2048 to 4096: the report-descriptor parser truncates any variable main item whose usage count exceeds MAXLOCCNT, silently dropping the trailing report fields. Some contemporary touch devices declare variable items with more than 2048 entries, so part of their input reports was being discarded. Reviewed by: adrian MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57673
There is no WRFSBASE and WRGSBASE 32bit variants at all. As such, the fsbase and gsbase must always be equal to the bases in the corresponding segment descriptor, same as on real i386. If a 32bit program reloads either %fs or %gs using setcontext(9) or sigreturn(9), restoring bases from the syscall entry time is wrong. In all other cases, hardware already does the right action when the segment register is loaded, and the bases for the ufssel/ugssel in GDT are updated on the context switch. Reviewed by: markj (previous version) Tested by: terehovv@mail.ru Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57611
Alter pmap_copy_page(s) to use memcpy rather than the deprecated bcopy. We'll be adding non-provenance preserving versions for CHERI support and would like to avoid introducing variants of deprecated APIs just to maintain symmetry. Reviewed by: kib Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57687
Some Book-E cores (at least e6500) can have much larger PID fields, up to 14 bits. Extend the PID mask space to the full space, and future changes may take advantage of this extended space.
e6500 core supports 14-bit TIDs (16384), while all earlier cores support only 8 bit TIDs. Dynamically allocate the tidbusy array at bootstrap time so that it stays in the TLB1, but is sized appropriately for the core. With MAXCPU of 32, a e6500 tidbusy would be (8 * 32 * 16384), or 4MB for this array, while e5500 would use (8 * 32 * 256), or 64kB.
Watchdog interrupt is a "critical" interrupt, so save the correct registers (CSSRn, into critical save area).
Network-related commands, library, and kernel.
On Linux struct ifinfomsg uses ARPHRD_* values, while we used IFT_* types (which derive from SNMP ifType definitions in RFC 1573). Update the header to reflect this. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272144 Reviewed by: pouria Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57334
No functional change intended. MFC after: 1 week
This removes requirement for existence of obsolete IPPROTO_DIVERT in <netinet/in.h> and the 'divert' entry in /etc/protocols. Also, this avoids running through the nsdispatch(3) machinery on startup, cutting down about 20 syscalls, three of which are open(2). The code of sockstat(1) itself is also reduced. The only UI change for a normal execution is that now the divert(4) sockets are reported as "divert4" instead of "div4". The prefix "4" itself is also incorrect, as divert(4) is not a part of IPv4. This will be addressed in a separate change. There is small UI change for incorrect runs. Previously protocols listed in /etc/protocols, but not supported, would err out like this: # sockstat -P ggp sockstat: protocol 3 not supported And non-existent protocols would err out like this: # sockstat -P foo sockstat: cap_getprotobyname: No error: 0 USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS Now both cases will consistently err: sockstat: protocol foo not supported Reviewed by: pouria, tuexen Differential Revision: https://reviews.freebsd.org/D57507
This makes it possible to list unix(4) protocols in -P, which was not possible before. Update the manual page and provide an example. In 'struct sock' make member proto a pointer into the protocols table instead of a number. This removes namespace collision that mixed IPPROTO_TCP and etc with SOCK_STREAM and etc. There were no known bugs due to this collision, though. Preserve all current UI bugs for possible combinations of protocol selection options. Should be no UI changes outside the improved -P. Reviewed by: pouria, tuexen Differential Revision: https://reviews.freebsd.org/D57508
After commit 08f54dfca197 pfctl_get_astats() doesn't set errno anymore, except in one place. Fix up that one place and adjust callers appropriately. Reviewed by: kp Fixes: https://cgit.freebsd.org/src/commit/?id=08f54dfca197 ("pf: convert DIOCRGETASTATS to netlink") Differential Revision: https://reviews.freebsd.org/D57608
Handle cred, ipopts, and maclabel using the same pattern:
allocate at the beginning and set to NULL when the object is
transferred to a struct syncache. When exiting the function, free
these objects if not transferred or when transferred to the on-stack
struct syncache. This makes use of a new function syncache_release().
This fixes a use after free problem: ipopts should only be freed,
if the on-stack struct syncache is used and the pointer in this
structure still points to the allocated ipopts. If the ipopts
are moved from the struct syncache to the struct inpcb in
syncache_socket(), which is called by syncache_tfo_expand(),
the pointer in the struct syncache is set to NULL.
In a FreeBSD default setup this problem is mitigated by
1. TCP fast open support on the server side not being enabled
(the sysctl-variable net.inet.tcp.fastopen.server_enable is 0).
2. Incoming IP packet with source routing options are not being
processed by the host stack
(the sysctl-variable net.inet.ip.accept_sourceroute is 0).
Only if these two sysctl-variables are changed, a FreeBSD system
is affected, if a server actually using TCP fast open is running.
Reported by: Yuxiang Yang, Yizhou Zhao, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM5.1 from Z.ai
Reviewed by: markj, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D57374
The default value has been 1 since June 2018, but the docs were not updated to reflect the change. MFC after: 3 days Reviewed by: ziaee Fixes: https://cgit.freebsd.org/src/commit/?id=af4da5865557 (Enable TCP_FASTOPEN by default) Signed-off-by: Matteo Riondato <matteo@FreeBSD.org> Closes: https://github.com/freebsd/freebsd-src/pull/2285
Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: Nvidia networking Differential revision: https://reviews.freebsd.org/D57083
Some interface drivers, notably bnxt, can insert 0 length packets onto their receive queues when certain conditions are met, such as discarding packets in the case of bnxt. When this packet gets processed by assemble_segments(), The solitary mbuf on the queue that composes it consist of a single zero length fragment. The loop in assemble_segments() doesn't seem to expect that a 0 length fragment can exist in the iri_frags list without a non-zero length header preceding it. In this situation, without filter intervention rxd_frag_to_sd() returns a pointer to the corresponding mbuf in the rxq, where it is matched as a zero-length fragment and immediately discarded without freeing as mh has not yet been assigned. This change corrects this behavior by falling through the mh == NULL case and freeing m on the condition that it is not NULL before continuing the loop. Reviewed by: gallatin Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D57537
Reviewed by: kp MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf") Differential Revision: https://reviews.freebsd.org/D57696
Stuff in man section 8 (other than networking).
The fill loop was bounded by packlen, which is sized for the receive buffer (datalen + IP6LEN + ICMP6ECHOLEN + EXTRA), not for outpack. With large datalen the loop wrote past outpack[MAXPACKETLEN]. Bound it to the actual data area in outpack instead. Reported by: Oculytic Reviewed by: des, markj Differential Revision: https://reviews.freebsd.org/D57441
Update bsdconfig dot USAGE Replace mention of graphics/ImageMagick with graphics/GraphicsMagick
Update bsdconfig dot USAGE graphics/gimmage is no longer in ports, remove mention
Update bsdconfig dot USAGE graphics/gqview is no longer in ports, remove mention
print/gsview is no longer in ports, remove mention
Add gm prefix to convert command. `convert` of ImageMagick is now available under `gm convert` where `gm` is the main entry point for GraphicsMagick commands.
graphics/gx is no longer in ports, remove reference
log_set_peer_name() and log_set_peer_addr() were never used Differential Revision: https://reviews.freebsd.org/D57164
Previously, gfxfb_blt flushed the framebuffer on every call. Since a single drawing operation may invoke gfxfb_blt multiple times, this can result in unnecessary flushes. Instead, write updates to the shadow buffer (when present) and mark the affected area as dirty. Flushing is deferred so multiple gfxfb_blt calls can be coalesced into a single update. As before, only the dirty region is flushed. This fixes the slow bootloader problem in some platforms. Reviewed by: imp, adrian, obiwac Tested by: obiwac, jrm MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57373
Free the previous value before re-strdup'ing, and initialise
remoteMountPoint to NULL in fs_entry_create() so the free() is safe on
the newly-created path
Observed via a dtrace leak snapshot on 15.0-RELEASE-p4:
data leaked = 1983, count = 1683
libc.so.7`malloc+0xa8
snmp_hostres.so.6`fs_tbl_process_statfs_entry+0x276
snmp_hostres.so.6`refresh_storage_tbl+0x502
snmp_hostres.so.6`op_hrStorageTable+0x1a
libbsnmp.so.7`0x2a2b1892ba3d
libbsnmp.so.7`snmp_getbulk+0x37f
Reviewed by: sjg, ngie
Differential Revision: https://reviews.freebsd.org/D57604
Use ATF to wrap the new reimplementation of pjdfstest that came out of GSOC 2022, now available in the ports tree as filesystems/pjdfstest. So far I added tests for UFS (with several different option combinations), tmpfs and ZFS, plus ZFS+nullfs. All of these create a memory disk, initialize the filesystem, and point the pjdfstest executable at it. In the future it would be good to add tests for at least NFS and p9fs. Reviewed by: asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56605
Reviewed by: emaste Fixes: https://cgit.freebsd.org/src/commit/?id=ad0e698e642e ("ifmcstat: remove libkvm(3) code") Event: BSDCan 2026
Correct the manpage to reflect the preference for GUID vs UUID. Take the long version of --guid for the -g option. Sort the argument list while we are touching it. Reviewed by: imp MFC after: 1 week MFC to: stable/15 Event: BSDCan 2026 Differential Revision: https://reviews.freebsd.org/D57695
Introduce a new variable "security_status_loginfail_ignore" to filter unwanted login failure messages from the daily security checks. Co-authored-by: Michael Osipov <michaelo@FreeBSD.org> Co-authored-by: Joseph Mingrone <jrm@FreeBSD.org> PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295191 Reviewed by: jrm MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D57671
This test fail until at least https://reviews.llvm.org/D155066 is rebased and picked up for aarch64 and more work is done for the other archs. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289096 Reviewed by: jlduran Fixes: https://cgit.freebsd.org/src/commit/?id=fef84fd8ae845e19cec0f6b9aac0e6451cca3d7a MFC after: 3 days
While here, remove the conditional on the "ci" config var to ensure that this is reproducible locally as well. This fixes a case where we are expecting a fail before the failing ATF_CHECK_* assertion happens. Found in a CI failure here: https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16608/testReport/lib.msun/logarithm_test/log1p_accuracy_tests/ PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253984 Fixes: https://cgit.freebsd.org/src/commit/?id=405188aeac540f7666dfde37c2f32d222119f56e MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57351
Userspace mlx5_driver_init() only attached when vendor/device matched hca_table, while the kernel already probed additional Mellanox PCI IDs That mismatch prevented libibverbs from loading the mlx5 provider on those HCAs. Extend hca_table to mirror mlx5_core_pci_table and add cross-references so future kernel ID additions are paired with a userspace update. Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> Sponsored by: Nvidia networking MFC after: 1 week
This reflects the difference from the upstream libusb code. See: https://github.com/libusb/libusb/blob/master/libusb/libusb.h Reviewed by: adrian Event: BSDCan 2026 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57620
ctermid(3): Fix return values section ctermid() doesn't, and has never, set errno. While here, add ctermid_r to the name section and align the parameter name in the source file. Reviewed by: bnovkov Approved by: bnovkov MFC after: 3 days Obtained from: https://github.com/apple-oss-distributions/libc Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57396
ctermid(3): Fix return Reported by: bnovkov Fixes: https://cgit.freebsd.org/src/commit/?id=dc24f31b67f5 ("ctermid(3): Fix return values section") Sponsored by: Klara, Inc.
Commit `3a686b851f8f` fixed a `dbm_nextkey` edge case when using the function after reaching the end of the database, but it inadvertently broke the following `R_NEXT` behaviour: "If the cursor is not yet set, this is the same as the R_FIRST flag." Fix this by adding a new cursor constant that allows us to differentiate between an unset cursor and a cursor that overflowed. Reported by: ae Fixes: https://cgit.freebsd.org/src/commit/?id=3a686b851f8f Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D57670 Reviewed by: markj
Commit 1e25cda7f06923d05e28dac8eb1c1c428a5c92dc fixed it. MFC after: 3 days Sponsored by: The FreeBSD Foundation
Commits c5d72d2 and 3b6d4c6 broke the case where the archive/hidden/system attributes are being set false (UF_ARCHIVE, UF_HIDDEN or UF_SYSTEM bits being cleared.) and the NFS server does not support those attributes. These patches only checked for support if the archive/hidden/system attributes were non-zero. This patch fixes the problem. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296088 Tested by: Joshua Kinard <freebsd@kumba.dev> MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=c5d72d29fe0e ("nfsv4: Add support for the NFSv4 hidden and system attributes")
Some ZFS pools do not support va_birthtime and will return EINVAL when a VOP_SETATTR() of it is attempted. The MacOS NFSv4 client sets va_birthtime (TimeCreate) in the same Setattr with ctime/mtime and other attributes after a new file is created. The EINVAL failure leaves these new files messed up (mode == 0). This patch pretends the setting of TimeCreate succeeded if ctime/mtime were also set in the same Setattr RPC, which resolves the problem for the MacOS client. If this fix is not sufficient, a new pathconf name to detect if a file system supports birthtime may be needed. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296066 Tested by: Will <freebsd.geography231@slmails.com> MFC after: 2 weeks
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
This code hasn't changed in a long time, so I don't know why this showed up now?
Kernel stuff (other than networking, filesystems, and drivers).
Add a KERNEL_VERSION() macro which normally would be in linux/version.h. On Linux that file is auto-generated and we are supporting more than one Linux version in LinuxKPI anyway so any further defines in there would likely be wrong. Adding the macro helps to support (vendor/out of tree) drivers more easily which are supporting multiple Linux versions. MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D57590
Add sg_init_marker() which is needed by mt76 drivers USB attachment. Sponosored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, dumbbell Differential Revision: https://reviews.freebsd.org/D57594
The upcall_sockets tree owns a ref on any resident socket. When a socket is removed after a TLS handshake failure, rpctls_rpc_failed() thus calls soclose(). rpctls_server() does not acquire an extra ref to compensate for this. So, if the upcall fails, e.g., because rpc.tlsservd is not running, we'll call soclose() to drop the reference, but this effectively releases the xprt layer's reference. Fix the problem by explicitly acquiring a socket reference when adding a socket to the upcall tree. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289734 Reviewed by: rmacklem, glebius MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57555
This patch moves "struct netexport" into a separate netexport.h file and refcounts the structure, plus adds a few fields that will be used in a future NFS server commit. The patch also includes some helper functions for handling the netextport structure: vfs_netexport_alloc(), vfs_netexport_acquire(), vfs_netexport_release() and vfs_netexport_reset(). Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D57553
Reviewed by: imp, kib (in D57002) Sponsored by: The FreeBSD Foundation
Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57413
The definition of the EXTERR_CATEGORY symbol in the .c file is needed for the script to regenerate identical context of gen/exterr_cat_filenames.h. Sponsored by: The FreeBSD Foundation
For all the socket options that have a fixed type, add the type of the socket option arg to the comment. Most of them already had this, but a few did not. The ones that don't have a tag use a variable length data structure of some kind, and are beyond the scope of this commit. Slightly expand the syntax to allow a comma separated list for those sockopts that have multiple fixed-length versions. Sponsored by: Netflix Reviewed by: pouria, peter.lei_ieee.org, tuexen Differential Revision: https://reviews.freebsd.org/D57545
According to the IB spec active_speed size should be u16 and not u8 as before. Changing it to allow further extensions in offered speeds. Linux commit: 376ceb31ff87 RDMA: Fix link active_speed size Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57084
Add new IBTA speed XDR, supporting signaling rate of 200Gb. Reviewed by: kib Tested by: Wafa Hamzah <wafah@nvidia.com> MFC after: 1 week Sponsored by: NVIDIA Networking Differential revision: https://reviews.freebsd.org/D57085
SYSCTL_XXX with CTLFLAG_RDTUN and without CTLFLAG_NOFETCH should not be used for values that are needed before SI_SUB_KLD. Otherwise they are tuned after they are needed. Set CTLFLAG_RDTUN | CTLFLAG_NOFETCH for the debug.witness.witness_count and debug.witness.skipspin sysctls and add separate tunables for them, which run at SI_SUB_TUNABLES time, i.e., in time for witness_startup. Reviewed by: kib, markj Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D57613
Add tunable debug.witness.lock_order_data_count to allow adjusting the number of witness lock order data entries (stacks) without recompiling the kernel. This may help to display stacks when a lock order reversal is reported but the number of entries is exhausted before recording the first lock order, by allowing the user to reboot with an adjusted tunable and try again. Tunable debug.witness.lock_order_hash_size is also provided to allow the hash table load factor to be managed, though that is not required. Also tweak witness_lock_order_add to avoid computing a hash when it won't be needed because the lock order data entries are exhausted. Reviewed by: kib, markj Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D57600
Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D56519
With exception to sockopt functionality, implement the so_options flag in unix(4) itself. The general argument for the flag is that SCM_RIGHTS can be used maliciously for, e.g., a DoS that the receiving side can't avoid if it is expecting other control messages. This option gives the receiver a way to disable SCM_RIGHTS on the sender-side, surfacing an EPERM to them instead. This seems to match the semantics that Linux offers. If an SCM_RIGHTS was already sent before we disabled SO_PASSRIGHTS, then a subsequent recvmsg(2) will silently discard any in-flight files. This has the downside of punting a file with the potential to hang over to the deferred-close task, but perhaps usage of the option would discourage folks from attempting to take advantage of that possibility anyways. Various manpages updated to describe the new behavior. The ru_msgsnd accounting here might need to be re-evaluated: some error paths will increment it while others will not, and it isn't really clearly labelled. At some point in the operation enough work has been done that one could consider it enough resources to count, but it's not obvious that it should work this way. This change doesn't attempt to address that. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D57423
This is a little different than the others in that it's not valid for anything but unix(4) sockets. New cases were added that jump into the more standard case out of a light preference for not taking advantage of case FALLTHROUGH with the additional logic- it doesn't scale very well for new cases added that might be slightly special, so we might as well just add the labels up-front. Reviewed by: glebius, markj Differential Revision: https://reviews.freebsd.org/D57424
We have a native version now, plumb it through to the Linuxolator. Reviewed by: glebius, markj Differential Revision: https://reviews.freebsd.org/D57427
so2rele was introduced in 1000cc4a0d3 and it was necessary there, but the cleanup in a837d1fe49e0255 rendered it redundant if our own KASSERT is to be believed: we've asserted that `so2->so_splice_back == sp` and `sp` has been dereferenced above, so there's no condition left where we shouldn't release the socket reference at the end. Indeed, the change in so_splice() to NULL out sp->dst removes that possible state of a partially constructed splice: if sp->dst is set, it has been ref'd. Reviewed by: gallatin, markj Differential Revision: https://reviews.freebsd.org/D57558
jail_attach lets modules do attachment-specific work by calling osd_jail_call(PR_METHOD_ATTACH). If one of the modules returns an error, the call needs to be repeated with the thread's current prison, so possible earlier modules and undo any changes they may have made. MFC after: 5 days
Use a value that do_execve will ignore since there's nothing there to do.
With this we can set the 'indirect' flag on rtld, to prevent direct execution
being used to bypass the 'indirect' flag on python3:
root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
pwned
root@vuefi:~ # veriexec -z enforce
root@vuefi:~ # /libexec/ld-elf32.so.1 /usr/bin/python3 -c 'print("pwned")'
/libexec/ld-elf32.so.1: Operation not permitted.
root@vuefi:~ #
load_file seems missnamed since it is only used by load_interp
so rename it to load_interp_file.
Reviewed by: imp
Sponsored by: Hewlett Packard Enterprise Development LP
Differential Revision: https://reviews.freebsd.org/D57649
libc: Add atomics C23 feature test macro Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Restrict ATOMIC_VAR_INIT for C23 conformance Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed. Retain it for earlier C standards and for C++ (as it still remains in C++23, albeit marked as deprecated since C17 and C++20.) Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to avoid coupling with a deprecated initialisation mechanism. No functional change intended for `atomic_init`; this is purely a conformance and cleanup adjustment. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Add missing kill_dependency macro Add `kill_dependency` as specified by C11 §7.17.3.1. The macro is required to break dependency chains in expressions without affecting the value. No functional impact beyond providing the required, value-preserving definition. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Reorganise memory_order enumeration constants Place the `memory_order` enumeration constants alongside the corresponding typedef under the §7.17.3 heading. The previous layout separated the fallback constant definitions from the enum, which could obscure their relationship. These fallbacks exist only to provide values when the compiler does not supply the builtins. The removed comment encoded implementation-specific assumptions about compiler-provided definitions and implied a relationship between Clang/GCC macros and fallback values. In practice, the fallback definitions exist solely to ensure the enumerators are defined when compiler intrinsics are absent, and do not depend on any particular numeric mapping. No functional change; this is a mere structural and clarity improvement. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Reorder atomic operations to match ISO C standard Reorder definitions of specified generic operations on atomic types so they follow the sequence in ISO/IEC 9899:2024 §7.17.7: 1. `atomic_store` 2. `atomic_load` 3. `atomic_exchange` 4. `atomic_compare_exchange` 5. `atomic_fetch` This aligns the header layout with the standard, making it easier to cross-check against the normative text and maintain consistency with the rest of the header. The behaviour of the macros remains unchanged; this is purely a reorganisation and documentation improvement. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Enforce lock-free atomic_flag and C23-safe initialisation
Select the `atomic_flag` backing type according to the C standard
requirements that `atomic_flag` operations be lock-free.
C11 §7.17.1.5 defines `atomic_flag` as:
> a structure type representing a lock-free, primitive atomic flag
and §7.17.8.2 further requires:
> Operations on an object of type atomic_flag shall be lock free
Therefore:
- Prefer `atomic_bool` when `ATOMIC_BOOL_LOCK_FREE == 2`
- Fall back to `atomic_uchar` when `ATOMIC_CHAR_LOCK_FREE == 2`
- Trigger a translation failure if neither type is lock-free
Adjust `ATOMIC_FLAG_INIT` for C23 initialisation rules:
- Use `{ ATOMIC_VAR_INIT(0) }` in pre-C23 modes
- Use `{ 0 }` in C23 and later
Preserve `atomic_flag_test_and_set_explicit()` semantics by
normalising the exchanged value with `!= 0`, ensuring consistent
boolean results regardless of whether the underlying
representation is `atomic_bool` or `atomic_uchar`.
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Fix atomic_init for GCC atomic objects Add a dedicated `__GNUC_ATOMICS` path that initialises via `atomic_store_explicit(obj, value, memory_order_relaxed)`. This ensures the required initialisation semantics without assuming any particular object representation. Previously, `atomic_init` on GCC fell through to the legacy `__val` member path intended only for old struct-backed atomic objects. For current atomic objects, this caused the following compilation error: > error: request for member '__val' in something not a structure or union As a result, valid code such as `atomic_init(&x, 1)` failed to compile when using GCC. This fix restores compatibility with standard-conforming callers while other code paths remain unchanged. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Fix GCC pointer semantics for atomic_fetch_add/sub Correct the GCC implementation of `atomic_fetch_add_explicit()` and `atomic_fetch_sub_explicit()` for atomic pointer types. The previous implementation passed the operand directly to the builtins. For pointer objects, this could result in raw byte-wise address arithmetic rather than the required C atomic pointer semantics, where the operand is interpreted as a `ptrdiff_t` element count. As a result, operations such as `atomic_fetch_sub_explicit(&p, 2, ...)` could produce an incorrect post-operation pointer value. Fix this by applying pointer scaling in the GCC path before invoking the builtin, mirroring the existing legacy fallback implementation. Pointer operands are now scaled by the size of the pointed-to type, while integer atomic behaviour remains unchanged. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
libc: Fix ATOMIC_VAR_INIT visibility Fixes: https://cgit.freebsd.org/src/commit/?id=28cecfe27964 ("libc: Restrict ATOMIC_VAR_INIT for C23 conformance") Reviewed by: fuz, imp Differential Revision: https://reviews.freebsd.org/D57724
Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html: "graph": Define characters to be classified as printable characters, not including the space character. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57578
linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_MODE()` They are the same as their `__ATTR_RO()` and `_ATTR_RW()` equivalents but they take the file mode as an extra argument. We now use these new macros to redefine `__ATTR_RO()` and `__ATTR_RW()` on top of them. The amdgpu DRM driver started to use `__ATTR_RW_MODE()` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57574
linuxkpi: Define a bunch of constants in <acpi/video.h> `ACPI_VIDEO_NOTIFY_PROBE` was already defined. Let's define the whole set once and for all. The amdgpu DRM driver started to use `ACPI_VIDEO_DISPLAY_LCD` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57575
linuxkpi: Add `pm_resume_via_firmware()` This function is unimplemented, always return false. While here, fix the return type of `pm_suspend_via_firmware()`: it should be a boolean, not an integer. The amdgpu DRM driver started to use `pm_resume_via_firmware()` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57580
linuxkpi: Add 'fd_empty()` The DRM drivers generic code started to use it in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57582
linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()` `COUNT_ARGS()` counts the number of arguments it is passed. The implementation is heavily inspired from the one of `CTR()`. `CONCATENATE()` is an alias for `__CONCAT()`. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57584
linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional The previous implementation always took the `len` but now, it is optional and defaults to the size of `dst`. The DRM drivers started to use `strscpy()` without the `len` in Linux 6.13. Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57585
The current format seems to be a little confusing, and the version of it for index 0 was broken by the below-referenced commit. Break our UNUSED macros out into one per unused bit to enumerate the entirety of the space and make it easier to claim an unused one. Fixes: https://cgit.freebsd.org/src/commit/?id=b165e9e3ea4e327fc ("Add fchroot(2)") Reviewed by: oshogbo (previous version), kib, markj Differential Revision: https://reviews.freebsd.org/D57505
pNFSd: Add a directory of newly created files for the pNFSd When an NFSv4.1/4.2 server is configured as a pNFS server, new file creation (via Open/Create from an NFS client) is slow, due to the fact that the NFS server (MDS) must do RPCs against the DS(s). This patch precreates files in a directory called ".pnfshide/numfiles", so that the NFS server can just rename them for the Open/Create. A kernel process called a "replenisher" creates more files in ".pnfshide/numfiles" as required. (At this point, the MDS must still do Setattr RPC(s) on the DS(s), but that will change when the pNFS server is converted to the loosely coupled configuration. This patch only affects the pNFS server and only if the directory .pnfshide/numfiles exists in the exported file system. Reviewed by: kib Discussed with: markj Differential Revision: https://reviews.freebsd.org/D57554
nfs_nfsdport.c: Do unnecessary initializations to quiet gcc Fixes: https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
nfs_nfsdport.c: One more unnecessary initialization for gcc Fixes: https://cgit.freebsd.org/src/commit/?id=d8e8f9251975 ("pNFSd: Add a directory of newly created files for the pNFSd")
These have turned out to be too noisy, so put them behind bootverbose Event: BSDCan 2026 (noticed during UFS demo) Sponsored by: Netflix MFC After: 2 weeks
execve_block(): a mechanism for mutual exclusion with execve() on the process A consumer of execve_block(9) is synchorized with the execution of execve(2) family of syscalls, ensuring that execve_block region is mutually exclusive with the execve processing. Either execve_block() or execve() would sleep until other finishes. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_exec.c: explicitly include sys/limits.h for UINT_MAX While there, remove unneeded manual inclusion of sys/cdefs.h. Fixes: https://cgit.freebsd.org/src/commit/?id=e1a84b7708c2 ("execve_block(): a mechanism for mutual exclusion with execve() on the process") Sponsored by: The FreeBSD Foundation MFC after: 1 week
Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Provide proc_vmspace_ref() to safely obtain the reference to the target process vmspace, optionally - requiring that the target cannot execve(2) and thus cannot change its vmspace until vmspace in unreferenced - requiring the check of permissions of the caller after the vmspace reference is obtained, since the process lock might have been dropped in the process. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_proc.c: ensure stability of the vmspace we read the strings from Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vmmap Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_proc.c: ensure stability of the vmspace for sysctl kern.proc.vm_layout Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_proc.c: make kern.proc.osrel atomic Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
kern_proc.c: disallow execve around sysctl kern.proc.kstacks Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497
kern_proc.c: disallow execve around sysctl kern.proc.rlimit Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: htts://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
to ensure stability of the process uid/gids during the p_cansee()/p_candebug()-protected regions. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57497
Add a uiomove_step() for the central set of switch statements which choose between userspace and kernel and if data is going to or from the iovec. Refactor uiomove_fromphys loops to unconditionally free per-iteration resources and drop gotos. While here, switch from bcopy to memcpy. Reviewed by: kib Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57688
Reviewed by: kib, emaste Suggested by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D57689
After the conversion to using netlink, the kgssapi had no way of knowing if the gssd daemon was running. As such, a boot where the kgssapi is loaded, but the gssd is not enabled would hang the nfsd for a very long time. (Many timeouts at 300sec each.) This patch adds a Null RPC upcall with a 200msec timeout to check to see if the gssd is running. If the gssd is not running, the nfsd starts up (without Kerberos support) with only a 200msec delay.) Also, move the svc_svc_nl_create() and svc_reg() calls in gssd.c to before the daemon() call, so they are guaranteed to have been done before the nfsd(8) daemon is started by the rc scripts. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295714 Reviewed by: glebius MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D57455
Reviewed by: emaste
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D57601
For native files we can do more minimal fixes to avoid this large of a hammer, but for third party files it may not be worth the effort to try and patch them. NetBSD has the original _FORTIFY_SOURCE implementation that ours is based on, for instance, but tests sourced from there can't do an __ssp_real(foo) without being certain that `foo` actually has a fortified definition. This change does always define _FORTIFY_SOURCE as a result, so gate it on CFLAGS not already containing _FORTIFY_SOURCE definitions. This re-applies c46a0b59071614, but without re-defining _FORTIFY_SOURCE needlessly. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294881 Reviewed by: markj, sjg (both previous version) Differential Revision: https://reviews.freebsd.org/D57356
Update to latest dirdeps related makefiles.
dirdeps.mk tweaks useful for universe among other corner cases.
also additional filtering for bogus paths ending in /
gendirdeps.mk allow more debugging
also additional filtering for bogus paths ending in /
install-new.mk fix bug when isPOSIX_SHELL is true
meta2deps.?? handle file names with spaces by ignoring them
Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D57683
Note: We confusingly have the instructions to build the system in the build manual, the UPDATING file, and the Makefile. These will get out of sync and will be harmful when they do. Fixes: https://cgit.freebsd.org/src/commit/?id=ddf6fad0295a ("etcupdate: Make nobuild the default") Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D57644
remove extra } from GENDIRDEPS_ENV more debug output for gendirdeps.mk Reviewed by: stevek Differential Revision: https://reviews.freebsd.org/D57727
Some downstream projects (e.g. ElectroBSD) have removed the TIOCSTI We already have some components (such as mail and tcsh) that build without TIOCSTI defined. This is (existing portability support in those projects. Simplify things for downstreams by extending this approach to this additional TIOCSTI user. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50614
This test is known to be flaky if 10 attempts happens to be not enough for the test to pass. Usually, this test passes in ~4-6 attempts. See https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28664/testReport/junit/sys.netpfil.pf/route_to/random_table/ Rely on the timeout (default 5 mins) to catch a failure here, rather than just 10 attempts. It's very unlikely that 5 mins worth of attempts still isn't enough. For a history of flakiness, see https://ci.freebsd.org/job/FreeBSD-main-amd64-test/lastSuccessfulBuild/testReport/junit/sys.netpfil.pf/route_to/random_table/history/ PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289477 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D57408
This is almost a trivial factoring, but it's still a bit of boilerplate that we don't care to rewrite- the SO_PASSRIGHTS test will still receive some data, so the iovec construction still saves us a few lines. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D57544
We test both the standard case where we want to reject any SCM_RIGHTS message, as well as the case where the kernel discards the unwanted file upon receipt. Reviewed by: glebius (previous version), markj Differential Revision: https://reviews.freebsd.org/D57426
Extend the existing test utility to cover recent stdatomic changes and improve validation of interface semantics, compile-time assertions, and behavioural conformance. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
sound tests: Add PROT_EXEC rejection test Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, kib Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
sound tests: Remove trailing PROT_EXEC Fixes: https://cgit.freebsd.org/src/commit/?id=730eaf466493 ("sound tests: Add PROT_EXEC rejection test") Reported by: Oliver Pinter <oliver.pntr@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 6 days
These could go in other categories, but it's more clear if they're here instead.
- s/Similarily/Similarly/ - s/passtrough/passthrough/ MFC after: 5 days
- s/thet/the/ MFC after: 5 days
- s/Wihout/Without/ MFC after: 5 days
- s/Februrary/February/ MFC after: 1 week
Fix typo in if statement for compiling rtw88 against a Linux target. Signed-off-by: Lambert Lim <lambert@sanesecurityguy.com> Reviewed by: imp,ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/2262
Merge commit '026e5b88eb0cde54d9fc22b9a1ebc79ea0f67aec'
Merge commit '3750aed65c1f5a610b44d29c92236ca119b62780'
It broke the test suite, and will be recommitted when fixed. This reverts commit db887713de2bf5c77494220a9e0ddfa7d4290155. Reported by: markj
This reverts commit 7a289fe3cd5c6de7ddbe394b7700b20b0bafdb3e. Hopefully, commit fc7993cf2d6d has fixed the underlying problem reported by PR#289734, so I am reverting this temporary work-around. I will delay MFC'ng this for a while, to see if the problem occurs again. MFC after: 3 months
Not classified automatically, and waiting for manual attention.
-- no commits in this category this week --
Dates:
cgit.freebsd.org/src. Git accurately records the
order of commits, but not their dates.Automatic grouping:
This reverts commit \\b([0-9a-fA-F]{40})\\b
and the hash was found in this week's commits.
Automatic categories:
Source code:
Generated with commits-periodical 0.20 at 2026-07-13 17:53:14+00:00.
This work is supported by Tarsnap Backup Inc.
Alternate version: 2026-06-15 (debug) (contains info about the classification)