linuxkpi: Release the "from" device in pci_get_class() and pci_get_base_class()
On Linux the pci_get_*() iterators drop the reference of the device passed
as "from" once the next one has been looked up, so a loop like
while ((pch = pci_get_class(class, pch)))
does not leak anything. LinuxKPI allocates a new pci_dev for every device
it returns but never released "from", so each device but the last one was
leaked together with its kobject, its name and its path name. i915 does
exactly this in intel_detect_pch() and leaked a device at every load.
Drop the reference, but only for the devices created by lkpinew_pci_dev();
the pci_dev of a device attached to a driver belongs to the bus.
Differential Revision: https://reviews.freebsd.org/D61222
lindebugfs: Free the kcov symlink when the module is unloaded
lindebugfs_init() creates the "kcov" symlink with debugfs_create_symlink(),
which allocates a node and a copy of the destination, but passed no destroy
callback to pfs_create_link(). pseudofs therefore never released them and
the "debugfsint" malloc type was reported as leaking memory each time the
module was unloaded.
Use debugfs_destroy(), as done for the other nodes.
Differential Revision: https://reviews.freebsd.org/D61221
linuxkpi: Release devres when the probe of a PCI driver fails
When the probe method of a driver fails, linux_pci_attach_device() only
dropped its reference on the device. Like on detach (see the previous
change), the devres actions are then not run if one of them holds a
reference on the device, which is what devm_drm_dev_alloc() does through the
drm_device. The device is never released, the drm_device is leaked with its
minor, its managed memory and its debugfs entries: unloading the driver
after a failed load (e.g. a missing firmware) printed
"WARNING !xa_empty(&drm_minors_xa)" and leaked memory.
Linux releases the devres resources of a device whose probe failed, so do the
same.
Differential Reivision: https://reviews.freebsd.org/D61223
pam_xdg: Add linger option
The pam_xdg module deletes a user's XDG_RUNTIME_DIR when the last
interactive session logs out. If the user leaves background processes
running on the system, like a terminal multiplexer, that puts state or
domain sockets in XDG_RUNTIME_DIR, then that state gets destroyed and
the processes become effectively orphaned.
On Linux, systemd-logind not only unlinks XDG_RUNTIME_DIR but also kills
all user processes on logout. To allow long-lived background processes,
it implements a per-user "linger" mode to disable the unlink and kill.
Because FreeBSD's pam_xdg does not implement process killing, this
"linger" option implementation skips only XDG_RUNTIME_DIR unlinking
when the user still has running processes after the last session logs
out.
Differential Revision: https://reviews.freebsd.org/D61332
aw_thermal: Add support for the H6
Add the thermal sensor controller of the H6, which has two sensors, for
the CPU and the GPU.
The controller has other registers than the one of the supported SoCs.
The efuse has the temperature of the factory test and the value of each
sensor at this temperature, from which the calibration value of each
sensor is computed and written to the controller.
The alarm and shutdown thresholds and the interrupts are not supported
yet.
Tested on: Pine H64 (CPU and GPU temperatures, idle and under load)
aw_thermal: Make the data register and the alarm support per SoC
The controller of the H6 has its data registers at another offset and
other alarm, shutdown and interrupt registers.
Add the offset of the first data register to the SoC configuration,
and a flag for the alarm handling (interrupt, alarm and shutdown
thresholds and the cpufreq throttling), set for all the SoCs
currently supported.
No functional change intended.
aw_thermal: Add an init function to the SoC configuration
Move the initialisation of the controller to a function of the SoC
configuration, as the controller of the H6 is different from the one
of the other supported SoCs.
No functional change intended.
aw_sid: Add the thermal sensor calibration fuse of the H6
The thermal sensor controller of the H6 gets its calibration data from
the 8 bytes of the efuse at offset 0x14, referenced by the
ths_calibration nvmem cell. Add it so the thermal driver can read it.
Tested on: Pine H64 (thermal sensor calibration)
aw_sid: Add the CPU speed grade fuse of the H6 and H616
The OPP tables of the H6 and H616 use the speed grade, stored in the
efuse, to select the voltage of each OPP. Add it as a fuse so it can be
read from the cpu_speed_grade nvmem cell, and expose it in a sysctl.
The speed grade of the H616 is the 2 first bytes of the efuse and
overlaps with the root key. Match the size too when looking up the
fuse of an nvmem read.
Tested on: Pine H64 (sysctl dev.aw_sid.0.speedgrade)
ccu_h6: Add the bus gates of UART1, UART2 and UART3
The firmware only leaves the gate of UART0 on. The UARTs of the H6 are
snps,dw-apb-uart and uart_snps enables the bus clock of the device, but
the clock does not exist, so the gate of the other UARTs stays off. With
a device tree where one of them is enabled (the Bluetooth UART of the
Pine H64 model B), uart_bus_probe() accesses the registers of a gated
UART and the boot hangs.
Add the gates of UART1 to UART3. The one of UART0 is left out for now,
with it uart_snps gets the clock rate and detects a 256 bytes FIFO, and
the input of the console is delayed.
Tested on: Pine H64 (model B device tree, UART1)
vn_fallocate/vn_deallocate: drop vnode addr from exterrors
This was converted from a KASSERT where it made sense, but not enough
thought was applied. vp is useless, just print both offset/len instead.
Reported by: llm-postcr
Fixes: 95c7b9eaa9ec ("vfs: fail VOP_DEALLOCATE passes [...]")
Fixes: 8bee7ea63a6a ("vfs: fail VOP_ALLOCATE passes [...]")
libc: regen exterr_cat_filenames.h
GEOMZONED had previously missed updating this; I had noted that I would
fix it before 95c7b9eaa9ecc874, but alas. Fixing it now is the second
best time to do it.
Fixes: 48efb6c4eb9fe ("gzoned: Introduce Zoned Storage emulator")
krb5: Import MIT 1.22.3
Major changes in 1.22.3 (2026-11-09)
====================================
This is a bug fix release, with a focus on security issues discovered
with the aid of large language models. See
https://web.mit.edu/kerberos/advisories/MITKRB5-SA-2026-001.txt for
information on the risks of continuing to use unpatched releases.
* Fix a logic error when checking PAC server checksums
[CVE-2026-111423].
* Check for unkeyed checksums when validating CAMMAC verifiers
[CVE-2026-71199].
* Fix a loophole in the KDC's client authdata filtering which could
allow clients to include fake PAC and CAMMAC authdata values when
requesting service tickets. These fake values would be rejected by
[52 lines not shown]
vmm: Avoid redundant AMD DEBUGCTL writes
Skip clearing and restoring DEBUGCTL when the saved host value is
zero. The entry path leaves DEBUGCTL zero, and LBR virtualization
restores that host value on VM exit. A rejected guest entry also
returns with the pre-VMRUN DEBUGCTL value. Guest accesses to DEBUGCTL
remain intercepted.
Preserve the existing writes for nonzero host state. Avoiding the
redundant writes can also avoid intercepted MSR accesses when bhyve
runs under another hypervisor.
Reviewed by: markj, bnovkov
Approved by: markj (mentor)
Sponsored by: Alchemilla Ventures Private Limited
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61218
vmm: Avoid redundant Intel DEBUGCTL writes
Skip clearing and restoring IA32_DEBUGCTL when the saved host value
is zero.
VM exit clears the register. If VM entry fails, the entry path has
already cleared any nonzero host value, so restoring zero is also
unnecessary in that case. Preserve the existing writes for nonzero
host state.
Avoiding these writes can also avoid intercepted MSR accesses when
bhyve runs under another hypervisor.
Reviewed by: markj, bnovkov
Approved by: markj (mentor)
Sponsored by: Alchemilla Ventures Private Limited
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D61219
vfs: fail VOP_DEALLOCATE passes that make no progress
VOP_DEALLOCATE(9) permits a filesystem to return a partial result, and
vn_deallocate_impl() simply loops until the range is consumed. If a
filesystem returns success without shrinking the remaining length, we
spin forever with the rangelock held and no way to interrupt the thread.
Return EIO if a pass doesn't make progress so that a buggy filesystem
doesn't wedge the caller.
Document the progress requirement in VOP_DEALLOCATE(9) and the new EIO
condition in fspacectl(2).
I did wonder if this should be made interruptible for, e.g., slow I/O
over NFS, but I've declined to touch it for now.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D61496