OPNSense/src dbc176fsys/netpfil/pf pf.c

pf: Fix fallout from the STATE_LOOKUP macro removal

Taken from: https://reviews.freebsd.org/D59015
DeltaFile
+6-11sys/netpfil/pf/pf.c
+6-111 files

OPNSense/src 11f6b12sys/netpfil/pf pf_lb.c pf.c

pf: Re-optimize state key handling

Taken from: https://reviews.freebsd.org/D58922
DeltaFile
+15-10sys/netpfil/pf/pf.c
+10-1sys/netpfil/pf/pf_lb.c
+25-112 files

OPNSense/src 9838480sys/kern uipc_ktls.c kern_mbuf.c, sys/sys mbuf.h

ktls: Propagate EPG_FLAG_ANON to mapped mbufs

Otherwise ktls_mbuf_crypto_state() will reject mbufs created by
_mb_unmapped_to_ext(), which arises when transmitting packets through an
interface that doesn't support unmapped mbufs, and the loopback
interface in particular.

PR:             296498
Fixes:          3444414cb463 ("ktls: Don't attempt to modify non-anonymous mbufs on the receive path")
Reviewed by:    gallatin, jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D57557

(cherry picked from commit 815976ee14121bafe8a8ab002459d32f8928f2de)
DeltaFile
+2-1sys/kern/uipc_ktls.c
+3-0sys/kern/kern_mbuf.c
+1-0sys/sys/mbuf.h
+6-13 files

OPNSense/src 98f9e01sbin/ifconfig sfp.c ifstf.c

ifconfig: Add SPDX-License-Identifier tags

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55272

(cherry picked from commit d685228989020f7bceebdaf6ea79be09305d2954)
DeltaFile
+2-0sbin/ifconfig/sfp.c
+2-0sbin/ifconfig/ifstf.c
+2-0sbin/ifconfig/ifipsec.c
+6-03 files

OPNSense/src 326a32bsys/netipsec xform_ipcomp.c

netipsec/xform_ipcomp.c: fix sockaddr type set in ipcomp6_nonexp_encapcheck()

(cherry picked from commit 01d4e3c1d3ffa14041d8faa3a7a6e6509e73af84)
DeltaFile
+1-1sys/netipsec/xform_ipcomp.c
+1-11 files

OPNSense/src 2beca9asys/netipsec key.c

PF_KEY socket: limit the length of copied socket address

PR:     297264

(cherry picked from commit cba481a7bff2fcf31420ee8b2714660e2666452b)
DeltaFile
+69-59sys/netipsec/key.c
+69-591 files

OPNSense/src d2e52b3sys/netipsec key.c

netipsec/key.c::key_checksockaddrs(): constify src/dst address buffer pointers

(cherry picked from commit fbe9aa7ebfcd6d89b298cc7a23de02d119367221)
DeltaFile
+4-1sys/netipsec/key.c
+4-11 files

OPNSense/src 68518a3sys/net if_private.h if.c

ifnet: Restore previous size of if_afdata

Struct ifnet contains an array if_afdata of AF_MAX pointers to address
information for each possible address family.  Since 2013, when AF_MAX
was inadvertently changed to be equal to the highest possible value,
instead of one more than the highest possible value, this array has been
too small in theory, but this never mattered in practice because the
higher address families were not assignable to interfaces.

My recent commit which corrected the value of AF_MAX had the side effect
of breaking the KBI by changing the size and layout of struct ifnet.
This manifested itself as kernel panics when using third-party network
drivers and went unnoticed in main because if_afdata no longer exists
there.  Address the issue for stable/15 and stable/14 by keeping the
correct value of AF_MAX but deliberately making if_afdata off by one,
restoring its previous size.

Fixes:          ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
Sponsored by:   Klara, Inc.

    [3 lines not shown]
DeltaFile
+1-1sys/net/if_private.h
+1-1sys/net/if.c
+2-22 files

OPNSense/src 2587f05lib/libifconfig libifconfig_internal.h

libifconfig: Fix table size

Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one.  Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.

Fixes:          ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
MFC after:      3 days
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D58827

(cherry picked from commit 79a6ad63e6afdfa00d0e625996bddf91e9f217c3)
DeltaFile
+1-1lib/libifconfig/libifconfig_internal.h
+1-11 files

OPNSense/src 9d0054dsys/net/route route_tables.c

routing: Fix table sizes

Tables that have one element per protocol or address family were
previously sized by AF_MAX + 1 since AF_MAX was off by one.  Now that
AF_MAX has been corrected, we need to apply the opposite correction to
these tables.

Fixes:          ddd850aa7720 ("sys/socket.h: Fix AF_MAX")
MFC after:      3 days
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    pouria, kevans, glebius
Differential Revision:  https://reviews.freebsd.org/D58826

(cherry picked from commit 6c41d928bcd763ec60d55bec2886c05b03cf9e6a)
DeltaFile
+9-9sys/net/route/route_tables.c
+9-91 files

OPNSense/src 2742a76lib/libifconfig libifconfig_internal.c libifconfig.c, sys/net rtsock.c

sys/socket.h: Fix AF_MAX

AF_MAX was always intended to be one more than the greatest allocated
value.  Jeff broke this in 2013.  Unfortunately, a bunch of people then
decided to adapt to the mistake instead of correcting it.

Fixes:          863c7e45628d (" - Reserve a special AF for SDP.  The one we were incorrectly using before    was taken by another AF.")
MFC after:      3 days
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    kevans, glebius
Differential Revision:  https://reviews.freebsd.org/D58597

(cherry picked from commit ddd850aa7720f77b6605599655df898b16ed74cc)
DeltaFile
+3-3sys/netlink/route/rt.c
+2-2sys/net/rtsock.c
+2-2sys/net/route/route_helpers.c
+2-2lib/libifconfig/libifconfig.c
+3-1sys/sys/socket.h
+1-1lib/libifconfig/libifconfig_internal.c
+13-113 files not shown
+16-149 files

OPNSense/src 8a8a660sys/dev/usb usbdevs, sys/dev/usb/net if_ure.c

ure: add USB device IDs for additional RTL8152/RTL8153 adapters

Add device IDs for several USB Ethernet adapters that use
RTL8152 and RTL8153 chips but are not yet recognized by ure(4).
This includes adapters from Cisco/Linksys, D-Link, Lenovo,
Microsoft Surface, Realtek, Samsung, and TP-Link.

All added devices use chip revisions already handled by
ure_read_chipver().

Signed-off-by: Christos Longros <chris.longros at gmail.com>

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D55748
DeltaFile
+11-2sys/dev/usb/net/if_ure.c
+7-0sys/dev/usb/usbdevs
+18-22 files

OPNSense/src 5d1808asys/dev/usb/net if_ure.c

ure(4): Fix spurious link flaps from MII

A race condition in the MII layer causes spurious link down events.
In `statchg`, on link down, check if the PHY reports the link as
actually down using the BMSR register, if not, force the status of the
link to back up and restart TX. Do the same in a MII `linkchg` handler.
On actual link up, restart TX in case it went idle and down.

PR:             252165
Signed-off-by:  Rafael Kitover <rkitover at gmail.com>
Reviewed by:    pouria
Differential Revision: https://reviews.freebsd.org/D55682
DeltaFile
+66-3sys/dev/usb/net/if_ure.c
+66-31 files

OPNSense/src 49721cdlib/libpfctl libpfctl.c, sbin/pfctl pf_print_state.c

pf: rule label patch was merged from a wrong version

PR: https://forum.opnsense.org/index.php?topic=52351.0
DeltaFile
+1-1sbin/pfctl/pf_print_state.c
+1-1lib/libpfctl/libpfctl.c
+2-22 files

OPNSense/src af06394lib/libifconfig libifconfig_internal.c libifconfig.c, sys/net rtsock.c

Revert "sys/socket.h: Fix AF_MAX"

This reverts commit 33a943ef85e73fd1c881cd3cf49471a6acf4dd6d.

PR: https://forum.opnsense.org/index.php?topic=52691.0

Causes reports of kernel panics the likes of:

 Fatal trap 12: page fault while in kernel mode
 cpuid = 1; apic id = 01
 fault virtual address  = 0x218361fa00
 fault code             = supervisor read data, page not present
 instruction pointer    = 0x20:0xffffffff80c4d7a7
 stack pointer          = 0x28:0xfffffe00d3332ab0
 frame pointer          = 0x28:0xfffffe00d3332ab0
 code segment           = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags       = interrupt enabled, resume, IOPL = 0
 current process                = 0 (netlink_socket (PID)

    [29 lines not shown]
DeltaFile
+3-3sys/netlink/route/rt.c
+1-3sys/sys/socket.h
+2-2sys/net/rtsock.c
+2-2sys/net/route/route_helpers.c
+2-2lib/libifconfig/libifconfig.c
+1-1lib/libifconfig/libifconfig_internal.c
+11-133 files not shown
+14-169 files

OPNSense/src 7067fa3sys/netpfil/pf pf.c

Revert "pf: mark non-port packets to require IP checksumming #312"

This reverts commit f331124d5c4a0b772e299901354360529b5cf4d6.
DeltaFile
+1-4sys/netpfil/pf/pf.c
+1-41 files

OPNSense/src b3c4c1asys/dev/igc if_igc.c

igc: additionally disable PCIe ASPM for I226

Always disable PCIe ASPM for i226 type cards to improve stability
and wire sysctl calls to iflib_request_reset instead of igc_if_init
as this will stall the drivers RX path.
DeltaFile
+33-3sys/dev/igc/if_igc.c
+33-31 files

OPNSense/src 41c9ba3sys/dev/igc igc_base.h igc_base.c

igc: Disable PCIe L1.2 on I225

I225 devices can incorrectly enter L1 substates while CLKREQ# is
asserted, both while idle and in D3.  Disable ASPM and PCI-PM L1.2 on
I225 to prevent the resulting packet loss.

Keep the I226 workaround ASPM-only because it addresses a separate
traffic exit latency observation.

PR:             265714

(cherry picked from commit 4a28d390f5fbae2483e88805559881b04ccf9a80)
DeltaFile
+22-20sys/dev/igc/if_igc.c
+29-0sys/dev/igc/igc_base.c
+1-0sys/dev/igc/igc_base.h
+52-203 files

OPNSense/src c7231b5sys/dev/igc igc_base.c

igc: Apply ASPM L1.2 workaround to all I226 devices

Classify I226_LMVP and I226_BLANK_NVM as I226 silicon so they
receive the I226-specific ASPM L1.2 workaround.

PR:             279245
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2318

(cherry picked from commit cecb0f45cb83349c60514da38fddce83ad042468)
DeltaFile
+5-0sys/dev/igc/igc_base.c
+5-01 files

OPNSense/src 664705bsys/dev/igc igc_base.h igc_base.c

igc: Disable ASPM L1.2 on I226 to prevent RX stalls

I226 parts advertise support for the PCIe L1.2 link substate, but a
hardware erratum makes the exit latency from that low-power state
longer than the packet buffer can absorb under load. This stalls the
inbound packet stream. Disabling ASPM system-wide (BIOS or OS ASPM
policy) does not fix it. The L1.2 enable bit must be cleared directly
in the device's own PCIe L1 PM extended capability.

Add igc_is_device_id_i226() to identify affected parts and
igc_disable_broken_aspm_l1_2() to clear the ASPM L1.2 enable bit
on attach and after resume, since PCIe config space can be
reset across a suspend/resume cycle.

Adapted from the Linux igc driver:

  0325143b59c6 igc: disable L1.2 PCI-E link substate to avoid
               performance issue
  1468c1f97cf3 igc: fix disabling L1.2 PCI-E link substate on I226

    [9 lines not shown]
DeltaFile
+44-0sys/dev/igc/if_igc.c
+21-0sys/dev/igc/igc_base.c
+1-0sys/dev/igc/igc_base.h
+66-03 files

OPNSense/src 7ce4c58sys/dev/pci pcireg.h

pci: Add L1 PM definitions

Add register/bit definitions for the L1 PM substates capability
(PCIZ_L1PM) to pcireg.h.

Signed-off-by: Michael Adler <madler at tapil.com>

Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2318

(cherry picked from commit 04f8a6aeeba5cbaa48be7134765ee49d5b1b9857)
DeltaFile
+14-0sys/dev/pci/pcireg.h
+14-01 files

OPNSense/src 680be42. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

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

OPNSense/src 693c51dsys/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

OPNSense/src 0e492bcsys/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

OPNSense/src bf65e6detc/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

OPNSense/src ffde0b3sys/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

OPNSense/src 10ab0e4sys/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

OPNSense/src 0ae5cebcontrib/tzdata theory.html europe

contrib/tzdata: import tzdata 2026c

Changes: https://github.com/eggert/tz/blob/2026c/NEWS

Approved by:    so
Security:       FreeBSD-EN-26:18.tzdata

(cherry picked from commit 665bb2d9a440d33e2ec2f9151e45b8cda93433ae)
(cherry picked from commit 819af80de8e8854f5767c20d03cb7362624b0085)
DeltaFile
+32-159contrib/tzdata/africa
+107-14contrib/tzdata/northamerica
+71-8contrib/tzdata/NEWS
+17-28contrib/tzdata/Makefile
+14-7contrib/tzdata/europe
+9-9contrib/tzdata/theory.html
+250-2258 files not shown
+272-24414 files

OPNSense/src 94e4581. UPDATING

Add a missing UPDATING entry

Approved by:    so
DeltaFile
+2-0UPDATING
+2-01 files

OPNSense/src f331124sys/netpfil/pf pf.c

pf: mark non-port packets to require IP checksumming #312

Instead of recomputing on the spot let's try to use this instead.
DeltaFile
+4-1sys/netpfil/pf/pf.c
+4-11 files