OPNSense/src 1114065sys/net pfvar.h, sys/netpfil/pf pf_ioctl.c pf.c

pf: Stop using net_epoch to synchronize access to eth rules

Commit 20c4899a8eea4 modified pf_test_eth_rule() to not acquire the
rules read lock, so pf_commit_eth() was changed to wait until the
now-inactive rules are no longer in use before freeing them.  In
particular, it uses the net_epoch to schedule callbacks once the
inactive rules are no longer visible to packet processing threads.

However, since commit 812839e5aaaf4, pf_test_eth_rule() acquires the
rules read lock, so this deferred action is unneeded.  This patch
reverts a portion of 20c4899a8eea4 such that we avoid using deferred
callbacks to free inactive rules.

The main motivation is performance: epoch_drain_callbacks() is quite
slow, especially on busy systems, and its use in the DIOCXBEGIN handler
in particular causes long stalls in relayd when reloading configuration.

Reviewed by:    kp
MFC after:      2 weeks

    [5 lines not shown]
DeltaFile
+3-29sys/netpfil/pf/pf_ioctl.c
+3-6sys/netpfil/pf/pf.c
+0-1sys/net/pfvar.h
+6-363 files

OPNSense/src 97415db. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version

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

OPNSense/src b12f1f4crypto/openssh sshd_config sshd_config.5

ssh: Bump VersionAddendum for CVE fixes

Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 62df41ae0a71e77ccb1e8fae06d82eec5dff441a)
(cherry picked from commit 24ce323f020fb1ee1b463e524a7a6c15f47ec2a4)
DeltaFile
+1-1crypto/openssh/sshd_config
+1-1crypto/openssh/sshd_config.5
+1-1crypto/openssh/version.h
+3-33 files

OPNSense/src 3cce750crypto/openssh sshconnect2.c ssh-agent.c

ssh: Fix cases where error codes were not correctly set

Obtained from:  OpenSSH 38df39ecf278
Security:       CVE-2025-26465
Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 170059d6d33cf4e890067097f3c0beb3061cabbd)
(cherry picked from commit 4ad8c195cf54411e3b3fa0bec227eb83ca078404)
DeltaFile
+4-1crypto/openssh/sshconnect2.c
+5-0crypto/openssh/ssh-agent.c
+3-1crypto/openssh/krl.c
+3-1crypto/openssh/ssh-sk-client.c
+1-0crypto/openssh/sshsig.c
+16-35 files

OPNSense/src b1697b6crypto/openssh packet.c

ssh: Don't reply to PING in preauth phase or during KEX

Obtained from:  OpenSSH 5e07dee272c3
Security:       CVE-2025-26466
Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 8a16d0831e70530b2fbd682e748bd051de35f192)
(cherry picked from commit 34798cb576bbd2064ab8da372112482bf8e2a7e6)
DeltaFile
+9-1crypto/openssh/packet.c
+9-11 files

OPNSense/src 921c838. UPDATING, sys/conf newvers.sh

Add UPDATING entries and bump version.

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

OPNSense/src 13db61ccrypto/openssh version.h sshd_config

ssh: Bump VersionAddendum for CVE fixes

Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 62df41ae0a71e77ccb1e8fae06d82eec5dff441a)
(cherry picked from commit 24ce323f020fb1ee1b463e524a7a6c15f47ec2a4)
DeltaFile
+1-1crypto/openssh/version.h
+1-1crypto/openssh/sshd_config
+1-1crypto/openssh/sshd_config.5
+3-33 files

OPNSense/src 071bb5bcrypto/openssh ssh-agent.c sshconnect2.c

ssh: Fix cases where error codes were not correctly set

Obtained from:  OpenSSH 38df39ecf278
Security:       CVE-2025-26465
Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 170059d6d33cf4e890067097f3c0beb3061cabbd)
(cherry picked from commit 4ad8c195cf54411e3b3fa0bec227eb83ca078404)
DeltaFile
+5-0crypto/openssh/ssh-agent.c
+4-1crypto/openssh/sshconnect2.c
+3-1crypto/openssh/krl.c
+3-1crypto/openssh/ssh-sk-client.c
+1-0crypto/openssh/sshsig.c
+16-35 files

OPNSense/src 096acf4crypto/openssh packet.c

ssh: Don't reply to PING in preauth phase or during KEX

Obtained from:  OpenSSH 5e07dee272c3
Security:       CVE-2025-26466
Security:       FreeBSD-SA-25:05.openssh
Approved by:    so
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 8a16d0831e70530b2fbd682e748bd051de35f192)
(cherry picked from commit 34798cb576bbd2064ab8da372112482bf8e2a7e6)
DeltaFile
+9-1crypto/openssh/packet.c
+9-11 files

OPNSense/src 2dfe373sys/netpfil/pf pf_ioctl.c pf_table.c

pf: chase panic of rn_walktree() via pfr_get_addrs()
DeltaFile
+2-2sys/netpfil/pf/pf_ioctl.c
+1-1sys/netpfil/pf/pf_table.c
+3-32 files

OPNSense/src e33a9f9sys/dev/mana gdma_main.c

dev/mana: replace power2 function

Replace is_power_of_2(length) with power2(length).  When length != 0, as in
this case, they produce the same result.  This will allow an implementation
of is_power_of_two to be dropped.

Reviewed by:    alc, markj
Differential Revision:  https://reviews.freebsd.org/D45536

(cherry picked from commit a94ed493b50752cee09245fc312c63b00331f217)
DeltaFile
+1-1sys/dev/mana/gdma_main.c
+1-11 files

OPNSense/src 59333e8sys/compat/linuxkpi/common/include/net mac80211.h, sys/compat/linuxkpi/common/src linux_80211.c linux_80211_macops.c

LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89

Bring in the LinuxKPI 802.11 compat bits which are altering
the mac80211 KPI.

* In struct ieee80211_bss_conf chandef -> chanreq.
* Various struct ieee80211_ops gained a link_id arguemnt,
  stop gained a suspend flag.
* Various functions gained a link_id argument.
* ieee80211_tx_status() was renamed to ieee80211_tx_status_skb()

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 7b43f4d064195bcf66816cb9fe350a1392fe24ce)
DeltaFile
+12-10sys/compat/linuxkpi/common/include/net/mac80211.h
+7-7sys/compat/linuxkpi/common/src/linux_80211.c
+3-3sys/compat/linuxkpi/common/src/linux_80211_macops.c
+1-1sys/compat/linuxkpi/common/src/linux_80211.h
+23-214 files

OPNSense/src 0f5c5aesys/sys libkern.h

libkern: don't use MPASS

Using MPASS in libkern breaks buildworld.  Replace MPASS with KASSERT
in three places.

(cherry picked from commit 08f6f78f81e21b21dd002a9389436b0333cb3488)
DeltaFile
+3-3sys/sys/libkern.h
+3-31 files

OPNSense/src 5e66087sys/sys libkern.h

libkern: avoid local var in order_base_2()

order_base_2(n) is implemented with a variable, which keeps it from
being used at file scope. Implement it instead as ilog2(2*n-1), which
produces a different result when 2*n overflows, which appears unlikely
in practice.

Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D46826

(cherry picked from commit b7cbf741d55468ba34305a14ac3acc1c286af034)
DeltaFile
+1-4sys/sys/libkern.h
+1-41 files

OPNSense/src c88d1cesys/compat/linuxkpi/common/include/linux log2.h, sys/dev/drm2 drm_os_freebsd.h

log2: move log2 functions from linuxkpi to libkern

Linux has a header file that defines an ilog2 function and some simple
functions/macros that use it: roundup_pow_of_two, is_power_of_2,
rounddown_pow_of_two, and order_base_2.  This change moves three of
those simple functions (all but is_power_of_2) from linuxkpi to
libkern.  It also deletes a few implementations of these functions
that have previously been copied into code for various device drivers,
so that they can use the libkern version.  The is_power_of_2 macro was
not moved because powerof2 in param.h provides almost the same service
already (except that they disagree about whether 0 is a power of two).

Since the linux definitions of these functions were copied into
FreeBSD 11 years ago, linux has improved them, and this change
provides those improvements.  In particular, a giant table of log
values for evaluating ilog2 for constant values is no longer
necessary.

Reviewed by:    alc, markj (previous version)

    [3 lines not shown]
DeltaFile
+11-71sys/sys/libkern.h
+4-19sys/compat/linuxkpi/common/include/linux/log2.h
+0-18sys/dev/qlnx/qlnxe/bcm_osal.h
+0-12sys/dev/mana/gdma_util.h
+0-7sys/dev/drm2/drm_os_freebsd.h
+15-1275 files

OPNSense/src feeeb1csys/arm64/iommu smmu.c, sys/compat/linuxkpi/common/include/linux log2.h

libkern: add ilog2 macro

The kernel source contains several definitions of an ilog2 function;
some are slower than necessary, and one of them is incorrect.
Elimininate them all and define an ilog2 macro in libkern to replace
them, in a way that is fast, correct for all argument types, and, in a
GENERIC kernel, includes a check for an invalid zero parameter.

Folks at Microsoft have verified that having a correct ilog2
definition for their MANA driver doesn't break it.

Reviewed by:    alc, markj, mhorne (older version), jhibbits (older version)
Differential Revision:  https://reviews.freebsd.org/D45170
Differential Revision:  https://reviews.freebsd.org/D45235

(cherry picked from commit b0056b31e90029553894d17c441cbb2c06d31412)
DeltaFile
+106-0sys/sys/libkern.h
+0-73sys/compat/linuxkpi/common/include/linux/log2.h
+0-13sys/powerpc/booke/pmap_32.c
+0-13sys/powerpc/booke/pmap_64.c
+0-10sys/dev/bxe/bxe.h
+0-9sys/arm64/iommu/smmu.c
+106-1188 files not shown
+108-15214 files

OPNSense/src 96f5dd4sys/dev/e1000 em_txrx.c e1000_defines.h

e1000: Fix vlan PCP/DEI on lem(4)

The vlan PCP and CFI/DEI were discarded when receiving vlan tagged
packets on lem(4) interfaces with vlanhwtag.

According to the 82540 SDM[1] (pg. 24), vlan tag is in the standard
format, so there's no reason to discard PCP/DEI.

[1]: http://iommu.com/datasheets/ethernet/controllers-nics/intel/e1000/pci-pci-x-family-gbe-controllers-software-dev-manual.pdf

Sponsored by:   Stormshield (author)
Differential Revision:  https://reviews.freebsd.org/D48987

(cherry picked from commit 4b29599fbbe33b75b7b58cfc5deea7a881e9a10e)
DeltaFile
+1-2sys/dev/e1000/em_txrx.c
+0-1sys/dev/e1000/e1000_defines.h
+1-32 files

OPNSense/src 2ff3730sys/dev/igc igc_defines.h

igc: Remove unused register IGC_RXD_SPC_VLAN_MASK

We don't use legacy receive descriptors and masking out the vlan ID
isn't necessary since the tag is in the standard format, so remove it.

(cherry picked from commit 124b7722aad7d4cf12d96c030659aef78175aa9c)
DeltaFile
+0-1sys/dev/igc/igc_defines.h
+0-11 files

OPNSense/src a9d080asys/net bpf.c if.c

ifnet: Detach BPF descriptors on interface vmove event

When an interface is moving to/from a vnet jail, it may still have BPF
descriptors attached. The userland (e.g. tcpdump) does not get noticed
that the interface is departing and still opens BPF descriptors thus
may result in leaking sensitive traffic (e.g. an interface is moved
back to parent jail but a user is still sniffing traffic over it in
the child jail).

Detach BPF descriptors so that the userland will be signaled.

Reviewed by:    ae
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D45727

(cherry picked from commit 1ed9b381d4701fc9f66741256e93b96e22273217)

ifnet: Fix build without BPF


    [5 lines not shown]
DeltaFile
+27-0sys/net/bpf.c
+7-0sys/net/if.c
+1-0sys/net/bpf.h
+35-03 files

OPNSense/src 3de3dbasys/net if.c

ifnet: Make if_detach_internal() and if_vmove() void

if_detach_internal() never fail since change [1]. As a consequence,
also does its caller if_vmove(). While here, remove a stall comment.

No functional change intended.

This reverts commit c7bab2a7ca9a6dae79f970c6730a19b65a1ed86e.

[1] a779388f8bb3 if: Protect V_ifnet in vnet_if_return()

Reviewed by:    glebius
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D48820

(cherry picked from commit bb0348a17974d83671becbd32ea0e4bd2ea61906)
DeltaFile
+16-27sys/net/if.c
+16-271 files

OPNSense/src b62f195sys/netpfil/ipfw ip_fw_table_value.c

ipfw: add missing initializer for 'limit' table value

PR:             284691

(cherry picked from commit 95ab7b3223c08cf48ccf764815523ea995a7ea0e)
DeltaFile
+1-0sys/netpfil/ipfw/ip_fw_table_value.c
+1-01 files

OPNSense/src de69fe0sys/netpfil/pf pf.c

pf: add extra SCTP multihoming probe points

Add probe points in the SCTP multihome parsing code. This is intended to help
debug a multihome issue, and is expected to be generally useful, so will be
included for everyone.

MFC after:      2 weeks
Sponsored by:   Orange Business Services

(cherry picked from commit 2d2481c35f5a53322e982e47a2bb8f9085f525b7)
DeltaFile
+17-0sys/netpfil/pf/pf.c
+17-01 files

OPNSense/src efd622dsys/netpfil/pf pf.c

pf: verify SCTP v_tag before updating connection state

Make it harder to manipulate the firewall state by verifying the v tag before we
update states.

MFC after:      2 weeks
Sponsored by:   Orange Business Services

(cherry picked from commit 4713d2fd5663eb64aa582dabced21d253c901a66)
DeltaFile
+7-7sys/netpfil/pf/pf.c
+7-71 files

OPNSense/src 0f09722sys/netpfil/pf pf_norm.c

pf: verify that ABORT chunks are not mixed with DATA chunks

RFC4960 3.3.7: DATA chunks MUST NOT be bundled with ABORT.

MFC after:      2 weeks
Sponsored by:   Orange Business Services

(cherry picked from commit 541ea3d7828e0ede161ac2d8ef3e8419657ef5cb)
DeltaFile
+8-0sys/netpfil/pf/pf_norm.c
+8-01 files

OPNSense/src 5658e37sys/netpfil/pf pf.c, tests/sys/netpfil/pf sctp.sh

pf: allow ICMP messages related to an SCTP state to pass

Much like we already do for TCP and UDP we should also parse SCTP-in-ICMP
messages to see if they apply to an SCTP connection we've already allowed. If so
we should allow the ICMP packet to pass, even if we'd otherwise block it.

Add a test case where we generate an 'ICMP unreachable - need to frag' packet
and check that it passes through pf.

MFC after:      2 weeks
Sponsored by:   Orange Business Services

(cherry picked from commit 7d5e02b01577047290e937399accc02e6b184ce9)
DeltaFile
+89-2sys/netpfil/pf/pf.c
+86-0tests/sys/netpfil/pf/sctp.sh
+175-22 files

OPNSense/src 6e76039sys/net if_media.h ieee8023ad_lacp.c

net: if_media for 100BASE-BX

d82c3e81:
net: if_media for 100BASE-BX

Renumber 1000BASE-BX and add 100BASE-BX sequentially

I added this 1000BASE-BX in 78c63ed260fa20b3500aedfe41dc0dcae9593f51 but
did not connect it to any code yet, appologize for the churn.

7835a4ad:
net: if_media fix syntax/build

Fixes:          d82c3e815a5f ("net: if_media for 100BASE-BX")

(cherry picked from commit d82c3e815a5fc0069562b69145ad695f9aa183f9)
(cherry picked from commit 7835a4ad6948290c92ea55c7be34ae72f4e2b0bd)
DeltaFile
+4-0sys/net/if_media.h
+1-0sys/net/ieee8023ad_lacp.c
+5-02 files

OPNSense/src f0a184bsys/contrib/dev/rtw88 debug.c, sys/contrib/dev/rtw89 debug.c

rtw88/rtw89: avoid duplicate top-level directory with debugfs

If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.

Sponsored by:   The FreeBSD Foundation
X-Note:         ath1[01]k and mt76 likely will need a similar change

(cherry picked from commit b4886c4ece3e692c294aa853da7aec849f8d00a2)
DeltaFile
+4-0sys/contrib/dev/rtw88/debug.c
+4-0sys/contrib/dev/rtw89/debug.c
+8-02 files

OPNSense/src c8d1d54sys/contrib/dev/rtw88 main.c, sys/contrib/dev/rtw89 core.c

rtw88/rtw89: add module_param to enable/disable HT/VHT and EHT

In order to better test HT and VHT support with LinuxKPI add (tunable)
options disabled by default to on-demand enable HT/VHT
and for rtw89 also EHT.

It is expected that we will remove this FreeBSD-specific code again in
the future.

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 7a5b55e3b448744b099c274763992cba2e3ebce5)
DeltaFile
+30-0sys/contrib/dev/rtw89/core.c
+22-0sys/contrib/dev/rtw88/main.c
+52-02 files

OPNSense/src 43d7574sys/contrib/dev/rtw89 rtw8852c_table.c reg.h

rtw89: update Realtek's rtw89 driver.

This adds support for the Realtek 8922AE PCI
wireless network (Wi-Fi 7) adapter.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75)
DeltaFile
+2,587-1,901sys/contrib/dev/rtw89/rtw8852c_table.c
+4,285-7sys/contrib/dev/rtw89/reg.h
+3,740-288sys/contrib/dev/rtw89/fw.c
+4,019-0sys/contrib/dev/rtw89/rtw8852bt_rfk.c
+2,502-478sys/contrib/dev/rtw89/coex.c
+2,639-0sys/contrib/dev/rtw89/rtw8922a.c
+19,772-2,67470 files not shown
+45,048-8,14776 files

OPNSense/src c296eebsys/contrib/dev/rtw88 rtw8703b.c rtw8822c_table.c

rtw88: update Realtek's rtw88 driver.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 11c53278a8a3e86e14377f09bbaa7bad193d3713)
DeltaFile
+2,122-0sys/contrib/dev/rtw88/rtw8703b.c
+522-717sys/contrib/dev/rtw88/rtw8822c_table.c
+825-329sys/contrib/dev/rtw88/rtw8821c_table.c
+902-0sys/contrib/dev/rtw88/rtw8703b_tables.c
+724-0sys/contrib/dev/rtw88/rtw8723x.c
+42-632sys/contrib/dev/rtw88/rtw8723d.c
+5,137-1,67834 files not shown
+6,281-2,09240 files