Commit Graph

306537 Commits

Author SHA1 Message Date
Konstantin Belousov ba8f429f42 kern/sched_shim.c: Add sysctl kern.sched.available
Reports all compiled-in schedulers.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 8aa8289d99 sys: Move 4BSD sysctls under kern.sched.4bsd
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov b125c4d130 sys: Make sched_4bsd a sched instance
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov eb454937a3 sys: Move ULE sysctls under kern.sched.ule
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov d14e018024 sys: Make sched_ule a sched instance
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 7efbfd6ff6 kern/sched_shim.c: provide required SYSINIT hooks
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov bab24f22ba kern/sched_shim.c: Provide a scheduler selection machinery
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov ce38acee8d Add kern/sched_shim.c
This is the infrastructure to allow scheduler implementation to be
selected on boot, supported by ifuncs.

The DEFINE_SHIM() macros and their usage provided by jrtc27@.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 0b474a48dc sys/sched.h: add SCHED_STAT_DECLARE()
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov a556ec46d3 kern/sched_{ule,4bsd}.c: cleanup headers
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 610d7062c6 sched_4bsd: remove unused function sched_pctcpu_delta()
It is not used since c72188d85a.

Noted by:	jrtc27
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:55 +02:00
Konstantin Belousov 8515934ce3 sys/sched.h: make sched_clear_tdname() function prototypes unconditional
There is no harm in having unused prototypes.

Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 57bb132e98 maybe_preempt(): make static in sched_4bsd.c
Reviewed by:	olce
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 23266bc992 amd64/machdep.c: remove extra empty line
Reviewed by:	olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Konstantin Belousov 03d61fe978 arm, riscv: add a preprocessor symbol indicating missed support of ifunc
in kernel.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54831
2026-01-29 20:11:54 +02:00
Bjoern A. Zeeb 5cfe09e3a4 LinuxKPI: 802.11: only announce netdev_features if any are set
Printing an empty netdev_features= line makes little sense even under
bootverbose.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-29 18:07:43 +00:00
Bjoern A. Zeeb 0762cf10fc usb: indentation (whitespace change only)
No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-29 18:07:43 +00:00
Artem Bunichev eb0fc67c45 src.conf.5: Cross-reference uname(1) manual page
Reviewed by:		emaste, ziaee
Differential Revision:	https://reviews.freebsd.org/D54688
2026-01-29 12:44:46 -05:00
Artem Bunichev 2711852bd9 sh.1: Provide detailed job control documentation
Adopt the POSIX standard text to our implementation.

PR:			206284
Reviewed by:		des, jilles, ziaee
Differential Revision:	https://reviews.freebsd.org/D49895
2026-01-29 12:08:47 -05:00
Ed Maste 54e006369c release: Remove not-NO_ROOT cases
We always use NO_ROOT for release artifact builds, so remove the
alternate code paths.

For the first step we set NO_ROOT unconditionally in cases that invoke
submakes, and turn NO_ROOT being unset into an error in lover-level
targets so that we can catch potential out-of-tree build scripts (or
missed in-tree cases) that expect to run not-NO_ROOT builds.  The second
step will be to remove those entirely.

Reviewed by:	cperciva
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54179
2026-01-29 12:03:20 -05:00
Aymeric Wibo 5a73302608 touch: Test for -m flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54853
2026-01-29 16:51:17 +01:00
Aymeric Wibo 578b4ec8f1 touch: Test for -a flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54852
2026-01-29 16:50:26 +01:00
Aymeric Wibo 21efed6cd8 touch: Tests for -h flag
Reviewed by:	kevans
Approved by:	kevans
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54836
2026-01-29 16:49:28 +01:00
Ed Maste 627e126dbb netinet6: Disallow connections to IN6ADDR_ANY
Previously connect() or sendto() to INADDR_ANY or IN6ADDR_ANY reached
some socket bound to some host interface address.  Although this was
intentional it was an artifact of a different era, and is not desirable
now.

In 417b35a97b markj added support to disallow connect() to INADDR_ANY
and IN6ADDR_ANY.  Connections to INADDR_ANY were disabled by default in
cd240957d7.  Follow suit with IN6ADDR_ANY.

Reviewed by:	glebius, markj, zlei
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54306
2026-01-29 09:08:45 -05:00
Baptiste Daroussin 90a7728cd8 nuageinit: support fetching configuration on multiple iface
On some environement a VM can be connected to multiple ifaces but only
one will respond to dhcp and able to fetch the metadata.

Launch the early dhclient on all available ifaces and as soon as one
dhcp has successfully configured an iface, proceed with fetching the
metadata.

MFC After:	1 week
Reported by:	mateusz.klejn@ovhcloud.com
Tested by:	mateusz.klejn@ovhcloud.com
Sponsored by:	OVHcloud
2026-01-29 11:03:06 +01:00
Michael Osipov 56970c3c4b loader: Prefer comma-separated list of values for "console"
PR:		292595
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54923
2026-01-29 09:44:45 +01:00
Eric A. Borisch 1b2d495a24 Set virtual_oss_enable="NO" in /etc/defaults/rc.conf
This prevents 'service -e' from emitting (/var/log/messages):

/usr/sbin/service: WARNING: $virtual_oss_enable is not set properly - see rc.conf(5)

Pull Request:	https://github.com/freebsd/freebsd-src/pull/1987
Reviewed by:	christos
Signed-off-by:	eborisch@gmail.com
MFC after:	1 week
2026-01-29 09:33:59 +02:00
Enji Cooper 808413da28 openssl: import 3.5.5
This change adds OpenSSL 3.5.5 from upstream [1].

The 3.5.5 artifact was been verified via PGP key [2] and by SHA256 checksum [3].

This is a security release, but also contains several bugfixes.

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

1. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz
2. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.asc
3. https://github.com/openssl/openssl/releases/download/openssl-3.5.5/openssl-3.5.5.tar.gz.sha256
4. https://github.com/openssl/openssl/blob/openssl-3.5.5/NEWS.md
2026-01-28 17:27:53 -08:00
Enji Cooper 3926ae98ad gtest.cc: declare fail_if_no_test_linked flag
Clang's -Wmissing-variable-declarations flags this as an issue since the
flag is only used in `gtest.cc`. Declare the flag beforehand to ensure
that the variable scope is properly limited to `gtest.cc`.

MFC after:	1 week
MFC with:	46333229c6
Ref:		https://github.com/google/googletest/pull/4898
2026-01-28 17:25:26 -08:00
Enji Cooper 46333229c6 GoogleTest: import 1.17.0
The changes between the two versions can be found in this diff of the
two release tags:
https://github.com/google/googletest/compare/v1.15.2...v1.17.0

One notable change is that GoogleTest 1.17.0 now requires C++-17 to
build.

MFC after:	1 week
Merge commit '3a4c29b5bed4ea20266ad9371fbfdc6bca088f92'
2026-01-28 17:24:01 -08:00
Ed Maste c59a47dc6c src.opts.mk: Enable LLDB by default globally
Previously it was enabled for all architectures except but RISC-V.
Upstream made significant progress on RISC-V support over the last
year[1], and although there's still some FreeBSD-specific work to do we
can start building it now.

[1] https://jonasdevlieghere.com/post/lldb-2025/

Sponsored by:	The FreeBSD Foundation
2026-01-28 18:13:52 -05:00
Jean-Sébastien Pédron 79b05e7f80 linuxkpi: Add tag support to radix tree
The tag is used to perform lookup in a different way.

New functions were introduced:
* to set, check and clear a tag
* to walk through a radix tree based on a given tag

Furthermore, the `radix_tree_delete()` function was modified to clear
tags on deletion.

The amdgpu DRM driver started to use this in Linux 6.10.

While here, the `radix_tree_gang_lookup()` function was added because it
is very close to `radix_tree_gang_lookup_tag()`, but it is not used by
the DRM drivers as of this commit.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54503
2026-01-28 23:06:56 +01:00
Cheng Cui 20285cad7a vtnet: remove M_HASHTYPE when there is only one pair of rx/tx queue
Summary:
Doing so will let the upper layer know how to deal with software hash,
with benefits like inp_flowid can be set and m_pkthdr.flowid can be set
in output path.

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D54929
2026-01-28 16:46:07 -05:00
Ed Maste 670b568ec1 capsicum-test: Move out of contrib
Google developed the Capsicum unit test suite[1] as part of the
Capsicum-Linux[2] project, based on unit tests that existed in FreeBSD
and unit tests developed as part of the initial Capsicum-Linux port.

Capsicum-Linux was archived as of October 31, 2022 and is no longer
being maintained.  FreeBSD is currently the only consumer of and
contributor to the test suite.  Move the src into tests/sys/capsicum to
simplify ongoing maintenance.

The makefiles were deleted as we (continue to) use the existing bespoke
FreeBSD Makefile, and CONTRIBUTING.md was removed as the Google CLA is
no longer applicable.

[1] https://github.com/google/capsicum-test
[2] https://github.com/google/capsicum-linux

Reviewed by:	asomers, oshogbo
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54917
2026-01-28 16:23:26 -05:00
Mark Johnston 59bbb62b60 cpucontrol: Be more strict with input validation
Avoid truncating 32-bit values.  This would have saved me a bit of time
when I was looking at a cpuid leaf on my system and typed 0x80000001f
instead of 0x8000001f.

Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54919
2026-01-28 17:47:02 +00:00
Mark Johnston 2ea85a622b ifconfig: Exit with a non-zero status when SIOCSIFFIB fails
Previously, setting an interface FIB to some invalid value would result
in a warning being printed, but the ifconfig command would exit with
status 0, but this is wrong.

Add a little regression test.

Reviewed by:	pouria, zlei, melifaro
MFC after:	2 weeks
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D54918
2026-01-28 16:11:47 +00:00
Kyle Evans b41b6fdb3a flua: lposix: fix WARNS=6 issues
lposix is the last holdout of modules built into flua until we can fix
the module design to have the right parts require()able.  Address a
valid bug in lua_read() found at a higher WARNS and drop the override
entirely.  Some of the modules could possibly be re-evaluated.

Fixes:	c2caf3b331 ("flua: lposix: add more useful functions [...]")
Reported by:	des
Reviewed by:	des
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-01-28 09:43:14 -06:00
Olivier Certner 0cca627749 acpi: Use AcpiGbl_FACS even on ACPI_REDUCED_HARDWARE
This has been possible since ACPICA 20240827, and is actually
a requirement to get out of S3 on ACPI_REDUCED_HARDWARE (that said, we
don't implement S3 on arm64 yet).

Relevant ACPICA commit:
https://github.com/acpica/acpica/commit/79cd933e7b370e8d3fb490bf36ca5d111a12f96a.

Reviewed by:    obiwac
MFC after:      2 weeks
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54625
2026-01-28 12:26:38 +01:00
Olivier Certner 526c09a489 acpi: Use only AcpiGetSleepTypeData() to determine Sx support
Previously, we would first call AcpiEvaluateObject() to execute \_Sx
before calling AcpiGetSleepTypeData().  This was unnecessary, as
AcpiGetSleepTypeData() performs the same call itself.  While doing so,
the latter function logs any other error than AE_NOT_FOUND (which
indicates that a particular sleep state is not supported), which most
probably is an added benefit of this change.

Reviewed by:    obiwac
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D54624
2026-01-28 12:26:37 +01:00
Olivier Certner 149e6c67ca acpi_spmc(4): Fix compilation on 32-bit platforms
Fixes:          c5daa5a4c3 ("acpi_spmc: Add system power management controller driver")
Sponsored by:   The FreeBSD Foundation
2026-01-28 12:26:37 +01:00
Olivier Certner a9f7074e85 ahc(4): Fix a warning on i386 compilation
Fixes:          cd036e891a ("ahc_pci.c: If bus_dma...")
MFC after:      3 days
Sponsored by:   The FreeBSD Foundation
2026-01-28 12:26:33 +01:00
Michael Osipov 240c614d48 loader.conf.5: "console" setting does not document multi-value possiblity
PR:		292595
Approved by:	ziaee, dab, imp, tsoome
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54843
2026-01-28 09:53:52 +01:00
Toomas Soome da33cae6c7 stand: fix typo in common/nvstore.c
Some out of order chars.
2026-01-28 10:38:26 +02:00
Toomas Soome ab5f29ae9e stand/zfs: fix path setup in zfs_mount()
Need to check argument 'path', not just allocated struct member.
2026-01-28 10:32:13 +02:00
Konstantin Belousov 4daf2d3e7d posix_spawn: use rfork_thread on all arches
Do not allocate or switch to the custom stack on non-x86.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54898
2026-01-28 04:26:52 +02:00
Konstantin Belousov c1be185e3f libsys, libc: provide rfork_thread() and pdrfork_thread() on all arches
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54898
2026-01-28 04:26:52 +02:00
Dave Cottlehuber c73ae67348 release/tools: use same pkg settings in containers as in /etc/pkg/FreeBSD.conf
Instructions in /etc/pkg/FreeBSD.conf and elsewhere recommend putting
changes in /usr/local/etc/pkg/repos/FreeBSD.conf so bring OCI containers
into line as well.

Reviewed by:	dfr, ivy
Differential Revision:	https://reviews.freebsd.org/D54090

MFC after:	5 days
Sponsored by:	SkunkWerks, GmbH
2026-01-27 22:54:44 +00:00
Jessica Clarke 331316b073 libc: Don't use uninitialised string for getnetbyaddr[_r](0) DNS lookup
If net is all-zero, the loop to extract all leading non-zero octets will
iterate zero times and leave nn with the value 4, which the following
switch statement to initialise qbuf does not handle. As a result,
_dns_getnetbyaddr will look up the PTR record for this uninitialised
string, which will leak the pre-existing contents of that stack memory
to the DNS resolver and, if remote and not otherwise protected, network.

Note that _dns_getnetbyaddr is only used if nsswitch.conf is configured
to enable the "dns" source for the "networks" database, which is not the
default configuration in FreeBSD.

For glibc this same bug, in code also derived from BIND's, was issued
CVE-2026-0915. This commit adopts the same behaviour as glibc's fix,
which is to regard a net of 0 as being for 0.0.0.0. Apparently NetBSD
will return NS_UNAVAIL instead, which may or may not make more sense,
but in general glibc compatibility tends to cause less friction when
there's not a good reason to avoid it.

Reviewed by:	markj (secteam)
Fixes:		1363f04ce1 ("get* rework and new bind code")
MFC after:	1 day
Security:	Same bug as glibc's CVE-2026-0915
2026-01-27 21:44:39 +00:00
Gleb Smirnoff 8a95085635 tests/kern: make ssl_sendfile:truncate and ssl_sendfile:grow less flaky
First problem is a trivial race that the client thread doesn't see updated
c.sbytes.  Second problem applies only to the truncate test.  On a machine
with huge default buffer sizes, there is a chance that sendfile(2) will
fill both buffers with amount of data that is larger than the size we plan
to truncate.  To minimise chances for this scenario, increase file size
and truncate it less aggressively, also try to decrease buffer sizes.
2026-01-27 13:17:08 -08:00
Mark Johnston 938915a22c netbsd-tests: Fix regcomp_too_big flakiness
The test sometimes crashes with ASLR enabled.  This seems to happen when
regcomp() grows the process stack and happens to run into the virtual
memory limit set at the beginning of the test.  ASLR triggers the
problem since it introduces a bit of fragmentation and thus introduces
cases where stack allocation can be the trigger of virtual memory
exhaustion, rather than dynamic memory allocation in regcomp().

Make the test stable by priming the stack before doing anything else.
This effectively reserves 16MB of virtual memory for the stack, which in
practice is enough to make the test stable on amd64.

PR:		259971
Reviewed by:	ngie, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54880
2026-01-27 21:08:35 +00:00