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
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
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
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
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
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)
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]
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
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)
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)
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]
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
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