FreeBSD/src 954001asys/dev/sound/usb uaudio.c

snd_uaudio: Initialize mixer_lock with MTX_RECURSE

Fixes:          fc9dc8482396 ("snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()")
PR:             296682
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+8-1sys/dev/sound/usb/uaudio.c
+8-11 files

FreeBSD/src 40cc9desys/dev/mlx5/mlx5_ib mlx5_ib_devx.c

mlx5ib: use the eventfd_ctx API for DEVX event subscriptions

The DEVX_SUBSCRIBE_EVENT redirect path resolved the user's eventfd with
fdget(), which on FreeBSD only finds LinuxKPI files.  rdma-core creates
the eventfd with the native FreeBSD eventfd(2), so the lookup failed and
subscription returned EBADF; the delivery side likewise assumed a
LinuxKPI-pollable file.

Use the LinuxKPI eventfd_ctx API instead: eventfd_ctx_fdget() resolves
the native eventfd, eventfd_signal() notifies it, and eventfd_ctx_put()
releases it.  DEVX async events can then be delivered through a redirect
eventfd.

Reviewed by: kib
Sponsored by: Nvidia networking
MFC after: 1 month
DeltaFile
+12-10sys/dev/mlx5/mlx5_ib/mlx5_ib_devx.c
+12-101 files

FreeBSD/src f1e8b0fshare/mk bsd.cpu.mk

bsd.cpu.mk: Add a workaround for erratum 843419

Add a workaround for the Arm Cortex-A53 erratum 843419. This has been
targeted when the build is either unoptimised for any CPU/architecture
or targets the Cortex-A53 or ARMv8.0 architecture.

PR:             296240
PR:             296395
Reported by:    Hal Murray <halmurray+freebsd at sonic.net>
Reported by:    Andreas Schuh <x55839 at icloud.com>
Reviewed by:    cognet, mmel
Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D58212
DeltaFile
+17-1share/mk/bsd.cpu.mk
+17-11 files

FreeBSD/src 4c9f648sbin Makefile, sbin/init init.c Makefile

init(8): extract reroot transient code into reroot_seed

Since init become dynamically linked, reroot appeared to be broken
because init copies itself into a transient tmpfs mount to continue
controlling execution right after the reboot(REROOT) syscall.  Because
the binary is dynamically linked, it cannot be properly executed.

Provide a minimal static binary 'reroot_seed' embedded into the init as
byte stream, which performs what the 'init -r' did, namely, the second
phase reroot.

For the static build of init as part of the /rescue crunch, keep the
inline reroot code.

Reported and tested by: markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58164
DeltaFile
+109-0sbin/reroot_seed/reroot_seed.c
+74-17sbin/init/init.c
+8-1sbin/init/Makefile
+6-0sbin/reroot_seed/Makefile
+4-0sbin/init/reroot_seed.embed.s
+2-0sbin/Makefile
+203-186 files

FreeBSD/src 0228338usr.sbin/bhyve block_if.c

bhyve: Fix some leaks in usr.sbin/bhyve/block_if.c

Modify `blockif_open` to properly release a partially initialized
`blockif_ctxt` structure on error.

Differential Revision:  https://reviews.freebsd.org/D57887
Reviewed by:    novel, bnovkov, glebius
Tested by:      bnovkov
MFC after:      2 weeks
DeltaFile
+39-9usr.sbin/bhyve/block_if.c
+39-91 files

FreeBSD/src 1aeb9d7sys/arm64/rockchip rk_gpio.c

Revert "rk_gpio: defer level-IRQ EOI until source line is driven low"

There is a more correct / preferable scheme for handling of EOI.

Requested-by:   mmel

This reverts commit 8ffb400bfd64102ac2a49639ccbbfffbe0c6f127.
DeltaFile
+3-54sys/arm64/rockchip/rk_gpio.c
+3-541 files

FreeBSD/src f82ee47etc/mtree BSD.tests.dist, tests/sys/fs Makefile

tests: Add pjdfstest integration

Use ATF to wrap the new reimplementation of pjdfstest that came out of
GSOC 2022, now available in the ports tree as filesystems/pjdfstest.

So far I added tests for UFS (with several different option
combinations), tmpfs and ZFS, plus ZFS+nullfs.  All of these create a
memory disk, initialize the filesystem, and point the pjdfstest
executable at it.

In the future it would be good to add tests for at least NFS and p9fs.

Reviewed by:    asomers
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56605

(cherry picked from commit 8fd4d1c0fff8441b42dbab767810db7aeaf796c3)
DeltaFile
+130-0tests/sys/fs/pjdfstest/ufs.sh
+96-0tests/sys/fs/pjdfstest/zfs.sh
+60-0tests/sys/fs/pjdfstest/tmpfs.sh
+12-0tests/sys/fs/pjdfstest/Makefile
+2-0etc/mtree/BSD.tests.dist
+1-0tests/sys/fs/Makefile
+301-06 files

FreeBSD/src 32ae329sys/netinet udp_usrreq.c

udp: Wrap a long line in udp_send()

No functional change intended.

MFC after:      1 week

(cherry picked from commit 3b69c7201fd06b368090f2ee3840d384a949cba8)
DeltaFile
+2-1sys/netinet/udp_usrreq.c
+2-11 files

FreeBSD/src 49b5356sys/compat/linux linux_futex.c

linux/futex: Don't load a timeout when try-locking a mutex

linux_sys_futex() does not copyin a timespec for the timeout if the
operation is LINUX_FUTEX_TRYLOCK_PI, presumably because it doesn't make
sense to specify a timeout for a try-lock operation.  However, this
means that we pass a userspace timespec pointer to
linux_umtx_abs_timeout_init().

Modify linux_futex_lock_pi() to not initialize the timeout if we're
try-locking.

Reviewed by:    kib, dchagin
Reported by:    Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li,
                and Ke Xu from Tsinghua University using GLM-5.2 from Z.ai
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D58061

(cherry picked from commit 407c7c339adb429efcb6658accd16399031c34ca)
DeltaFile
+8-5sys/compat/linux/linux_futex.c
+8-51 files

FreeBSD/src f815c54usr.bin/xinstall xinstall.c

install: Explicitly include sys/param.h for MAXPATHLEN

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit ca89b0fa1a93744a5bbf7a5c949826bbee4e2559)
DeltaFile
+1-0usr.bin/xinstall/xinstall.c
+1-01 files

FreeBSD/src 9af7633usr.sbin/makefs/zfs dsl.c

makefs/zfs: Explicitly include sys/param.h for nitems()

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 88deb1cff92cb3620c248f32fa6e7bdbc5301213)
DeltaFile
+1-0usr.sbin/makefs/zfs/dsl.c
+1-01 files

FreeBSD/src d4b1fe7tests/sys/netinet ip6_v4mapped_test.c

netinet tests: Fix leaks in ip6_v4mapped_test

Reported by:    Coverity
MFC after:      1 week

(cherry picked from commit 6ad6929974e6394d57a40f7d43c899963c6ae5ec)
DeltaFile
+7-2tests/sys/netinet/ip6_v4mapped_test.c
+7-21 files

FreeBSD/src eba4bf3lib/librpcsec_gss svc_rpcsec_gss.c

librpcsec_gss: Fix an off-by-one in rpc_gss_get_principal_name()

Include an extra byte for the nul-terminator, otherwise we may end up
with an out-of-bounds write.

The corresponding bug in the kernel implementation was fixed by commit
e3081f7e3e2d ("kgssapi(4): Fix string overrun in Kerberos principal construction").

Reviewed by:    markj
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57738

(cherry picked from commit 635ad6f2ec97e9c6b1f15620cd5ee84eb632082f)
DeltaFile
+1-1lib/librpcsec_gss/svc_rpcsec_gss.c
+1-11 files

FreeBSD/src cdd4f32sys/net if_ovpn.c

if_ovpn: Fix a lock leak in an error path

Reviewed by:    kp
MFC after:      1 week
Fixes:          04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf")
Differential Revision:  https://reviews.freebsd.org/D57696

(cherry picked from commit f7b71f832c990da0bf203095f02405df665529d0)
DeltaFile
+1-0sys/net/if_ovpn.c
+1-01 files

FreeBSD/src 60585eesys/kern uipc_socket.c

so_splice: Fix the KTLS check for the sink socket in so_splice()

Reviewed by:    gallatin
Reported by:    Claude Sonnet 4.6
Fixes:          1000cc4a0d39 ("so_splice: Disallow splicing with KTLS-enabled sockets")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56385

(cherry picked from commit d88a159da42a75dbd46ea4f6f9c8059975dab5e8)
DeltaFile
+1-1sys/kern/uipc_socket.c
+1-11 files

FreeBSD/src 085667csys/vm vm_object.c

Reset kvo_laundry to prevent it being cumulative

`sysctl vm.objects`, used by `vmstat -o` was not resetting the
laundry counter to 0 inside the loop, causing it to show the sum of
the laundry count for all previous objects instead of only the laundry
count for the current object.

Fixes:  a86373bc93ee1c850943e8585d0d426479378145
Reviewed by:    markj
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
Differential Revision:  https://reviews.freebsd.org/D50907

(cherry picked from commit 32f9c9699a5a56ef8ef1da8e2974a8b34e2b84f5)
DeltaFile
+1-0sys/vm/vm_object.c
+1-01 files

FreeBSD/src 7cf84b5sys/cddl/dev/kinst/aarch64 kinst_isa.c

kinst/arm64: Fix return values from kinst_invop()

After commit 853cd8723494 it became invalid for kinst_invop() to return
0: dtrace_invop_start() would convert this to a sentinel value
indicating that it did not consume the breakpoint, and so we'd just
call kdb_trap() to handle it.

Change kinst_invop() to return NOP_INSTR after handling a matching
breakpoint.  NOP_INSTR is handled by advancing the ELR, so we have to
compensate by subtracting INSTR_SIZE before returning.

Reviewed by:    christos
MFC after:      1 week
Fixes:          853cd8723494 ("arm64: Clean up usage of the dtrace invop handler")
Differential Revision:  https://reviews.freebsd.org/D56987

(cherry picked from commit d6f0e671d0797b56011880f84d12ce5fb20bf099)
DeltaFile
+20-18sys/cddl/dev/kinst/aarch64/kinst_isa.c
+20-181 files

FreeBSD/src 1d5f108share/man/man3 Makefile

queue.3: Add MLINKs for *_EMPTY_ATOMIC

MFC after:      1 week
Fixes:          d2870b8666f2 ("queue: Add atomic variants for *_EMPTY")

(cherry picked from commit 1563da200d4d3d56799267f1bbc58933a6c21331)
DeltaFile
+4-0share/man/man3/Makefile
+4-01 files

FreeBSD/src a619438sys/dev/sound/pcm dsp.c channel.c

sound: track kqueue low watermark per-knote for mmaped channels

Use kn->kn_sdata to track the last bs->total value for each knote
attached to an mmaped channel. An event is delivered only when the total
byte counter has advanced by at least c->lw since the last delivery.
After delivery kn_sdata is updated to the current total.

Each knote tracks its own watermark independently, so multiple knotes
attached to the same mmaped channel all receive events correctly.

Non-mmap channels keep the existing level-triggered behavior via
chn_polltrigger().

MFC after:      1 week
Reviewed by:    christos
Differential Revision:  https://reviews.freebsd.org/D57833

(cherry picked from commit 24576c39789ca13846b9450155923ee0e377aeb4)
DeltaFile
+13-1sys/dev/sound/pcm/dsp.c
+9-5sys/dev/sound/pcm/channel.c
+1-1sys/dev/sound/pcm/channel.h
+23-73 files

FreeBSD/src 4b539c5sys/netinet/libalias alias_db.c

libalias: Serialize updates to the global instance list

libalias maintains a global list of all libalias handles.  The list was
updated without any locking, but nothing prevents updates from running
concurrently.

MFC after:      1 week

(cherry picked from commit 2ff705f32a2033201a8f83f1ade5ddbc0460387d)
DeltaFile
+17-0sys/netinet/libalias/alias_db.c
+17-01 files

FreeBSD/src f49ca17lib/libc/iconv iconv.3

iconv.3: Fix formatting of the error section

MFC after:      1 week

(cherry picked from commit c491c2db2f37399eba7a356c4bfa298d64012101)
DeltaFile
+1-0lib/libc/iconv/iconv.3
+1-01 files

FreeBSD/src 4542cc1sys/conf kern.mk

kernel: Enable -fstack-protector-strong by default

This extends stack canary use to all functions which define arrays on
the stack, not just those which operate on byte buffers.  This option
would have made it harder to exploit SA-26:18.setcred and
SA-26:08.rpcsec_gss.

The change bloats the amd64 kernel text by about 350KB and increases the
number of covered functions from ~1500 to ~9000 (within the kernel
itself, i.e., not counting kernel modules).

Reviewed by:    olce, olivier, emaste
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56870

(cherry picked from commit 8deebce931fa9b469cf28a082038a64caf972602)
DeltaFile
+1-1sys/conf/kern.mk
+1-11 files

FreeBSD/src 38cbd25sys/x86/x86 ucode.c

ucode: Fix validation on Intel platforms

The check for the extended signature table was backwards, so we always
ignored it.

We should verify that the extended signature table fits within the total
image size.

Reviewed by:    jrm, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D57209

(cherry picked from commit 0beb172898499fff51eed4df3d9284cd1094afbb)
DeltaFile
+24-8sys/x86/x86/ucode.c
+24-81 files

FreeBSD/src 1e857a9sys/x86/include ucode.h, sys/x86/x86 ucode.c

x86/ucode: add const where appropriate

Sponsored by:   Netflix
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D43865

(cherry picked from commit fd24a63a38d0d4cb4f5041ef232036abe09d9d4f)
DeltaFile
+21-19sys/x86/x86/ucode.c
+1-1sys/x86/include/ucode.h
+22-202 files

FreeBSD/src 451325csys/x86/x86 ucode.c

ucode: ucode_error can be defined with static

MFC after:      1 week

(cherry picked from commit 96256587b06cfcdbeb1789145f5e427831b3d732)
DeltaFile
+1-1sys/x86/x86/ucode.c
+1-11 files

FreeBSD/src 8909dd2sys/compat/linuxkpi/common/include/acpi video.h acpi_bus.h

linuxkpi: Add `acpi_video_get_edid()`

Like the rest of <acpi/video.h>, this function is unimplemented and
returns `-ENODEV`.

The amdgpu DRM driver started to use it in Linux 6.13.

Reviewed by:    bz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57576
DeltaFile
+10-0sys/compat/linuxkpi/common/include/acpi/video.h
+1-1sys/compat/linuxkpi/common/include/acpi/acpi_bus.h
+11-12 files

FreeBSD/src 9c7629dsys/dev/mlx5/mlx5_ib mlx5_ib_devx.c

mlx5ib: initialize DEVX subscription state before the eventfd fdget()

In the DEVX_SUBSCRIBE_EVENT handler the eventfd path can fail and
"goto err" before the subscription's xa keys and ev_file have been set;
they are still zeroed from kzalloc().  The cleanup then looks up a
level-1 xa entry with key 0, gets NULL, and faults dereferencing it.

Initialize the fields the cleanup path relies on right after the
subscription is allocated, before it is linked and before the fallible
fdget(), so a later failure unwinds cleanly.

Reviewed by: kib
Sponsored by: Nvidia networking
MFC after: 1 month
DeltaFile
+6-7sys/dev/mlx5/mlx5_ib/mlx5_ib_devx.c
+6-71 files

FreeBSD/src 9c6ed9atools/test/stress2/misc rename_exchange.sh pddupfd.sh

stress2: Added new test scenarios
DeltaFile
+162-0tools/test/stress2/misc/rename_exchange.sh
+132-0tools/test/stress2/misc/pddupfd.sh
+129-0tools/test/stress2/misc/nullfs33.sh
+84-0tools/test/stress2/misc/rename_exchange2.sh
+57-0tools/test/stress2/misc/rename17.sh
+28-0tools/test/stress2/misc/nullfs34.sh
+592-01 files not shown
+613-07 files

FreeBSD/src 2e21f7esys/dev/ena ena.c

ena: Put taskqueues into correct domain if !RSS

When compiled without 'options RSS', the ena driver created taskqueues
using taskqueue_start_threads_cpuset passing a mask value of NULL,
both in the ena_setup_tx_resources path (for enqueues) and in the
ena_create_io_queues path (for the completion-processing).

In the default configuration, on most EC2 instances, this results in
taskqueues running in the right NUMA domain, but only by accident; in
non-default configurations (e.g. with with multiple EBS volumes
attached and associated NVMe taskqueues) the taskqueues may land in
the wrong NUMA domain even on instance types where the one-EBS-one-ENA
case produces the desired results.

Set (struct ena_que)->domain and use that to inform the choice of CPU
sets.  On a c8gn.48xlarge EC2 instance this doubles throughput on a
32-TCP-stream benchmark.

Reviewed by:    akiyano

    [3 lines not shown]
DeltaFile
+11-1sys/dev/ena/ena.c
+11-11 files

FreeBSD/src 8ed5e67sys/net/route nhop_ctl.c

routing: Include <sys/eventhandler.h> in nhop_ctl.h

Fix missing Include which is currently leaked through vnet code.

Reported by: bz
Fixes: d05d1f256082 ("routing: Subscribe nhops to ifnet link events")
Differential Revision: https://reviews.freebsd.org/D57375
DeltaFile
+1-0sys/net/route/nhop_ctl.c
+1-01 files