This is a display of mostly-automatically-classified git commits from 2026-07-20 to 2026-07-26.
Table of contents and commits per category:
| (1) | Highlighted commits (these are copies, not in stats) | |
| 8 | 5.4% | Userland programs |
| 10 | 6.7% | Documentation |
| 52 | 34.9% | Hardware support |
| 10 | 6.7% | Networking |
| 7 | 4.7% | System administration |
| 5 | 3.4% | Libraries |
| 2 | 1.3% | Filesystems |
| 36 | 24.2% | Kernel |
| 2 | 1.3% | Build system |
| 3 | 2.0% | Internal organizational stuff |
| 10 | 6.7% | Testing |
| 1 | 0.7% | Style, typos, and comments |
| 3 | 2.0% | Contrib code |
| 0 | 0.0% | Reverted commits |
| 0 | 0.0% | Unclassified commits |
| 149 | 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.
Point out which features are non-POSIX and thus can not be safely assumed to be portable and exist in other implementations. Relnotes: YES! Reviewed by: ziaee, jilles Differential Revision: https://reviews.freebsd.org/D55333
Commits about commands found in man section 1 (other than networking).
GNU hexdump supports octal and hex, we add supports for BSD style hexdump for better compatibility. See: https://github.com/llvm/llvm-project/pull/206581/ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58074
- gnum4.c: fix m4_warnx() to use vwarnx() instead of warnx() - eval.c: improve error messages for empty macro names - extern.h: remove compute_prevep() declaration - Update OpenBSD version strings MFC After: 3 days
This partially reverts commit 77a201b1705dbd97ea9ebe5b25b1d4ddac8a7d38. Requested by: des, fuz
The fallback glyph is stored at index 0, and does not need to be inserted into a mapping. Previously there was a dead store of add_glyph's return value for the fallback case, which upset Clang's static analyzer. Now, cast the return value to (void) to make it clear this is intentional. Also change add_glyph's fallback parameter to a c99 bool to make its use more clear. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57174
install: Allow installing stdin If from_name is "/dev/stdin" or "-" and the target is not a directory, skip the comparison and copy data from standard input to the target. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D58348
install: Fix typo MFC after: 1 week Reported by: markj Fixes: https://cgit.freebsd.org/src/commit/?id=d34870708db9 ("install: Allow installing stdin")
This is mainy focused on using bool for booleans but also renames some variables for clarity, adds some explicit comparisons, adds some braces, with miscellanous style fixes thrown in. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D58355
Check the `fdopen` return value before calling `cook_cat`. Reviewed by: markj, bnovkov Differential Revision: https://reviews.freebsd.org/D57741 MFC after: 1 week
Man pages, release notes, etc.
boot.9 was moved to kern_reboot.9, but this reference was not changed appropriately. Reviewed by: mhorne, kib, emaste Fixes: https://cgit.freebsd.org/src/commit/?id=800e74955d4e ("boot(9): update to match reality") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58350
Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58315
Point out which features are non-POSIX and thus can not be safely assumed to be portable and exist in other implementations. Relnotes: YES! Reviewed by: ziaee, jilles Differential Revision: https://reviews.freebsd.org/D55333
List every AQC part aq_vendor_info_array[] probes, each with the maximum speed aq_hw_capabilities() grants it. Only the Atlantic 2 parts link at 10 Megabit. The AQC100 and AQC100S are the only SFP+ controllers; the rest are twisted pair. Reviewed by: adrian, ziaee Signed-off-by: Nick Price <nick@spun.io> Differential Revision: https://reviews.freebsd.org/D58144
Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D58267
contigmalloc.9: Note that M_WAITOK may still return NULL Reviewed by: markj, bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58382
contigmalloc.9: Correct typo Reported by: alc, rlibby Fixes: https://cgit.freebsd.org/src/commit/?id=caabdb3aefdc ("contigmalloc.9: Note that M_WAITOK may still return NULL")
The manual page claimed that SIGINFO caused information to be printed to stdout, when in fact it is printed to stderr, as one would expect. This has been true ever since the feature was first added in 2003. MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=00d321a2b395 ("Add a SIGINFO handler.") Reviewed by: jilles Differential Revision: https://reviews.freebsd.org/D58392
Describe the disabled, adaptive, and low-latency settings and their interrupt-rate tradeoffs. MFC after: 1 week
Describe the disabled, adaptive, and low-latency settings and their interrupt-rate tradeoffs. MFC after: 1 week
Hardware drivers and architecture-specific code.
bus_{read,write}_8 are macro wrappers around the corresponding bus_space
functions in sys/bus.h, so implementing bus_{read,write}_8 won't work.
Implement the underlying bus_space function instead.
Reviewed by: jrtc27, rlibby
Fixes: https://cgit.freebsd.org/src/commit/?id=9313f6b01485
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58301
The accumulated count of a process-mode counting PMC is kept in a 64-bit software counter and seeded into the hardware counter at every context switch in. Hardware counters are narrower than that - each PMC class discovers and records its own counter width, e.g. 48 bits on current x86 (queried from CPUID on Intel, architectural on AMD) - so once the accumulated count approaches the end of the hardware counter range, the counter wraps during a time slice and the value read back at switch out is smaller than the value seeded. The increment was computed assuming a full 64-bit counter: on INVARIANTS kernels a long enough counting run panics with "negative increment" the moment the accumulated count first crosses the hardware counter range, and on other kernels the totals silently lose a full counter range per wrap. Compute the increment modulo the per-class hardware counter width instead, in both places that accumulate switch-out deltas. Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58340
A process-mode PMC's runcount tracks how many CPUs currently have it
loaded in hardware. It is decremented only by the context-switch-out
and process-exit reclaim paths, both of which the scheduler invokes
only for processes flagged P_HWPMC. Detaching a target that still has
the PMC live in hardware dropped the target and cleared P_HWPMC without
taking the PMC off the hardware or dropping the runcount reference, so
the reference leaked. A subsequent release then spun in
pmc_wait_for_pmc_idle() forever waiting for the runcount to reach zero:
on an INVARIANTS kernel this panics ("waiting too long for pmc to be
free"), otherwise it is an unkillable loop holding the hwpmc lock. Any
process able to allocate a PMC can trigger this by attaching a counting
PMC to itself and detaching it before releasing.
Take the PMC off the hardware and drop the runcount reference as part
of detaching, before P_HWPMC is cleared: reclaim it from the detaching
thread's own CPU directly, and, when the detach removes the PMC's last
target, wait for any references held by the target's other threads to
drain while P_HWPMC is still set (they can no longer reload it).
Reviewed by: adrian
MFC after: 2 weeks
Assisted-by: Claude Code (Fable 5)
Differential Revision: https://reviews.freebsd.org/D58342
Some UVC devices (e.g. Logitech C920) expose more than 8 Processing Unit descriptors, causing "too many PU descriptors found!" errors. Increase both limits from 8 to 32 to accommodate such devices.
Import the device quirk system from OpenBSD to handle UVC devices that need special handling. This includes: - UVIDEO_FLAG_ISIGHT_STREAM_HEADER: non-standard streaming header - UVIDEO_FLAG_REATTACH: needs reattach after firmware upload - UVIDEO_FLAG_VENDOR_CLASS: incorrectly reports as vendor class - UVIDEO_FLAG_NOATTACH: device not supported - UVIDEO_FLAG_FORMAT_INDEX_IN_BMHINT: format index in bmHint Add quirks table with known devices and lookup function. Add iSight stream header decoder for Apple iSight cameras. Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56005
A bunch of drivers weren't properly converted. I mistakenly put a call to ieee80211_output_seqno_assign() wherever the crypto header was added, which isn't exactly correct. There are plenty of drivers which don't share enough of their raw and normal transmit path code for that to hold true. So after some manual review, it looks like I've captured the places (outside of iwn(4) which I committed earlier) where I missed ieee80211_output_seqno_assign() calls. * For bwi(4) and bwn(4) I refactored it out into a place that is common enough and happens in the same lock hold window, so it's serialised. * For the rest, it's just plain missing from the raw path. Locally tested: * ural(4) * ral(4) * bwi(4) Differential Revision: https://reviews.freebsd.org/D58098
firewire: add warn-only CRC validation for CSR ROM directories Implemented crom_crc_valid() helper to validate IEEE 1394 config ROM CRC-16 checksums. Skipped root header CRC validation since csrhdr.crc_len cover the entire ROM body which is not fully read at header parse time. Per-directory CRC checks below catch corruption where it needed. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58307
firewire: drain pending xfers after callout stop in detach Removes a TODO that predates the existing drain call. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58308
firewire: force root change when root node is not cycle master capable When a FireWire bus resets, all devices negotiate who is the new boss. when we detect the root node can't be cycle master, we send a PHY config packet that forces a reelection. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58309
firewire: remove dead code across the subsystem Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58310
firewire: replace magic numbers with named constants No functional change. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58311
Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=6d0001d44490 ("nvme: add support for DIOCGIDENT") Reviewed by: bnovkov, imp Differential Revision: https://reviews.freebsd.org/D58357
The uvideo driver freed the mmap buffer (contigmalloc'd) in several paths (VIDIOC_STREAMOFF, last close, detach) without coordinating with the lifetime of existing user-space mmap mappings. This could lead to use-after-free when user-space continued to access the mapped memory after the backing pages had been freed. Fix this by switching from the simple d_mmap callback to d_mmap_single with custom cdev_pager_ops, and by attaching the contig buffer to a single shared vm_object created at REQBUFS time: - uvideo_reqbufs() allocates a uvideo_mmap_state (independent of the softc) and a shared vm_object via cdev_pager_allocate() that spans the whole buffer; the softc holds one reference to it. - uvideo_cdev_mmap_single() simply hands out additional references to that shared object; the requested offset selects which buffer is mapped. The VM system tracks mapping lifetime through the object reference count, so no per-mapping bookkeeping is needed. - uvideo_pg_ctor/uvideo_pg_dtor validate the mapping and free the contig buffer together with the state when the last reference (softc's own or a user mapping) is dropped. - uvideo_pg_fault installs a fictitious page for the backing physical address, following the canonical device-pager pattern: update the passed-in page in place when it is already fictitious, otherwise allocate a fake page and vm_page_replace() the busy placeholder, so that dev_pager_dealloc() does not deadlock. - uvideo_vs_free_frame() drops the softc's reference instead of contigfree()'ing directly; if mappings still exist the buffer stays alive until the last uvideo_pg_dtor(). - VIDIOC_STREAMOFF no longer frees the buffer (per V4L2 spec). - Last close always releases the buffer (deferred if mappings exist). - The mmap_state outlives the softc, so the pager dtor can safely free the buffer even after device detach. Reported by: 章鱼哥 (@aipyapp) (www.aipyaipy.com) Reported by: Chris Jarrett-Davies of the OpenAI Codex Security Team
This fixes an issue with the Solo2 (and likely some of the Nitrokey
family) where hangs would occur with OpenSSH- it issues a CANCEL prior
to closing the device unconditionally, and without draining the read
endpoint we end up seeing the response to that CANCEL the next time
OpenSSH tries to connect. This throws the entire command/response
sequence out of whack.
This call used to break Yubikeys in some situations, but the fix that
landed in 28d85db46b48 ("xhci: Do not drop and add bits in xhci") seems
to have addressed that- presumably we sometimes end up stopping the
command and desyncing at the controller level. This probably implies
that we need a SYNCWRITE HID quirk, but that requires a little more work
in usbhid_sync_xfer() and this doesn't seem to cause any problems in
normal usage.
Reviewed by: aokblast, wulf
Differential Revision: https://reviews.freebsd.org/D58199
Replace bare EINVAL in AMD/IBS allocation and config-validation with EXTERROR(), so a failed pmc(3) allocation names the check and value. Register HWPMC_AMD in exterr_cat.h and the generated filenames.h. Signed-off-by: Andre Silva <andasilv@amd.com> Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne Sponsored by: AMD Pull Request: https://github.com/freebsd/freebsd-src/pull/2180
Annotate validation failures in the PMC syscall handlers (allocate, attach, read/write) with EXTERROR(), so pmc(3) callers see which precondition failed, not a bare errno. Register HWPMC_MOD in exterr_cat.h and the generated filenames.h. Signed-off-by: Andre Silva <andasilv@amd.com> Reviewed by: Ali Mashtizadeh <ali@mashtizadeh.com>, mhorne Sponsored by: AMD Pull Request: https://github.com/freebsd/freebsd-src/pull/2180
vtnet: Retry feature negotiation without offloads A device is permitted to reject an otherwise valid subset of its offered features by refusing to accept FEATURES_OK (VirtIO v1.3, 2.2.2). Apple's Virtualization.framework does this in practice; it treats the offered CSUM/TSO offloads as all-or-nothing, while vtnet's default request contains only part of that group because of hw.vtnet.lro_disable that would drop the guest TSO bits, thus negotiation fails and the device does not attach. If FEATURES_OK is rejected, retry the negotiation once with every offload-related feature stripped. Changing the feature set after a failed FEATURES_OK requires re-initialising from device reset (VirtIO v1.3, 3.1.1), so the retry goes through virtio_reinit(). A NIC without offloads is preferable to no NIC at all. Devices that accept the initial feature set are unaffected, while those that also reject the reduced set continue to fail attachment as before. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: adrian Pull Request: https://github.com/freebsd/freebsd-src/pull/2322
vtnet: Implement VIRTIO_NET_F_GUEST_ANNOUNCE When the device sets VIRTIO_NET_S_ANNOUNCE in the config status field, for example after a VM migrates to a new host, announce the interface's presence on the network so peers and switches learn the new attachment point, then acknowledge the request with the VIRTIO_NET_CTRL_ANNOUNCE_ACK control command, as per VirtIO v1.3, 5.1.6.5.4. The announcement raises iflladdr_event: the stack sends gratuitous ARPs and unsolicited neighbor advertisements for the interface's addresses, and stacked interfaces such as vlan(4) propagate the event and announce theirs as well. The event handlers may sleep, so the work is deferred from the config change interrupt to a task on taskqueue_thread; that context also allows the acknowledgement to be skipped safely if the interface was stopped in the meantime, in which case the device keeps the bit set and the request is re-delivered with the next config change interrupt. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: adrian Pull Request: https://github.com/freebsd/freebsd-src/pull/2322
vtnet: Accept VIRTIO_NET_F_CTRL_RX_EXTRA Although the driver does not issue the extra receive-mode commands accepting the feature is harmless and some devices, notably Apple's Virtualization.framework, offer their control-queue features as a group and refuse FEATURES_OK unless the whole set is acknowledged. Signed-off-by: Faraz Vahedi <kfv@kfv.io> Reviewed by: adrian Pull Request: https://github.com/freebsd/freebsd-src/pull/2322
These kernconfs were missed in the previous commit. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289236 Reviewed by: kib Fixes: https://cgit.freebsd.org/src/commit/?id=f38cbefef8090f3363e5685c5a3b30ffbf1d3ad0 MFC after: 3 days Sponsored by: The FreeBSD Foundation
uvideo: replace contigmalloc with OBJT_PHYS vm_object for mmap buffer Allocate the mmap buffer via phys_pager_allocate() and map it into kernel space with vm_map_find()/vm_map_wire(), instead of a custom cdev_pager backed by contigmalloc. phys_pager_allocate() is required over a bare vm_object_allocate(OBJT_PHYS) to initialise un_pager.phys.ops, otherwise phys_pager_getpages() NULL-derefs during vm_map_wire(). Reviewed by: markj Reported by: markj Differential Revision: https://reviews.freebsd.org/D58394
uvideo: validate frame size before mmap buffer allocation dwMaxVideoFrameSize comes from the USB probe/commit response and is not validated. reqbufs() computed buf_size_total with signed int arithmetic and no bound, so a bogus value could wrap the product to a small size and yield a too-small buffer with a huge sc_mmap_buffer_size, causing out-of-bounds writes from the USB transfer callbacks. Bound the frame size against sc_max_fbuf_size and use overflow-checked size_t arithmetic for the total and per-buffer offsets. Reported by: emaste
uvideo: lock the mmap queue and read path qbuf(), dqbuf() and read() manipulated sc_mmap_q / sc_mmap_cur / sc_frames_ready without sc_mtx, racing with the USB transfer callbacks (producer) that run under the mutex. This could corrupt the queue or trigger use-after-free. Take sc_mtx around qbuf(), use mtx_sleep() and protect the queue operations in dqbuf(), and use mtx_sleep() with a snapshot of sc_fsize in read(). Also reject S_FMT and S_PARM with EBUSY while streaming: both re-negotiate the probe/commit controls with the device, which disrupts the active USB transfers (a second client opening the device would otherwise freeze the first one's stream).
uvideo: bounds-check frame interval reads against bLength Frame interval data is read from device-supplied frame descriptors whose bLength may be shorter than the number of intervals declared by bFrameIntervalType. The continuous branch of uvideo_enum_fivals() read three intervals unconditionally, and the discrete branch checked the pointer but not the four bytes that UGETDW() reads, so a short or malformed descriptor could read past bLength and leak adjacent kernel memory to userspace. uvideo_vs_parse_desc_frame_max_rate() had the same class of off-by-up-to-three-bytes read. Compute the available bytes from bLength and validate before each read. Reported by: emaste
uvideo: track streaming ownership per-fd and free buffers on STREAMOFF The driver shared a single streaming state and buffer pool across all open file descriptors, so a second client (e.g. another browser tab) could disrupt the first: its cleanup STREAMOFF would tear down the active stream, and stale buffers prevented re-acquisition. Add per-fd state via devfs cdevpriv tracking whether this fd started streaming. STREAMOFF and close from a non-streaming fd are no-ops. STREAMOFF from the streaming fd stops the stream and frees the buffers so that a new fd can re-acquire the camera. DQBUF returns EPIPE immediately when buffers are freed instead of waiting for a timeout.
uvideo: fix close/detach race on streaming teardown detach() stopped streaming and called uvideo_vs_close() before destroy_dev(), so a concurrent close() could race the teardown and call uvideo_vs_close() a second time (double usbd_transfer_unsetup), and mtx_destroy() could race a close still holding sc_mtx. sc_streaming was also read without the lock in both paths. Reorder detach() to call destroy_dev() first so all in-flight cdev methods drain before any teardown. Read sc_streaming under sc_mtx in both detach() and the last-close safety net.
uvideo: use size_t for sc_mmap_count and loop index in reqbufs
uvideo: validate frame descriptors and fix integer overflows in size computation
uvideo: fix printf type Reported by: vishwin
Reviewed by: aokblast, kib, olce Differential Revision: https://reviews.freebsd.org/D58336
Some UAC2 devices expose a single Clock Source entity that is shared between their playback and capture interfaces (it appears in both the output and input clock bitmaps). On such a device uaudio(4) programs the sample rate for both directions when a stream starts. If playback runs at a 44.1 kHz-family rate while the idle capture channel is left at its 48 kHz-family default, the capture SET_CUR(UA20_CS_SAM_FREQ_CONTROL) is issued after the playback one and overwrites the rate on the shared clock. The device then runs at ~48 kHz while the playback stream carries 44.1 kHz data. Consuming samples faster than they arrive, the device repeatedly runs out of data, loses sync with the playback stream, and re-locks onto it (audible dropouts, front-panel play/idle flicker). The 48 kHz family is unaffected because both directions then agree on the rate. Fix it in three parts: - Add a shared-clock guard: before issuing SET_CUR to a clock id, if that clock is shared between playback and capture and the other direction is already streaming at a different rate, skip it. The first active stream owns the clock; a later one follows it. - When the recording channel is auto-started only as a source of jitter information for asynchronous playback, align its nominal rate to the playback rate before starting it, so it neither reprograms the shared clock to a conflicting rate nor produces mismatched frame sizes. - Always submit the explicit-feedback SYNC transfer so dev.pcm.%d.feedback_rate stays live as a diagnostic even when a capture stream is present. Reproduced on an OKTO RESEARCH DAC8 STEREO (0x152a:0x88c5), whose vestigial capture interface never streams; the same device plays the 44.1 kHz family correctly under Linux's snd-usb-audio. As a side effect, this patch also fixes the sample rate bug mentioned in the BUGS section of sound(4)'s man page, where a device needs to have the same sample rate set for both playback and recording in order to work properly. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295933 Assisted-By: Claude Opus 4.8 (claude-opus-4-8) Signed-off-by: giacomo <delleceste@gmail.com> MFC after: 2 weeks Reviewed by: christos Pull-Request: https://github.com/freebsd/freebsd-src/pull/2323
The fixed 128 KiB secondary buffer cap dates from stereo-sized streams. High channel-count or high sample-width OSS streams can consume most of that budget in one graph quantum, leaving too little room for capture catch-up or playback headroom. Keep 128 KiB as the low-rate floor, but derive the effective soft-ring cap from the channel byte rate, clamped to 4 MiB. Use that per-channel cap when resizing the soft buffer and when clamping SNDCTL_DSP_SETFRAGMENT requests. Also clamp SNDCTL_DSP_LOW_WATER to the current soft-buffer size so an impossible readiness threshold cannot make poll/select wait forever. MFC after: 3 weeks Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D58064
Prevent infinite loop in uvideo_vs_negotiation() when a USB camera reports step=0 in its continuous frame interval descriptor. Cast fbuf_size calculation to uint64_t to avoid int overflow for large width/height/bpp combinations. Reported by: emaste
Don't coerce errors to EINVAL, which isn't correct for mtx_sleep's failure cases. Sponsored by: The FreeBSD Foundation
Our USB TRB buildup subroutines were previously difficult to follow. In setup_generic_chain_sub(), the routine filled TRB packets based on the characteristics passed by the caller and the current state (for example, whether the TRB was the last in the TD). However, most TRB types (except Normal TRBs) cannot be shared across TDs. To simplify the logic, refactor xhci_setup_generic() so that TRBs are constructed according to their transfer type, with dedicated helper functions for each TRB type. Sponsored by: The FreeBSD Foundation Assisted-by: Claude Code (Opus 4.6, Opus 4.8(1M) and Sonet 5.0) Differential Revision: https://reviews.freebsd.org/D57130
When a USB HID device triggers identify, the grandparent is usbhid on a USB hub. Calling iicbus_get_addr() on a non-iicbus device hits a KASSERT panic. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D58432
Currently, USB request not distinguished different error and always return EIO. However, some error are recoverable or ignorable in userspace. Therefore, we preserve the meaning of different error to userspace then allow userspace to decide how to use the return error. Reviewed by: adrian Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52244
Reviewed by: markj MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56311
e1000: Defer link-up notification until after TSO reset em_automask_tso() changes the enabled TSO capabilities when the link moves between 10/100 and 1000 Mb/s. A running interface must be reinitialized to apply the new capability set. Do not publish LINK_STATE_UP until the requested iflib reset has completed. Replace link_active with an explicit state machine that distinguishes the physical link, its publication to iflib, and an outstanding reset barrier. Preserve that barrier across a link flap with DOWN_RESET_PENDING, and only publish DOWN if UP was previously published. Only request a reset for a running interface or for an initialization while the interface is administratively up. In other states the next initialization will apply the capability changes, avoiding a reset request that iflib's admin task could discard. Reviewed by: Faraz Vahedi <kfv@kfv.io> Fixes: https://cgit.freebsd.org/src/commit/?id=2ddf24f8f525 ("e1000: Automask TSO on lem(4)/em(4) 10/100 Ethernet") MFC after: 1 week
e1000: fix 82574 MSI-X interrupt throttling em_newitr() and the per-queue interrupt_rate sysctl both tested que->msix to decide whether an 82574 is running in MSI-X mode. 0 is a valid MSI-X vector so queue 0 was misclassified as legacy/MSI. Test sc->intr_type == IFLIB_INTR_MSIX instead. While here, index the tx EITR read by tque->msix rather than tque->me so it matches the register em_newitr() actually writes; the two differ once tx_num_queues exceeds rx_num_queues. Also seed que->itr_setting in em_initialize_receive_unit() with the rate the hardware was just programmed with. Otherwise an itr_setting left over from AIM across an interface re-init makes the change detection in em_newitr() suppress the write that would restore it, leaving the hardware at the default rate while software believes otherwise. Fixes: https://cgit.freebsd.org/src/commit/?id=3e501ef89667 ("e1000: Re-add AIM") MFC after: 3 days
e1000: fix rx accounting for multi-descriptor packets The receive paths accumulate ri->iri_len across the descriptors making up a packet, then add that running total to rxr->rx_bytes on every iteration of the loop. A packet spanning descriptors of length l1, l2 and l3 thus contributes 3*l1 + 2*l2 + l3 instead of l1 + l2 + l3. Single descriptor packets, the common case, are accounted correctly, so this only shows up on jumbo frames. Add the per descriptor length instead. iflib memsets the if_rxd_info before each isc_rxd_pkt_get() call, so summing len gives the same total as the final iri_len, and the frame error path that returns without incrementing rx_packets keeps counting bytes exactly as before. MFC after: 1 week
e1000: make AIM counter sampling coherent Sample free-running counters by delta instead of clearing them from the interrupt filter, which can race their producers. Publish byte and packet counts together at the TX and RX doorbells so each sample is coherent. Aggregate every TX ring assigned to the interrupt vector so unequal RX and TX queue counts are safe. Count RX bytes only after a frame is accepted. MFC after: 1 week
e1000: synchronize interrupt moderation state Keep the saved EITR and PBA values synchronized with hardware across reinitialization. Correct EITR encoding, decoding, and MSI-X register selection, and reject nonpositive fallback rates. Treat only sub-gigabit links as sub-gigabit and apply the packet-buffer fallback without permanently disabling AIM. MFC after: 1 week
e1000: restore packet-size AIM Restore the packet-size calculation introduced in a69ed8dfb381 and used by igb(4) until the iflib conversion in f2d6ace4a684. It derives interrupt holdoff from average packet size, so RSS queue count does not change its behavior. The calculation follows the pre-iflib code. Retain the current normal and low-latency rate caps, and keep the current setting when an interval has no usable sample. Fixes: https://cgit.freebsd.org/src/commit/?id=3e501ef89667 ("e1000: Re-add AIM") MFC after: 1 week
e1000: count TSO wire segments in the AIM counters The transmit paths billed one packet of ipi_len bytes per request. For TSO that is the whole unsegmented payload, up to 64KB, so the average size the moderation calculation sees is not a size that appears on the wire. Count the segments the hardware will put on the wire and the header each of them carries. Non-TSO accounting is unchanged. MFC after: 1 week
igc: fix RX accounting for multi-descriptor packets The receive path adds the running packet length to rx_bytes for every descriptor. A packet spanning descriptors of length l1, l2, and l3 is therefore counted as 3*l1 + 2*l2 + l3. Add each descriptor length once. Single-descriptor accounting remains unchanged. MFC after: 1 week
igc: make AIM counter sampling coherent Sample free-running counters by delta instead of clearing them from the interrupt filter, which can race their producers. Publish byte and packet counts together at the TX and RX doorbells so each sample is coherent. Aggregate every TX ring assigned to the interrupt vector so unequal RX and TX queue counts are safe. Count RX bytes only after a frame is accepted. MFC after: 1 week
igc: synchronize interrupt moderation state Keep the saved EITR value synchronized with hardware across reinitialization. Correct EITR encoding, decoding, and MSI-X register selection, and reject nonpositive fallback rates. Apply the packet-buffer fallback without permanently disabling AIM. MFC after: 1 week
igc: use packet-size AIM Use the packet-size calculation introduced for igb(4) in a69ed8dfb381 and retained there until the iflib conversion in f2d6ace4a684. It derives interrupt holdoff from average packet size, so RSS queue count does not change its behavior. The calculation follows the pre-iflib igb code. Retain igc's normal and low-latency rate caps, and keep the current setting when an interval has no usable sample. MFC after: 1 week
igc: count TSO wire segments in the AIM counters The transmit path bills one packet of ipi_len bytes per request. For TSO that is the whole unsegmented payload, up to 64 KiB, rather than a packet size that appears on the wire. Count the segments the hardware emits and the header carried by each segment. Non-TSO accounting is unchanged. MFC after: 1 week
No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
Network-related commands, library, and kernel.
Add FIB selection logic by introducing ifa_ifwithaddr_fib() to support FIB-specific lookups. Then have ifa_ifwithaddr() wrap it with RT_ALL_FIBS. Also, do the same for ifa_ifwithaddr_check(). Reviewed by: glebius, bnovkov Differential Revision: https://reviews.freebsd.org/D58305
Free mbuf and increase IFCOUNTER_IERRORS if ip_ecn_egress() under geneve_input_inherit() decides to drop the packet. Reported by: Chris Jarrett-Davies of the OpenAI Codex Security Team Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D58361
Sponsored by: NetApp, Inc. MFC after: 1 week Reviewed By: tuexen, #transport, markj Differential Revision: https://reviews.freebsd.org/D58360
When a protocol-specific 'bind_all_fibs' tunable is set to 0, a listening socket will only receive traffic originating from the FIB it was bound to. However, there are no checks to determine whether an address exists in the target FIB when binding the socket, which can lead to a situation where a socket and the address it was bound to belong to different FIBs. Prevent this footgun by looking up the requested address in the current FIB if 'bind_all_fibs' is active and returning an error if the address does not exist. Sponsored by: Stormshield Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D58281 Reviewed by: glebius, pouria, markj MFC after: 2 weeks
In practice, this is not possible, but we are adding it just to be safe. Reported by: markj
pf(4) currently ignores fragment direction (in vs. out)
in pf_frnode_compare() function.
Issue noticed and reported by Frank Denis
OK @bluhm
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, eaa2c80721
Sponsored by: Rubicon Communications, LLC ("Netgate")
Outbound packet which matches rule with source limiter attached,
for example:
source limiter "crash" id 1 entries 10000 limit 1000
pass out from any to any source limiter "crash" keep state
triggers a NULL pointer dereference.
The issue was kindly reported and initial version of fix
submitted by SecBuddyF, Tencent KeenLab.
The submitted diff fixed the issue for failing look up by destination
address in outbound packet. dlg@ also pointed out the change should
be further improved so NULL pointer dereference is avoided when rule
uses nat-to/rdr-to option.
OK dlg@
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, f0f215c11e
Sponsored by: Rubicon Communications, LLC ("Netgate")
The latest version of draft-ietf-tcpm-tcp-ghost-acks changed a condition. This should make no substantial difference, but makei it compliant to the latest version of the specification. Reviewed by: rscheff, Peter Lei MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D58411
During call to `icmp_verify_redirect_gateway()` ensure using fib-aware source address selection function. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D58409
When we drop the prefix lock to call nd6_prefix_offlink() or nd6_prefix_onlink(), make sure to keep the correpsonding prefix structure alive. It is possible for a concurrent nd6_timer() to expire the prefix while the lock is dropped. Reported by: Maik Muench of Secfault Security Reviewed by: pouria, zlei MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58423
Stuff in man section 8 (other than networking).
hwpmc: add regression tests for counting-PMC counter wraparound Exercise a process-mode counting PMC whose accumulated count crosses, or already exceeds, the range of the underlying hardware counter. Before the previous commit, the first context switch after the hardware counter wrapped panicked INVARIANTS kernels with "negative increment" and silently corrupted the accumulated count on other kernels. The tests need a hardware counting event backed by a counter narrower than 64 bits and skip where none is available (hwpmc(4) not loaded, or a VM without a vPMU). Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58341
tests/sys/pmc: only build if MK_PMC != no This unbreaks the build when pmc support is explicitly disabled via the aforementioned build knob. MFC after: 10 days Fixes: https://cgit.freebsd.org/src/commit/?id=2cfd82f74 ("hwpmc: add regression tests for ...") Differential Revision: https://reviews.freebsd.org/D58401
vt(4) does not (currently) support changing the video mode. Report that -i mode is not supported rather than printing an empty list. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207411 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58163
The max_qentries in pci_nvme_softc is uint16_t and too large int may get truncated to invalid value. While there, use local declarations for val. Suggested by: Bill Sommerfeld Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D58293
Firmware on a test machine applied NX to non-code allocations, which resulted in a fault when jumping to the trampoline. Reviewed by: kib Tested by: Jim Huang Chen <jim.chen.1827@gmail.com> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58383
MFC after: 1 week
Commit 9e1db51d4b5fc made nvmecontrol devlist get list of active namespaces from the device instead of iterating through all possible IDs. The problem is that this request is not supported before NVMe 1.1, and in particular by Intel Optane 905P drives. This change reintroduces iteration for devices before NVMe 1.2. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D58010
* Get rid of the pointless LOCALBASE_CTL_LEN mechanism * Apply minimal normalization to the paths obtained from the environment or sysctl variable * Turn the manual page into a manual page * Add tests MFC after: 1 week Reviewed by: se Differential Revision: https://reviews.freebsd.org/D58362
MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=2a5e58c59694 ("procdesc: add NOTE_PDSIGCHLD") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D58388
Introduce a generic Netlink attribute decoding framework based on attribute decoder tables. The framework supports decoding primitive attribute types as well as nested attributes and can be reused by different Generic Netlink families. Signed-off-by: Ishan Agrawal <iagrawal9990@gmail.com> Sponsored-by: Google LLC (GSoC 2026) Reviewed-by: kp Pull-Request: https://github.com/freebsd/freebsd-src/pull/2337
Sponsored by: The FreeBSD Foundation
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57898
If the server is closing (or the device node is going away), or if
devfs_set_cdevpriv() fails, cuse_client_open() returns with the server
reference taken at the top of the function still held and the newly
allocated client still linked on pcs->hcli. Since cuse_client_free()
has not been registered as the cdevpriv destructor at that point,
nothing ever undoes this work: every open() that races the is_closing
window permanently leaks one server reference and one cuse_client.
A leaked reference is fatal on server exit: cuse_server_free()
busy-waits in an uninterruptible pause("W", hz) loop until pcs->refs
drops to 1, which now never happens, so the exiting server process
(e.g. virtual_oss(8)) is left wedged in state "D", immune to SIGKILL,
cuse.ko is pinned (kldunload hangs too), and only a reboot recovers.
Before 634e578ac7b0 the is_closing error path dropped the reference by
calling devfs_clear_cdevpriv(), which ran the cuse_client_free()
destructor. That commit moved devfs_set_cdevpriv() after the
is_closing check to fix the panic paths, but left both error returns
without any cleanup.
Fix by calling cuse_client_free() directly on both error paths. The
client is fully constructed and linked on pcs->hcli at these points,
which is exactly the state cuse_client_free() expects.
PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296291
Fixes: https://cgit.freebsd.org/src/commit/?id=634e578ac7b0 ("cuse: Fix cdevpriv bugs in cuse_client_open()")
Assisted-By: Claude Opus 4.8 (claude-opus-4-8)
Signed-off-by: giacomo <delleceste@gmail.com>
MFC after: 2 weeks
Reviewed by: christos
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2324
Kernel stuff (other than networking, filesystems, and drivers).
procdesc: report NOTE_PDSIGCHLD for traced and stopped process on attach of the knote. It is same as for NOTE_EXIT when attaching to the exiting process. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58327
kqueue: Fix delivery of unwanted events In both procdesc_kqops_event() and filt_proc(), the event variable can have more than one bit set. This means that: * We cannot compare it directly with NOTE_EXIT; we must binary-and them instead. * We cannot binary-or it with the report mask; we must binary-and it with the request mask first. MFC after: 1 week Fixes: https://cgit.freebsd.org/src/commit/?id=2a5e58c59694 ("procdesc: add NOTE_PDSIGCHLD") Fixes: https://cgit.freebsd.org/src/commit/?id=b328975b9d7c ("procdesc: report NOTE_PDSIGCHLD for traced and stopped process") Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D58395
When transferring a thread with near 100% CPU statistics (but not 100%; up to 57.5/59≈97.46%) to a CPU where the enqueue offset is ahead of at least 2 from the dequeue one, which requires peculiar conditions to happen (transfer triggered by a bind request or cpuset change, or during balancing if a thread or more existed from a brief amount of time on the origin CPU), the transferred thread can get placed after the dequeue offset, effectively making it appear as a high priority one unduly, causing latency increase for other threads. The change here was missed when changing the enqueue and dequeue offsets update mechanism to recover pre-256-queue-runqueue ULE anti-starvation and fairness behavior. That change opened up the possibility that these two offsets are apart by more than one. Reviewed by: markj Discussed with: Minsoo Choo <minsoo@minsoo.io> Fixes: https://cgit.freebsd.org/src/commit/?id=6792f3411f6d ("sched_ule: Recover previous nice and anti-starvation behaviors") MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57829
Different command sets have different encoding for op codes, etc. While one can normally puzzle out which is which, it's better to explicitly tag the command set used. Sponsored by: Netflix
ptrace(2): add PT_GET_CHILDREN Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58315
kern/sys_ptrace: do not skip P2_PTRACEREQ wait for PT_CLEARSTEP/PT_GET_CHILDREN Reported and reviewed by: markj Fixes: https://cgit.freebsd.org/src/commit/?id=d3b7bbee9275 ("ptrace(2): add PT_GET_CHILDREN") Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58364
amd64: FRED support FRED support as defined starting from the SDM rev. 90, requires a new 'events' entry point to receive user and kernel mode exceptions and interrupts notifications from the hardware. A minimal asm trampoline is enough, rest can be implemented in C due to the clean FRED organization of the event reporting. The syscall entry is handled by a microptimized assembly path, directly calling into the amd64_syscall() handler, instead of the generic events entry point. Tested by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D55829
amd64: Fix an off-by-one in the fred_ipi_handlers definition Fixes: https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D58378
amd64: Remove a prototype for an unimplemented function Fixes: https://cgit.freebsd.org/src/commit/?id=6e93f5e4d693 ("amd64: FRED support") Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D58379
Return the covered vnode instead. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D58191
We introduced (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE) as part of
ESTCPULIM() in commit eebc148f25c3 ("sched_4bsd: ESTCPULIM(): Allow any
value in the timeshare range") in order to use more than a fixed number
(40) of all the available priority levels in the timeshare range (136
before the 256-queue runqueue work, 224 now) to take into account the
number of ticks a thread has run ('ts_estcpu').
In the computation of a new thread's priority (resetpriority()), in
addition to the "ticks running" contribution, the final priority also
includes a "nice" value contribution. The final value is clamped into
the [PRI_MIN_TIMESHARE; PRI_MAX_TRIMESHARE] range.
Problem is that the new "ticks running" contribution now can lead to
a computed priority value that exceeds PRI_MAX_TRIMESHARE, and is thus
finally clamped to PRI_MAX_TIMESHARE, which becomes an alias for all
out-of-bound values. In particular, this can conflate CPU-hungry
threads. With at least two of them competing on the same CPU, with an
increase of 'ts_estcpu' of ~64 per second (stathz being 127) and the
minimal decay of 4/5 (load average 2 or more), both threads will easily
reach the current clamping of 224 (+ PRI_MIN_TIMESHARE), and be
considered indifferently by the scheduler.
Fix this problem by ensuring that the maximum contribution of
'ts_estcpu' (via ESTCPULIM()) cannot exceed the timeshare range of
priorities when the nice contribution is added to it, so the nice
contribution continues to have an effect on CPU-bound threads.
Introduction of the nice term in ESTCPULIM() (then NICE_WEIGHT *
PRIO_MAX) has been done in commit bdf423572ee3 ("Scheduler fixes
equivalent to the ones logged in the following NetBSD commit...") and
does not appear to have made any real sense even then.
Fixes: https://cgit.freebsd.org/src/commit/?id=bdf423572ee3 ("Scheduler fixes equivalent to the ones logged in the following NetBSD commit...")
Fixes: https://cgit.freebsd.org/src/commit/?id=eebc148f25c3 ("sched_4bsd: ESTCPULIM(): Allow any value in the timeshare range")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57826
The INVERSE_ESTCPU_WEIGHT scaling had been introduced by commit
b698380f33ef ("Quick fix for scaling of statclock ticks in the SMP
case. ...") to leave more discrimination room for multiple CPUs possibly
adding their ticks to the same 'struct ksegrp' (but also slightly
changing how CPU hogs are penalized).
Then, commit 8460a577a4b4 ("Make KSE a kernel option, ...") introduced
the current thread-based code, where tick accounting is only done on the
current thread, which renders this trick obsolete on !KSE.
Finally, when KSE was removed, the trick became generally obsolete.
The trick is actually even harmful because it changes the intended
behavior of priorizing more the CPUs that use the less ticks (and so,
impairs boosting "interactive" processes).
Remove it now. Clamping of 'ts_estcpu' and its relation to the
load-average-based decay may be re-examined later.
Fixes: https://cgit.freebsd.org/src/commit/?id=8460a577a4b4 ("Make KSE a kernel option, ...")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57827
In an upcoming change whose purpose is to stop having 4BSD always
allocate MAXCPU runqueues, wasting space on most machines, 'struct
td_sched' will store the CPU ID to which a thread is bound/pinned
instead of a pointer to the corresponding runqueue. As a consequence,
existing functions manipulating a thread's runqueue will need to point
to the inferred runqueue through a local variable. The name 'runq' is
the ideal one for these local variables, but before this change it
designated the global runqueue, also causing unnecessary ambiguity.
Thus, rename the global runqueue to the more explicit 'runq_global'.
Arguably, this should have been performed as part of commit e17c57b14ba9
("- Implement cpu pinning and binding. (...)").
No functional change (intended).
[olce: Massaged the commit message. Tested with source builds.]
Suggested by: olce
Reviewed by: olce
Tested by: olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58065
4BSD has been allocating an array of MAXCPU runqueues, runq_pcpu[],
instead of one runqueue per actually present CPU. On amd64, MAXCPU is
1024 and 'struct runq' is 4128 bytes, causing runq_pcpu[] to take more
than 4 MiB of memory. On the vast majority of current systems, which
have at most 32 cores with SMT, this is a waste of memory.
Besides providing per-CPU runqueues, runq_pcpu[] has also been used to
determine the CPU ID of a given thread's associated runqueue through
pointer arithmetic.
Since per-CPU structures are only allocated for present CPUs, in order
to save space, move the runqueues to per-CPU fields and, for each thread
('struct ts_sched'), replace its runqueue pointer by the CPU ID of the
runqueue it is in (new 'ts_rqcpu' field). Set the thread's CPU ID to
the special NOCPU value when it is running on the global runqueue.
Drop the SKE_RUNQ_PCPU() macro as it is now simply equivalent to
'ts_rqcpu != NOCPU'. Introduce the TS_RUNQ_PTR() macro to get a pointer
to the thread's runqueue, which must be passed to runq_add() and
runq_remove().
[olce: Massaged the commit message. Fixed an inverted KASSERT().
Tested with source builds.]
Reviewed by: olce
Tested by: olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D58000
We would lock the downcalls during normal operation but not during vap (vif) creation as there was no need for locking. Add the missing locking there as drivers seem to always expect it (by assertion) and cannot distinguish between state. Add the assertions to the downcalls as we need both of them locked and both of them can sleep. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296185 ("rtwhttps://bugs.freebsd.org/bugzilla/show_bug.cgi?id=89(https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=4) freezes the system with INVARIANTS kernel") Debugged by: Artem Bunichev (temcbun gmail.com) Sponsored by: The FreeBSD Foundation MFC after: 3 days
Allow userland, in particular test cases for EXTERROR conversions, to detect at run time whether extended errors include the descriptive message strings, which depends on the EXTERR_STRINGS kernel option and cannot be probed in any other way. Reviewed by: kib MFC after: 1 week Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58321
On a test system with 1024 cores the size of exec map exceeds 4GB, and all of the operands in the size calculation are 32-bit integers. Tested by: Jim Huang Chen <jim.chen.1827@gmail.com> MFC after: 1 week Sponsored by: AMD (hardware)
Also be more protective in getsid(). Reported by: arrowd Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differrential revision: https://reviews.freebsd.org/D58393
LinuxKPI: pci: fix dma handle type in match function dma_addr_t is a vm_paddr_t which is a uint of some width. Rather than passing pointers of it around pass the value. Comparing the addresses of different storage for the same dma handle (the actual bug here) will not work when passed to the devres match function. Sponsored by: The FreeBSD Foundation Fixes: https://cgit.freebsd.org/src/commit/?id=0a575891211ef ("implement dmam_free_coherent()") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D58285
LinuxKPI: sg_page() remove superfluous () Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D58295
LinuxKPI: move clear_page() within the linux/page.h file clear_page() would normally live in asm/page.h but adding the file and fixing the dependencies would be too much for a single line. Move the function to the end of the file with a clear separator and make it clear that it does not operate on a 'struct page' but on a page address by changing the argument name and leaving a comment. The function is currently used by at least mthca(4) as the only in-tree consumer, and drm-kmod ttm_pool.c. No functional changes. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D58296
LinuxKPI: prefer struct page [*] over struct vm_page[_t] LinuxKPI is based on Linux 'struct page' which is currently aliased to struct vm_page. Upcoming changes may change that so start using 'struct page *' instead vm_page_t to make future changes transparent. This is a continuation of 9e9c682ff3a1 and should be a NOP. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste (no objections) Differential Revision: https://reviews.freebsd.org/D58297
LinuxKPI: page.h: use atop() and ptoa() instead of PAGE_SHIFT With upcoming changes to 'struct page' this will make the lines easier to read by using the predefined macros from param.h. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D58298
LinuxKPI: page.h: resort lines Two of the "page macros" can be abstracted elsewhere in the upcoming struct page work, so sort them away from the four which are here to stay. No functional change. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D58299
LinuxKPI: page pool updates and add to the build Split implementation out from the header files. This "page pool" is the very minimalistic version we need in order to support packets on mt76. We allocate the page pool in order to have the meta data available of which we only make limited use. This implementation does no pooling, it does no page fragments for now, it always hands out a full page and frees it upon return. It is written in a way that it can be in the tree before the 'struct page' work it depends on has landed in order to reduce friction for people who want to try mt7921 (or others later) upfront. We use the same #ifdef as in the struct page work for that reason so one knob will turn everything on or off. Once the struct page work has landed and settled we can start filling this with more complexity. In the unlikely event that in the mean time any other consumer would start showing up they will have to be aware that the current code as-is essentially is a NOP without the 'struct page' work. A WARN_ONCE() will notify them. Sponsored by: The FreeBSD Foundation MFC after: 3 days
Fixes: https://cgit.freebsd.org/src/commit/?id=963629923308 ("kthread_add(): do not allow to attach the thread to a dead or dying process") Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58433
Reported by: Maik Muench of Secfault Security Reviewed by: kib Fixes: https://cgit.freebsd.org/src/commit/?id=1ad21a652182 ("kern: add pddupfd(2)") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58403
The FD_RESOLVE_BENEATH flag is supposed to be sticky. It's set when you receive an fd from a different jail and preserved by openat(<dfd>) etc.. However, if you send the fd to yourself, the flag is stripped since SCM_RIGHTS message don't preserve file descriptor flags. Fix this by preserving those flags and checking for UF_RESOLVE_BENEATH in restrict_rights(). Fixes: https://cgit.freebsd.org/src/commit/?id=350ba9672a7f ("unix: Set O_RESOLVE_BENEATH on fds transferred between jails") Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58317
As far as I can see, it is impossible for procdesc_exit() to observe pd->pd_fpcount == 0: if procdesc_close() decrements that counter to zero, then it will clean up the procdesc structure too, and this is atomic with respect to the proctree lock. No functional change intended. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58396
The scan marker was originally stack-allocated. In commit 1c0f9af5b5224, it became heap-allocated since the marker is visible to other threads and a scanning thread's stack may be swapped out. Now that kernel stacks can no longer be swapped out, we can avoid these heap allocations. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58402
uma: Factor out the implementations of uma_zfree_{arg,smr}()
The two function both free an item to a UMA zone, but uma_zfree_arg()
does so in such as way as to ensure that the item will be the first one
returned by a subsequent allocation, while uma_zfree_smr() must defer
reuse of the item and therefore never frees to the per-CPU alloc bucket.
When KASAN is enabled, we actually want uma_zfree_arg() to behave like
uma_zfree_smr(): to improve the reliability of use-after-free detection,
reuse of the newly freed item should be deferred for some time.
Refactor a bit to make it easier to improve KASAN along these lines:
introduce two helper functions, cache_free_item() and cache_free_smr(),
which handle most of the work of interacting with the per-CPU caches.
A subsequent commit will let uma_zfree_arg() use cache_free_smr() when
KASAN is enabled.
No functional change intended.
Reviewed by: rlibby
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58268
uma: Make an effort to defer reuse of items when KASAN is enabled When KASAN is configured, make uma_zfree_arg() free items to the per-CPU free bucket, rather than to the alloc bucket. This means that the item won't be recycled immediately the next time a thread goes to allocate an item from that zone on the same CPU. In other words, the item will stay in a quarantine state longer, which helps make KASAN's use-after-free detection more reliable. Reviewed by: rlibby MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58269
uma: Avoid allocating from free buckets when KASAN is enabled When uma_zalloc_arg() hits an empty alloc bucket in the per-CPU cache, it tries swapping the alloc and free buckets in the hope that the free bucket has some items available. If not, it has to lock the zone. Disable this behaviour when KASAN is configured in order to further defer reuse of freed items. This forces a free item to go to the per-domain full bucket cache before it becomes accessible to the allocator. Reviewed by: rlibby MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58270
uma: Enqueue full buckets in FIFO order when KASAN is configured We want to defer reuse of free objects, and this is a trivial way to promote that. Suggested by: rlibby Reviewed by: rlibby, alc MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D58312
This makes it easier to grep for the error message to better understand the call stack when loading firmware modules fails. Fix a cosmetic-only style(9) bug while here in the same function related to another logging message. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D58380
If something goes very badly (e.g. forcibly removing a medium while the OS tries to start it), this could end up in params.blksize being 0 (and params.disksize 1). Avoid an integer divide fault, panicking the kernel, by bailing out before. MFC after: 3 days
We defined CONFIG_DEBUG_FILE only in libwpautils, not in wpa_supplicant, so all it did was enable code that never got called. Enable it at the top level so it also applies to wpa_supplicant(8), and the -f option mentioned in the manual page now actually works. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281617 MFC after: 1 week Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D57723
The ssh-sk-helper utility only functions if/when MK_USB == yes. Installing it on systems where MK_USB == no doesn't make sense. Differential Revision: https://reviews.freebsd.org/D58246
git-mfc: Slightly relax the regex used to search for reverts Prompted by commit 9dfaf1cb37f8ac89cf in FreeBSD src. Reported by: des
git-mfc: Let the upstream for PRERELEASE branches be main Such branches are in code slush but are the same as stable branches for the purpose of MFCs.
git-mfc: Improve handling of remotes If we can't figure out which remote to use, print a useful error instead of assuming that "freebsd" is the right remote to use.
Attach a process-mode counting PMC to the current process, start it, then detach and release it while it is still loaded on the hardware - the case that previously leaked the PMC's runcount reference and wedged pmc_wait_for_pmc_idle() at release. A second case does the same from a multi-threaded process so the sibling threads' references have to be drained too. The tests need an allocatable process-mode counting event and skip where none is available (hwpmc(4) not loaded, or a VM without a vPMU). Reviewed by: adrian MFC after: 2 weeks Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58343
stress2: Updated the exclude file
stress2: Added a comment
stress2: Added a regression test
Skip the message-content check on kernels that do not advertise the exterr_strings feature, and pin the output format by clearing EXTERROR_VERBOSE. Reviewed by: kib MFC after: 1 week Assisted-by: Claude Code (Fable 5) Differential Revision: https://reviews.freebsd.org/D58322
This requested fix[0] was not complete before the change was committed. Cleans up this error message when running tests[1]: "Cannot 'start' ipfilter. Set ipfilter_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'." [0] https://reviews.freebsd.org/D21065?id=60288#inline-131488 [1] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28917/testReport/sys.netpfil.common/rdr/ipfnat_local_redirect/ Fixes: https://cgit.freebsd.org/src/commit/?id=f97a8a36153a9 MFC after: 3 days Sponsored by: The FreeBSD Foundation
This keeps the skipped test message consistent with others. Reviewed by: netchild MFC after: 3 days Sponsored by: The FreeBSD Foundation
The time_unit test case uses PID 1 as a target for pwait. This doesn't work in a jail. Since all we need is a process that we know won't die while the test is running, we may as well use ourselves. MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D58418
The function create_staticobj() is only used inside this translation unit. Clang produces a -Wmissing-prototypes warning during standard buildworld. This warning will become a fatal compile error if MK_WERROR is enabled for hardened builds. PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285870 Fixes: https://cgit.freebsd.org/src/commit/?id=ee9ce1078 ("libc: tests: add some tests for __cxa_atexit...") Signed-off-by: Zhang Qiyue <peter-open-source.probing805@aleeas.com> Reviewed-by: ngie Pull-Request: https://github.com/freebsd/freebsd-src/pull/2321
This change converts the longhand form of `extern "C" {` and its
corresponding `}` into `__BEGIN_DECLS` and `__END_DECLS`, respectively.
The new form is much easier to grep for and is a best practice to use in
the FreeBSD tree.
This is meant to be a non-functional change.
MFC after: 1 week
These could go in other categories, but it's more clear if they're here instead.
if administrator mistakenly types into configuration file anchor=authpf_test where 'authpf_test' is followed by white space, the authpf(8) is going to use anchor 'authpf_test ' instead of the 'authpf_test' which is defined in pf.conf(5) as 'anchor authpf_test/*' issue kindly reported and patch submitted by Avinash Duduskar <avinash.duduskar (_at_) gmail (_dot_) com> OK sashan@ PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296958 MFC after: 1 week Obtained from: OpenBSD, sashan <sashan@openbsd.org>, 2d12a8e44d Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D58333 Approved by: ivy MFC after: 3 days Changelog: https://github.com/vstakhov/libucl/releases/tag/0.9.4
Add -P as shorthand for --pause-before-cleanup. MFC after: 1 week Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D56613
Release notes at
https://community.nlnetlabs.nl/t/unbound-1-25-2-released
Merge commit 'c68e7bcd81d62e9f5364c6da22fd9917976acf85'
Security: CVE-2026-14586
Security: CVE-2026-32665
Security: CVE-2026-40691
Security: CVE-2026-41637
Security: CVE-2026-42955
Security: CVE-2026-44621
Security: CVE-2026-44687
Security: CVE-2026-44690
Security: CVE-2026-46582
Security: CVE-2026-50045
Security: CVE-2026-50046
Security: CVE-2026-50243
Security: CVE-2026-50248
Security: CVE-2026-50251
Security: CVE-2026-50252
Security: CVE-2026-52863
Security: CVE-2026-54478
Security: CVE-2026-55708
Security: CVE-2026-55717
Security: CVE-2026-55973
Security: CVE-2026-55990
Security: CVE-2026-55991
Security: CVE-2026-56416
Security: CVE-2026-56444
-- no commits in this category this week --
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-08-04 17:42:40+00:00.
This work is supported by Tarsnap Backup Inc.
Alternate version: 2026-07-20 (debug) (contains info about the classification)