FreeBSD git weekly: 2026-08-17 to 2026-08-23

Introduction

This is a display of mostly-automatically-classified git commits from 2026-08-17 to 2026-08-23.

Table of contents and commits per category:

(3) Highlighted commits (these are copies, not in stats)
2 1.3% Userland programs
2 1.3% Documentation
66 42.0% Hardware support
9 5.7% Networking
17 10.8% System administration
10 6.4% Libraries
3 1.9% Filesystems
17 10.8% Kernel
3 1.9% Build system
2 1.3% Internal organizational stuff
8 5.1% Testing
13 8.3% Style, typos, and comments
2 1.3% Contrib code
3 1.9% Reverted commits
0 0.0% Unclassified commits
157 100% total
Technical notes about this page

Highlighted commits

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.

fts: add fts_openat() API
Add fts_openat() as a new entry point for fts(3).

When dirfd is AT_FDCWD the behaviour is identical to fts_open().
Passing a pre-opened directory fd allows fts traversal inside
Capsicum capability mode where path-based operations are not
permitted.

Capability mode users should use fts_parent->fts_dirfd + fts_name with
openat(2) to access files.

Reviewed by:    asomers
Relnotes:       yes
Sponsored by:   Google LLC (GSoC 2026)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2273
9aed7a7745512ca098cc2b247cef61ad57d63204 Jitendra Bhati 2026-06-12 20:48:17
shmfd: consistently return size in 512 byte blocks for fstat(2) st_blocks
This is ABI-breaking change that could be considered as the bug fix.

Requested by:   David Timber <dxdt@dev.snart.me>
Reviewed by:    emaste, markj
Sponsored by:   The FreeBSD Foundation
Relnotes:       yes
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58942
3a1bf59d195ced99c0f69774969d7090d21f6097 Konstantin Belousov 2026-08-19 02:27:46
chflags: use Capsicum capability mode
Run the file-hierarchy traversal inside Capsicum capability mode
using the fts_openat(3) API.  This confines chflags to the directory
hierarchies named on the command line, so a malicious or buggy tree
cannot redirect it at files elsewhere via a crafted symbolic link.

Because AT_FDCWD is rejected in capability mode, a directory descriptor
for the parent directory of every argument with an absolute path or a
path containing ".." is opened once before cap_enter().  Once every
descriptor is open, cap_enter() is called and the traversal acts through
fd-relative operations: chflagsat(fts_parent->fts_dirfd, fts_name).

With -L chflags follows symbolic links, which may point outside the
named hierarchy; chflag now rejects such accesses.  The new
--dereference-links-unsafely option disables the sandbox to restore the
historical behavior for the rare callers that rely on it.  But if the
symbolic was link was named directly on the command line, chflags will
still follow it (unless -h was given).

Add functional tests covering relative, absolute, "..", recursive
and mixed path arguments, and the symlink handling in both the
default and --dereference-links-unsafely modes; they skip on
filesystems that do not support the uchg flag.

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
Relnotes:       yes (for the -L behavior change)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2375
22df19c09af64dc8711ee62796ba4cf3e7e4824f Jitendra Bhati 2026-08-18 21:46:01

Userland programs

Commits about commands found in man section 1 (other than networking).

yes: Avoid static initialization
Our buffer is half a megabyte, but we are only initializing the first
two bytes.  Switching from static to dynamic initialization moves it
from .data to .bss, greatly reducing the size of the binary.

Fixes:          https://cgit.freebsd.org/src/commit/?id=cf74b63d61b4 ("yes: Completely overengineer")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D58890
557ba0c2a5138ce026c0ea9cb02f374f97378b7c Dag-Erling Smørgrav 2026-08-17 16:04:35
chflags: use Capsicum capability mode
Run the file-hierarchy traversal inside Capsicum capability mode
using the fts_openat(3) API.  This confines chflags to the directory
hierarchies named on the command line, so a malicious or buggy tree
cannot redirect it at files elsewhere via a crafted symbolic link.

Because AT_FDCWD is rejected in capability mode, a directory descriptor
for the parent directory of every argument with an absolute path or a
path containing ".." is opened once before cap_enter().  Once every
descriptor is open, cap_enter() is called and the traversal acts through
fd-relative operations: chflagsat(fts_parent->fts_dirfd, fts_name).

With -L chflags follows symbolic links, which may point outside the
named hierarchy; chflag now rejects such accesses.  The new
--dereference-links-unsafely option disables the sandbox to restore the
historical behavior for the rare callers that rely on it.  But if the
symbolic was link was named directly on the command line, chflags will
still follow it (unless -h was given).

Add functional tests covering relative, absolute, "..", recursive
and mixed path arguments, and the symlink handling in both the
default and --dereference-links-unsafely modes; they skip on
filesystems that do not support the uchg flag.

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
Relnotes:       yes (for the -L behavior change)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2375
22df19c09af64dc8711ee62796ba4cf3e7e4824f Jitendra Bhati 2026-08-18 21:46:01

Documentation

Man pages, release notes, etc.

mdoc: Standardize SYNOPISIS section for drivers
Standardize driver manuals on the style used for 12 years in vt(4).
This brings SYNOPSIS across all FreeBSD manual sections into harmony
of meaning where where SYNOPSIS lists available options, and does not
contain prose. Adjust mdoc(7) to reflect the established convention.

Reviewed by:    jhb
Discussed with: arch@ (marc.info/?l=freebsd-arch&m=176782215606871)
Differential Revision:  https://reviews.freebsd.org/D54586
d383c870f7fe20b67278184df54953a49189fca3 Alexander Ziaee 2026-08-17 16:07:54
bnxt(4): Cross-reference led(4)
Point the identification LED documentation to led(4), which describes
how to control /dev/led device nodes.

MFC after:      2 weeks
Sponsored by:   BBOX.io
af069400a8ea514c8e55f123cae478aee65e04d5 Kevin Bowling 2026-08-18 00:33:46

Hardware support

Hardware drivers and architecture-specific code.

asmc: prefer MMIO backend over PIO when both are present
T2, T1, and some pre-T1 Macs advertise a legacy PIO
range in the SMC ACPI _CRS alongside a live MMIO window, but the
silicon behind the PIO range is bogus.

Try MMIO first, validate via LDKN >= 2, fall back to PIO if that
fails or no MMIO resource is present. Drop "(T2)" from the backend
message since MMIO isn't T2-exclusive.

MFC: 1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D58839
37826269b41b46c72264191d35b09baf24e055b9 Abdelkader Boudih 2026-08-17 03:12:00
ix(4): Remove workaround for 2.5/5G speeds on E610
The problem observed on X550 adapters with 2.5 and 5 Gbps speeds
negotiation on some switches is not affecting E610 adapters.
Remove workaround, which omitted those speeds in the list
of initially advertised speeds and advertise all speeds
supported by adapter.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:    kbowling
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 week
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D57339
62d5d119ee7d935ac05966f1c7c4333c33c4f3a9 Krzysztof Galazka 2026-08-17 09:17:46
ice(4): Add two more 4-part IDs for E835 adapters
Two additional subdevice IDs were introduced
to distinguish between adapters with and without
manageability over USB support.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka@intel.com>

Reviewed by:    erj
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 week
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D57337
f370d9e4d5844daa06d77e57236e03bd7c5f4ba1 Krzysztof Galazka 2026-08-17 15:46:39
snd_hdspe: Avoid allocation in the interrupt handler
Cache PCM children and drain interrupt callbacks before detach.
Allocate the parent softc by its actual size.

Reviewed by:    br
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58370
4c1004c00ff250f2a9e5bff5ae90c25d6b70feb3 Kevin Bowling 2026-07-21 03:31:57
ice: Add led(4) identification support
Expose the firmware-controlled physical port identification LED
through /dev/led/ice*.  Use the AdminQ port-identification command to
select blinking mode and restore the netlist-selected original mode
before the interface is stopped.

MFC after:      2 weeks
Sponsored by:   BBOX.io
a781965b91ea390f9576ae42c35c842db74aab86 Kevin Bowling 2026-08-12 01:29:31
Commit group #0: ufshci
ufshci: return the real errno from SDB queue construction

ufshci_req_sdb_cmd_desc_construct() and ufshci_req_sdb_construct()
returned ENOMEM for every failure, so an EINVAL from bus_dma_tag_create()
was reported as a memory shortage. Capture and return the real errno,
and drop the cmd descriptor construct's now pointless out label.

No functional change: no caller inspects the value beyond propagating
it, so this only improves the diagnostics on an attach failure.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58815
a508a9f7238828fb5fb0f68e9f5df7d24072d6c2 Jaeyoon Choi 2026-08-18 04:48:56

ufshci: pass the queue being destroyed to the cmd descriptor teardown

ufshci_req_sdb_destroy() hardcoded &ctrlr->transfer_req_queue when
destroying command descriptors instead of using its req_queue argument.

No functional change: the branch only runs for the transfer queue, so
the two pointers are always the same today. Using the argument keeps
the function queue-agnostic for when more transfer queues exist (MCQ).

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58816
dbcebc7c661e961ea6e72ef77e29675aca86ab4b Jaeyoon Choi 2026-08-18 04:50:27

ufshci: validate the CDB before allocating a request

The CDB pointer and length checks depend only on the CCB, so perform
them before allocating and initializing the request. This avoids a
wasted allocation for invalid CCBs on the I/O path and removes one
request-free error path.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58817
f3c3db35d545bb14b96e4cb079312c377247540b Jaeyoon Choi 2026-08-18 04:51:42

ufshci: consolidate the device query submit/poll pattern

The six query helpers duplicated the same submit, error check, poll,
and status check sequence. Move it into ufshci_dev_send_query() so
future changes to the query flow are made in one place. This also
unifies the failure log message format.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58818
e1aa173f812010675005e2917d7b2b44ee4a226e Jaeyoon Choi 2026-08-18 04:52:54

ufshci: correct the crypto/config register offsets and HCMID fields

The reserved array after CCAP must be 508, but it was 511.
This pushed the config, MCQ config, and ESI registers from 0x300 and
0x380 up to 0x900. None of these registers are used yet, so nothing
broke.

Also fix the HCMID bank index field. The spec places it at bits
[23:16], but it was defined on top of the manufacturer code at [15:0].

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58819
34518292a3e077efe239b61f64b9d860bbfb2960 Jaeyoon Choi 2026-08-18 05:06:54

ufshci: report the highest LUN number in the path inquiry

cpi->max_lun is an inclusive upper bound, but the driver reported the
LUN count (8 or 32), so CAM probed one nonexistent LUN past the end.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58820
68091ebf0a72b58424e6b57d6ff9687af9043003 Jaeyoon Choi 2026-08-18 05:09:21
arm64 vfp: eliminate nested critical sections
At two out of three call sites to vfp_restore_state_common(), the caller
must use critical_{enter,exit}() to prevent preemption between its call
to vfp_restore_state_common() and other actions, notably its call to
sve_enable().  So, it is arguably better to make
vfp_restore_state_common()'s caller responsible for performing
critical_{enter,exit}() and simply perform CRITICAL_ASSERT() inside
vfp_restore_state_common().

Reviewed by:    kib, markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58859
189ee41b6cc3b0d92c291cc854d9781afec23ad4 Alan Cox 2026-08-15 06:15:36
ix(4): Sanitize negative error codes
Due to development history FreeBSD driver error codes are reported
the same way as in Linux (as negatives) which is inconsistent
with FreeBSD standard. It may cause unexpected behavior when driver
errors are interpreted by a kernel as syscall handler return values.
This patch converts error codes from negative to positive values for
NVM access functions.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk@intel.com>

Reviewed by:    kbowling, erj, milosz.linkiewicz_intel.com
Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      1 week
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D57642
33e2eac3e3e738daa95a06f42d6c661b87ad9aac Sobczyk, Pawel 2026-08-18 08:10:54
virtio_p9fs: Disallow detach if a session is in progress
PR:           https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295453
Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57500
b39457bb1566912062b2df551b7b8d429b8ba0da Nimish Jain 2026-08-18 14:41:38
bcm2835_audio: Comment out vchi_service_release()
bcm2835_audio_release() calls vchi_service_close() and then
unconditionally calls vchi_service_release() with the same service
handle.

In the VCHI shim implementation, a successful vchi_service_close() calls
service_free(service). The subsequent vchi_service_release() therefore
dereferences a freed SHIM_SERVICE_T object when it reads
service->handle, resulting in a use-after-free panic.

vchi_service_release(), however, releases a reference which might block
vchi_service_close() from completing successfuly, so comment it out
instead of removing it altogether, until further testing is done.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297187
MFC after:      2 weeks
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D58921
95c04b25323d59da43203a08e56db141ac37181b Xuqing Yang 2026-08-18 20:17:44
intelspi: add Gemini Lake SPI controller PCI IDs
Add Gemini Lake LPSS SPI controller PCI IDs (0x31c2, 0x31c4, 0x31c6)
to intelspi_pci_devices[].

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58868
8ddc54f923aec9738c323d2077419b17ba4a1226 Abdelkader Boudih 2026-08-19 01:50:37
vmm: Emulate CPUID leaf 1Fh for guests
On an Intel N150 host a guest started with sockets=1, cores=4,
threads=1 reports "1 package(s) x 2 core(s) x 2 hardware threads"
instead of four cores with one thread each, while the host itself
detects its topology correctly.

A FreeBSD guest picks the topology leaf in topo_probe_intel_0xb(),
sys/x86/x86/mp_x86.c, and since 6badb512a94d it prefers leaf 1Fh over
leaf 0Bh whenever cpu_high is 1Fh or higher.  bhyve passes leaf 0
through unmodified, so the guest sees the maximum basic leaf of the
host, which is 1Fh or above on Alder Lake and newer, and takes that
path.  x86_emulate_cpuid(), sys/amd64/vmm/x86.c, derives the topology
from vm_get_topology() for leaves 1, 4 and 0Bh, but has no case for
1Fh, so the request ends up in default_leaf and the host values are
returned verbatim.  The guest therefore enumerates the topology of the
host: with an SMT shift of 1 in the host's leaf 1Fh and four vCPUs this
gives core_id_shift = 1 and pkg_id_shift = 2, which is exactly the
reported 2 cores x 2 threads.  Hosts whose maximum basic leaf is below
1Fh are unaffected, as the request is clamped to cpu_high before the
switch statement.

Leaf 1Fh uses the same level encoding as leaf 0Bh for the SMT and the
core level, so handle both leaves in the same case.  The module, tile
and die levels are not emulated and terminate the enumeration, exactly
as they already do for leaf 0Bh.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297475
MFC after:      1 week
Reported by:    Richard Straka <fntms@pryse.net>
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D58885
4b1974e9db63d6510406e4ef3e56c250edd2240a Jochen Neumeister 2026-08-19 10:07:03
mlx5(4): convert to timer_setup() linuxKPI
Reviewed by:  bz
Sponsored by:   NVidia networking
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58941
814cd919981e98120c3065906092dca2546fdd74 Konstantin Belousov 2026-08-19 02:13:20
e1000: Report 82571 packet buffer ECC errors
The 82571 PBA_ECC register contains a 12-bit count of packet buffer ECC
detections.  The shared code enables single-bit correction, but neither
FreeBSD nor the DPDK base driver consumes the counter.

Sample it with the ordinary statistics timer, accumulate the value under
dev.em.N.memory_errors.detected_packet_buffer, and clear the hardware
counter while preserving correction and reserved register state.  Do not
enable its shared interrupt: the register does not distinguish corrected
from uncorrectable events and does not provide a safe fatal recovery
policy.

Validated on a dual port 82571EB.  Both functions reported zero after a
clean boot, and a controlled link down/up cycle left the counter at zero
while the management link recovered at 1 Gb/s without issue.

MFC after:      2 weeks
Sponsored by:   BBOX.io
aec0f1b85b54d14819747ed3364f366d21e76d88 Kevin Bowling 2026-08-16 07:11:57
mtw: fix zero-length queue array that can corrupt struct mtw_softc
The mtw softc declares sc_epq with MTW_BULK_RX even though MTW_BULK_RX is enum
value 0, while initialization and queue handling index up to MTW_EP_QUEUES;
attaching a matching USB WLAN device can drive writes past the absent array and
corrupt adjacent softc fields.

This suggested patch sizes sc_epq with MTW_EP_QUEUES so the softc contains the
endpoint queues the driver initializes and uses.

Fixes:          https://cgit.freebsd.org/src/commit/?id=c14b01624261 ("mt7601U: Importing if_mtw from OpenBSD")
Reviewed by:    bz
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58897
7e9e72bee359437b9f78c6a4056ef0a90337f341 Andrew Griffiths 2026-08-20 14:29:53
rsu: add a runtime TX buffer bound check for a kernel buffer overflow
The rsu driver currently relies on a `KASSERT` to prove that the mbuf payload
plus TX descriptor fits in the per-transfer USB TX buffer. On production
kernels without `INVARIANTS`, an oversized raw 802.11 frame can reach
`m_copydata()` and overwrite past that buffer, causing local kernel memory
corruption.

This suggested patch replaces the assertion-only guard with a runtime size
check before the copy. Oversized frames return `EMSGSIZE`, leaving the existing
caller cleanup paths responsible for freeing `m0`, `ni`, and the unused
transfer buffer.

Reachable via root / bpf access

Reviewed by:    bz, adrian
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58898
81a67bfebc60055bbf19ce6e39537fb5f53eeee5 Andrew Griffiths 2026-08-20 14:30:03
ice(4): Support Total Port Shutdown on E830 devices
When 'Permit Total Port Shutdown' feature in BIOS is enabled then Port
Disable bit is set in the Link Default Override Mask TLV PFA module
in the NVM. In this mode, the driver acts as if the link_active_on_if_down
flag is always disabled and disallow any change to that flag.
This feature applies for E830 and E835 NIC series.

Signed-off-by: Pawel Sobczyk <pawel.sobczyk@intel.com>

Tested by:      Mateusz Moga <mateusz.moga@intel.com>
MFC after:      2 weeks
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D58149
0011cd9f8863fce3743bfd9920b7924162bb6410 Sobczyk, Pawel 2026-08-20 16:35:12
thunderbolt: Fix v2.0 reset to reliably wait for the reset to finish
The `reg` value was never initialized, so the loop could potentially
abort without a single read of the register.  This was found by the
following warning from GCC:

sys/dev/thunderbolt/nhi.c: In function 'nhi_reset_v2':
sys/dev/thunderbolt/nhi.c:272:35: error: 'reg' is used uninitialized [-Werror=uninitialized]
  272 |         for (size_t i = 0; i < 10 && reg; i++) {
      |                                   ^~
sys/dev/thunderbolt/nhi.c:257:18: note: 'reg' was declared here
  257 |         uint32_t reg;
      |                  ^~~

Reported by:    GCC 15
Fixes:          https://cgit.freebsd.org/src/commit/?id=efdb82413963 ("thunderbolt: Reset controllers")
850203655b7d25d7309601a32b44011a21e850c6 John Baldwin 2026-08-20 19:49:36
bcm2835_audio: Remove wrong chn_intr()
chn_trigger() calls bcmchan_trigger() with the channel lock held.
However, bcmchan_trigger() calls chn_intr(), which also tries to lock,
which results in a lock recursion panic. chn_intr() is meant to be
called by the interrupt handler and not inside CHANNEL_TRIGGER()
methods. Remove the call altogether, the bcm2835_worker_play_start()
call that comes after is enough.

Fixes:          https://cgit.freebsd.org/src/commit/?id=69cab2d1bfb5 ("Fix locking in bcm2835_audio driver")
Reported by:    Marco Devesas Campos <devesas.campos@gmail.com>
Tested by:      Marco Devesas Campos <devesas.campos@gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59055
f0778a6f9ba7045239a0055ebfbd7965d1f162c9 Christos Margiolis 2026-08-21 00:47:03
powerpc/dma: Fix accounting and loading large segments
When the first page of a segment fits alignment, the second likely does
not, so the DMA infrastructure (must_bounce()) thinks it needs to bounce
the pages.  Fix this by passing the previous end (address of byte
following the previous segment) as a third argument to must_bounce(), so
that the alignment check is done against the start of a new segment if
and only if necessary, instead of the current page.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58627
601312bf9fc644aa0345374861f1fa5b640cb47d Justin Hibbits 2026-08-21 01:28:33
sdhci_fsl_fdt: Allow setting extra quirks
Respect the `hw.sdhci.quirk_set` and `hw.sdhci.quirk_clear` tunables in
the QorIQ eSDHC driver.  This lets us tweak quirks for debugging or
platform specifics.
a952adecc8ddf0dcd8af2fa90af1062e88ba148d Justin Hibbits 2026-08-21 01:28:43
sdhci_fsl_fdt: Add support for PowerPC eSDHC controllers
Migrate all PowerPC QorIQ to the sdhci_fsl_fdt SDHC driver.  There are a
few differences that need to be accounted for:
* On PowerPC device trees, the `clock-frequency` property defines the
  clock rate, not a `clocks` reference property.
* On some older SoCs (P1022 only?) the BURST fields of the WML register
  are reserved, and must be 0x10, so add a FSL quirk (errata field) to
  account for this.
* The PowerPC eSDHC controllers must have the DMA SNOOP bit set for DMA
  to work properly and avoid corruption.

As part of this, make the fallback "fsl,esdhc" compat data work for
PowerPC.  If these fallbacks are not compatible with ARM SoCs, newer
compat strings could be added for those, but the conservative catch-all
should work for most SoCs, though perhaps less optimal.

Differential Revision:  https://reviews.freebsd.org/D58630
48609042212a43a8dd9c3f205e91dcabe5cd96fe Justin Hibbits 2026-08-21 01:29:45
fman: Fix duplicate port identifiers
fman_qman_channel_id returns the QMan FMan channel for a given port.
If a port isn't found, the wrong channel number will be returned.
86715a30e2708eacedaafed629d196d945c12b1e Justin Hibbits 2026-08-20 03:29:50
DPAA: Minor performance improvements
* Add interrupt coalescing for DQRR and MR, with thresholds and period
  as tunable sysctls under the `hw.qman` tree.
* Do lazy/sloppy buffer management to avoid constantly checking
  thresholds via QMan portal round-trips.
* Add cache stashing to prewarm caches, reducing latency.
* Fix the definition of Context_A in the init_fq MC command/result
  structures, they're 64-bit fields, not 32-bit.
* Reorder the dpaa_eth_frame_info as a bit of cleanup.
* Take advantage of the fact that UMA small allocations are returned in
  the DMAP, and avoid pmap_kextract().

These changes together improve throughput by ~1.5%
(925Mbps->935-940Mbps) consistently, and reduce CPU usage by a bit,
increasing idle CPU from 30%->35% minimum.
86a88972dc311b5d4fd112564bfe19c6d7549b5f Justin Hibbits 2026-07-26 04:01:51
dpaa/qman: Make `show fqid <N>` actually work
Set the verb correctly so the query works.  Also print out the
programmable FQID fields as well.
81ac9c66edbfda05f347448828619c0f47af1be3 Justin Hibbits 2026-08-20 03:39:48
dpaa/dtsec: advertise RX/TX csum
Apply 6464974 to dTSEC, since it supports the same offload capabilities
as mEMAC.

The DPAA_CSUM_TX_OFFLOAD macro moves from if_memac.c to the shared
dpaa_eth.h since both drivers now reference it.
240d81169286cd436368644f863aa1dea996fdee Justin Hibbits 2026-08-10 18:26:54
snd_uaudio: Use uDWord for the UAC2 sample rate
uaudio20_set_speed() split the sample rate into bytes by hand. Use
uDWord and USETDW() instead.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59066
5c3bc8ab427c8624b29cd9ac9265445002da3ba8 Christos Margiolis 2026-08-21 14:02:19
sdhci: Remove redundant device_get_softc
Fixes: https://cgit.freebsd.org/src/commit/?id=550db3d6f502 ("sdhci: Initial support for the SpacemiT K1 sdhci controller")
Reviewed by:    bnovkov
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59083
fdf3e570362ab1a37cfe8870bf5a29a087992081 Ed Maste 2026-08-21 14:04:31
jh7110_gpio: remove unneeded cleanup
Any failure within bus_alloc_resources() will call bus_release_resources();
thus the call is redundant here.

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2af2ec524957754ff356daea5fa7ee4990c1c3ea Mitchell Horne 2025-08-10 17:16:11
jh7110_gpio: driver enhancements
Fix reporting of state and capabilities by the gpioctl command.

Support selection of pull-up and pull-down resistors.

Support second gpio device (AON - always on power domain) to allow
attaching gpioled device to visionfive2 status LED or querying boot
selection switches.

Reviewed by:    mhorne
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D58693
3d20f8a022435e8ed37e2c0ce8f66d4c1203ec1c Brian Scott 2026-08-21 16:27:00
Commit group #1: intelspi
intelspi: sort PCI ID table by device ID

Sort the existing LPSS peripheral SPI controller PCI ID table by
numeric device ID so new entries have an unambiguous insertion point.

Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D58996
728775442c62c6eff1b521c074dcbccde9e70764 Abdelkader Boudih 2026-08-21 16:02:15

intelspi: add Broxton SPI controller IDs

Add PCI device IDs for Broxton-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58997
a3489cc47083b7dd4ddddd6d9c03b7ba33f1271f Abdelkader Boudih 2026-08-21 16:02:29

intelspi: add Apollo Lake SPI controller IDs

Add PCI device IDs for Apollo Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58998
4c998ff28471e3fbfcf96decbef5a472cd3d0dd1 Abdelkader Boudih 2026-08-21 16:02:40

intelspi: add Cannon Lake SPI controller IDs

Add PCI device IDs for Cannon Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D58999
26b921d8bd86d14ddb2441186440f6a6136cc1c1 Abdelkader Boudih 2026-08-21 16:02:56

intelspi: add Comet Lake SPI controller IDs

Add PCI device IDs for Comet Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59000
9fb03dd2f759fa68fadecbab40ae84ec390b3a62 Abdelkader Boudih 2026-08-21 16:03:09
Commit group #2: ofw_pcibus: Inherit PF locality for SR-IOV VFs
ofw_pcibus: Inherit PF locality for SR-IOV VFs

PCI VFs are allocated dynamically and have no corresponding OFW node.
The zero-filled OFW PCI devinfo currently leaves obd_node as 0, which
is not the invalid-node sentinel and can send NUMA lookup through an
unrelated firmware node.

Initialize dynamically allocated devinfo with an invalid OFW node. For
VF locality queries, use the owning PF's node when it exists. Fall back
to the PCI bus when neither the VF nor PF has a firmware node.

This preserves existing CPU-locality behavior for ordinary PCI devices
while making VF domain and interrupt placement follow their PF.

Reviewed by:    PowerPC (jhibbits)
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59064
f003e86335c9c16c6769ef8f0c091d425dba7ef9 Kevin Bowling 2026-08-21 02:45:33

pci: Expose a VF's owning PF to bus subclasses

ofw_pcibus now uses pci_iov_get_pf() to inherit PF locality for
VFs, but the accessor was inadvertently left in an uncommited ACPI
change.  This breaks powerpc builds.

Expose the accessor from the PCI core and provide a stub when PCI_IOV
is omitted.  Record VF ownership before pci_add_child() so child added
callbacks can safely query it, and remove the later redundant
assignment.

Fixes:          https://cgit.freebsd.org/src/commit/?id=f003e86335c9 ofw_pcibus: Inherit PF locality for SR-IOV VFs
MFC after:      2 weeks
Sponsored by:   BBOX.io
3481a9cdc4dc26ef583bb0f46a04d5d059cde466 Kevin Bowling 2026-08-22 03:14:37
ofw_pcibus: Honor device proximity for DMA tags
BUS_GET_DOMAIN can report a PCI function's firmware locality, including
an SR-IOV VF's inherited PF locality, but ordinary OFW PCI functions
still use the shared bus DMA tag.  Consequently, busdma metadata and
coherent memory can be allocated from the bus's domain instead of the
function's domain.

Create and cache a child tag for each function that requests a DMA tag
and apply its reported domain without modifying the shared parent tag.
Apply the same domain to the private IOMMU tag already created by the
pSeries PCI bus.  Destroy cached tags when PCI children are removed so
VF create and destroy cycles do not leak them.

Reviewed by:    PowerPC (jhibbits)
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59065
df6bbc9b17dcb75e220b9ab44f5a6483b47c562e Kevin Bowling 2026-08-21 03:08:13
snd_hdsp: Avoid allocation in the interrupt handler
Cache PCM children instead of calling device_get_children() from the
interrupt handler.  Drain callbacks before child detach so cached
pointers cannot outlive the PCM softc.  Allocate the parent softc by
its actual size.

This mirrors snd_hdspe's interrupt dispatch and detach lifecycle.

Reported by:    christos
MFC after:      1 week
74db53d5d7657d0508940d1193f05a39df85434a Kevin Bowling 2026-08-22 01:13:12
e1000: Limit the TSO sentinel to lem(4) controllers
The TSO workaround splits the final DMA segment to create a four byte
sentinel descriptor.  Intel documents the premature descriptor writeback
erratum and this workaround in the 82540EP and 82545GM specification
updates (erratum 3) and the 82546GB specification update (erratum 1).

Limit the workaround and its preceding TSO state to the legacy PCI and
PCI-X controllers so PCIe controllers retain their natural descriptor
layout using one fewer descriptor per TSO packet, no split of the final
segment, and one less four byte DMA.

MFC after:      2 weeks
Sponsored by:   BBOX.io
2a7af8ebcf90af83f01f9523b25bfc6e58c7b809 Kevin Bowling 2026-08-22 01:24:28
Commit group #3: intelspi
intelspi: add Lakefield SPI controller IDs

Add PCI device IDs for Lakefield-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59001
0b4ff3e1def98c6d804f1e8cc96f3f8eaf4c60bb Abdelkader Boudih 2026-08-22 02:20:19

intelspi: add Ice Lake SPI controller IDs

Add PCI device IDs for Ice Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59002
88919d5ab6c4f611fb2b90d4ff17667072296950 Abdelkader Boudih 2026-08-22 02:24:32

intelspi: add Jasper Lake SPI controller IDs

Add PCI device IDs for Jasper Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59003
e7db9fa2e10408257541c38b99323a17824c6078 Abdelkader Boudih 2026-08-22 02:25:24

intelspi: add Tiger Lake SPI controller IDs

Add PCI device IDs for Tiger Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59004
3ff56f81a1a58d708d0101d601e88c289cfc5882 Abdelkader Boudih 2026-08-22 02:25:39

intelspi: add Elkhart Lake SPI controller IDs

Add PCI device IDs for Elkhart Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59005
bdda595a8ea31cb8161e5773139df3cf8785abb7 Abdelkader Boudih 2026-08-22 02:26:01

intelspi: add Alder Lake SPI controller IDs

Add PCI device IDs for Alder Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59006
2dd4027c07e91ea5903314411f4bae44f72ca03b Abdelkader Boudih 2026-08-22 02:27:04

intelspi: add Raptor Lake SPI controller IDs

Add PCI device IDs for Raptor Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59007
a6d84d04b3f2b570d7fff0835058d14f3bd84d9a Abdelkader Boudih 2026-08-22 02:27:22

intelspi: add Meteor Lake SPI controller IDs

Add PCI device IDs for Meteor Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59008
6d4b45ac5c6c7b01febda0185df420d08f80096b Abdelkader Boudih 2026-08-22 02:28:05

intelspi: add Arrow Lake SPI controller IDs

Add PCI device IDs for Arrow Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59009
ca1a2bf39614a910c87cbc703df25396fe2bd26b Abdelkader Boudih 2026-08-22 02:28:40

intelspi: add Lunar Lake SPI controller IDs

Add PCI device IDs for Lunar Lake-generation LPSS peripheral SPI
controllers.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59010
be503dd912a18e5f7eb16c73326562e13681cf49 Abdelkader Boudih 2026-08-22 02:29:30
snd_hdsp*: malloc(9) with M_WAITOK
Perform the allocations outside the lock section so that we can use
M_WAITOK. Holding the lock here is actually not really necessary and we
could just as well remove it, but keep it for consistency.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 month
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D59079
b5c1ab6c8f2811278b801084713a6618f3b783d3 Christos Margiolis 2026-08-22 12:48:50
dpaa/eth: fast-path single-page TX frame build
The TX SG-build loop in dpaa_eth_if_start_locked() walked page
boundaries with PAGE_MASK arithmetic even for buffers that lived
entirely within one page -- the common case, since MCLBYTES
is smaller than PAGE_SIZE.  Add a fast path that emits a single SGT
entry for wholly-in-one-page segments and skips the inner while
entirely.

Fix the following bugs while we're here:

1. "if (m->m_len == 0) continue;" in the outer loop never
   advanced m -- any zero-length mbuf hung the TX path in an
   infinite loop.  Fix this by switching to a for loop, with the
   advancement in the post-clause.

2. In the inner (page-splitting) loop, the cap
   "if (m->m_len < ssize) ssize = m->m_len;" compared against
   the mbuf's original length, not the remaining bytes.  A single mbuf
   whose data started mid-page and ran into a second page would produce
   a second SGT entry with ssize > rem, over-reading past the buffer end
   into whatever followed in kernel memory.  Fixed by tracking a local
   rem and capping ssize against it.

3. If the whole mbuf chain consisted of zero-length segments,
   the final-flag store "fi_sgt[i - 1].final = 1" wrote to
   index -1.  Reject empty frames up front now instead.

As part of this, rename the inner counter from dsize to rem for clarity
instead of playing double-duty in both inner and outer loops.
1d445ae68446771c78161a3eca35acdb04ef78ab Justin Hibbits 2026-08-10 18:24:08
dpaa/qman: Fix various pool allocation bugs
* Set qman_channel_base after determining if QMan is v3, otherwise this
  global stays at 0x21, which messes up the shift in
  qman_portal_static_dequeue_channel().
* Fix the base shift in qman_portal_static_dequeue_channel(), there are
  only 15 channels available, not 16, so starting at a shift of 15
  yields shifting into the portal-specific channel.
* Correct vmem pool names for QMan resource pools.
ee81cd1d8f5596a6ab4c8eb29009405572cc162b Justin Hibbits 2026-08-13 14:50:06
e1000: Recover from 82580 memory errors
82580 reports fatal parity and uncorrectable ECC errors through ICR.FER
and its four region PEIND hierarchy.  Region specific status registers
identify PCIe, DMA transmit, DMA receive, DMA host, and LAN port
memories that can leave traffic stopped.

Enable the documented DMA, PCIe, packet-buffer, and host-owned LAN
parity and ECC checks only after initializing queue and filter tables.
Leave the flexible filter parity controls under management firmware
ownership.  Capture read-clear and RW1C status in the interrupt filter
and keep FER masked until the admin task resolves the event.

Reset for a host-owned region or an unknown FER source.  Leave
management-only recovery to firmware.  Use CTRL.RST before master
disable because fatal 82580 memory errors can stop PCIe traffic.  Do not
use CTRL.DEV_RST: specification update item 9 declares that bit reserved
and says it must always be written as zero.  Wait for EEPROM auto read
completion; STATUS bit 21 is reserved on 82580, not PF_RST_DONE.

Validated on an Intel I340-T2 (82580, revision 1).  A one queue
port programmed LANPERRCTL as 0x6e00 while a four-queue port programmed
0x7e00, avoiding the RSS checker until RETA is initialized.  Both ports
programmed PEINDM 0xf, DTPARC 0x1555, DRPARC and DDPARC 0x55,
PCIEERRCTL 0x5555, and PCIEECCCTL 0x11.  Three down/up cycles left all
status and counters clear.

A synthetic ICS.FER event on each function caused exactly one
unknown source reset without advancing the sibling function counters.
Controls were restored, the linked port recovered carrier, and
bidirectional traffic after recovery.

Enabling flexible filter parity checkers before programming their
memories produced genuine LAN region faults with LANPERRSTS bits 0 and
1.  Each fault advanced fatal_lan and fatal_resets exactly once, left
the sibling function unchanged, and recovered the port proving hardware
events will trigger the intended recovery.

MFC after:      2 weeks
Sponsored by:   BBOX.io
5e56a1fb09cd3cc2081978dd6508ff5bc7c59eca Kevin Bowling 2026-08-16 05:48:58
igb: Report 82580 memory ECC errors
82580 exposes clear-on-read, saturating corrected error counters for
the receive and transmit packet buffers.  Its two PCIe command memories
expose RW1C indications for uncorrectable ECC errors.

Sample the packet buffer counters and PCIe indications from the regular
hardware statistics update.  Fatal recovery samples the PCIe indications
from the serialized admin path rather than the interrupt filter.  Thus,
either the regular statistics pass or recovery reads and clears each
indication, but they cannot both account it.  Also preserve indications
observed while initialization is completing.

Expose the exact packet buffer error total and observed PCIe command
memory indications under the memory_errors sysctl node.  Multiple PCIe
errors between samples can collapse into one indication per memory.

Validated on an Intel I340-T2 (82580, revision 1).  A clean boot and
three down/up cycles left the packet-buffer, PCIe, and region-specific
counters at zero.  Synthetic ICS.FER events advanced fatal_unknown and
fatal_resets exactly once on the targeted function without changing the
sibling or ECC counters.

The 82580 datasheet exposes no ECC or parity error injection register,
so corrected packet buffer and PCIe ECC accounting could not be forced
independently.

MFC after:      2 weeks
Sponsored by:   BBOX.io
915c628c4f49b267c8a713b79c4a8b157092d717 Kevin Bowling 2026-08-16 05:49:56
ixgbe: Probe additional controller variants
The shared base code already selects and configures the 82598 BX,
82599 KR, 82599 SFP Express Module, X552 XFI, X553 QSFP, and X553 N
QSFP device IDs, but the FreeBSD probe table omits them while DPDK lists
them.

MFC after:      2 weeks
Sponsored by:   BBOX.io
27f0491e3648722a892558416a768dda77850ad9 Kevin Bowling 2026-08-10 16:01:45
hwpmc: probe the RAPL unit MSR instead of faulting on it
The RAPL probe read MSR_RAPL_POWER_UNIT with a bare rdmsr().  RAPL is not
enumerated by CPUID on either vendor and the register is absent on older
Intel and AMD parts and under a hypervisor that does not emulate it, so
the read raises #GP and loading hwpmc panics the machine.

Read it with rdmsr_safe() and return ENXIO when it is not there, as this
function already does for the energy MSRs.  Both callers already drop the
class when the probe fails.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a99d04f39dab ("hwpmc: add RAPL energy-counter class (AMD + Intel)")
Assisted-by:    Claude Code (Opus 5)
469727f0637beec05e0478c1391e3df1e684e53c Alexander Leidinger 2026-08-21 22:29:05
hwpmc: do not register RAPL when the unit register reads as zero
An energy status unit of zero means one joule per raw tick, which no part
reports; it is what a hypervisor returns for an MSR it does not implement.
Both energy rows are scaled by that field, so the class would be
registered with counters that read zero forever.

Refuse it, as the class is already refused when no energy MSR responds.

Assisted-by:    Claude Code (Opus 5)
d2e7fcb6dd79691d336c3700e4727a887e5cabdc Alexander Leidinger 2026-08-22 07:59:03
amd_iommu: Bound IVHD device-entry parsing
Validate the IVRS table and every subtable length before using either
to form iterator bounds. Reject truncated typed IVHD blocks instead of
passing them to a type-specific callback.

Within each IVHD payload, correct the lower-bound comparison for
extended range entries and validate fixed-size entries, paired range
terminators, the fixed HID body, and the variable HID UID before
dereferencing or advancing. Malformed firmware can no longer drive
either iterator beyond its enclosing object.

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58724
4a2494d76ad03c755f2cb0ed5e1311b03bb2a8e2 Kevin Bowling 2026-08-06 08:22:37
rtwn: add rtwn_efuse_preread
This would be used to switch to the "WiFi bank" before reading the rom.
The 8723bu will need this, currently a nop on all chips.

Differential Revision:  https://reviews.freebsd.org/D59106
006920b63c03528bae5abd273d57c8af63bdf68a Ahmad Khalifa 2026-08-23 16:46:34
rtwn: allow non-zero interface indexes
The endpoints we want won't always be on interface 0. Instead, allow the
interface index to be specified in driver_info when probing.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D59107
481314f620ac01a5a92c322e8ab4f310035872f9 Ahmad Khalifa 2026-08-23 16:46:58

Networking

Network-related commands, library, and kernel.

ipfilter: Fix checksum update for NAT_DIVERTOUT
When taking a snapshot of the before ip_len (s1) for comparison with the
after-translated ip_len (s2), we must convert it from network to host
byte order before we can use it. Add the missing ntohs() call.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296944
MFC after:      3 days
c08a97fa27b914988ef092352872b2f455abb7c3 Cy Schubert 2026-08-17 23:23:32
Commit group #4: net80211
net80211: fix WEP transmit

This was broken in 2022 with a security fix (61605e0ae5d8f) which
disallowed defaulting to the default TX key if there's no unicast
key.  Unfortunately this path was also used by WEP transmit.

To fix it, add a separate check which ensures that WEP is configured
(authtype OPEN, privacy enabled) - then also check if the default TX
key is set and that said key is a WEP key.

Fixes: https://cgit.freebsd.org/src/commit/?id=61605e0ae5d8f

Locally tested:

* rtwn(4) AP and rtwn(4) STA w/ static WEP keys configured

Differential Revision:  https://reviews.freebsd.org/D58854
874035c11cd40282cb5d654749a99b03b9233502 Adrian Chadd 2026-08-19 02:01:53

net80211: add key get/set methods

Introduce net80211 key get and set methods with appropriate
bounds checking and buffer zero'ing.

Differential Revision:  https://reviews.freebsd.org/D58705
db4d6f76407c098a2fe72eb359e93180b508753a Adrian Chadd 2026-08-19 02:01:59

net80211: migrate the ioctl API to a 128 bit specific API + use key API

* Begin migrating the ioctl code to use the key management APIs.
  Not all of it has been migrated (notably the WEP API hasn't.)

* Take special care to copy the TKIP MIC in and out correctly.

* Note that some of the defines used as sizes are actually the ioctl
  sizes, they'll need to be fixed before I push this into a review.

* Document this current API as a specific 128 bit key + 128 bit
  TKIP MIC API.

The goal here is to solidify this stuff as the 128 bit ioctl API
and not change it, even if net80211 will eventually grow 256 and
384 bit key support.

Notably the TKIP stuff - the driver_bsd.c code puts the TKIP after
the normal key contents, whereas the net80211 code puts the TKIP
stuff in the /end/ of the key buffer.  They happen to be equivalent
when ioctl key buffer size == net80211 key buffer size, but as I learnt
the last couple times I tried this, they're not always going to be
equivalent.

Differential Revision:  https://reviews.freebsd.org/D58384
99fda13f1c4a260923d3a0a173af14f730b705c9 Adrian Chadd 2026-08-19 02:02:05
net8021!: radiotap: add another HE define
Add another HE define needed by the upcoming espwl(4).

MFC after:      3 days
83e8fd6bbfaf3e0b4d7901187f6863ed93d03951 Bjoern A. Zeeb 2026-08-12 14:13:24
netlink: Parse repeated nested attributes
Modern Netlink arrays encode their elements as repeated attributes of
the same type rather than as children of an additional array container.

Add an SNL callback that parses one nested element for each occurrence
and appends it to a geometrically grown parser array.  Retain the
existing parray callback for protocols that use the legacy container
form.

Store the growth capacity in struct snl_parray, appended after its
existing public count and items fields so their offsets remain stable
on LP64 and ILP32.  Require parser targets to be real snl_parray
objects, and convert bitset, generic Netlink, and route multipath arrays
accordingly.  This avoids relying on layout aliases for private growth
state.

Add regression coverage for a nested bit array that grows beyond its
initial allocation, while preserving replacement semantics when a
legacy array target is reused.

Reviewed by:    melifaro, pouria
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D58775
60c0a075472cabd0ac7f54411f6a65626169984a Kevin Bowling 2026-08-10 21:34:12
netstat(1): Add nexthop statistics support with -os flag
Add support nexthop statistics and update its manual.
While here, fix manual of other nexthop related options.

Reviewed by: kfv
Differential Revision:  https://reviews.freebsd.org/D58538
f71abf3f650f265974f90c24ad7d358d797bf22e Pouria Mousavizadeh Tehrani 2026-08-19 22:01:10
route/fib_algo: Free leaked radix_masks in radix_lockless
radix_lockless algorithm creates its own radix tree and
allocates its own radix_masks by directly calling rnh_addaddr().
However, during destruction, it only frees the radix_tree without
freeing its allocated radix_masks.
Fix the leak by calling rn_delete() during radix_destroy().

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297339
Reviewed by:    melifaro
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D59112
790817f5a7a640c9ceb5c2ad99135f1a69aeb77d Pouria Mousavizadeh Tehrani 2026-08-22 20:37:58
sockstat: improve consistency
Include the entries of the BBLOG STATE column in the computation
of the column width as done also for other columns.
Also set first to falso only when needed.

MFC after:      3 days
MFC to:         stable/15
MFC to:         stable/14
Sponsored by:   Netflix, Inc.
732c8d2a1a0e169bad1c02b1e54a4306861bde4a Michael Tuexen 2026-08-23 19:55:51

System administration

Stuff in man section 8 (other than networking).

Fix transposed arguments in call to calloc(). Reported by GCC 15 warning.
No functional change intended.

Submitted by: Pedro Giffuni <pfg@freebsd.org>
MFC-after:    1 week
2cefae4cf34e7d39fc3b27358d7d66a96b3b0056 Kirk McKusick 2026-08-17 19:15:09
stand: set st_dev/st_ino in the loader's ZFS stat for veriexec
The loader's ZFS implementation never set st_dev or st_ino in
zfs_dnode_stat(). With an uninitialized struct stat, veriexec's device
comparison in lib/libsecureboot/veopen.c read stack garbage and skipped
the matching manifest entry, failing with a spurious "no entry" on ZFS
root under UEFI Secure Boot.

Rather than zeroing the device (which would break veriexec's ability to
tell apart the same path on different datasets), populate st_dev and
st_ino with the same intrinsic identifiers the kernel uses:

- st_dev = the dataset's ds_fsid_guid (as the kernel does via
  dmu_objset_fsid_guid()/dsl_dataset_fsid_guid()), already read in
  zfs_mount_dataset() and now propagated through struct zfsmount.
- st_ino = the object number resolved in zfs_lookup(), propagated
  through struct file (the loader's equivalent of the kernel's z_id).

dev_t and ino_t are 64-bit on FreeBSD, so both are assigned directly
with no hashing. A memset() at the top of zfs_dnode_stat() zeroes the
remaining fields so they no longer hold stack garbage.

Tested on 16.0-CURRENT (amd64), ZFS-on-GELI root: rebuilt and re-signed
the EFI loader; the system boots under UEFI Secure Boot with
mac_veriexec active.

(boot1 segment was modified by kevans)

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295935
Sponsored by:   Defenso

Reviewed-by: kevans
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2271
b567434a592e1a35b20c5a39c4ccc2ea9e00601d Etienne Bonnand 2026-06-18 16:37:31
New version of jng (9.0)
Changes for jng 2.0 -> 9.0 include:

+ Use ng_bridge(4) uplink hooks on ng_ether(4) lower so the host
  mapping table stays small (first hook is uplink; unknown unicast
  goes only to uplink)
+ Add `jng pin [-h] {-a | NAME ...}' to plant eiface MACs with
  NGM_BRIDGE_MOVE_HOST and raise maxStaleness so they do not expire
+ Remove experimental NG_TYPE=iface / ng_tcpmss(4); ng_iface(4)
  cannot work with ng_bridge(4)
+ Add -v
+ SPDX-License-Identifier: BSD-2-Clause; bump copyright to 2026

See D58902 for the ng_bridge(4) data-path MOVE_HOST fix.

MFC after:      1 week
Reviewed by:    kfv, jlduran
Differential Revision:  https://reviews.freebsd.org/D58903
644990f193cc284db241125e567519cafa1c7ccd Devin Teske 2026-08-18 18:54:36
New version of jng (9.1)
Update examples and comments to return eifaces in exec.prestop
with ifconfig -vnet (before jng shutdown in poststop).

Reported by:    jlduran
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268397
MFC after:      1 week
Reviewed by:    kfv, jlduran
Differential Revision:  https://reviews.freebsd.org/D58939
8d83b10345da101e4a24a38c90d99a0df0f48b3b Devin Teske 2026-08-20 04:39:23
New version of jng (9.2)
Use jail.conf(5) $name in the jail.conf examples so the jail name
need only be set on the stanza. Keep host.hostname as xxx.yyy;
a jail name is not a DNS label. Leave the rc.conf excerpt as xxx.

Suggested by:   jlduran
MFC after:      1 week
Reviewed by:    kfv, jlduran
Differential Revision:  https://reviews.freebsd.org/D59032
c4bca1f8830223766105af486ae70e78d67ae78a Devin Teske 2026-08-20 17:44:55
pmc: Use distinct names for arguments to the pmc_config constructor
This pacifies shadow warnings from GCC:

usr.sbin/pmc/cmd_pmc_record.cc: In constructor 'pmc_config::pmc_config(const std::__1::string&, uint64_t, cpuset_t)':
usr.sbin/pmc/cmd_pmc_record.cc:96:71: error: declaration of 'cpumask' shadows a member of 'pmc_config' [-Werror=shadow]
   96 |         pmc_config(const std::string &event, uint64_t count, cpuset_t cpumask)
      |                                                              ~~~~~~~~~^~~~~~~
usr.sbin/pmc/cmd_pmc_record.cc:90:25: note: shadowed declaration is here
   90 |         cpuset_t        cpumask;
      |                         ^~~~~~~
usr.sbin/pmc/cmd_pmc_record.cc:96:55: error: declaration of 'count' shadows a member of 'pmc_config' [-Werror=shadow]
   96 |         pmc_config(const std::string &event, uint64_t count, cpuset_t cpumask)
      |                                              ~~~~~~~~~^~~~~
usr.sbin/pmc/cmd_pmc_record.cc:89:25: note: shadowed declaration is here
   89 |         uint64_t        count;
      |                         ^~~~~
usr.sbin/pmc/cmd_pmc_record.cc:96:39: error: declaration of 'event' shadows a member of 'pmc_config' [-Werror=shadow]
   96 |         pmc_config(const std::string &event, uint64_t count, cpuset_t cpumask)
      |                    ~~~~~~~~~~~~~~~~~~~^~~~~
usr.sbin/pmc/cmd_pmc_record.cc:88:25: note: shadowed declaration is here
   88 |         std::string     event;
      |                         ^~~~~

Reported by:    GCC 15
Fixes:          https://cgit.freebsd.org/src/commit/?id=a79a051e7d16 ("pmc: pmc record command")
78bbe9fc3e3529731df07e29464f103f96f6ebed John Baldwin 2026-08-20 19:49:36
bhyve: Manage passthrough devices across guest FLR
bhyve emulates the guest PCI Command register so BAR sizing does not
disable physical decoding.  However, PCIe Device Control was passed
through.  A guest VFIO reset therefore performed a physical FLR, which
cleared physical Command, while the guest restored only its emulated
copy.  The device remained assigned with bus mastering disabled and
could not fetch DMA descriptors.

Intercept guest FLR writes and issue a PPT-managed reset.  Stop all
vCPUs, verify ownership, quiesce the function, perform only an FLR, and
restore the host-owned PCI configuration, decode, and bus-master state.
Keep the IOMMU domain in place.  bhyve removes guest BAR mappings before
this ioctl; a later guest MEMEN write recreates them.  Never escalate a
guest FLR to a power reset.

Reset the guest-owned Command, MSI, MSI-X, MSI-X table, INTx, and MRRS
state.  PCIe 6.2 section 6.6.2 explicitly preserves MPS across FLR.
Virtualize MPS, MRRS, and Completion Timeout.  Keep physical MPS and
completion-timeout policy host-owned, and apply physical MRRS with MPS
as its floor.  Keep Phantom Functions Enable host-owned because it
changes requester identities visible to the IOMMU.

Serialize guest configuration transactions per function and gate
trapped and direct BAR access across the reset.  Handle byte, word,
dword, and overlapping Device Control accesses.

A guest FLR can sleep for at least 100 ms.  Reserve the target function
while dropping the global PPT lock so a guest cannot delay PPT lifecycle
operations for other VMs.  Operations on the target wait for its reset
while other functions and VMs can proceed.

Check pcie_flr_supported() before destructive preparation so PPT applies
the generic PCI quirk policy.  This includes VFs such as the 82599 which
implement FLR without advertising it.

Validated with two E610 VFs in a Linux 7.0 guest using VFIO no-IOMMU and
DPDK testpmd with two queues per VF.  Byte, word, dword, and overlapping
FLR writes, 32 alternating resets, DPDK traffic, and ixgbevf
reattachment all completed while the sibling VF and host PCIe remained
healthy.  This fixes Linux VFIO no-IOMMU with DPDK PMDs.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   BBOX.io
c8343ba84af75c3710a1c587ff9bd2165fcd37a9 Kevin Bowling 2026-08-15 23:47:33
bhyve: Keep passthrough PCI power state virtual
The passthrough Command register is emulated, but PMCSR writes were
sent directly to the physical function.  A guest D3hot-to-D0 transition
can perform an internal reset and clear physical Command while its
emulated copy remains enabled.

Cache the Power Management capability and keep the physical D-state
host-owned.  Emulate the guest D-state and advertise No_Soft_Reset so
the guest is not promised a function reset by a virtual power cycle.
Restore the assignment-time virtual state after a managed FLR.

Reviewed by:    markj
MFC after:      2 weeks
Sponsored by:   BBOX.io
3b90096cf9bcaec70b717e9ff0a9e23d14b600b6 Kevin Bowling 2026-08-17 17:09:23
makefs: zfs: Allow the path vdev property to be set
This allows specifying custom vdev paths (such as GPT labels like
/dev/gpt/...) when creating ZFS filesystem images via makefs(8), rather
than defaulting to /dev/null.

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59031
5fece2484324be52737e4cea86658a4b8d3107fc Jose Luis Duran 2026-08-21 19:02:04
pmc: Use isascii(3) to check if a character is ASCII
The previous check did not work on architectures where `char` is
unsigned as noted by GCC on aarch64:

usr.sbin/pmc/view.cc: In member function 'void pmcview::loadsymboltable(image*, Elf*, Elf_Scn*, GElf_Shdr*)':
usr.sbin/pmc/view.cc:627:38: error: comparison is always false due to limited range of data type [-Werror=type-limits]
  627 |                         if (fname[i] < 0) {
      |                             ~~~~~~~~~^~~

Reported by:    GCC 15
82a3337952b922c48c55d1359ab0472f1d116c7a John Baldwin 2026-08-21 20:19:56
examples/jails: New version of jib (9.0)
Add $Version, -h/-v, and SPDX-License-Identifier: BSD-2-Clause.
Drop the long-form license and bump the copyright to 2026.

MFC after:      1 week
fc7eb8c4a76594ad6ce40c43d507248f431c3f9a Devin Teske 2026-08-22 02:06:46
examples/jails: Allow any character in interface names
Interface names have no limitations on the allowed character set, only
a length restriction.

Widen the allowed character set for interface names to include any
printable character.

PR:     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290916
Reviewed by:    dteske
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53865
60848a08b0931abfdfb812fece93258d47377541 Jose Luis Duran 2026-08-22 02:12:24
bsdinstall: Ensure logging retained when BSDINSTALL_LOG is not changed by preamble
Before the preamble script is sourced, initialize BSDINSTALL_LOG with the
file in $debugFile, if it is not already set.

Without this change, the bsdinstall script would assume the preamble set
BSDINSTALL_LOG to empty and the comparison with $debugFile will fail,
causing the log to be re-initialized to /dev/null.

Reviewed by:    dteske
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D25343
70c9d047990017394a872474c81fcdd66b502168 Stephen J. Kiernan 2026-08-22 05:29:37
nuageinit: root should be allowed to log in when disable_root is false
PermitRootLogin is "no" by default and that stopped root from logging in
even though disable_root was set to false during initialization.

Reviewed by:    bapt
Sponsored by:   Chelsio Communications
Differential Revision:  https://reviews.freebsd.org/D59101
a209aac86882d3062318dea4971b2f728463c7e2 Navdeep Parhar 2026-08-21 20:16:48
bhyve: Do not panic on invalid input in HDA emulation
The emulated HDA controller passed values taken from guest registers and
from guest memory straight into assert(), so a guest could abort bhyve
with values the emulation did not expect. Reject them instead.

In case the guest asked to start something and it failed, clear the
corresponding run/enable bit.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256379, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256381, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256382, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256383, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256384, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256385, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256386, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256498
Sponsored by:   The FreeBSD Foundation
MFC after:      2 weeks
Reviewed by:    bnovkov, jhb
Differential Revision:  https://reviews.freebsd.org/D59082
f4d953bea74091874f019e3a2c4902dd013ee739 Christos Margiolis 2026-08-22 12:48:32
bhyve: Generalize the IPC thread
Move the code for the snapshotting IPC thread into a separate file
and define macros for adding new IPC commands.
No functional change intended.

Reviewed by:    rew
Differential Revision:  https://reviews.freebsd.org/D54650
04811d46d3f2176af245f6d5e7e06b422f5d6216 Bojan Novković 2025-11-18 11:59:01
bhyvectl: Generalize bhyve IPC code
Move the nvlist-based bhyve IPC code into a separate function.
No functional change intended.

Reviewed by:    rew
Differential Revision:  https://reviews.freebsd.org/D54652
f49f33ef8c5315ada2ec1a1ca5626d5608e4e6e0 Bojan Novković 2025-11-24 21:47:46

Libraries

fts: fix file descriptor leak in fts_close
fts_build() stores a dup'd file descriptor in each directory
entry's fts_dirfd.  When a traversal is abandoned before
completion and fts_close() is called, the cleanup loop freed
each pending entry with free() without first closing its
fts_dirfd, leaking one descriptor per pending directory.

Close fts_dirfd before freeing each entry in the cleanup loop,
matching the handling already applied to the dummy parent entry
after the loop.

Add a regression test that descends a couple of levels, abandons
the traversal, closes, and asserts the open descriptor count is
unchanged.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297557
Reported by:    asomers
Fixes:          https://cgit.freebsd.org/src/commit/?id=4bd01d6ae016
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2373
9b8c2bffeba9861c3f5bda0e5a08943e5ed4853f Jitendra Bhati 2026-08-15 16:06:39
fts: add fts_openat() API
Add fts_openat() as a new entry point for fts(3).

When dirfd is AT_FDCWD the behaviour is identical to fts_open().
Passing a pre-opened directory fd allows fts traversal inside
Capsicum capability mode where path-based operations are not
permitted.

Capability mode users should use fts_parent->fts_dirfd + fts_name with
openat(2) to access files.

Reviewed by:    asomers
Relnotes:       yes
Sponsored by:   Google LLC (GSoC 2026)
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2273
9aed7a7745512ca098cc2b247cef61ad57d63204 Jitendra Bhati 2026-06-12 20:48:17
libc: Restore prior C23 include guards
To avoid any sort of POLA violation, this commit restores old
guards and defines the C23 feature test macros in addition to
them.  This is to close off whole class of possible breakage,
rather than patching it case by case.

Reported by:    dim
Reviewed by:    dim, dteske, fuz
Approved by:    dim, dteske (mentor), fuz (mentor)
MFC after:      1 month
Differential Revision: https://reviews.freebsd.org/D58911
8d29d242964976d9ffa89387d97de87d6cedc886 Faraz Vahedi 2026-08-18 10:48:20
Commit group #5: exterr: relax format restrictions
exterr: relax format restrictions

Rather than passing the format string to printf and forcing the
arguments to be (u)intmax_t, partially parse format strings and cast
p1 and p2 to the correct type before running the individual format
though printf.  This restructure has a couple motivatations:
 - We can skip formats that make no sense (floating point, %n, etc.).
 - It is possible to special case the printing of pointers in the
   CHERI case.

The first case is motivated by a suggestion from the audiance at
one of Kirk's BSDCan talks on exterr to allow userspace to set exterr
status.  Allowing arbitrary format strings including %n creates a
write-what-where gadget so we need to not do that.

The second case is motivated by our experinces with CHERI and debugging
mmap issues using a different textual error reporting framework.  With
CHERI, pointers are more than integer addresses and it's useful to
include more details.  Doing so will follow in a future commit.

When the new code encounters an inappropriate format it includes
a diagnostic and in most cases prints the format untouched.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58058
2f024a7cfddd5ce92df8437d89ba5bc3d55dacaf Brooks Davis 2026-08-20 10:37:44

exterr: Fix build with GCC on 32-bit architectures

Use an intermediate uintptr_t cast to avoid casting a uint64_t value
directly to void * on 32-bit platforms (including lib32 builds).

lib/libc/gen/uexterr_format.c: In function 'uexterr_format_msg':
lib/libc/gen/uexterr_format.c:248:35: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  248 |                         PFMT(fmt, (void *)ARG(nextarg));
      |                                   ^
lib/libc/gen/uexterr_format.c:144:47: note: in definition of macro 'PFMT'
  144 |                 psz = snprintf(buf, bufsz, f, a);                       \
      |                                               ^

Reported by:    GCC 15
Fixes:          https://cgit.freebsd.org/src/commit/?id=2f024a7cfddd ("exterr: relax format restrictions")
01c0ddf44a770a152a01259fd150fc77d5caac26 John Baldwin 2026-08-20 19:49:36
runtime: add the ability to set exterrors in userspace
The UEXTERROR(3) macro is a partial analog to EXTERROR(9) that sets
the current user exterror state and errno.  The main difference is
that it returns no value and sets errno directly since that's the
typical pattern in libraries.

While here move the storage and constructor for single-threaded
program's uexterr to its own file.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58059
95e33099c74d9fc7963968f052b7546ad3040317 Brooks Davis 2026-08-20 10:39:00
libusb: change callback register handler to int
libusb upstream uses int for register handler. This causes some library
user (like pyusb) to assume that we have int in all implementations and
therefore provides a 4 byte storage only. This causes Segmentation
fault as we will right the pointer.

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54211

(cherry picked from commit ce9ced951a0b9d004a3b007d4ac6e9087a1301a2)
6bda9f26d2eda066285a55edd0e508b799b1a02a ShengYi Hung 2025-12-13 15:12:11
libusb: Add an XXX comment for possible duplicate callback IDs
If next_callback_id wraps we could end up with two callbacks with the
same ID.  I recommitted the original change despite this issue in order
to fix the libusb API as soon as possible after SHLIB_MAJOR was bumped
in commit 527a82474cb3 (libusb: versioning symbols).

It's very unlikely in practice that software will register and
deregister a sufficient number of callbacks to trigger this, but it is
a real issue to be fixed in a subsequent commit.

Sponsored by:   The FreeBSD Foundation
250db717b24d084c0a3193226a79b73a69fbfe0f Ed Maste 2026-08-21 14:31:25
libusb: Avoid signed integer overflow UB
Instead, just reset next_callback_id to 1 at INT_MAX.  The potential for
duplicate callback IDs remains.

Sponsored by:   The FreeBSD Foundation
a793cabb621ee33ded7ef25cf8290ee53d2c5e4d Ed Maste 2026-08-21 16:56:08
libc: Implement bsearch_s(), document bsearch_b(), and add unit tests
- Implement bsearch_s() as per §K.3.6.3.2 in C23, first specified
  in C11.  It behaves identically to bsearch(), except the callback
  is called with a third argument, context, which is passed through
  from the caller, and it also performs runtime constraint checking
  on its arguments.
- Document bsearch_b(), bsearch_s(), and add history section
- Add rudimentary unit tests for bsearch(), bsearch_b(), and bsearch_s()

Reviewed by:    dteske, fuz
Approved by:    dteske (mentor), fuz (mentor)
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D58876
d59c7ea2701fe7b73b32eef49a7c712ef38de5a0 Faraz Vahedi 2026-08-22 15:01:27

Filesystems

tarfs: remove PRIV_VFS_MOUNT_PERM check
The backing file is already opened successfully, so there is
no need to override the permissions.

Reviewed by:    des
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58832
4d524915233092d71b309b49d9743012cb05c11e Siva Mahadevan 2026-08-20 04:17:45
tarfs: allow mounting inside jails
Reviewed by:  des
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58833
ba99013a4464c2f3e8cc0a89c23d03810dc2d37e Siva Mahadevan 2026-08-20 04:18:43
unionfs_lock(): eliminate LK_CANRECURSE special-case
As of commit 9f5c4ef328 ("dounmount(9): temporarily enable recursion
for the covered vnode lock"), the unmount path handles recursion
automatically, so there's no longer a need to handle this case
in unionfs-specific code.

Reviewed by:    kib, markj
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D58858
b952606b4f999d2e691a1adf02f0ef0b2b34d26c Jason A. Harmening 2026-08-15 16:05:46

Kernel

Kernel stuff (other than networking, filesystems, and drivers).

Commit group #6: sys: Add sys/ckdint.h
sys: Add sys/ckdint.h

We have a C23 stdckdint.h header for userspace, which provides checked
addition, subtraction and multiplication.  We lack similar helpers in
the kernel, where they are regularly needed.

Let's just adopt the C23 macros.  For bonus points, I added a wrapper to
ensure that ignored an return value is raised as an error by the
compiler.

Reviewed by:    kib, emaste
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58773
37bd69d43c70346b9191f7ce07ee9ed783ce528f Mark Johnston 2026-08-17 17:06:04

tools/build: stage stdckdint.h's dependencies for non-FreeBSD hosts

37bd69d43c7 gave stdckdint.h two new includes, <sys/_visible.h> and
<sys/ckdint.h>.  Neither reaches a non-FreeBSD host: _visible.h is
staged only under ${.MAKE.OS} == "FreeBSD" and ckdint.h is not staged at
all, so the libc bootstrap fails on reallocarray.o when cross-building
from macOS.  Both headers are self-contained; stage them alongside
stdckdint.h.

Fixes:          https://cgit.freebsd.org/src/commit/?id=37bd69d43c7 ("sys: Add sys/ckdint.h")
Reviewed by:    rpaulo, markj
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58943
805c5004fa86e26486175cd3a0bb253dcb8ec7e0 Abhijeet Sharma 2026-08-19 12:19:27
malloc: Use ckdint.h helpers instead of WOULD_OVERFLOW
This serves to demonstrate some usage of the ckdint.h helpers.  The new
version also generates better machine code on amd64 and arm64.

Reviewed by:    kib, emaste
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
2d67765f10e7da43ba2d4a7fc074c15d5354684b Mark Johnston 2026-08-17 18:15:17
SYSINIT: add SI_SUB_KENV
Since the kernel environment has its own dependencies, lurking at the end
of the SI_SUB_KMEM sequence appeared to be fragile.  Provide own subsystem
for it.  The init_dynamic_kenv() goes SI_ORDER_FIRST, and two modules that
depend on it go SI_ORDER_ANY.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297492
Reviewed by:            imp, markj, emaste
Differential Revision:  https://reviews.freebsd.org/D58836
a77edeb0e54ad3e96e2a6c685d5c26eac4ba190a Gleb Smirnoff 2026-08-17 19:40:49
unix: wrap comments to fit in 80 char line
5e0e6a9e2f838304346f2c83b1c2982fec9b92de Gleb Smirnoff 2026-08-18 17:44:33
linux: add dma-buf and sync_file ioctl handlers
drm-kmod already implements the dma-buf and sync_file ioctls, but
linux_ioctl.c had no handler group for the 'b' and '>' magic bytes, so
the requests never reached it and returned EINVAL from
linux_ioctl_fallback().  Route the commands drm-kmod services to
sys_ioctl(), translating the direction bits with SETDIR(); everything
else still falls through to the fallback and keeps getting named in
dmesg.

Approved-by: adrian
Accepted-by: dumbbell
Signed-off-by: Nick Price <nprice@FreeBSD.org>
(cherry picked from commit d6a7e89504af337413af39fd121026f512c0a35d)
c90c46ea239f2514f1af82c1fa9dc0b4f20361e7 Nick Price 2026-08-09 23:43:12
Commit group #7: shmfd: consistently return size in 512 byte blocks for fstat(2) st_blocks
shmfd: consistently return size in 512 byte blocks for fstat(2) st_blocks

This is ABI-breaking change that could be considered as the bug fix.

Requested by:   David Timber <dxdt@dev.snart.me>
Reviewed by:    emaste, markj
Sponsored by:   The FreeBSD Foundation
Relnotes:       yes
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58942
3a1bf59d195ced99c0f69774969d7090d21f6097 Konstantin Belousov 2026-08-19 02:27:46

tests/sys/posixshm/posixshm_test.c::accounting fix after st_size changes

st_blksize is defined by POSIX as the 'preferred I/O block size for this
object.' It is wrong to use st_blksize as the unit for st_blocks and
expect it to be equal to the object size regardless of the change of
st_blksize.

Fixes:  https://cgit.freebsd.org/src/commit/?id=3a1bf59d195c ("shmfd: consistently return size in 512 byte blocks for fstat(2) st_blocks")
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D59014
a1aa26b7db2c774b1da5eecb5505efd412ea7a23 Konstantin Belousov 2026-08-19 21:53:55
LinuxKPI: 802.11: add more defines, structures, ...
Add more defines, structures, sort struct field types, add inline
functions (partially implemented) all needed for the upcoming
espwl(4) wireless driver.

MFC after:      3 days
9b13e6ce5b099af0958a824fa37c70538a8b6d2a Bjoern A. Zeeb 2026-08-12 14:11:36
LinuxKPI: 802.11: deal with wdev list, and misc
Fill in more (lvif) wdev details and add it to the list under the wiphy
struct so that iterators at least work and find the (one) device.
This is needed for the upcoming espwl(4) driver.

misc: add WPI-SMS4 to the list of cipher suits (we won't support it but
at least print the name).

MFC after:      3 days
3e42109d846766248b7d0d0b077543ffc1a9db22 Bjoern A. Zeeb 2026-08-12 14:16:40
linux: Add STF type and convert some if_type to ARPHRD
Convert IFT_BRIDGE and IFT_L2VLAN to ARPHRD_ETHER, and IFT_LOOP
to ARPHRD_LOOPBACK in linux netlink.
Also, add ARPHRD_SIT and convert IFT_STF to it.

Reviewed by:    kfv
Differential Revision:  https://reviews.freebsd.org/D58573
ba27b63c4477b0a6b796fe7807832870363201d0 Pouria Mousavizadeh Tehrani 2026-08-19 18:21:57
unix: fix comment
241df6af172921d3135c82229ff1ab778583adcd Gleb Smirnoff 2026-08-19 22:53:53
ofed/ipoib: convert to timer_setup linuxKPI
Reviewed by:  bz
Sponsored by:   NVidia networking
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58941
fdcb52d03688d92ba4962eea623292b0120e2293 Konstantin Belousov 2026-08-19 02:14:00
kern/sched: Hide scheduler selection from C++
The scheduler selection interface uses names that are reserved words in
C++, causing problems for downstream projects that use C++ in the
kernel.  Work around this by hiding the interface from C++ compilers
until we can come up with a better solution.

Fixes:          https://cgit.freebsd.org/src/commit/?id=ce38acee8d0b ("Add kern/sched_shim.c")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    siderop1_netapp.com, imp, kib
Differential Revision:  https://reviews.freebsd.org/D58991
f2366851616083f923e8101363802678a03dc0b9 Dag-Erling Smørgrav 2026-08-20 13:57:56
vchiq: Merge two commits from Linux
6e474d8e3981 ("staging: vchiq_shim: avoid code duplication") refactors
some code which makes applying the subsequent patch easier.

49bec49fd7f2 ("staging: vc04_services: remove vchiq_copy_from_user")
addresses a user-triggerable integer overflow via the
VCHIQ_IOC_QUEUE_MESSAGE ioctl on /dev/vchiq (which has mode 0600 by
default).  It also addresses insufficient validation of user-controlled
addresses in vchiq_copy_from_user().

Update the bcm2835_audio driver to follow the change to
vchi_msg_queue().

Reported by:    Vicki Pfau
Reviewed by:    Abdelkader Boudih <freebsd@seuros.com>
Tested by:      Abdelkader Boudih <freebsd@seuros.com>
Tested by:      Marco Devesas Campos <devesas.campos@gmail.com>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58889
97e24b41d2d224cfb4043f1ae84fc23d9033d0a1 Mark Johnston 2026-08-21 14:53:54
libkern.h: remove HAVE_INLINE_* macros
The final consumer of this was OpenZFS, fixed in ffaea0831973 (thanks
mav@). That change has been present in all active OpenZFS release
branches for at least 6 months. These can finally be retired.

Reviewed by:    mav
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55201
76f14217f6051df414e435c3388d3f4bb388cc22 Mitchell Horne 2026-08-21 16:57:12
dounmount(): generalize comment on covered vnode lock recursion
The need for recursion applies (in somewhat different form) to both
nullfs and unionfs, and would likely apply to any other hypothetical
stacked filesystem as well.

Reviewed by:            kib, markj
Differential Revision:  https://reviews.freebsd.org/D58858
9a8287cbb12be92b503b1bd301d69a42949e855c Jason A. Harmening 2026-08-15 16:14:11

Build system

nhop.9: Rewrite relics of rtentry.9 into nhop.9
Parts of rtentry.9 information such as information related to
the nexthop is outdated.
Remove those relics and add the new design into separate
manual instead.

Reviewed by:    bcr
Discussed with: ziaee
Differential Revision: https://reviews.freebsd.org/D58564
a6e9e4cb259c3394aab4dc3e407d932866a02884 Pouria Mousavizadeh Tehrani 2026-08-19 17:40:38
uexterror(3): install the right manpage
Reported by:  Herbert J. Skuhra
2ff0ca5272c8c2bb038a565949d5bd5c4726c704 Brooks Davis 2026-08-20 13:31:07
hwpmc: build hwpmc_rapl.c into the i386 module
The module's i386 source list compiles the files that call
pmc_rapl_initialize() and pmc_rapl_finalize() but not the one that defines
them, so the i386 hwpmc.ko has both undefined and cannot be loaded.

Fixes:          https://cgit.freebsd.org/src/commit/?id=a99d04f39dab ("hwpmc: add RAPL energy-counter class (AMD + Intel)")
Assisted-by:    Claude Code (Opus 5)
9c8bcdddb35e9a3c70f65748ecc784bb400dfa38 Alexander Leidinger 2026-08-22 07:59:04

Internal organizational stuff

mfc-candidates: Annotate variables as local
And clean up luacheck warnings.

Sponsored by:   Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D48950
ba120b8d38f3f0bc78efa5200807eb9904fbb1f9 Mark Johnston 2026-08-12 18:39:11
ObsoleteFiles: Add missing headers
The header files for dialog, figpar, dpv were never listed.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297612
Fixes:          https://cgit.freebsd.org/src/commit/?id=af202a5052b6 ("Retire dialog")
e2f2b182c08c8f9232b49333051bdc63328b71bc Dag-Erling Smørgrav 2026-08-21 16:02:26

Testing

fts: add fts_capsicum_test.c
Add three test cases verifying fts(3) Capsicum capability mode:

- fts_dirfd_valid: verifies fts_dirfd is set for all non-root
  entries and openat(fts_dirfd, fts_name) identifies the same
  inode as fts_accpath
- fts_dirfd_capsicum: verifies complete fts traversal works in
  Capsicum capability mode using fts_openat() and fts_dirfd
- fts_dirfd_deep_tree: verifies fts_dirfd + fts_name is correct
  at all directory depths (7 non-root entries)

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2332
31f9f09bf7b9b53533c9b731d9fade73eae379cc Jitendra Bhati 2026-07-18 23:19:52
stress2: Enable two hwpmc tests that now run as expected
8eb77a5aabef40ef31d974337ff5763558d4813b Peter Holm 2026-08-20 08:55:16
Fix zombie leak in test using pdfork()
d58ca841529c29fec4df90fc0cb93cc427f4f65d Peter Holm 2026-08-20 08:59:58
exterr(9): add a few tests of new message formats
This is enough to show that the idea works (and to exercise
uexterr_set()), but isn't complete by any means.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58060
ddf6065122e8990eafe31d21adaf719a25924a73 Brooks Davis 2026-08-20 10:39:46
uexterror_gettext: add tests for invalid formats
Verify that unsupported, unterminated, and overly long formats output
expected messages.

Reviewed by:    kib
Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D58413
94f86eff72ed43a38a12a41cd5945afe00c8199a Brooks Davis 2026-08-20 10:40:06
makefs: Fix atime tests on MS-DOS (FAT) file systems
On FAT file systems, access time has a resolution of 1 day, so it is
really the access date.

Strip the time component from the epoch timestamp in order to check the
access time.

Reference: https://learn.microsoft.com/en-us/windows/win32/sysinfo/file-times

Reviewed by:    ngie
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54584
2916ae647303e3bd92e533002a8e6c476417fe7f Jose Luis Duran 2026-08-21 19:14:03
unionfs7.sh: eliminate stderr redirection
The bash-ism here results in an "ambiguous output redirect"
error when run under tcsh.  Similar unionfs stress2 tests don't
do this, and unionfs7 doesn't seem to generate spurious output
when run locally, so just delete it.

Reviewed by:            pho
Differential Revision:  https://reviews.freebsd.org/D58856
d7033e3b20b93e081ff2f1e923ff4925a42ae5dc Jason A. Harmening 2026-08-15 06:48:46
kyua: Add "prepare" command
This introduces the requirement preparation handler concept, with the
first handler implemented to load the required kernel modules.

Running without arguments lists all available handlers:

  kyua prepare

Currently there are only two handlers:

  all: runs all available handlers
  kmods: loads the modules declared by required_kmods metadata

The dry run option lists the required modules without actual loading:

  kyua prepare { --dry-run | -n } kmods

The "prepare" command traverses only the given tree of tests, i.e., the
following invocation lists all required modules for the whole test
suite:

  kyua prepare -k /usr/tests/Kyuafile -n kmods

, while this one is limited to the pf tests only:

  kyua prepare -k /usr/tests/sys/netpfil/pf/Kyuafile -n kmods

Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D48087
edb230c4af499203d7a6894b3711fe6574b26040 Igor Ostapenko 2026-08-23 22:42:48

Style, typos, and comments

These could go in other categories, but it's more clear if they're here instead.

msun: Fix a typo in a source code comment
- s/uneccessarily/unnecessarily/

Obtained from:  NetBSD
MFC after:      3 days
cd4aae2fa9d35015248c445752e23800e75e8517 Gordon Bergling 2026-08-17 05:47:17
nullfs(4): Fix a typo in a source code comment
- s/modifing/modifying/

MFC after:      3 days
27c70deb3d260b48bee8f3c4c975fd2de64264fb Gordon Bergling 2026-08-17 05:48:33
swap_pager: Fix a typo in a source code comment
- s/errornous/erroneous/

MFC after:      3 days
88293bdd1eefb4bf518e1764d370b4a2321afdd1 Gordon Bergling 2026-08-17 05:51:05
ppbus(4): Fix a typo in a source code comment
- s/predifined/predefined/

MFC after:      3 days
709bd45a1b3a5ca21e05995c0c01f0ee8e7e8c38 Gordon Bergling 2026-08-17 05:52:09
fxp(4): Fix a typo in a source code comment
- s/modifing/modifying/

MFC after:      3 days
c47b430c6ea3aa8d133af0af426d018bae3b7018 Gordon Bergling 2026-08-17 05:53:07
ichwd(4): Fix a typo in a source code comment
- s/modifing/modifying/

MFC after:      3 days
8362aecdeb2548813942a7e604543c71f5a10271 Gordon Bergling 2026-08-17 05:54:10
ipfw(4): Fix a typo in a source code comment
- s/varaiables/variables/

MFC after:      3 days
251e6ef40203a6f911d7f4daacf3075de7f870c0 Gordon Bergling 2026-08-17 05:55:17
bluetooth(4): Fix a typo in a kernel message in l2cap
- s/staring/starting/

MFC after:      5 days
8e968c5ff4112387c87f7afdf79d873a6f475b21 Gordon Bergling 2026-08-17 05:57:15
dpaa/fman_port: Fix register config typo
6b57054af620558eb6abceaf6890f98309052d8b Justin Hibbits 2026-08-11 03:03:52
clk: Correct SpacemitT typo
SpacemiT has only one T.

Fixes: https://cgit.freebsd.org/src/commit/?id=dcb10e3add17 ("clk: Initial support for the SpacemiT K1 clock control units")

Sponsored by:   The FreeBSD Foundation
2346300eafb6fc021581fbba4b5e757d227c7ac6 Ed Maste 2026-08-18 02:02:20
jh7110_gpio: style
- Fix whitespace
- Replace JH7110_GPIO_READ with RD4 (and WR4)
- Trim headers
- Explicit conditional checks
- Use correct method typedefs

MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
72216145d3e4e2460d48d279a339072e0be2cc74 Mitchell Horne 2025-08-10 17:13:23
unionfs_noderem(): fix typo
Reviewed by:          kib, markj
Differential Revision:  https://reviews.freebsd.org/D58858
6b452301172391815c6e21a9875f75c8ddb35735 Jason A. Harmening 2026-08-15 16:16:09
chflags: fix indentation style bugs
Several lines in the flags-parsing block used spaces instead of
tabs for indentation.  Convert them to tabs to match style(9).
No functional change.

Sponsored by:   Google LLC (GSoC 2026)
4a07ed9bcd5fd8c6635d2e086b9e5b83deb21766 Jitendra Bhati 2026-08-18 21:16:48

Contrib code

sqlite3: Vendor import of sqlite3 3.53.3
Release notes at https://www.sqlite.org/releaselog/3_53_3.html.

Obtained from:  https://www.sqlite.org/2026/sqlite-autoconf-3530300.tar.gz

MFC after:      2 weeks

Merge commit 'e698feec080925c6cffa9ec31be884daa5cea536'
14e3daa72db7d6410877481a4ed2791603e2b99f Cy Schubert 2026-08-16 03:24:45
contrib/netbsd-tests: lib/libc/c063: sync with NetBSD
This change syncs the lib/libc/c063 NetBSD tests with FreeBSD. This does
two things:
- Addresses bogus tautologically true assertions flagged by clang and gcc
  with ATF 0.22+ [1].
- Brings in some new test coverage.

Obtained from:  NetBSD (date tag: `20260818UTC`)
MFC after:      2 weeks
1. https://github.com/freebsd/atf/pull/72
8109a5c0fba0d015354a69b40e6682d5e8c0f638 Enji Cooper 2026-08-19 07:57:27

Reverted commits

Revert "ciss: Add max physical target"
This reverts commit 45645518ea19ccb4761aee3a525aab2f323d37d4.

Although this changed looks like it should just be a harmless change to
bookkeeping, it turns out that it changes the termination condition of
the initial device scan, resulting in it never finishing. This causes
the boot to hang forever coming up. Since I don't have good access to
hardware, I'm reverting until the exact details can be sorted out.

Reported by: Edward Scroop
Sponsored by: Netflix
MFC After: 1 week
ba9aaed01a484778f1c1f2fb5d7e30dbb1a8f5ad Warner Losh 2026-08-17 13:11:52
Commit & revert pair: vtnet: move offload functions to virtio_net.h to share them
vtnet: move offload functions to virtio_net.h to share them

Move the functions vtnet_rxq_csum() and vtnet_txq_offload() and the
subfunctions they call from if_vtnet.c to virtio_net.h. This allows
us to call these functions from if_tuntap.c and if_ptnet.c.
virtio_net.h already contained a copy of these functions, but a copy
of an outdated version. The functions evolved in if_vtnet.c.
In if_vtnet.c, the copy has never been used because it increments
counters in their own functions.
This patch removes the outdated copy from virtio_net.h and moves the
new version of the functions from if_vtnet.c to virtio_net.h.
if_tuntap.c, if_ptnet.c, and if_vtnet.c just call these functions,
and if_vtnet.c increments its counters depending on the return value.

Reviewed by:            tuexen
MFC after:              1 month
MFC to:                 stable/15
Differential Revision:  https://reviews.freebsd.org/D57299
44cddaa99dee0a634cf2713f71e799eb41397355 Timo Völker 2026-08-18 12:49:40

Revert "vtnet: move offload functions to virtio_net.h to share them"

This reverts commit 44cddaa99dee0a634cf2713f71e799eb41397355.
It breaks the LINT-NOIP config.
8bea280f4325d10858ec58ae7251db7604fa77a2 Michael Tuexen 2026-08-21 20:16:05

Unclassified commits

Not classified automatically, and waiting for manual attention.

-- no commits in this category this week --

Technical notes

Dates:

Automatic grouping:

Automatic categories:

Source code:


Generated with commits-periodical 0.21 at (time removed for reproducibility).

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-08-17 (debug) (contains info about the classification)