HardenedBSD/src d47c4b0tests/sys/netpfil/common divapp.c, tests/sys/netpfil/pf divert-to.sh

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+4-1,205tools/test/stress2/misc/umountf2.sh
+21-21tests/sys/netpfil/pf/divert-to.sh
+12-18tools/test/stress2/misc/msdos10.sh
+20-6tests/sys/netpfil/common/divapp.c
+6-10tools/test/stress2/misc/tmpfs5.sh
+4-10tools/test/stress2/misc/msdos9.sh
+67-1,2706 files not shown
+87-1,28812 files

HardenedBSD/src fc690a7sys/sys sched.h, tools/build Makefile

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+17-7usr.bin/xinstall/tests/install_test.sh
+12-2sys/sys/sched.h
+7-3usr.bin/yes/yes.c
+3-3usr.bin/xinstall/xinstall.c
+2-2tools/build/Makefile
+41-175 files

HardenedBSD/src de92f4dtests/sys/netpfil/common divapp.c, tests/sys/netpfil/pf divert-to.sh

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+4-1,205tools/test/stress2/misc/umountf2.sh
+21-21tests/sys/netpfil/pf/divert-to.sh
+12-18tools/test/stress2/misc/msdos10.sh
+20-6tests/sys/netpfil/common/divapp.c
+6-10tools/test/stress2/misc/tmpfs5.sh
+4-10tools/test/stress2/misc/msdos9.sh
+67-1,2706 files not shown
+87-1,28812 files

HardenedBSD/src 55eb86csys/sys sched.h, tools/build Makefile

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+17-7usr.bin/xinstall/tests/install_test.sh
+12-2sys/sys/sched.h
+7-3usr.bin/yes/yes.c
+3-3usr.bin/xinstall/xinstall.c
+2-2tools/build/Makefile
+41-175 files

HardenedBSD/src 36afb13tests/sys/netpfil/common divapp.c, tests/sys/netpfil/ipfw divert.sh

netpfil tests: Make divapp packet loop handling opt-in

This generalizes the divapp logic and makes it usable for other test
scenarios such as diverted TCP connections.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59067
DeltaFile
+21-21tests/sys/netpfil/pf/divert-to.sh
+20-6tests/sys/netpfil/common/divapp.c
+6-6tests/sys/netpfil/ipfw/divert.sh
+47-333 files

HardenedBSD/src 2b93d98tools/test/stress2/misc 1st.sh ext2fs3.sh

stress2: Use the new version of fsx in ports instead of the older one in tools/regression

Suggested by:    asomers
DeltaFile
+4-1,205tools/test/stress2/misc/umountf2.sh
+12-18tools/test/stress2/misc/msdos10.sh
+6-10tools/test/stress2/misc/tmpfs5.sh
+4-10tools/test/stress2/misc/msdos9.sh
+3-9tools/test/stress2/misc/ext2fs3.sh
+1-0tools/test/stress2/misc/1st.sh
+30-1,2526 files

HardenedBSD/src d105707sys/compat/linuxkpi/common/src linux_80211_macops.c linux_80211.c

LinuxKPI: 802.11: assert wiphy lock for lkpi_bss_info_change() and MO

Finish reviewing all callers for lkpi_80211_mo_link_info_changed() and
lkpi_80211_mo_bss_info_changed(), which are called from
lkpi_bss_info_change() only.  Add the lockdep_assert_wiphy() to
lkpi_bss_info_change() and make sure all callers are holding the
wiphy lock.

PR:             297228
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+6-1sys/compat/linuxkpi/common/src/linux_80211.c
+2-2sys/compat/linuxkpi/common/src/linux_80211_macops.c
+8-32 files

HardenedBSD/src 80bac43sys/dev/iicbus/sensor w83793g.c

i2c/sensor/w83793g: Fix unused function warning

w83793g_writereg is unused so silence it.

Fixes:  cd3cc6e910c0f ("i2c/sensors: Add driver for W83793 hardware monitor")
DeltaFile
+2-0sys/dev/iicbus/sensor/w83793g.c
+2-01 files

HardenedBSD/src 724c344usr.bin/xinstall xinstall.c, usr.bin/xinstall/tests install_test.sh

install: Fix two bugs in stdin code

* Fix case where the source is - and the target exists.

* Only call chflags() (to remove flags that might prevent us from
  replacing an existing target) in the exists case; otherwise,
  to_sb.st_flags is uninitialized.

* Rename the source file in the stdin test case.

* Extend null and stdin test cases to cover the case where the
  target already exists.

PR:             297681
MFC after:      1 week
Fixes:          d34870708db9 ("install: Allow installing stdin")
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D59144

(cherry picked from commit a5ff4125cf08a83f7e67f498e423f3e354144327)
DeltaFile
+17-7usr.bin/xinstall/tests/install_test.sh
+3-3usr.bin/xinstall/xinstall.c
+20-102 files

HardenedBSD/src 9213578sys/sys sched.h

kern/sched: Hide scheduler selection from C++

The scheduler selection interface uses names that are reserved words in
C++, causing problems for downstream projects that use C++ in the
kernel.  Work around this by hiding the interface from C++ compilers
until we can come up with a better solution.

Fixes:          ce38acee8d0b ("Add kern/sched_shim.c")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    siderop1_netapp.com, imp, kib
Differential Revision:  https://reviews.freebsd.org/D58991

(cherry picked from commit f2366851616083f923e8101363802678a03dc0b9)
DeltaFile
+12-2sys/sys/sched.h
+12-21 files

HardenedBSD/src 9f25a71tools/build Makefile

build: Use -f when copying sources

If one of the source files we copy is non-writeable, cp will create a
non-writeable copy.  If the original is later modified, cp will fail to
overwrite the copy since it is not writeable.  Using cp -f ensures the
copy always succeeds, as long as the object directory is writeable.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.

(cherry picked from commit 336b6d11922ac3d080de50f789d40ff95b540cdf)
DeltaFile
+2-2tools/build/Makefile
+2-21 files

HardenedBSD/src 1e7d914usr.bin/yes yes.c

yes: Avoid static initialization

Our buffer is half a megabyte, but we are only initializing the first
two bytes.  Switching from static to dynamic initialization moves it
from .data to .bss, greatly reducing the size of the binary.

Fixes:          cf74b63d61b4 ("yes: Completely overengineer")
MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D58890

(cherry picked from commit 557ba0c2a5138ce026c0ea9cb02f374f97378b7c)
DeltaFile
+7-3usr.bin/yes/yes.c
+7-31 files

HardenedBSD/src a1338basys/dev/acpica acpi_pci.c, sys/dev/ufshci ufshci_private.h ufshci_sim.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+45-48sys/dev/ufshci/ufshci_req_queue.c
+36-1sys/dev/acpica/acpi_pci.c
+15-4sys/dev/ufshci/ufshci_ctrlr.c
+4-0sys/dev/ufshci/ufshci_sim.c
+1-1sys/dev/ufshci/ufshci_private.h
+101-545 files

HardenedBSD/src 86ab2f1share/man/man4 bnxt.4, sys/dev/bnxt/bnxt_en bnxt_hwrm.h bnxt.h

Merge remote-tracking branch 'rad/hardened/15-stable/main' into hardened/15-stable/pledge
DeltaFile
+105-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+41-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+15-0sys/dev/bnxt/bnxt_en/bnxt.h
+6-1share/man/man4/bnxt.4
+2-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+169-15 files

HardenedBSD/src dccec3dsys/dev/acpica acpi_pci.c, sys/dev/ufshci ufshci_private.h ufshci_sim.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+45-48sys/dev/ufshci/ufshci_req_queue.c
+36-1sys/dev/acpica/acpi_pci.c
+15-4sys/dev/ufshci/ufshci_ctrlr.c
+4-0sys/dev/ufshci/ufshci_sim.c
+1-1sys/dev/ufshci/ufshci_private.h
+101-545 files

HardenedBSD/src 1bf7c1fshare/man/man4 bnxt.4, sys/dev/bnxt/bnxt_en bnxt_hwrm.h bnxt.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+105-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+41-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+15-0sys/dev/bnxt/bnxt_en/bnxt.h
+6-1share/man/man4/bnxt.4
+2-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+169-15 files

HardenedBSD/src b057c92share/man/man4 bnxt.4, sys/dev/bnxt/bnxt_en bnxt_hwrm.h bnxt.h

bnxt: Add led(4) identification support

Query the firmware for the LEDs on each physical port and expose
/dev/led/bnxt* only when alternate blinking is supported.  Configure
every LED in the advertised group for identification and restore its
default firmware state before a function reset.

This follows the DPDK and Linux bnxt HWRM identification paths.

Reviewed against: DPDK, Linux

Reviewed by:    Sumit Saxena <sumit.saxena at broadcom.com>
Sponsored by:   BBOX.io

(cherry picked from commit 98b5640786f874949e441bee7c4ad5740cd6a649)
DeltaFile
+105-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.c
+41-0sys/dev/bnxt/bnxt_en/if_bnxt.c
+15-0sys/dev/bnxt/bnxt_en/bnxt.h
+6-1share/man/man4/bnxt.4
+2-0sys/dev/bnxt/bnxt_en/bnxt_hwrm.h
+169-15 files

HardenedBSD/src 746278asys/dev/ufshci ufshci_req_queue.c

ufshci: build valid fake responses for manual completion

The manual completion wrote the fake response to the wrong
descriptor for task management slots. It also left the task tag
at zero, which tripped the task tag check under INVARIANTS.

Write the fake response where the completion path reads it.
Copy the task tag from the request.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58946
DeltaFile
+20-6sys/dev/ufshci/ufshci_req_queue.c
+20-61 files

HardenedBSD/src e59d4ecsys/dev/ufshci ufshci_sim.c ufshci_ctrlr.c

ufshci: handle a recovery reset before the SIM attach

When the first start attempt fails early, the recovery reset
runs the start sequence again without a SIM. That pass still
looked up the WLUN, so it dereferenced a NULL SIM and panicked.

Attach the SIM whenever it does not exist yet. Also make the
WLUN lookup return NULL when there is no SIM.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58947
DeltaFile
+4-3sys/dev/ufshci/ufshci_ctrlr.c
+4-0sys/dev/ufshci/ufshci_sim.c
+8-32 files

HardenedBSD/src 3ecee93sys/dev/ufshci ufshci_req_queue.c

ufshci: reject new requests on a failed controller

A failed controller accepted new requests, but nothing ever
completed them, so the caller waited forever. The admin retry
path could also resubmit a request to a dead queue.

Reject new submits and admin retries on a failed controller.
The submit check runs under the queue lock, so it cannot race
with the queue walk in the fail path.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58948
DeltaFile
+5-2sys/dev/ufshci/ufshci_req_queue.c
+5-21 files

HardenedBSD/src 1258ae2sys/dev/ufshci ufshci_private.h ufshci_ctrlr.c

ufshci: run the controller fail path only once

Two threads could run ufshci_ctrlr_fail() at the same time.
Each one walked the queues and completed the same trackers
again, which caused a double free and a panic.

Turn is_failed into an atomic gate, so only the first caller
walks the queues. The reset task now returns early on a failed
controller instead of re-enabling it.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58944
DeltaFile
+11-1sys/dev/ufshci/ufshci_ctrlr.c
+1-1sys/dev/ufshci/ufshci_private.h
+12-22 files

HardenedBSD/src 7682b8fsys/dev/ufshci ufshci_req_queue.c

ufshci: claim trackers before failing them

ufshci_req_queue_fail() drops the queue lock to complete each
tracker. In that window the completion path could complete the
same tracker again.

Claim the slot before dropping the lock, so the completion scan
skips it. Reserved slots are left to their submit thread, which
completes them itself. The manual request completion helper
lost its only caller, so drop it.

Reviewed by:            imp (mentor)
Sponsored by:           Samsung Electronics
Differential Revision:  https://reviews.freebsd.org/D58945
DeltaFile
+20-40sys/dev/ufshci/ufshci_req_queue.c
+20-401 files

HardenedBSD/src 1a2a886sys/dev/acpica acpi_pci.c

acpi_pci: Inherit PF locality for SR-IOV VFs

SR-IOV VFs are instantiated from their PF and intentionally do not
receive an ACPI handle by matching their runtime BDF.  Consequently,
ACPI locality queries for a VF fall back to the upstream bus.  This is
usually sufficient, but loses a _PXM supplied specifically for the PF.

Use the PCI core's owning-PF accessor for BUS_GET_DOMAIN and
BUS_GET_CPUS requests made for a VF.  This preserves the VF's lack of
an ACPI handle while allowing its CPU and NUMA placement to follow the
PF.

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59062
DeltaFile
+24-1sys/dev/acpica/acpi_pci.c
+24-11 files

HardenedBSD/src 8b74806sys/dev/acpica acpi_pci.c

acpi_pci: Do not match SR-IOV VFs to ACPI devices

SR-IOV VFs are instantiated dynamically from their PF rather than
enumerated from ACPI.  A VF's runtime slot and function can match an
unrelated _ADR below the bridge.  acpi_pci_save_handle() stores that
handle in the VF's devinfo before acpi_pci_update_device() runs.

If the handle is already bound to another device_t whose parent is not
acpi0, acpi_pci_update_device() panics under INVARIANTS.  Without
INVARIANTS, the VF retains the unrelated handle, so subsequent ACPI
lookups, including NUMA and power-management operations, can act on the
wrong namespace node.

Skip ACPI namespace matching for VFs.

Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   BBOX.io
Differential Revision:  https://reviews.freebsd.org/D59061
DeltaFile
+12-0sys/dev/acpica/acpi_pci.c
+12-01 files

HardenedBSD/src 2adad9bsys/dev/usb/controller xhci.c, usr.bin/sockstat sockstat.1 main.c

Merge remote-tracking branch 'rad/hardened/current/master' into hardened/current/pledge
DeltaFile
+69-70usr.sbin/bhyve/pci_emul.c
+47-3usr.bin/sockstat/main.c
+18-5sys/dev/usb/controller/xhci.c
+15-2usr.bin/sockstat/sockstat.1
+6-7usr.sbin/bhyve/pci_passthru.c
+2-5usr.sbin/bhyve/pci_fbuf.c
+157-9212 files not shown
+181-10618 files

HardenedBSD/src c2c4d20sys/dev/usb/controller xhci.c, usr.bin/sockstat sockstat.1 main.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+69-70usr.sbin/bhyve/pci_emul.c
+47-3usr.bin/sockstat/main.c
+18-5sys/dev/usb/controller/xhci.c
+15-2usr.bin/sockstat/sockstat.1
+6-7usr.sbin/bhyve/pci_passthru.c
+2-5usr.sbin/bhyve/pci_fbuf.c
+157-9212 files not shown
+181-10618 files

HardenedBSD/src c54fbc9bin/chflags chflags.1

chflags.1: Change dontcache to nocache

Commit 290e563166b4 changed the flag's name from dontcache
to nocache. This patch fixes the man page.

This is a content change.

Reviewed by:    kib (earlier version)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D58181
Fixes:  4830670a3f94 ("chflags.1: Document the new UF_DONTCACHE flag")
DeltaFile
+3-3bin/chflags/chflags.1
+3-31 files

HardenedBSD/src 290e563lib/libc/gen strtofflags.c, sys/fs/tmpfs tmpfs_subr.c

chflags: Add a new UF_NOCACHE flag

This internet draft (which is close to being an RFC)
specifies a new NFSv4.2 attribute which tells the NFSv4.2
client to not cache file data. (Similar to O_DIRECT, but
triggered by this attribute set on the file on the NFSv4.2
server and not by the application's open(2).)

https://datatracker.ietf.org/doc/draft-ietf-nfsv4-uncacheable-files/

This patch adds a new chflags(1) flag called UF_NOCACHE to
implement this.

Patches for NFS and ZFS will be done separately.

This is a redo of the patch, with a requested name change
and a #ifdef in strtofflags.c so that it doesn't break some
Linux cross build.  The name change was requested by fuz@.


    [3 lines not shown]
DeltaFile
+6-0lib/libc/gen/strtofflags.c
+1-1sys/ufs/ufs/ufs_vnops.c
+1-1sys/fs/tmpfs/tmpfs_subr.c
+1-0sys/sys/stat.h
+9-24 files

HardenedBSD/src 0f59df8sys/dev/usb/controller xhci.h xhci.c

xhci: Only reset the data toggle value when the USB stack asks for it

The previous patch assumes that we don't want to reset toggle bit in
STOPPED_STEP. However, a device can explicitly call
usbd_clear_data_toggle if necessary. As a result, instead of not
dropping the bit unconditionally, we added a field in xhci to specify
that we want to drop it, so that usbd_clear_data_toggle can handle it
correctly.

Reported by:    oh
Reviewed by:    kevans
Tested by:      oh
Fixes:          28d85db46b48 ("xhci: Do not drop and add bits in xhci")
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D59186
DeltaFile
+18-5sys/dev/usb/controller/xhci.c
+1-0sys/dev/usb/controller/xhci.h
+19-52 files

HardenedBSD/src 4a20c0asys/kern sched_ule.c

sched_ule: Fix spelling of csr_cpu in comment.

Commit 08063e9f98 renamed cs_cpu to csr_cpu.
DeltaFile
+1-1sys/kern/sched_ule.c
+1-11 files