Commit Graph

306357 Commits

Author SHA1 Message Date
Jose Luis Duran 7106db625e nanobsd: Prefer nano_umount to umount
nano_umount[^1] is a convenience routine used to override issues with
umount(8) without changing the nanobsd.sh source code.  There were a few
places where it was not being used.

[^1]: Introduced in 6d12b61a88 ("Add a routine for easy workaround any
umount issues w/o hacking nanobsd.sh.")

Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48780
2026-01-17 18:03:00 +00:00
Jose Luis Duran a4f0a60e05 tarfs: tests: Increase timeout (again 2)
Bump the timeout value (for the third time), to avoid cutoff on emulated
architectures on ci.freebsd.org.  One of the runners will take
considerably more time to complete this test.

Reported by:	Jenkins
Fixes:		a551b05249 ("tarfs: tests: Increase timeout (again)")
MFC after:	3 days
2026-01-17 18:01:21 +00:00
Michael Tuexen 97b177f51f dwc: prepare for IPv6 transmit checksum offloading
No functional change intended.

MFC after:	3 days
2026-01-16 18:28:01 +01:00
Xin LI 8e6843db9b libc: drop NO_FP_LIBC support
NO_FP_LIBC was added in 2004 to save space by disabling FP support in
*printf()/*scanf(). The size benefit is negligible on modern systems
and conflicts with assumptions made by current base utilities.

Remove the option and always build libc with floating-point support.

Reported by:	Oskar Holmlund <eovholmlund at gmail com>
MFC after:	2 weeks
2026-01-16 22:43:40 -08:00
Adrian Chadd afbb21bd1d aq: remove from NOTES; it's unfortunately amd64 only
Unfortunately the aq driver is using readl/writel calls instead
of bus space routines.

This broke, well, everything else.
Fixes:		c75eff16ef
2026-01-16 21:01:02 -08:00
Justin Hibbits cd22fd0549 powerpc: Add ISA 2.06 sub-word atomic set/clear
Add atomic_set/clear_short/char for doing 8-bit and 16-bit operations
more efficiently on "newer" architectures (POWER7 and later).

Piggybacks on b31abc95eb.
2026-01-16 23:10:02 -05:00
Gleb Smirnoff 35caa56a32 tests/ipfw: add a test for ipfw(4) log rules that write to bpf(4) 2026-01-16 20:09:02 -08:00
Gleb Smirnoff 65b4bf7a6e ipfw: refactor how we store bpf tap points
Make the tap database belong to ip_fw_chain, but leave the default "ipfw0"
tap per-vnet.  This is only slightly better than keeping the database per-
vnet, as the bpf name space is per-vnet.  However, we yet have only single
ipfw chain.  Whenever multiple chains will coexist, this needs to be
addressed.

Require the chain lock to make modifications to the database.

Move tap allocation to a later ruleset build stage, when all rule numbers
are known already.  This fixes a panic introduced by 3daae1ac1d.

Fixes:	3daae1ac1d
2026-01-16 20:09:02 -08:00
Gleb Smirnoff 1a7b74d312 ipfw: in a vnet destructor use NET_EPOCH_WAIT()
The lock grab & drop predates epoch(9) introduction to the network
stack and it doesn't provide a true guarantee that all threads that
may use ipfw configuration have finished.  Also the lock prevented
from sleepable operations when freeing the rules.
2026-01-16 20:09:02 -08:00
Sulev-Madis Silber 6dc12ecfb2 spi: "-S" option for continuous stream from standard input to bus
created to allow addressable leds to be driven by abusing spi bus as waveform generator. this might have other uses for similar "permanent" spi transfers

Differential Revision:	https://reviews.freebsd.org/D54734
Reviewed by:	adrian
2026-01-16 19:41:33 -08:00
Konstantin Belousov 325baf0073 vm/swap_pager.c: silence compiler warning
Initialize pindex in swap_pager_getpages_locked() before the loop
actually calculating it by skipping bogus pages.  Compiler is worried
that loop might never assign to it, which actually cannot happen.

Sponsored by:	The FreeBSD Foundation
Fixes:	d198ad51ea
MFC after:	1 week
2026-01-17 05:33:24 +02:00
Brad Smith c75eff16ef aq: Add to amd64 GENERIC and to sys/conf/NOTES
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D54633
2026-01-16 19:23:22 -08:00
Konstantin Belousov d198ad51ea swap_pager_getpages(): some pages from ma[] might be bogus
Same as vnode_pager_generic_getpages_async(), swap_pager_getpages() must
handle a possibility of the provided page run to include bogus_page on
some positions, when called from sendfile_swapin().  The swap pager is
used for tmpfs vnodes.

In particular, the bogus page must not be used for pindex calculation,
we better not update the flags on it or wait for the flag clearing, and
we must not call vm_page_valid() because the function expects busy page.

This was bisected down to 72ddb6de10 (unix: increase
net.local.(stream|seqpacket).(recv|send)space to 64 KiB),
which is somewhat surprising, but apparently reasonable because it
allowed the run of more than one page for page-in from the swap pager,
which now might include valid pages replaced by bogus one.

In collaboration with:	pho
Reviewed by:	glebius, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54713
2026-01-17 04:08:03 +02:00
Konstantin Belousov b02ddb59e6 swap_pager_getpages(): assert that bp->b_pages[] is accessed in bounds
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54713
2026-01-17 04:07:57 +02:00
Konstantin Belousov 3fe275c1ef sendfile: remove calculation of unused bsize
Reviewed by:	glebius, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54713
2026-01-17 04:07:51 +02:00
Gleb Smirnoff b0c13e7e24 ipfw: remove locking workarounds in the table code
Before the "upper half lock" became sleepable the table manipulation code
needed sophisticated workarounds to recover from races, where the lock is
temporarily dropped to do malloc(M_WAITOK).  Remove all these workarounds
as they are no longer needed.

Differential Revision:	https://reviews.freebsd.org/D54580
2026-01-16 16:39:13 -08:00
Gleb Smirnoff e3caa360d5 ipfw: make the upper half lock sleepable
The so called upper half ipfw lock is not used in the forwarding path.  It
is used only during configuration changes and servicing system events like
interface arrival/departure or vnet creation.  The original code drops the
lock before malloc(M_WAITOK) and then goes into great efforts to recover
from possible races.  But the races still exist, e.g. create_table() would
first check for table existence, but then drop the lock.  The change also
fixes unlock leak in check_table_space() in a branch that apparently was
never entered.

Changing to a sleepable lock we can reduce a lot of existing complexity
associated with race recovery, and as use the lock to cover other
configuration time allocations, like recently added per-rule bpf(4) taps.

This change doesn't remove much of a race recovery code, to ease bisection
in case of a regression.  This will be done in a separate commit.  This
change just removes lock drops during configuration events.  The only
reduction is removal of get_map(), which is a straightforward reduce to a
simple malloc(9).

The only sleepable context where the lock was acquired was dyn_tick(). The
comment said it is done to prevent parallel execution of
dyn_expire_states().  However, there is proper internal locking in there
and function should be safe to execute in parallel.  The real problem is
dyn_expire_states() called via userland to race with dyn_grow_hashtable()
called via dyn_tick().  Protect against this condition with the main chain
lock.

Differential Revision:	https://reviews.freebsd.org/D54535
2026-01-16 16:39:01 -08:00
Gleb Smirnoff 7eac31c83e tests/ipfw: add a simple fuzzing test for ipfw tables
Reviewed by:		pouria, ae
Differential Revision:	https://reviews.freebsd.org/D54579
2026-01-16 16:38:41 -08:00
Gleb Smirnoff f102a18349 net: on interface detach purge all its routes before detaching protocols
Otherwise, a forwarding thread may use the interface being detached.  This
is a regression from 0d469d2371, which manifests itself as a reliably
reproducible panic in in6_selecthlim().  Note that there are old bug
reports about such a panic, and I believe this change will not fix them,
as their nature is not due to a screwed up detach sequence, but due to
lack of proper epoch(9) based synchronization between the detach and
forwarding.

Reviewed by:		pouria
Reported & tested by:	jhibbits
PR:			292162
Fixes:			0d469d2371
Differential Revision:	https://reviews.freebsd.org/D54721
2026-01-16 16:38:02 -08:00
Dimitry Andric 74cac745fe mxge(4): avoid clang 21 warning in NO-IP configuration
Building the LINT-NOIP kernel on amd64 with clang 21 results in a
-Werror warning similar to:

    sys/dev/mxge/if_mxge.c:1846:44: error: variable 'sum' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
     1846 |                     cksum_offset, sizeof(sum), (caddr_t)&sum);
          |                                                          ^~~

Indeed, if both `INET` and `INET6` are undefined, `sum` is never
initialized. Initialize it to zero to silence the warning.

Reviewed by:	jhibbits
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D54730
2026-01-17 00:31:50 +01:00
Doug Moore 988555e329 tdestroy: don't visit one-child node twice
Change tdestroy() to immediately free a node with no right child as
soon as it is encountered. Currently, such nodes are visited twice
before deletion.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D54699
2026-01-16 16:26:09 -06:00
Warner Losh 689663d465 Initialize CLOCK_UPTIME for itmer events
Since we move to implement Linux's CLOCK_MONOTONIC with CLOCK_UPTIME, we
broke the some timer support for Linux. Fix this by initializing
CLOCK_UPTIME as a posix clock so we can use in that context.

PR:			292496
MFC After:		5 days
Fixes: 			108de78451
Sponsored by:		Netflix
Reviewed by:		kib
Differential Revision:	https://reviews.freebsd.org/D54746
2026-01-16 14:20:20 -07:00
Bjoern A. Zeeb c940f5c775 RELNOTES: LinuxKPI based wireless drivers are now avail on RISC-V
This was enabled after a report [1] that iwlwifi(4) works on
RISC-V.

[1] https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=5947+0+archive/2026/freebsd-wireless/20260112.freebsd-wireless

Sponsored by:	The FreeBSD Foundation
2026-01-16 20:29:49 +00:00
Artem Bunichev fd34f549b7 termios.4: Cross-reference stack(9) for STATUS
If the kernel is built without stack(9) (options STACK),
then the mentioned sysctl(8) kern.tty_info_kstacks will not be found.

MFC after:		3 days
Reviewed by:		kib, ziaee
Differential Revision:	https://reviews.freebsd.org/D54701
2026-01-16 15:22:30 -05:00
Mark Johnston 75c591b267 smartpqi: Avoid declaring extern inline functions
Each C file is compiled separately so these functions can't be inlined
except in the file where they are defined.  Since these functions aren't
used outside smartpqi_request.c, just do the simple thing and make them
private to that file.

Reported by:	gcc
Reviewed by:	jrhall
Fixes:		c558eca479 ("smartpqi: update to version 4660.0.2002")
Differential Revision:	https://reviews.freebsd.org/D54732
2026-01-16 19:55:08 +00:00
Michael Osipov f89f7e58ba sockstat: improve formataddr() according to style(9)
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54412
2026-01-16 20:36:46 +01:00
Marek Zarychta d836dae9f0 ng_netflow v9: fix template re-announcement using packet count
Increment fe->sent_packets after export9_send().
Previously, NetFlow v9 templates were only re-announced based on
time, ignoring the packet count parameter (`templ_packets`).

PR:		270083
Reviewed by:	glebius pouria
Approved by:	glebius (mentor)
MFC after:	1 week
Sponsored by:	Subcarpathian BSD User Group
2026-01-16 22:06:53 +03:30
Siva Mahadevan 1d819aad17 mailmap: translate siva@'s personal email
Reviewed by:		lwhsu
Approved by:		lwhsu (mentor)
Differential Revision:	https://reviews.freebsd.org/D54744
2026-01-16 13:23:09 -05:00
Siva Mahadevan 33f2f3049a committers-src: add myself (siva@)
Reviewed by:		lwhsu
Approved by:		lwhsu (mentor)
Differential Revision:	https://reviews.freebsd.org/D54744
2026-01-16 13:22:32 -05:00
Mark Johnston c527f58bb1 exterr: Regenerate exterr_cat_filenames.h 2026-01-16 15:56:51 +00:00
Mark Johnston bda6ed2ee4 exterr: Sort output from make_libc_exterr_cat_filenames.sh
Otherwise the script may permute the order of entries in the file since
find(1) output is not stable.

Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54669
2026-01-16 15:56:33 +00:00
Hans Rosenfeld e2d7bec6bc bhyve: Want walk_config_nodes
Add a function to all nodes under a config option node. This allows
parsing an arbitrary number of similarly structured configuration
options in a config option group.

Reviewed by:	corvink, markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D51551
2026-01-16 10:48:34 -04:00
ShengYi Hung 87c4d6555b hwpstate_amd: Use ipi instead of sched_bind + thread_lock
Reviewed by:    olce
Approved by:    markj (mentor)
MFC after:      2 weeks
Differential Revision: https://reviews.freebsd.org/D54505
2026-01-16 22:38:15 +08:00
ShengYi Hung 5b61ef94d6 smp: add smp_rendezvous_cpu helper function
Reviewed by:    olce
Approved by:    markj (mentor)
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D54551
2026-01-16 22:38:12 +08:00
Dimitry Andric b39662fc38 vchiq: fix build with clang 21
When compiling vchiq with clang 21, the following -Werror warning is
produced:

    sys/contrib/vchiq/interface/vchiq_arm/vchiq_arm.c:728:27: error: default initialization of an object of type 'VCHIQ_QUEUE_MESSAGE32_T' with const member leaves the object uninitialized [-Werror,-Wdefault-const-init-field-unsafe]
      728 |                 VCHIQ_QUEUE_MESSAGE32_T args32;
          |                                         ^
    sys/contrib/vchiq/interface/vchiq_arm/vchiq_ioctl.h:151:40: note: member 'elements' declared 'const' here
      151 |         const /*VCHIQ_ELEMENT_T * */ uint32_t elements;
          |                                               ^

While the warning is formally correct, the 'args32' object is
immediately initialized after its declaration. Therefore, suppress the
warning.

MFC after:	3 days
2026-01-16 15:02:35 +01:00
Michael Tuexen bbd30927b1 bge: disable TXCSUM if UDP transmit checksum offloading is disabled
The bge interface is special with respect to transmit checksumi
offloading. In the default settings, an bge interface announces TXCSUM
capabilities, but only supports TCP/IPv4 and not UDP/IPv4 due to
limitations of some of the NICs. This results in problems when the bge
interface becomes a member of a bridge. Since currently only the
TXCSUM capabilities are synced when a member is added to a bridge and
not the protocol specific capabilities, this can result in a situation
where UDP packets are sent out using a bge interface without having a
correct checksum.
To mitigate this problem, initially don't announce TXCSUM capabilities,
when UDP transmit checksum is disabled. It is still possible to enable
TXCSUM capabilities via ifconfig.

PR:			291420
Reviewed by:		Timo Voelker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54486
2026-01-16 13:36:53 +01:00
Dag-Erling Smørgrav 77a6992bf5 MINIMAL: Add virtio_scsi
This allows a MINIMAL kernel to boot in qemu/kvm.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
2026-01-16 13:31:12 +01:00
Michael Tuexen 1f5b1de1fd ipv6: account for jumbo payload option
If a jumbo payload option is added, the length of the mbuf chain is
increased by 8 but the actual hop-by-hop extension header with the
jumbo playload option is only inserted in the packet if there are
other options. Therefore, adjust optlen to reflect the actual size
of IPv6 extension headers including the hop-by-hop extension header
containing the jumbo payload option.

Reported by:		syzbot+73fe316271df473230eb@syzkaller.appspotmail.com
Reviewed by:		markj, Timo Voelker
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54394
2026-01-16 12:49:40 +01:00
Michael Tuexen f8ddf74175 dwc: improve IPv4 transmit checksum offloading
This patch provides two improvements for TCP/IPv4 and UDP/IPv4
transmit checksum offloading:
(1) Use *CIC_SEG instead of *CIC_FULL, since FreeBSD always provides
    a pseudo header checksum.
(2) Don't make transmit IPv4 header checksum offloading a prerequisite
    for TCP/IPv4 or UDP/IPv4 transmit checksum offloading.
This is the root cause of PR 291696, since right now the epair
interface does not support transmit IPv4 header checksum offloading,
but TCP/IPv4 and UDP/IPv4 transmit checksum offloading.

PR:			291696
Reviewed by:		Timo Voelker
Tested by:		Marek Benc
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D54395
2026-01-16 12:02:53 +01:00
Brooks Davis a01a4c0730 CODEOWNERS: register interest in some infrastructure 2026-01-16 09:43:12 +00:00
Brooks Davis d78291b0e9 lib/virtual_oss: don't (over)link to libsamplerate
These plugins require samplerate.h due to virtual_oss's int.h including
it, but don't use any symbols directly so don't link to the library.

Centralize adding the include path.

Reviewed by:	christos
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D54705
2026-01-16 09:34:18 +00:00
Brooks Davis 373c72ad50 virtual_oss: build system tidying
general:
 - find libsamplerate's headers in the temporary sysroot instead of
   digging in the source tree.
 - use LIBADD where possible

lib/virtual_oss:
 - centralize SHLIBDIR define
 - centralize include path for internal headers
 - don't try to find libsamplerate directly in .OBJDIR

No functional changes.

Reviewed by:	christos
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D54704
2026-01-16 09:33:56 +00:00
Brooks Davis adab1dd6a7 virtual_oss: build commands/libs in parallel
Reviewed by:	christos
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D54703
2026-01-16 09:33:50 +00:00
Brooks Davis 497a13601f virtual_oss: remove needless .include in intermediate Makefile
It doesn't define anything we use.

Reviewed by:	christos
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D54702
2026-01-16 09:33:22 +00:00
Kyle Evans 22569a1d80 Bump __FreeBSD_version for MAC changes 2026-01-16 03:06:38 -06:00
Kyle Evans c18631fe79 RELNOTES: document the MAC/jail integration
Reviewed by:	jamie, markj
Differential Revision:	https://reviews.freebsd.org/D54737
2026-01-16 03:04:39 -06:00
Kyle Evans 1e8c28712a jail: document the mac.label parameter
In particular, we should provide a hint about mac.conf(5), since libjail
will just use the mac_prepare_type(3) API to provide a reasonably sane
interface for system administrators.  Progammers wanting to fetch an
arbitrary MAC label would need to bypass libjail and use jail_get(2)
directly with their own prepared `struct mac`.

Differential Revision:	https://reviews.freebsd.org/D54067
2026-01-15 18:23:40 -06:00
Kyle Evans db3b39f063 libjail: extend struct handlers to included MAC labels
MAC label handling is a little special; to avoid being too disruptive,
we allocate a `mac_t *` here for the value so that we can mac_prepare()
or mac_from_text() into.  As a result, we need:

 - A custom free() handler to avoid leaking the *jp_value
 - A custom jailparam_get() handler to mac_prepare() the mac_t and
    populate the iove properly, so that the kernel doesn't have to
    do something funky like copyin, dereference, copyin again.
 - A custom jailparam_set() handler to similarly populate the iovec
    properly.

Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D53960
2026-01-15 18:23:40 -06:00
Kyle Evans 1af8d5652a libjail: start refactoring struct ioctl support
Instead of ad-hoc comparisons against the struct type in a few places,
start to abstract out an interface for dealing with struct types.  For
now, this just means that we have some special jailparam_import and
jailparam_export handling for the ip addr types, but in the next commit
we'll extend it further to support MAC labels.

Reviewed by:	jamie
Differential Revision:	https://reviews.freebsd.org/D53959
2026-01-15 18:23:40 -06:00
Kyle Evans bd55cbb50c kern: add a mac.label jail parameter
Have it take a `struct mac` and we'll paper over the difference for
jail(8)/jls(8) in libjail(3).  The mac_syscalls.h model is taken from
mac_set_proc_*() that were previously done.

Reviewed by:	olce
Differential Revision:	https://reviews.freebsd.org/D53958
2026-01-15 18:23:39 -06:00