Commit Graph

306317 Commits

Author SHA1 Message Date
Warner Losh 4990cf83f5 MAINTAINERS: Remove some stale entries
Remove some stale entries, preen some others. Longer term, we need a
better format. Also, if there's mistakes, let us know: we want it to be
useful to people seeking review, not be perscriptive about who can do
what.

Reviewed by: srcmgr@
2026-01-23 11:08:16 -07:00
Dimitry Andric 3cdb6c9d92 libc++ inttypes.h: define __STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS
Before transitively including the base version of inttypes.h, define
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS, because the base
inttypes.h directly includes sys/stdint.h, instead of going through the
'regular' stdint.h.

The libc++ version of the latter does define those macros, to ensure
things like UINT64_C() and SIZE_MAX are defined even in C++98 or C++03.

MFC after:	3 days
2026-01-23 18:33:23 +01:00
Andrew Turner 6c5fdba45a arm/gic: Detect broken configurations
Some virtualization platforms provide broken configurations. There
is a GIC interrupt controller, however accessing the CPU interface
registers leads to an external data abort. As these are needed to
handle interrupts we are unable to boot further.

Detect this misconfiguration and panic to tell the user the issue.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54832
2026-01-23 17:02:29 +00:00
Artem Bunichev e6bafbeb1e capsicum.4: Replace 'fi' ligature and smart quotation mark
While here, wrap the line to 80 characters.

Reviewed by:	jlduran
Fixes:		c54534e602 ("capsicum.4: Add some more detail from the Capsicum paper")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54761
2026-01-23 16:22:46 +00:00
Warner Losh 6b9cbeed64 CONTRIBUTING.md: Tweaks for clarity
Add a few tweaks to clarify the author and signed-off-by lines. Add
clarifying note about the style checker. Refine the AI statements
for clarity, but these will need to be revised once the AI policy
has been completed.

Sponsored by:		Netflix
2026-01-23 07:04:41 -07:00
Bjoern A. Zeeb b1bebaaba9 mt76: update Mediatek's mt76 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Notable change: license got switched from ISC to BSD-3-Clause-Clear.
util.h is now imported from upstream given it is no longer GPL-only.
See the upstream repository 909675fd4344f73aad5f75f123bd271ada2ab9fb
and a96fed2825d8dfb068bf640419c619b5f2df4218.

For us the new version should also help with page pools and DMA32.

Sponsored by:	The FreeBSD Foundation
2026-01-23 13:52:47 +00:00
Dag-Erling Smørgrav 498fe07257 buf_ring: Rename some variables
The elements we store in buffer rings are buffers, so refer to them as
`buf` throughout instead of a mixture of `buf`, `ret`, and `new`,
especially since the latter breaks C++ code that directly or indirectly
includes this header.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	siderop1_netapp.com, markj
Differential Revision:	https://reviews.freebsd.org/D54827
2026-01-23 12:36:21 +01:00
Brooks Davis e17d7ab869 xdr_string: don't leak strings with xdr_free
Historically (and in a small amount of older software such as OpenAFS),
developers would attempt to free XDR strings with

	xdr_free((xdrproc_t)xdr_string, &string)

This resulted in xdr_free calling xdr_string with only two intentional
arguments and whatever was left in the third argument register.  If the
register held a sufficently small number, xdr_string would return FALSE
and not free the string (no one checks the return values).

Software should instead free strings with:

	xdr_free((xdrproc_t)xdr_wrapstring, &string)

Because buggy software exists in the wild, act as though xdr_wrapstring
was used in the XDR_FREE case and plug these leaks.

Reviewed by:	kib
MFC after:	3 days
Effort:		CHERI upstreaming
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D54825
2026-01-23 10:35:55 +00:00
Brooks Davis ac5a19ec69 rpc/xdr.h: make xdrproc_t always take two arguments
The type of xdrproc_t is clearly defined in the comments as a function
with two arguments, an XDR * and a void * (sometimes spelled caddr_t).
It was initialy defined as:

	typedef bool_t (*xdrproc_t)();

At some point people started giving it a non-empty argument list.
Unfortunatly, there has been widespread disagreement about how arguments
are passed.  There seems to have been a widespread view that it should
be allowed to pass three argument function pointer to xdrproc_t.  Most
notable is xdr_string which takes a maximum length parameter. This lead
to all sorts of prototypes (all of which have been present in the
FreeBSD source tree):

FreeBSD userspace (nominally from tirpc, but seemingly local):
	typedef bool_t (*xdrproc_t)(XDR *, ...);
FreeBSD kernel, glibc:
	typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
rcp/xdr.h with _KERNEL defined (not used?):
	typedef bool_t (*xdrproc_t)(XDR *, void *, u_int);
gssrpc (in krb5) and Linux kernel:
	typedef bool_t (*xdrproc_t)(XDR *, void *);

For two argument functions on current ABIs, these all equivalent as
these arguments are passed in registers regardless of decleration and
definition, but we end up with two problems:

   - xdr_free((xdrproc_t)xdr_string, ...) calls xdr_string with no third
     argument and (at least on FreeBSD) may fail to free memory if the
     string is shorter than the value lying around in the third argument
     register.  There are no instance of this in tree, but I found some
     with Debian code search, in particular in OpenAFS.

   - Under CheriABI, variadic arguments are passed in a separate,
     bounded array so theses prototypes aren't equilvalent to the
     non-variadic calling convention of the functions.

The reality is that that xdr_string should not be cast to xdrproc_t and
xdr_wrapstring should be used instead so we do not need to support this
case.  Instances of the former behavior are now extremely rare.

With this change we bring FreeBSD in line with gssrpc and the Linux
Kernel.  Warnings about casts should now be correct and should be fixed.

Bump __FreeBSD_version as some software required adaptation if it is
declaring functions to cast to xdrproc_t.  Update OpenZFS's workaround
of this historic mess accordingly.

Effort:		CHERI upstreaming
Sponsored by:	Innovate UK

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D54824
2026-01-23 10:35:32 +00:00
Michael Tuexen f31336b3e3 dpnaa2: announce transmit checksum support
Let the network stack know that the NIC supports checksum offloading
for the IPv4 header checksum and the TCP and UDP transport checksum.
This avoids the computation in software and therefore provides the
expected performance gain.

PR:			292006
Reviewed by:		dsl, Timo Völker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54809
2026-01-23 08:59:57 +01:00
Siva Mahadevan 8352e24d0b tests/ktest_netlink_message_writer: remove INVARIANTS requirement
INVARIANTS is meant to be used to enable extra sanity checking for
internal structures, not enable/disable tests in the freebsd kyua
test suite.

STABLE branches include a GENERIC kernconf without INVARIANTS, so
ktest_netlink_message_writer is broken on such branches:

https://ci.freebsd.org/job/FreeBSD-stable-15-amd64-test/253/testReport/sys.netlink.test_netlink_message_writer/py/__test_cases_list__/

Reviewed by:	lwhsu, imp
Approved by:	lwhsu (mentor)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1889
MFC after:	3 days
Signed-off-by:	Siva Mahadevan <siva@FreeBSD.org>
Sponsored by:	The FreeBSD Foundation
2026-01-22 14:49:51 -05:00
Konstantin Belousov dfc4186c6d x86 lapic: Dump LVTs from the ddb show lapic command
Add description for each LVT element, use it in show lapic dump.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-01-22 21:09:21 +02:00
Konstantin Belousov 2b1db07bec x86: add machine/ifunc.h
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-01-22 21:09:21 +02:00
Dag-Erling Smørgrav 4b96204338 mdmfs: Fix soft updates logic
Now that newfs(8) has a command-line argument to disable soft updates,
use that instead of running tunefs(8) after the fact to turn them off.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	mckusick, imp
Differential Revision:	https://reviews.freebsd.org/D54783
2026-01-22 19:16:45 +01:00
Mark Johnston 14dce731d7 syslogd/tests: Fix flakiness in forwarding tests
syslogd_start() waits for the local log socket to appear before
returning, to ensure that the daemon is ready to handle log messages.
Some tests start two daemons, so by default the socket already exists
when the second daemon is started, so syslogd_start() returns early.
The test subsequently sends a message to this second daemon, which
sometimes isn't ready.

Define a separate log socket for the second daemon.  Add a check to
syslogd_start() to help catch this type of bug.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54800
2026-01-22 15:52:00 +00:00
Mark Johnston 92d251472e syslogd/tests: Improve loopback interface initialization
- In syslogd_start(), assign the lo0 address in the specified jail.
- Use the correct netmask.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54799
2026-01-22 15:51:42 +00:00
Mark Johnston 560c22937b syslogd/tests: Address races
I occasionally see failures in the syslogd test suite.  The problem is
that the tests are racy: they send a message using logger(1), then
immediately check whether the message was logged to a log file.  If the
syslogd instance under test doesn't get a chance to run before the
second step, the test fails.

This change reworks things to avoid the race while minimizing the amount
of time sleeping.
1) Each test uses a single logfile, so have them use a new common
   variable, SYSLOGD_LOGFILE, instead of something test-specific.
2) In syslogd_start(), if the configuration references SYSLOGD_LOGFILE,
   wait for it to be created by syslogd before returning.
3) Add a helper syslogd_check_log(), to check for a given log entry in
   the last line of SYSLOGD_LOGFILE, instead of using atf_check
   directly.
4) In syslogd_check_log(), poll the logfile until the desired log entry
   appears, or the test times out.

With this change, I was able to run the tests 1000 times in a loop with
4-way parallelism without seeing any test failures.  Without the change
I usually get a failure within 10 loops.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54779
2026-01-22 15:50:25 +00:00
Mark Johnston ffdbc1bc21 syslogd/tests: Use a helper function to log from within a jail
This is just for consistency with all other logger(1) invocations, which
happen from the syslogd_log() function.

No functional change intended.

Reviewed by:	jlduran
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54778
2026-01-22 15:50:14 +00:00
Ed Maste dec3ea45b6 libiconv: Fix typo in comment 2026-01-22 10:36:37 -05:00
Eugene Grosbein 129aec7225 libfetch: allow disabling TLS v1.3 when the connection
MFC after:	3 days
2026-01-22 21:37:54 +07:00
Eugene Grosbein 8f8a7f6fff libfetch: apply timeout to SSL_read()
Currently, fetchTimeout works for non-SSL connections only, so does fetch -T.
Fix it applying specified timeout to SSL_read().

MFC after:	3 days
2026-01-22 15:40:35 +07:00
Cy Schubert ad9932995c hwpstate: Add CPPC enable tunable
The Framework 13 runs very hot the maximum frequency is possible. By
disabling CPPC (reverting to Cool`n'Quiet 2.0) we can use powerd to
limit the CPU frequency to 2200, thereby reducing the CPU temperature.

Some systems may run slower with CPPC enabled. See PR/292615 for that
bug.

Those experiencing either of these issues may add the following to
their loader.conf or device.hints to disable CPPC:

machdep.hwpstate_amd_cppc_enable="0"

PR:			292615
Reviewed by:		lwhsu, olce
Differential revision:	https://reviews.freebsd.org/D54803
2026-01-21 20:36:33 -08:00
Kyle Evans eacc501eff truncate: fix a minor nit + add a hole-punching test
The struct spacectl_range we use is only really used in these three
lines of code, so re-scope it down to just the dealloc branch.  This is
marginally easier to reason about what might be necessary to replace in
porting our truncate(1) to other platforms.

While we're here, add a test for the -d flag to be sure it really does
punch a hole in the file.  The test also tries to confirm that it does
not disturb other segments of the file in the process, just to inspire
some confidence that it's not corrupting the file somehow.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D51207
2026-01-21 17:35:25 -06:00
Bjoern A. Zeeb 6c61f58562 ath10k: update Atheros/QCA's ath10k driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:	The FreeBSD Foundation
2026-01-21 19:57:42 +00:00
Bjoern A. Zeeb 80ba8933a9 rtw88: update Realtek's rtw88 driver
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
24d479d26b25bce5faea3ddd9fa8f3a6c3129ea7 ( tag: v6.19-rc6 ).

Sponsored by:	The FreeBSD Foundation
2026-01-21 19:57:15 +00:00
Bjoern A. Zeeb 275c7f5131 LinuxKPI: netdevice: add structs net_device_path, net_device_path_ctx
mt76(4) is using this along with a mac80211.h functiontion pointer to
resolve a path in an offload case.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb d4898c6e01 LinuxKPi: 802.11: add more defines
Add more defines and a mac80211 op function pointer used by
mt76(4) at Linux v6.19-rc6.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb f1d7eea9dc LinuxKPI: skbuff: implement skb_queue_splice()
Add skb_queue_splice() and use it in skb_queue_splice_init() which
already had that functionality (plus the init bit).
The new function is used by rtw89(4).

Sponosred by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:08 +00:00
Bjoern A. Zeeb b2c90d106c LinuxKPI: 802.11: rename enum ieee80211_tx_rate_flags and move file
What we used to call enum ieee80211_tx_rate_flags is now used as
enum mac80211_rate_control_flags for the ieee80211_tx_rate.flags
in rtw89(4).  Rename the enum and move it to mac80211 as it seems
to belong there.

Sponsonred by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb 18de28308c LinuxKPI: 802.11: add new field to struct cfg80211_bitrate_mask
rtw89(4) accesses eht_mcs[].
Add the field to struct cfg80211_bitrate_mask.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb 5f7b5dde10 radiotap: add more EHT definitions
Add more EHT definitions used by at least iwlwifi.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Bjoern A. Zeeb e4a4841d7a LinuxKPI: 802.11: Management MIC element can have 8 or 16 octets MIC
Management MIC element (MME) can have 8 or 16 octets MIC.  Add a second
structure used by at least iwlwifi and update reference to latest
standard version.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-01-21 18:31:07 +00:00
Artem Bunichev 2c6bee2b23 socket.2: Cross-reference protocol families
While here, make wider use of Dv for socket types and protocol families
and reference fcntl(2) flags for the `type` argument values.

MFC after:		3 days
Reviewed by:		glebius, ziaee
Differential Revision:	https://reviews.freebsd.org/D54434
2026-01-21 12:25:36 -05:00
Sarah Walker 98cb4874e2 simd.7: Add Arm MOPS memcpy(), memmove() and memset() to manpage
Fixes:			41ccf82b29 (Use MOPS implementations)
Reviewed by:		ziaee
Sponsored by:		Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D54812
2026-01-21 11:51:10 -05:00
John Baldwin 5eb1d4eec6 rpctls_impl.c: Use a direct cast to uintptr_t instead of __DECONST
This fixes the build on CHERI architectures where the compiler warns
about a direct cast between uint64_t and const void * inside of
__DECONST.  However, GCC would also complain about this on 32-bit
kernels due to uint64_t not being the same size as a pointer.  Also,
a direct cast to uintptr_t to right-size the cookie value is more
direct than using __DECONST given that there is no "const" pointer
involved in the expression.

Reviewed by:	brooks, glebius
Obtained from:	CheriBSD
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D54797
2026-01-21 11:10:53 -05:00
Ed Maste 37de3763b8 CODEOWNERS: Add myself for openssh and makefs 2026-01-21 10:09:58 -05:00
Warner Losh 76ca619f10 MAINTAINERS: remove stale entry 2026-01-21 07:39:59 -07:00
Michael Tuexen d8b8dc776b dpaa2: cleanup
No functional change intended.

Reviewed by:		bz, dsl
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54805
2026-01-21 08:16:46 +01:00
Xin LI 53d6b23765 cron.8: clarify system crontab format
PR:		234504
MFC after:	1 week
2026-01-20 22:33:48 -08:00
Justin Hibbits 21a7a9ef8b powerpc/mpc85xx: Fix PCI attach error cleanup
If an error occurs during attach after ofw_pcib_init() runs, the device
is torn down, leaving the rmans embedded in the softc attached to the
rman list, thus corrupting the rman list.  Fix this by undoing
everything that was done by this point.

MFC after:	1 week
2026-01-20 23:28:41 -05:00
Justin Hibbits 24d048be7a powerpc/mpc85xx: Set pc_hwref to the primary thread ID
On multithreaded cores (e6500) the CPU ID in the device tree (reg[0]) is
the primary core, which may not match the cpuid, until Book-E threading
is added.
2026-01-20 23:28:40 -05:00
Justin Hibbits c611ef5747 dpaa: Simplify CPU binding for bman and qman
If cpu-handle property doesn't exist simply iterate and assign the CPUs
in sequence rather than following the convoluted search which may not
bear fruit in some cases.  If cpu-handle doesn't exist for one portal it
probably doesn't exist for any of them.
2026-01-20 23:28:40 -05:00
Xin LI 12444a4da5 cron: Implement full PAM session lifecycle for user jobs
Extend PAM integration beyond account checks to include credential
establishment and session management, allowing PAM modules to configure
the execution environment for user cron jobs.

Previously, cron only called pam_acct_mgmt() to verify account validity
but immediately terminated the PAM handle before job execution. This
prevented PAM modules from establishing sessions, setting credentials
(e.g., Kerberos tickets), or exporting environment variables needed by
jobs.

The PAM handle now persists in the intermediate process throughout the
job execution, enabling proper session open/close pairing. Credentials
are established and sessions opened while still running as root, before
dropping privileges in the grandchild. PAM environment variables are
exported in the job process with user crontab variables taking precedence.

A session rule (pam_permit.so) is added to /etc/pam.d/cron to enable
session support without changing default behavior. Administrators can
replace this with other modules as needed.

System crontab entries continue to bypass all PAM operations.

PR:		bin/244844
Reviewed by:	des
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D54415
2026-01-20 18:47:16 -08:00
Rick Macklem 053449fa5c nfscl: Fix the build
Fixes:	f2155a6fb5 ("nfscl: Fix handling of case insensitive file systems")
2026-01-20 17:32:23 -08:00
Rick Macklem f2155a6fb5 nfscl: Fix handling of case insensitive file systems
Name caching must be handled somewhat differently
for case insensitive file systems.  Negative name
caching does not work and, for rename, all names
associated with the rename'd vnode must be disabled.

For a case insensitive ZFS file system that is exported,
the unpatched code did work, since the change in mtime
or ctime of the directory when other case names were
created or rename'd would disable the false name cache
hit.  However, an export of an msdosfs file system
breaks the NFS client, because it only works if ctime/mtime
is changed whenever a name is added/removed.  Depending
on what the server file system is, this may not happen,
due to clock resolution or lack of support for these
attributes.

This patch checks to see if the server file system is
case insensitive and modifies the name caching to handle
this.

There is still a problem if a case insensitive file system
is a subtree of a non-case insensitive is exported by the
NFSv4 server.  This can be fixed someday, when the NFSv4
client gets support for submounts within the mount.

Suggested by:	kib
MFC after:	2 weeks
2026-01-20 16:21:52 -08:00
Konstantin Belousov 6bb3f20861 ktrace: do not enqueue request if the process' ktrioparams are freed
The p_ktrioparms are freed on termination of tracing.  Any ktr requests
added to the queue after that would hang there and leak on the struct
proc recycling, or trigger an assert in the process destructor for debug
builds.

Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54804
2026-01-20 21:44:54 +02:00
Ed Maste 466bad427d src.conf.5: Add WITHOUT_SOUND description
Fixes: f74f891581 ("src.opts: Introduce MK_SOUND")
Sponsored by:	The FreeBSD Foundation
2026-01-20 13:13:10 -05:00
Cy Schubert 2d8ec3bab2 krb5: Fix another GCC build issue
Fixes:		1876de606e
X-MFC with:	1876de606e
MFC after:	2 weeks
2026-01-20 09:40:52 -08:00
Bjoern A. Zeeb c592d54a24 LinuxKPI: 802.11: fix build for non-debug kernels
lkpi_nl80211_band_name() is only available under LINUXKPI_DEBUG_80211.
IMPROVE in theory should be as well or defined to nothing but we cannot
do that in cfg80211.h mac80211.h where we possibly (re-)define this.

Put an #ifdef around the IMPROVE call for now (untested).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Fixes:		768332d619
Reported by:	CI
2026-01-20 17:19:29 +00:00
Michael Tuexen 8d82dafa56 sctp: support bridge interfaces
Reported by:	Timo Völker
Tested by:	Timo Völker
MFC after:	3 days
2026-01-20 18:06:17 +01:00