HardenedBSD/src bce565f — sys/dev/acpica acpi_cpu.c, sys/kern p1003_1b.c kern_module.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+148-62sys/kern/sys_generic.c
+55-29sys/kern/sys_capability.c
+32-26sys/kern/kern_module.c
+39-13sys/kern/p1003_1b.c
+19-27sys/dev/acpica/acpi_cpu.c
+46-0sys/sys/syscallsubr.h
+339-1576 files not shown
+366-18112 files

HardenedBSD/src ff3f704 — sys/dev/acpica acpi_cpu.c

acpi_cpu: Bring back setting BM_RLD on resume

enable_idle(), which was called on resume before 427747fc16c9
("acpi_cpu: No longer disable idle during suspend"), also set BM_RLD.

This commit brings back just setting BM_RLD on resume because some
firmware might not be doing this itself on some machines.

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D61431
DeltaFile
+24-6sys/dev/acpica/acpi_cpu.c
+24-61 files

HardenedBSD/src 427747f — sys/dev/acpica acpi_cpu.c

acpi_cpu: No longer disable idle during suspend

This had been introduced in 3331373ce733 ("Disable CPU idle states
during suspend and reenable them during resume.") to work around C-state
selection logic which would skip C-states which returned immediately,
considering them "broken".

This workaround is incompatible with suspend-to-idle however, which
requires CPUs to be in their idle states, and is no longer relevant
either way since b0baaaaecf1a ("Avoid comparing negative signed to
positive unsignad values.") removed the C-state skipping logic the
previous change was working around.

Reviewed by:    olce
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/71
Differential Revision:  https://reviews.freebsd.org/D60649
DeltaFile
+2-28sys/dev/acpica/acpi_cpu.c
+2-281 files

HardenedBSD/src 51d910a — lib/libfetch Makefile common.c, share/mk src.libnames.mk

libfetch: Prepare for OpenSSL 4

* Always use libmd's MD5 since it's deprecated in OpenSSL.

* Use ASN1_STRING_get_length() instead of ASN1_STRING_length().
DeltaFile
+4-12lib/libfetch/http.c
+1-3lib/libfetch/Makefile
+4-0lib/libfetch/common.c
+1-2share/mk/src.libnames.mk
+10-174 files

HardenedBSD/src 1eada42 — sys/kern sys_getrandom.c, sys/sys syscallsubr.h

getrandom(2): add kern_getrandom

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+2-1sys/kern/sys_getrandom.c
+2-0sys/sys/syscallsubr.h
+4-12 files

HardenedBSD/src 9acec4c — sys/kern sys_generic.c, sys/sys syscallsubr.h

sys_generic.c: add kern_ and user_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+148-62sys/kern/sys_generic.c
+25-0sys/sys/syscallsubr.h
+173-622 files

HardenedBSD/src 9743203 — sys/kern sys_capability.c, sys/sys syscallsubr.h

sys_capability.c: add kern_ and user_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+55-29sys/kern/sys_capability.c
+9-0sys/sys/syscallsubr.h
+64-292 files

HardenedBSD/src e5100cd — sys/kern p1003_1b.c, sys/sys syscallsubr.h

sched_*(2): add user_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+39-13sys/kern/p1003_1b.c
+8-0sys/sys/syscallsubr.h
+47-132 files

HardenedBSD/src 7f8c205 — sys/kern kern_module.c

modstat: avoid copying from freed memory

If a module is unloaded after the module is looked up in kern_modstat,
but before one of the copyout's occurs, then the memory being copied
might be freed and reused leading to an information disclosure.

The LLM was particularly concerned about a TOCTOU issue in the length
of the name, but it seems likely that there are issues with all the
copyout's.  As such, hold the shared lock throughout.

Reviewed by:    markj
Reported by:    llm-postcr
MFC after:      3 days
Sponsored by:   Innovate UK
Fixes:          9b3851e9e3b1 ("- Lock down the ``module'' structure...")
Differential Revision:  https://reviews.freebsd.org/D61398
DeltaFile
+32-26sys/kern/kern_module.c
+32-261 files

HardenedBSD/src 1c17a09 — sys/kern subr_prof.c, sys/sys syscallsubr.h

profil(2): add kern_ implemenation

Effort:         CHERI upstreaming
Sponsored by:   Innovate, UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+15-6sys/kern/subr_prof.c
+2-0sys/sys/syscallsubr.h
+17-62 files

HardenedBSD/src 05447ca — sys/dev/mlx5/mlx5_core fs_core.h mlx5_fs_core.c, sys/netipsec xform_ipcomp.c xform_ah.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+27-4sys/dev/mlx5/mlx5_core/mlx5_fs_core.c
+13-17usr.sbin/ppp/ipcp.c
+7-0sys/dev/mlx5/mlx5_core/fs_core.h
+1-0sys/netipsec/xform_ipcomp.c
+1-0sys/netipsec/xform_ah.c
+49-215 files

HardenedBSD/src 310955b — include pthread_np.h, lib/libthr/tests pthread_query_test.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+254-0share/man/man3/pthread_query_np.3
+123-0lib/libthr/tests/pthread_query_test.c
+116-0lib/libthr/thread/thr_query.c
+37-17sys/kern/vfs_syscalls.c
+30-22lib/libthr/thread/thr_mutex.c
+30-0include/pthread_np.h
+590-3915 files not shown
+657-4921 files

HardenedBSD/src 2af08ab — sys/netipsec xform_ipcomp.c xform_ah.c

netipsec: Release the sahtree lock on the AH and IPComp EAGAIN paths

183513d15f22 made the AH, ESP and IPComp input callbacks hold the
sahtree read lock, but only esp_input_cb() drops it before resubmitting
a request that the crypto framework completed with EAGAIN.
ah_input_cb() and ipcomp_input_cb() return with the lock still held.

crypto_invoke() completes requests with EAGAIN while their driver
detaches.  Detaching ossl(4) under inbound AH traffic then hangs the
next rmlock writer, and the system panics with "spin lock held too
long" in smp_rendezvous_cpus() called from _rm_wlock().

Release the lock as esp_input_cb() does.

Reported by:            llm-postcr
Reviewed by:            kib
Fixes:                  183513d15f22 ("sys/netipsec: ensure sah stability during input callback processing")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61399
DeltaFile
+1-0sys/netipsec/xform_ipcomp.c
+1-0sys/netipsec/xform_ah.c
+2-02 files

HardenedBSD/src dfdc0cf — usr.sbin/ppp ipcp.c

ppp: bound IPCP IP-Address replies to the reply buffers

`ipcp_ValidateReq()` appended `IP-Address ack/nak/reject` records to the fixed `fsm_decode` buffers without a bound check. A `Config-Request` with ~17 or more `IP-Address` options overran a buffer into its own end pointer, so later writes could go wherever the peer chose.

Emit the option through `fsm_ack()/fsm_nak()/fsm_rej()` like the other options.

Reviewed by:    markj
Approved by:    adrian (mentor)
Signed-off-by:  Nick Price <nprice at FreeBSD.org>
Differential Revision:  https://reviews.freebsd.org/D61326
DeltaFile
+13-17usr.sbin/ppp/ipcp.c
+13-171 files

HardenedBSD/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

HardenedBSD/src 2b2d62b — crypto/krb5 README, crypto/krb5/src/plugins/preauth/pkinit pkinit_crypto_openssl.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+215-215crypto/krb5/src/po/mit-krb5.pot
+182-0crypto/krb5/README
+123-3sys/dev/acpica/acpi_video.c
+77-32crypto/krb5/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+108-0usr.sbin/pwd_mkdb/tests/pwd_mkdb_test.sh
+66-38sys/dev/axgbe/xgbe-sysctl.c
+771-288157 files not shown
+2,380-990163 files

HardenedBSD/src 3821312 — sys/kern kern_module.c

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-7sys/kern/kern_module.c
+0-71 files

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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

HardenedBSD/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