OPNSense/src d8322a6sys/netpfil/pf pf.c pf_mtag.h

pf: avoid passing through dummynet multiple times

In some setups we end up with multiple states created for a single
packet, which in turn can mean we run the packet through dummynet
multiple times. That's not expected or intended. Mark each packet when
it goes through dummynet, and do not pass packet through dummynet if
they're marked as having already passed through.

See also:       https://redmine.pfsense.org/issues/14854
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D44365
DeltaFile
+4-0sys/netpfil/pf/pf.c
+1-1sys/netpfil/pf/pf_mtag.h
+5-12 files

OPNSense/src 72ff6bdsys/netpfil/pf pf.c

pf: fix dummynet + route-to for IPv6

Apply the fixes from c6f1116357904 and b8ef285f6cc6a to IPv6 as well.

Ensure that when dummynet re-injects it does so in the correct direction, and
uses the correct dummynet pipes.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+22-0sys/netpfil/pf/pf.c
+22-01 files

OPNSense/src 0b16335sys/netpfil/pf pf.c

pf: fix dummynet + route-to

Ensure that we pick the correct dummynet pipe (i.e. forward vs. reverse
direction) when applying route-to.

We mark the processing as outbound so that dummynet will re-inject in
the correct phase of processing after it's done with the packet, but
that will cause us to pick the wrong pipe number. Reverse them so that
the incorrect decision ends up picking the correct pipe.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D44366
DeltaFile
+21-5sys/netpfil/pf/pf.c
+21-51 files

OPNSense/src 85bec3csys/netpfil/pf pf.c

pf: ensure dummynet gets the correct direction after route-to

If we apply a route-to to an inbound packet pf_route() may hand that
packet over to dummynet. Dummynet may then delay the packet, and later
re-inject it. This re-injection (in dummynet_send()) needs to know
if the packet was inbound or outbound, to call the correct path for
continued processing.

That's done based on the pf_pdesc we pass along (through
pf_dummynet_route() and pf_pdesc_to_dnflow()). In the case of pf_route()
on inbound packets that may be wrong, because we're called in the input
path, and didn't update pf_pdesc->dir.

This can manifest in issues with fragmented packets. For example, a
fragmented packet will be re-fragmented in pf_route(), and if dummynet
makes different decisions for some of the fragments (that is, it delays
some and allows others to pass through directly) this will break.

The packets that pass through dummynet without delay will be transmitted

    [15 lines not shown]
DeltaFile
+6-0sys/netpfil/pf/pf.c
+6-01 files

OPNSense/src b578125sys/netpfil/pf pf.c

pf: SCTP abort messages fully close the connection

As per RFC (RFC4960 section 3.3.7) an ABORT terminates the connection fully. We
should mode the state to CLOSED rather than CLOSING.

Suggested by:   Oliver Thomas
See also:       https://redmine.pfsense.org/issues/15924
Sponsored by:   Rubicon Communications, LLC ("Netgate")
DeltaFile
+2-2sys/netpfil/pf/pf.c
+2-21 files

OPNSense/src f10f826sys/netlink netlink_snl.h

netlink: in snl_init_writer() don't overwrite error in case of failure

PR:     290050
(cherry picked from commit 488718ff42346888243496c00cbeb42ba004171e)
DeltaFile
+3-3sys/netlink/netlink_snl.h
+3-31 files

OPNSense/src 2487dc2sbin/ipfw ipfw2.c

ipfw: Remove more unused IP_FW_* cases

All of the do_cmd() calls are in dummynet.c and specify the socket
option at compile time; none of these removed cases are used in ipfw
after the v3 work.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53378

(cherry picked from commit 0e2e0fb955adf15a217949bc4cc337d53d2c7259)
(cherry picked from commit 6b1e5d4d20a94b5bebd726eb6d1df8dca2738f8e)
DeltaFile
+1-5sbin/ipfw/ipfw2.c
+1-51 files

OPNSense/src 39feb3asbin/ipfw ipfw2.c

ipfw: Remove IP_DUMMYNET_GET case

IP_DUMMYNET_GET is no longer used in ipfw(1).

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53348

(cherry picked from commit 28e52dea96809c7904e498759ee1f79bda929a82)
(cherry picked from commit 73c105268cc6138015241b080bc7945c6cde0fa6)
DeltaFile
+1-1sbin/ipfw/ipfw2.c
+1-11 files

OPNSense/src 41d43adsbin/ipfw ipfw2.c

ipfw: Correct error message

The failed allocation in the error pertains to IP_FW_XADD, not
IP_FW_ADD.

Reviewed by:    ae
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53359

(cherry picked from commit 498e56142660c8dd864c878e820252358c9a15cf)
(cherry picked from commit c22437c8b574878241a3c897a095ae6939e66743)
DeltaFile
+1-1sbin/ipfw/ipfw2.c
+1-11 files

OPNSense/src f7c13f3sbin/ipfw dummynet.c

ipfw: Update warning/error setsockopt references

Dummynet v3 switched to IP_DUMMYNET3 but did not update these
warnings/errors.

Fixes: cc4d3c30ea28 ("Bring in the most recent version of ipfw and dummynet, developed")
Sponsored by:   The FreeBSD Foundation
Differential Revision: sbin/ipfw/ipfw2.c

(cherry picked from commit 1f95a517880bae5fc0a9fe4463a8f2ec36ed734a)
(cherry picked from commit a5dd21c7dd1f3c8103c2fc6a1caa5635d70671aa)
DeltaFile
+2-2sbin/ipfw/dummynet.c
+2-21 files

OPNSense/src 14882c5sys/dev/e1000 if_em.c e1000_osdep.h

igb(4): Fix out-of-bounds register access on VFs

Virtual Functions have access to a limited number of registers,
and their bus space size is lower. Use KASSERT to detect out-of-bounds
access and eliminate them to avoid kernel panics in production
environment.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Reviewed by:    jmg
Tested by:      mateusz.moga_intel.com
Approved by:    kbowling (mentor), erj (mentor)
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D52976

(cherry picked from commit 2c02e6ca7154593d214b62578f67d9fe7db23d70)
DeltaFile
+47-36sys/dev/e1000/if_em.c
+33-13sys/dev/e1000/e1000_osdep.h
+80-492 files

OPNSense/src f8b7905sys/dev/ice ice_drv_info.h

ice(4): Add support for E835-XXV-4 adapter

Add subdevice ID and branding string for E835-XXV-4
adapter.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Approved by:    kbowling (mentor), erj (mentor)
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D53319

(cherry picked from commit 09b48f811b4bf3a17485680b4720d1c0a81bbe07)
DeltaFile
+3-0sys/dev/ice/ice_drv_info.h
+3-01 files

OPNSense/src 7c85688sys/dev/ice ice_drv_info.h ice_devids.h

ice(4): Add PCI IDs for E835 devices

Add device IDs and branding strings for E835 adapters.
This is a follow up for E830 adapters with Security Protocol
and Data Model (SPDM) support and RDMA support available
on 100 and 200Gbps links.

Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>

Approved by:    kbowling (mentor), erj (mentor)
Sponsored by:   Intel Corporation
Differential Revision:  https://reviews.freebsd.org/D52782

(cherry picked from commit b202176dc76d862f886778439b96dd1243d8b999)
DeltaFile
+39-0sys/dev/ice/ice_drv_info.h
+18-0sys/dev/ice/ice_devids.h
+9-0sys/dev/ice/ice_common.c
+66-03 files

OPNSense/src a920739sys/dev/igc if_igc.c

igc(4): Fix a typo in a sysctl description

- s/Recevied/Received/

(cherry picked from commit defe77554d134964d7c197a2f3ca552778e8b41a)
DeltaFile
+1-1sys/dev/igc/if_igc.c
+1-11 files

OPNSense/src def59b6sys/dev/ixgbe ixgbe_e610.c ixgbe_type_e610.h

ix/ixv: Add support for new Intel Ethernet E610 family devices

This is part 1 of the support for the new Intel Ethernet E610 family of devices.

Introduce new PCI device IDs:
• 57AE: Intel(R) E610 (Backplane)
• 57AF: Intel(R) E610 (SFP)
• 57B0: Intel(R) E610 (10 GbE)
• 57B1: Intel(R) E610 (2.5 GbE)
• 57B2: Intel(R) E610 (SGMII)

Key updates for E610 family:
• Firmware manages Link and PHY
• Implement new CSR-based Admin Command Interface (ACI) for SW-FW interaction
• Tested exclusively for x64 operating systems on E610-XT2/XT4 (10G) and E610-IT4 (2.5G)
• Enable link speeds above 1G: 2.5G, 5G and 10G
• NVM Recovery Mode and Rollback support

Signed-off-by: Yogesh Bhosale yogesh.bhosale at intel.com

    [9 lines not shown]
DeltaFile
+5,567-0sys/dev/ixgbe/ixgbe_e610.c
+2,278-0sys/dev/ixgbe/ixgbe_type_e610.h
+205-26sys/dev/ixgbe/if_ix.c
+224-0sys/dev/ixgbe/ixgbe_e610.h
+68-1sys/dev/ixgbe/ixgbe_type.h
+31-0sys/dev/ixgbe/ixgbe_osdep.h
+8,373-2710 files not shown
+8,458-3616 files

OPNSense/src aa1fce8sys/dev/ixl ixl_pf_main.c if_ixl.c

ixl(4): fix multicast promiscuous mode state tracking and filter management

This change reapplies the improvements from commit 89e7335 and adds
additional fixes and code optimizations on top of it.

The ixl driver supports up to 128 multicast filters in hardware. When this
limit is exceeded, the driver should enable multicast promiscuous mode.
When the count drops below 128, it should disable promiscuous mode and
restore individual filters.

The driver previously had problems that could corrupt multicast filters list.
The main issue was that ixl_dis_multi_promisc() would attempt to disable
promiscuous mode without checking if it was actually enabled, potentially
corrupting existing filters. There was also no state tracking across driver
functions, leading to redundant operations.

This change adds an IXL_FLAGS_MC_PROMISC flag to track the multicast
promiscuous mode state. The flag is set when enabling promiscuous mode and
cleared when disabling it. Early return checks prevent redundant operations

    [12 lines not shown]
DeltaFile
+94-16sys/dev/ixl/ixl_pf_main.c
+25-2sys/dev/ixl/if_ixl.c
+1-0sys/dev/ixl/ixl.h
+120-183 files

OPNSense/src 747d7b2sys/dev/virtio/network if_vtnet.c

vtnet: don't provide VIRTIO_NET_HDR_F_DATA_VALID

According to section 5.1.6.2.1 of version 1.3 of the virtio
specification, the driver MUST NOT set VIRTIO_NET_HDR_F_DATA_VALID in
the flags. So don't do that.

Reviewed by:            Timo Völker
Differential Revision:  https://reviews.freebsd.org/D53650

(cherry picked from commit 836b3cd9d7910aff5225e9e58189067ca03fae30)
DeltaFile
+1-6sys/dev/virtio/network/if_vtnet.c
+1-61 files

OPNSense/src c3ae6f4sys/dev/virtio/network if_vtnet.c

vtnet: fix enabling/disabling tso

Transmit segment offloading depends on transmit checksum offloading.
Enforce that constraint. This also fixes a bug, since if_hwassist bits
are from the CSUM_ space, not from the IFCAP_ space.

PR:                     290773
Reviewed by:            Timo Völker
Tested by:              lg at efficientip.com
Differential Revision:  https://reviews.freebsd.org/D53629

(cherry picked from commit 4c50ac68166caf7e08c5a9984d63fa91490fa50d)
DeltaFile
+24-4sys/dev/virtio/network/if_vtnet.c
+24-41 files

OPNSense/src db57e94sys/net/altq altq_fairq.c altq_cbq.c

altq: Clear stats structures in get_class_stats()

These structures are copied out to userspace, and it's possible to leak
uninitialized stack bytes since these routines and their callers weren't
careful to clear them first.  Add memsets to avoid this.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:    kp, emaste
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D53342

(cherry picked from commit ff08916e9ac689e6ce734de72325fc2bd9495a35)
DeltaFile
+2-0sys/net/altq/altq_fairq.c
+2-0sys/net/altq/altq_cbq.c
+2-0sys/net/altq/altq_priq.c
+6-03 files

OPNSense/src 1c57156sys/net if.c

net: Validate interface group names in ioctl handlers

The handlers were not checking that the group names are nul-terminated.
Add checks for this.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:    zlei
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D53344

(cherry picked from commit 32919a34f17ac1af99dec7376f22a8393c251602)
DeltaFile
+26-8sys/net/if.c
+26-81 files

OPNSense/src 320050esys/net if_vxlan.c

if_vxlan: fix byteorder of source port

Fix the htons byteorder of vxlan packets after
`vxlan_pick_source_port` picks a source port during encapsulation.

Reviewed by:    zlei, kp, adrian
Differential Revision:  https://reviews.freebsd.org/D53022

(cherry picked from commit 1cc316727ebae157b3d035d9fb1ad38310a80698)
DeltaFile
+2-2sys/net/if_vxlan.c
+2-21 files

OPNSense/src 3251fe6sys/conf files, sys/modules/dummynet Makefile

ipfw: Retire obsolete compat code

The current IPFW version 3 dates to 2010 (commit cc4d3c30ea28, "Bring in
the most recent version of ipfw and dummynet, developed").

The compat code for FreeBSD 8 and earlier has a number of issues and is
no longer needed, so remove it.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
Reviewed by:    ae, glebius
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53343

(cherry picked from commit c59aab9a5b3970b3ccec744f759e6cb87e938dbe)
(cherry picked from commit 9657c50cdd7741404d99881fdd9243175086ede1)
DeltaFile
+0-849sys/netpfil/ipfw/ip_dn_glue.c
+27-69sys/netpfil/ipfw/ip_dummynet.c
+1-9sys/netpfil/ipfw/ip_dn_private.h
+0-4sys/netinet/raw_ip.c
+1-2sys/modules/dummynet/Makefile
+0-1sys/conf/files
+29-9346 files

OPNSense/src ffedf88sys/netpfil/ipfw/pmod tcpmod.c

ipfw: pmod: avoid further rule processing after tcp-mod failures

m_pullup() here will have freed the mbuf chain, but we pass back an
IP_FW_DENY without any signal that the outer loop should finish.  Thus,
rule processing continues without an mbuf and there's a chance that we
conclude that the packet may pass (but there's no mbuf remaining)
depending on the rules that follow it.

PR:             284606
Reviewed by:    ae

(cherry picked from commit c0382512bfce872102d213b9bc2550de0bc30b67)
DeltaFile
+16-9sys/netpfil/ipfw/pmod/tcpmod.c
+16-91 files

OPNSense/src b7c3332sys/netpfil/pf if_pfsync.c, tests/sys/netpfil/pf/ioctl validation.c

pf: improve add state validation

Both for the DIOCADDSTATE ioctl and for states imported through pfsync packets.
Add a test case to exercise this code path.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit faacc0d968816cf8714c974b6d8df6191cfb0e0d)
DeltaFile
+26-0tests/sys/netpfil/pf/ioctl/validation.c
+3-0sys/netpfil/pf/if_pfsync.c
+29-02 files

OPNSense/src 61338a0sys/netpfil/pf pf_ioctl.c, tests/sys/netpfil/pf/ioctl validation.c

pf: improve DIOCRCLRTABLES validation

Unterminated strings in the anchor or name could cause crashes.
Validate them, and add a test case.

Reported by:    Ilja Van Sprundel <ivansprundel at ioactive.com>
MFC after:      3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 1da3c0ca5b1decaa9cf55859cd134bdcd1218116)
DeltaFile
+33-0tests/sys/netpfil/pf/ioctl/validation.c
+11-0sys/netpfil/pf/pf_ioctl.c
+44-02 files

OPNSense/src e598d78usr.sbin/bsdinstall/partedit part_wizard.c

partedit: make minimum FreeBSD install size just under 1 GiB

1 GiB is a convenient disk image size for testing.  It is also the
installer's minimum size, but the minimum applies to the partition
rather than the whole disk.  Testing with a 1 GiB image resulted in the
counterintuitive error "There is not enough free space on <disk> to
install FreeBSD (1.0 GB free, 1.0 GB required)."

Reduce the installer's minimum size slightly to support this case.

Reviewed by:    brd
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D38881

(cherry picked from commit 57e12d397387542b13f175d4c0b8b5adca198690)
DeltaFile
+1-1usr.sbin/bsdinstall/partedit/part_wizard.c
+1-11 files

OPNSense/src 2c24992usr.sbin/bsdinstall/scripts zfsboot

bsdinstall: Use fat32 EFI system partition for ZFS

This is consistent with other operating systems and with bsdinstall's
UFS config and with bsdinstall's ZFS config prior to commit
0b7472b3d8d2.

PR:             290857
Fixes: 0b7472b3d8d2 ("Mount the EFI system partition (ESP) on newly-installed systems.")
Reviewed by:    imp
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53642

(cherry picked from commit 4109cdf0f817162cf3032aa589dd180dfa910025)
(cherry picked from commit 65e347d315449e8c28dbcb0c5bb64f79d822d024)
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/zfsboot
+1-11 files

OPNSense/src 9e40826usr.sbin/bsdinstall/partedit gpart_ops.c

bsdinstall: Fix newfs bsddialog menu

The second and third members of struct bsddialog_menuitem are `bool on`
and `unsigned int depth`. The newfs dialog options in bsdinstall's
partition tool had these two swapped, so the default selection did not
work.

PR: 290857
Reviewed by: asiciliano
Fixes: 50e244964e9b ("bsdinstall/partedit: Replace libdialog with libbsddialog")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53639

(cherry picked from commit 4e36942420712c2ab6ebc2c646e61d47b2b68e7b)
(cherry picked from commit 980aa8d4cfdf57a1f99401fa4160c0d82c927d7c)
DeltaFile
+7-7usr.sbin/bsdinstall/partedit/gpart_ops.c
+7-71 files

OPNSense/src 8684f75sys/netpfil/ipfw dn_sched_fq_codel.c

dummynet: move these exessive logging messages under debug output
DeltaFile
+3-2sys/netpfil/ipfw/dn_sched_fq_codel.c
+3-21 files

OPNSense/src 35d39cdstand/efi/loader main.c bootinfo.c

Revert "stand: add EFI support for mmio serial consoles"

This reverts commit 56b85fc10c2a83e59820860f2446bbfbb2edfdf4.
DeltaFile
+0-18stand/efi/loader/main.c
+0-8stand/efi/loader/bootinfo.c
+0-262 files