FreeBSD/src 8759a34sys/conf newvers.sh

15.1: Bump version to BETA3-p1

Since we had a conveniently timed batch of security issues, I'm going
to use this opportunity to test pkgbase update tooling.

Approved by:    re (cperciva)
DeltaFile
+1-1sys/conf/newvers.sh
+1-11 files

FreeBSD/src 8f715c6crypto/openssh freebsd-configure.sh

openssh: Fix SIZEOF_TIME_T in freebsd-configure.sh

Sponsored by:   The FreeBSD Foundation
Reviewed by:    jlduran
Differential Revision: https://reviews.freebsd.org/D57053

(cherry picked from commit 0b0e5daf4333a0faf93133f7d2c7b3743eead9d8)
(cherry picked from commit b718f7d88157f4d5827e3639c1e0ba7e5383ed04)
DeltaFile
+7-0crypto/openssh/freebsd-configure.sh
+7-01 files

FreeBSD/src bc301fetests/sys/net/routing test_routing.sh Makefile

routing: Add tests for metric

Add tests to make sure:
* Default metric is enforced.
* Lowest metric wins.
* Deleting routes by specifying gateway/metric works.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D57016
DeltaFile
+231-0tests/sys/net/routing/test_routing.sh
+3-0tests/sys/net/routing/Makefile
+234-02 files

FreeBSD/src 1f03c62usr.bin/netstat route.c route_netlink.c

netstat(1): Show metric value for routes

Add metric support and show its value in wide flag and
libxo output.
Also, add metric to the description of wide flag (`-w`) in
routing display (`-r`) section of manual page.

Reviewed by:    markj (manpage)
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D57011
DeltaFile
+8-4usr.bin/netstat/route.c
+6-3usr.bin/netstat/route_netlink.c
+2-2usr.bin/netstat/netstat.1
+1-0usr.bin/netstat/common.h
+17-94 files

FreeBSD/src d87e5b2sbin/route route.8

route.8: Describe metric modifier

Describe `-metric` argument in the route manual.

Discussed with: ziaee
Differential Revision: https://reviews.freebsd.org/D57025
DeltaFile
+21-1sbin/route/route.8
+21-11 files

FreeBSD/src 2e2d402sbin/route route.c route_netlink.c

route(8): Add metric argument

Add support for metric in route command.

Differential Revision: https://reviews.freebsd.org/D56335
DeltaFile
+4-0sbin/route/route.c
+2-0sbin/route/route_netlink.c
+1-0sbin/route/keywords
+7-03 files

FreeBSD/src f15b8a8sbin/route route_netlink.c

route(8): Show metric value in monitor route

Reviewed by:    glebius
Differential Revision: https://reviews.freebsd.org/D56326
DeltaFile
+1-0sbin/route/route_netlink.c
+1-01 files

FreeBSD/src 6dd429asbin/route route_netlink.c

route(8): Show metric value in get route

Reviewed by:    glebius
Differential Revision: https://reviews.freebsd.org/D56325
DeltaFile
+5-2sbin/route/route_netlink.c
+5-21 files

FreeBSD/src b9a246ashare/man/man4 rtnetlink.4

rtnetlink.4: Add RTA_PRIORITY

Add metric implementation of netlink to manual.

Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D56324
DeltaFile
+3-1share/man/man4/rtnetlink.4
+3-11 files

FreeBSD/src 73acfc5sys/netlink netlink_snl_route_parsers.h, sys/netlink/route rt.c route.h

netlink: Add RTA_PRIORITY support (metric)

* Use our new 32-bit metric for RTA_PRIORITY support.
* Update snl library for new RTA_PRIORITY support.
* return RTA_PRIORITY for both MPATH and non-MPATH routes.

Reviewed by:    glebius (previous version)
Discussed with: markj
Differential Revision: https://reviews.freebsd.org/D56323
DeltaFile
+15-2sys/netlink/route/rt.c
+4-0sys/netlink/netlink_snl_route_parsers.h
+1-1sys/netlink/route/route.h
+20-33 files

FreeBSD/src c0256b3sys/net route.h, sys/net/route nhgrp_ctl.c nhop_ctl.c

routing: Add support for metric

In our routing stack implementation, metric is an attribute
of the nexthop, not the route itself.
Store metric in nhop_priv which is control-plane data of
nexthop, filter the nexthops by metric and populate the mpath
slots in nexthop group with only the lowest metric nexthops
for use in the forwarding path.

`cmp_priv()` compares nhops based on priv hash.
Add metric compare logic to it and only return nexthops
with different metrics if the input nexthop's metric is
zero (wildcard).
Also, add support for metric via rtsock by introducing rmx_metric.

Finally, remove the upper 8-bit reservation of weight for
administrative distance.

Reviewed by:    adrian

    [3 lines not shown]
DeltaFile
+45-18sys/net/route/nhgrp_ctl.c
+36-3sys/net/route/nhop_ctl.c
+5-2sys/net/route.h
+1-4sys/net/route/route_ctl.c
+2-1sys/net/route/nhop_var.h
+2-0sys/net/route/nhop.h
+91-282 files not shown
+93-288 files

FreeBSD/src b718f7dcrypto/openssh freebsd-configure.sh

openssh: Fix SIZEOF_TIME_T in freebsd-configure.sh

Sponsored by:   The FreeBSD Foundation
Reviewed by:    jlduran
Differential Revision: https://reviews.freebsd.org/D57053

(cherry picked from commit 0b0e5daf4333a0faf93133f7d2c7b3743eead9d8)
DeltaFile
+7-0crypto/openssh/freebsd-configure.sh
+7-01 files

FreeBSD/src 59601a7lib/libcasper/services/cap_net cap_net.3

cap_net.3: Clarify monotonic reduction in permitted operations

Reviewed by:    markj, oshogbo
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57141
DeltaFile
+2-1lib/libcasper/services/cap_net/cap_net.3
+2-11 files

FreeBSD/src f15df0ausr.sbin/bsdconfig/share/media wlan.subr

bsdconfig: Make sure that SSID names are properly escaped

The f_menu_wpa_scan_results() function returns a list of networks
discovered by a scan.  The untrusted network names are evaluated in
f_dialog_menu_wireless_edit.  The quoting applied in
f_menu_wpa_scan_results() protects against evaluation of something like
"$(whoami)" but one can add single quotes to defeat that.

Pass the SSID names through f_shell_escape to work around this.  Escape
single quotes in f_dialog_wireless_edit() and f_menu_wireless_configs()
too for consistency.

I note that this module doesn't seem to actually work, see e.g.,
bugzilla PR 229883.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls

    [2 lines not shown]
DeltaFile
+3-0usr.sbin/bsdconfig/share/media/wlan.subr
+3-01 files

FreeBSD/src 9e74d5elib/libcasper/libcasper service.c libcasper_service.c, lib/libcasper/tests cap_main_test.c Makefile

libcasper: switch from select(2) to poll(2)

The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

poll(2) takes an array indexed by slot rather than by fd value, so it
has no FD_SETSIZE limit.

Approved by:    so
Security:       FreeBSD-SA-26:22.libcasper
Security:       CVE-2026-39461
Reported by:    Joshua Rogers
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56695
DeltaFile
+105-83lib/libcasper/libcasper/service.c
+142-0lib/libcasper/tests/cap_main_test.c
+4-53lib/libcasper/libcasper/libcasper_service.c
+10-2lib/libcasper/tests/Makefile
+2-4lib/libcasper/libcasper/libcasper_impl.h
+263-1425 files

FreeBSD/src 25148c5sys/fs/fuse fuse_vnops.c fuse_ipc.h, tests/sys/fs/fusefs xattr.cc

fusefs: Handle buggy servers' LISTXATTR response

The fuse protocol requires server to respond to LISTXATTR with a
NUL-terminated string.  If they don't, report an error rather than
attempt to scan through uninitialized memory for a NUL.

Approved by:    so
Security:       FreeBSD-SA-26:20.fusefs
Security:       CVE-2026-45252
admbugs:        1039
Reported by:    Joshua Rogers
Sponsored by:   ConnectWise
DeltaFile
+73-0tests/sys/fs/fusefs/xattr.cc
+11-6sys/fs/fuse/fuse_vnops.c
+1-0sys/fs/fuse/fuse_ipc.h
+85-63 files

FreeBSD/src b90b25csys/dev/netmap netmap_freebsd.c

netmap: Drain selinfo sleepers in nm_os_selinfo_uninit()

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
DeltaFile
+1-0sys/dev/netmap/netmap_freebsd.c
+1-01 files

FreeBSD/src dab07b7sys/kern sys_procdesc.c, sys/sys procdesc.h

procdesc: Make sure to drain selinfo sleepers in procdesc_free()

Otherwise they are left on a freed list after procdesc_free() is called.
This can be exploited to elevate privileges.

Remove the PDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
Reported by:    75Acol, Lexpl0it, fcgboy, and robinzeng2015
Reviewed by:    kib, oshogbo
Fixes:          cfb5f7686588 ("Add experimental support for process descriptors")
Differential Revision:  https://reviews.freebsd.org/D56887
DeltaFile
+128-0tests/sys/kern/procdesc.c
+3-7sys/kern/sys_procdesc.c
+2-0tests/sys/kern/Makefile
+0-1sys/sys/procdesc.h
+133-84 files

FreeBSD/src 8eb0bbbsys/kern kern_prot.c

setcred: Fix buffer overflow

Since groups is a pointer to a pointer to an array of gid_t, we should
use sizeof(**groups) or sizeof(gid_t) when calculating how much to
allocate and copy in.  We were using sizeof(*groups) instead, which
meant that on 64-bit platforms, we would allocate and copy in twice as
much as we should.  Unfortunately, in the smallgroups case, we copy
into a preallocated buffer which has the correct size, which means that
if sc_supp_groups_nb >= CRED_SMALLGROUPS_NB / 2, we overflow smallgroups.

This is a direct commit to stable/14.

Approved by:    so
Security:       FreeBSD-SA-26:18.setcred
Reported by:    Ryan of Calif.io
Fixes:          ddb3eb4efe55 ("New setcred() system call and associated MAC hooks")
DeltaFile
+2-2sys/kern/kern_prot.c
+2-21 files

FreeBSD/src 1837269usr.sbin/bsdinstall/scripts wlanconfig

bsdinstall: Avoid invoking eval on the wlan SSID list

The wlanconfig utility is not careful about handling untrusted network
names, which can contain shell metacharacters.  Factor network selection
into a subroutine and use the `set -- "$@"` trick to build up a list of
positional parameters for bsddialog without evaluating them.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls
Reviewed by:    dteske, des, asiciliano
Differential Revision:  https://reviews.freebsd.org/D56973
DeltaFile
+31-16usr.sbin/bsdinstall/scripts/wlanconfig
+31-161 files

FreeBSD/src fac902asys/kern kern_sig.c, tests/sys/kern ptrace_test.c

ptrace: Fix validation of PT_SC_REMOTE arguments

- Fix an off-by-one in the system call number check.  A value of
  SYS_MAXSYSCALL was permitted.
- Validate the system call number after we've dealt with
  syscall(2)/__syscall(2), since they pass the syscall number as an
  argument.
- When the syscall number is for syscall(2) or __syscall(2), we must
  make sure that nargs > 0 to avoid an underflow when shifting arguments
  down.

Add regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:21.ptrace
Security:       CVE-2026-45253
Fixes:          140ceb5d956b ("ptrace(2): add PT_SC_REMOTE remote syscall request")
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D56978
DeltaFile
+66-19tests/sys/kern/ptrace_test.c
+10-7sys/kern/kern_sig.c
+76-262 files

FreeBSD/src b640153usr.sbin/bsdinstall/scripts wlanconfig

bsdinstall: Fix wifi network selection size

Use correct variable while creating dialog used to select among
available wireless networks

Approved by:    asiciliano
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D45271

(cherry picked from commit 55d29905489c975ee33b86d34f38e78b5ba29817)
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/wlanconfig
+1-11 files

FreeBSD/src 6f5674busr.sbin/bsdconfig/share/media wlan.subr

bsdconfig: Make sure that SSID names are properly escaped

The f_menu_wpa_scan_results() function returns a list of networks
discovered by a scan.  The untrusted network names are evaluated in
f_dialog_menu_wireless_edit.  The quoting applied in
f_menu_wpa_scan_results() protects against evaluation of something like
"$(whoami)" but one can add single quotes to defeat that.

Pass the SSID names through f_shell_escape to work around this.  Escape
single quotes in f_dialog_wireless_edit() and f_menu_wireless_configs()
too for consistency.

I note that this module doesn't seem to actually work, see e.g.,
bugzilla PR 229883.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls

    [2 lines not shown]
DeltaFile
+3-0usr.sbin/bsdconfig/share/media/wlan.subr
+3-01 files

FreeBSD/src 23929d7lib/libcasper/libcasper service.c libcasper_service.c, lib/libcasper/tests cap_main_test.c Makefile

libcasper: switch from select(2) to poll(2)

The previous implementation used FD_SET() on a stack-allocated fd_set,
which is an out-of-bounds write whenever the socket fd is >= FD_SETSIZE
(1024).

poll(2) takes an array indexed by slot rather than by fd value, so it
has no FD_SETSIZE limit.

Approved by:    so
Security:       FreeBSD-SA-26:22.libcasper
Security:       CVE-2026-39461
Reported by:    Joshua Rogers
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56695
DeltaFile
+105-82lib/libcasper/libcasper/service.c
+142-0lib/libcasper/tests/cap_main_test.c
+4-53lib/libcasper/libcasper/libcasper_service.c
+9-2lib/libcasper/tests/Makefile
+2-4lib/libcasper/libcasper/libcasper_impl.h
+262-1415 files

FreeBSD/src b7d2e44usr.sbin/bsdinstall/scripts wlanconfig

bsdinstall: Avoid invoking eval on the wlan SSID list

The wlanconfig utility is not careful about handling untrusted network
names, which can contain shell metacharacters.  Factor network selection
into a subroutine and use the `set -- "$@"` trick to build up a list of
positional parameters for bsddialog without evaluating them.

Approved by:    so
Security:       FreeBSD-SA-26:23.bsdinstall
Security:       CVE-2026-45255
Reported by:    Austin Ralls
Reviewed by:    dteske, des, asiciliano
Differential Revision:  https://reviews.freebsd.org/D56973
DeltaFile
+31-16usr.sbin/bsdinstall/scripts/wlanconfig
+31-161 files

FreeBSD/src 3b4afabsys/kern kern_sig.c, tests/sys/kern ptrace_test.c

ptrace: Fix validation of PT_SC_REMOTE arguments

- Fix an off-by-one in the system call number check.  A value of
  SYS_MAXSYSCALL was permitted.
- Validate the system call number after we've dealt with
  syscall(2)/__syscall(2), since they pass the syscall number as an
  argument.
- When the syscall number is for syscall(2) or __syscall(2), we must
  make sure that nargs > 0 to avoid an underflow when shifting arguments
  down.

Add regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:21.ptrace
Security:       CVE-2026-45253
Fixes:          140ceb5d956b ("ptrace(2): add PT_SC_REMOTE remote syscall request")
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai
Reviewed by:    kib, emaste
Differential Revision:  https://reviews.freebsd.org/D56978
DeltaFile
+66-19tests/sys/kern/ptrace_test.c
+10-7sys/kern/kern_sig.c
+76-262 files

FreeBSD/src 53a78e5sys/dev/netmap netmap_freebsd.c

netmap: Drain selinfo sleepers in nm_os_selinfo_uninit()

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
DeltaFile
+1-0sys/dev/netmap/netmap_freebsd.c
+1-01 files

FreeBSD/src df3f3fasys/fs/fuse fuse_vnops.c fuse_ipc.h, tests/sys/fs/fusefs xattr.cc

fusefs: Handle buggy servers' LISTXATTR response

The fuse protocol requires server to respond to LISTXATTR with a
NUL-terminated string.  If they don't, report an error rather than
attempt to scan through uninitialized memory for a NUL.

Approved by:    so
Security:       FreeBSD-SA-26:20.fusefs
Security:       CVE-2026-45252
admbugs:        1039
Reported by:    Joshua Rogers
Sponsored by:   ConnectWise
DeltaFile
+73-0tests/sys/fs/fusefs/xattr.cc
+12-6sys/fs/fuse/fuse_vnops.c
+1-0sys/fs/fuse/fuse_ipc.h
+86-63 files

FreeBSD/src f45a4f9sys/kern kern_jaildesc.c, sys/sys jaildesc.h

jaildesc: Make sure to drain selinfo sleepers in jaildesc_close()

Otherwise they may be left on a freed selinfo list after the
corresponding jaildesc struct is freed.  This can be exploited to
elevate privileges.

Remove the JDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
Fixes:          66d8ffe3046d ("jaildesc: add kevent support")
Reviewed by:    kib, jamie
Differential Revision:  https://reviews.freebsd.org/D56945
DeltaFile
+201-0tests/sys/kern/jaildesc.c
+3-7sys/kern/kern_jaildesc.c
+2-0tests/sys/kern/Makefile
+0-1sys/sys/jaildesc.h
+206-84 files

FreeBSD/src d7e63dfsys/kern sys_procdesc.c, sys/sys procdesc.h

procdesc: Make sure to drain selinfo sleepers in procdesc_free()

Otherwise they are left on a freed list after procdesc_free() is called.
This can be exploited to elevate privileges.

Remove the PDF_SELECTED micro-optimization.  doselwakeup() is a no-op if
no one ever called selrecord() on the file description, so I see no
reason to complicate the code to avoid the call.

Add some regression tests.

Approved by:    so
Security:       FreeBSD-SA-26:19.file
Security:       CVE-2026-45251
Reported by:    75Acol, Lexpl0it, fcgboy, and robinzeng2015
Reviewed by:    kib, oshogbo
Fixes:          cfb5f7686588 ("Add experimental support for process descriptors")
Differential Revision:  https://reviews.freebsd.org/D56887
DeltaFile
+85-1tests/sys/kern/procdesc.c
+3-7sys/kern/sys_procdesc.c
+0-1sys/sys/procdesc.h
+1-0tests/sys/kern/Makefile
+89-94 files