zfs: fix SIMD defines to match OpenZFS HAVE_SIMD() macro
The OpenZFS merge 80aae8a3f8aa introduced HAVE_SIMD() which checks for
HAVE_TOOLCHAIN_* defines via simd_config.h. The kernel module Makefile
was updated, but kern.pre.mk (static kernel build) and the libzpool/libzfs
Makefiles were missed, still using the old HAVE_SSE2 etc. names. This
caused all vectorized raidz, fletcher, and blake3 implementations to be
compiled out.
CHERI: make mem{cpy,move}(9) CHERI compatible
- Use intptr_t in place of long as the word type in the core copying
loop where aligned words a copied. This preserved the provenance of
any copied pointers.
- When working with the address of src or dst use ptraddr_t rather than
uintptr_t. This avoid ambigious provenance in expressions involving
multiple addresses.
As a minor tweak, rename the function to memmove since that is the
interface it implements (overlapping src and dst are permitted) and make
memcpy the alias rather than the other way around.
Reviewed by: kib, markj
Effort: CHERI upstreaming
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D57965
CHERI: add sooptcopyinptr to preserve pointer provenance
Most socket options don't involve pointers so make the default
sooptcopyin discard provenance and add a sooptcopyinptr that preserves.
Reviewed by: markj, emaste
Effort: CHERI upstreaming
Sponsored by: DARPA, AFRL, Innovate UK
Differential Revision: https://reviews.freebsd.org/D57665
CHERI: declare mem{cpy,move}_data
Declare kernel-only, provenance-discarding memcpy_data, and memmove_data
APIs intended to copy raw data which does not contain pointers (e.g.,
buffers on their way to or from network or storage devices). On CHERI
architectures, they will explicitly remove tags from capabilities,
removing any provenance. This reduces the risk of accidental spread of
pointers on CHERI systems.
Document that bcopy preserves pointer provenance.
Reviewed by: ziaee, kib, adrian, markj
Effort: CHERI upstreaming
Sponsored by: DARPA, AFRL, Innovate UK
Differential Revision: https://reviews.freebsd.org/D57662
autofs: rename sx lock description for am_lock
Rename am_lock description from autofslk -> autfsm.
The lock description, autofslk, is used as the description for
autofs_softc->sc_lock, which is used to protect autofs requests and the
like as opposed to am_lock which protects autofs nodes for a given
mount.
This change allows witness to distinguish different lock orders for each
lock.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D57972
linuxulator: Add linux_extattr_get_vp() for atomic getxattr
Move the atomic size-probe-and-read logic into a new
linux_extattr_get_vp() function in linux_xattr.c instead of
modifying the generic extattr_get_vp() in vfs_extattr.c.
This keeps Linux-specific getxattr semantics (ERANGE on
too-small buffer, EOPNOTSUPP to ENOATTR mapping)
self-contained within the linuxulator.
The function probes the attribute size and reads the data
under a single vnode lock, preventing a TOCTOU race between
the size probe and data read.
Signed-off-by: YAO, Xin <mr.yaoxin at outlook.com>
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/2263
linuxulator: Fix O_PATH file descriptors errno for f*xattr(2)
LTP open13 expects these operations to fail with EBADF, matching
Linux behavior, but FreeBSD currently returns EOPNOTSUPP
for fgetxattr() on an O_PATH fd
Look up Linux fd-based xattr descriptors with getvnode()
and route the operations through shared kern_extattr_*_fp()
helpers so the O_PATH check and the extattr operation use the
same referenced file.
Apply the same EBADF handling to fsetxattr(), fremovexattr(), and
flistxattr() so the xattr paths stay consistent.
Signed-off-by: YAO, Xin <mr.yaoxin at outlook.com>
PR: 295537
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/2263
tests/netinet/socket_afinet: reduce tautology in test cases names
Just avoid repeating the test program name in every test case name.
No functional change.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D56727
tests/socket_afinet: extend bind_connected_port_test to cover more cases
- Test SOCK_DGRAM (UDP) sockets.
- Test binding to 0:port and to a addr:port in presence of connected socket
using the port.
Differential Revision: https://reviews.freebsd.org/D56707
tests/socket_afinet: make child_bind() return a full spectre of results
There is no functional change for existing tests, but allows to write a test
that would expect an immediate success of bind(2).
inpcb: use correct mask in in6_pcblookup_lbgroup()
There is no visible bug fixed as in current tree masks are the same.
Fixes: 6883b120c53735ff1681ef96d257f376731f56b3
hym8563: Fix 32-bit powerpc build
Depend on clknode_if.h in the module Makefile, so that it gets
explicitly built for the module. Also, reduce the #if guards to only
the new clock output code, and gate them on all powerpc, not just
powerpc64.
Fixes: 6b77d34f("HYM8563: Add support for clock output.")
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D57795
rge: Fix 32-bit powerpc build
Book-E powerpc has 64-bit bus_addr_t but only a 32-bit bus_size_t. Use
the right macros for maxsize and maxsegsize to fix the build.
Fixes: 4bf8ce037 ("if_rge: initial import of if_rge driver from OpenBSD.")
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57794
ktls: Add a tunable to disable TLS receive
TLS receive offload is really only beneficial for in-kernel use cases
(such as NFS over TLS) or when using a hardware offload. In addition,
several recent SAs have involved the TLS receive path, but the only
current mitigation for those is to disable TLS offload entirely.
Reviewed by: ziaee, gallatin, markj
Relnotes: yes
Sponsored by: Netflix
Sponsored by: Chelsio Communications
Co-authored-by: John Baldwin <jhb at FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D57974
ktls: Centralize the check for CBC ciphers
Move the check out of ktls_enable_(rx|tx) and into ktls_create_session.
Reviewed by: gallatin, markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D57973
pkgconf: match the update to version 2.9.93
This update brings spdxtool(1), with the ability to generate software
bill of material files (SBOM) in the SPDX 3.0.1 format (JSON-LD).
Reviewed by: markj
Approved by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57953
asmc: try PIO before MMIO to avoid false T2 detection
Add hw.asmc.system-state and hw.asmc.board-id read-only sysctls to
expose the T2 system state register and Mac board identifier via SMC.
Try PIO access before MMIO during probe to prevent false T2 detection
on Macs that happen to have something mapped at the T2 BAR address.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57844
net80211: fix CCMP/GCMP AAD for MFP frames
Update ieee80211_crypto_init_aad() to do what 802.11-2020 says -
only mask fc[0] bits 4-6 on data frames, not on management frames.
This (with other diffs to actually negotiate MFP and configure
ath(4) for MFP + software keys) allows the CCMP path to decrypt
CCMP MFP frames in the software path.
Differential Revision: https://reviews.freebsd.org/D57799
asmc: deduplicate sensor converters and cause sysctls
Replace per-type spXX_to_milli() functions with a table-driven
asmc_sensor_convert() that looks up the divisor by SMC type string.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57854
asmc: add system state and board identity sysctls
Add dev.asmc.0.system subtree with read-only sysctls for SMC diagnostic
and identity keys: shutdown_cause (MSSD), sleep_cause (MSSP),
thermal_status (MSAL), time_of_day (CLKT), power_state (MSPS),
board_id (RPlt), and chip_gen (RGEN).
Each sysctl is registered only if the key exists on the hardware.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D57853