FreeBSD/src d53633bsys/kern vfs_syscalls.c vfs_lookup.c, sys/sys vnode.h

rename(2): do not allow to rename root vnode of the mounted filesystem

Check for tdvp being vp_crossmp.  This cannot happen for the normal
rename cases, but could if the target path specified by the syscall
points to the nullfs mount over the regular file.  In this case namei()
cannot step over crossmp, and keep it in ni_dvp.

Since crossmp VOP_GETWRITEMOUNT() returns NULL mp, we retry the locking
dance since the belief is that NULL return is transient.

PR:     295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
DeltaFile
+9-0sys/kern/vfs_syscalls.c
+1-1sys/kern/vfs_lookup.c
+1-0sys/sys/vnode.h
+11-13 files

FreeBSD/src 5d0ebfesys/kern vfs_syscalls.c

renameat(2): when retrying, check for pending signals

The vn_start_write() call there is already interruptible.  Check for
user signals before restarting due to ERELOOKUP, or after failed
vn_start_write().  Note that vn_start_write(V_XSLEEP | V_PCATCH)
does not check for signals if not sleeping.

PR:     295826
Reviewed by:    markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57453
DeltaFile
+8-2sys/kern/vfs_syscalls.c
+8-21 files

FreeBSD/src 9263fb9sys/conf newvers.sh

15.1: Update to RC2

Approved by:    re (implicit)
Sponsored by;   OpenSats Initiative
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 56e5998stand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [21 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src dd2e9aausr.sbin/bsdinstall/scripts script

bsdinstall: script: Fix scripted DISTRIBUTIONS

Restore exporting DISTRIBUTIONS to make it available to other scripts.

Approved by:    re (cperciva)
Reviewed by:    imp, asomers
Fixes:          dc14ae4217a0 ("bsdinstall: do pkgbase installations with the "script" command")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57319

(cherry picked from commit 283959bbe0863917c4fc3200a92d1055a4c89bdc)
(cherry picked from commit 0e3c9cbee4ac735b7c19f3cb719b65f960be0b23)
DeltaFile
+1-0usr.sbin/bsdinstall/scripts/script
+1-01 files

FreeBSD/src 95632c9stand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [19 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src 3915ffbstand/efi/loader bootinfo.c, stand/efi/loader/arch/amd64 elf64_freebsd.c

loader.efi: Fix when staging moves late

Prior to this commit, we'd compute the page tables and have the last
entries point to the staging area. We'd then add some more metadata to
the image and boot. This assumed the staging area didn't need to move
for this last bit of data.

However, if we go over the staging limit, when we copyin new data, we
grow the staging area, usually be moving it to a lower address.  This
overage usually happens when we're loading modules and so things work
out nicely. Sometimes we're close to the limit, and we need to do this
growing inside bi_load, after we've computed the page table, making the
page table wrong, and the code we jump to random rather than the btext
routine we normally start at.

To fix this, move computation of the table (but not its allocation) to
after bi_load, but before we call the trampoline.

This problem was most observed when loading microcode for many peole,

    [17 lines not shown]
DeltaFile
+34-24stand/efi/loader/arch/i386/elf64_freebsd.c
+30-21stand/efi/loader/arch/amd64/elf64_freebsd.c
+17-1stand/efi/loader/bootinfo.c
+81-463 files

FreeBSD/src 16e5abfsys/dev/acpica acpi_apei.c

APEI: Provide more info on fatal hardware errors

This change refactors fatal error delivery via APEI and prints more info:

- Makes the NMI handler call into the ge handler to establish a common
        code flow, no matter how the error is delivered
- Adds the FRU to the panic string so as to provide more information than
        just "APEI Fatal Hardware Error!" such as
        "APEI Fatal Hardware Error: PcieError"
- Prints more details about fatal pcie errors.  Note that we skip acquiring
        Giant on fatal errors
- Hexdumps the full GED data on fatal errors, so as to facilitate
        offline data analysis

Reviewed by: imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D57417
DeltaFile
+37-16sys/dev/acpica/acpi_apei.c
+37-161 files

FreeBSD/src e27261dsys/x86/x86 ucode.c

amd64: there is no reason to copy ucode around in ucode_load_bsp()

Approved by:    re (cperciva)
PR:     294630

(cherry picked from commit 16f21c5af35002b8361ffb2e83ff3c92cd899a3a)
(cherry picked from commit c6ccef4a32b4e09927dfdcc0f734af25c6193f5a)
DeltaFile
+9-11sys/x86/x86/ucode.c
+9-111 files

FreeBSD/src 77e894csys/security/audit audit_trigger.c

audit: Replace TAILQ with STAILQ

This reduces the size of a trigger entry from 24 bytes to 16 (or from
12 bytes to 8 on 32-bit) with no additional complexity.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, emaste
Differential Revision:  https://reviews.freebsd.org/D57464
DeltaFile
+11-11sys/security/audit/audit_trigger.c
+11-111 files

FreeBSD/src 0620c99sys/security/audit audit_trigger.c

audit: Add poll / select support

It was previously not possible to poll() or select() on the trigger
device, which made implementing proper signal handling in auditd
difficult.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans, markj
Differential Revision:  https://reviews.freebsd.org/D57457
DeltaFile
+21-2sys/security/audit/audit_trigger.c
+21-21 files

FreeBSD/src 520e0f5sys/netinet6 udp6_usrreq.c

udp: Fix resource leaks in an error path in udp6_send()

Reported by:    Andrew Griffiths <andrew at calif.io>
Fixes:          069a67374ed9 ("ip6: Remove support for RFC2675 (Jumbo Payload Option)")
Reviewed by:    pouria, tuexen, glebius
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57341
DeltaFile
+2-4sys/netinet6/udp6_usrreq.c
+2-41 files

FreeBSD/src c2631d1share/man/man7 arch.7

arch.7: Restore (non-SPE) 32-bit powerpc to MD tables

powerpc is still relevant for lib32.  powerpcspe cannot use lib32 so
remains removed.

Reported by:    Minsoo Choo <minsoo at minsoo.io>
Reviewed by:    Minsoo Choo <minsoo at minsoo.io>
Sponsored by:   The FreeBSD Foundation
Fixes: 2ea49bb595df ("arch.7: Remove 32-bit powerpc from tables")
Differential Revision: https://reviews.freebsd.org/D57473
DeltaFile
+8-2share/man/man7/arch.7
+8-21 files

FreeBSD/src 670738alib/libc/tests/gen fts_regress_test.c Makefile

fts: add fts regression tests

Add ATF regression tests for previously-fixed fts(3) bugs:

- PR 45723: directory with read but no execute is traversed via
  FTS_DONTCHDIR fallback, not silently skipped
  (commit 1e03bff7f2b7)
- PR 196724: FTS_SLNONE must not be returned for a non-symlink;
  time-bounded race test runs for 1 second with concurrent
  file creation/deletion
  (commit bf4374c54589)
- PR 262038: readdir(2) errors produce FTS_DNR with fts_errno
  set, not silently treated as end-of-directory
  (commit 0cff70ca6654)
- SVN r246641: normal traversal works correctly with O_DIRECTORY
  fix in fts_safe_changedir()
  (commit f9928f1705ee)
- SVN r261589: no crash when tree modified during traversal;
  time-bounded race test runs for 1 second with concurrent

    [7 lines not shown]
DeltaFile
+315-0lib/libc/tests/gen/fts_regress_test.c
+2-0lib/libc/tests/gen/Makefile
+317-02 files

FreeBSD/src b45654clib/libc/tests/gen fts_misc_test.c

fts: add misc fts traversal tests

Extend fts_misc_test.c with additional test cases:

- FTS_NOCHDIR with absolute paths allows application chdir freely
- fts_name is always NUL-terminated with correct fts_namelen
- FTS_D/FTS_DP are paired and fts_level increments correctly
- FTSENT fts_errno/fts_dev/fts_ino/fts_nlink are correct
- circular symlink loop under FTS_PHYSICAL terminates
- cycle via symlink under FTS_LOGICAL yields FTS_DC
- fts_close after root deletion must not crash
- fts_close after root rename restores CWD (SVN r77497)
- FTS_NOCHDIR + empty directory does not corrupt path (SVN r49772)
- FTS_NS entry has non-zero fts_errno
- FTS_XDEV and FTS_WHITEOUT stubbed pending mount setup

Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    asomers, jillest
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2248
DeltaFile
+520-1lib/libc/tests/gen/fts_misc_test.c
+520-11 files

FreeBSD/src 28833adsys/netlink/route nexthop.c

netlink: Fix lock leak in nl_find_nhop

Reviewed by: bz, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57156

(cherry picked from commit d66fec481bfd65cbabb6c12a410d76843e76083e)
(cherry picked from commit ab599e44dba31d7b002aed8c71242e06d992b21a)
DeltaFile
+1-1sys/netlink/route/nexthop.c
+1-11 files

FreeBSD/src ab599e4sys/netlink/route nexthop.c

netlink: Fix lock leak in nl_find_nhop

Reviewed by: bz, pouria
Fixes: 7e5bf68495cc ("netlink: add netlink support")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57156

(cherry picked from commit d66fec481bfd65cbabb6c12a410d76843e76083e)
DeltaFile
+1-1sys/netlink/route/nexthop.c
+1-11 files

FreeBSD/src 0ae946esys/dev/vt vt_buf.c vt_core.c

vt: Avoid integer overflow in CONS_HISTORY ioctl

Reviewed by:    markj, vexeduxr
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57250
DeltaFile
+4-5sys/dev/vt/vt_buf.c
+4-2sys/dev/vt/vt_core.c
+8-72 files

FreeBSD/src 641e8e3contrib/telnet/libtelnet getent.c, include stdlib.h

Revert "libc: Constify the getcap API"

This broke cross-building on Linux and macOS.

This reverts commit 823d00b2d447247f1c5860e3bbc61f6fd19a70e5.
DeltaFile
+8-10lib/libc/gen/getcap.c
+4-4lib/libc/gen/getcap.3
+6-1libexec/getty/subr.c
+3-3contrib/telnet/libtelnet/getent.c
+3-3include/stdlib.h
+3-3usr.bin/cap_mkdb/cap_mkdb.c
+27-245 files not shown
+34-3111 files

FreeBSD/src 2404d8dsys/i386/linux linux_ptrace_machdep.c

linux: Drop unneeded PHOLDs

There's no point in acquiring a hold if the proc lock isn't going to be
dropped.

Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57468
DeltaFile
+0-4sys/i386/linux/linux_ptrace_machdep.c
+0-41 files

FreeBSD/src 77fdebalib/libc/gen fts.3

fts: Correct description of fts_set

MFC after:      1 week
Sponsored by:   Klara, Inc.
Fixes:  e030e4e73fe7 ("lib/libc/gen/fts.3: use 'options' consistently in fts_set() description")
Differential Revision:  https://reviews.freebsd.org/D57326
DeltaFile
+5-4lib/libc/gen/fts.3
+5-41 files

FreeBSD/src 2ea49bbshare/man/man7 arch.7

arch.7: Remove 32-bit powerpc from tables

Most 32-bit architecture support has been deprecated for FreeBSD 16.

Reviewed by:    des
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57472
DeltaFile
+2-14share/man/man7/arch.7
+2-141 files

FreeBSD/src 5805fadshare/man/man7 arch.7

arch.7: arch.7: Add wchar_t signedness

Most architectures have the same signedness for char and wchar_t, but
powerpc has the unusual combination of unsigned char and signed wchar_t.

Reviewed by:    des, jhb, markj
Sponsored by:   The FreeBSD Foundation
DeltaFile
+14-14share/man/man7/arch.7
+14-141 files

FreeBSD/src 5cc3fa0sys/arm64/arm64 trap.c, sys/sys signalvar.h

arm64: Add exception flag for ksiginfo_t and set in trapsignal

The `ksiginfo_t` flag `KSI_TRAP` is set both for exceptions and when
copying between userspace and the kernel fails. In the latter case, the
exception syndrome register as captured in `struct trapframe` won't be
valid. That means we can't use `KSI_TRAP` to determine whether `tf_esr`
is valid. This motivates the addition of a new flag, here called
`KSI_EXCEPT`, for specifically identifying signals caused by exceptions.
It is added to `ksi_flags` via `trapsignal`.

Signed-off-by: Alex Arslan <ararslan at comcast.net>
Reported by:    andrew
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2053
DeltaFile
+1-0sys/sys/signalvar.h
+1-0sys/arm64/arm64/trap.c
+2-02 files

FreeBSD/src 0b862a7sys/arm64/arm64 exec_machdep.c, sys/arm64/include ucontext.h

arm64: Expose ESR in mcontext

At present, the exception syndrome register (ESR) is not accessible via
the user context on FreeBSD AArch64, which makes it difficult to
determine the cause of an exception. For example, a signal handler might
get a `SIGSEGV` with `SEGV_ACCERR`, but it can't know whether that
occurred due to a bad read or write. The change implemented here
includes ESR in `struct __mcontext`, thereby allowing access via
`ucontext_t` for use by signal handlers, sanitizers, debuggers, etc.

Note that this addition consumes one of the seven spare 64-bit slots in
`struct __mcontext`.

Signed-off-by: Alex Arslan <ararslan at comcast.net>
Reviewed by:    andrew
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2053
DeltaFile
+5-0sys/arm64/arm64/exec_machdep.c
+3-1sys/arm64/include/ucontext.h
+8-12 files

FreeBSD/src 8f6c577usr.sbin/bhyve bhyverun.c, usr.sbin/bhyve/aarch64 bhyverun_machdep.c

bhyve(8): allow cpu pinning using N-M:X-Y ranges

bhyve's -p allows to pin guest's virtual CPU vcpu to hostcpu, however
this becomes very tedious work when you have to pin more than a single
CPU.

This allows to pass a range to -p, e.g. -p 0-3:4-7 which will pin the
cpus 0:4, 1:5, 2:6, 3:7. The ranges must be equal and the CPU numbers
must be ascending.

Sponsored by: Armenian Bioinformatics Institute
Reviewed by:    corvink, markj
Tested by:      bnovkov
MFC after:      3 weeks
Differential Revision:  https://reviews.freebsd.org/D54937
DeltaFile
+30-8usr.sbin/bhyve/bhyverun.c
+3-2usr.sbin/bhyve/aarch64/bhyverun_machdep.c
+3-2usr.sbin/bhyve/amd64/bhyverun_machdep.c
+3-2usr.sbin/bhyve/riscv/bhyverun_machdep.c
+39-144 files

FreeBSD/src b5a9689libexec/rc rc, share/man/man8 rc.8

rc: Bail if /dev/null is not a device

On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.

PR:             295782
MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57447
DeltaFile
+11-1share/man/man8/rc.8
+5-0libexec/rc/rc
+16-12 files

FreeBSD/src ddf6fadusr.sbin/etcupdate etcupdate.8 etcupdate.sh

etcupdate: Make nobuild the default

The common case for etcupdate is to run it after building and installing
the world, in which case we already have an object directory to draw on.
Add a -b option to turn nobuild off (opposite of -B), and turn nobuild
on by default.

MFC after:      1 week
Reviewed by:    jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D57306
DeltaFile
+17-13usr.sbin/etcupdate/etcupdate.8
+5-2usr.sbin/etcupdate/etcupdate.sh
+22-152 files

FreeBSD/src c606eb3lib/libc/tests/gen fts_children_test.c

fts: address post-merge feedback on fts_children_test.c

- Remove fts_check_debug() which is only needed by test cases
  that use the fts_test() helper; fts_children_test.c does not
  call fts_test()
- Remove fts_lexical_compar where traversal order does not matter
  for the test result
- Drop fts_test.h and copy fts_lexical_compar locally
- Pull up NULL argument onto same line as fts_open

Fixes:          e624417db8a1 ("lib/libc/tests/gen: add fts_children() tests")
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:    des, asomers
MFC after:      2 weeks
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2260
DeltaFile
+8-8lib/libc/tests/gen/fts_children_test.c
+8-81 files

FreeBSD/src f4424a2sbin/dhclient dhclient.conf.5

dhclient.conf.5: Correct crossreference

PR:             285614
Reviewed by:    ziaee, michaelo, jrm
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D49489
DeltaFile
+8-7sbin/dhclient/dhclient.conf.5
+8-71 files