OPNSense/src 1ac8487. 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 4a49bf4lib/librpcsec_gss svc_rpcsec_gss.c, sys/rpc/rpcsec_gss svc_rpcsec_gss.c

rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()

svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:    so
Security:       FreeBSD-SA-26:08.rpcsec_gss
Security:       CVE-2026-4747
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    rmacklem
Fixes:          a9148abd9da5d
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+17-22 files

OPNSense/src afd6de9sys/netinet tcp_subr.c

tcp: plug an mbuf leak

When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:    so
Security:       FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:    lstewart
Tested by:      lstewart
Sponsored by:   Netflix, Inc.
DeltaFile
+2-0sys/netinet/tcp_subr.c
+2-01 files

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

Add UPDATING entries and bump version

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

OPNSense/src 5d8b34asys/netpfil/pf pf_ioctl.c

pf: include all elements when hashing rules

Approved by:    so
Security:       FreeBSD-SA-26:09.pf
Security:       CVE-2026-4748
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c6bcf6e6fd507d952a48226b51cc161b8ef972a2)
(cherry picked from commit e3b801edded92c1ccef67f9aef8653e996493460)
DeltaFile
+83-8sys/netpfil/pf/pf_ioctl.c
+83-81 files

OPNSense/src 3aa9ae8sbin/pfctl pfctl.c

pfctl: always warn if a duplicate rule was detected

Approved by:    so
Security:       FreeBSD-SA-26:09.pf
Security:       CVE-2026-4748
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 66d66dd0f6f83926980fc1d68dd366c0057350c5)
(cherry picked from commit e79818ec36efafc994d8c5a912dcb94986c038c5)
DeltaFile
+2-2sbin/pfctl/pfctl.c
+2-21 files

OPNSense/src 9b77f8ctests/sys/netpfil/pf pass_block.sh

pf tests: verify that we handle address range rules correctly

There's been a problem where rules which differed only in address ranges
were considered duplicates and not added. Test for this.

Approved by:    so
Security:       FreeBSD-SA-26:09.pf
Security:       CVE-2026-4748
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit ab74151e8d097b263237942c0b12277098bc9533)
(cherry picked from commit 958dbc87e9c59a2e9f83d84115ce03fb96e9b249)
DeltaFile
+38-0tests/sys/netpfil/pf/pass_block.sh
+38-01 files

OPNSense/src 4b1f421sys/netpfil/pf pf_ioctl.c

pf: Fix hashing of IP address ranges

This corrects the false detection of duplicate rules.

Approved by:    so
Security:       FreeBSD-SA-26:09.pf
Security:       CVE-2026-4748
Reviewed by:    kp

(cherry picked from commit 1fa873c93c8b08561c53107c7b90c53dfad30ddc)
(cherry picked from commit ac6bb58a715eaf0afb7a80dc87083f9819e10ac1)
DeltaFile
+1-0sys/netpfil/pf/pf_ioctl.c
+1-01 files

OPNSense/src 97ff478lib/librpcsec_gss svc_rpcsec_gss.c, sys/rpc/rpcsec_gss svc_rpcsec_gss.c

rpcsec_gss: Fix a stack overflow in svc_rpc_gss_validate()

svc_rpc_gss_validate() copies the input message into a stack buffer
without ensuring that the buffer is large enough.  Sure enough,
oa_length may be up to 400 bytes, much larger than the provided space.
This enables an unauthenticated user to trigger an overflow and obtain
remote code execution.

Add a runtime check which verifies that the copy won't overflow.

Approved by:    so
Security:       FreeBSD-SA-26:08.rpcsec_gss
Security:       CVE-2026-4747
Reported by:    Nicholas Carlini <npc at anthropic.com>
Reviewed by:    rmacklem
Fixes:          a9148abd9da5d
DeltaFile
+9-1sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+8-1lib/librpcsec_gss/svc_rpcsec_gss.c
+17-22 files

OPNSense/src 0da18fbsys/netinet tcp_subr.c

tcp: plug an mbuf leak

When a challenge ACK should be sent via tcp_send_challenge_ack(),
but the rate limiter suppresses the sending, free the mbuf chain.
The caller of tcp_send_challenge_ack() expects this similar to the
callers of tcp_respond().

Approved by:    so
Security:       FreeBSD-SA-26:06.tcp
Security:       CVE-2026-4247
Reviewed by:    lstewart
Tested by:      lstewart
Sponsored by:   Netflix, Inc.
DeltaFile
+2-0sys/netinet/tcp_subr.c
+2-01 files

OPNSense/src fb61125sys/net if.c

ifnet: Fix decreasing the vnet interface count

It should be decreased only when the interface has been successfully
removed from the "active" list.

This prevents vnet_if_return() from potential OOB writes to the
allocated memory "pending".

Reviewed by:    kp, pouria
Fixes:          a779388f8bb3 if: Protect V_ifnet in vnet_if_return()
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55873

(cherry picked from commit 8065ff63c0e5c3bb4abb02f55b20cb47bb51d1a7)
(cherry picked from commit 1b7687f053afcf251ee7643ee5a4f22a225f4a02)
DeltaFile
+3-3sys/net/if.c
+3-31 files

OPNSense/src 4dcd148sys/compat/linuxkpi/common/include/linux sort.h

LinuxKPI: avoid -Werror=unused-value in sort() from BUILD_BUG_ON_ZERO()

The BUILD_BUG_ON_ZERO() macro returns an (int)0 if it does not fail
at build time. LinuxKPI sort() has it as a guard for an unsupported
argument but ignores the return value.

This leads to gcc complaining:

/usr/src/sys/compat/linuxkpi/common/include/linux/build_bug.h:60:33: error: statement with no effect [-Werror=unused-value]
   60 | #define BUILD_BUG_ON_ZERO(x)    ((int)sizeof(struct { int:-((x) != 0); }))
      |                                 ^
/usr/src/sys/compat/linuxkpi/common/include/linux/sort.h:37:9: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   37 |         BUILD_BUG_ON_ZERO(swap);                        \
      |         ^~~~~~~~~~~~~~~~~
/usr/src/sys/contrib/dev/rtw89/core.c:2575:9: note: in expansion of macro 'sort'
 2575 |         sort(drift, RTW89_BCN_TRACK_STAT_NR, sizeof(*drift), cmp_u16, NULL);

Change to BUILD_BUG_ON() for the statement version.


    [8 lines not shown]
DeltaFile
+1-1sys/compat/linuxkpi/common/include/linux/sort.h
+1-11 files

OPNSense/src 8c8ffb0sys/netinet6 in6_src.c

netinet6: try to guard against known  in6_selecthlim() panic

At least for tcp_default_output() it's easy to avoid this.  May cause
more panics but we will have to go one by one since the FreeBSD fixes
on main are not compatible/backported.

PR: https://forum.opnsense.org/index.php?topic=51348.0
DeltaFile
+2-1sys/netinet6/in6_src.c
+2-11 files

OPNSense/src 871a807. 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 69195c0sys/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 33c5e0fsys/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 19e2ceetests/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 13f268csys/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 33ec4b8sys/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 23247a9sys/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
+4-4sys/kern/vfs_extattr.c
+6-2sys/sys/filedesc.h
+2-2sys/fs/fdescfs/fdesc_vnops.c
+108-444 files not shown
+113-4810 files

OPNSense/src 505b4a6sys/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 6e01be6sys/net vnet.c

vnet: Ensure the space allocated by vnet_data_alloc() is sufficent aligned

Some 32-bit architectures, e.g., armv7, require strict 8-byte
alignment while doing atomic 64-bit access. Hence aligning to the
pointer type (4-byte alignment) does not meet the requirement on
those architectures.

Make the space allocated by vnet_data_alloc() sufficent aligned to
avoid unaligned access.

PR:             265639
Diagnosed by:   markj
Reviewed by:    jhb, markj
Co-authored-by: jhb
MFC after:      5 days
Differential Revision:  https://reviews.freebsd.org/D55560

(cherry picked from commit 32beb3ae71cb320dbe4190a01c036943d99083b3)
(cherry picked from commit 973d607b284ba68e63f0386af44c28bfde15add2)
DeltaFile
+11-3sys/net/vnet.c
+11-31 files

OPNSense/src 1f54b94sys/dev/e1000 if_em.c

e1000: Increase FC pause/refresh time on PCH2 and newer

This corresponds to Linux f74dc880098b4a29f76d756b888fb31d81ad9a0c

That commit does not provide any public background detail, but it's been
in use for over 5 years and corresponds to previous chip bugs w.r.t.
automatic generation of PAUSE frames.

Reviewed by:    kgalazka
Differential Revision:  https://reviews.freebsd.org/D54555

(cherry picked from commit 2bdec2ee73be7dbafce9982b0dc5c273918a5443)
DeltaFile
+2-2sys/dev/e1000/if_em.c
+2-21 files

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