HardenedBSD/src 454165dsys/dev/thunderbolt nhi_pci.c nhi.c, tests/sys/netinet ip_mroute.py

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+5-116sys/dev/thunderbolt/nhi_pci.c
+26-24usr.bin/du/du.c
+3-46sys/dev/thunderbolt/nhi.c
+19-1usr.bin/du/tests/du_test.sh
+0-18sys/dev/thunderbolt/nhi_var.h
+193-2188 files not shown
+213-23814 files

HardenedBSD/src 18454bcsys/dev/thunderbolt nhi_pci.c nhi.c, tests/sys/netinet ip_mroute.py

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+5-116sys/dev/thunderbolt/nhi_pci.c
+26-24usr.bin/du/du.c
+3-46sys/dev/thunderbolt/nhi.c
+19-1usr.bin/du/tests/du_test.sh
+0-18sys/dev/thunderbolt/nhi_var.h
+193-2188 files not shown
+213-23814 files

HardenedBSD/src 0c09c65tests/sys/fs/fusefs rename.cc

tests/fusefs: appease gcc -Wcast-qual

Fix gcc build error.

Reviewed by:    asomers, kib
Fixes:  7e68af7ce2c1 ("fusefs: redo vnode attribute locking")
Differential Revision:  https://reviews.freebsd.org/D56370
DeltaFile
+2-2tests/sys/fs/fusefs/rename.cc
+2-21 files

HardenedBSD/src 1dddb58sys/conf ldscript.arm64

arm64: Define the .iplt section placement.

Ensure that the .plt and .ipld sections are in the executable memory segment.

MFC after:      1 week
Reviewed by:    andrew
Differential Revision: https://reviews.freebsd.org/D56403
DeltaFile
+6-1sys/conf/ldscript.arm64
+6-11 files

HardenedBSD/src 18b7115sys/netinet ip_mroute.c, sys/netinet6 ip6_mroute.c

ip_mroute: Fix a lock leak in X_ip_mforward()

If a FIB does not have a router configured, X_ip_mforward() would leak a
lock.  Plug the leak.

The IPv6 counterpart did not have such a check.  It wouldn't send an
upcall to a non-existent router anyway due to the router_ver check, but
we should verify that a router is present anyway.

Add regression test cases to exercise these code paths.

Reported by:    Claude Opus 4.6
Fixes:          0bb9c2b665d9 ("ip6_mroute: FIBify")
Sponsored by:   Klara, Inc.
Sponsored by:   Stormshield
DeltaFile
+140-13tests/sys/netinet/ip_mroute.py
+4-0sys/netinet6/ip6_mroute.c
+3-1sys/netinet/ip_mroute.c
+147-143 files

HardenedBSD/src e99b3f5usr.bin/du/tests du_test.sh

du: Fix t_flag test case

MFC after:      1 week
Fixes:          3e5550d25c6d ("du: Add regression tests")
Sponsored by:   Klara, Inc.
DeltaFile
+1-1usr.bin/du/tests/du_test.sh
+1-11 files

HardenedBSD/src 6c18dd3usr.bin/du du.c du.1, usr.bin/du/tests du_test.sh

du: Complete libxo transition

* Use xo_warn() / xo_err() instead of warn() / err().

* Add a test case for the POSIX-mandated stdout error check.

* While here, don't assume the size of off_t, address some style issues,
  and broaden the use of bool instead of int.

* Reorder SEE ALSO section.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    allanjude
Differential Revision:  https://reviews.freebsd.org/D56402
DeltaFile
+26-24usr.bin/du/du.c
+18-0usr.bin/du/tests/du_test.sh
+2-2usr.bin/du/du.1
+46-263 files

HardenedBSD/src 52d2fc7sys/compat/linuxkpi/common/include/linux kfifo.h

linuxkpi: Fix an off-by-one error in the kfifo implementation

"total" is the number of slots in the array, so wraparound needs to be
done when "first" or "last" is greater than or equal to the number of
slots.

Note that no consumers of the code are currently connected to the kernel
build.

Reported by:    Stanislav Fort <stanislav.fort at aisle.com>
Reviewed by:    bz, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56371
DeltaFile
+2-2sys/compat/linuxkpi/common/include/linux/kfifo.h
+2-21 files

HardenedBSD/src bb36c45sys/dev/pci pcireg.h, sys/dev/thunderbolt nhi_pci.c nhi.c

thunderbolt: Support generic USB4 NHIs

Check a PCI device's class, subclass, and progif to figure out if it is
a USB4 NHI. nhi_identifiers is completely removed as only these generic
USB4 NHIs are supported anyway, and all remnants of ICM-supporting code
are removed too. All devices now use the HCM.

PR:             290827
Reviewed by:    jhb, ngie
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52861
DeltaFile
+5-116sys/dev/thunderbolt/nhi_pci.c
+3-46sys/dev/thunderbolt/nhi.c
+0-18sys/dev/thunderbolt/nhi_var.h
+0-12sys/dev/thunderbolt/tb_pcib.c
+1-0sys/dev/pci/pcireg.h
+9-1925 files

HardenedBSD/src 2227904. UPDATING, libexec/rc/rc.d NETWORKING

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+6-0UPDATING
+3-3usr.bin/sockstat/sockstat.1
+4-0sys/sys/time.h
+1-1libexec/rc/rc.d/NETWORKING
+14-44 files

HardenedBSD/src 095f7a4. UPDATING, libexec/rc/rc.d NETWORKING

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+6-0UPDATING
+3-3usr.bin/sockstat/sockstat.1
+4-0sys/sys/time.h
+1-1libexec/rc/rc.d/NETWORKING
+14-44 files

HardenedBSD/src 4f752balib/libc/tests/string strrchr_test.c Makefile, usr.bin/stat/tests stat_test.sh readlink_test.sh

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+156-0lib/libc/tests/string/strrchr_test.c
+13-12usr.bin/stat/tests/stat_test.sh
+6-3usr.bin/stat/tests/readlink_test.sh
+2-0lib/libc/tests/string/Makefile
+1-0usr.sbin/daemon/daemon.c
+178-155 files

HardenedBSD/src e4f02a7lib/libc/tests/string strrchr_test.c Makefile

libc/tests/string: add a more comprehensive unit test for strrchr()

The unit tests are patterned after those for memrchr().
This catches the issue found in 293915.

PR:             293915
Reviewed by:    strajabot
Reported by:    safonov.paul at gmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56037

(cherry picked from commit 8b5d77bbcbd98e684226950be1c779e108059d8d)
DeltaFile
+156-0lib/libc/tests/string/strrchr_test.c
+2-0lib/libc/tests/string/Makefile
+158-02 files

HardenedBSD/src a6bd704usr.bin/sockstat sockstat.1

sockstat: Unbreak SEE ALSO section

MFC after:      1 week
Fixes:          7b35b4d19630 ("sockstat: add libxo support")
DeltaFile
+3-3usr.bin/sockstat/sockstat.1
+3-31 files

HardenedBSD/src 47a9af4. UPDATING, libexec/rc/rc.d NETWORKING

rc.d/NETWORKING: remove the NETWORK alias

NETWORKING is the documented placeholder, while
/etc/rc.d/NETWORKING still provides the legacy alias
NETWORK.

The NETWORKING script was originally introduced to avoid
conflicts with NetBSD's lowercase network script on
case-insensitive file systems.  The NETWORK alias was
retained for compatibility with older scripts.

Following the discussion in PR 293652, remove the legacy
NETWORK alias from 16-CURRENT.  Keeping both names adds
more confusion than value now that NETWORKING is the
documented placeholder and current base system and ports
tree uses are already clean.

Add an UPDATING entry to note that local RC scripts using
REQUIRE: NETWORK should be migrated to REQUIRE: NETWORKING.

    [5 lines not shown]
DeltaFile
+6-0UPDATING
+1-1libexec/rc/rc.d/NETWORKING
+7-12 files

HardenedBSD/src 5aa751cusr.sbin/daemon daemon.c

daemon(8): Add "--output-file -o" to list of options enabling supervision mode

This is the small internal doc fix from https://reviews.freebsd.org/D46313

Reviewed by:    michaelo
Approved by:    (blanket; comment fix)
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D55325

(cherry picked from commit e9a69948a8837601d71e556550a272ca85c03e48)
DeltaFile
+1-0usr.sbin/daemon/daemon.c
+1-01 files

HardenedBSD/src 00dccc3sys/sys time.h

sys/time: appease gcc -Wtype-limits

In environments where time_t is 32 bits, including the 32-bit library
build on amd64, the overflow being tested for cannot happen, and gcc
complains with -Wtype-limits, causing the gcc build to fail.  Work
around this by ifdef'ing out the saturation code on i386.

Reviewed by:    imp, jfree
Discussed with: markj
Fixes:  e3799530b3ba ("sys/time: Add saturating sbt conversions")
Differential Revision:  https://reviews.freebsd.org/D56369
DeltaFile
+4-0sys/sys/time.h
+4-01 files

HardenedBSD/src 94d4be9usr.bin/stat/tests stat_test.sh

stat: Nits in stat tests

* Use ourselves as test file instead of /COPYRIGHT, which may or may not
  be present in the test environment.

* atf-check understands \n in strings, use it.

* Some file systems don't like creating small holes, so create large ones
  instead.  This means we need two variables: ps (page size) is the
  minimum size of a data region and the alignment for a hole, while hs
  (hole size) is the minimum size of the holes we create.  This makes no
  difference on FreeBSD but makes it easier to port the test to other
  platforms.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56304

(cherry picked from commit 8cbd3949297d56e3960dcde73bd7e2277ac4bee8)
DeltaFile
+13-12usr.bin/stat/tests/stat_test.sh
+13-121 files

HardenedBSD/src 9d89e57usr.bin/stat/tests readlink_test.sh

stat: Nits in readlink tests

* The f_flag test may fail if a component of the full path to the
  temporary directory is a symbolic link.

* The n_flag test had an empty head; give it a description.

* Use consistent quoting.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56293

(cherry picked from commit 1c793e7cbe2ecded388fd51fb20274891620a6f4)
DeltaFile
+6-3usr.bin/stat/tests/readlink_test.sh
+6-31 files

HardenedBSD/src 20f8a79lib/libifconfig libifconfig_sfp.c sfp.lua, share/examples/sound mmap.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+450-0sys/net/cmis.h
+297-0share/examples/sound/mmap.c
+240-47sys/dev/asmc/asmc.c
+241-0tests/sys/cam/ctl/opcodes.sh
+227-1lib/libifconfig/libifconfig_sfp.c
+120-0lib/libifconfig/sfp.lua
+1,575-4843 files not shown
+2,063-19049 files

HardenedBSD/src 6a86eeashare/man/man4 asmc.4, sys/dev/asmc asmc.c asmcvar.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+240-47sys/dev/asmc/asmc.c
+29-0share/man/man4/asmc.4
+19-0sys/dev/asmc/asmcvar.h
+288-473 files

HardenedBSD/src 92a1aaclib/msun/aarch64 fenv.c fenv.h, lib/msun/amd64 Makefile.inc

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+18-0lib/msun/aarch64/fenv.c
+9-5lib/msun/aarch64/fenv.h
+10-0lib/msun/aarch64/Symbol.map
+0-1lib/msun/amd64/Makefile.inc
+0-1lib/msun/arm/Makefile.inc
+0-1lib/msun/i387/Makefile.inc
+37-83 files not shown
+38-109 files

HardenedBSD/src 3e27114share/man/man4 asmc.4, sys/dev/asmc asmc.c asmcvar.h

asmc: add raw SMC key read/write interface

This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
 and control of undocumented features.

The interface provides four sysctls under dev.asmc.0.raw.*:
  - key - Set the 4-character SMC key name (e.g., "AUPO")
  - value - Read/write key value as a hex string
  - len - Auto-detected key value length (can be overridden)
  - type - Read-only 4-character type string (e.g., "ui8", "flt")

Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.

This interface was essential for discovering that the AUPO key

    [5 lines not shown]
DeltaFile
+240-47sys/dev/asmc/asmc.c
+29-0share/man/man4/asmc.4
+19-0sys/dev/asmc/asmcvar.h
+288-473 files

HardenedBSD/src bafff9arelease/tools ec2-small.conf ec2-builder.conf

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-5release/tools/ec2-small.conf
+0-5release/tools/ec2-builder.conf
+0-102 files

HardenedBSD/src 0c89907lib/libifconfig libifconfig_sfp.c sfp.lua, share/examples/sound mmap.c

Merge remote-tracking branch 'internal/freebsd/current/main' into hardened/current/master

Conflicts:
        release/tools/ec2-builder.conf (unresolved)
        release/tools/ec2-small.conf (unresolved)
DeltaFile
+450-0sys/net/cmis.h
+297-0share/examples/sound/mmap.c
+241-0tests/sys/cam/ctl/opcodes.sh
+227-1lib/libifconfig/libifconfig_sfp.c
+120-0lib/libifconfig/sfp.lua
+52-21sys/netinet/tcp_lro.c
+1,387-2240 files not shown
+1,783-14146 files

HardenedBSD/src 68c6a73lib/msun/aarch64 fenv.c fenv.h

lib/msun/aarch64: provide export file for arch-specific fenv methods

(cherry picked from commit 96a685c229f2ce440591f98d33d36776e56dd55c)
DeltaFile
+18-0lib/msun/aarch64/fenv.c
+9-5lib/msun/aarch64/fenv.h
+10-0lib/msun/aarch64/Symbol.map
+37-53 files

HardenedBSD/src 1e7e033lib/msun Makefile, lib/msun/amd64 Makefile.inc

lib/msun: centralize addition of the arch-specific symbol map files

(cherry picked from commit c913dce86e7b6ff9c0c3265631529586aaf8520a)
DeltaFile
+1-0lib/msun/Makefile
+0-1lib/msun/amd64/Makefile.inc
+0-1lib/msun/arm/Makefile.inc
+0-1lib/msun/i387/Makefile.inc
+0-1lib/msun/powerpc/Makefile.inc
+0-1lib/msun/riscv/Makefile.inc
+1-56 files

HardenedBSD/src 6b00c65sys/netinet6 in6_pcb.c

inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect()

Allow to be passed with already unconnected inpcb.

Fixes:  4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4
DeltaFile
+3-0sys/netinet6/in6_pcb.c
+3-01 files

HardenedBSD/src bf41d86sys/netinet ip_fastfwd.c, sys/netinet6 ip6_fastfwd.c

routing: Make ip[6]_tryforward() FIB-aware for local traffic

`ip_tryforward()` and `ip6_tryforward()` checks whether the destination
address is local or not without considering if it belongs to the current FIB.
If the destination is local but not in our FIB, forward it instead
of returning it to ip_input().

PR:             292319
Reviewed by:    zlei
MFC after:      1 week
MFC to:         stable/15
Differential Revision: https://reviews.freebsd.org/D56353
DeltaFile
+2-2sys/netinet/ip_fastfwd.c
+1-1sys/netinet6/ip6_fastfwd.c
+3-32 files

HardenedBSD/src 956acdcsys/net if_loop.c

loopback: Account for packet drops

Make loopback packet drops more obvious by reporting them
in interface stats visable via netstat -ni
Since loopback uses netisr, packets can be dropped if the
netisr queue overflows.  These drops are visible via
netisr -Q, but its not an obvious place to look.

Differential Revision: https://reviews.freebsd.org/D56356
Reviewed by: glebius, tuexen
Sponsored by: Netflix
DeltaFile
+7-3sys/net/if_loop.c
+7-31 files