FreeBSD/src 2d5a6bc — sys/dev/mlx5/mlx5_core fs_core.h mlx5_fs_core.c

mlx5: add per-flow-group hash table for FTE lookup

lookup_fte_locked() scanned every FTE in a flow group with xa_next()
and memcmp() on each one.  A new RX TLS session always misses, so the
whole group was walked under the group lock for every insertion.  With
tens of thousands of RX-offloaded sessions in the same IPv6 TCP group
this costs milliseconds per call and grows linearly with the number of
FTEs.

Keep a hash table of the FTEs in each flow group, keyed by a jhash of
the match value.  The table is sized from the group size, capped at
16K buckets.  It is updated in insert_fte() and del_sw_fte(), both of
which hold the group write lock, and read in lookup_fte_locked() under
the group read or write lock.  The xarray is kept for index
allocation.  No lockless reads are introduced.

Reported by:    NetApp
Reviewed by:    kib
Sponsored by:   NVidia networking
MFC after:      1 week
DeltaFile
+27-4sys/dev/mlx5/mlx5_core/mlx5_fs_core.c
+7-0sys/dev/mlx5/mlx5_core/fs_core.h
+34-42 files

FreeBSD/src 7cb4d4d — share/man/man4 sched_ule.4, sys/kern sched_ule.c

sched_ule.4: sync current scheduler sysctls

Reviewed by:    bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
DeltaFile
+37-6share/man/man4/sched_ule.4
+1-0sys/kern/sched_ule.c
+38-62 files

FreeBSD/src be25f6d — share/man/man4 sched_4bsd.4, sys/kern sched_4bsd.c

sched_4bsd.4: sync current scheduler sysctls

Reviewed by:    bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
DeltaFile
+21-16share/man/man4/sched_4bsd.4
+1-0sys/kern/sched_4bsd.c
+22-162 files

FreeBSD/src fb797f8 — share/man/man4 Makefile smp.4

scheduler.4: document common scheduler sysctls

Reviewed by:    bcr, jhb, olce
Approved by:    jhb, olce (mentor)
MFC after:      2 weeks
Sponsored by:   FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D60002
DeltaFile
+61-0share/man/man4/scheduler.4
+5-2share/man/man4/sched_ule.4
+5-2share/man/man4/sched_4bsd.4
+2-1share/man/man4/smp.4
+2-1share/man/man4/dtrace_sched.4
+1-0share/man/man4/Makefile
+76-66 files

FreeBSD/src 307e725 — contrib/netbsd-tests/kernel t_mqueue.c, tests/freebsd_test_suite macros.h

Revert "Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros"

The change breaks the build of tests/sys/net/routing/test_rtsock_l3.c.

This reverts commit e34b159d4c64575aa45763968b6ad01dfd7c2337.
DeltaFile
+13-13tests/freebsd_test_suite/macros.h
+3-15tests/sys/net/routing/rtsock_config.h
+4-0contrib/netbsd-tests/kernel/t_mqueue.c
+0-1tests/sys/kern/Makefile
+20-294 files

FreeBSD/src e34b159 — contrib/netbsd-tests/kernel t_mqueue.c, tests/freebsd_test_suite macros.h

Remove {ATF,PLAIN}_REQUIRE_KERNEL_MODULE macros

These macros predated the `require.kmod` (ATF) and `required_kmods`
(kyua) test metadata and are no longer needed.

Add a hint to freebsd_test_suite/macros.h about the `*FEATURE*` macros
going away soon. See [this kyua issue][kyua-issue] for more details.

MFC after:      1 month
Differential Revision:  https://reviews.freebsd.org/D61082

[kyua-issue]: https://github.com/freebsd/kyua/issues/346
DeltaFile
+13-13tests/freebsd_test_suite/macros.h
+15-3tests/sys/net/routing/rtsock_config.h
+0-4contrib/netbsd-tests/kernel/t_mqueue.c
+1-0tests/sys/kern/Makefile
+29-204 files

FreeBSD/src 3d6f886 — sbin/nvmecontrol format.c nvmecontrol.8

nvmecontrol: Range-check the format command's field values

The format command accepted any 32-bit value for -m, -p, -l and
--ses and passed it into the Format NVM command.  Before
eae727676169 an out-of-range value spilled into the adjacent cdw10
fields, which usually drew an error from the controller; after it,
the value is masked to the field width, so a mistyped value is
silently accepted with a different meaning.  Most seriously,
--ses 8 masked to SES=0 and performed a plain format with no erase
at all, exiting 0.  A value like --ses 10 masked to a cryptographic
erase while bypassing the FNA cryptographic erase capability check,
which compares the unmasked value.

Reject values outside the ranges nvmecontrol.8 documents, which are
the values the spec defines: 0-1 for -m and -l, 0-3 for -p, and
0-2 for --ses.  The checks run at option validation time, before
the device is opened, and the capability check now only ever sees
valid values.


    [10 lines not shown]
DeltaFile
+19-1sbin/nvmecontrol/nvmecontrol.8
+10-0sbin/nvmecontrol/format.c
+29-12 files

FreeBSD/src 61b5fa0 — sys/dev/virtio/random virtio_random.c

virtio_random: defer first enqueue until after DRIVER_OK

According to the virtio spec:

> The driver MUST NOT send any buffer available notifications to the
> device before setting DRIVER_OK.

DRIVER_OK isn't set until after attach completes, so defer the first
enqueue.  We haven't found any problems as a result of this to the best
of my knowledge: q35 and other devices that we *have* been used with
will apparently check when we go DRIVER_OK.

Tested with q35 virtio-random, which still works.

Approved by:    re (cperciva)
Reported by:    llm-postcr
Reviewed by:    kfv, markj
Fixes:  f1c5a2e3a62505 ("virtio_random: Pipeline fetching the data")
Sponsored by:   Stormshield

    [4 lines not shown]
DeltaFile
+16-2sys/dev/virtio/random/virtio_random.c
+16-21 files

FreeBSD/src 16edda2 — sys/dev/virtio/pci virtio_pci_modern.c

virtio_pci_modern: enable virtqueues before completing attach

Most of our drivers setup interrupt(s) and virtqueues are enabled at
that time, but nothing will currently enable them for devices that we're
only going to poll.  This most notably affects virtio-random, and the
problem can be observed with qemu's q35 emulation and a random device
attached.  The q35 implementation ignores the ring unless it's enabled,
so vtrnd_harvest() will consistently EAGAIN rather than contribute
anything of value, but with this patch it becomes functional.

This can be reproduced with a qemu invocation like so:

qemu-system-x86_64 -machine q35,accel=tcg -cpu max -smp 2 -m 2G \
  -drive file=FreeBSD-16.0-CURRENT-amd64-ufs.qcow2,if=virtio \
  -device pcie-root-port,id=rp1,bus=pcie.0,chassis=1 \
  -object rng-random,id=rng0,filename=/dev/urandom \
  -device virtio-rng-pci,rng=rng0,bus=rp1 \
  -display curses


    [7 lines not shown]
DeltaFile
+10-0sys/dev/virtio/pci/virtio_pci_modern.c
+10-01 files

FreeBSD/src 7e4c0a3 — crypto/krb5 README, crypto/krb5/src/lib/kadm5 kadm_rpc_xdr.c

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

    [49 lines not shown]
DeltaFile
+215-215crypto/krb5/src/po/mit-krb5.pot
+182-0crypto/krb5/README
+77-32crypto/krb5/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+69-29crypto/krb5/src/lib/rpc/svc_auth_gss.c
+97-0crypto/krb5/src/lib/krb5/krb/t_init_creds_step.c
+59-34crypto/krb5/src/lib/kadm5/kadm_rpc_xdr.c
+699-310133 files not shown
+1,800-901139 files

FreeBSD/src eae7276 — sbin/nvmecontrol format.c

nvmecontrol: Mask the fields in the Format NVM command

The format command composed cdw10 by hand without masking any of
the fields and with no support for the LBAFU field.  Since commit
2c41f7d8a034 the LBA format index defaulted from FLBAS can exceed
15 on an NVMe 2.0 namespace using FIDXU, and such an index would
bleed into the MSET and PI fields.  An out of range index supplied
with -f for a whole-controller format was not caught either.

Build the command with nvme_admin_format_cmd(), which masks all of
the fields and encodes LBA format indexes above 15 in LBAFU, and
reject LBA format indexes greater than 63 for whole-controller
formats.  Per-namespace formats already validate the index against
NLBAF.

This is the same problem that llm-postcr reported in camcontrol's
copy of this code, fixed in 3892a6453fc6; the unmasked composition
originated here (635c517ae9ca).


    [7 lines not shown]
DeltaFile
+7-8sbin/nvmecontrol/format.c
+7-81 files

FreeBSD/src 6a38153 — sys/kern sys_capability.c

cap_enter(2): stricter checks

(cherry picked from commit b357c94448997b1702c5d3be9cc3a9531ba92ffc)
DeltaFile
+18-2sys/kern/sys_capability.c
+18-21 files

FreeBSD/src b157e1c — lib/libc/gen err.3

libc/gen/err.3: reword to refer to exterror.9

(cherry picked from commit 5d622079272308ba7e9dd815ed9380ee53c14c03)
DeltaFile
+4-2lib/libc/gen/err.3
+4-21 files

FreeBSD/src 40d0ff3 — lib/libsys cap_enter.2

cap_enter.2: document new behavior, in particular EBUSY

(cherry picked from commit 82bbfe16ae1eaa9eca970cb50abe8ac9162fe9cb)
DeltaFile
+16-0lib/libsys/cap_enter.2
+16-01 files

FreeBSD/src 952fd61 — sys/kern vfs_syscalls.c

kern: do not allow unprivileged chroot when pwd is shared

(cherry picked from commit e95e010fd0de721ae0e87bb24e20ec53aec8629e)
DeltaFile
+21-1sys/kern/vfs_syscalls.c
+21-11 files

FreeBSD/src a79aca4 — sys/kern vfs_syscalls.c

kern/vfs_syscalls.c: extract privilege check from kern_chroot()

(cherry picked from commit f809179ba9811decc518cb5694a289d169a5d6ae)
DeltaFile
+17-17sys/kern/vfs_syscalls.c
+17-171 files

FreeBSD/src fcfe407 — lib/libsys chroot.2

chroot.2: document EPERM for shared pwd

(cherry picked from commit aff8d265fa1c4b6d5c7a5220e328bcb7b62585f2)
DeltaFile
+5-0lib/libsys/chroot.2
+5-01 files

FreeBSD/src 45f988b — sys/kern kern_descrip.c, sys/sys filedesc.h

pwddesc: add sharecount

(cherry picked from commit 5276fba9fd55bf2e79c54df18a70b46d11cc15a1)
DeltaFile
+8-1sys/kern/kern_descrip.c
+2-1sys/sys/filedesc.h
+10-22 files

FreeBSD/src 1da7bc7 — include pthread_np.h, lib/libthr pthread.map

libthr: pthread_query_np(3) and pthread_query_all_np(3)

(cherry picked from commit 588bd8bb6c1331dad1bbe1cf222db970f6476c44)
DeltaFile
+116-0lib/libthr/thread/thr_query.c
+30-0include/pthread_np.h
+2-0lib/libthr/pthread.map
+1-0lib/libthr/thread/Makefile.inc
+149-04 files

FreeBSD/src f10f1e2 — share/man/man3 Makefile pthread_query_np.3

man3: document pthread_query_np(3) and pthread_query_all_np(3)

(cherry picked from commit 7e904a6ef80321ad6ebd192126e05f8b714dce46)
DeltaFile
+254-0share/man/man3/pthread_query_np.3
+2-0share/man/man3/Makefile
+256-02 files

FreeBSD/src a64b48d — lib/libthr/thread thr_exit.c thr_list.c

libthr: fix the race between pthread_getname_np() and thread exit

(cherry picked from commit 49e0c6270c73f1570efc67028004db9da56da2d1)
DeltaFile
+4-0lib/libthr/thread/thr_list.c
+2-0lib/libthr/thread/thr_exit.c
+6-02 files

FreeBSD/src c6ff0ba — lib/libthr/tests Makefile pthread_query_test.c

libthr: test pthread_query_np(3) and pthread_query_all_np(3)

(cherry picked from commit 9bd30915963157d975969649f8b3143408ecdf3c)
DeltaFile
+123-0lib/libthr/tests/pthread_query_test.c
+1-0lib/libthr/tests/Makefile
+124-02 files

FreeBSD/src c1dfe18 — lib/libthr/thread thr_mutex.c

libthr/thr_mutex.c: make mutex asserts more useful

(cherry picked from commit 4ab9e73994e673e518d1b0631f8ce7d1faec6d80)
DeltaFile
+30-22lib/libthr/thread/thr_mutex.c
+30-221 files

FreeBSD/src dfe1bc3 — lib/libc/include libc_private.h, lib/libthr/sys thr_error.c

libc: provide the declaration for __libsys_errno in libc_private.h

(cherry picked from commit 7f309ac03989032903cce945a743a6046e496b10)
DeltaFile
+0-2lib/libthr/thread/thr_rtld.c
+0-2lib/libthr/sys/thr_error.c
+2-0lib/libc/include/libc_private.h
+2-43 files

FreeBSD/src 5feb271 — sys/kern vfs_lookup.c

namei(9): fix two ni_startdir leaks

namei() leaks the caller's ni_startdir reference on the empty-path
ENOENT return and on namei_getpath() failure.

On ZFS with the default zfs_xattr_compat=1, an empty user-namespace
extattr name on a file that has an xattr directory leaks one reference
on that directory per call.

Reported by:    llm-postcr
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61366
DeltaFile
+6-1sys/kern/vfs_lookup.c
+6-11 files

FreeBSD/src 7ac5569 — sys/kern vfs_vnops.c

vn_open_cred(9): fix ni_startdir leak

vn_open_cred() returns EINVAL before calling namei() for
O_CREAT|O_EXCL|O_DIRECTORY and for O_CREAT|O_EMPTY_PATH.
That leaks an NDINIT_ATVP() start directory.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61366
DeltaFile
+4-2sys/kern/vfs_vnops.c
+4-21 files

FreeBSD/src 1b4779e — lib/libthr/thread thr_mutex.c

libthr mutex_self_lock(): handle signals and clock steps

Relocking an owned NORMAL mutex with an absolute timeout has two issues:
- nanosleep(2) is never restarted, so any caught signal causes
  an early ETIMEDOUT.
- If CLOCK_REALTIME or CLOCK_TAI are stepped backward during the sleep,
  the call also returns ETIMEDOUT before the clock reaches the deadline.

The kernel already polls CPU-time clocks and handles realtime steps.
Use _thr_umtx_timedwait_uint() in a loop to handle both issues.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D61381
DeltaFile
+7-3lib/libthr/thread/thr_mutex.c
+7-31 files

FreeBSD/src a7163bd — usr.sbin/bsdinstall/scripts pkgbase.in

bsdinstall: Set TMPDIR in pkgbase install

The FreeBSD-base repository (aka "pkgbase") is now created using 'pkg
repo -l' in order to make 'pkg rwhich' work.  Unfortunately this makes
the data.pkg file considerably larger, and FreeBSD 15.2-BETA1 fails to
install using a remote repository since the installer has a small /tmp
(20 MB).

Run pkg commands with 'env TMPDIR=<chrootdir>/tmp' since the /tmp in
the system being installed is considerably larger than the tmpfs which
the installer runs with.  Create <chrootdir>/tmp first so we can ensure
it has 1777 permissions.

Reviewed by:    bapt
MFC after:      1 day
Differential Revision:  https://reviews.freebsd.org/D61380
DeltaFile
+6-1usr.sbin/bsdinstall/scripts/pkgbase.in
+6-11 files

FreeBSD/src 6066c79 — sys/dev/acpica acpi_video.c

acpi_video: dim the internal panel while the lid is closed

Register an acpi_lid_event consumer that saves the current _BQC level and
drives _BCM to the lowest level _BCL offers when the lid closes, putting
the saved level back when it opens.  Only an output already classified as
an internal panel is touched, and only a level this handler dimmed is
restored, so a brightness change made while the lid was shut survives.

Disabled by default; set hw.acpi.video.lid_blank=1 to enable.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60827
DeltaFile
+98-0sys/dev/acpica/acpi_video.c
+98-01 files

FreeBSD/src 09a79e9 — sys/dev/acpica acpi_video.c

acpi_video: fall back to _BCL when _DOD matches no output

vid_enum_outputs() only registers a child whose _ADR appears in the
graphics controller's _DOD. _DOD is filled in from the graphics driver's
ACPI opregion on some platforms, so with no such driver attached it can
describe no device at all while the panel still implements _BCL, _BCM and
_BQC. The match then fails for every child and the machine is left with
no brightness control.

Fall back to registering the first child that implements _BCL when _DOD
matched nothing, so such a machine gets a working
hw.acpi.video.lcd0.brightness and the brightness keys that ride on it.

MFC after: 1 week

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D60826
DeltaFile
+25-3sys/dev/acpica/acpi_video.c
+25-31 files