HardenedBSD/src 3e4333clib/libc/gen fts.c, lib/libc/tests/gen fts_regress_test.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+58-0lib/libc/tests/gen/fts_regress_test.c
+16-8sys/net/if_epair.c
+7-3share/man/man4/epair.4
+2-1usr.sbin/zonectl/zonectl.c
+1-1lib/libc/gen/fts.c
+1-0sys/arm64/linux/linux_emul_md.c
+85-132 files not shown
+87-138 files

HardenedBSD/src 4b93eaelib/libc/gen fts.c, lib/libc/tests/gen fts_regress_test.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+58-0lib/libc/tests/gen/fts_regress_test.c
+16-8sys/net/if_epair.c
+7-3share/man/man4/epair.4
+2-1usr.sbin/zonectl/zonectl.c
+1-1lib/libc/gen/fts.c
+1-0sys/arm64/linux/linux_emul_md.c
+85-132 files not shown
+87-138 files

HardenedBSD/src 39fc649share/man/man4 ix.4, sys/dev/ixgbe ixgbe.h if_ix.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+496-55sys/dev/ixgbe/if_sriov.c
+286-58sys/dev/ixgbe/if_ixv.c
+238-78sys/dev/ixgbe/if_ix.c
+53-0sys/net/iflib.c
+33-1share/man/man4/ix.4
+22-1sys/dev/ixgbe/ixgbe.h
+1,128-19310 files not shown
+1,196-21316 files

HardenedBSD/src 374799fsys/arm64/linux linux_emul_md.c, sys/i386/linux linux_emul_md.c

linux: sort sys headers in linux_emul_md.c

style(9): sys/param.h, then sys/systm.h, then the remaining kernel
headers alphabetically.  imgact.h belongs before proc.h.

Reported by:    jhibbits
MFC after:      1 month
Reviewed by:    jhibbits
Differential Revision:  https://reviews.freebsd.org/D58884
DeltaFile
+1-1sys/i386/linux/linux_emul_md.c
+1-1sys/arm64/linux/linux_emul_md.c
+2-22 files

HardenedBSD/src 8c81b3bsys/net iflib.h iflib.c

iflib: Add restart transactions for IOV reconfiguration

Some devices remap the PF queues when entering or leaving SR-IOV. Add
opt-in PCI IOV helpers that hold the iflib context lock across the
complete stop, driver callback, and restart transaction.

Existing drivers continue to use the non-restarting helpers.

Sponsored by:   BBOX.io

(cherry picked from commit f8fa2d77bc305bec519f9f02afe211e903c57573)
DeltaFile
+22-0sys/net/iflib.c
+2-0sys/net/iflib.h
+24-02 files

HardenedBSD/src 81207ddsys/kern sys_process.c

HBSD: Resolve merge conflict

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-7sys/kern/sys_process.c
+0-71 files

HardenedBSD/src f35224dlib/libsys pdfork.2, sys/kern sys_procdesc.c

Merge remote-tracking branch 'rad/freebsd/15-stable/main' into hardened/15-stable/main

Conflicts:
        sys/kern/sys_process.c (unresolved)
DeltaFile
+556-0tests/sys/kern/procdesc.c
+396-114sys/kern/sys_procdesc.c
+194-5lib/libsys/pdfork.2
+51-99tests/sys/capsicum/procdesc.cc
+4-144tests/sys/capsicum/capsicum.h
+1-144tests/sys/capsicum/syscalls.h
+1,202-50664 files not shown
+1,805-1,30170 files

HardenedBSD/src cce53d1sys/arm64/linux linux_emul_md.c, sys/compat/linux linux_emul.h

linux: unbreak arm64 linux_emul_md.c after pkey syscalls

linux_emul.h uses struct image_args without a file-scope forward
declaration.  The new arm64 (and i386) stubs include that header
without imgact.h first, which fails the build under -Werror.
Include it the same way linux_pkru.c already does, and declare the
type next to struct image_params so the header is self-contained.

Reported by:    tuexen
Fixes:          bdb561843e86
MFC after:      1 month
DeltaFile
+1-0sys/i386/linux/linux_emul_md.c
+1-0sys/compat/linux/linux_emul.h
+1-0sys/arm64/linux/linux_emul_md.c
+3-03 files

HardenedBSD/src c1ff9c9lib/libc/gen fts.c, lib/libc/tests/gen fts_regress_test.c

fts: fix trailing-slash regression in fts_read after fts_children

When fts_read() descends into a directory whose children were
already prefetched by fts_children() (as ls -R does), it changed
directory using p->fts_name instead of p->fts_accpath.

With a trailing slash on a relative root path (e.g. 'dir/'),
the bare name was resolved relative to the wrong directory, so
every sibling directory after the first failed with ENOENT and
was reported as FTS_DNR.  This manifested as 'ls -lR dir/'
skipping the contents of all but the first subdirectory.

Restore the use of p->fts_accpath, matching the behavior prior
to 4bd01d6ae016.

Add a regression test that reproduces the exact conditions:
fts_children() on each directory, FTS_PHYSICAL without
FTS_NOCHDIR, and a trailing slash on the root path.


    [5 lines not shown]
DeltaFile
+58-0lib/libc/tests/gen/fts_regress_test.c
+1-1lib/libc/gen/fts.c
+59-12 files

HardenedBSD/src eceddfbsys/dev/ixgbe if_ix.c

ixgbe: Report the management packet drop counter

The management_pkts_drpd sysctl was wired to MNGPTC, making it an
alias of management_pkts_txd, instead of MNGPDC.

(cherry picked from commit 435cde959c8823ff38c699d1bc8655918fda57dd)
DeltaFile
+1-1sys/dev/ixgbe/if_ix.c
+1-11 files

HardenedBSD/src 45aac70sys/dev/ixgbe if_ix.c

ixgbe: Re-enable the SFP laser during initialization

ixgbe_if_stop() disables the transmit laser on every 82599 SFP fiber
port, but the iflib initialization path did not re-enable it. Re-enable
the laser before deferred SFP module setup so interface
reinitialization cannot leave either single-speed or multispeed optics
dark.

The hardware wrapper is a no-op when laser control is unavailable. The
placement follows Intel ix-3.4.39; this version deliberately applies to
every SFP port affected by the stop path.

(cherry picked from commit 545779a99290b7b7d94dece6c096ce230be91ff9)
DeltaFile
+2-0sys/dev/ixgbe/if_ix.c
+2-01 files

HardenedBSD/src 5cd4954sys/net iflib.c

iflib: Permit SR-IOV configuration on a down interface

Drivers which remap PF queues need a stop/mutate/restart transaction
only when the interface has live queues. Permit their IOV
initialization callback while the interface is administratively down
and leave it down afterward.

This restores the standard boot-time iovctl.conf workflow and
lets other opt-in drivers configure VFs before netif brings the PF up.

(cherry picked from commit 2cf580c694f6f392531a63f01c3fb89c0244f89a)
DeltaFile
+31-0sys/net/iflib.c
+31-01 files

HardenedBSD/src cd6f4b3sys/dev/pci pci.c

pci: Permit function-level reset of 82599 VFs

Intel 82599 supports FLR on VFs but reports FLR support only in the PF
Device Capabilities register.  The VF register therefore leaves the FLR
Capable bit clear, and pcie_flr() rejects the reset.

Intel documents the zeroed VF PCIe capability structure as erratum 35
in the 82599 Specification Update (B0=Yes; NoFix).

Add a positive FLR quirk for the 82599 VF.  Keep the capability check
for every other function, so an unknown nonconforming VF cannot make
pcie_flr() report success when its reset request was ignored.

SR-IOV requires VFs to support FLR, but a clear capability bit cannot
distinguish the 82599's misadvertisement from a VF that fails to
implement it.

(cherry picked from commit ee776a8e291cb73845a8611d3dec5a2a966106b9)
DeltaFile
+11-3sys/dev/pci/pci.c
+11-31 files

HardenedBSD/src cafdeedshare/man/man4 pci.4, sys/dev/pci pci.c

pci: Ignore SR-IOV VFs when tuning MPS

The VF Device Control MPS and MRRS fields are reserved and preserved.
VF transactions use the PF MPS, so a hardwired VF value must not be
used to retune the shared PCIe hierarchy.

Document the previously undocumented tuning knob and clarify why a VF
may continue to display its reserved hardwired value.

This fixes an instant crash/reboot on my Zen3 system with 82599 VFs.

(cherry picked from commit 5aab6164161db397d84e5fff88e1af1a9e405875)
DeltaFile
+12-1share/man/man4/pci.4
+7-0sys/dev/pci/pci.c
+19-12 files

HardenedBSD/src 5dfc962sys/dev/ixgbe ixgbe.h if_ixv.c

ixv: reconcile VLAN filters through the mailbox

VLAN registration callbacks only update the software shadow, leaving
the PF unaware until a later full initialization.  Initialization then
retries each failed request in a tight loop, while skipping replay
entirely when local hardware filtering is disabled.

Send additions and removals as soon as the desired state changes,
independent of the VF local-filter capability.  Replay the desired
memberships after reset and retry a bounded batch per timer tick.  Stop
after the first failure so a silent PF can consume only one mailbox
timeout per pass, while a responsive PF can drain several requests.
Treat the retry window as a no-progress deadline: advance it when
pending work succeeds so a large backlog can drain, but leave entries
dormant after a sustained failure.

A successful mailbox request wakes a dormant backlog.  Dispatch
timer-driven retries only while iflib marks the VF running, so a stale
timer tick cannot restore PF VLAN state after the stop path resets the

    [14 lines not shown]
DeltaFile
+210-54sys/dev/ixgbe/if_ixv.c
+4-0sys/dev/ixgbe/ixgbe.h
+214-542 files

HardenedBSD/src 626a367share/man/man4 ix.4, sys/dev/ixgbe ixgbe_sriov.h ixgbe.h

ixgbe: implement VF secondary MAC filters

The PF advertises the legacy SET_MACVLAN mailbox request but always
rejects it. The request installs secondary unicast addresses.

Allocate an owned RAR pool for VF secondary addresses, reserve low
entries for PF filters, and place VF-primary addresses at the top of
the usable RAR range. Reject address collisions and cap each VF at
three secondary filters so one guest cannot exhaust the shared table.

Clear secondary filters on VF or PF reset and on SR-IOV teardown. This
hardware can anti-spoof only the VF primary source address. Reject
secondary filters while MAC anti-spoofing is configured, so installing
them requires an explicit administrative policy choice. Report optional
filter-table allocation failure without disabling SR-IOV.

Adapt the owned-RAR allocation and reset-cleanup model from igb(4) in
a2ed165f0049 to DPDK's ixgbe SET_MACVLAN mailbox semantics.


    [3 lines not shown]
DeltaFile
+149-5sys/dev/ixgbe/if_sriov.c
+10-0sys/dev/ixgbe/ixgbe.h
+10-0share/man/man4/ix.4
+2-0sys/dev/ixgbe/ixgbe_sriov.h
+171-54 files

HardenedBSD/src 1ff1416sys/dev/ixgbe ixgbe_vf.c ixgbe.h

ixgbe: enforce VF promiscuity and multicast policy

The allow-promisc IOV property is advertised but ignored, and the PF
rejects the xcast request used by modern VFs. Negotiate mailbox APIs
1.2 and 1.3, implement pool-scoped xcast modes, and require
allow-promisc for requested all-multicast or unicast-promiscuous modes.

The VF mailbox can carry only 30 multicast hashes. When ixv has a
larger list, request the API 1.2 all-multicast xcast mode instead of
extending the legacy SET_MULTICAST message. The PF grants that fallback
only to VFs configured with allow-promisc; otherwise ixv reports that
only the first 30 addresses are active.

Reset xcast state with the VF and have ixv replay the mode implied by
its interface flags after multicast updates.

Follow DPDK's ixgbe API 1.2/1.3 xcast contract, with allow-promisc
policy adapted from igb(4) in a2ed165f0049.


    [3 lines not shown]
DeltaFile
+90-26sys/dev/ixgbe/if_sriov.c
+48-1sys/dev/ixgbe/if_ixv.c
+3-0sys/dev/ixgbe/ixgbe_sriov.h
+1-1sys/dev/ixgbe/ixgbe_vf.c
+2-0sys/dev/ixgbe/ixgbe.h
+144-285 files

HardenedBSD/src df7e516sys/dev/ixgbe ix_txrx.c if_sriov.c

ixgbe: Preserve priority-tagged traffic with SR-IOV

VID 0 carries only 802.1p priority and does not identify VLAN
membership. Keep VFTA bit zero in the persistent PF shadow table so
reset and SR-IOV replay admit priority-tagged frames while VLAN
filtering is enabled.

In virtualization mode, also reserve VLVF slot zero and restore PF and
eligible VF pool memberships. A VFTA hit alone admits the tag globally
but does not deliver it to the correct pools.

This matches the priority-tag treatment in em/igb.

(cherry picked from commit caa08ed331da02a91f95472193e25e573c0ae1e3)
DeltaFile
+10-1sys/dev/ixgbe/if_ix.c
+4-2sys/dev/ixgbe/if_sriov.c
+3-2sys/dev/ixgbe/ix_txrx.c
+17-53 files

HardenedBSD/src 06a514bshare/man/man4 ix.4, sys/dev/ixgbe ixgbe.h ix_txrx.c

ixgbe: preserve VLAN ownership with SR-IOV

The VF VLAN capability is checked but never granted, and no SR-IOV
configuration property exposes the existing default-VLAN support. PF
VLAN updates also replace VFTA registers from a PF-only shadow, erasing
live VF filters.

Expose access VLAN and trunk policy through the IOV schema. Track each
VF VLAN as desired state, restore the administrative VLAN after reset,
and use the native VLVF helper for incremental PF and VF ownership
changes.

Keep VLAN filtering enabled while SR-IOV is active. When PF hardware
filtering is disabled, admit every VLAN to the PF without bypassing
per-pool VF isolation. Reconstruct VLVF and the shared VFTA from PF and
VF desired state after reset or a filtering-mode transition, and
restore PF-only state on teardown.

When the last VF leaves a VLAN still owned by the PF, free its VLVF

    [15 lines not shown]
DeltaFile
+201-21sys/dev/ixgbe/if_sriov.c
+149-69sys/dev/ixgbe/if_ix.c
+23-1share/man/man4/ix.4
+15-3sys/dev/ixgbe/ix_txrx.c
+5-1sys/dev/ixgbe/ixgbe.h
+393-955 files

HardenedBSD/src 59bd5fcsys/dev/ixgbe ixgbe_sriov.h if_sriov.c

ixgbe: enforce configured VF anti-spoofing

The SR-IOV schema advertises MAC anti-spoofing and enables it by
default, but the VF configuration was never consumed and the hardware
policy remained disabled.

Record the configured policy and apply MAC and VLAN anti-spoofing
throughout VF initialization and reset. On X550-family devices, also
protect the LLDP and flow-control Ethertypes and enable per-VF
spoof-event accounting. Remove the driver-owned state during SR-IOV
teardown.

Adapt the anti-spoof configuration lifecycle used by igb(4) in
a2ed165f0049 to the ixgbe hardware controls.

Relnotes:       yes

(cherry picked from commit 7d3d6309398ebeb4d60e35535160c722cd25f9bb)
DeltaFile
+50-0sys/dev/ixgbe/if_sriov.c
+1-0sys/dev/ixgbe/ixgbe_sriov.h
+51-02 files

HardenedBSD/src bc00b34sys/dev/ixgbe ixgbe_sriov.h ixgbe.h

ixgbe: rebuild the shared multicast table

The MTA is shared by the PF and all VFs. The VF mailbox handler only
ORs new bits, so hashes survive list removal and VF reset. Conversely,
PF multicast updates replace the whole table with PF-only state and
discard live VF filters.

Rebuild the table from the PF list and every active VF whenever either
changes. Clear VF multicast state during reset and PF reinitialization,
and remove all VF hashes on SR-IOV teardown. Keep the software shadow
and multicast control state synchronized, and avoid writes to unchanged
MTA registers.

Adapt the aggregate desired-state rebuild introduced for igb(4) in
a2ed165f0049 and its write-elision scheme from 350211ab1782 to ixgbe's
shared MTA.

(cherry picked from commit 1a180b4c86fc7534596cfbe451e25e403db81666)
DeltaFile
+77-8sys/dev/ixgbe/if_ix.c
+23-22sys/dev/ixgbe/if_sriov.c
+1-0sys/dev/ixgbe/ixgbe_sriov.h
+1-0sys/dev/ixgbe/ixgbe.h
+102-304 files

HardenedBSD/src 07b73c3sys/dev/ixgbe if_ixv.c

ixv: reconcile the PF-approved MAC address

The shared VF set-RAR helper restores hw.mac.addr when the PF rejects a
requested address, but ixv ignores the error and leaves the interface
link-layer address unchanged. Subsequent initialization repeats the
rejected request while the interface appears to use an address the PF
will not deliver.

Refresh the permanent address returned by the PF after every successful
reset handshake. Copy the resulting PF-approved address back to the
interface and emit the normal link-layer address notification without
re-entering the driver initialization path. This also recovers from a
prior mailbox transport failure or a PF-side reassignment.

Adapt the igb VF address reconciliation added in a6bb3850e7c6.

(cherry picked from commit 4c03feacd17199a4d8689e4415992111c99e6220)
DeltaFile
+26-0sys/dev/ixgbe/if_ixv.c
+26-01 files

HardenedBSD/src cc03ff9sys/dev/ixgbe if_ixv.c

ixv: defer every admin-vector interrupt

The VF admin vector carries both link and PF mailbox causes, but the
filter schedules the admin task only for link-status changes. Defer
administration for every interrupt so reset and control notifications
are serviced promptly.

(cherry picked from commit 5e05c40aff53f2adb366b3c30ff5b98aac0bb54a)
DeltaFile
+2-3sys/dev/ixgbe/if_ixv.c
+2-31 files

HardenedBSD/src fb81855sys/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

HardenedBSD/src bd68deblib/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

HardenedBSD/src 5614dafsys/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

HardenedBSD/src 95a4412usr.sbin/zonectl zonectl.c

zonectl: Consistently report ZAC conv. zones WP LBA

On ZAC drives, conventional zones conventionally report a write pointer
LBA of 0xffffffffffff. This field is 48 bits wide, unlike ZBC's 64 bits.

Recognize both ZAC and ZBC all-ones behaviour in the WRITE POINTER LBA
field to indicate non-valid information.

Tested by:      fuz
Discussed with: fuz, asomers, ken
Fixes:          4735ef6196bc ("zonectl: display conventional zones better")
MFC after:      2 weeks
Sponsored by:   Google Summer Of Code 2026
Reviewed by:    asomers
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2345
DeltaFile
+2-1usr.sbin/zonectl/zonectl.c
+2-11 files

HardenedBSD/src f343f03share/man/man4 epair.4, sys/net if_epair.c

epair: allow disabling receive checksum offloading

Allow disabling RXCSUM and RXCSUM6 on an epair interface. If disabled,
epair unsets the mbuf flags that indicate a valid checksum when
transferring a packet from one epair end to the other. This gives a
user in a jail the power to control whether the user wants to use the
result of a previous validation (by a physical interface) or not.

Reviewed by:            kp, tuexen
MFC after:              1 month
MFC to:                 stable/15
Differential Revision:  https://reviews.freebsd.org/D58786
DeltaFile
+16-8sys/net/if_epair.c
+7-3share/man/man4/epair.4
+23-112 files

HardenedBSD/src 6faba60sys/dev/clk/spacemit k1_apmu.c k1_clk.h, sys/dev/sdhci sdhci_fdt_spacemit.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+409-0sys/dev/clk/spacemit/k1_clk.c
+200-0sys/dev/clk/spacemit/k1_pll.c
+146-0sys/dev/clk/spacemit/k1_clk.h
+134-0sys/dev/sdhci/sdhci_fdt_spacemit.c
+114-0sys/dev/clk/spacemit/k1_apmu.c
+32-0sys/dts/riscv/overlays/spacemit-k1-mmc0.dtso
+1,035-011 files not shown
+1,085-517 files

HardenedBSD/src fac5dbcsys/dev/clk/spacemit k1_apmu.c k1_clk.h, sys/dev/sdhci sdhci_fdt_spacemit.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+409-0sys/dev/clk/spacemit/k1_clk.c
+200-0sys/dev/clk/spacemit/k1_pll.c
+146-0sys/dev/clk/spacemit/k1_clk.h
+134-0sys/dev/sdhci/sdhci_fdt_spacemit.c
+114-0sys/dev/clk/spacemit/k1_apmu.c
+32-0sys/dts/riscv/overlays/spacemit-k1-mmc0.dtso
+1,035-011 files not shown
+1,085-517 files