Commit Graph

307385 Commits

Author SHA1 Message Date
Konstantin Belousov 3e8a9995e9 amd64: extract uprintf_signal printing into a helper 2026-03-06 01:53:57 +02:00
Konstantin Belousov 5c71df9850 nfsclient: convert to use vn_delayed_setsize()
Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55595
2026-03-06 01:46:54 +02:00
Konstantin Belousov 45117ffcd5 vfs: add VOP_DELAYED_SETSIZE() and related infrastructure
The change generalizes code that was initially developed for nfs client
to handle filesystems that needs to call vnode_pager_setsize() while
only owning the vnode lock shared.  Since vnode pager might need to trim
or extend the vnode vm_object' page queue, the vnode lock for the call
must be owned exclusive.  This is typical for filesystems with remote
authorative source of file attributes, like nfs/p9/fuse.

Handle the conflict by delaying the vnode_pager_setsize() to the next
vnode locking to avoid relock.  But if the next locking request is in
shared mode, lock it exclusively instead, perform the delayed
vnode_pager_setsize() call by doing VOP_DEFAULT_SETSIZE(), and then
downgrade to shared.

Filesystems that opt into the feature must provide the implementation of
VOP_DELAYED_SETSIZE() that actually calls vnode_pager_setsize(), and use
vn_delay_setsize() helper to mark the vnode as requiring the delay call.

Reviewed by:	rmacklem
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55595
2026-03-06 01:46:54 +02:00
Konstantin Belousov ef8292e339 Regen 2026-03-06 01:46:54 +02:00
Konstantin Belousov 619e49b2ba renameat2(2): document
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 5f911eaba0 libsys/rename.2: remove commented-out CAVEAT section
FreeBSD UFS does not support hardlinks to directories.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 8feb8d221c linuxolator: translate LINUX_RENAME_NOREPLACE into our AT_RENAME_NOREPLACE
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 7a1217ff3b zfs: implement AT_RENAME_NOREPLACE
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 7aaec5f3fa renameat2(2): implement AT_RENAME_NOREPLACE flag
For msdosfs, tmpfs, and ufs.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 28599a1e5f sys: add renameat2(2) syscall
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 1f3020067a kern_renameat(9): add flags argument
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov e486066cf4 VOP_RENAME(9): add flags argument
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov ed87040311 zfs rename: properly cleanup on errors occuring before zfs_do_rename()
Reported and tested by:	arrowd
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55539
2026-03-06 01:46:53 +02:00
Konstantin Belousov 347cec10e2 amd64: align stack on 16 bytes when calling into a EFIRT method
Reported by:	Abdelkader Boudih
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-03-06 01:43:55 +02:00
Olivier Certner 35da55c28d iwx: Fix 32-bit compilation
- Avoid shifts wider than integer types, by wrapping the corresponding
  checks into '#if __SIZEOF_SIZE_T__ > 32' blocks.  'bus_addr_t'
  currently has the same width as 'size_t' on all architectures (and
  this is not going to change for 32-bit architectures).
- Use appropriate printf(3) format for 'wk_keytsc'.

Reviewed by:    adrian
MFC after:      1 minute
MFC to:         stable/15
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55667
2026-03-05 21:40:53 +01:00
Ed Maste 9cea0f0be7 bsd.linker.mk: Retire support for binutils 2.17.50
GNU binutils 2.17.50 is the last GPLv2 version, and we retained support
in FreeBSD while it was part of the in-tree toolchain.  The last parts
of binutils 2.17.50 were removed in commit 74e8d41e0a ("Retire
BINUTILS and BINUTILS_BOOTSTRAP options") and there is no longer a need
for the build infrastructure.

We retain build-id and ifunc in LINKER_FEATURES unconditionally for now,
as they may be tested by 3rd-party Makefiles.  We can however stop
testing for them in the tree.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55674
2026-03-05 15:01:21 -05:00
Ed Maste a1789fa30c netinet6: Remove support for connecting to IN6ADDR_ANY
RFC4291 section 2.5.2:
    The unspecified address must not be used as the destination address
    of IPv6 packets or in IPv6 Routing headers.  An IPv6 packet with a
    source address of unspecified must never be forwarded by an IPv6
    router.

We disallowed connections to IN6ADDR_ANY by default, as of commit
627e126dbb ("netinet6: Disallow connections to IN6ADDR_ANY").  As this
is actually disallowed by the RFC, just remove the support.

Reported by:	bz (in D54306)
Reviewed by:	bz, glebius
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54942
2026-03-05 14:57:36 -05:00
John Baldwin 54bf594851 libc/quad: Switch to per-arch lists of symbols
This more closely mirrors libc/quad/Makefile.inc and is easier to
read.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D55658
2026-03-05 14:07:09 -05:00
John Baldwin 27cfa8ec63 libc/quad: narrow list of symbols exposed for 32-bit arm
lld doesn't notice, but ld.bfd complains.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D55657
2026-03-05 14:07:09 -05:00
John Baldwin cf92fa3370 bsd.linker.mk: Sort list of linker features
Reindent the features as well to be friendly to long feature names.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55656
2026-03-05 14:07:09 -05:00
John Baldwin 1b77f6ec6b bsd.linker.mk: Document ifunc, ifunc-noplt, riscv-relaxations features
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55655
2026-03-05 14:07:09 -05:00
John Baldwin d19f2af2b7 acpi: Don't attach a "wake" sysctl node to devices without the ACPI flags IVAR
Not all bus drivers for ACPI-aware devices implement the ACPI flags
IVAR used by the acpi_wake_set_sysctl handler.  In some cases this may
be a feature as some new-bus devices share the same ACPI handle (e.g.
a pcibX device and its child pciY device) which can lead to confusing
results (e.g. setting the sysctl on pciY changes the behavior of the
parent pcibX device, but the "wake" sysctl for pcibX won't reflect the
new behavior, or reflect the device's state).

Reviewed by:	obiwac, ngie, imp
Differential Revision:	https://reviews.freebsd.org/D55562
2026-03-05 14:07:09 -05:00
Gleb Smirnoff 6feb16b77e witness: report a thread that can't sleep in WITNESS_WARN
Although this is not related to locking, but seems to be the right
place to catch violators, given that WITNESS_WARN is already used
widely in the kernel.

Reviewed by:		kib, markj
Differential Revision:	https://reviews.freebsd.org/D55316
2026-03-05 10:43:17 -08:00
Pouria Mousavizadeh Tehrani 0616521adc ndp: Simplify and breakdown nd6_ra_input()
`nd6_ra_input()` is simplied to make it easier to add
additional options.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55267
2026-03-05 21:34:32 +03:30
Pouria Mousavizadeh Tehrani 7f3b46fe54 ndp: Add support for Gratuitous Neighbor Discovery (GRAND)
Implement RFC 4861 Section 7.2.6 and RFC 9131, which is also
address one of the IPv6 deployment issues in RFC 9898 Section 3.9.
GRAND should be triggered by a change in link-layer address of interface
or by configuration of a new global ipv6 address after DAD completes.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D55015
2026-03-05 21:28:38 +03:30
Baptiste Daroussin 6d2a147ae5 libedit: fix use after free 2026-03-05 17:13:08 +01:00
Andrew Turner 80b4129bef arm64: Optimise the repeated TLBI workaround
It has been reported that the overhead of repeating all TLBI
instructions is too large [1]. The Software Developer Errata Notices
(SDEN) for the relevant Arm CPUs have been updated so a single
"tlbi vale1is, xzr" followed by "dsb ish"  is sufficient to work around
the issues.

Replace the places we repeat TLBI instructions with the new sequence.

[1] https://lore.kernel.org/linux-arm-kernel/20260218164348.2022831-1-mark.rutland@arm.com/

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D55646
2026-03-05 15:13:30 +00:00
Andrew Turner 570b8b2575 arm64: Use a canonical address when TBI is enabled
When Top Byte Ignore (TBI) is enabled in a processor we need to pass
a canonical address to the vm subsystem.

Reviewed by:	alc, kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D55619
2026-03-05 15:13:30 +00:00
Ed Maste 5d757312ad build: Retire LLVM_CXXFILT option
The LLVM_CXXFILT option was added when we used ELF Tool Chain tools by
default.  ELF Tool Chain's c++filt failed to demangle some symbols, so
we added a special case to install LLVM's version and enabled it by
default.

The rest of the LLVM tools are now used by default, as of commit
9fa94e1c09 ("Turn on WITH_LLVM_CXXFILT by default").  Simplify the
build logic by removing a special case and just include llvm-cxxfilt
with the rest of the LLVM utilities.

Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55654
2026-03-05 09:43:46 -05:00
Bjoern A. Zeeb f68ebebd8a LinuxKPI: 802.11: change teardown order of disassoc and sta rm
In lkpi_sta_auth_to_scan() we remove the sta from the firmware
for everything supporting (*sta_state).

We used to run into issues here with iwlwifi in that we had to
use a specific order: set vif->cfg.assoc = false, .aid = 0,
then remove the sta, and then send the mac update as otherwise
we would either have the sta silently removed (if we run
(*bss_info_change) first and fail then or silently not have the
sta removed and upon sta add we would trigger the fw crash.

The order of events seem to have changed now and especially BE200
(iwlwifi/mld) is picky about this and would crash the firmware with
something like:

	iwlwifi0: 0x20103311 | ADVANCED_SYSASSERT
	iwlwifi0: 0x00000000 | umac branchlink1
	iwlwifi0: 0xC00808AA | umac branchlink2
	iwlwifi0: 0xD00D6E90 | umac interruptlink1
	iwlwifi0: 0x0108C504 | umac interruptlink2
	iwlwifi0: 0x00000000 | umac data1 (link_id? seen weird values there though)
	iwlwifi0: 0x00000006 | umac data2 (fw_sta_id)
	iwlwifi0: 0x00000001 | umac data3

if it would still think we were assoc.

So the new order is as one would have expected initially:
set assoc = false, aid = 0;  do the remaining bss_conf (vif/link) changes
and issue the (*vif_cfg_changed) / (*link_info_changed) or for older
drivers (*bss_info_changed).  That will tell the mac we are no longer
associated.  And only then remove the sta from the firmware.

Update the comment there along so we do have the paper trail as to when
and why this changed.

Tested on:	BE200, AX210 (11ac)
Tested on:	AX200. 9260, 8265, 3165 (11a)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-05 13:44:02 +00:00
Bjoern A. Zeeb 9592f563c3 LinuxKPI: 802.11: split (*bss_info_changed) up for more modern drivers
With the advent of MLO some of the updates (*bss_info_changed) would
have done are not per-link.  This had (*vif_cfg_changed) and
(*link_conf_changed) introduced which are used by iwlwifi, rtw89,
select mt76 drivers, and ath12k currently it seems.
A driver normally only supports on or the other set.

Factor out the call to (*bss_info_changed) into an internal function.
There split the options up depending on whether they are for the
vif or a link and leave a fallback to (*bss_info_changed) for older
drivers.

Add the mac80211 ops implementations for the two new calls along with
a currently unused backup option for (*bss_info_changed) for each
as I assume we will eventually call the directly rather than from the
internal wrapper function.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-05 13:44:02 +00:00
Bjoern A. Zeeb fa41408d60 LinuxKPI: 802.11: fix typo
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-05 13:44:01 +00:00
Bjoern A. Zeeb 760e0a18d3 iwlwifi: fixup link_id for certain cases
In iwl_mvm_mld_vif_cfg_changed_station() if we do not do MLO (which we
do not do yet at all), dtim_period is not yet set but asssoc is
(our common case) the link_id can become -1 as active_links is always
0 for the non-MLO case.

This leads to logging of a WARN;
Invalid link ID for session protection: 4294967295

Fixup the link_id if it is -1 to be 0.  This is the deflink link_id so
that should always be fine in this case.

For Linux 7.0-rc2 that code is already gone so this is a local temporary
stopgap measure for the mvm-mld devices (e.g., some AX210).

Sponosred by:	The FreeBSD Foundation
MFC after:	3 days
2026-03-05 13:44:01 +00:00
Bjoern A. Zeeb 9b03cc2a70 net80211: sta: use IEEE80211_STATUS_SUCCESS instead of magic 0
Rather than using the status != 0 check use the way more descriptive
status != IEEE80211_STATUS_SUCCESS definition.  This makes it a lot
more clear what is checked here.  While here add a comment in case
aof the (Re)Assoc Resp failure as we do not update state in that case
but rely on a timeout which will bounce us back to State 1
(cf. 802.11-2024, Figure 11-23) which means SCAN in our case, rather
than possibly moving us back to AUTH.  We will likely have to revisit
this when SAE hits the tree.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D55643
2026-03-05 13:44:00 +00:00
Olivier Cochard 9f71153aec carp: fix global demotion counter to VRRP advertisements
When net.inet.carp.preempt=1 and a physical interface goes down, the global
V_carp_demotion counter is incremented. For CARP this was already reflected in
outgoing advertisements via DEMOTE_ADVSKEW(), but VRRP sent the raw
sc_vrrp_prio unchanged, so demotion had no effect.

Add DEMOTE_VRRP_PRIO(), a macro analogous to DEMOTE_ADVSKEW():
It subtracts V_carp_demotion from the configured priority and clamps the result
to [0, 254]. Priority 0 is VRRPv3's "resign" signal and causes backups to
preempt immediately. Priority 255 (IP address owner) is never demoted.

Reviewed by:	kp
Approved by:	kp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D55558
2026-03-05 12:02:20 +01:00
Brooks Davis 4dd517acb6 libc/armv7: remove default version for alloca
The alloca() interface has been a macro expanding to __builtin_alloca()
since 2003 (commit 79806b4cdc, included in FreeBSD 5.2).  Even before
that virtually every compiler version I was able to test replaced
alloca() with compiler generated code when targeting C.

Hide it to prevent future (mis)use.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D51858
2026-03-05 10:34:47 +00:00
Brooks Davis db1ecd5854 getnetconfig: make nc_error a thread local variable
Remove a bunch of complexity at the cost of 4 bytes of storage per
thread.

Reviewed by:	jhb
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D55310
2026-03-05 10:30:30 +00:00
Brooks Davis ea9bc84658 cirrus-ci: move package_check after test
Liveness is often more important than minor packaging glitches (which
might well be the fault of a prior commit.)

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55481
2026-03-05 10:23:51 +00:00
Jari Sihvola d3eaa40282 riscv: save FPE state in cpu_fork().
Save the Floating Point Extension (FPE) state before copying struct pcb.

Reviewed by:	br
Differential Revision:	https://reviews.freebsd.org/D53804
2026-03-05 09:00:23 +00:00
Ruslan Bukin dff2758b5f static dtb: add BTI note
Add BTI note to fdt_static_dtb.o
- resolves "Branch Target Exception" panic on FDT systems with static DTB
  due to missing landing pads (bti note has to be in all object files used
  for linkage)
- also required by bti_report linker feature

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D55636
2026-03-05 08:50:26 +00:00
Baptiste Daroussin 28ff4d35f8 libedit: vendor import version 2026-03-04
MFC After:	1 week
2026-03-05 08:17:51 +01:00
Baptiste Daroussin b1ddc060e9 libedit: import version 2026-03-04 2026-03-05 08:12:33 +01:00
Gleb Smirnoff 1abb62867f tests/net/bpf: skip the bpf:inject test when RSS is present
With RSS the epair(4) may reorder packets making the test flaky. See
net/if_epair.c:epair_select_queue().
2026-03-04 20:04:11 -08:00
Gleb Smirnoff 78843218b0 rss: manifest RSS option in kernel with kern.features sysctl 2026-03-04 20:01:22 -08:00
Gleb Smirnoff d4083fb836 tests/net/bpf: hexdump(3) the packets if compare fails 2026-03-04 19:57:59 -08:00
Gleb Smirnoff 776604651e hpts: remove call into TCP HPTS from userret()
This hack introduced in d7955cc0ff and e3cbc572f1 proved to have more
ill side effects than benefits.  Sorry for that.

Now the HPTS soft clock is called only after the LRO completion.  Refactor
HPTS module linkage to address that and share the pointer only between
HPTS and LRO.

Reviewed by:		Nick Banks
Differential Revision:	https://reviews.freebsd.org/D55640
2026-03-04 19:16:00 -08:00
Majed Alkhaleefah 2f440158c6 hid: Fix 'strenght' typo in hpen.c
Reviewed by:	wulf, obiwac
Approved by:	wulf, obiwac
Fixes:	d97d5c0ce8 ("hid: Import hidmap-based drivers written by Greg V")
Differential Revision:	https://reviews.freebsd.org/D55626
2026-03-05 00:41:57 +01:00
Gleb Smirnoff c5c54f7d21 hpts: remove no longer relevant comment 2026-03-04 13:35:29 -08:00
Gleb Smirnoff df97a58afd inpcb: use correct label name in a comment 2026-03-04 13:35:07 -08:00
John Baldwin 00ff89c1e0 acpi: Treat ACPI_IVAR_FLAGS as a global IVAR
The ACPI bus uses the flags IVAR for any device with a _PRW method
including devices such as PCI bridges/devices that are not direct
children of acpi0.

Reported by:	ngie
Reviewed by:	ngie
Fixes:		0bb867e9f5 ("acpi: Split ACPI IVARs into global and private sets")
Differential Revision:	https://reviews.freebsd.org/D55561
2026-03-04 15:19:48 -05:00