FreeBSD git weekly: 2026-10-12 to 2026-10-18

Introduction

This is a display of mostly-automatically-classified git commits from 2026-10-12 to 2026-10-18.

Table of contents and commits per category:

(0) Highlighted commits (these are copies, not in stats)
3 2.0% Userland programs
2 1.3% Documentation
45 29.8% Hardware support
24 15.9% Networking
15 9.9% System administration
6 4.0% Libraries
6 4.0% Filesystems
23 15.2% Kernel
4 2.6% Build system
6 4.0% Internal organizational stuff
7 4.6% Testing
1 0.7% Style, typos, and comments
3 2.0% Contrib code
6 4.0% Reverted commits
0 0.0% Unclassified commits
151 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.

-- no commits in this category this week --

Userland programs

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

termcap: add missing capabilities to the xterm-ghostty entry
The entry was imported from the termcap source that Ghostty generates
with infotocap during its build.  To fit within 1023 bytes, the
conversion dropped a number of capabilities, most notably all color
support, so termcap consumers such as ls -G and ncurses applications
treated Ghostty as a monochrome terminal.

Split the entry into xterm-ghostty and a ghostty+common fragment, and
restore the following from Ghostty's terminfo definition:

 - colors: Co, pa, AF, AB, op, oc, ut, AX
 - keys: End, keypad Enter, F10-F12, back tab, mouse prefix
 - attributes: italics (ZH/ZR), invisible (mk), acsc map (ac)
 - misc: cb, ch, cv, SA/RA, r1, bs, NP, 5i

AF and AB use the plain 256-color form, like xterm-256color, because
termcap cannot express the conditional used by the terminfo entry.

Fixes:          https://cgit.freebsd.org/src/commit/?id=804f961c5cdd ("share/termcap: add xterm-ghostty entry")
MFC after:      1 week
3ceb5f150bc121f5e6a3e0cc8b289279338405a1 Xin LI 2026-10-12 07:51:43
ncal(1): handle Sweden's transitional calendar (1700-1712)
Sweden used a unique intermediate calendar during 1700-1712.  In 1700,
Sweden omitted the Julian leap day (Feb 29, 1700) to begin a gradual
transition to the Gregorian calendar.  The transition was abandoned
mid-way due to the Great Northern War; to revert to the Julian calendar,
an extra day "Feb 30, 1712" was added.  Sweden finally adopted the
Gregorian calendar in 1753 (already handled correctly by ncal).

ncal previously displayed Feb 1700 as a 29-day month and Feb 1712 as a
29-day month, both incorrect for the Swedish (-s SE) calendar mode.

Add flag_sweden, which is set when the SE country code is selected (via
-s SE or the locale) and cleared by -J, since -J selects the plain
Julian calendar.  When active, sndaysr() and sdater() apply the one-day
offset that characterised the Swedish transitional calendar:

  - Feb 1700: displayed with 28 days (no leap day)
  - 1700-03-01 to 1712-02-30: dates run one day ahead of Julian, so
    weekdays are correctly anchored to the actual solar day
  - Feb 1712: displayed with 30 days (the unique "Feb 30" day)
  - 1712-03-01 onward: back to Julian until the 1753 Gregorian switch

Add ATF tests covering the 3-month and Julian-day views around both
boundaries and the -J override.

Reported-by:    John Costello <https://joxn.org>
Signed-off-by:  Juan Michelini <juan@juan.com.uy>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewed by:    asomers, js
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2353
1ca7f6618536febba5b500c050cddaf06bd2342a Juan Michelini 2026-10-09 14:28:25
diff: support -qq to output absolutely nothing
This is similar to `cmp -s`, but can be combined with:
-B --ignore-blank-lines
-b --ignore-space-change
-w --ignore-all-space

To only report a difference if it doesn't involve whitespace

Reviewed by:    des, bapt, markj (previous version), ziaee (man page)
MFC after:      1 week
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D46717
c30a321a61ce7e1c03d4c314b2127b37f75564c6 Allan Jude 2024-09-20 15:30:58

Documentation

Man pages, release notes, etc.

dict: Add "macho"
Macho is a perfectly cromulent word, in both Merriam-Webster and OED.

Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D60713
4a65e12dfbaba7193e37fcd2e14fbc20776a78b9 Ed Maste 2022-06-17 15:55:23
tcpsso.8: fix a cosmetic nit and make mandoc -Tlint happy
bfb7ee5ef00f847d27f535c80936fd845db7104d Maxim Konovalov 2026-10-16 21:33:41

Hardware support

Hardware drivers and architecture-specific code.

Commit group #0: iwm
iwm: add lock assertion checks

Add lock/unlock assertions to use in current and future code.

Differential Revision:  https://reviews.freebsd.org/D60400
b3ef4013a4fa75063930d0221a0bc50f95af0527 Adrian Chadd 2026-10-12 02:40:54

iwm: placeholders for HT rates, update some FW flags to openbsd

* update a flag to openbsd iwm
* lay down placeholder ht rate / MIMO config routines based on
  openbsd's updated init path

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60073
1f07bcd91de1d02d1adb8a1215945cd02f469489 Adrian Chadd 2026-10-12 02:41:12

iwm: bring over placeholder calibration information

Like openbsd at this commit, it's not being used anywhere yet.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60074
b00a90df99f72c30bdeec17bb0fb0cd28342415d Adrian Chadd 2026-10-12 02:41:20

iwm: bring in the command table version code from openbsd

Parse the command table; same way as OpenBSD (ie, memcpy()
and not anything endianness happy.)

Nothing is using it yet.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60075
65373e8d02391054eb867edaeb92348c6f2d4ff4 Adrian Chadd 2026-10-12 02:41:24

iwm: Intel 9000 series bits from OpenBSD

* Add basic SOC conf firmware command
* Configured with the same xtal latency as used by openbsd

Currently untested; will need to find a device.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60076
b15ec53784f3be913d6b4711f8eb166584a7d791 Adrian Chadd 2026-10-12 02:50:40

iwm: add thermal cutoff to firmware command support

This is based on firmware capabilities.

Locally tested:

* Intel 7260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60077
e6ca3d05b93b5f36dde2873076d7bc29dbcd46d1 Adrian Chadd 2026-10-12 02:50:45

iwm: clear persistence bit on 9000 series NICs

From what I've gathered, this is to make sure that the firmware
clears state and is reloaded through hardware bring-up and
suspend/resume.

It may fix instability issues with the 9000 series NICs.
I'll need to test it out first.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60078
7ce67909fa683b22546b2ec8d635db1582b56bca Adrian Chadd 2026-10-12 02:50:50

iwm: add MSI-X support

This brings over the MSI-X support from OpenBSD.
It's mostly untested at this point.

Locally tested:

* Intel 7260, STA mode (but I don't know yet if it used msi-x)

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60079
8f93ad70078a88710d34b371a4076191cfebc4f6 Adrian Chadd 2026-10-12 02:50:57
u3g: Add ublox LARA-L6 modem
MFC after:            3 days
Approved by:            adrian
Reviewed by:            kevans, adrian
Differential Revision:  https://reviews.freebsd.org/D60652
a32c8dc6e8fd96e0d56e5add09638120e62d8418 Joel Bodenmann 2026-10-12 16:54:41
arm64: Fix and rename midr_check_var_part_range()
At the lowest and highest variants in the specified range,
midr_check_var_part_range() was comparing the part number, rather than
the revision, against the bounds.  In other words, the "Y" in "rXpY"
should be compared to CPU_REV() instead of CPU_PART().  Apply this
correction, and rename the function to midr_check_var_rev_range() to
better reflect the field that we are checking.

Reported by:    Claude Code (Opus 5.5)
Reviewed by:    andrew
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60624
39d6e2226484ca434c7d980eda4aa19ed0d62c9e Alan Cox 2026-10-11 18:13:25
hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class
The IRPERF MSR counter (0xc00000e9) exposes an instructions-retired count
when read. Its support is advertised through CPUID leaf 0x80000008 EBX bit 1.
If this bit is set, the CPU supports the IRPERF MSR. For it to be used
by the system, bit 30 of the HWCR MSR (0xC0010015) needs to be enabled.

This patch checks for availability of the feature and enables the bit. If
the feature is available, the hwpmc PERF class detects its presence and
registers a third PERF MSR counter that allows hwpmc users to measure
instructions retired using IRPERF. This is AMD-only, as Intel does not
support IRPERF.

Due to erratum #1054 affecting AMD Zen 1 before model 30h, IRPERF is only
enabled for AMD Zen 1 model 30h onwards and later microarchitectures. This
commit also implements a validation step to make sure the IRPERF counter
is actually incrementing; otherwise, the feature is not enabled. This
guarantees it is working as expected before being made available to the
system and users.

To support this, the perf_pmcdesc[] structure changed from being
statically initialized with 2 entries (MPERF/APERF) to being populated
dynamically. If both MPERF/APERF and IRPERF are supported, the structure
will contain three entries: MPERF, APERF, and IRPERF. Each entry now also
carries its own MSR address and PMC event, so perf_read_pmc() reads the
MSR to use from the matching perf_pmcdesc[] entry at runtime instead of
switching over a fixed set of row indices.

Definitions for the features available on the HWCR MSR did not previously
exist. This commit adds macros for those features, including
HWCR_IRPERFEN. The MSR definition for MSR_IRPERF was also missing and has
now been added.

This commit also updates the manual page accordingly.

Signed-off-by:  Anderson Nascimento <anascime@amd.com>
Reviewed by:    mhorne, adrian
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D59554
2272fac218a88a6f25e696ec54ece2eedec39a38 Anderson Nascimento 2026-10-13 13:10:28
if_bnxt: fix powerpc build of the MPC ring code
powerpc has no 16-bit acquire/release atomics, so the
atomic_load_acq_16() and atomic_store_rel_16() calls on the MPC TX
ring indices fail to build there. Make the producer and consumer
indices 32 bits wide and use the 32-bit primitives.

Reviewed by:    gallatin, chandrakanth.patil_broadcom.com
Sponsored by:   Broadcom Inc
MFC after:      1 week
Fixes: https://cgit.freebsd.org/src/commit/?id=088a42c0ff76 ("if_bnxt: add MPC (Mid-Path Channel) ring infrastructure")
Differential Revision: https://reviews.freebsd.org/D60698
b43c4d84c8d172858fc4bbf59e07888bfb8ac472 Sumit Saxena 2026-10-13 08:28:03
arm64/vmm: Treat Rt=31 as xzr in reg & instr emul
For certain instructions like msr, mrs, ldr & str, Rt=31 means the
operand is the Zero register (XZR) as opposed to the SP, even though the
two share the encoding of 31 on AArch64.

This is currently ignored in register and instruction emulation, so
emulated guest operations like "msr <reg>, xzr" will set the value of
<reg> to the current value of the SP instead of to 0.

Skip set and get operations when Rt=31 to correct the behaviour.

Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Reviewed by:    andrew
Sponsored by:   Arm Ltd
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2454
167d3567c4b93650c8bcca86ff294226e6e1a9ce Kajetan Puchalski 2026-09-29 17:02:19
arm64: Relax memory barriers around DMA operations
Before and after DMA operations we need memory barriers to ensure
stores on the CPU are observed by the device, and stores by the device
are observed by the CPU.

Previously we used a "dsb sy" instruction, however this is too strong
and can lead to slower performance.

Drew Gallatin found and tested the issue with cache-coherent devices,
reducing the barriers to dmb instructions in the outer-shareable
domain. After discussing the issue with the Arm Linux DMA maintainer I
concluded it was safe for non-coherent devices as the only dsb
instructions we need are after cache operations and these already exist.

Replace the dsb before DMA with a "dmb oshst" when cache-coherent, or
the existing dsb after invalidating the cache when not coherent. This
ensures earlier stores have completed before we signal the device.

Replace the dsb after DMA with "dmb oshld" in both cases. This ensures
later loads or stores are ordered after earlier device register loads.

Co-Authored-By: Andrew Gallatin <gallatin@FreeBSD.org>
Sponsored by:   Arm Ltd
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60407
ac64294143ffea63c7dedf9a1859f88342bd998a Andrew Turner 2026-10-13 15:36:16
mgb: support multi-segment packets in the DMA descriptor rings.
Reviewed by:  emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60705
ec68ff15bfa6aece12383ba408e9eec95f4b79cd Ruslan Bukin 2026-10-13 16:26:10
if_rge: add debugnet/netdump support
Implement the debugnet KPI in rge(4) by mirroring the re(4) pattern.
Tested with a RTL8125 2.5GbE NIC.

Approved by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60135
686323c1820cc4b2ef5434c0b6fa0ac38466fe5e Olivier Cochard 2026-10-13 16:22:19
mgb: support for PCI11414.
Add support for Microchip PCI11414 Gigabit Ethernet Controller.

The PCI11414 is used on the CHERI VITA 57.1 PCIe Extension Board.

- Add PCI11414 device ID
- Add support for SGMII mode. Read the programmed strap configuration
  and enable SGMII operation when configured. Bypass the MII interface
  in SGMII mode.
- Increase the DMA descriptor ring size.

Reviewed by:    emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60539
da8a529bc01f5fdfdd5308ff6fd9a2bc52359069 Ruslan Bukin 2026-10-13 17:39:24
mgb: increase timeout
Increase wait timeout as needed for slower systems.

It takes ~120ms on the Codasip Prime for the MGB_PHY_READY bit
to set after phy reset command issued.

Reviewed by:    emaste
Sponsored by:   EPSRC ("UKRI3001: CHERI Research Centre")
Differential Revision:  https://reviews.freebsd.org/D60706
3943973aaeba035bf36b34dfb9354d8d1c4684b9 Ruslan Bukin 2026-10-13 18:34:40
acpi_lid: add an in-kernel lid state eventhandler
Lid state changes are only published to userland, via devd and evdev.
Drivers that need to react to the lid in the kernel have no hook, so
they end up installing a second ACPI_DEVICE_NOTIFY handler on the same
lid object and reimplementing the _LID evaluation.

Add acpi_lid_event, invoked from acpi_lid_status_update() alongside the
existing devd notification, carrying the new state (1 open, 0 closed).

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60704
030e556ff8a9dfa6fd7b5328e410eb806f4d07ed Abdelkader Boudih 2026-10-13 18:43:56
powerpc: Avoid deadlock when CPUs exchange threads
The PowerPC context switch waited for the incoming thread to leave
blocked_lock before releasing the outgoing thread.  If two CPUs selected
each other's running threads concurrently, both CPUs waited for the
other to perform the release and neither could progress.  This appeared
as intermittent boot hangs under QEMU MTTCG when taskqueue threads were
bound to opposite CPUs.

8df2e5421468 ("powerpc: put the isync inside the TD_LOCK()...")
attempted to fix the same hang by moving isync into the polling loop.
That did not address the circular wait: isync cannot cause either CPU to
execute the release store after the loop.  It only added context
synchronization to failed iterations and changed timing. Move isync back
to the successful exit, which preserves acquire ordering for subsequent
context loads.

Match the ordering used by other architectures: publish the outgoing
thread's new lock before waiting for the incoming thread.  Apply the
correction to both 32-bit and 64-bit switch paths.

The 2015 change moved the release after the stack switch because the old
implementation continued through pmap_activate() and optional state
restoration on the outgoing thread's stack after making that thread
runnable.  The switch path has since changed: after the release it only
polls wired td_lock state using registers, then immediately loads the
incoming PCB_SP before updating per-CPU state or making any calls.
cpu_switch() also runs with external and decrementer interrupts disabled
by spinlock_enter().  Thus this does not restore the post-release call
window that the 2015 change corrected.

Reviewed by:    jhb, jhibbits
Approved by:    jhb (mentor)
Fixes: https://cgit.freebsd.org/src/commit/?id=53607fe3cc8d ("Fix an extremely subtle concurrency bug...")
Fixes: https://cgit.freebsd.org/src/commit/?id=7a49d964d3f9 ("Merge r278429 from ppc64:")
Fixes: https://cgit.freebsd.org/src/commit/?id=8df2e5421468 ("powerpc: put the isync inside the TD_LOCK()...")
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D59742
0571d8a0cc606be9a216439b3cfea685b709d6ea Minsoo Choo 2026-09-16 19:37:01
amdsmu: Print how long system spent in S0i3
It's practical to have this printed out proactively, at least while this
is still very experimental.

Sponsored by:   The FreeBSD Foundation
cd96657b6708e42caa55531f8118bff6dcb38769 Aymeric Wibo 2026-10-13 21:20:23
snd_hda: use the pin ELD to select DisplayPort audio framing
hdaa_audio_setup() reads the converter widget's ELD when choosing
between HDMI and DisplayPort audio infoframes. ELD is stored on the
output pin, so the converter has no ELD and the driver selects HDMI
framing even when the connected display uses DisplayPort.

Read the ELD from the output pin to select the correct audio framing.

The equivalent change was tested on DragonFly BSD with an Intel Kaby
Lake display-audio codec and an LG HDR 4K monitor connected over
DisplayPort. Before the change, converter node 2 had no ELD, while
output pin 5 had an 83-byte ELD identifying DisplayPort. Captured driver
commands programmed HDMI audio infoframe bytes (84 01 0a 70 01 00 00
00). After applying the change and rebooting, the commands used the
existing DisplayPort form (84 1b 44 01 00 00 00), and console tones and
desktop audio were audible.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299094
Signed-off-by:  David Bidner <david@crap.solutions>
Reviewed by:    christos
MFC after:      2 weeks
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2463
29449b3e468cb1673814dc6452e82035b3c2a628 David Bidner 2026-10-03 14:04:32
amd64/vmm: Don't advertise support for performance counters
vmm doesn't implement them, and after commit 2272fac218a8
("hwpmc: Add support for AMD-only IRPERF in hwpmc PERF class"), FreeBSD
guests fail to boot since they access the unimplemented IRPERF MSR.

MFC after:      1 week
c83e075d72f62c91cb27dd644a62d6a6f5bd56ba Mark Johnston 2026-10-14 15:55:51
sound: Check for errors from sndbuf_resize()
Most implementations of CHANNEL_SETBLOCKSIZE and CHANNEL_SETFRAGMENTS
were not checking this.  This is probably not a big problem: it's
unlikely for sndbuf_resize() to fail due to the refcount check in this
case since it's operating on the hardware buffer, which doesn't get
mmaped.  But, I will add more reasons for it to fail in the next patch,
so let's be more careful.

This change modifies various CHANNEL_SETBLOCKSIZE implementations to
check for errors.  In some cases I reordered things to avoid updating
driver state until after sndbuf_resize() succeeds.

Return 0 from CHANNEL_SETBLOCKSIZE to indicate an error, as it otherwise
returns the new block size.  We could change the interface to return
both an error number and a block size, but that would break at least one
out-of-tree driver and I wish to avoid that here.  Make sure that errors
from CHANNEL_SETFRAGMENTS and CHANNEL_SETBLOCKSIZE are returned to
userspace.

Approved by:    so
Security:       FreeBSD-SA-26:71.sound
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60553
3545fc68f416ee6d3379e0a44ed9eb22fefee2ef Mark Johnston 2026-10-13 15:53:39
sound: Revalidate after reacquiring locks when resizing buffers
sndbuf_resize() and sndbuf_remalloc() drop the channel lock in order to
allocate the new buffer(s) with M_WAITOK.  Before doing that they verify
that the buffer is not mapped, but this could change while the lock is
dropped, as there is no higher-level synchronization which prevents
buffer resize (e.g., via the SNDCTL_DSP_SETBLKSIZE ioctl) from happening
concurrently with mmap.  Thus, these checks are insufficient.

Modify sndbuf_resize() and sndbuf_remalloc() to revalidate after
reacquiring the lock.  Extend them to check for a couple of channel
flags, mirroring the check in chn_resizebuf().  Modify chn_resizebuf()
to revalidate state after reacquiring the channel lock.

We could also allocate new buffers with M_NOWAIT and so avoid dropping
the lock.  Then, I think we could go even further and invoke
CHANNEL_SETBLOCKSIZE and CHANNEL_SETFRAGMENTS with the channel lock
held.  But really it would be better to ensure that dsp operations are
serialized; there is no reason for mmap and chn_resizebuf() to be able
to run in parallel, we should not be relying on the channel lock for
this.  So, let's keep a more minimal approach here.

Add a simple regression test.

Approved by:    so
Security:       FreeBSD-SA-26:71.sound
Security:       CVE-2026-101308
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60554
47d2d509c6b32b3c2245748f755fbf2344351d94 Mark Johnston 2026-10-13 15:54:07
machine/ieeefp.h: include <sys/cdefs.h>
The <machine/ieeefp.h> headers wrap their deprecated FPU control
prototypes in __BEGIN_DECLS/__END_DECLS but rely on the includer to
have pulled in <sys/cdefs.h>.  Including <floatingpoint.h> first on
arm, arm64, powerpc and riscv (or amd64 <machine/ieeefp.h> with
__IEEEFP_NOINLINES__) fails with "unknown type name '__BEGIN_DECLS'".
This breaks e.g. devel/py-pyinstaller.

Suggested by:   jhb
Reviewed by:    jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59659
9d50245a0f1333e10cc1c4dda16878cd79a7c42b Piotr Kubaj 2026-10-14 16:04:02
Commit group #1: iwm
iwm: add DQA (dynamic queue assignment)

This is the minimum set of DQA bits from iwm at the given openbsd
commit place.

* add a method to map ac to queue / ring
* use the DQA command queue if needed
* glue to wire it up

Locally tested:

* Intel 7260, STA mode
* Intel 9260, STA mode
* Intel 8260, STA mode
* Intel 3160, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60080
8d53176ef83dad3a0962cdffdae98871c0379c35 Adrian Chadd 2026-10-15 01:48:49

iwm: bring IWM_CSR_HW_IF_CONFIG_REG programming in line with openbsd

bring the iwm_nic_config() / IWM_CSR_HW_IF_CONFIG_REG programming
in line with openbsd.

Locally tested:

* 3160 STA mode
* 7260 STA mode
* 8260 STA mode
* 9260 STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60081
ed92055cb8e72d0a2055dc3e2f8fa96853c71d50 Adrian Chadd 2026-10-15 01:49:16

iwm: update phy context routines; add HT channel width parameter

Update the phy context routines to match what the openbsd snapshot
is doing.  This involves some HT channel width stuff which although
I am not doing HT right now, it was juts easier to sync these
entirely versus just a partial sync.

* Update the phy context routines to match what openbsd is doing
* Although the openbsd driver has an iwm_phy_ctxt_update() routine
  instead of add and modify, I'm leaving it as-is for now.
  A bunch of refactoring is going to need to be done to properly
  use an iwm_phy_ctxt_update() call and I didn't want to tackle
  that in here.
* Add a UHB firmware capability phy context call; I can't test it
  but it's mostly copy/paste.
* Add in a util to turn ieee80211_channel into the 'sco' variable
  (the HT low/hi parameter) since it's done in openbsd in a
  slightly different way.

Locally tested:

* 3160, STA mode
* 7260, STA mode
* 8260, STA mode
* 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60082
103a4f05c77feacacd4e8191b4bfc92a71d1673d Adrian Chadd 2026-10-15 01:49:33

iwm: add return status to set/clear prph bits

This brings these functions inline with OpenBSD

Locally tested:

* 3160, STA mode
* 7260, STA mode
* 8260, STA mode
* 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D60211
c27ed49a46f8cc4228ed7d420b703b4872ee46d7 Adrian Chadd 2026-10-15 01:50:15
acpi_apple: Apple platform ACPI driver,
handles wake-on-LAN arming and lid state on the PCH
PMC/GMUX platform instance, and panel backlight
control on the PNLF instance, registering with
backlight(9).

Reviewed by:    ziaee, adrian
Differential Revision:  https://reviews.freebsd.org/D58867
d7d237ce731f0897107ca0f9301b4cef1846a182 Abdelkader Boudih 2026-10-15 13:03:22
powerpc64: give each CPU its own KDB trap stack
Kernel mode program, trace, breakpoint and machine check exceptions go
through dbtrap, which saves the registers on trapstk and, if KDB doesn't
want the trap, restores them from there and continues with the normal
trap handler. There was just one trapstk for all CPUs, so when two of
them trapped at the same time they overwrote each other's frame and one
of them carried on with the other's registers. DTrace fbt probes are
these traps, so a probe on a function that runs on several CPUs at once
took the kernel down within seconds.

Keep the stack in the pcpu instead. The boot CPU gets a static one,
since it's set up before malloc works, the others allocate theirs in
cpu_pcpu_init() like the Book-E critical interrupt stack.

Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60362
eaaf838e33042ed3f282a5cdf8e1260e78d4989b Piotr Kubaj 2026-10-15 14:27:59
Commit group #2: iwm
iwm: add qenablemsk to track enabled TXQs

This isn't yet used by anything; it's a precursor to TX queue
tracking needed for dynamically assigned TX aggregate queues.

Tested:

* 3160, 7260, 8260, 9260, STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60286
05635ccc575bcd395e3f2bf23dee7f91778f1c73 Adrian Chadd 2026-10-16 03:52:57

iwm: add phy/mac context tasks; clean up task stop; add net80211 MAC methods

* Add phy/mac tasks, the phy task is currently a placeholder
* Add in the MAC methods from net80211 that are called whenever
  the VAP mode needs updating
* Mark the hardware as STOPPED during shutdown so scheduled tasks
  don't run

The fun side of this work:

* detaching net80211 causes the parent method to be called which leads
  to iwm_stop() being called, and at least one of the entry paths
  into iwm_stop() has IWM_LOCK held, and we can't do a taskqueue_drain()
  or taskqueue_drain_all() call with any lock held as it will sleep.

* the net80211 detach path is calling at least one of the MAC methods
  during detach, and since the taskqueue is being deleted /before/
  the net80211 detach path, we have to make sure nothing is actually
  going to do taskqueue work after that!

* STOPPED in FreeBSD is MOSTLY doing the same as SHUTDOWN in OpenBSD.
  It should be fine enough for this.

Locally tested:

* 3160/7260/8260/9260 STA mode - create, ctrl-C wpa_supplicant;  create,
  destroy; create, unload; create, destroy, unload.  The create+unload paths
  generate interesting net80211 tear down states which were causing
  issues here.

Differential Revision:  https://reviews.freebsd.org/D60607
401434a46c1067dd5fea8ba5e4886efb66c47908 Adrian Chadd 2026-10-16 03:53:19

iwm: add iwm_enable_ac_txq(); use it for command queue setup

Port iwm_enable_ac_txq() from OpenBSD.  It's effictively the
command FIFO path in the existing iwm_enable_txq().

The OpenBSD driver does a bunch of TX aggregation queue setup in
iwm_enable_txq() which isn't relevant here just quite yet and
it doesn't currently hurt to leave the existing one here
whilst I figure out the next steps.

Locally tested:

* 3160, 7260, 8260, 9260 - STA mode

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Differential Revision:  https://reviews.freebsd.org/D60696
0a12ff65b9647a6e31471e5d27a8692b4adb6803 Adrian Chadd 2026-10-16 03:53:55

iwm: rename iwm_stop_session_protection() -> iwm_unprotect_session()

This matches OpenBSD's driver naming.

Obtained from: OpenBSD a6e25c727a2214219715b51ba6af2221d7e0d674

Reviewed by:    mizhka
Differential Revision:  https://reviews.freebsd.org/D60287
a7195567fdadb929cfddd190a9666a75ed7652d4 Adrian Chadd 2026-10-16 04:16:32
pty: preserve O_NONBLOCK when opening /dev/ptmx
ptmx_fdopen() masks the supplied file flags to FREAD | FWRITE before
passing them to pts_alloc(). This discards FNONBLOCK even when the
caller explicitly requests O_NONBLOCK.

As a result, open("/dev/ptmx", O_RDWR | O_NOCTTY | O_NONBLOCK) succeeds,
but the returned file is blocking. F_GETFL reports O_NONBLOCK cleared,
and a subsequent read can block instead of returning EAGAIN when no
data is available.

This causes Linux xfce4-terminal/VTE running under Linuxulator to
freeze. VTE opens the PTY master with O_NONBLOCK and relies on
nonblocking reads while draining terminal output. Once the available
data has been consumed, the main UI thread blocks in ptsdev_read(),
leaving the window unresponsive even though the child shell has
started successfully.

Include FNONBLOCK in the flags passed to pts_alloc(). Blocking opens
retain their existing behavior. No change to posix_openpt(2) flag
validation is required.

The flag loss also reproduces with a native FreeBSD program, so the
problem is in the shared /dev/ptmx implementation rather than Linux
syscall flag translation.

Validation:
- Before the fix, a native FreeBSD reproducer observes O_NONBLOCK
  cleared after opening /dev/ptmx with that flag.
- Explicitly setting O_NONBLOCK with F_SETFL works, confirming that
  nonblocking PTY operation itself is supported.
- After the fix, F_GETFL preserves O_NONBLOCK when requested and
  leaves it cleared for a blocking open.
- xfce4-terminal in the Linux jail displays the shell prompt and
  accepts input.

Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60700
495bc1924edfd474c479df61ec35bdf6a83a8d17 Vladimir Grebenshchikov 2026-10-12 18:31:30
machine/floatingpoing.h: harmonize all arches
Reported by:  fluffy
Reviewed by:    jhibbits (previous version)
Discussed with: imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60255
43c79c64af480dad96ba8cf73fb010239dd088d2 Konstantin Belousov 2026-10-02 19:42:07
acpi_apple: rename source files to match the driver name
The driver, module, kernel option and manual page are all named
acpi_apple, but the sources lived in sys/dev/apple_acpi/ with an
apple_ prefix. Every other vendor ACPI driver in the tree uses the
acpi_<vendor> form for both the directory and the file names.

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60792
44ceda0a53bfe0c9b343f1e94a4f6ce67f427be6 Abdelkader Boudih 2026-10-17 19:48:49
acpi_apple: make the device mode a typed enum
The two mode values were spelled as bit flags, but a device is exactly
one of the two and the dispatch compared the field for equality.

Turned them into an enum, type the softc field with it, and dispatch with
a switch that lists every value

No functional change.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60793
4a059dac78157e6163d6e8ed6e7be5ec65a78a5f Abdelkader Boudih 2026-10-17 19:49:19
Commit group #3: iwm
iwm: fix incorrect mutex / crash use during error detach path

My previous commit (b3ef4013a4) added a couple of lock assertions.
However, the detach assertion is wrong - if the driver hasn't
attached then detach needs to be a no-op and this includes
not touching a deinit'ed mutex.

So, move the mutex check and use until after the attached check.

This fixes the driver crash I saw when another bit of in-flight
work caused attach to fail, and thus iwm_detach() -> iwm_detach_local()
ended up trying to use a deinit'ed mutex, leading to a crash.

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

Differential Revision:  https://reviews.freebsd.org/D60821
37337c4994745b8143f240fd1b9f64c4255b58fc Adrian Chadd 2026-10-17 21:31:45

iwm: ensure NIC is alive during txq enable

I broke this in a previous commit.  OpenBSD already has the NIC
nailed alive but FreeBSD's codebase currently does not.

Locally tested:

* 7260, 9260, STA mode

Fixes: https://cgit.freebsd.org/src/commit/?id=0a12ff65b9647a6e31471e5d27a8692b4adb6803

Differential Revision:  https://reviews.freebsd.org/D60823
176fd23c88e8f7e3736389547c4a2990736911e7 Adrian Chadd 2026-10-17 21:32:01

iwm: mask closed_rb_num to the RX ring size

iwm_notif_intr() reads hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff and
loops while (sc->rxq.cur != hw) without masking hw to the ring size (512 entries
for 9000-series MQ RX, 256 for legacy). If the hardware reports a value at or
above the ring size, cur never equals hw: the loop walks stale ring entries
indefinitely and the write-pointer update uses a bogus index. Linux iwlwifi
masks the value (5eae443eb5e2) and OpenBSD has done the same since 9000-series
support was added (3287dca4fa10).

This was found while debugging an iwm crash on another BSD using the same
driver lineage (DragonFly, upstream bug 3449)

Locally tested:

* 7260, 9260, STA mode

PR: kern/https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299427
Submitted by: David Bidner <david@crap.solutions>

Differential Revision:  https://reviews.freebsd.org/D60824
461da47e45e7f8ef8754875f4820d3855e7f4097 Adrian Chadd 2026-10-17 21:32:51
null.c: fix signature mismatch for null_read
Reviewed by:    jhb
Differential Revision: https://reviews.freebsd.org/D49168
7af3fd0993a49cce7a749dfb62e9b17ca3a6be1f ShengYi Hung 2025-02-28 14:56:45
powerpc: keep the VSX halves of the FPRs across back-to-back signals
grab_mcontext() only put the second halves of vs0-31 into the context
while the thread owned the VSX unit, but sigreturn(2) gives ownership
up so that the next use reloads the registers lazily. A signal that
arrives right after a sigreturn, like one the handler's mask was
holding back, got a context without them and its own sigreturn then
zeroed them in the PCB.

The halves saved in the PCB are current whenever the FP state is, since
VSX instructions can't run without PCB_VSX and save_fpu() stores them
in that case, so export them together with the FP registers.

Reviewed by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60754
64b2fea9a2f90c2cc6097ed2d69acbfeeb13058d Piotr Kubaj 2026-10-15 19:18:16

Networking

Network-related commands, library, and kernel.

pf: Drain the overload task before a vnet's rules are freed
pf_src_connlimit() queues an entry for pf_overload_task() when a
source exceeds max-src-conn or max-src-conn-rate and the rule has an
overload table.  The entry holds a pointer to the rule, and the task
runs from taskqueue_swi with the vnet of the queue.  Nothing drained
the task when the vnet went away: an entry queued just before could
be applied to a rule pf_unload_vnet_purge() had freed, or to a vnet
that was gone.

Drain the task at the start of pf_unload_vnet_purge(), before the
unlinked rules are freed.  No packet can queue another by then, as the
hooks are already removed.

Reviewed by:            kp
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60529
92d66a6b474fa6fe42fbe08002803d79a5af6594 R. Christian McDonald 2026-10-12 11:52:34
Commit group #4: pf
pf: do not free the caller's ruleset when attaching a table fails

pfr_attach_table() takes a struct pf_ruleset * from its caller and, on its
own error paths, calls pfr_destroy_ktable() on the table it just made.  That
drops the table's reference on the ruleset and calls
pf_remove_if_empty_ruleset(), which may unlink and free the anchor the
ruleset is embedded in -- and then pfr_attach_table() returns NULL to a
caller still holding the pointer.

Reached from userland with DIOCADDRULE and a PF_ADDR_DYNIFTL source, after
DIOCSETLIMIT has lowered PF_LIMIT_TABLES to one item of headroom: the first
pfr_create_ktable() takes it and the root table's fails.

Hold a table reference on the ruleset for the duration instead, so the
ruleset outlives every failure path inside pfr_attach_table() and stays the
caller's to remove.

OK sashan@

Obtained from:  OpenBSD, gnezdo <gnezdo@openbsd.org>, e0a25791f4
Sponsored by:   Rubicon Communications, LLC ("Netgate")
25f04bf42786806e2661b7a09c283b83f568380a Kristof Provost 2026-10-12 08:00:11

pf: check extension header length.

pf_walk_header6() advances the packet offset for each IPv6 extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  When used with af-to rules,
this could trigger a panic: m_copydata: null mbuf.

from Acts1631; OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, 6d56112588
Sponsored by:   Rubicon Communications, LLC ("Netgate")
ccb19b359aae4b7e7315ad61d33d9a35d85849d1 Kristof Provost 2026-10-12 12:25:07

pf: check AH header length.

pf_walk_header() advances the packet offset for each AH extension
header.  It was not checked that this does not exceed the packet
length if no next header was processed.  Fix it like in IPv6.

OK henning@ sashan@

MFC after:      1 week
Obtained from:  OpenBSD, bluhm <bluhm@openbsd.org>, fcd4e5522e
Sponsored by:   Rubicon Communications, LLC ("Netgate")
b4d2c9835c0edfddd1d6742afa86d4873ccfad16 Kristof Provost 2026-10-12 12:28:22
pf: Change source limiter tables from a task
pf_source_used() puts a source in the table of its source limiter when
the source has more states than the high-water mark, and
pf_source_rele() takes it out again below the low-water mark.  Both
changed the table in place: pf_source_used() from pf_create_state(),
with the rules lock held for reading, and pf_source_rele() from
pf_remove_state(), with no rules lock at all.  A table may only be
changed with the rules lock held for writing, as packets look addresses
up in its radix tree at the same time.  With INVARIANTS the first
insertion panics ("Lock pf rulesets not exclusively locked" in
pfr_route_kentry()); without, the tree can be corrupted.

Queue the changes instead, as pf_overload_task() does for overload
tables, and make them from a task with the rules lock held for writing.
An entry names the limiter by its id and remembers its table: the
limiter, or its table, may be gone or replaced by the time the task
runs, and then the entry is dropped.  pfsr_intable changes only once
the change is queued, so a failed allocation is retried the next time
the source crosses a mark; a removal is also retried when the source is
purged.  Drain the task when a vnet goes away, after its last state.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=461648121230 ("pf: introduce source and state limiters")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60526
6bc57500b8b700a3d9998fd417fdee653f93366d R. Christian McDonald 2026-10-12 16:47:21
iflib: unify prefetching
This change makes all prefetching use the iflib prefetch wrappers, rather
than using prefetch() in some places and __builtin_prefetch() in others.

Note that __builtin_prefetch() does not work in the kernel on amd64 as clang
disables it when -mnosse is specified, so we must use the asm directives there,
and builtin_prefetch() elsewhere.

This change enables prefetching on non-x86 (notably arm64), and it enables
prefetching in netmap that has been there since day one, but which has never worked.

This is a no-op on non-netmap amd64 and i386

Differential Revision: https://reviews.freebsd.org/D60602
Reviewed by: glebius, kbowling
Sponsored by: Netflix
cdd95034d6f4b5a7abe7d21b2b1a568fa5e906a0 Andrew Gallatin 2026-10-12 19:50:15
pf: first-match-wins for nat rules, even in anchors
Ensure we stop evaluating nat rules if we find a match in a nat-anchor.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299320
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")
b5219c068fbc133dde91d5cf48423e34ce27bd4f Kristof Provost 2026-10-13 12:40:58
pf: Set the reassembly flags under the rules lock
DIOCSETREASS stored V_pf_status.reass twice with no lock, first the
flags it was given and then, if reassembly was not among them, zero.
pf_normalize_ip() and pf_normalize_ip6() read the flags with the rules
lock held for reading, so a packet could see the intermediate value.
Compute the flags first and store them once, with the rules lock held
for writing, as DIOCSETDEBUG and DIOCSETHOSTID do.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=39282ef356db ("pf: backport OpenBSD syntax of "scrub" option for "match" and "pass" rules")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60531
b951994eddd4d274514df751da06680a32139037 R. Christian McDonald 2026-10-13 13:39:30
pf: Parse the GETSTATES state id as 64 bits
The GETSTATES dump sends PF_ST_ID as a u64, but the request parser
reads it as a u32 and rejects an id taken from the dump with EINVAL.
Nothing in base sends PF_ST_ID.  Parse and document it as a u64.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60543
74d2a0b79ffd8d43da61eaca36b39935594d8772 R. Christian McDonald 2026-10-13 14:53:10
pf: Free a table entry that cannot be routed
pfr_insert_kentry() returned the error of pfr_route_kentry() and
leaked the entry it had created; pfr_insert_kentries() stopped at the
first entry it could not route and leaked it and the rest of the work
queue, which no caller frees.  Destroy an entry that cannot be routed
and go on with the next.

Reviewed by:            kp
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60532
989d72fd3d35daa6a056afdd0c6b0aba4c5d8ccf R. Christian McDonald 2026-10-13 15:53:00
pf: Do not corrupt neighbour advertisements when translating
When an ICMPv6 query or reply matches a translated state,
pf_test_state_icmp() copies the state's virtual id into icmp6_id.  Only
echo messages have an identifier there.  For all other types the
virtual id is 0 and those two bytes hold something else; in a neighbour
advertisement they hold the R, S and O flags.  The checksum was not
updated either, so icmp6_input() dropped the advertisement as a bad
checksum.

Unicast NUD probes to a link-local neighbour, such as the default
router, are sent from the link-local address.  With a nat rule that
matches it (e.g. "from any"), every advertisement answering a probe was
dropped: NUD failed, the neighbour cache entry was deleted, and traffic
to the neighbour stalled until it was resolved again.

Only rewrite the id of echo messages, as the ICMPv6 error path already
does, and update the checksum, as the IPv4 path does.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=f1ddd7f1dae6 ("pf: add forgotten fixup for icmp6 id's when translating")
See also:               https://redmine.pfsense.org/issues/16236
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60542
a6e1dde287eb3854873224200cea40996b0b5cbf R. Christian McDonald 2026-10-13 15:58:55
pf: Do not hash pool address pointers into rule hashes
pf_hash_pool() hashes the first address of a pool as a whole struct
pf_addr_wrap, including the union that holds the kernel's pfi_dynaddr
or pfr_ktable pointer.

An interface pool such as "-> ($ext_if)" gets a new pfi_dynaddr on
every load, so with "set keepcounters" the rule never matches its
predecessor and loses its counters on every reload.  The pointers also
differ between hosts: once a filter rule in the main ruleset has an
interface or table pool, pfsync peers disagree on the ruleset checksum
and bind every synced state to the default rule.

Hash the address with that union cleared.  The rest of the address,
including the prefix length of an interface address, is hashed as
before, and the hash of a rule with a plain address pool does not
change.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=c6bcf6e6fd50 ("pf: include all elements when hashing rules")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60370
e6dc001d7a387100125718322fa741444a9025fc R. Christian McDonald 2026-10-13 19:17:48
pf: Register the netlink family only while the vnets are set up
pf_modevent() registers the generic netlink family at MOD_LOAD, before
vnet_pf_init() has set up the state hashes and locks the handlers use,
and pf_unload() unregisters it after vnet_pf_uninit() has torn them
down.  Sending PFNL_CMD_GETSTATES while pf loads or unloads panics in
pf_handle_getstates() on a NULL or freed V_pf_idhash.

Register the family from a SYSINIT ordered after vnet_pf_init(), and
unregister it from the matching SYSUNINIT, before vnet_pf_uninit().

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60651
68831d2a2cbb34e8daf24db7e4e15b8c09451f85 R. Christian McDonald 2026-10-13 19:22:30
ipfw: re-arrange declarations so that they match comments
No functional change.
a20bbabe343148c1a6d4b234c05fbcc9916c840d Gleb Smirnoff 2026-10-13 19:51:53
netinet: garbage collect __IPPROTO_DIVERT
90c8c8e451058289660e798b242ff5d27f9e7d1e Gleb Smirnoff 2026-10-13 19:51:53
tcp/rack: Fix a potential overflow in rack_update_pcm_ack()
The RACK stack's path capacity measurement module maintains an array of
samples, updated when the stack receives an ACK.  The array grows as
needed, but code which handles the expansion is susceptible to remotely
triggerable overflow.  This could lead to underallocation and a ~512KB
out-of-bounds write.

Fix this by bounding the sample array size.

Approved by:    so
Security:       FreeBSD-SA-26:70.tcp
Security:       CVE-2026-101307
Reviewed by:    glebius, markj
Reported by:    Nozomi Networks Security Research
9a406a9ec399cced14ce5d204ba3fd383544b47f Michael Tuexen 2026-10-12 18:55:21
pfsync: use result of m_pullup()
f84cdc2584305f8b656ce3f3746868c4a58a9a82 Gleb Smirnoff 2026-10-15 04:50:41
pf: Remove a table entry regardless of its mark
pfr_remove_kentry() returns without removing an entry whose mark is
set.  The mark is scratch space for the operations that handle a list
of addresses: each resets it before use and leaves it set on the
entries it kept, so after "pfctl -T replace" or "pfctl -T zero" of an
address the entry stays marked.  An address a source limiter put in
its table is then never taken out again when the source falls below
the low-water mark.

Remove the entry whether it is marked or not; nothing else is in the
work queue.

Add a regression test.

Reviewed by:            kp
Fixes:                  https://cgit.freebsd.org/src/commit/?id=461648121230 ("pf: introduce source and state limiters")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60530
f4fe4c3d17f9bb523981b88a01d7c0f0c0f00c36 R. Christian McDonald 2026-10-15 18:10:11
pf: only log that we're not creating a tag in verbose mode
While here get rid of the aesthetically unpleasing '== false' construct.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
294dc0464c3b68e8308d8c6ac93cf6b31e433a00 Kristof Provost 2026-10-13 14:31:01
sctp: improve locking validation
Ensure that the TCB lock is hold in sctp_calc_rwnd().

Reviewed by:    tuexen
MFC after:      1 week
MFC to:         stable/14
MFC to:         stable/15
38479a4832789c239eb1ff097ee51e93e8084315 Lukas Book 2026-10-16 07:46:16
loopback: set MTU to IF_MAXMTU
It was temporarily reduced in af78195e0024 in 1994 to hide some bugs with
signed short overflow.  We believe all these bugs were sorted out by
today. :)

Note that earlier ba582a82b0e36 reduced the MTU be rounded to a longword
with a reference "NFS likes it to be rounded".  We have had several
refactors of the NFS code since that.

Reviewed by:            pouria, zlei, tuexen
Differential Revision:  https://reviews.freebsd.org/D59450
a44c11974c82a01c767a33332177a39fd65616fe Gleb Smirnoff 2026-10-16 21:08:36
ipfw: cleanup SYSINIT(9)s
Make them all belong to SI_SUB_PROTO_FIREWALL and explicitly specify
order.  Prefer SYSINIT() over modevent, for those subsystems that don't
have dependencies.  All subsystems just depend on the main module and they
don't depend on each other, except dummynet which also has submodules.
Thus, keep DECLARE_MODULE() only for the main module and dummynet.

Differential Revision:  https://reviews.freebsd.org/D60685
9bcc1e97dda8e926483b81874884211bbe4f36e9 Gleb Smirnoff 2026-10-16 21:09:05
net*: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979.  It became obsolete in 1989,
when ANSI C introduced void *.

What's left:

* ioctl(9) KPI still uses caddr_t, thus network related ioctl method
  still use it.
* if_clone KPI, to be done separately.
* bpf(4), to be done separately.
* SCTP, let maintainers decide.
* iflib(4), let maintainers decide.

Reviewed by:            zlei
Differential Revision:  https://reviews.freebsd.org/D60738
d7cf2e714e29a52264fa4bc67e7d727948003afb Gleb Smirnoff 2026-10-16 21:16:27
tcp/rack: reject wma_divisor values <= 0
The net.inet.tcp.rack.measure.wma_divisor sysctl is the divisor
of the goodput weighted moving average used when the dynamic
goodput multiplier is enabled.  Setting it to 0 panics the kernel.

Make the variable and the sysctl unsigned, reject 0 and values
above INT32_MAX.

MFC after:      1 month
Found with:     Claude Code Opus 5.5
Reviewed by:    tuexen, glebius, markj (early version)
Differential Revision:  https://reviews.freebsd.org/D60759
7668705cb9837d4c3a6db9b3434b3a522220c8ea Maxim Konovalov 2026-10-16 22:15:00

System administration

Stuff in man section 8 (other than networking).

Commit group #5: tests: add UFS synchronous write durability tests
tests: add UFS synchronous write durability tests

Check that once fsync(2), fdatasync(2), or a write(2) with O_SYNC or
O_DSYNC returns, the new data, the file size and every block pointer
leading to the data are on disk.  The cases append a block, fill a hole,
append the first block that needs an indirect block and append below an
existing indirect block.  Two more append after another write left a
new direct block unsynced, which with soft updates cuts the size and the
later pointers of an inode written meanwhile.  With O_SYNC and O_DSYNC
on soft updates, those also check that the open already made the
unsynced block durable.
Each case runs on UFS without soft updates, with soft updates and with
SU+J.

The file systems live on md(4) and the checks read the inode, the
indirect block and the data block straight from the device with libufs
right after the synchronous call returns.  There is no cache in front
of the disk device, so this shows what would survive a crash at that
moment without having to crash anything.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    pho
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
afe1dec7425c9f3bec1aafcfed15229a385894eb Maxim Sobolev 2026-10-13 02:45:12

tests/sys/fs/ufs/sync_test.c: hide the alignment warning

Reported and tested by: dhw
Fixes:  https://cgit.freebsd.org/src/commit/?id=afe1dec7425c ("tests: add UFS synchronous write durability tests")
Sponsored by:   The FreeBSD Foundation
af08f29e5fc05d1e67370b36800b20ac95937a51 Konstantin Belousov 2026-10-13 12:17:57
safe_eval.sh: safe_set_var add allow list for values
Complete the controls with -v "values":

sh ./safe_eval.sh set_var -a "knob" -v "no yes" knob=yes knob=no knob=ok ok=yes
knob=yes
knob=no
denied value 'ok' for 'knob'
denied variable 'ok'
5efc40dd13a7ebd17fe79ab40a424ad894316675 Simon J. Gerraty 2026-10-13 23:05:21
debug.sh avoid trouble from set -e
The setting of _TTY ran afoul of set -e.

Also the handling of Myname blew up if debug.sh included by
a login sheel (eg in .profile).

For non-posix shell, leave false alone if it is a builtin.
064edc2ceb77389d17655c8aa347084e10d64add Simon J. Gerraty 2026-10-13 23:08:15
hooks.sh allow running DebugO{n,ff} from hooks_run
We need to watch out for _debugO{n,ff}_hooks.

Also add add_list (hook lists are just lists).

Fix bug in hooks_has() - should look for $2 in list.
34e92fb6bd8da6569c90ae9ee79c9a01890b8a6b Simon J. Gerraty 2026-10-13 23:59:32
Commit group #6: bhyve
bhyve: Fix handling of the xhci event ring

rts->erst_p and rts->erstba_p are pointers to guest-controlled memory
which describe the event rings and pending event array, respectively.
The device model was not validating the size nor saving the value.
As a result, the bounds checks in pci_xhci_insert_event() were
susceptible to TOCTOU races.

Fix pci_xhci_rtsregs_write() to save the ring size in a softc field.
Validate that the size isn't larger than the maximum allowed by the XHCI
specification (64KB, or 4096 TRBs).

When processing TRBs, make sure we don't load fields more than once.
Make sure that pci_xhci_trb_next() doesn't return a pointer to host
memory.  When handling ERDP writes, make sure that the guest-supplied
address is actually a pointer into the TRB array, and ignore the write
if not.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101309
Reported by:    Brian Delgado from Intel using Anthropic Opus 4.8
Differential Revision:  https://reviews.freebsd.org/D60677
1d14ab14dd72f5141eddce84df8ec5b74dbb8cd7 Mark Johnston 2026-10-13 19:56:47

bhyve: Improve HDA stream descriptor validation

The length of each block in the stream must be non-zero.  This is
assumed in hda_transfer(), otherwise an out-of-bounds read or write is
possible.

Use atomic loads to access stream descriptor fields, since they are
guest-controlled.  Make sure that the descriptor array is suitably
aligned so that we can drop the __packed annotation from the structure
definition; per section 3.3.42 of the HDA spec the BDL pointer is
supposed to be 128-byte aligned, in fact.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101310
Reported by:    Brian Delgado from Intel using Anthropic Opus 4.8
Reviewed by:    christos
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60678
81b9fcfa0bbca2f9931a9b9a5e6fde0972f08cfa Mark Johnston 2026-10-13 19:58:36

bhyve: Fix handling of framebuffer resizing

The rfb code maintains an array of CRCs for 32x32 tiles in the
framebuffer.  This array is sized statically based on the rfb code's
notion of the maximum framebuffer size, which changed in commit
fb51ddb20d57 without updating the rfb code.

Morever, writes to the framebuffer BAR can modify the recorded height
and width of the framebuffer.  These values were not validated against
the maximum at all, unlike the parameters set via bhyve config.

Fix these problems:
- Define the maximum width and height in a shared header file so that
  they do not get out of sync again.
- In pci_fbuf_render(), don't resize the console if the new dimensions
  are too large.
- Add a mutex to synchronize framebuffer BAR I/O with the rfb thread.

Approved by:    so
Security:       FreeBSD-SA-26:72.bhyve
Security:       CVE-2026-101311
Fixes:          https://cgit.freebsd.org/src/commit/?id=fb51ddb20d57 ("bhyve: increase fbuf display resolution limit")
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60680
ac6f9513b210097410dcd6f44e9523f990ba7b92 Mark Johnston 2026-10-13 19:59:10
ggate: fix test intermittency
* ggatel: fix piped output.  Flush stdout before daemonizing, so the
  output can be read when it's in a command pipeline.

* ggated: bind the port _before_ daemonizing, so an invoking script can
  be sure that the port is bound as soon as the command returns.

* tests: allow ggatec or ggatel to automatically allocate a device
  number instead of choosing one in a racy way.

With all of these changes I can no run the tests 1000 times without
fail.  And in parallel, too.

MFC after:      1 week
Sponsored by:   ConnectWise
PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298942
Reported by:    siva
Reviewed by:    ngie
Differential Revision: https://reviews.freebsd.org/D60707
802f5e4d6926f0be9294d71c6cadcbe872dbddf2 Alan Somers 2026-10-13 17:40:22
rtld: add .cfi_undefined lr to rtld_start.S on powerpc*
Without it, LLVM libunwind doesn't know where to stop when unwinding the
main thread, so it uses a stale LR as the return address and crashes.
Our libunwind doesn't do that since 5866c369e4fd reverted it, but
programs that bundle their own copy, like ClickHouse, are hit by it.

amd64, arm64, i386 and riscv already have the same annotation.

Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60740
c4fde87a3236b500246d4fce76dbca2a3d64f73a Piotr Kubaj 2026-10-15 13:58:04
dhclient: Avoid out-of-bounds reads in check_classless_option()
The loop did not verify that the option buffer is large enough before
reading an address.

Reported by:    Andrew Griffiths <andrew@calif.io>
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60484
368a1bfcd49315e8dd3e56ca6744ce5d74ef737b Mark Johnston 2026-10-14 21:12:42
tcpsso: fix the level error messages
tcpsso incorrectly referred to the optname instead of
the level name/number.

MFC after:      2 weeks
c7cf285bb2069ff5adc3ca63dbdaf3deb0fe3aeb Maxim Konovalov 2026-10-16 21:29:17
sysrc: Be quiet when changing values
Make it easier for the rc group to facilitate having an option to fully
boot muted (à la OmniOS) without resorting to /dev/null redirections.

Reviewed by:    imp, dteske
Differential Revision:  https://reviews.freebsd.org/D46120
454e8ffbd237f05b08eadbe4b22abf4089799b83 Jose Luis Duran 2026-10-17 21:02:16
sysconf: report a truncated keyword match list
snprintf(3) returns the length that would have been written, so an
ambiguous prefix can fill the match buffer with no sign that names
were cut off.  Append " (truncated)" when that happens.  Drop the
empty statement when scanning option arguments: only a separate
argument consumes the next argv entry.

Bump sysconf(8) to 2.2.1.

Suggested by:   fuz
Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D60815
158c59210d9530af64b2bd6a08c7ffd216b243a8 Devin Teske 2026-10-18 15:43:37
bsdinstall: use the GPT label for swap in fstab
The GPT layout already labels the swap partition swapN, but fstab
named the disk device. That name changes when disks are added or
reordered, and swap does not come up until fstab is edited. Write
/dev/gpt/swapN instead, appending .eli when swap encryption is on.
Mirrored swap still uses /dev/mirror/swap, with the same suffix.

Submitted by:   Wanpeng Qian <wanpengqian@gmail.com>
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D32936
49e3c256e4619c56acc09660bc3c49b68ec32c20 Devin Teske 2026-10-18 19:06:48

Libraries

libpfctl: Return max_win and mss of state peers
The kernel sends PF_STP_MAX_WIN and PF_STP_MSS for both peers of a
state, but struct pfctl_state_peer has no fields for them and libpfctl
dropped them.  Add the fields and parse the attributes.

Reviewed by:            kp
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60544
9664345efb8bb598536fd069c0dd797fc60ce1d2 R. Christian McDonald 2026-10-13 14:48:15
lib/libifconfig: Fix pointer-sign warnings
Fix all pointer-sign warnings generated when compiling libifconfig.

A couple more snuck in while the previous batch of fixes was landing.

Fixes:          https://cgit.freebsd.org/src/commit/?id=963f1a5455c9 ("ifconfig: add CMIS support for 400GbE optics")
Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D60573
a3c57739ca07c655fbb0f9e7ddd38968186b8a76 Ryan Moeller 2026-10-13 16:41:52
libthr: Fix LIBPTHREAD_QUEUE_FIFO range
LIBPTHREAD_QUEUE_FIFO is used in bitwise offset, we set the limit to
0~31 so that it won't cause undefined behavior. Also, create a new
helper function to do getenv++strtol directly and check the boundary of
the valid value.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60487
5fb07bbcd5d5d9a865d9e7765fb93e9ba5edef1c ShengYi Hung 2026-10-08 18:53:06
libthr: Remove deadcode in join_common
The while loop previous can only be break when ret == ETIMEDOUT. They
never produce EBUSY. Remove the deadcode here.

Reviewed by:    kib
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D60711
a0e152973613e0d0d55257f4e1f614509b7ec4c9 ShengYi Hung 2026-10-13 19:41:00
sbuf(3): increase test coverage
This change adds additional explicit test coverage for the following
sbuf(3) APIs:
- sbuf_clear_flags
- sbuf_get_flags
- sbuf_set_flags

While here, add a missing `sbuf_delete` to `sbuf_drain_ret0_test`: while
it isn't strictly required (the library's state is cleaned up shortly
after the test process ends), tools such as Coverity and LSAN flag
issues with leaked memory. Adding the sbuf_delete(3) call to the test
quells that issue.

MFC after:      1 week
Reviewed-by:    ngie
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2367
642b3d965eb6ef3ecf733950e66fad565a27c967 Joao Bonifacio 2026-08-09 22:43:26
sbuf(3): clean up tests
- Update the copyright dates and add "Joao Bonifacio" to the top of
  `sbuf_core_test.c`.
- Use `SPDX-Identifier` instead of longform copyright tort.
- Remove `sbuf_test_common.h`: the header was originally added to help
  with the 10.x/11.x split, but is no longer needed given that those
  releases have been EOLed for multiple years now.

MFC after:      1 week
3593be37a49e3f5268259bcc2af58cf730b08335 Enji Cooper 2026-10-18 18:24:20

Filesystems

ufs: do not busy or reference the mount in ufs_sync_nlink()
With soft updates, mkdir(2), link(2) and rename(2) into a directory
whose i_nlink is at UFS_LINK_MAX while i_effnlink is below it call
ufs_sync_nlink1() to sync the file system and restart.  It busied the
mount with vfs_busy(mp, 0), which sleeps for as long as an unmount is in
progress.  The caller is still between vn_start_write() and
vn_finished_write() there, and the unmount, once it has set
MNTK_UNMOUNT, goes on to suspend writes in VFS_UNMOUNT() and waits in
vfs_write_suspend() for that write to end.  Neither could make progress,
and every later vfs_busy() of the mount, such as from getfsstat(2) or a
lookup crossing the mount point, hung behind them.

The window is wide: after setting MNTK_UNMOUNT, the unmount waits for
the busy references to drain, which includes another thread already
syncing in ufs_sync_nlink1(), and for vfs_periodic().  A forced unmount
of a file system with a directory at the link limit under mkdir/rmdir
load hits it within seconds.

This is the deadlock that 29d03af1e4da fixed for VOP_RENAME(), and the
same reasoning applies: the caller's vn_start_write() already keeps the
unmount from getting past the write suspension, before which
ffs_unmount() tears nothing down, so the mount point does not need to
be busied for VFS_SYNC().  The extra vfs_ref() taken by the callers is
not needed either: a successful vn_start_write() keeps the reference
that VOP_GETWRITEMOUNT() took until vn_finished_write() drops it.  With
both gone, ufs_sync_nlink1() was only VFS_SYNC() and ERELOOKUP, so
remove it and call VFS_SYNC() directly from ufs_sync_nlink() and the
two places in ufs_rename().

Fixes:  https://cgit.freebsd.org/src/commit/?id=8db679af66b0 ("UFS: make mkdir() and link() reliable when using SU and reaching nlink limit")
Fixes:  https://cgit.freebsd.org/src/commit/?id=bc6d0d72f4f4 ("UFS rename: make it reliable when using SU and reaching nlink limit")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60204
MFC after:      1 month
a6728314ff6d6c73cab55c5bbd0025ed4ab56d53 Maxim Sobolev 2026-10-13 03:57:26
Commit group #7: ufs
ufs: make fdatasync(2) and O_DSYNC writes update the inode

ffs_syncvnode() in the DATA_ONLY case and ffs_write() for IO_DATASYNC
decide whether the inode has to be written by testing IN_SIZEMOD and
IN_IBLKDATA against ip->i_flags, the chflags(2) word, instead of the
in-core state ip->i_flag.  IN_SIZEMOD and IN_IBLKDATA alias UF_READONLY
and UF_ARCHIVE, so for ordinary files the test was always false: after
an fdatasync() or an O_DSYNC write that extended a file or filled a
hole, the data blocks were on disk but the inode size and block pointers
were not, and a crash before the syncer got to the inode lost the
"synced" data.  Files with uarchive or urdonly set got a synchronous
inode write on every call instead.

journal_mount() has the same mixup and sets IN_MODIFIED in i_flags,
which leaves UF_OPAQUE set on the in-core .sujournal inode.  The
synchronous ffs_update() that follows writes the inode regardless, so
only the stray flag is fixed here.

Fixes:  https://cgit.freebsd.org/src/commit/?id=7428630b757 ("UFS: write inode block for fdatasync(2) if pointers in inode where allocated")
Fixes:  https://cgit.freebsd.org/src/commit/?id=52488b51489 ("Further evaluation of the POSIX spec for fdatasync()...")
Fixes:  https://cgit.freebsd.org/src/commit/?id=e7347be9e34 ("ffs: Support O_DSYNC.")
Fixes:  https://cgit.freebsd.org/src/commit/?id=113db2dddb7 ("Merge soft-updates journaling from projects/suj/head into head.")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
8ff663dde22fe9f50ba5d71d0237bec9b9b44683 Maxim Sobolev 2026-10-13 02:39:05

ufs: make fdatasync(2) write dirty indirect blocks

A data-only ffs_syncvnode() skips dirty indirect blocks on file systems
without soft updates, and with soft updates stops making passes once
only indirect blocks are left dirty.  Indirect blocks only get dirty
when the block pointers in them change, and those pointers are what
makes a newly allocated block reachable.  So when fdatasync() follows
a write that extended the file or filled a hole past the direct blocks,
the data and the inode size reached the disk but the pointer to the new
block did not, and a crash lost the "synced" data.  With soft updates
the indirect block was usually written once, with the new pointer
rolled back, and never rewritten.

POSIX requires fdatasync() to write the metadata needed to retrieve the
data, which 52488b51489 already acknowledged for the inode, so treat
dirty indirect blocks the same way for a data-only sync as for a full
one.  This restores the loop to what it was before 2f514f92cf0.  Plain
overwrites, the case data-only sync is meant to speed up, do not dirty
indirect blocks and still write neither them nor the inode.

Fixes:  https://cgit.freebsd.org/src/commit/?id=2f514f92cf0 ("Implement VOP_FDATASYNC() for UFS.")

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
1498efc4243e963503179547221335940e2aeded Maxim Sobolev 2026-10-13 02:41:27

ufs: flush soft updates dependencies for O_SYNC and O_DSYNC writes

For a synchronous write, ffs_write() writes the data buffers with
bwrite() and then the inode with ffs_update(vp, 1).  With soft updates,
a new block pointer can only reach the disk after the dependencies of
the block, such as the cylinder group map that allocates it, are
written.  Until then initiate_write_inodeblock_ufs[12]() and
initiate_write_indirdep() roll the pointer, and for an extending write
the size, back in the buffer being written.  Nothing in the write path
flushes those dependencies, so the inode went out with the old size and
pointers, ffs_update() cleared IN_SIZEMOD and IN_IBLKDATA, and a crash
before the syncer rewrote the inode lost data that O_SYNC or O_DSYNC
promised was on stable storage.  The same held for a new block below an
indirect block, which ffs_balloc() writes synchronously but with the
pointer rolled back.

When soft updates are enabled and the write allocated blocks, finish it
with ffs_syncvnode(), as fsync(2) and fdatasync(2) do: it flushes the
dependencies, rewrites the rolled back indirect blocks and writes the
inode, or for O_DSYNC only writes the inode when IN_SIZEMOD or
IN_IBLKDATA say it is needed.  The flags cannot tell whether the write
allocated anything, because allocating a block below an existing
indirect block sets neither, so compare the inode's block count before
and after the write instead.  A write that allocated nothing, such as
an overwrite of existing blocks, adds no dependencies of its own and
keeps writing only the inode, so that it does not pay for a sync of the
whole vnode.  ffs_syncvnode() only drops the vnode lock when it has to
resolve directory dependencies, which ffs_write() never sees.

ffs_syncvnode() also writes whatever other descriptors left dirty on
the vnode, so the first synchronous write after a lot of buffered
writes would pay for all of them.  To put that cost on the open
instead, where it is less unexpected for a descriptor opened for
synchronous writes, add ffs_open() and, with soft updates, sync the
vnode there when a regular file is opened for writing with O_SYNC or
O_DSYNC, the same way the writes would: a full sync for O_SYNC, a
data-only one for O_DSYNC.  It calls ffs_syncvnode() rather than
VOP_FSYNC(), whose softdep_fsync() may drop the vnode lock in the middle
of the open.  The sync on open only moves work that the writes would
otherwise do, so it is skipped rather than waited for when writes are
suspended, and its errors do not fail the open.  Without soft updates
the writes sync nothing but their own blocks and the inode, so there is
nothing to move and the open does not sync.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
26d84bb8bf9b4acd0aa80b0208c1ba4fc9646ff3 Maxim Sobolev 2026-10-13 02:42:31

ufs: do not let a rolled back inode write end a data-only sync

With soft updates, ffs_syncvnode() writes the inode between its passes
while buffers are still dirty.  That write can go out with new block
pointers rolled back, for instance a new indirect block whose contents
are only written in a later pass, yet ffs_update() clears IN_SIZEMOD
and IN_IBLKDATA because the write was synchronous.  A data-only sync
then decides at the end that the inode need not be written, and
fdatasync(2) or an O_DSYNC write that allocated the first indirect
block returned with the on-disk inode not pointing to it.

Note on entry whether a data-only sync has to write the inode, and base
the final write, done once all dependencies are flushed, on that alone:
nothing else can set IN_SIZEMOD or IN_IBLKDATA meanwhile, as the vnode
is locked.  A full sync always writes the inode last and was not
affected.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    kib
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60134
MFC after:      1 month
e8534ba3ad36b88e94de0a3174e9ab7ac04a929d Maxim Sobolev 2026-10-13 02:44:40
nfs_clvfsops.c: Set readahead to 15 for RDMA
MFC after:    1 month
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
5bf3e2a1411151b81eedfa19b263c8832c7f5d7a Rick Macklem 2026-10-18 23:33:45

Kernel

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

rms: Order a writer's stores before its readers see it leave
Readers check rms->writers without a fence, and rms_wunlock() drops
it with a plain store.  rms_wlock() interrupts every CPU before the
first writer blocks readers, but nothing orders them when the last
writer leaves: on a weakly ordered CPU a reader can see the count
reach zero and still read what the writer replaced, such as callbacks
of a module unloaded under the lock.

Fence every CPU before the last writer drops the count: rename
rms_wlock_switch() to rms_block_readers() and add
rms_unblock_readers(), a wrapper for cpus_fence_seq_cst().  Readers
stay fence-free; the cost lands on the rare unlock.

Reviewed by:            mjg
Discussed with:         kib
Fixes:                  https://cgit.freebsd.org/src/commit/?id=1f162fef76a0 ("Add read-mostly sleepable locks")
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60658
2b911d947b5c1157a495454123ea972a18e4743d R. Christian McDonald 2026-10-12 20:44:32
Commit group #8: mbuf: simplify m_free
mbuf: simplify m_free

The check for  (M_PKTHDR|M_NOFREE) was added by np@ in
"91d1b03d3617 Merge r254736 from user/np/cxl_tuning."
in order to support a clever rx mode optimization used
by cxgbe at the time.  That optimization was removed in
46e1e307edb6 several years ago.  This check is otherwise
unneeded and adds an extraneous test to every mbuf free,
so let's remove it.

Reviewed by: glebius, np
Differential Revision: https://reviews.freebsd.org/D60686
Sponsored by: Netflix
398254f9999eb1af5f0842570111d584aaf8d01a Andrew Gallatin 2026-10-12 21:32:52

pfil: Avoid potential mbuf tag leak

In '398254f9999e mbuf: simplify m_free' we removed tag processing
on m_free() of M_NOFREE mbufs. It is possible that a packet filter
could attach a tag to this stack mbuf and call m_free()
on it, meaning that 398254f9999e may have introduced a tag leak.

However,if a tag is attached without anyone calling m_free(), then
this leak was pre-existing.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D60686
Fixes: https://cgit.freebsd.org/src/commit/?id=398254f9999e
Sponsored by: Netflix
f4ff995e361fa72cea240c4dbac2d0931965c80f Andrew Gallatin 2026-10-13 13:01:26
Reformat the shutdown messages when debug.bootverbose is set
Reported by:  bz
Fixes:          https://cgit.freebsd.org/src/commit/?id=b551cb063c5 ("During shutdown, announce each file system")
MFC after:      1 week
Sponsored by:   ConnectWise
Differential Revision: https://reviews.freebsd.org/D59744
228d2ac511de3dda45c85a3af465c05b14c9162b Alan Somers 2026-09-16 21:37:30
mbuf: move leaf_rcv union farther back in the pkthdr
When the leaf_rcv union was introduced to support ktls RX offload in
4d88d81c3166 it was put at the front of the pkthhdr, and pushed the
more commonly accessed csum_flags and rsstype into the next cacheline.

Given that csum_flags is accessed on every pkt sent and every pkt freed,
but the leaf_rcv fields are only used for ktls rx offload, it makes more
sense to have csum_flags in a cacheline that is already likely to be hot.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D60691
Sponsored by: Netflix
9890a0d5e04a1b4cd398a52be6374734b9496cd3 Andrew Gallatin 2026-10-13 13:12:10
__FreeBSD_version: Bump for changing pkthdr layout
Changing the layout of the pkthdr requires external drivers
to be rebuilt, lest they access the wrong fields.

Sponored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60691
83f5b5c2eeba2a2d66d87d4367ca5406322386a4 Andrew Gallatin 2026-10-13 13:51:41
linuxulator: Accept 0 as signal in rt_sigqueueinfo
Linux allows 0 as a signal for rt_sigqueueinfo(2) the same as it does
for kill(2).  This is used to check for process existence and
permissions.

Allow this value through as a special case in linux_rt_siqgueueinfo the
same way as was done for linux_kill.

Before this change, lio_listio(3) would fail with EINVAL under
Linuxulator.  Now it is functional.

MFC after:      1 week
Reviewed by:    kevans
Approved by:    kevans (mentor)
Differential Revision:  https://reviews.freebsd.org/D60574
33d9fbf5f95301f6eefbbf7e7fd49b4e9c098919 Ryan Moeller 2026-10-13 16:42:45
linux: cap mount id to INT_MAX
linux stores mount id as a int32_t, using xor would make it becomes
negative in some cases. As a result, we cap the value to INT_MAX to
prevent getting a negative value from userspace.

MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D59202
23626eb9e3d61928358c9c813aa5a17e797ba404 ShengYi Hung 2026-08-26 20:44:47
ip_encap: Recompute flowid for packets received over tunnel
Packets decapsulated by a tunnel interface carry the NIC's flowid
computed over the outer tunnel tuple, which is the same for every
flow a peer carries. Therefore mpath nhop selection places all
traffic on one path.

Add encap_set_flowid() to ip_encap.c, which rehashes a decapsulated
IP packet on its inner addresses.

The feature is off by default and is enabled with the per-vnet
net.route.hash_inbound sysctl.

Reviewed by:    gallatin
Differential Revision:  https://reviews.freebsd.org/D60552
84f790e5b6ccca9d7253834b7dcac5f4432b2917 Pouria Mousavizadeh Tehrani 2026-10-09 11:08:44
epoch: Queue drain callbacks from each CPU's callback task
epoch_drain_callbacks() bound the calling thread to each CPU in turn
to queue a callback on that CPU's record.  Callers are often user
threads, such as kldunload or ifconfig destroy, and ULE does not
preempt a CPU-bound thread for a migrating thread of no better
priority, so each bind could wait out a time slice.  On an 8-CPU VM
with six busy loops running, destroying an epair interface took 1.5 s
and kldunload pflow 0.8 s.

Instead, set a request flag on each record and enqueue that CPU's
callback task, which queues the callback before it polls the record.
The task runs on the CPU's softirq gtaskqueue thread at PI_SOFT, which
preempts a busy user thread, so the request is served at once; the
caller no longer migrates.  Both operations now take under 10 ms, idle
or under load.

Reviewed by:            markj
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60646
fe90f180047bc2cb4d15d4a31033741add5f5d10 R. Christian McDonald 2026-10-14 00:16:35
newvers.sh: Report -dirty also with staged changes
We add -dirty to the uname version string if the tree does not match the
reported hash. Previously, staged but uncommitted changes were ignored.
Noted by naddy@ in D60606.

Reviewed by:    cperciva, imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60722
617c700abae7aba74777fca137458395936f5053 Ed Maste 2026-10-14 12:42:40
ktls: Take the receiving interface of each packet in sbappend_ktls_rx()
sbappend_ktls_rx() read the receiving interface of each packet header it
demotes from the chain's first mbuf, whose header it had zeroed on the first
pass. A chain of two packets or more thus had no interface, and a change of
input interface went unnoticed: the TLS receive tag stayed on the old interface
until a later append of one packet.
Read it from the packet being demoted, as the decrypted mark is.

Fixes: https://cgit.freebsd.org/src/commit/?id=fe8c78f0d202 ("ktls: Add full support for TLS RX offloading via network interface.")

Approved by:    gallatin
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60758
c9599b80015a50e66c907dc667334a53bc234dab Olivier Cochard 2026-10-16 04:32:29
ktls: Fix capability checks in ktls_reset_receive_tag()
IFCAP2_RXTLS4 and IFCAP2_RXTLS6 are bit numbers, not masks, so
ktls_reset_receive_tag() tested if_capenable2 against 0 for IPv4 and against the
RXTLS4 bit for IPv6. An IPv4 connection with NIC receive TLS offload thus never
got a new receive tag after its packets moved to another interface, and fell
back to software decryption for good.
c721694 fixed the same checks in ktls_alloc_rcv_tag(); use IFCAP2_BIT() here
as well.

Fixes: https://cgit.freebsd.org/src/commit/?id=fe8c78f ("ktls: Add full support for TLS RX offloading via network interface.")

Approved by:    gallatin, kib
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D60757
32a981471c0147ea494745477434807cf8b6dadb Olivier Cochard 2026-10-16 04:40:03
linux: preserve epoll descriptors across fork using KQUEUE_CPONFORK
Linuxulator implements epoll instances using kqueues. Currently,
epoll_create_common() creates the backing kqueue with copy-on-fork
disabled. When fork() copies the descriptor table, the kqueue is
omitted from the child's table.

This differs from Linux, where an epoll descriptor survives fork(),
including when it was created with EPOLL_CLOEXEC. That flag controls
descriptor lifetime across exec(), not fork().

The missing descriptor breaks dbus-daemon daemonization. The daemon
creates its epoll instance before forking and continues using the
saved descriptor number in the child. F_GETFD initially fails with
EBADF. Once another open reuses that number, subsequent epoll_ctl()
calls fail with EINVAL because the descriptor no longer refers to
an epoll instance. The daemon then exits, preventing applications
that depend on the session bus from starting correctly.

Enable KQUEUE_CPONFORK for epoll's backing kqueue. This preserves the
descriptor number and copies supported event registrations into the
child, allowing the daemonized process to continue using epoll.

This is a partial compatibility improvement, not a complete
implementation of Linux epoll inheritance. Linux parent and child
reference the same epoll instance, whereas KQUEUE_CPONFORK creates
independent queues. Consequently, registration changes and one-shot
event consumption in one process are not reflected in the other.
Applications relying on shared epoll state across fork still require
further work.

Validation:
- A static Linux x86-64 C reproducer fails under the original
  Linuxulator and passes on a real Linux kernel under QEMU.
- Before this change, the child loses its epoll descriptor with
  both EPOLL_CLOEXEC enabled and disabled, while ordinary pipe
  descriptors survive.
- After this change, descriptor flags, inherited readiness and
  event data remain available in the child. epoll_ctl() also
  succeeds after allocating additional descriptors.
- Both dbus-daemon --session --fork and dbus-launch start
  successfully and answer a ListNames request from a separate
  client.
- Shared-state regression tests still fail for parent visibility
  of child ADD/MOD/DEL operations and EPOLLONESHOT consumption,
  documenting the remaining semantic differences.

Reviewed by:    kib
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60783
b3836322a1e6863734427ac9c01381ab25458126 Vladimir Grebenshchikov 2026-10-12 18:40:23
linuxkpi: implement irqs_disabled
This adds a function which is used from various places in drm-kmod
to detect if the code can sleep or not. Currently, these locations
(such as intel_guc_send_busy_loop) are ifdeffed to freebsd specific
solutions (usually drm_can_sleep).

This change implements irqs_disabled. We check td_pinned as spinlocks
will call sched_pin, and td_critnest to check if we are in a critical
section.

Approved by:    wulf, khng (mentor)
Differential Revision:  https://reviews.freebsd.org/D57782
4f2f26fb1e8aefb529e6186d8f39e1255dc98036 Austin Shafer 2026-06-23 18:55:31
mbuf: remove remnants of caddr_t
caddr_t is a typedef for a character pointer (char *) that originated in
Version 7 Unix, released by AT&T in 1979.  It became obsolete in 1989,
when ANSI C introduced void *.

There is a lot of code that uses m->m_data for arithmetics, thus we can't
switch it to void * easily.  Let's at least stop proliferation of caddr_t.
We have developers that are twice younger than obsoletion of this type.

Reviewed by:            zlei, tuexen, adrian
Differential Revision:  https://reviews.freebsd.org/D60736
690c3fbbe1ed31d551a81e665e3f6dbdaadb045e Gleb Smirnoff 2026-10-16 21:09:19
Commit group #9: linuxkpi
linuxkpi: add strncpy_from_user()

Same semantics as Linux: returns the string length without the NUL,
count if the string was truncated, or -EFAULT. Implemented with
copyinstr(9). Unlike linux_copyin() it does not translate the remapped
ioctl argument window; its user, drm/virtio, passes a pointer taken
from the ioctl payload, so that is not needed.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60198
59642e07f4272d56d5a2b68169e388123d01b03b Denis Borovikov 2026-10-17 19:55:17

linuxkpi: add uuid_t and helpers

linux/uuid.h has only the guid_t family. Add uuid_t, next to guid_t,
with uuid_equal(), uuid_copy(), import_uuid() and export_uuid(),
mirroring the guid_ versions.

Used by drm/virtio for dma-buf UUID export.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60199
fce354b0e9ebd682b251de17bc743d8d855e0cdd Denis Borovikov 2026-10-17 19:55:17

linuxkpi: add pci_is_vga()

Returns true for a VGA-compatible display controller and for the
pre-PCI 2.0 VGA class (base 0x00, subclass 0x01), as Linux's
pci_is_vga() does. Used by drm/virtio to decide whether to remove
the firmware framebuffer on virtio-vga.

Signed-off-by:  Denis Borovikov <denis.borovikov@gmail.com>
Reviewed by:    wulf
Differential Revision:  https://reviews.freebsd.org/D60200
8558dd61e6747fef424ef924b19f4095072fc2f3 Denis Borovikov 2026-10-17 19:55:17
clntrdma.h: Add some fields to RDMA structures (glue for nfsclrdma.ko)
This patch adds some fields to NFS client side RDMA
structures and an additional argument to xprt_rdma_release_send().
This patch does not fix any semantics issue.

MFC after:      3 months
Fixes:  https://cgit.freebsd.org/src/commit/?id=884ee8d6c9b4 ("nfscl: Add some glue for client side NFS over RDMA")
02971f200083837e7a5001b00e11753d1abddc00 Rick Macklem 2026-10-17 23:24:00
vfs_subr.c: fix signature mismatch for close method
Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D49166
fe6aee442d4de11864f511509ece76286b73f5b9 ShengYi Hung 2026-05-23 14:43:06
LinuxKPI: account for delayed work cancelled after taskqueue dequeue
I encounter intermittent shutdown/restart hangs with i915/GuC and the
normal 34 ms scheduling-disable delay. Setting that delay to zero has
avoided the hang in my testing. This change fixes a reproducible
LinuxKPI cancellation-accounting defect that can leave the
corresponding context reference unreleased, rather than changing the
driver's delay.

Commit 79e290d96786 corrected the ordinary queued and already-executing
return values of cancel_delayed_work_sync(). There is still a gap
between native taskqueue dequeue and LinuxKPI callback ownership:

1. In sys/kern/subr_taskqueue.c, taskqueue_run_locked() removes the
   task, clears ta_pending and sets tb_running before calling its
   handler.
2. Before linux_work_fn() claims the callback,
   linux_cancel_delayed_work_sync_int() atomically changes WORK_ST_TASK
   to WORK_ST_IDLE.
3. taskqueue_cancel() can now return EBUSY with pending == 0: the
   native task is busy, but the Linux callback has not started.
4. linux_work_fn() subsequently sees IDLE and skips the callback. The
   cancelling thread drains the task and retries, but returns false
   because neither the timer-stop result nor the native pending count
   records what it cancelled.

The task can also finish consuming IDLE before taskqueue_cancel() is
called, giving success with pending == 0 and the same incorrect false
return. This affects zero-delay WORK_ST_TIMER and WORK_ST_CANCEL left
by a failed nonblocking cancellation as well. A zero-delay self-requeue
handled by linux_work_fn()'s executor loop can similarly be pending
without a native queue entry.

Use the old state returned by the atomic transition to account for
pending work suppressed by this cancellation: TIMER, TASK and CANCEL
contribute a true result. EXEC does not: the callback has already been
claimed, or has finished with that sticky state. Keep the native
pending-count aggregation, drain operations and retry decisions
unchanged; use a separate local variable for the callout-stop result.
In particular, EBUSY alone is not treated as successful cancellation,
which would regress the already-running-callback case fixed by
79e290d96786.

One affected consumer is guc_request_alloc() in drm-kmod's
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c. It calls
intel_context_sched_disable_unpin() when cancel_delayed_work_sync()
returns true. Suppressing the delayed callback while returning false
can leave neither path responsible for releasing that reference,
retaining the engine wakeref that shutdown later waits for.

Fixes:  https://cgit.freebsd.org/src/commit/?id=79e290d96786 ("Fix cancel_delayed_work_sync() return value")
Signed-off-by:  JustAnotherHumanBeing <oleglelchuk@gmail.com>
Differential Revision:  https://reviews.freebsd.org/D60046
2ff9182d89215322de1958057bf2345d34a6576e JustAnotherHumanBeing 2026-10-18 15:15:54
namei: retry absolute symlink expansions from the native root
For a Linux ABI process, namei() resolves a path first under the ABI
root (compat.linux.emul_path) and, if that fails, restarts the walk
of the original path from the native root.  Since 459ac3044b51 an
absolute symlink target found during the ABI pass stays under the
ABI root, so self-contained Linux userlands resolve their own
symlinks correctly (PR 289739); but when the target names a file
that exists only in the native namespace, the walk fails and the
restart cannot recover: it re-walks the original path, whose
ABI-visible prefix (the symlink itself) does not exist natively.

Casualties are the absolute symlinks planted under the emulator root
to integrate the host into the Linux namespace -- among them
linux-rl9-fontconfig's /compat/linux/etc/fonts ->
/usr/local/etc/fonts (Linux fontconfig cannot load its
configuration, degrading font matching to arbitrary results) and
similar links from linux-rl9-alsa-lib and linux-rl9-ca-certificates
-- and linprocfs' /proc/<pid>/exe, whose target is a host path:
following it fails for any Linux binary whose text lives outside the
emulator root (Chromium-based browsers execve /proc/self/exe to
spawn helpers), unless procfs(5) mounted at the native /proc masks
the failure.

Remember the expansion produced while following an absolute symlink
during the ABI pass and, when that pass fails with ENOENT before the
target has resolved, perform the one allowed native restart walking
the saved expansion in place of the original path.  The target has
resolved once the walk has consumed it, leaving no more than the
suffix appended past it; an ENOENT after that point restarts from
the original path as it always has.  Lookups that succeed under the
ABI root are unaffected, preserving 459ac3044b51; lockless lookups
are unaffected because cache_fplookup_symlink() already aborts to
the locked path for absolute symlinks whenever an ABI root is
active.

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297426
Fixes:          https://cgit.freebsd.org/src/commit/?id=459ac3044b51 ("namei: Preserve ABI root for absolute symlinks before fallback")
MFC after:      1 month
Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D58855
23b326728778fd3a6c37b33686dea98d010eb1cf Devin Teske 2026-10-18 15:44:12

Build system

man4: Install mgb.4 on all architectures
mgb(4) is not x86-only now, so install its manpage everywhere and make
if_mgb.4 link creation work, which is already on all architectures.

Sponsored by:   The FreeBSD Foundation
98b7f63c45ec711169c59c90ffa807cad22e27fe Li-Wen Hsu 2026-10-15 17:58:26
sysarch.x86.2: manual page for the sysarch(2) functions on x86
Reviewed by:  ziaee
Discussed with: jhb
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D60047
bdcfeac3e1cb8ce3f05c32d8a7ad3597deb48bdf Konstantin Belousov 2026-09-26 11:03:34
build: Support got
Add code for using got(1), matching how git(1) is currently used:
1. Determining the git branch,
2. Determining the checked-out hash,
3. Determining the commit count,
4. Determining the timestamp of the most recent commit,
5. Determining if the tree is "dirty",
6. Generating lists of files for the src and src-sys packages, and
7. Excluding .got directories from src.txz and ports.txz.

The release engineer hopes to use this functionality in release builds,
since got's minimalism makes it a far more manageable build tool than
git.

Reviewed by:    naddy
MFC after:      1 week
Sponsored by:   Amazon
Differential Revision:  https://reviews.freebsd.org/D60606
a8be899289303c9f83813cfd96d1a62abba09685 Colin Percival 2026-10-14 01:12:07
Makefile.inc1: Adjust mkimg bootstrap versions
Stream-optimized VMDK support was merged to stable/15 with
__FreeBSD_version 1501504.

Sponsored by:   Amazon
7ccf9ae50ce4e3df8ec2acd1e36aa4f6390629d1 Colin Percival 2026-10-17 17:09:41

Internal organizational stuff

ObsoleteFiles.inc: <sys/kpilite.h> was removed
Reported by:    glebius
Fixes:          https://cgit.freebsd.org/src/commit/?id=e478037df4f1 ("systm.h: Remove unused <sys/kpilite.h>")
Sponsored by:   The FreeBSD Foundation
b42793d4bcdf73475b77a26c9dbacd45f8876621 Olivier Certner 2026-10-12 08:38:58
mailmap: Add mappings for rmoeller
Approved by:  kevans (mentor)
e3d7a9b5ed5f7b0027852dd0a848884fce00b1ee Ryan Moeller 2026-10-13 13:22:20
committers-src: Add rmoeller mentored by kevans@
And note the commit bit return date of my previous account, freqlabs@.

Approved by:    kevans (mentor)
8fdf03cd361393765cdba00b87e7b6d614a7e80f Ryan Moeller 2026-10-13 13:24:01
committers-ports.dot: Restore ahze from alumni
Move back to the current committers section and record acm and dtxdf
as mentors.

Approved by:    dtxdf (mentor)
Differential Revision:  https://reviews.freebsd.org/D60683
b6a34e83651ce2bf4d1eea8d6f7f0f5bf4d9469c Michael Johnson 2026-10-12 19:27:54
Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.
79d491be21209536d7c410cb1ce892379135f3ce Ed Maste 2021-05-22 14:36:52
github: Only run the checklist checker for PRs against main
Currently this check is run on every push to stable branches which all
fail since they fail to fetch the non-existent .github/path-rules.txt
from the just-updated branches.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D60709
19a5023e45bd34d6bf5ee15e580f945caece5d2c John Baldwin 2026-10-17 15:24:23

Testing

stress2: add a test for forced unmount racing mkdir at UFS_LINK_MAX
On a soft updates file system, keep a directory at UFS_LINK_MAX with
workers removing and recreating subdirectories in it, so that mkdir(2)
keeps going through ufs_sync_nlink(), and force-unmount, check and
remount the file system in a loop.  The workers work relative to the
directory: a lookup through the mount point would wait for the unmount
on the covered vnode lock and never race with it.  Before the fix, the
first forced unmount deadlocked with mkdir(2) sleeping in vfs_busy().

With dtrace=1, count the vfs_busy() calls made during an unmount by
caller, and the mkdir(2) calls that synced and restarted with ERELOOKUP
during an unmount, which shows that the race was hit.

Sponsored by:   Sippy Software, Inc.
Reviewed by:    pho
Tested by:      pho
Differential Revision:  https://reviews.freebsd.org/D60204
MFC after:      1 month
2aca5deff7a0fb9f6f082d562f1ca85e707f674e Maxim Sobolev 2026-10-13 03:59:13
stress2: Add a new FS type: UFS2 to the test.
Workaround for kern.maxfiles limit exceeded.
Workaround for SU disk full issue.
Added some debug info, if umount(8) returns EBUSY.
b5e6d60e57bad805a064b0795434bcf6c454fdd0 Peter Holm 2026-10-13 08:11:15
tests/netinet6: Turn off stable addresses in ndp_prefix_len_mismatch
ndp_prefix_len_mismatch exercises the fallback in in6_ifadd() for an
interface whose link-local address does not have the advertised prefix
length (9e792f7ef729).  Since a2eb0894b79b made stable addresses
(RFC 7217) the default, in6_ifadd() takes the interface identifier from
in6_get_stableifid() and never looks at the link-local address, so the
case passes without reaching the fallback.  Turn stable addresses off
on the interface.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
ee8cb6ab6741014218a9157d316e1a675390edc4 R. Christian McDonald 2026-10-13 13:15:10
tests: Add SLAAC interface identifier cases to ndp.sh
Cover the interface identifier selection in in6_ifadd(): a /64
link-local address provides the identifier, while a /128 link-local
address or no link-local address at all yields the EUI-64 identifier
derived from the MAC address.  Each case asserts the exact
autoconfigured address.  ndp_prefix_len_mismatch reaches the same
fallback with a /127 link-local address, but only checks that some
address was configured.

Stable addresses (RFC 7217) are the default and bypass both paths, so
the host disables them.  The advertisement goes to all nodes, and an
interface only joins that group with its first address, so the case
without a link-local address gives the host a static address from
another prefix.

ra.py now takes the Ethernet source address from --sendif rather than
from a route lookup; for ff02::1 that lookup fails in scapy 2.7.0.

Reviewed by:            pouria
MFC after:              2 weeks
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D60520
9fd9039c888d2d3d6cec47a3383c6825b903fcba R. Christian McDonald 2026-10-13 19:33:37
tests/netpfil: reference manual pages in atf_skip statements
For those modules that don't have a manual page spell out full name of a
loadable module.
1da1ad38d0731fb39e6685383fa9aa0a503b241f Gleb Smirnoff 2026-10-13 06:35:56
tests/sys/kern: stress FP registers across sigreturn on powerpc64
This is the program that found the races fixed in 1f1043d550ea. One
thread keeps a pattern in f14-f31 across a signal, while helpers pinned
to the same CPU keep different patterns in the real registers and get
woken up from another CPU to preempt it at random points. If the kernel
ever hands it somebody else's registers, the pattern doesn't match.

The register loads, the thr_kill() and the handshake with the helper are
in assembly so that nothing touches the FP registers between sigreturn
and the check. It runs for ten seconds and is skipped with fewer than
two CPUs.

Requested by:   adrian
Approved by:    jhibbits
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D60411
35a226dded9934c6beb5945a982a705712454be1 Piotr Kubaj 2026-10-15 14:28:00
dhclient: Add some regression tests
Add tests for some recently fixed bugs in dhclient.  All of these tests
set up two VNET jails connected by an epair.  dhclient runs in one jail,
and the test code runs on the other end.  It uses scapy to inject
"interesting" packets in response to DHCPDISCOVER messages from
dhclient, then checks the configured interface and lease file.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60485
a143197801c680b958ab662c88cf086668a1958b Mark Johnston 2026-10-14 21:12:51

Style, typos, and comments

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

updateuio_t: improve comment and style
Reported by:  netchild
Effort:         CHERI upstreaming
Fixes:          https://cgit.freebsd.org/src/commit/?id=afe41f1ab9f6 ("sys/uio: add updateiov()")
Sponsored by:   Innovate UK
Differential Revision:  https://reviews.freebsd.org/D60169
deadb35becaae2788888e12868428b3a0ebef34f Brooks Davis 2026-10-13 14:01:30

Contrib code

MFV: zlib: Fix buffer overflow bug in non-blocking gzwrite.
MFC after:    3 days
DIfferential revision:  https://reviews.freebsd.org/D60695
7fe1d8abad3f55f127634c1ada7718bc1982089e Xin LI 2026-10-13 05:49:35
auditdistd: Use fixed-length protocol names
All communication between auditdistd senders and receivers and
internally between auditdistd and its worker children passes through the
same pair of send / receive functions.  The receive function uses
recv(2) with the MSG_WAITALL flag, which in theory means we should never
get a short read.  However, when handing off a socket to a worker child,
we also pass a variable-length string identifying the type of socket
we're passing, and reading this string relies on a short read.  This
used to work because the arrival of the descriptor would interrupt the
recv(2) call, but this bug was fixed when the AF_UNIX code was rewritten
a while ago and auditdistd has been broken ever since.

Fixing the length of the protocol name to four characters including the
terminating null solves the short-read bug by never requiring a short
read (nothing else in auditdistd requires one).

PR:             https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296107
MFC after:      1 week
Reviewed by:    js, kevans
Differential Revision:  https://reviews.freebsd.org/D59565
3ca4b8dd162afbecb8de70dc44f525d708726b07 Dag-Erling Smørgrav 2026-10-13 15:55:27
kyua: Fixes after vendor merge
Reviewed by:  ngie
MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D60446
af238d55d313a4a99fe9a3492755eb152b17bca0 Igor Ostapenko 2026-10-18 17:22:55

Reverted commits

mgb: Build module for all archs
It is not x86-specific.

This reverts commit e0a5aa37c1ef3a22e2dc8c311e0e32ea363f7ccf.
This reverts commit 2d935a1e93af4d552db1f7218ef97e01f058c084.

Reviewed by:    kbowling
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60615
b80af977f1b1ab72cb80fe6802228cdae0547efe Ed Maste 2026-10-11 14:34:15
Commit & revert pair: umb: Update man page HISTORY
umb: Update man page HISTORY

It was merged to stable/14 prior to FreeBSD 14.4.
ed797306243f3bdbbfd5d8223ec8698b9d7fe319 Ed Maste 2025-10-24 17:02:40

Revert "umb: Update man page HISTORY"

Oops, pushed in error from a staging branch.

This reverts commit ed797306243f3bdbbfd5d8223ec8698b9d7fe319.
d5612784ab931782956d9b106cc0d1c7d4801002 Ed Maste 2026-10-15 17:58:47
Revert LinuxKPI: LINUXKPI_DEBUG changes to allow drm-kmod to build
It has been almost a week with an open pull-requests and a follow-up
identified merge from master drm-kmod, as well as a patch supplied
in a PR for the ports to fix the the current build breakage in drm-kmod
and as a result also in nvidia-drm-* ports.

The problem there is that instead of using the kmod.mk supplied
definitions for LINUXKPI and despite using kmod.mk for the build,
the external components have hand-rolled solutions which can get
out of synch with src.git.

This was not discovered early on given that building drm-kmod with
LOCAL_MODULES_DIR= from git sources will not fail as the kernel
build will have provided the new opt_linuxkpi.h file.  In addition
drm-kmod master already had the -include for kconfig.h which the
src tree has had since 2024.

Give the pkgbase/kmod builds and users over the weekend a chance
to produce drm-kmod packages as the number of affected poeple is
rising.
These changes will hopefully be brought back next week once
drm-kmod and nvidia-drm-* ports are fixed.

PR:                     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299334
Bring back after:       3+ days

This reverts commit bbfd52dcbeb7b6e540220b3b24b664df6d200200.
This reverts commit 9820afb99e6fdc471cb820f321530c52ed2c31ac.
6866177454acf8fc5ac4295a0571fa791442ab52 Bjoern A. Zeeb 2026-10-17 01:38:06
Commit & revert pair: sbuf(3): increase test coverage
sbuf(3): increase test coverage

This change adds additional explicit test coverage for the following
sbuf(3) APIs:
- sbuf_clear_flags
- sbuf_get_flags
- sbuf_set_flags

While here, add a missing `sbuf_delete` to `sbuf_drain_ret0_test`: while
it isn't strictly required (the library's state is cleaned up shortly
after the test process ends), tools such as Coverity and LSAN flag
issues with leaked memory. Adding the sbuf_delete(3) call to the test
quells that issue.

MFC after:      1 week
Reviewed-by:    ngie
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2367
760efcc775c304d175a360dddf499a7b0d5e3935 Joao Bonifacio 2026-08-09 22:43:26

Revert "sbuf(3): increase test coverage"

ghpr doesn't seem to do a `git status` prior to allowing someone to push
changes (bug pending). Revert the change so the properly tested one can
be pushed into the tree.

This reverts commit 760efcc775c304d175a360dddf499a7b0d5e3935.
23ab9a9d09f4b46d0b1334742f466526da3662c1 Enji Cooper 2026-10-18 18:09:37

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 2026-11-03 03:23:54+00:00.

This work is supported by Tarsnap Backup Inc.

Alternate version: 2026-10-12 (debug) (contains info about the classification)