FreeBSD/src ff426cesys/contrib/zstd/doc zstd_manual.html zstd_compression_format.md, sys/contrib/zstd/doc/educational_decoder zstd_decompress.c

MFV: zstd 1.5.7.

MFC after:      2 weeks
Relnotes:       yes

(cherry picked from commit c0d9a07101a1e72769ee0619a583f63a078fb391)
(cherry picked from commit 7c9418613a31571e4eceda55a417f7183d26acb5)
(cherry picked from commit 111a42d7d78a88ba6ff7b5d61b0867faccc00276)
DeltaFile
+2,416-1,011sys/contrib/zstd/lib/common/xxhash.h
+2,413-897sys/contrib/zstd/lib/compress/zstd_compress.c
+0-2,320sys/contrib/zstd/doc/educational_decoder/zstd_decompress.c
+0-1,908sys/contrib/zstd/doc/zstd_manual.html
+1,063-820sys/contrib/zstd/programs/fileio.c
+0-1,692sys/contrib/zstd/doc/zstd_compression_format.md
+5,892-8,648185 files not shown
+18,051-23,812191 files

FreeBSD/src 5169e95sys/conf ldscript.arm64

arm64: Define the .iplt section placement.

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

Reviewed by:    andrew
Differential Revision: https://reviews.freebsd.org/D56403

(cherry picked from commit 1dddb580f950a27fb9859b2879755dde114c9d8b)
DeltaFile
+6-1sys/conf/ldscript.arm64
+6-11 files

FreeBSD/src 40d59eesys/fs/p9fs p9fs_vnops.c p9fs_subr.c

p9fs: Fix creating files with restrictive permissions

When a file is created via p9fs with restrictive permissions (like 000),
the 9P TCREATE request successfully creates and natively opens the file,
returning an open, writable file descriptor. Previously, p9fs would
attempt a subsequent TOPEN. That TOPEN would fail with EACCES due to the
restrictive mode, leaving a 0-byte file and causing operations like 'mv'
to abort.

We now preserve the writable descriptor returned by TCREATE so that the
subsequent VOP_OPEN can use it directly, avoiding the failing TOPEN.
Additionally, p9fs_compatible_mode now appropriately isolates the base
access intent when matching fids, preventing extended flags from
breaking the match.

A test case for this behavior has been submitted to pjdfstest:
https://github.com/pjd/pjdfstest/pull/87

Resolves: https://github.com/CTSRD-CHERI/cheribsd/issues/2617

    [4 lines not shown]
DeltaFile
+23-1sys/fs/p9fs/p9fs_vnops.c
+9-5sys/fs/p9fs/p9fs_subr.c
+32-62 files

FreeBSD/src 96b2f4asys/fs/p9fs p9fs_vnops.c p9fs.h

p9fs: implement basic pathconf support

This is needed for various pjdfstest tests which fail with syntax errors
if pathconf _PC_NAME_MAX/_PC_PATH_MAX return -1. For NAME_MAX we can use
the 9P2000.L Tstatfs call to get namelen from the host. While this could
theoretically be different for nested filesystems in the shared mount it
is a much better guess than just returning 255.
There does not seem to be a way to get the host PATH_MAX, so we just
return the conservative kernel default.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:    markj, kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56493
DeltaFile
+71-2sys/fs/p9fs/p9fs_vnops.c
+1-0sys/fs/p9fs/p9fs.h
+72-22 files

FreeBSD/src 1ed2ef4sys/dev/virtio/p9fs virtio_p9fs.c, sys/fs/p9fs p9fs_vfsops.c

p9fs: Move UMA zone initialization to VFS module lifecycle

Previously, the UMA zones required for 9P requests (p9fs_buf_zone,
p9fs_req_zone, etc.) were initialized and destroyed in the
virtio_p9fs transport module. This caused issues when unloading
the core p9fs module.

This change moves p9_init_zones() and p9_destroy_zones() into
p9fs_init() and p9fs_uninit() inside p9fs_vfsops.c so that they
are correctly bound to the VFS filesystem module lifecycle via
vfs_modevent, aligning p9fs with standard FreeBSD VFS semantics.

Found while fixing https://github.com/CTSRD-CHERI/cheribsd/issues/2617.

Reviewed by:    kib
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56492
DeltaFile
+4-0sys/fs/p9fs/p9fs_vfsops.c
+1-2sys/dev/virtio/p9fs/virtio_p9fs.c
+5-22 files

FreeBSD/src 3fe5069sys/dev/virtio/p9fs virtio_p9fs.c

virtio_p9fs: Fix kernel panic on module unload

The virtio_p9fs module event handler can be invoked multiple times.
Previously, this caused p9_init_zones() and p9_register_trans() to be
executed multiple times, leaking UMA zones and corrupting the transport
list. During module unload, p9_destroy_zones() was also called multiple
times on the same zone pointers, triggering a duplicate free kernel panic
in uma_zdestroy().

This patch introduces a static reference counter in vt9p_modevent() to
ensure the zones and transports are only initialized and destroyed exactly
once, aligning with the approach used by other virtio drivers like vtnet.

Reviewed by:    kib, markj
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D56497
DeltaFile
+9-3sys/dev/virtio/p9fs/virtio_p9fs.c
+9-31 files

FreeBSD/src 3daa43bsys/sys rtprio.h priority.h, tools/build/test-includes badfiles.inc

sys: Make priority.h and rtprio.h include all dependencies

This ensures this header can be included without an explicit or implicit
sys/types.h include first. This causes issues building SPEC2017 which
includes sys/rtprio.h and then we get an error due to missing u_char
definition.

Reviewed by:    emaste
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52041
DeltaFile
+5-4sys/sys/rtprio.h
+4-4sys/sys/priority.h
+0-2tools/build/test-includes/badfiles.inc
+9-103 files

FreeBSD/src 423b0bccontrib/less less.nro screen.c

MFV less v691

Relnotes:       yes

(cherry picked from commit dafba19e42e78cd3d7c9264ece49ddd3d7d70da5)

MFV: less v692.

(cherry picked from commit e2abec625bf07c054f7ac2df2402d6c454113df8)
DeltaFile
+1,017-476contrib/less/less.nro
+374-153contrib/less/screen.c
+245-144contrib/less/lesskey.nro
+107-51contrib/less/mark.c
+70-68contrib/less/option.c
+81-57contrib/less/cmdbuf.c
+1,894-94958 files not shown
+2,855-1,45464 files

FreeBSD/src 5868387sys/kern sys_process.c

Remove PROC_CHECK_PRIV macro from sys_process.c

Just put the priv_check calls in the code.

Reviewed by:    kib
Differential Revision:  https://reviews.freebsd.org/D56864
DeltaFile
+40-19sys/kern/sys_process.c
+40-191 files

FreeBSD/src 09d8176share/man/man7 freebsd-base.7

freebsd-base.7: style
DeltaFile
+3-2share/man/man7/freebsd-base.7
+3-21 files

FreeBSD/src b2e4da0sbin/devd devd.cc

devd: Use PF_LOCAL instead of PF_INET

Avoid dependency on INET (IPv4) by using PF_LOCAL,
allowing media check to work on systems without INET support.

PR:             295045
Reviewed by:    kevans
MFC after:      1 week
DeltaFile
+1-1sbin/devd/devd.cc
+1-11 files

FreeBSD/src 58811b0usr.sbin/jail config.c

jail: open the fstab files with fopen("re")

This protects against accidentally leaking them past fork()+exec()
in future refactorings.

PR:             295052
Reviewed by:    kevans
DeltaFile
+1-1usr.sbin/jail/config.c
+1-11 files

FreeBSD/src 276d9b8usr.sbin/jail config.c

jail: avoid leaking jail config fds to exec.* hooks

The jail(8) command must not leave parsed configuration files open
since the file descriptors will be leaked to child processes
including the untrusted exec.start or exec.stop hooks.

While fopen() doesn't provide direct access to O_CLOEXEC, it does
provide access to FD_CLOEXEC via "e" in the mode string which
provides the desired defense in depth against leaking file descriptors
into exec.* hooks since those always execve() into a shell.

Jail configuration is potentially sensitive and some hooks execute from
within the jail context, leaving some opening for the jail to exfiltrate
information about the host environment.

(Commit message wordsmithed by kevans)

PR:             295052
Reviewed by:    kevans
MFC after:      3 days
DeltaFile
+4-1usr.sbin/jail/config.c
+4-11 files

FreeBSD/src 3348fa7tests/sys/netinet6/frag6 frag6_19.sh

Revert "Skip sys.netinet6.frag6.frag6_19.frag6_19 in CI"

Per [siva@'s comment on the PR][1], this testcase now passes cleanly in CI.

PR:     274941
MFC after:      1 week

[1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274941#c6

This reverts commit 86e87c3bd1b377242aafe7e2222ae17ca0be96d9.
DeltaFile
+0-3tests/sys/netinet6/frag6/frag6_19.sh
+0-31 files

FreeBSD/src efa8679sys/contrib/openzfs/config kernel-dentry-alias.m4, sys/contrib/openzfs/lib/libzfs libzfs_mnttab.c

zfs: merge openzfs/zfs at a12c6ed62

Notable upstream pull request merges:
 #18473 b8d959640 Fix rare cksum errors after rebuild
 #18477 e78a51dd6 Fix off-by-one in PREVIOUSLY_REDACTED handler that drops
                  last block
 #18482 d5099c330 Initialize vr_last_txg for rebuild
 #18483 872f01019 Zstd: rework ZSTD_isError symbol renaming
 #18489 366b1f9a3 Fix long POSIX_FADV_DONTNEED for single block files

Obtained from:  OpenZFS
OpenZFS commit: a12c6ed62fcd06093b95616515e4716b0b0bc038
DeltaFile
+118-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/redacted_send/redacted_max_blkid.ksh
+107-0sys/contrib/openzfs/tests/zfs-tests/cmd/libzfs_mnttab_cache_check.c
+45-25sys/contrib/openzfs/lib/libzfs/libzfs_mnttab.c
+32-0sys/contrib/openzfs/config/kernel-dentry-alias.m4
+26-0sys/contrib/openzfs/tests/zfs-tests/tests/functional/libzfs/libzfs_mnttab_cache.ksh
+16-3sys/contrib/openzfs/module/os/linux/zfs/zfs_ctldir.c
+344-2841 files not shown
+522-10747 files

FreeBSD/src 18626fatests/sys/netinet6/frag6 frag6_07.sh

Unskip test sys.netinet6.frag6.frag6_07.frag6_07

This is now consistently passing with 100+ consecutive runs.

Signed-off-by: Siva Mahadevan <me at svmhdvn.name>
PR:             244170
MFC after:      3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 681e9d3e391f30a512c523514f69a63c9782a901)
DeltaFile
+0-3tests/sys/netinet6/frag6/frag6_07.sh
+0-31 files

FreeBSD/src 1c4f255tests/sys/net if_lagg_test.sh

tests/if_lagg_test: unskip 'witness' testcase

This testcase passes consistently (in 100+ runs) now.

Signed-off-by:  Siva Mahadevan <me at svmhdvn.name>
PR:             244163, 251726
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 7a83fedc116d827cc9c6d8e049b785f1d7b68dcd)
DeltaFile
+0-3tests/sys/net/if_lagg_test.sh
+0-31 files

FreeBSD/src c4af3f1share/man/man7 freebsd-base.7

freebsd-base.7: Document adding a local repo

MFC after:              1 day
Discussed with:         bcr, ivy, kevans, ngie
Differential Revision:  https://reviews.freebsd.org/D56608
DeltaFile
+22-1share/man/man7/freebsd-base.7
+22-11 files

FreeBSD/src 2a86992libexec/nuageinit/tests nuageinit.sh

nuageninit: modify the test to show the issue fixed inc316ec259011

Ensure the script used is invalid when parsed by libyaml which
highlight the issue revealed in PR295062

while at here validate the mode of the file is properly changed

PR:             295062
MFC After:      1 day
DeltaFile
+5-3libexec/nuageinit/tests/nuageinit.sh
+5-31 files

FreeBSD/src 5df7daesys/kern subr_kobj.c

kobj: Use M_WAITOK in kobj_init

Blocking allocation is safe in all of the current callers of kobj_init
(most of them do a M_WAITOK malloc of the structure passed as the
first argument to kobj_init just before calling it).  kobj_init
doesn't return an error code but instead panics if the nested malloc
in kobj_class_compile1 fails, so using M_WAITOK here is more robust.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D56625
DeltaFile
+1-1sys/kern/subr_kobj.c
+1-11 files

FreeBSD/src 5a6e595sys/kern subr_kobj.c

kobj: Assert class passed to kobj_init_static is compiled

Inspired by discussion in
https://github.com/freebsd/freebsd-src/pull/2016

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D56624
DeltaFile
+2-0sys/kern/subr_kobj.c
+2-01 files

FreeBSD/src bf636acsys/dev/mlx5/mlx5_en mlx5_en_hw_tls_rx.c

mlx5en: destroy TIR before DEK during TLS RX teardown

Reorder the TLS RX teardown sequence so the TIR is destroyed before
the DEK.  DESTROY_TIR for a TLS-enabled TIR issues a TRA RX fence
that drains all in-flight packets from the crypto pipeline.  If the
DEK is destroyed first, packets still in flight hit a TPT encryption
error (vendor syndrome 0x55) because the key they reference is
already gone.

Reviewed by:    kib
Sponsored by:   Nvidia networking
MFC after:      1 week
DeltaFile
+11-4sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls_rx.c
+11-41 files

FreeBSD/src c316ec2libexec/nuageinit nuageinit

nuageinit: only parse user_data as yaml when necessary

This fixes a regression introduced in cae280931c9e which prevents
user_data as a shell script to be used

PR:             295062
Reported by:    Ross McKelvie <ross at exitzero.uk>
MFC After:      1 day
DeltaFile
+1-1libexec/nuageinit/nuageinit
+1-11 files

FreeBSD/src 84a9574share/man/man9 cdefs.9, sys/compat/linuxkpi/common/include/linux compiler_attributes.h

sys/cdefs.h: Introduce __maybe_unused attribute

The __maybe_unused attribute should be used for variables which may or
may not be used, such as when their only use is in an assertion. This
attribute is functionally identical to __unused, suppressing compiler
warnings for particular variable if it remains unused.

Reviewed by:    Minsoo Choo <minsoo at minsoo.io>, imp
Differential Revision:  https://reviews.freebsd.org/D56517
DeltaFile
+4-2share/man/man9/cdefs.9
+1-0sys/sys/cdefs.h
+0-1sys/compat/linuxkpi/common/include/linux/compiler_attributes.h
+5-33 files

FreeBSD/src 103f988usr.sbin/rtadvd config.c

rtadvd(8): Honor pltime/vltime in interface declarations

Currently rtadvd ignores interface pltime/vltime specifications
unless the (static) address range is also included in the config file.
This extends the validity of a pltime and/or vltime stanza in
the config file for an interface to delegated addresses from
an upstream provider.

Signed-off-by:  tickerguy <karl at denninger.net>
PR:             288426
Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1863
DeltaFile
+20-2usr.sbin/rtadvd/config.c
+20-21 files

FreeBSD/src 76d756erelease Makefile.vm

Makefile.vm: Split error condition

Make it clear which of two possible cases applies.

Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D56837
DeltaFile
+4-3release/Makefile.vm
+4-31 files

FreeBSD/src bc9f667usr.sbin/bhyve pci_virtio_scsi.c

bhyve/virtio-scsi: Don't invoke iov_to_buf() in an assert() expression

If anyone would build bhyve with -DNDEBUG, any code in the expression
in assert() won't be executed.  Instead put the return value in a
temporary variable to assert that it has the expected value.

Reviewed by: emaste, markj (earlier version)
Fixes: 2a514d377b37 ("bhyve/virtio-scsi: Preallocate all I/O requests")
Differential Revision: https://reviews.freebsd.org/D55803
DeltaFile
+4-2usr.sbin/bhyve/pci_virtio_scsi.c
+4-21 files

FreeBSD/src a12c6edtests/test-runner/bin zts-report.py.in

ZTS: Remove threadsappend_001_pos exception

Commit f828a80c may have resolved the underlying cause for
the occasional CI failures observed for this test.  Remove
the exception to ensure any new occurrences are noticed.

Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs at mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6136
Closes #18495
DeltaFile
+0-1tests/test-runner/bin/zts-report.py.in
+0-11 files

FreeBSD/src 872f010module/zstd/include zstd_compat_wrapper.h, module/zstd/lib/common zstd_common.c

Zstd: rework ZSTD_isError symbol renaming

The import of Zstd v1.5.7 in a2ac9cd606ce2428c23cc89cec6f0392424e82c9
added an unconditional renaming of ZSTD_isError to zfs_ZSTD_isError
with an asm directive.  Instead, do it with a define that is conditioned
on whether zstd_compat_wrapper.h is actually in use.  Also add a define
to that header so that it can be detected.  This allows the build to
work without using the compat wrapper.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ryan Libby <rlibby at FreeBSD.org>
Closes #18483
DeltaFile
+6-2module/zstd/lib/common/zstd_common.c
+2-0module/zstd/include/zstd_compat_wrapper.h
+8-22 files

FreeBSD/src ae37f05module/os/linux/zfs zpl_file.c zfs_vfsops.c

linux: verify stale znodes in legacy fallocate

The mode=0 and FALLOC_FL_KEEP_SIZE preallocation path can reach
zfs_freesp() directly and call zfs_statvfs() before going through the
normal zpl_enter_verify_zp() boundary.

When zfs_rezget() tears down a failed SA reload, a stale inode may
remain alive in the VFS with z_sa_hdl cleared. The unchecked
fallocate path can then reach sa_lookup(zp->z_sa_hdl, ...) through
zfs_statvfs() or zfs_freesp() and crash on a NULL SA handle.

Use zfs_enter_verify_zp() in zfs_statvfs() so stale znodes are
rejected under the teardown lock for both fallocate and statfs.
Also wrap the direct zfs_freesp() call in
zpl_enter_verify_zp()/zfs_exit() so this path follows the same
validation rules as the other Linux ZPL file operations.

Fixes: f734301d2267
("linux: add basic fallocate(mode=0/2) compatibility")

    [4 lines not shown]
DeltaFile
+12-4module/os/linux/zfs/zpl_file.c
+2-3module/os/linux/zfs/zfs_vfsops.c
+14-72 files