FreeBSD/src 1d24638sys/kern uipc_usrreq.c, sys/sys ucred.h

Fix LOCAL_PEERCRED in 32-bit compat mode

Previously the cr_pid field would be incorrectly copied to userland, due
to a size mismatch between the structure as defined in 32-bit vs 64-bit
builds.  Fix it by converting the structure before copying it to
userland.

PR:             294833
Sponsored by:   ConnectWise
MFC after:      1 week
Reviewed by:    emaste
Differential Revision: https://reviews.freebsd.org/D56675
DeltaFile
+19-2sys/kern/uipc_usrreq.c
+11-0sys/sys/ucred.h
+30-22 files

FreeBSD/src 5dca0c8tests/sys/netinet socket_afinet.c

tests/socket_afinet: Remove a conditional skip

The test runs without any unexpected results when mac_portacl is loaded.

Approved by:    re (cperciva)
PR:             238781
MFC after:      1 week

(cherry picked from commit 9f6041fb579106aa6fa358071a14eddabd581998)
(cherry picked from commit ae6c11642b54f304490434ec5fe1eb2b470ff620)
DeltaFile
+0-3tests/sys/netinet/socket_afinet.c
+0-31 files

FreeBSD/src 87054cetests/sys/posixshm posixshm_test.c

tests/posixshm: Check for hardware support in largepage_pkru

Approved by:    re (cperciva)
MFC after:      3 days
Fixes:          ca87c0b8e396 ("pkru: Fix handling of 1GB largepage mappings")

(cherry picked from commit 75c66218401c00f4728d5312e2b933b8d3aefde1)
(cherry picked from commit 8988b4de4e3b85baa97fd76254e00da7d3304b35)
DeltaFile
+10-0tests/sys/posixshm/posixshm_test.c
+10-01 files

FreeBSD/src fdd8f30sys/fs/nullfs null_vnops.c, sys/kern vfs_inotify.c

nullfs: Clear inotify flags during reclaim

The inotify flags are copied from the lower vnode into the nullfs vnode
so that the INOTIFY() macro will invoke VOP_INOTIFY on the nullfs vnode;
this is then bypassed to the lower vnode.  However, when a nullfs vnode
is reclaimed we should clear these flags, as the vnode is now doomed and
no longer forwards VOPs to the lower vnode.

Add regression tests.  Remove a test in vn_inotify_revoke() which is no
longer needed after this change.

Approved by:    re (cperciva)
PR:             292495
Reviewed by:    kib
Reported by:    Jed Laundry <jlaundry at jlaundry.com>
Fixes:          f1f230439fa4 ("vfs: Initial revision of inotify")
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56639


    [2 lines not shown]
DeltaFile
+112-0tests/sys/kern/inotify_test.c
+12-0sys/fs/nullfs/null_vnops.c
+0-4sys/kern/vfs_inotify.c
+124-43 files

FreeBSD/src a096a97sys/kern uipc_socket.c

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

Approved by:    re (cperciva)
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)
(cherry picked from commit 43b1de5970d1246aa54d8e34b0f211511cc2b103)
DeltaFile
+1-1sys/kern/uipc_socket.c
+1-11 files

FreeBSD/src 88e12cctests/sys/netinet socket_afinet.c

tests/socket_afinet: Fix the bind_connected_port test

The test verifies that a socket can bind to a local address assigned by
connect(2) to a different socket.  It was however trying to bind to the
wrong address, and the check of the result was inverted, so this went
unnoticed.  It also needs to set SO_REUSEADDR for this to succeed.

Approved by:    re (cperciva)
Reported by:    glebius
MFC after:      1 week

(cherry picked from commit d3d0466cae546254c50c80cf3e0c060bbbbba53c)
(cherry picked from commit 9e8d7d83ecfbf8b34b785d7981a29dda567d0bc6)
DeltaFile
+7-7tests/sys/netinet/socket_afinet.c
+7-71 files

FreeBSD/src 38c5d60usr.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)

Approved by:    re (cperciva)
PR:             295052

    [4 lines not shown]
DeltaFile
+4-1usr.sbin/jail/config.c
+4-11 files

FreeBSD/src 13c70efusr.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.

Approved by:    re (cperciva)
Signed-off-by:  tickerguy <karl at denninger.net>
PR:             288426
Reviewed by:    pouria
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1863

(cherry picked from commit 103f9883d1ed7431c432caa6ab9c61cd4d0831d0)
(cherry picked from commit 18caefe847086a9e89812db600c852b225467090)
DeltaFile
+20-2usr.sbin/rtadvd/config.c
+20-21 files

FreeBSD/src cef90b4usr.sbin/certctl certctl.c certctl.8, usr.sbin/certctl/tests certctl_test.sh

certctl: Unstickify (un)trusted certificates

Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH.  Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

Approved by:    re (cperciva)
PR:             290078
MFC after:      1 week
Reviewed by:    kevans, bcr
Differential Revision:  https://reviews.freebsd.org/D56617

    [3 lines not shown]
DeltaFile
+52-29usr.sbin/certctl/certctl.c
+13-2usr.sbin/certctl/certctl.8
+2-1usr.sbin/certctl/tests/certctl_test.sh
+67-323 files

FreeBSD/src 9536a3asbin/md5/tests md5_test.sh

md5: Don't generate test cases just to skip them

Don't waste time generating Perl test cases for algorithms that are not
supported in Perl mode only to skip them when they are run.

Approved by:    re (cperciva)
MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56687

(cherry picked from commit fd386e76fa2b29d99525c246cbfc05768a1f4a76)
(cherry picked from commit f9626b7e55e11322ad45da2201cd482b43eeabb6)
DeltaFile
+6-6sbin/md5/tests/md5_test.sh
+6-61 files

FreeBSD/src 1981ce9contrib/libc-vis vis.3

vis.3: Try to better describe VIS_SAFE

The current text fails to draw the reader's attention to the fact that
VIS_SAFE essentially exempts certain characters from being encoded.

While here, fix some markup nits.

Approved by:    re (cperciva)
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D56716

(cherry picked from commit 8acc4c16c6635c3cd8871d0ee1221b62d48d71b9)
(cherry picked from commit b21f08f97ba0c1e254b55e2ac66ec6853ad281f7)
DeltaFile
+19-13contrib/libc-vis/vis.3
+19-131 files

FreeBSD/src 60a521ausr.bin/stat stat.c, usr.bin/stat/tests stat_test.sh

stat: fix use of devname(3)

Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Approved by:    re (cperciva)
Reviewed by:    des, kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D56565

(cherry picked from commit 4d4acdbfc22c84081037f31cff4fb03d18373036)

stat: The devname test case requires root


    [26 lines not shown]
DeltaFile
+38-2usr.bin/stat/tests/stat_test.sh
+11-3usr.bin/stat/stat.c
+49-52 files

FreeBSD/src 56a5d11share/man/man4 nlsysevent.4 Makefile

nlsysevent: add manpage

Approved by:    re (cperciva)
Reviewed by:    des

(cherry picked from commit 72d701eb1d83cfb3479e4c839412325ff9efc97c)
(cherry picked from commit ee2fc974e0716040622926c7c8ca8df09284e6f9)
DeltaFile
+132-0share/man/man4/nlsysevent.4
+1-0share/man/man4/Makefile
+133-02 files

FreeBSD/src 78c1ba5libexec/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

Approved by:    re (cperciva)
PR:             295062
Reported by:    Ross McKelvie <ross at exitzero.uk>
MFC After:      1 day

(cherry picked from commit c316ec259011e9e22e40eaa72d834f3bfac95c28)
(cherry picked from commit 4211f280ba087c75dcd84f9b592238b2eae33af9)
DeltaFile
+1-1libexec/nuageinit/nuageinit
+1-11 files

FreeBSD/src 8eef59dsys/vm vm_map.c

vm_map_growstack(): use local for p->p_vmspace

Noted by:       alc
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-2sys/vm/vm_map.c
+1-21 files

FreeBSD/src 18caefeusr.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

(cherry picked from commit 103f9883d1ed7431c432caa6ab9c61cd4d0831d0)
DeltaFile
+20-2usr.sbin/rtadvd/config.c
+20-21 files

FreeBSD/src 219c494contrib/libc-vis vis.3

vis.3: Try to better describe VIS_SAFE

The current text fails to draw the reader's attention to the fact that
VIS_SAFE essentially exempts certain characters from being encoded.

While here, fix some markup nits.

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

(cherry picked from commit 8acc4c16c6635c3cd8871d0ee1221b62d48d71b9)
DeltaFile
+19-13contrib/libc-vis/vis.3
+19-131 files

FreeBSD/src c65e233usr.sbin/certctl certctl.c certctl.8, usr.sbin/certctl/tests certctl_test.sh

certctl: Unstickify (un)trusted certificates

Ever since certctl was rewritten in C, the rehash command has reingested
TRUSTDESTDIR / UNTRUSTDESTDIR in addition to TRUSTPATH / UNTRUSTPATH.
This seemed like a good idea at the time but was, in retrospect, a
mistake, as it means a (un)trusted certificate remains (un)trusted
forever (or at least until it expires) even if it is removed from
(UN)TRUSTPATH.  Among other issues, it causes ports QA to fail for any
port that either installs certificates or depends on a port that does.

Although this behavior was undocumented, the change may surprise users
who have added certificates manually, so update the manual page to point
it out and add prominent warnings to the trust and untrust commands.

PR:             290078
MFC after:      1 week
Reviewed by:    kevans, bcr
Differential Revision:  https://reviews.freebsd.org/D56617

(cherry picked from commit 2fef18ff594328a771b6aa659e8ffa5a7e076540)
DeltaFile
+52-29usr.sbin/certctl/certctl.c
+13-2usr.sbin/certctl/certctl.8
+2-1usr.sbin/certctl/tests/certctl_test.sh
+67-323 files

FreeBSD/src b21f08fcontrib/libc-vis vis.3

vis.3: Try to better describe VIS_SAFE

The current text fails to draw the reader's attention to the fact that
VIS_SAFE essentially exempts certain characters from being encoded.

While here, fix some markup nits.

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

(cherry picked from commit 8acc4c16c6635c3cd8871d0ee1221b62d48d71b9)
DeltaFile
+19-13contrib/libc-vis/vis.3
+19-131 files

FreeBSD/src f9626b7sbin/md5/tests md5_test.sh

md5: Don't generate test cases just to skip them

Don't waste time generating Perl test cases for algorithms that are not
supported in Perl mode only to skip them when they are run.

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56687

(cherry picked from commit fd386e76fa2b29d99525c246cbfc05768a1f4a76)
DeltaFile
+6-6sbin/md5/tests/md5_test.sh
+6-61 files

FreeBSD/src 88f5520usr.bin/stat stat.c, usr.bin/stat/tests stat_test.sh

stat: fix use of devname(3)

Besides being a little hard to parse through visually, this had its own
bug of inspecting st->st_mode to determine what to pass to devname(3),
which is only correct for st_rdev.

For st_dev, you're likely to be looking at files or directories and
attempting to assess what device they're located on, so the mode is
meaningless- we just have to assume that our filesystems are on
character devices and attempt to resolve st_dev as such.

Reviewed by:    des, kib (previous version)
Differential Revision:  https://reviews.freebsd.org/D56565

(cherry picked from commit 4d4acdbfc22c84081037f31cff4fb03d18373036)

stat: The devname test case requires root

Fixes:          4d4acdbfc22c ("stat: fix use of devname(3)")

    [24 lines not shown]
DeltaFile
+38-2usr.bin/stat/tests/stat_test.sh
+11-3usr.bin/stat/stat.c
+49-52 files

FreeBSD/src 2c88636usr.bin/stat/tests stat_test.sh

stat: Expand devname test case

Test what happens when we ask for the rdev of a non-device.

MFC after:      1 week
Sponsored by:   Klara, Inc.
Reviewed by:    kevans
Differential Revision:  https://reviews.freebsd.org/D56838
DeltaFile
+2-0usr.bin/stat/tests/stat_test.sh
+2-01 files

FreeBSD/src e9912b7share/man/man4 smartpqi.4

smartpqi.4: Document runtime debug_level sysctl

Update smartpqi(4) to document the dev.smartpqi.<unit>.debug_level
sysctl for runtime debug level changes, and note that device
add/remove and controller event messages always appear in dmesg
regardless of the debug_level setting.

PR:             294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

Differential Revision:  https://reviews.freebsd.org/D56832
DeltaFile
+26-6share/man/man4/smartpqi.4
+26-61 files

FreeBSD/src 0d48d6dsys/dev/smartpqi smartpqi_discovery.c smartpqi_event.c

smartpqi: Add runtime sysctl for debug_level and log device state changes

The smartpqi driver did not log device add/remove or controller events
to syslog, and hw.smartpqi.debug_level could only be set at boot via
loader.conf with no runtime sysctl interface.

Add a read-write sysctl at dev.smartpqi.N.debug_level for runtime
debug level changes. Add device_printf calls for device addition,
removal, and controller events (hotplug, hardware, physical/logical
device, AIO state/config changes) so state changes always appear in
dmesg. Add DBG_DISC logging for discovery state transitions. Fix
spelling errors in strings and comments across the driver.

Bump driver version to 14.4691.1.2000 / 15.2.1.2000.

PR:             294161
Reviewed by:    imp
Approved by:    imp
MFC after:      2 weeks

    [2 lines not shown]
DeltaFile
+18-3sys/dev/smartpqi/smartpqi_discovery.c
+14-3sys/dev/smartpqi/smartpqi_event.c
+11-1sys/dev/smartpqi/smartpqi_main.c
+4-4sys/dev/smartpqi/smartpqi_defines.h
+3-3sys/dev/smartpqi/smartpqi_sis.c
+2-2sys/dev/smartpqi/smartpqi_structures.h
+52-165 files not shown
+62-2611 files

FreeBSD/src 944a4ebstand/libsa/zfs Makefile.inc

stand/libsa/zfs: disable ZSTD_TRACE and DYNAMIC_BMI2 code paths

Enabling ZSTD_TRACE leaves behind undefined weak symbols, which causes a
problem for gcc builds.  The bfd linker emits an obscure error about
overlapping FDEs.  We don't need ZSTD_TRACE for libsa, so just disable
it.

Also disable BMI2 instruction optimizations.  The addition of the
optional BMI2 code paths caused the boot loader binaries to grow larger
(28 KiB for clang, 32 KiB for gcc).  The boot loader binaries are size
constrained, and this pushed the gcc-generated lua_loader.bin over the
500000 byte limit, and the clang one to within 4k of the limit.

Fixes:  8a62a2a5659d ("zfs: merge openzfs/zfs at f8e5af53e")
Reviewed by:    delphij, imp, mm
Differential Revision:  https://reviews.freebsd.org/D56866
DeltaFile
+5-1stand/libsa/zfs/Makefile.inc
+5-11 files

FreeBSD/src 187de25usr.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

    [2 lines not shown]
DeltaFile
+4-1usr.sbin/jail/config.c
+4-11 files

FreeBSD/src c35bb8busr.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

    [2 lines not shown]
DeltaFile
+4-1usr.sbin/jail/config.c
+4-11 files

FreeBSD/src 123476asys/compat/linuxkpi/common/include/linux module.h

linuxkpi: Implement `module_*()` APIs as static functions

This fixes an "unused variable" warning when building DRM drivers.

Approved by:    re (cperciva)
Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56780

(cherry picked from commit 658bb99db9c7872f92ccb86ed2674c72636436d2)
(cherry picked from commit c81f516512111fa5ac8d5a9f3f7e64c2fb5ab5a3)
DeltaFile
+8-3sys/compat/linuxkpi/common/include/linux/module.h
+8-31 files

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

MFV: zstd 1.5.7.

Approved by:    re (cperciva)
MFC after:      2 weeks
Relnotes:       yes

(cherry picked from commit c0d9a07101a1e72769ee0619a583f63a078fb391)
(cherry picked from commit 7c9418613a31571e4eceda55a417f7183d26acb5)
(cherry picked from commit 111a42d7d78a88ba6ff7b5d61b0867faccc00276)
(cherry picked from commit ff426ceef657d7c478471e631349c5d1a8b96453)
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 ed0ef03sys/conf ldscript.arm64

arm64: Define the .iplt section placement.

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

Approved by:    re (cperciva)
Reviewed by:    andrew
Differential Revision: https://reviews.freebsd.org/D56403

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