Commit Graph

306537 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron 710167623d linuxkpi: Implement <linux/seq_buf.h>
It is a wrapper above a `char *` to track the overall available space in
the buffer as well as the used space. This wrapper does not manage
memory allocation.

The DRM generic code started to use this in Linux 6.10.

Reviewed by:	bz
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54488
2026-01-24 20:16:14 +01:00
Michael Osipov 28764001b5 vt.4: Document that hw.vga.textmode does not apply for UEFI(8) boot
PR:		292598
Approved by:	ziaee, imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54842
2026-01-24 19:41:29 +01:00
Alan Somers 52ddca7c2e fusefs: style
Reorder macro definitions.
2026-01-24 09:02:44 -07:00
Alan Somers ffb747d587 fusefs: Add tests for the new -o auto_unmount feature
Add tests for mount_fusefs's new -o auto_unmount feature, recently added
by arrowd.

MFC with:	10037d0978 "fusefs: Implement support for the auto_unmount"
2026-01-24 09:02:33 -07:00
Peter Holm c2b513335f stress2: Added two new test scenarios 2026-01-24 13:30:31 +01:00
Peter Holm 833f9294b4 stress2: Added two syzkaller reproducers. Updated the exclude file 2026-01-24 13:28:54 +01:00
Gleb Popov 10037d0978 fusefs: Implement support for the auto_unmount option kernel-side
libfuse clients may pass the "-o auto_unmount" flag to ensure that the mountpoint
will get unmounted even if the server terminate abnormally. Without this flag
sending KILL to a FUSE daemon leaves its mountpoint mounted.

Approved by:	asomers
Differential Revision:	https://reviews.freebsd.org/D53086
2026-01-24 13:06:16 +03:00
Pouria Mousavizadeh Tehrani 04f6b99947 netlink: use caller's credentials in rtnl_handle_newlink
Make sure rtnl_handle_newlink sets the caller's credential
during calls to ifc_create_ifp_nl and ifc_modify_ifp_nl

Reviewed by: glebius, melifaro
Approved by: glebius (mentor)
Differential Revision: https://reviews.freebsd.org/D54109
2026-01-24 13:20:50 +03:30
Jose Luis Duran cd730bef74 nanobsd: Use mtree -C to produce the metalog
Prefer an mtree -C output, which is guaranteed to be mtree-compatible.
Add "gname", "uname", and "tags" to the default keyword set, while
removing "size" and "time", the latter being set on kernel file entries
and taking precedence over makefs -T (when paired with -F).

As a side effect, this produces a cleaner file with sorted keywords.

Note that passing "-u" to sort in order to pipe to mtree is no longer
necessary, but we'll do it out of habit.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54854
2026-01-24 02:06:57 +00:00
Hans Rosenfeld 202e3109a9 amd64: Fix sys/pcpu.h usage in vmm_host.h and md_var.h
Include sys/pcpu in vmm_host.h as its structs and functions are used
there, and add a forward declaration of struct pcpu to md_var.h as it
is used in some function prototypes.

Reviewed by:	corvink, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D51550
2026-01-24 01:29:45 +00:00
Gleb Smirnoff f3de667137 netinet6: free in6_ifextra with epoch_call(9)
This is expected to fix the old in6_selecthlim() panics.  The nature of
the panic is that a packet sending thread will obtain the struct ifnet
pointer locklessly and then pick the if_inet6 pointer from it and
dereference it. While the struct ifnet is freed via epoch_call(9), the
struct in6_ifextra until this change was not.  For the forwarded packets,
or locally originated non-TCP packets we were probably safe due to the old
if_dead trick.  But locally originated TCP packets may dereference
in6_ifextra via direct call into in6_selecthlim() from the tcp_output(),
before ip6_output().

NB: hypothetically a similar problem also applies to IPv4's if_inet pointer,
but there are no known panics, yet.

PR:			279653
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54728
2026-01-23 14:18:18 -08:00
Gleb Smirnoff cba9f88105 netinet6: embed struct mld_ifsoftc into struct in6_ifextra
In mld_domifdetach() don't search the global list.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54727
2026-01-23 14:18:12 -08:00
Gleb Smirnoff aa3bbc06e5 netinet6: embed struct scope6_id into struct in6_ifextra
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54726
2026-01-23 14:18:07 -08:00
Gleb Smirnoff 576ee62dd2 netinet6: store ND context directly in struct in6_ifextra
Stop using struct nd_ifinfo for that, because it is an API struct for
SIOCGIFINFO_IN6.  The functional changes are isolated to the protocol
attach and detach: in6_ifarrival(), nd6_ifattach(), in6_ifdeparture(),
nd6_ifdetach(), as well as to the nd6_ioctl(), nd6_ra_input(),
nd6_slowtimo() and in6_ifmtu().

The dad_failures member was just renamed to match the rest.  The M_IP6NDP
malloc(9) type declaration moved to files that actually use it.

The rest of the changes are mechanical substitution of double pointer
dereference via ND_IFINFO() to a single pointer dereference.  This was
achieved with a sed(1) script:

s/ND_IFINFO\(([a-z0-9>_.-]+)\)->(flags|linkmtu|basereachable|reachable|retrans|chlim)/\1->if_inet6->nd_\2/g
s/nd_chlim/nd_curhoplimit/g

Reviewed by:		tuexen, madpilot
Differential Revision:	https://reviews.freebsd.org/D54725
2026-01-23 14:17:40 -08:00
Gleb Smirnoff 25a11d9805 netinet6: use in6_ifmtu() instead of IN6_LINKMTU() macro
There should be no functional change.  If there are any performance
concerns with a function call, with the future changes, that would move
ND6 bits into in6_ifextra, this function would be easily inline-able.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54724
2026-01-23 14:17:16 -08:00
Gleb Smirnoff 3182dc4117 netinet6: embed the counter(9) arrays in struct in6_ifextra
Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54723
2026-01-23 14:17:10 -08:00
Gleb Smirnoff 6857b3a04e netinet6: embed struct nd_ifinfo into struct in6_ndireq
There is no functional change here, but we'd like to emphasize that the
nd_ifinfo structure is not a actually a kernel ND6 software context,
despite being actively used like this way, but an API/ABI structure for
ioctl(2).  This should prevent from a ABI breakages like in 31ec8b6407.
This also is a step towards stopping using it as a kernel software
context.

Reviewed by:		tuexen
Differential Revision:	https://reviews.freebsd.org/D54722
2026-01-23 14:16:42 -08:00
Li-Wen Hsu 3aa8d5395c mkimg(1): Sync mkimg(1) and usage() with the implementation
Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54419
2026-01-23 15:55:32 -05:00
Gleb Smirnoff 37d11fde8f tests/kern: add test for SSL_sendfile() 2026-01-23 11:00:49 -08:00
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