OPNSense/src b4ddb3eusr.sbin/bsdinstall/scripts bootconfig

bsdinstall: fix EFI boot entry creation

update_uefi_bootentry assumes that the caller sets FREEBSD_BOOTNAME and
mntpt, which isn't the case anymore. The result is that there is no
"FreeBSD" boot entry created/updated after install. Most machines manage
to boot from the removable media path (if the loader is installed there
too), but some don't.

Take the loader's path as an argument and rename the variable used in
the ZFS mirror loop so mntpt can be reused below.

Also mark nentries as a local variable so it doesn't leak out of the
function.

PR:             293385
Fixes:          494de51bc0074472d1b01604f085daea0844f240
MFC after:      2 days
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D55469

    [2 lines not shown]
DeltaFile
+14-11usr.sbin/bsdinstall/scripts/bootconfig
+14-111 files

OPNSense/src c2b3d1dsys/netinet ip_divert.c

divert: Use a better source identifier for netisr_queue_src() calls

These opaque IDs are used by netisr to distribute work among threads.
The mapping function is simply SourceID % numthreads, so using socket
addresses as source IDs isn't going to distribute packets well due to
alignment.

Use the divert socket's generation number instead, as that suits this
purpose much better.
DeltaFile
+4-2sys/netinet/ip_divert.c
+4-21 files

OPNSense/src f9831b4. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

Approved by:    so
DeltaFile
+8-0UPDATING
+1-1sys/conf/newvers.sh
+9-12 files

OPNSense/src 4ab9730sys/net rtsock.c

rtsock: Fix stack overflow

Approved by:    so
Security:       FreeBSD-SA-26:05.route
Security:       CVE-2026-3038
Fixes:          92be2847e845 ("rtsock: Avoid copying uninitialized padding bytes")

(cherry picked from commit cd00cd9f6ed4b6f6e6bb8ae168f2537968991b53)
(cherry picked from commit f44d771c2c6c80f3fabd11d335964e1efdf50a21)
DeltaFile
+2-2sys/net/rtsock.c
+2-21 files

OPNSense/src c673940sys/amd64/conf SYZKALLER

amd64/conf: Remove a config committed by accident

Approved by:    so
Reported by:    kib, kp
Fixes:          350ba9672a7f ("unix: Set O_RESOLVE_BENEATH on fds transferred between jails")

(cherry picked from commit 3ef39f58e5d63a78fd1c37e6c62d599bc68d5e1e)
(cherry picked from commit 302120bcb934ea150555362326c812353fb72eaa)
DeltaFile
+0-5sys/amd64/conf/SYZKALLER
+0-51 files

OPNSense/src 3f73e41tests/sys/kern unix_passfd_test.c Makefile

unix/tests: Add a regression test for fd transfer across jails

Approved by:    so
MFC after:      3 weeks

(cherry picked from commit 5843b8ee02e99527c28f579acfc1f48e10033529)
(cherry picked from commit ac2279ea57b72d688cf0af5a6fa7f5dbd1d4521b)
DeltaFile
+131-0tests/sys/kern/unix_passfd_test.c
+2-0tests/sys/kern/Makefile
+133-02 files

OPNSense/src 6d73caesys/amd64/conf SYZKALLER, sys/kern uipc_usrreq.c

unix: Set O_RESOLVE_BENEATH on fds transferred between jails

If a pair of jails with different filesystem roots is able to exchange
SCM_RIGHTS messages (e.g., using a unix socket in a shared nullfs
mount), a process in one jail can open a directory outside of the root
of the second jail and then pass the fd to that second jail, allowing
the receiving process to escape the jail chroot.

Address this using the new FD_RESOLVE_BENEATH flag.  When externalizing
an SCM_RIGHTS message into the receiving process, automatically set this
flag on all new fds where a jail boundary is crossed.  This ensures that
the receiver cannot do more than access files underneath the directory;
in particular, the received fd cannot be used to access vnodes not
accessible by the sender.

Approved by:    so
Security:       FreeBSD-SA-26:04.jail
Security:       CVE-2025-15576
PR:             262179

    [6 lines not shown]
DeltaFile
+23-8sys/kern/uipc_usrreq.c
+5-0sys/amd64/conf/SYZKALLER
+28-82 files

OPNSense/src 9a9303esys/kern kern_descrip.c

file: Fix the !CAPABILITIES build

Approved by:    so
Reported by:    Ian FREISLICH <ianfreislich at gmail.com>
Fixes:  f35525ff2053 ("file: Add a fd flag with O_RESOLVE_BENEATH semantics")

(cherry picked from commit 6783dfb10637100067520bd6d9804e154cfee7ee)
(cherry picked from commit 8f6769b82a2a071cf07080b6d77639e919efbbcf)
DeltaFile
+1-2sys/kern/kern_descrip.c
+1-21 files

OPNSense/src f77dc4dsys/fs/fdescfs fdesc_vnops.c, sys/kern kern_descrip.c vfs_syscalls.c

file: Add a fd flag with O_RESOLVE_BENEATH semantics

The O_RESOLVE_BENEATH openat(2) flag restricts name lookups such that
they remain under the directory referenced by the dirfd.  This commit
introduces an implicit version of the flag, FD_RESOLVE_BENEATH, stored
in the file descriptor entry.  When the flag is set, any lookup relative
to that fd automatically has O_RESOLVE_BENEATH semantics.  Furthermore,
the flag is sticky, meaning that it cannot be cleared, and it is copied
by dup() and openat().

File descriptors with FD_RESOLVE_BENEATH set may not be passed to
fchdir(2) or fchroot(2).  Various fd lookup routines are modified to
return fd flags to the caller.

This flag will be used to address a case where jails with different root
directories and the ability to pass SCM_RIGHTS messages across the jail
boundary can transfer directory fds in such as way as to allow a
filesystem escape.


    [8 lines not shown]
DeltaFile
+71-26sys/kern/kern_descrip.c
+15-6sys/kern/vfs_syscalls.c
+10-4sys/kern/vfs_cache.c
+6-2sys/sys/filedesc.h
+4-4sys/kern/vfs_extattr.c
+2-2sys/fs/fdescfs/fdesc_vnops.c
+108-444 files not shown
+113-4810 files

OPNSense/src fd926d0sys/kern kern_descrip.c uipc_syscalls.c, sys/sys file.h filedesc.h

file: Qualify pointers to capsicum rights as const

File descriptor lookup routines typically take a set of capsicum rights
as input to the lookup, so that the fd's rights can be atomically
checked.  This set should be qualified with const.

No functional change intended.

Approved by:    so
Reviewed by:    olce, oshogbo, brooks, kib
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D50419

(cherry picked from commit 5319cb21610ad947c56fd0cd4f18ef5b58bc8db7)
(cherry picked from commit 2060337c0937f08d9960d629eb59ce737339640c)
DeltaFile
+29-23sys/kern/kern_descrip.c
+11-10sys/sys/file.h
+10-9sys/sys/filedesc.h
+4-3sys/kern/uipc_syscalls.c
+3-3sys/kern/uipc_sem.c
+4-2sys/sys/procdesc.h
+61-505 files not shown
+74-6011 files

OPNSense/src d871609contrib/atf/atf-c++ check_test.cpp check.hpp, contrib/atf/atf-c++/detail process_test.cpp

atf: Switch from std::auto_ptr<> to std::unique_ptr<>

This mirrors upstream commit f053ab687f6e27aa264f599ecbfc5ef27ad4e2d3.

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D49789

(cherry picked from commit 5e6befdaca5194a8fb91b48d5f678942f22fa8f1)
DeltaFile
+11-11contrib/atf/atf-c++/check_test.cpp
+4-4contrib/atf/atf-sh/atf-check.cpp
+4-4contrib/atf/atf-c++/detail/process_test.cpp
+2-2contrib/atf/atf-c++/check.hpp
+2-2contrib/atf/atf-c++/check.cpp
+0-4libexec/atf/atf-check/Makefile
+23-274 files not shown
+23-3810 files

OPNSense/src 6431199contrib/lutok stack_cleaner.hpp, lib/liblutok Makefile

lutok: Switch from std::auto_ptr<> to std::unique_ptr<>

This mirrors upstream commit bd5904144c9778a07685f3e4efa6ef011a5480ec.

Reviewed by:    igoro, imp, emaste
Differential Revision:  https://reviews.freebsd.org/D49788

(cherry picked from commit 25f2634a1f4b27c9804b705e85bc104a2eac67b9)
DeltaFile
+0-4lib/liblutok/Makefile
+1-1contrib/lutok/stack_cleaner.hpp
+1-52 files

OPNSense/src 22336c0sys/netinet ip_divert.c

divert: Use a better source identifier for netisr_queue_src() calls

These opaque IDs are used by netisr to distribute work among threads.
The mapping function is simply SourceID % numthreads, so using socket
addresses as source IDs isn't going to distribute packets well due to
alignment.

Use the divert socket's generation number instead, as that suits this
purpose much better.
DeltaFile
+4-2sys/netinet/ip_divert.c
+4-21 files

OPNSense/src 4d43ea1sys/netinet6 icmp6.c

icmp6: clear csum_flags on mbuf reuse

When icmp6 sends an ICMPv6 message, it reuses the mbuf of the packet
that triggered the ICMPv6 message and prepends an IPv6 and ICMPv6
header. For a locally generated packet with checksum offloading, the
mbuf still has csum_flags set indicating that a SCTP/TCP/UDP checksum
has to be computed and inserted. Since this not the case anymore,
csum_flags need to be cleared.

PR:                     293227
Reviewed by:            kp, zlei, tuexen
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D55367

(cherry picked from commit ada4dc77577f7162353e8c2916ba5c258b6210f0)
DeltaFile
+1-0sys/netinet6/icmp6.c
+1-01 files

OPNSense/src 2e22159sys/netpfil/pf pf_ioctl.c

pf: Use proper prototype for SYSINIT functions

MFC after:      1 week

(cherry picked from commit 0ce8c20fcd44c1595b42fcb540913d3802edd438)
(cherry picked from commit 34462748d79a6e2ea8215564286f97e93670dfbb)
DeltaFile
+2-2sys/netpfil/pf/pf_ioctl.c
+2-21 files

OPNSense/src 2c6944fsys/netpfil/ipfw ip_fw2.c ip_fw_nat.c

ipfw: Use proper prototype for SYSINIT functions

The only possible return value of function ipfw_init() is 0. Make it
return void to match the prototype of SYSINIT.

MFC after:      1 week

(cherry picked from commit 1bba2194c8a960235f8eae36e7d3e96f347ce779)
(cherry picked from commit 745b6ca4ed933f9f4c1d314dc7b0aa31e8e9e0de)
DeltaFile
+3-6sys/netpfil/ipfw/ip_fw2.c
+2-2sys/netpfil/ipfw/ip_fw_nat.c
+5-82 files

OPNSense/src 77d0070usr.sbin/bsdinstall bsdinstall.8

bsdinstall.8: Minor maintenance

Replace CD-ROMs with "discs, USBs, or network boot environments"
to both modernize aesthetic and also nudge youths to think at scale.
Since I'm disrupting the flow of these lines anyway, expand the VM
acronym because I think this is one of the first manuals people will
be looking at.

Reset list alignment to seven characters. It was at 19 characters,
and that was not enough to align them all, wasting many extra lines
by crunching all the words over. Seven actually bought us some lines
from six due to avg item size. Tag SPDX.

MFC after:      3 days
Discussed with: ivy, zi

(cherry picked from commit 81d9e08a4df42079d5e163b5991d5d6f3a28d4f0)
DeltaFile
+11-8usr.sbin/bsdinstall/bsdinstall.8
+11-81 files

OPNSense/src 89058b9sys/netipsec xform_ipcomp.c

netipsec: Use proper prototype for SYSINIT functions

MFC after:      1 week

(cherry picked from commit 360bb45690d918fac5bae78ab44f45d11327067a)
(cherry picked from commit a32ee2897f8eed4a03976be65020912f03f7228e)
DeltaFile
+2-2sys/netipsec/xform_ipcomp.c
+2-21 files

OPNSense/src 9d3a11csys/netinet6 ip6_mroute.c

ip6_mroute: Fix the UPCALL_TIMING build

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

(cherry picked from commit 5bb953b095461b488b102ab3025f42cd2ef61f9d)
DeltaFile
+1-1sys/netinet6/ip6_mroute.c
+1-11 files

OPNSense/src b2d3c64sys/netinet6 ip6_mroute.c

ip6_mroute: Remove an unhelpful comment

ifnets already track if_allmulti() calls in the if_amcount field.  That
field is older than the comment, so I'm not exactly sure what the intent
was; let's just remove it.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

(cherry picked from commit a45fb94801dffd414bdb1981def0e977ef0c774f)
DeltaFile
+0-4sys/netinet6/ip6_mroute.c
+0-41 files

OPNSense/src 366c3d7sys/netinet6 ip6_mroute.c

ip6_mroute: Make MF6CFIND a regular function

This is more natural and corresponds more closely to the v4 multicast
routing code.  No functional change intended.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54983

(cherry picked from commit b370fcc716b9cfd4d08e291f0009f02452c84d64)
DeltaFile
+20-25sys/netinet6/ip6_mroute.c
+20-251 files

OPNSense/src 9d4eb1asys/netinet6 ip6_mroute.c

ip6_mroute: Remove an unused constant

No functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

(cherry picked from commit b320e89e6909c0c3f29542976df0381990866988)
DeltaFile
+0-2sys/netinet6/ip6_mroute.c
+0-21 files

OPNSense/src 07c0d54sys/netinet6 ip6_mroute.c

ip6_mroute: Mark functions as static

No functional change intended.

MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

(cherry picked from commit a03eabfebbce15d8ce028168969812d3ca2be206)
(cherry picked from commit ebc9a98c1b7d0a47359dae34509e1d9c02767a88)
DeltaFile
+10-10sys/netinet6/ip6_mroute.c
+10-101 files

OPNSense/src f5f369fsys/netinet6 in6_fib_algo.c

netinet6: Use proper prototype for SYSINIT functions

MFC after:      1 week

(cherry picked from commit d4a80fa271b148b269869e5ca34e1861d9fcdfb0)
(cherry picked from commit cfc237162c248d0488e264bf1fdae0186c5a13c1)
DeltaFile
+1-1sys/netinet6/in6_fib_algo.c
+1-11 files

OPNSense/src 5ee3f73sys/netinet siftr.c

siftr: refactor batch log processing

Refactoring to perform the batch processing of
log messaged in two phases. First cycling through a limited
number of collected packets, and only thereafter freeing
the processed packets. This prevents any chance of calling
free while in a critical / spinlocked section.

Reviewed By:           tuexen
Sponsored by:          NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D42949

(cherry picked from commit a95cd6e4870b79178860e03366c4327e533ecf1e)
DeltaFile
+16-23sys/netinet/siftr.c
+16-231 files

OPNSense/src b83e384sys/netinet siftr.c

siftr: flush pkt_nodes to the log file in batch

Reviewed by: rscheff, tuexen
Differential Revision: https://reviews.freebsd.org/D41175

(cherry picked from commit fafb03ab4254ab0d3927bc8ec22e4ba432efdbeb)
DeltaFile
+55-18sys/netinet/siftr.c
+55-181 files

OPNSense/src 5a6ee6asys/netinet ip_mroute.c, sys/netinet6 ip6_mroute.c raw_ip6.c

ip_mroute: Make privilege checking more consistent

- The v6 socket option and ioctl handlers had no privilege checks at
  all.  The socket options, I believe, can only be reached via a raw
  socket, but a jailed root user with a raw socket shouldn't be able to
  configure multicast routing in a non-VNET jail.  The ioctls can only
  be used to fetch stats.
- Delete a bogus comment in X_mrt_ioctl(), one can issue multicast
  routing ioctls against any socket.  Note that the call path is
  soo_ioctl()->rtioctl_fib()->mrt_ioctl().

I think all of the mroute privilege checks should be done within the
ip(6)_mroute code, but let's first make the v4 and v6 modules
consistent.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

    [3 lines not shown]
DeltaFile
+9-6sys/netinet6/ip6_mroute.c
+6-0sys/netinet6/raw_ip6.c
+0-5sys/netinet/ip_mroute.c
+15-113 files

OPNSense/src 9ad99a2sys/netinet ip_mroute.c ip_mroute.h

ip_mroute: Convert to using a regular mutex

The multicast routing code was using spin mutexes for packet counting,
but there is no reason to use them instead of regular mutexes, given
that none of this code runs in an interrupt context.  Convert to using
default mutexes.

Reviewed by:    glebius
MFC after:      2 weeks
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D54603

(cherry picked from commit a265c8b4a5a7c8fdd33e27b8f74bd2a514f82c70)
DeltaFile
+18-17sys/netinet/ip_mroute.c
+5-5sys/netinet/ip_mroute.h
+23-222 files

OPNSense/src 5c48d7bsys/netinet ip_mroute.c

ip_mroute: EVENTHANDLER_REGISTER does not fail

No functional change intended.

MFC after:      1 week
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.

(cherry picked from commit 0f1e1350704af555a4b30136f5f3d16db6f2dc51)
DeltaFile
+0-6sys/netinet/ip_mroute.c
+0-61 files

OPNSense/src 4b02370sys/netinet in_fib_algo.c, sys/netinet/cc cc.c

netinet: Use proper prototype for SYSINIT functions

MFC after:      1 week

(cherry picked from commit 6613b6ad1ecc5384c119018b9b27c18bd7516e3f)
(cherry picked from commit 5b41be5cc0666372840d798507e85544d8a3e7c3)
DeltaFile
+1-1sys/netinet/cc/cc.c
+1-1sys/netinet/in_fib_algo.c
+2-22 files