Commit Graph

310048 Commits

Author SHA1 Message Date
Piotr Kubaj 92ae21e8a1 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
2026-06-11 13:46:38 +02:00
Stefan Eßer 3260c42c41 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
2026-06-11 13:39:19 +02:00
Stefan Eßer 596dadbbb5 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
2026-06-11 13:36:09 +02:00
Stefan Eßer 6e5b990c50 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
2026-06-11 13:15:12 +02:00
Pouria Mousavizadeh Tehrani de639dcde2 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@plan-b.pwste.edu.pl>
Differential Revision:	https://reviews.freebsd.org/D57469
2026-06-11 13:50:56 +03:30
Christos Margiolis 93a234a694 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
2026-06-11 11:30:29 +02:00
Christos Margiolis 0bd5ef6b43 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
2026-06-11 11:30:22 +02:00
Warner Losh 0d644b41d6 Revert "improve renice user error messages"
This reverts commit 925f536824. The tests are wrong,
so I'm reverting and reopening the pull request.
2026-06-10 23:59:03 -06:00
Gordon Bergling 14e93e3e36 mxge(4): Fix a typo in a source code comment
- s/deterimine/determine/

MFC after:	3 days
2026-06-11 06:03:02 +02:00
Aleksandr Rybalko 9d10b4d2c9 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
a0439a1b82, 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
2026-06-11 04:52:12 +03:00
Siva Mahadevan 64b053f879 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
2026-06-10 20:08:37 -04:00
Siva Mahadevan b61ab2d693 src.opts.mk: enable OPENSSL_KTLS by default on riscv64
1e649491b8 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:	1e649491b8
MFC after:	3 days
Reviewed by:	gallatin, ngie
Differential Revision:	https://reviews.freebsd.org/D57316
2026-06-10 19:30:52 -04:00
Siva Mahadevan 1e25cda7f0 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
2026-06-10 19:30:40 -04:00
Siva Mahadevan 9f2a38cf40 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
2026-06-10 19:30:24 -04:00
Siva Mahadevan 432ac5c07c 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
[...]
KDB: enter: panic

Consequently, this fixes armv7 CI:
https://ci.freebsd.org/job/FreeBSD-main-armv7-test/2287/consoleText

Fixes:	6353f5d9a5
Reviewed by:	kp
MFC after:	3 days
2026-06-10 17:50:27 -04:00
Mark Ranger 331613ddd8 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
2026-06-10 14:13:05 -07:00
Mateusz Piotrowski 75a94ae7d1 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
2026-06-10 21:52:16 +02:00
Faraz Vahedi 694baf88c2 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@kfv.io>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2223
MFC after:	1 month
Reviewed by:	imp, fuz
2026-06-10 18:14:32 +02:00
Faraz Vahedi 48d20fd1cf 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@kfv.io>
Reviewed by:	aokblast, fuz
MFC after:	1 week
Fixes:		867b51452e
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2265
2026-06-10 18:14:32 +02:00
Ed Maste 6365c45d95 elf_common: Add FDO package metadata note type
Reviewed by:	fuz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57525
2026-06-10 11:45:34 -04:00
Enji Cooper 0881f6cf3f crypto/openssl: update artifacts to match 3.5.7 release
MFC after:	3 days
MFC with:	1523ccfd9
2026-06-10 08:32:35 -07:00
Enji Cooper 1523ccfd9c 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'

Conflicts:
	crypto/openssl/include/internal/quic_channel.h
	crypto/openssl/ssl/quic/quic_channel_local.h
	crypto/openssl/ssl/quic/quic_rx_depack.c
	crypto/openssl/test/cmsapitest.c
	crypto/openssl/test/evp_extra_test.c
2026-06-10 08:31:07 -07:00
Justin Hibbits 4bdcff5543 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.
2026-06-10 10:04:41 -04:00
Justin Hibbits d08cb1dc17 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
2026-06-10 10:04:40 -04:00
John Baldwin 4d8fde8cff ppp: Reject FSM messages whose length is smaller than the message header
PR:		271843
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	des, emaste
Differential Revision:	https://reviews.freebsd.org/D57139
2026-06-10 09:44:10 -04:00
John Baldwin 7e971892df 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@lcs.mit.edu>
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D57138
2026-06-10 09:44:10 -04:00
John Baldwin b5a8b933d4 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
2026-06-10 09:44:10 -04:00
John Baldwin 0492dbe921 cd9660: Don't parse RRIP records whose length overflows the sector boundary
PR:		272896
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	des, emaste
Differential Revision:	https://reviews.freebsd.org/D57135
2026-06-10 09:44:10 -04:00
Kit Dallege ab8ceaaa86 hcreate(3): fix incorrect claim that hdestroy frees keys
The man page incorrectly stated that hdestroy() calls free(3) for
each comparison key. The implementation (hdestroy_r.c) only frees
the internal table structure, not the user-provided keys or data.
This matches POSIX, which says hdestroy "shall dispose of the
search table" without mentioning key deallocation.

Update the description to clarify that the caller is responsible
for freeing any memory associated with table entries.

PR: 291240
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2095
2026-06-10 06:35:05 -06:00
Kit Dallege 3a71a24bbe etherswitchcfg(8): document atu commands
Add documentation for the ATU (Address Translation Unit) commands
that were implemented but not documented in the man page:

- atu dump: display the MAC address table
- atu flush all: clear all dynamic ATU entries
- atu flush port <n>: clear ATU entries for a specific port

Also add atu to the SYNOPSIS section.

PR: 275413
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2096
2026-06-10 06:35:04 -06:00
Kit Dallege 473fa0f7a1 re(4): document jumbo frame support for 8168/8111 chips
The man page only mentioned jumbo frame support for the 8169, 8169S,
and 8110S chips. The 8168 and 8111 family also support jumbo frames,
with varying MTU limits depending on the chip revision (6K for C
variants, 9K for D and later). Update the documentation to reflect
the actual driver capabilities.

PR: 160399
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2097
2026-06-10 06:35:04 -06:00
Kit Dallege e7bdf44da7 bsdconfig(8): add missing vt(4) console commands
Add documentation for the vt_font, vt_keymap, vt_repeat, vt_saver,
vt_screenmap, and vt_ttys commands which are available at runtime
but were not listed in the man page.

Also clarify that the existing syscons_* commands are for the
syscons(4) console driver and remove stale commented-out entries.

PR: 291051
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2100
2026-06-10 06:35:04 -06:00
Kit Dallege f8c8875add diskless(8): remove references to deleted clone_root script
The clone_root script was removed from the tree in commit
7736786b08 but the diskless(8) man page still referenced it
in two places. Remove both references.

PR: 292231
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2101
2026-06-10 06:35:04 -06:00
Kit Dallege 05a02d395d mail(1): fix temporary file path in FILES section
The FILES section listed /tmp/R* but the source code uses
/tmp/mail.R* (e.g. mail.RsXXXXXXXXXX, mail.ReXXXXXXXXXX,
mail.RxXXXXXXXXXX) as the mkstemp template prefix.

PR: 289980
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2103
2026-06-10 06:35:04 -06:00
Kit Dallege 2c5fd7d9a7 cp(1): fix -P documentation to reflect it works without -R
Since commit 97e1303791, the -P flag works without -R as
required by POSIX. Update the man page to state that only -H
and -L are ignored without -R, while -P can be used independently.

PR: 289959
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2102
2026-06-10 06:35:03 -06:00
Kit Dallege 82780af43b du(1): document --si option
The --si option (human-readable output with SI units based on
powers of 1000) was implemented but missing from both the SYNOPSIS
and the options list.

PR: 265199
Signed-off-by: Kit Dallege <xaum.io@gmail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2104
2026-06-10 06:35:03 -06:00
K Rin 2671607f1b libc/tests: Enable fpsetround_basic which was never triggered since ported.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1656
2026-06-10 06:35:03 -06:00
K Rin 85e449cfcf libc/tests: copy ieeefp tests out from contrib/netbsd-tests and rename them as FreeBSD test convention.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1656
2026-06-10 06:35:03 -06:00
K Rin ce08af6378 mac_portacl tests: rewrite the test program and test unspecific family.
Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1659
2026-06-10 06:35:03 -06:00
K Rin 6b61852b4f mac_portacl: do not reject unspecific family directly
Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1659
2026-06-10 06:35:02 -06:00
ykla 9a6a2e4b7d Warn if hostname is empty
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1700
2026-06-10 06:35:02 -06:00
Phil Krylov a62eaf71dd bsdinstall(8): Fix GPT label conflicts with disks not managed by us
Signed-off-by: Phil Krylov <phil@krylov.eu>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1735
2026-06-10 06:35:02 -06:00
androvonx95 925f536824 improve renice user error messages
Improve error handling for invalid user names and UIDs in renice:
- Use warnx() and err() for consistent error reporting
- Set errno = EINVAL for invalid input
- Provide clearer error messages for invalid user names and UIDs
- Add test cases for invalid user input

Signed-off-by: androvonx95 <androvonx95@tutamail.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1768
2026-06-10 06:35:02 -06:00
Konstantin Belousov 9b48646ab3 kern_fork: guard against NULL newproc on the failure path
Reported and tested by:	pho
Fixes:	85a65e3930 ("proc: add tree ref count")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-06-10 14:37:23 +03:00
Konstantin Belousov 89fa97f0a7 compat32 wait4/6(2): only copy out when there is a pid to report
PR:	295965
Reported and tested by:	mandree
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57513
2026-06-10 05:37:25 +03:00
Xin LI c85542b92a GCE: Apply public-image label on GCE images
Update the GCE image creation process to automatically apply the
'public-image=true' label when publishing new images. This aligns
with standard labeling expectations for images hosted in public
projects.

MFC after:	3 days
2026-06-09 19:33:12 -07:00
Chuck Tuffli 925ca9b835 linux: Add TCP_INFO support
Implement the getsockopt for TCP_INFO by mapping FreeBSD's version to
what Linux expects.

MFC after:	1 month
Relnotes:	yes
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55882
2026-06-09 17:23:24 -07:00
Faraz Vahedi 1c85c5eea0 loader.efi: Search boot device before foreign ZFS pools
When `boot_policy` is `RELAXED`, `find_currdev()` tried ZFS pools on every
disk before searching the boot ESP and sibling partitions. Booting install
media from USB could therefore select an installed ZFS root on internal
storage instead of the intended memstick UFS image.

Extract the boot-device partition walk into `try_boot_device_partitions()`
and run it before relaxed foreign-pool probing. The ZFS search order is
preserved; pools on the boot device are tried first, followed by pools on
other devices when `boot_policy` is `RELAXED` and the boot device yields
no bootable root.

Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2239
2026-06-09 17:33:05 -06:00
Jamie Gritton b52dc20676 jail: Don't double-free the current prison in kern_jail_set/get
Reported by:	Yuxiang Yang, et al <yangyx22 at mails.tsinghua.edu.cn>
Discussed with:	markj
MFC after:	3 days
2026-06-09 15:31:40 -07:00
Konstantin Belousov 44970244e6 reap_kill_subtree_once: when proctree_lock is dropped, reaper might change
Recalculate it to iterate over the right set of processes.

Prevent reaper' struct proc reuse by holding the tree ref on it.
Since our reference is taken under the proctree lock and we know that
the process is reaper, it cannot go away.  The process hold count
(p_lock) cannot be used there because p_lock intent is prevent exit, but
reaper owns its reap-children until reaped itself, i.e. even a zombie
reaper is still on duty.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57492
2026-06-10 00:11:45 +03:00