314363 Commits
Author SHA1 Message Date
Poul-Henning Kamp c9dbbe382d Mark network_interfaces as deprecated 2026-10-28 09:36:10 +00:00
Poul-Henning Kamp dca2ad4c6f All Jetway NF541 seem to have the same UUID 2026-10-28 08:34:14 +00:00
Olivier Cochard 1e86bf6009 tests/sys/vfs: use LIBADD for libutil, don't clobber LDFLAGS
"LDFLAGS= -lutil" dropped LDFLAGS from make.conf for every test in the
directory.

Approved by:	glebius
Fixes:		c3ac06161d ("nmount: Introduce the "check_fsid" option")
Sponsored by:	Netflix
2026-10-28 06:32:56 +01:00
Mir Saheb Ali 2c38dc04d6 rtwn: add support for the RTL8188FTV USB chipset
Add support for the RTL8188FTV chipset to rtwn(4)/rtwn_usb(4).

Differential Revision: https://reviews.freebsd.org/D60875
2026-10-27 19:57:07 -07:00
Konstantin Belousov 4ab9e73994 libthr/thr_mutex.c: make mutex asserts more useful
Print the file and line number of the caller where the assert fired.
Use _thread_exitf() directly for this.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-28 02:56:06 +02:00
Gleb Smirnoff f2d4370fbb ipfw: declare the ipfw_nat module
The module declaration is necessary for 'kldstat -m' to see it,
and the rc(8) uses that to detect presence of ipfw_nat.

NB: the module(9) KPI lacks a way to declare a module without
providing an empty handler and no SYSINITs.

Reported by:	ambrisko
Fixes:		9bcc1e97dd
2026-10-27 13:53:26 -07:00
Siva Mahadevan d9d6e77965 tests/pf/igmp: fix attribute error with newer versions of scapy
This fixes the flaky testcase in CI[0].

While here:
* fix a typo in a comment
* remove an unnecessary import
* fix this deprecation warning:

  /usr/local/lib/python3.12/site-packages/scapy/contrib/igmp.py:12:
  DeprecationWarning: scapy.contrib.igmp is deprecated. Please use
  scapy.layers.igmp instead !

[0] https://ci.freebsd.org/job/FreeBSD-main-amd64-test/29813/testReport/junit/sys.netpfil.pf.igmp/py/TestIGMP__test_ip_opts/

Reviewed by:	kp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2026-10-27 12:54:20 -04:00
Mark Johnston eca7cba74c virtio_p9fs: Mark response buffers as initialized for KMSAN
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2026-10-27 15:03:52 +00:00
Konstantin Belousov 73b3fb41e6 amd64: Make the SYSENTER and INTn action same as for IDT case.
Fixes:	6e93f5e4d6 ("amd64: FRED support")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:59:41 +02:00
Konstantin Belousov 8671e823b7 amd64: do not pass SYSENTER frame to FRED fast syscall handler
With FRED, SYSCALL is delivered as event type syscall (7) and vector 1.
SYSENTER is syscall with vector 2.  Handle SYSENTER in slow path,
otherwise 32bit code is able to execute 64bit syscalls.

Also check that SYSCALL comes from the 64bit mode. Intel already
specifies that SYSCALL causes #UD in compatibility mode, but there is no
AMD specification for SYSCALL under FRED yet, and SYSCALL is allowed
in compatibility mode on AMD with IDT event delivery.

Fixes:	6e93f5e4d6 ("amd64: FRED support")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:59:41 +02:00
Konstantin Belousov 473cd1bba9 amd64: fixes for register handling of syscall entry for FRED
- Save %r10 into tf_rcx.  This is the location for the 4th arg.
  libsys stubs do 'movq %rcx, %r10' so the fast syscall path works
  as is.  But Go binaries directly put arg 4 into %r10.
  Also save %r11 into tf_r11 for the duration of syscall handler.
- Somewhat improve binary compatibility with IDT SYSCALL fast return,
  by copying userspace return %rip into %rcx, and %rflags into %r11,
  emulating SYSCALL IDT delivery.

Fixes:	6e93f5e4d6 ("amd64: FRED support")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:58:48 +02:00
Konstantin Belousov 5bc997b6f5 amd64: do not allow to set IOPL to 3 when FRED is used
SDM requires that IOPL is zero when returning to usermode with ERETU.

Do not set rflags.iopl for FreeBSD io(4) open.
This might be changed to disallow io(4) open for FRED at all with a
knob, if there is a real need.

Return ENOSYS from linux iopl(2), apparently Linux kernel can be
configured without iopl(2) support, so linux programs should be prepared
for this error.

Return EINVAL from vt(4)/syscons(4) ioctl(KDENABIO).

Fixes:	6e93f5e4d6 ("amd64: FRED support")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:58:48 +02:00
Konstantin Belousov e86a612d77 trap_fred_handle_k_exc(): handle #AC in kernel
Fixes:	c6d7235ac1 ("amd64: handle #AC in kernel mode")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:58:48 +02:00
Konstantin Belousov 787e2e411d amd64_cpu_init_fred(): set stack level for NMI and not #NM
Fixes:	6e93f5e4d6 ("amd64: FRED support")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-27 13:58:48 +02:00
Christos Margiolis eb36c35ccf sound tests: Check the return value of close(2)
While here, remove two munmap(2) calls on mappings the tests require to
have failed, since they are practically dead.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D60800
2026-10-27 12:27:32 +01:00
Christos Margiolis 5760c22a05 sound: Let pcm_unregister() tear down a partially initialized device
Since 3107b952f5 ("sound: Merge PCM_ALIVE() with PCM_REGISTERED()"),
pcm_unregister() is gated on PCM_REGISTERED(), so it cannot run unless
pcm_register() has already succeeded, which means drivers will leak
resources if a failure happened prior to this.

Reintroduce PCM_ALIVE(), but test dev rather than the lock. pcm_init()
assigns dev before anything else, so it can tell us whether pcm_init()
has run or not. Make sure to clear it in pcm_unregister() so that a
second call to pcm_unregister() cannot double-free.

While here, publish to sndstat(4) only once pcm_register() has
succeeded.

Reported by:	jah
Fixes:		3107b952f5 ("sound: Merge PCM_ALIVE() with PCM_REGISTERED()")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Reviewed by:	jah, markj
Differential Revision:	https://reviews.freebsd.org/D60801
2026-10-27 12:26:29 +01:00
Ram Kishore Vegesna 039a8e11f8 ocs_fc: Fix config space bounds, double PRLI response and a stack overflow
Fix three unrelated problems found by security review of the driver.

ECD helper ioctl:
- OCS_ECD_HELPER_CFG_READ* and OCS_ECD_HELPER_CFG_WRITE* passed a user
  supplied offset straight to pci_read_config() and pci_write_config().
  Reject accesses that extend past PCIE_REGMAX, so that a wide access
  starting in range cannot run past the end of config space.
- Use the real access width (1, 2 or 4 bytes) of the command for both
  the BAR and the config space checks, rather than assuming 4 bytes, so
  that narrow accesses at the very end of the BAR or config space are
  not rejected while wider ones remain bounded.

PRLI:
- When a PRLI carries an FC-4 type other than the one the driver
  supports, ocs_d_send_prli_rsp() sent an LS_RJT and started node
  shutdown, but then fell through and sent a second response on the same
  IO (another LS_RJT, or a PRLI LS_ACC when the initiator is accepted),
  followed by a conflicting transition to __ocs_d_device_ready.  The two
  responses posted two WQEs for one IO and caused a double ocs_ref_put(),
  a use after free of the ELS IO.  Return after dispatching the LS_RJT so
  that exactly one response is sent.
- __ocs_d_port_logged_in calls ocs_d_send_prli_rsp() without checking
  the FC-4 type, so any port that has completed a PLOGI can trigger this
  with a single PRLI, whether or not target mode is enabled.

Management:
- The active profile id is a uint32_t that is formatted as "0x%02x"
  with sprintf() into a buffer of MAX_PROFILE_LENGTH (5) bytes, which
  overflows for any id above 0xff.  Size the buffer for the longest
  possible string ("0x" plus 8 hex digits and the terminating NUL) and
  use ocs_snprintf().
- Use ocs_snprintf() for nv_wwpn as well, as nv_wwnn already does.

MFC after:	1 week
Sponsored by:	Broadcom
Reviewed by:	ken
2026-10-27 14:22:14 +05:30
Ram Kishore Vegesna 26081296b2 ocs_fc: Harden ioctl, XRI lookup and FCP command validation
Fix several issues found by security review of the driver.

ioctl:
- Require PRIV_DRIVER for all ocs ioctls and create the device node
  with mode 0600, group wheel.
- Return the error from ocs_process_sli_config() to the caller.
  Previously only ENXIO was propagated, so a failed validation or a
  failed copyin() still issued the mailbox command, in the latter case
  with a descriptor pointing at freed memory.
- Reject COMMON_WRITE_OBJECT when in_bytes exceeds
  desired_write_length, and cap WRITE_OBJECT, READ_OBJECT,
  READ_OBJECT_LIST and non-embedded mailbox buffers at
  OCS_MAX_DMA_ALLOC, returning EINVAL.
- Use a 64-bit size for the non-embedded mailbox buffer to avoid
  truncation of a user supplied length.
- Refuse to copy out more than the size of the DMA buffer allocated
  for the command.
- Range check the BAR offset in the ECD helper ioctl.

HW:
- Range check the XRI in ocs_hw_io_lookup() and return NULL when it is
  out of range.  Handle a NULL return in the auto xfer ready command
  and data paths (returning the RQ buffers in the former), and in
  ocs_hw_reclaim_xri().
- Make ocs_ref_get_unless_zero() atomic.

FCP:
- additional_fcp_cdb_length is in 4-byte words, but
  ocs_validate_fcp_cmd() added it to the expected payload length as
  bytes, so the length check under-validated the received frame.
- Drop commands with a CDB longer than CAM_MAX_CDBLEN instead of
  passing a truncated CDB to CAM.

MFC after:	1 week
Sponsored by:	Broadcom
Reviewed by:	ken
2026-10-27 14:21:38 +05:30
Martin Matuska 61c70dc16a libarchive: merge from vendor branch
libarchive 3.8.10

ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10

Obtained from:	libarchive
Vendor commit:	0c48412be2d94afe1859a807ea7896a18d8900bd
MFC after:	3 days
2026-10-26 22:47:32 +01:00
Dima Panov 5250c98908 usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)
Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.

Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions

MFC after:		1 day
MFC to:			stable/15 stable/14
Reviewed by:		ziaee, fernape
Approved by:		fernape
Differential Revision:	https://reviews.freebsd.org/D55805
2026-10-26 23:07:56 +03:00
Albin Hellqvist 7b8151b0cd sctp: improve handling of SO_SETFIB socket option
Since SCTP keeps fibnum in the SCTP protocol control block,
the code can't just defer the processing to the IPv4 or IPv6
layer. Therefore it needs to be implemented in the the SCTP
layer and it needs to call the socket layer function.

PR:		300091
Reviewed by:	tuexen
Fixes:		caccbaef8e ("socket: Move SO_SETFIB handling to protocol layers")
MFC after:	3 days
MFC to:		stable/14
MFC to:		stable/15
2026-10-26 20:07:03 +01:00
Aymeric Wibo 9a4bb77040 amdsmu: Use devclass name instead of module name
The diagnostics array contained expected modules to be loaded but the
checking logic checked for if a devclass of that name existed instead.

Have the diagnostics array contain the devclass instead as well as the
module to load for the hint string.

Furthermore, check tha the number of devices is greater than 0 so that
leftover devclasses from unloaded modules don't skip the hint.

Reported by:	emaste
Reviewed by:	emaste
Fixes:	758578370f ("amdsmu: Hints on what to do if IP block blocking S0i3")
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://ron-dev.freebsd.org/FreeBSD/src/pulls/70
2026-10-26 16:35:18 +00:00
Rick Richard 509d65fae5 riscv: Map the DTB when it is outside the kernel's 1GB region
When the kernel is started directly by SBI firmware, locore.S maps only
the 1GB region that contains the kernel, and initriscv() reads the DTB
through that mapping at the physical address passed in a1.  If the
firmware put the DTB in another 1GB region, as QEMU does with more than
1GB of RAM, fake_preload_metadata() faults before the console is up and
the kernel hangs.

Also map the 1GB region that contains the DTB.

This fixes direct kernel booting without FreeBSD loader(8).

PR:		299088
Reviewed by:	mhorne
Fixes:		bfb8575469 ("riscv: Construct an identity map in locore.S")
MFC after:	1 week
Signed-off-by:	Rick Richard <[email protected]>
2026-10-26 12:01:39 -03:00
Aymeric Wibo b86f3d6ae8 amdsmu: Update diagnostics comments for Krackan Point
Krackan Point has the same quirks as the Phoenix SMU it would seem.

Reported by:	emaste
Sponsored by:	The FreeBSD Foundation
2026-10-26 14:08:52 +00:00
Ed Maste 7ea9ac99e1 libc: Add a man page caveat about the w modifier
In-tree Clang is unaware of the N2680 fixed-width modifier `w` and emits
a warning when used.

PR:		299631
Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D60939
2026-10-26 09:46:02 -04:00
Ed Maste ce9de516ee amdsmu: Print detailed stats for KRACKAN_POINT
Testing on a Dell AMD Ryzen AI 5 PRO 435 laptop shows that the same
diagnostic information is valid.

Reviewed by:	obiwac
Sponsored by:	The FreeBSD Foundation
2026-10-26 09:34:41 -04:00
Martin Matuska a8dfdb79eb Update vendor/libarchive to 3.8.10
ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10

Obtained from:		libarchive
Libarcive commit:	0c48412be2d94afe1859a807ea7896a18d8900bd
2026-10-26 14:25:48 +01:00
Wolfram Schneider 13d222bd83 manpages: Fix unusual Xr order 2026-10-26 10:53:02 +00:00
Wolfram Schneider 029466808f manpages: Fix unusual Xr order 2026-10-26 10:46:28 +00:00
Wolfram Schneider fb4f233466 manpages: Fix unusual Xr order 2026-10-26 10:44:08 +00:00
Wolfram Schneider 2ba2623414 manpages: Fix unusual Xr order 2026-10-26 10:41:28 +00:00
Wolfram Schneider f5b6c8f5c2 manpages: Fix unusual Xr order 2026-10-26 10:35:42 +00:00
Wolfram Schneider 3208a17f96 manpages: Fix unusual Xr order 2026-10-26 10:32:42 +00:00
Wolfram Schneider afe20e82f9 manpages: Fix unusual Xr order 2026-10-26 10:29:10 +00:00
Wolfram Schneider 4560b19ff4 manpages: Fix unusual Xr order 2026-10-26 10:27:43 +00:00
Konstantin Belousov 175595ba6c dl_iterate_phdr(3): do not return garbage for objects not using TLS
For objects without a TLS segment, tlsindex is zero. tls_get_addr_slow()
then reads dtv_slots[-1], which is dtv_size, and returns it as the TLS
address. Set dlpi_tls_data to NULL for such objects instead.

Fixes:	d36d681615 ("rtld dl_iterate_phdr(): dlpi_tls_data is wrong")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-25 19:33:46 +02:00
Konstantin Belousov e2979f4cbb rtld: some cosmetics in donelist_init()
Add a missing word in the comment.
Make each assignment a separate statement.
Fix formatting.

Fixes:	1e370f0387 ("rtld: stop using unbound alloca()")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-25 19:33:46 +02:00
Konstantin Belousov 91d8163803 rtld: fix leak in get_program_var_addr() on the error path
Fixes:	1e370f0387 ("rtld: stop using unbound alloca()")
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-25 19:33:46 +02:00
Dimitry Andric 28ec7cb871 Merge commit fd4113508a64 from llvm-project (by Minsoo Choo):
[libunwind] Support extended amd64 segment registers (#229176)

  Raise the amd64 DWARF register limit to 59 and add RFLAGS, all six
  segment selectors, FS.base, and GS.base to the register model. Capture
  the extended state and restore it when resuming, using sigreturn() on
  FreeBSD to restore selectors and bases together. Pack the state into the
  existing context buffers without changing their public sizes or the
  Windows XMM offsets.

  Add tests for register access, signal-frame CFI recovery, register
  bounds, and resume behavior.

  Assisted-by: GPT

MFC after:	1 week
2026-10-25 13:11:27 +01:00
Dimitry Andric 6a936d939b Merge commit 4d7292e58078 from llvm-project (by Minsoo Choo):
[libunwind] Unwind through AArch64 FreeBSD signal trampolines (#235065)

  Retried from https://reviews.llvm.org/D155066.

  Recognize signal trampolines using KERN_PROC_SIGTRAMP when unwind
  metadata is unavailable. Restore the interrupted PC, LR, SP, general
  registers, and valid floating-point registers.

  Add coverage for unwinding out of an interrupted leaf function on both
  regular and alternate signal stacks.

  Assisted-by: GPT

MFC after:	1 week
2026-10-25 13:11:27 +01:00
Wolfram Schneider f7114dc7b7 manpages: Fix unusual Xr order 2026-10-25 12:06:08 +00:00
Wolfram Schneider 44a5cf1372 manpages: Fix unusual Xr order 2026-10-25 12:02:00 +00:00
Wolfram Schneider 3f4743d657 manpages: Fix unusual Xr order 2026-10-25 11:57:18 +00:00
Wolfram Schneider 741197267e manpages: Fix unusual Xr order 2026-10-25 11:51:42 +00:00
Wolfram Schneider 14680d205c ps.1: Fix unusual Xr order 2026-10-25 11:36:15 +00:00
Wolfram Schneider 51a531151a df.1: Fix unusual Xr order 2026-10-25 11:32:12 +00:00
Christos Margiolis 8dac0bdb4d snd_hda: Identify AMD Audio Coprocessor
This makes the driver attach, but the device is still not usable.

Reported by:	Lukasz Wencki <[email protected]>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2026-10-25 11:23:36 +01:00
Konstantin Belousov dc1514eda5 x86: make machine/sysarch.h usable from assembler
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2026-10-25 05:39:25 +02:00
Enji Cooper a3214d4e9b share/mk/bsd.confs.mk: fix trivial typo in message
The error message noting that the file should not be included said
"bsd.conf.mk" before this change. Now it correctly says "bsd.confs.mk".

MFC after:	3 days
2026-10-24 19:57:19 -07:00
Ed Maste 81f86c9a94 smsc: Allow 10BASE-T1L/-T1S media
These are Single-Pair Ethernet types (SPE) from 802.3cg. smsc sets the
link flag only if mii_media_active is one of a known set of media types.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60745
2026-10-24 14:54:11 -04:00