FreeBSD/src b440741tools/test/stress2/misc msdos12.sh

tools/test/stress2/misc/msdos12.sh: fix permission issue

This test runs with rights of an un-privileged user writing to a file
system only writable by the owner. Since no UID was provided in the
mount command, the owner of the file system was "root", and thus
writing was not allowed for $testuser. Fix this issue by mounting
with "-u $testuser".

MFC after:      3 days
DeltaFile
+1-1tools/test/stress2/misc/msdos12.sh
+1-11 files

FreeBSD/src 92ae21esys/arm64/arm64 freebsd32_machdep.c

sys/arm64: fix return values of freebsd32_{set,swap}context()

This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.

In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.

Tested by:      fuz
MFC after:      1 week
DeltaFile
+2-2sys/arm64/arm64/freebsd32_machdep.c
+2-21 files

FreeBSD/src 3260c42tools/test/stress2/misc all.exclude

tools/test/stress2/misc/all.exclude: remove msdos24.sh

Remove test for UFC-16 surrogate pairs in file names from this exclude
list, since kernel support has been committed and the test can be now
expected to succeed.

MFC after:      3 days
DeltaFile
+0-1tools/test/stress2/misc/all.exclude
+0-11 files

FreeBSD/src 596dadbtools/test/stress2/misc msdos24.sh

tools/test/stress2/misc/msdos24.sh: improve surrogate pair test

Instead of varying only the low surrogate do also randomly choose a
suitable high surrogate.

MFC after:      3 days
DeltaFile
+10-2tools/test/stress2/misc/msdos24.sh
+10-21 files

FreeBSD/src 6e5b990tools/test/stress2/misc all.debug.inc

tools/test/stress2/misc/all.debug.inc: skip undefined variables

On my ZFS based systems, no allocations occur with tags "newblk" or
"freework". This leads to errors executing the tests that check for
memory leaks. Skip the checks if the output of wmstat -m does not
contain lines corresponding to those allocations.

MFC after:      3 days
DeltaFile
+4-2tools/test/stress2/misc/all.debug.inc
+4-21 files

FreeBSD/src de639dcsys/net/route route_ctl.c nhgrp_ctl.c

routing: Enable hash_outbound during nhgrp allocation

Multipath routes can be added via both RTM_F_CREATE and RTM_F_APPEND.
Therefore, it's possible to have mpath routes without calling
add_route_flags_mpath.

Instead of checking V_fib_hash_outbound for every route append,
check it during nhgrp_ctl initialization, which is only called for
the first multipath request per rib_head.

PR:             293136
Reviewed by:    glebius
Tested by:      Marek Zarychta <zarychtam at plan-b.pwste.edu.pl>
Differential Revision:  https://reviews.freebsd.org/D57469
DeltaFile
+1-14sys/net/route/route_ctl.c
+6-0sys/net/route/nhgrp_ctl.c
+7-142 files

FreeBSD/src 93a234ausr.sbin/virtual_oss/virtual_oss main.c int.h

virtual_oss(8): Make sndstat FD global

There is no reason to have per-profile copies, plus this way we open
/dev/sndstat multiple times if more than 1 profile is created.

Also close the FD on exit to avoid leaking.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
DeltaFile
+9-7usr.sbin/virtual_oss/virtual_oss/main.c
+0-1usr.sbin/virtual_oss/virtual_oss/int.h
+9-82 files

FreeBSD/src 0bd5ef6usr.sbin/virtual_oss/virtual_oss main.c int.h

virtual_oss(8): Properly cleanup cuse(3)

virtual_oss(8) does not currently keep track of the cuse(3) it creates,
nor does it destroy any of them on exit, except for the control device.
This is harmless if virtual_oss(8) is killed after all audio streams
have been shut down, but if it's killed during I/O, the process hangs
and/or goes into uninterruptible sleep state.

To fix this, have pointers to all cuse(3) devices, and explicitly
destroy them on exit. Also make sure we don't leak memory in
dup_profile().

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    jrm
Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/41
DeltaFile
+35-4usr.sbin/virtual_oss/virtual_oss/main.c
+2-0usr.sbin/virtual_oss/virtual_oss/int.h
+37-42 files

FreeBSD/src 0d644b4usr.bin/renice renice.c, usr.bin/renice/tests renice_test.sh

Revert "improve renice user error messages"

This reverts commit 925f53682469ea12c017b48114b16e8f1627fb0b. The tests are wrong,
so I'm reverting and reopening the pull request.
DeltaFile
+0-57usr.bin/renice/tests/renice_test.sh
+4-27usr.bin/renice/renice.c
+4-842 files

FreeBSD/src ca66129crypto/openssl/apps testrsa.h, crypto/openssl/crypto/cast cast_s.h

openssl: update to 3.0.21

This change is a security release which resolves several issues with OpenSSL 3.0,
the highest severity issue being ranked "High". Users are strongly encouraged to
update to this release.

More information about the release (from a high level) can be found in
the release notes [1].

Tested with:    (make tinderbox; spotchecks on dev hosts)

1. https://github.com/openssl/openssl/blob/openssl-3.0.21/NEWS.md

- :main and :stable/15 run OpenSSL 3.5 and :stable/14, et al runs
  OpenSSL 3.0.
- This is not a merge commit because our pre-receive checkers still
  don't allow direct MFVs without going through :main first.
- This is a direct commit to stable/14.
DeltaFile
+449-4,467crypto/openssl/apps/testrsa.h
+284-2,821crypto/openssl/test/pkcs12_format_test.c
+224-2,214crypto/openssl/test/evp_extra_test2.c
+257-2,049crypto/openssl/crypto/cast/cast_s.h
+248-1,965crypto/openssl/fuzz/server.c
+129-1,793crypto/openssl/test/siphash_internal_test.c
+1,591-15,309913 files not shown
+5,374-22,558919 files

FreeBSD/src 14e93e3sys/dev/mxge if_mxge.c

mxge(4): Fix a typo in a source code comment

- s/deterimine/determine/

MFC after:      3 days
DeltaFile
+1-1sys/dev/mxge/if_mxge.c
+1-11 files

FreeBSD/src 9d10b4dusr.bin/xinstall xinstall.c install.1

install: drop obsolete file size limit for -C

Removes the file size limit for -C comparisons. The limit was
meant to prevent oversized mmap allocations, which is no longer
relevant as mmap is no longer used here (removed by
a0439a1b820fa0e742c00d095f5f5c06f5f19432, review D44809).
Credit to bdrewery.
See: https://reviews.freebsd.org/D57230

Reviewed by:    bdrewery, glebius, ziaee
Approved by:    glebius (mentor)
Obtained from:  Fudo Security
MFC after:      2 weeks
Sponsored by:   Fudo Security
Differential Revision:  https://reviews.freebsd.org/D57503
DeltaFile
+45-60usr.bin/xinstall/xinstall.c
+2-11usr.bin/xinstall/install.1
+1-1usr.bin/xinstall/Makefile
+48-723 files

FreeBSD/src 64b053ftests/sys/posixshm memfd_test.c

memfd_test: skip hugetlb testcase when large page requests are not supported

Fixes this CI test failure: https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16606/testReport/junit/sys.posixshm/memfd_test/hugetlb/

Reviewed by:    kevans
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57289
DeltaFile
+5-2tests/sys/posixshm/memfd_test.c
+5-21 files

FreeBSD/src b61ab2dshare/man/man5 src.conf.5, share/mk src.opts.mk

src.opts.mk: enable OPENSSL_KTLS by default on riscv64

1e649491b8567151270095fda3bce8faea394952 enabled KERN_TLS in
riscv/conf/GENERIC, but didn't enable OPENSSL_KTLS.

This passes all testcases in the sys/kern/ssl_sendfile suite and
fixes CI failures seen here:
https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16606/testReport/sys.kern/ssl_sendfile/

PR:     293810
Fixes:  1e649491b8567151270095fda3bce8faea394952
MFC after:      3 days
Reviewed by:    gallatin, ngie
Differential Revision:  https://reviews.freebsd.org/D57316
DeltaFile
+3-3share/man/man5/src.conf.5
+2-2share/mk/src.opts.mk
+5-52 files

FreeBSD/src 1e25cdalib/libc/riscv gd_qnan.h

libc: fix strtold NaN representation on riscv

Regenerate gd_qnan.h on riscv using the qnan.c
config tool found in contrib/gdtoa.

This fixes the following tests in CI:
lib/libc/stdio/scanfloat_test:infinities_and_nans
lib/libc/stdlib/strtod_test:strtold_nan

Reviewed by:    jrtc27
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57405
DeltaFile
+3-3lib/libc/riscv/gd_qnan.h
+3-31 files

FreeBSD/src 9f2a38clib/libc/tests/secure fortify_uio_test.c generate-fortify-tests.lua

libc/fortify_uio_test: replace stdin in base readv tests

This fixes the readv_before_end and preadv_before_end test
timeout failures on riscv.

See https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/lastCompletedBuild/testReport/lib.libc.secure/fortify_uio_test/readv_before_end/

Reviewed by:    kevans, emaste
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57420
DeltaFile
+18-0lib/libc/tests/secure/fortify_uio_test.c
+2-0lib/libc/tests/secure/generate-fortify-tests.lua
+20-02 files

FreeBSD/src 432ac5csys/netpfil/pf pf.c

pf: free match rules after exiting critical section

This fixes a panic reported on armv7:

sys/netpfil/pf/counters:match_block  ->  panic: free: called with spinlock or critical section held
[...]
vpanic() at vpanic
         pc = 0xc0321b5c  lr = 0xc02f7b5c (free+0x140)
         sp = 0xc8c858bc  fp = 0xc8c858e0
         r4 = 0xe2fad648  r5 = 0xe402ce78
         r6 = 0xc8c859e8  r7 = 0x0000001c
         r8 = 0xc8c858b4  r9 = 0xc0321b5c
        r10 = 0xc8c858bc
free() at free+0x140
         pc = 0xc02f7b5c  lr = 0xe2f4f920 ($a+0x5f8)
         sp = 0xc8c858e8  fp = 0xc8c85930
         r4 = 0xe402ce68  r5 = 0xc8c8599c
         r6 = 0xffffffff r10 = 0x0000001c
[...]

    [8 lines not shown]
DeltaFile
+4-4sys/netpfil/pf/pf.c
+4-41 files

FreeBSD/src 331613dsys/kern kern_fail.c

Pause failpoint: replace mtx_sleep with tsleep

Eliminate panic when re-setting a paused failpoint to pause
(address of feq_mtx changes whilst in mtx_sleep, triggering
assertion when reacquiring mtx).

Reviewed by:    rlibby
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2267
DeltaFile
+3-8sys/kern/kern_fail.c
+3-81 files

FreeBSD/src 75a94aeusr.sbin/inetd inetd.8 inetd.c

inetd: Add missing argument to the -p flag description

While here, use the more specific "pidfile" consistently instead of
ambiguous "filename".

Reviewed by:    ziaee
MFC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57531
DeltaFile
+3-3usr.sbin/inetd/inetd.8
+1-1usr.sbin/inetd/inetd.c
+4-42 files

FreeBSD/src 48d20fdinclude assert.h

libc: Fix assert() sanitiser for C++ contextual bool conversion

Replace the `(bool(*)(bool))` probe in `__assert_sanitize()` with an unevaluated
conditional expression, so types with `explicit operator bool()` that require a
contextually converted constant expression of type `bool` are handled correctly.

Ergo, arity check is now performed separately via `__assert_sanitize_arity()`, a
unary template whose parameter pack must bind to exactly on argument after
`__VA_ARGS__` is substituted into the call.

Also align NDEBUG with C23 requirements.

Reported by:    dim, aokblast
Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    aokblast, fuz
MFC after:      1 week
Fixes:          867b51452ea78ece0b312a387e63fdbc2a11056a
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2265
DeltaFile
+9-29include/assert.h
+9-291 files

FreeBSD/src 694baf8include stdalign.h

libc: Suppress <stdalign.h> content for C23 and later

C23 deprecates <stdalign.h> and specifies that the header shall
provide no content (§7.15.1).

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2223
MFC after:      1 month
Reviewed by:    imp, fuz
DeltaFile
+4-0include/stdalign.h
+4-01 files

FreeBSD/src 6365c45sys/sys elf_common.h

elf_common: Add FDO package metadata note type

Reviewed by:    fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57525
DeltaFile
+3-0sys/sys/elf_common.h
+3-01 files

FreeBSD/src 0881f6csecure/lib/libcrypto/man/man3 BIO_s_bio.3 d2i_X509.3, sys/crypto/openssl/powerpc chachap10-ppc.S

crypto/openssl: update artifacts to match 3.5.7 release

MFC after:      3 days
MFC with:       1523ccfd9
DeltaFile
+85-3secure/lib/libcrypto/man/man3/BIO_s_bio.3
+46-4sys/crypto/openssl/powerpc64/chachap10-ppc.S
+46-4sys/crypto/openssl/powerpc/chachap10-ppc.S
+46-4sys/crypto/openssl/powerpc64le/chachap10-ppc.S
+24-16secure/lib/libcrypto/man/man3/d2i_X509.3
+19-10secure/lib/libcrypto/man/man3/SSL_CTX_set_session_id_context.3
+266-41901 files not shown
+1,274-996907 files

FreeBSD/src 1523ccfcrypto/openssl/apps testrsa.h, crypto/openssl/crypto/cast cast_s.h

MFV: openssl 3.5.7

This change is a security release which resolves several issues with OpenSSL 3.5,
the highest severity issue being ranked "High". Users are strongly encouraged to
update to this release.

More information about the release (from a high level) can be found in
the release notes [1].

1. https://github.com/openssl/openssl/blob/openssl-3.5.7/NEWS.md

All conflicts were resolved with `--theirs`, taking the release diff
over the local diff; the conflicts occurred due to preemptive security
fixes applied by so@ in e508c343.

MFC after:      3 days (the important security issues have been
preemptively addressed)
Merge commit '3a71a35ad9dad0e5d2cad8efecc8ba9d57c42d43'


    [6 lines not shown]
DeltaFile
+854-8,335crypto/openssl/test/quic_record_test.c
+449-4,467crypto/openssl/apps/testrsa.h
+380-3,027crypto/openssl/fuzz/dtlsserver.c
+284-2,821crypto/openssl/test/pkcs12_format_test.c
+224-2,214crypto/openssl/test/evp_extra_test2.c
+257-2,049crypto/openssl/crypto/cast/cast_s.h
+2,448-22,913196 files not shown
+7,603-35,267202 files

FreeBSD/src 4bdcff5sys/powerpc/booke machdep_e500.c, sys/powerpc/include spr.h

powerpc/booke: Add watchdog driver

The Book-E watchdog is effectively a state machine based around an AND
mask of the timebase register.  A single bit (0-63) is watched in the
timebase register, and when it transitions (by counting *or* by
programmatically setting) an exception is triggered.  The first
exception triggers a core interrupt.  The second is programmable.
In our case, we panic on the first and reset on second.
DeltaFile
+71-0sys/powerpc/booke/machdep_e500.c
+3-0sys/powerpc/include/spr.h
+74-02 files

FreeBSD/src d08cb1dsys/dev/watchdog watchdog.c

watchdog: Fix a couple type issues

* Force the type of the literal `1` passed to nstosbt() to ensure it's a
  64-bit type (or larger).  Otherwise it gets inconveniently typed to
  int, resulting in truncation.
* Use `flsll()` when converting sbt to power-of-2-nanoseconds to fix
  32-bit compatibility.

PR:             292616
Obtained from:  Hewlett Packard Enterprise
Fixes:  26d6617f3 ("watchdog: Convert to using sbintime_t format")
MFC after:      3 days
DeltaFile
+2-2sys/dev/watchdog/watchdog.c
+2-21 files

FreeBSD/src 4d8fde8usr.sbin/ppp fsm.c

ppp: Reject FSM messages whose length is smaller than the message header

PR:             271843
Reported by:    Robert Morris <rtm at lcs.mit.edu>
Reviewed by:    des, emaste
Differential Revision:  https://reviews.freebsd.org/D57139
DeltaFile
+6-0usr.sbin/ppp/fsm.c
+6-01 files

FreeBSD/src 7e97189usr.sbin/ppp chap.c chap.h

ppp: Permit CHAP challenges up to 255 bytes

RFC 1994 does not place any limit on the length of the value field in
challenge messages except that the length is a single octet which
bounds the maximum length to 255.

NB: I'm not sure why the local[] and peer[] arrays contain room for an
authentication name (AUTHLEN) in addition to a challenge value/response,
but I've just left that in place.

PR:             271955
Reported by:    Robert Morris <rtm at lcs.mit.edu>
Reviewed by:    des
Differential Revision:  https://reviews.freebsd.org/D57138
DeltaFile
+2-2usr.sbin/ppp/chap.c
+2-2usr.sbin/ppp/chap.h
+1-1usr.sbin/ppp/defs.h
+5-53 files

FreeBSD/src b5a8b93usr.sbin/ppp id.c

ppp: Don't fetch a non-existent variadic argument

Only fetch the optional mode argument to ID0open to pass to open(2) if
O_CREAT is present in the flags argument.  It is UB to fetch an
argument that doesn't exist.  On CHERI this UB results in a fault.

Reviewed by:    brooks
Obtained from:  CheriBSD
Sponsored by:   AFRL, DARPA
Differential Revision:  https://reviews.freebsd.org/D57137
DeltaFile
+4-1usr.sbin/ppp/id.c
+4-11 files

FreeBSD/src 0492dbesys/fs/cd9660 cd9660_rrip.c

cd9660: Don't parse RRIP records whose length overflows the sector boundary

PR:             272896
Reported by:    Robert Morris <rtm at lcs.mit.edu>
Reviewed by:    des, emaste
Differential Revision:  https://reviews.freebsd.org/D57135
DeltaFile
+18-8sys/fs/cd9660/cd9660_rrip.c
+18-81 files