FreeBSD/src 88f1161sys/opencrypto crypto.c

OCF: Add a fail point to inject EBADMSG decryption errors

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+16-0sys/opencrypto/crypto.c
+16-01 files

FreeBSD/src 825c6f4etc/mtree BSD.tests.dist, tests/sys/net Makefile

wg(4): Add a test that the driver handles a decryption failure

The test uses a fail point to inject a decryption error in OCF while
sending a ping across the tunnel.  The driver should then fail to
respond to the ping and increment the input error counter on the
interface.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+111-0tests/sys/net/wg/if_wg_nojail.sh
+10-0tests/sys/net/wg/Makefile
+2-0etc/mtree/BSD.tests.dist
+1-0tests/sys/net/Makefile
+124-04 files

FreeBSD/src 89a88e4sys/kern imgact_elf.c

coredump: Don't assume that the number of ELF segments is consistent

In an ELF coredump, each dumped vm_map_entry is represented by a
segment.  __elfN(coredump) first computes the number of segments by
looping over the vm_map entries (in each_dumpable_segment()), then
allocates a buffer to hold the ELF header and program headers, then
loops over the entries again to populate the program headers.

each_dumpable_segment() holds the vm_map read lock, but that lock is
dropped between the two calls.  If the map is shared with another
process, via rfork(), then the map can change.  cb_put_phdr() did not
account for this, and so could write out of bounds.

Add a check to prevent this; simply do not write out excess segments.

Approved by:    so
Security:       FreeBSD-SA-26:55.elf
Security:       CVE-2026-58088
Reported by:    Maik Muench of Secfault Security

    [3 lines not shown]
DeltaFile
+19-3sys/kern/imgact_elf.c
+19-31 files

FreeBSD/src 4cb888csys/dev/wg wg_crypto.c

wg(4): Check for crypto operation errors

In particular, handle authentication errors due to bad MACs when
decrypting packets.

Since the current dispatch code assumes synchronous OCF sessions by
design, explicitly reject any created OCF session that is not
synchronous.  Software sessions are always synchronous in practice, so
this should be a nop.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+10-1sys/dev/wg/wg_crypto.c
+10-11 files

FreeBSD/src 8b08ee9sys/kern sysv_sem.c

sysvsem: Fix a TOCTOU race in semctl({GET,SET}ALL)

These commands take a snapshot of the size of a semaphore set, then drop
the lock and malloc an appropriately sized array before reacquiring the
lock.  A comment explains why this is (probably) safe.  Unfortunately,
it's wrong; it is indeed possible for a malicious userspace to create
and destroy 2^{15} sets in the window where the lock is dropped.  This
race can lead to out-of-bounds reads and writes, and that can be
exploited to elevate privileges.

Replace the assertions with runtime checks.

Approved by:    so
Security:       FreeBSD-SA-26:54.sysvsem
Security:       CVE-2026-58087
Reported by:    Maik Muench of Secfault Security
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58421
DeltaFile
+16-20sys/kern/sysv_sem.c
+16-201 files

FreeBSD/src 008d3basys/kern imgact_elf.c

coredump: Don't assume that the number of ELF segments is consistent

In an ELF coredump, each dumped vm_map_entry is represented by a
segment.  __elfN(coredump) first computes the number of segments by
looping over the vm_map entries (in each_dumpable_segment()), then
allocates a buffer to hold the ELF header and program headers, then
loops over the entries again to populate the program headers.

each_dumpable_segment() holds the vm_map read lock, but that lock is
dropped between the two calls.  If the map is shared with another
process, via rfork(), then the map can change.  cb_put_phdr() did not
account for this, and so could write out of bounds.

Add a check to prevent this; simply do not write out excess segments.

Approved by:    so
Security:       FreeBSD-SA-26:55.elf
Security:       CVE-2026-58088
Reported by:    Maik Muench of Secfault Security

    [3 lines not shown]
DeltaFile
+19-3sys/kern/imgact_elf.c
+19-31 files

FreeBSD/src cb7cb40sys/kern kern_event.c, sys/sys event.h

kqueue: Avoid enqueuing an already-enqueued knote

knotes with a non-trivial f_copy implementation may be activated before
kqueue_fork_copy_knote() is finished.  In particular, it may be enqueued
at the time that kqueue_fork_copy_knote() calls knote_enqueue().  Guard
against this.

Add a test case which triggers the race.

Fix several other problems with the replication of knote state:
- Make sure only the KN_ACTIVE and KN_DISABLED status flags are
  inherited, the rest should not be copied.
- Ignore marker knotes.
- Ignore knotes for kqueues.  They cannot be safely copied into the
  child without more work, as kqueues are inherently local to a process;
  on fork, we need to ensure that such knotes are patched to reference
  the new kqueue, not the original.
- Try to keep knote state stable by holding the kqueue and knlist locks
  while copying.

    [8 lines not shown]
DeltaFile
+35-8sys/kern/kern_event.c
+36-0tests/sys/kqueue/kqueue_fork.c
+1-0sys/sys/event.h
+72-83 files

FreeBSD/src e258568sys/kern sysv_sem.c

sysvsem: Fix a TOCTOU race in semctl({GET,SET}ALL)

These commands take a snapshot of the size of a semaphore set, then drop
the lock and malloc an appropriately sized array before reacquiring the
lock.  A comment explains why this is (probably) safe.  Unfortunately,
it's wrong; it is indeed possible for a malicious userspace to create
and destroy 2^{15} sets in the window where the lock is dropped.  This
race can lead to out-of-bounds reads and writes, and that can be
exploited to elevate privileges.

Replace the assertions with runtime checks.

Approved by:    so
Security:       FreeBSD-SA-26:54.sysvsem
Security:       CVE-2026-58087
Reported by:    Maik Muench of Secfault Security
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58421
DeltaFile
+16-20sys/kern/sysv_sem.c
+16-201 files

FreeBSD/src dbd5593sys/dev/wg wg_crypto.c

wg(4): Check for crypto operation errors

In particular, handle authentication errors due to bad MACs when
decrypting packets.

Since the current dispatch code assumes synchronous OCF sessions by
design, explicitly reject any created OCF session that is not
synchronous.  Software sessions are always synchronous in practice, so
this should be a nop.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+10-1sys/dev/wg/wg_crypto.c
+10-11 files

FreeBSD/src cd14473sys/opencrypto crypto.c

OCF: Add a fail point to inject EBADMSG decryption errors

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+15-0sys/opencrypto/crypto.c
+15-01 files

FreeBSD/src fb432f5sys/kern kern_jail.c

jail: restore ktrace privileges for jailed root

Commit 4be491e1b9b3 ("jail: Optionally allow audit session state to
be configured in a jail") removed the #if 0 around the audit cases
in prison_priv_check() and added the PR_ALLOW_SETAUDIT check under
them.  This unintentionally captured the preceding case PRIV_KTRACE,
which used to fall through the disabled block into the unconditional
return (0) of the credential cases: since then, jailed root only has
ktrace privileges (tracing processes with changed credentials, see
ktrcanset()) when the unrelated allow.setaudit knob is enabled, and
conversely gains them when that audit knob is turned on.

Give PRIV_KTRACE back its own unconditional return (0), matching its
comment and the pre-4be491e1b9b3 behaviour.

Approved by:    so
Security:       FreeBSD-SA-26:53.ktrace
Security:       CVE-2026-58086
Fixes:          4be491e1b9b3 ("jail: Optionally allow audit session state to be configured in a jail")

    [2 lines not shown]
DeltaFile
+1-0sys/kern/kern_jail.c
+1-01 files

FreeBSD/src 4c40cb6etc/mtree BSD.tests.dist, tests/sys/net Makefile

wg(4): Add a test that the driver handles a decryption failure

The test uses a fail point to inject a decryption error in OCF while
sending a ping across the tunnel.  The driver should then fail to
respond to the ping and increment the input error counter on the
interface.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+111-0tests/sys/net/wg/if_wg_nojail.sh
+10-0tests/sys/net/wg/Makefile
+2-0etc/mtree/BSD.tests.dist
+1-0tests/sys/net/Makefile
+124-04 files

FreeBSD/src 7893a7esys/kern imgact_elf.c

coredump: Don't assume that the number of ELF segments is consistent

In an ELF coredump, each dumped vm_map_entry is represented by a
segment.  __elfN(coredump) first computes the number of segments by
looping over the vm_map entries (in each_dumpable_segment()), then
allocates a buffer to hold the ELF header and program headers, then
loops over the entries again to populate the program headers.

each_dumpable_segment() holds the vm_map read lock, but that lock is
dropped between the two calls.  If the map is shared with another
process, via rfork(), then the map can change.  cb_put_phdr() did not
account for this, and so could write out of bounds.

Add a check to prevent this; simply do not write out excess segments.

Approved by:    so
Security:       FreeBSD-SA-26:55.elf
Security:       CVE-2026-58088
Reported by:    Maik Muench of Secfault Security

    [3 lines not shown]
DeltaFile
+19-3sys/kern/imgact_elf.c
+19-31 files

FreeBSD/src 8c5e2d2sys/kern sysv_sem.c

sysvsem: Fix a TOCTOU race in semctl({GET,SET}ALL)

These commands take a snapshot of the size of a semaphore set, then drop
the lock and malloc an appropriately sized array before reacquiring the
lock.  A comment explains why this is (probably) safe.  Unfortunately,
it's wrong; it is indeed possible for a malicious userspace to create
and destroy 2^{15} sets in the window where the lock is dropped.  This
race can lead to out-of-bounds reads and writes, and that can be
exploited to elevate privileges.

Replace the assertions with runtime checks.

Approved by:    so
Security:       FreeBSD-SA-26:54.sysvsem
Security:       CVE-2026-58087
Reported by:    Maik Muench of Secfault Security
Reviewed by:    kib
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58421
DeltaFile
+16-20sys/kern/sysv_sem.c
+16-201 files

FreeBSD/src 3427182sys/dev/wg wg_crypto.c

wg(4): Check for crypto operation errors

In particular, handle authentication errors due to bad MACs when
decrypting packets.

Since the current dispatch code assumes synchronous OCF sessions by
design, explicitly reject any created OCF session that is not
synchronous.  Software sessions are always synchronous in practice, so
this should be a nop.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+10-1sys/dev/wg/wg_crypto.c
+10-11 files

FreeBSD/src d8bdcb0sys/kern kern_event.c, sys/sys event.h

kqueue: Avoid enqueuing an already-enqueued knote

knotes with a non-trivial f_copy implementation may be activated before
kqueue_fork_copy_knote() is finished.  In particular, it may be enqueued
at the time that kqueue_fork_copy_knote() calls knote_enqueue().  Guard
against this.

Add a test case which triggers the race.

Fix several other problems with the replication of knote state:
- Make sure only the KN_ACTIVE and KN_DISABLED status flags are
  inherited, the rest should not be copied.
- Ignore marker knotes.
- Ignore knotes for kqueues.  They cannot be safely copied into the
  child without more work, as kqueues are inherently local to a process;
  on fork, we need to ensure that such knotes are patched to reference
  the new kqueue, not the original.
- Try to keep knote state stable by holding the kqueue and knlist locks
  while copying.

    [8 lines not shown]
DeltaFile
+35-8sys/kern/kern_event.c
+36-0tests/sys/kqueue/kqueue_fork.c
+1-0sys/sys/event.h
+72-83 files

FreeBSD/src 490365esys/kern kern_jail.c

jail: restore ktrace privileges for jailed root

Commit 4be491e1b9b3 ("jail: Optionally allow audit session state to
be configured in a jail") removed the #if 0 around the audit cases
in prison_priv_check() and added the PR_ALLOW_SETAUDIT check under
them.  This unintentionally captured the preceding case PRIV_KTRACE,
which used to fall through the disabled block into the unconditional
return (0) of the credential cases: since then, jailed root only has
ktrace privileges (tracing processes with changed credentials, see
ktrcanset()) when the unrelated allow.setaudit knob is enabled, and
conversely gains them when that audit knob is turned on.

Give PRIV_KTRACE back its own unconditional return (0), matching its
comment and the pre-4be491e1b9b3 behaviour.

Approved by:    so
Security:       FreeBSD-SA-26:53.ktrace
Security:       CVE-2026-58086
Fixes:          4be491e1b9b3 ("jail: Optionally allow audit session state to be configured in a jail")

    [2 lines not shown]
DeltaFile
+1-0sys/kern/kern_jail.c
+1-01 files

FreeBSD/src db3afbeetc/mtree BSD.tests.dist, tests/sys/net Makefile

wg(4): Add a test that the driver handles a decryption failure

The test uses a fail point to inject a decryption error in OCF while
sending a ping across the tunnel.  The driver should then fail to
respond to the ping and increment the input error counter on the
interface.

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+111-0tests/sys/net/wg/if_wg_nojail.sh
+10-0tests/sys/net/wg/Makefile
+2-0etc/mtree/BSD.tests.dist
+1-0tests/sys/net/Makefile
+124-04 files

FreeBSD/src 98bbfefsys/opencrypto crypto.c

OCF: Add a fail point to inject EBADMSG decryption errors

Approved by:    so
Security:       FreeBSD-SA-26:52.if_wg
Security:       CVE-2026-58085
Reviewed by:    markj
Sponsored by:   Chelsio Communications
DeltaFile
+15-0sys/opencrypto/crypto.c
+15-01 files

FreeBSD/ports 3c37ff9devel/librcc/files patch-examples_Makefile.am

devel/librcc: Fix building with libtool 2.6

PR:             296964
DeltaFile
+11-0devel/librcc/files/patch-examples_Makefile.am
+11-01 files

FreeBSD/ports cd3b903emulators/tme/files patch-tmesh_Makefile.am

emulators/tme: Fix building with libtool 2.6

PR:             296964
DeltaFile
+9-0emulators/tme/files/patch-tmesh_Makefile.am
+9-01 files

FreeBSD/ports d676bbemail/nextcloud-mail Makefile distinfo

mail/nextcloud-mail: Update to 5.10.10
DeltaFile
+3-3mail/nextcloud-mail/distinfo
+1-1mail/nextcloud-mail/Makefile
+4-42 files

FreeBSD/ports d7016bawww/nextcloud-groupfolders Makefile distinfo

www/nextcloud-groupfolders: Update to 22.0.6
DeltaFile
+3-3www/nextcloud-groupfolders/distinfo
+1-1www/nextcloud-groupfolders/Makefile
+4-42 files

FreeBSD/ports 6f2f021www/nextcloud-contacts Makefile distinfo

www/nextcloud-contacts: Update to 8.7.5
DeltaFile
+3-3www/nextcloud-contacts/distinfo
+1-1www/nextcloud-contacts/Makefile
+4-42 files

FreeBSD/ports 79bb726www/nextcloud-calendar Makefile distinfo

www/nextcloud-calendar: Update to 6.5.2
DeltaFile
+3-3www/nextcloud-calendar/distinfo
+1-1www/nextcloud-calendar/Makefile
+4-42 files

FreeBSD/ports 56a340cwww/pocketbase Makefile distinfo

www/pocketbase: Update 0.36.9 => 0.39.9

While here, utilize GO_TARGET in favor of post-install target.

Changelog:
https://github.com/pocketbase/pocketbase/blob/v0.39.9/CHANGELOG.md

PR:             297111
Reported by:    Christos Longros <chris.longros at gmail.com> (maintainer)
Approved by:    osa, vvd (Mentors, implicit)
MFH:            2026Q3
DeltaFile
+5-5www/pocketbase/distinfo
+2-5www/pocketbase/Makefile
+7-102 files

FreeBSD/ports 9d7c861sysutils/rpi-firmware distinfo Makefile

sysutils/rpi-firmware: Update to 1.20260521

Update the Raspberry Pi firmware binaries to the latest upstream release
to provide native support for GPT partition schemes.

This update is related to the NanoBSD Reimagined GSoC 2026 project,
which aims to standardize on GPT layouts across all supported embedded
platforms.

Reviewed by:    manu
Differential Revision:  https://reviews.freebsd.org/D58197
DeltaFile
+108-5sysutils/rpi-firmware/pkg-plist
+3-3sysutils/rpi-firmware/distinfo
+4-2sysutils/rpi-firmware/Makefile
+115-103 files

FreeBSD/ports 7aeb00elang/luajit distinfo Makefile

lang/luajit: update to the recent snapshot

Sponsored by:   tipi.work
DeltaFile
+3-3lang/luajit/distinfo
+3-3lang/luajit/Makefile
+6-62 files

FreeBSD/ports c2db25cmath/R-cran-RcppParallel Makefile distinfo

math/R-cran-RcppParallel: Update 5.1.11.2 => 6.1.1

Changelog:
https://github.com/RcppCore/RcppParallel/blob/v6.1.1/NEWS.md

PR:             297110
Reported by:    Christos Longros <chris.longros at gmail.com> (maintainer)
Approved by:    osa, vvd (Mentors, implicit)
MFH:            2026Q3

(cherry picked from commit fae544394b068a3308153eccb3e75b7600d80100)
DeltaFile
+3-3math/R-cran-RcppParallel/distinfo
+1-1math/R-cran-RcppParallel/Makefile
+4-42 files

FreeBSD/src 4007d91usr.sbin/boot0cfg boot0cfg.8 boot0cfg.c

boot0cfg: Also allow a file as a trailing argument

Modify the disk check to allow arbitrary files as the trailing argument
instead of requiring a live GEOM disk provider.

This enables modifying a boot0 binary file in-place before flashing it
to a disk via gpart bootcode, or using it directly as an argument to
mkimg's partition specification, as these tools cannot directly adjust
the parameters of the boot0 boot manager.

Reviewed by:    imp, jhb
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57310
DeltaFile
+34-6usr.sbin/boot0cfg/boot0cfg.c
+26-6usr.sbin/boot0cfg/boot0cfg.8
+60-122 files