Commit Graph

305721 Commits

Author SHA1 Message Date
Michael Osipov 0d31189cbc linprocfs.4: Improve docs around pid/self entries
Mark <pid> as a placeholder and document that self is a symlink to a directory.

PR:		283080
Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54358
2025-12-26 19:53:43 +01:00
Michael Osipov e1bfd541c7 bhyve: Document that MAC address has to be unicast
bhyve accepts any MAC address even foreign as long it is a unicast one.

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54372
2025-12-26 17:35:20 +01:00
Ed Maste 02376be32d tests/ci: Use :H:H rather than ../..
In general we want to strip subdir components, rather than appending
`..`s.

Reviewed by:	lwhsu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54352
2025-12-26 11:32:27 -05:00
John Baldwin bd8296bd81 Build acpi kernel modules on aarch64
For now, the only kernel module built is acpi_ged.ko.

Sponsored by:	Netflix
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D54315
2025-12-26 10:37:34 -05:00
John Baldwin fe74d52de5 sys/modules/acpi/Makefile: One line per subdirectory
This makes diffs that add or remove modules easier to read.

Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54314
2025-12-26 10:37:20 -05:00
John Baldwin 11757b1487 acpi: Statically initialize acpi_ioctl_hooks
Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54313
2025-12-26 10:37:10 -05:00
John Baldwin 425b41f816 acpi: Use M_WAITOK in acpi_register_ioctl
This function is only called from device attach routines which can
sleep.

Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54312
2025-12-26 10:36:48 -05:00
John Baldwin 4eb560faa7 acpi: Reject duplicate handlers for ioctl commands
Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54311
2025-12-26 10:36:38 -05:00
John Baldwin 88f8e3c5ab acpi_apei: Remove the hest member from the softc
This is only used during attach and freed after use, so just use a
local variable in the attach routine instead to avoid leaving a
dangling pointer around in the softc.

Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54310
2025-12-26 10:36:24 -05:00
John Baldwin 5b39245ab6 acpi: Free ivars in bus_child_deleted method
Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54309
2025-12-26 10:36:12 -05:00
John Baldwin 6b2e4da443 acpidump: Extend the decoding of entries in the EINJ and ERST tables
- Decode the Action, Instruction, and Flags fields for these tables

- Omit the Flags field if it is zero

- Omit the Value field for instrunctions that do not use it

Reviewed by:	imp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D54308
2025-12-26 10:35:59 -05:00
Dimitry Andric 1c9ff80f06 tools.build: add sys/cdefs.h to SYSINCS, since lots of other headers use it
This is needed to let the legacy stage compile against newer versions of
sys/font.h, which transitively includes sys/cdefs.h, and requires the
new __nonstring macro from it.

Fixes:		e2c93ed09f
MFC after:	3 days
2025-12-26 16:26:13 +01:00
Michael Osipov 66604463e7 bhyve_config.5: Fix consistency and terms in manpage
Correct inconsistent spelling of terms and duplication.

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54370
2025-12-26 15:52:47 +01:00
Dimitry Andric e2c93ed09f sys/font.h: avoid warnings about too-long initializer strings
Mark `font_header::fh_magic` as `__non_string`, to avoid a warning from
clang 21 similar to:

    /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:763:15: error: initializer-string for character array is too long, array size is 8 but initializer has size 9 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      763 |                 .fh_magic = FONT_HEADER_MAGIC,
          |                             ^~~~~~~~~~~~~~~~~
    /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/font.h:109:27: note: expanded from macro 'FONT_HEADER_MAGIC'
      109 | #define FONT_HEADER_MAGIC       "VFNT0002"
          |                                 ^~~~~~~~~~

MFC after:	3 days
2025-12-26 15:32:09 +01:00
Dimitry Andric cd880010c4 pmcannotate: avoid accessing uninitialized local variables
Initialize `tbfl` and `tofl` to NULL, and check whether they are
non-NULL before calling remove(3) on them, to avoid warnings from clang
21 similar to:

    usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tbfl' is uninitialized when used here [-Werror,-Wuninitialized]
      746 |                 FATAL(exec, "%s: Impossible to locate the binary file\n",
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      747 |                     exec);
          |                     ~~~~~
    usr.sbin/pmcannotate/pmcannotate.c:57:9: note: expanded from macro 'FATAL'
       57 |         remove(tbfl);                                                   \
          |                ^~~~
    usr.sbin/pmcannotate/pmcannotate.c:695:12: note: initialize the variable 'tbfl' to silence this warning
      695 |         char *tbfl, *tofl, *tmpdir;
          |                   ^
          |                    = NULL
    usr.sbin/pmcannotate/pmcannotate.c:746:3: error: variable 'tofl' is uninitialized when used here [-Werror,-Wuninitialized]
      746 |                 FATAL(exec, "%s: Impossible to locate the binary file\n",
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      747 |                     exec);
          |                     ~~~~~
    usr.sbin/pmcannotate/pmcannotate.c:58:9: note: expanded from macro 'FATAL'
       58 |         remove(tofl);                                                   \
          |                ^~~~
    usr.sbin/pmcannotate/pmcannotate.c:695:19: note: initialize the variable 'tofl' to silence this warning
      695 |         char *tbfl, *tofl, *tmpdir;
          |                          ^
          |                           = NULL

MFC after:	3 days
2025-12-26 14:37:53 +01:00
Dimitry Andric 3054e22e45 bsnmpd: avoid warnings about too-long initializer strings
Mark `UTC` as `__non_string`, to avoid a warning from clang 21 similar
to:

    usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c:339:29: error: initializer-string for character array is too long, array size is 3 but initializer has size 4 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    --- all_subdir_usr.sbin ---
      339 |         static const char UTC[3] = "UTC";
          |                                    ^~~~~

MFC after:	3 days
2025-12-26 14:27:23 +01:00
Simon Wollwage eaa424e3bd snmp_pf: remove errno usage after pfctl_get_status_h change
pfctl_get_status_h() does not set errno, so don't log it.

PR:		291936
Reviewed by:	kp
2025-12-26 11:50:37 +01:00
Kristof Provost 2e7699355f pf: don't reject route-to'd too-large packets
If we're sending a packet via pf_route()/pf_route6() we check for packet
size and potentially generate ICMP(6) packet too big messages. If we do,
don't consider this a rejected packet. That is, return PF_PASS and set
the mbuf to NULL rather than returning PF_DROP.

This matters for locally generated packets, because with PF_DROP we
can end up returning EACCES to userspace, causing the connection to
terminate. Instead, with PF_PASS and a NULL mbuf this is translated to
PFIL_CONSUMED, which does not return an error to userspace.

MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-12-26 10:58:59 +01:00
Dimitry Andric a3394b6a23 m4: avoid warnings about too-long initializer strings
Mark `digits` as `__non_string`, to avoid warnings from clang 21 similar
to:

    usr.bin/m4/misc.c:123:27: error: initializer-string for character array is too long, array size is 36 but initializer has size 37 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      123 |         static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
          |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

MFC after:	3 days
2025-12-26 01:30:36 +01:00
Dimitry Andric ba0a115122 makefs: avoid warnings about too-long initializer strings
Mark `direntry::deName` as `__non_string`, to avoid warnings from clang
21 similar to:

  usr.sbin/makefs/msdos/msdosfs_vnops.c:512:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    512 |         {       ".          ",                          /* the . entry */
        |                 ^~~~~~~~~~~~~
  usr.sbin/makefs/msdos/msdosfs_vnops.c:522:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
    522 |         {       "..         ",                          /* the .. entry */
        |                 ^~~~~~~~~~~~~

MFC after:	3 days
2025-12-26 01:22:18 +01:00
Igor Ostapenko ecb58f931d kyua: Fix prompt of "debug -p" command 2025-12-25 20:41:22 +00:00
Dimitry Andric 98c3d868fb fsck_msdosfs: avoid warnings about too-long initializer strings
Mark `dot_name` and `dotdot_name` as as `__non_string`, to avoid
warnings from clang 21 similar to:

    sbin/fsck_msdosfs/dir.c:466:39: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      466 | static const u_char dot_name[11]    = ".          ";
          |                                       ^~~~~~~~~~~~~
    sbin/fsck_msdosfs/dir.c:467:39: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      467 | static const u_char dotdot_name[11] = "..         ";
          |                                       ^~~~~~~~~~~~~

MFC after:	3 days
2025-12-25 21:34:00 +01:00
Dimitry Andric 5629b5cf79 cuse(3): annotate cuse_init() to suppress thread safety analysis
This avoids warnings from clang 21, similar to:

    /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
      111 |         TAILQ_INIT(&h_cuse);
          |                     ^
    /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
    /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]
      112 |         TAILQ_INIT(&h_cuse_entered);
          |                     ^
    /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis]

MFC after:	3 days
2025-12-25 19:02:40 +01:00
Rick Macklem 4f184fd35d nfsd.8: Add a short paragraph w.r.t. NFSv3 vs NFSv4 setup
The nfsd can be configured to support NFSv3, NFSv4 or both
of them.

This patch adds a short paragraph to nfsd.8 to explain this.

This is a content change.

Reviewed by:	kib, zaiee (manpages)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54279
2025-12-24 08:29:29 -08:00
Dimitry Andric 160077a4d7 OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases
In commit cf1eaaf41c I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.

However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.

Fixes:		cf1eaaf41c
MFC after:	1 week
2025-12-24 16:52:48 +01:00
Dimitry Andric 8d5a11cd01 src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob
In commit 2e47f35be5 libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.

However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).

Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.

PR:		287447
Reviewed by:	emaste
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D50956
2025-12-23 22:01:40 +01:00
Michael Osipov 5819f8b285 bhyve.8: Fix consistency and terms in manpage
Correct inconsistent spelling of terms and duplication.

Reviewed by:	ziaee
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D54332
2025-12-23 20:12:44 +01:00
Doug Moore 1e8c2cb328 vnode_pager: use ptoa(), atop()
In vnode_pager.c, use ptoa() or atop() instead of arithmetic with
PAGE_SIZE or PAGE_SHIFT.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D49330
2025-12-23 12:34:20 -06:00
Gleb Smirnoff 1aea5b0ba7 nvme: make the interface standard file
This makes nvme.ko and nvd.ko loadable.

Fixes:	aed44717a1
2025-12-23 09:51:25 -08:00
Poul-Henning Kamp a7e0f6a3dc Specialize the REALTEK RTL8153 quirk to just rev=0x31fd 2025-12-23 17:04:10 +00:00
Alexander Ziaee 3c83b5d340 udl.4: Tweak HARDWARE for hardware release note
Fixes:	97fa62708f (udl.4: Consolidate HARDWARE and add HISTORY)
2025-12-23 09:56:09 -05:00
Alexander Ziaee 97fa62708f udl.4: Consolidate HARDWARE and add HISTORY
Some of the information needed for the HARDWARE section was the entire
DESCRIPTION section, so merge the two. While here, add the HISTORY of
this driver, add "driver" to the document description matching other
drivers, and tag the SPDX license identifier for mechanical parsing.

MFC after:	3 days
2025-12-23 09:40:31 -05:00
Alexander Ziaee f7245a27e8 cdce.4: Add RTL8153 to HARDWARE
Fixes:	1b1fb628a1 (Quirk Realtek RTL8153 to config#1)
2025-12-23 08:55:57 -05:00
Alexander Ziaee 03752041e4 cdce.4: Minor polish
+ Tag spdx license identifier	+ Fix "e.g.,"s to quiet linter
+ Remove useless Nd quoting	+ Put example in EXAMPLES

MFC after:	3 days
2025-12-23 08:54:21 -05:00
Alexander Ziaee fbc321b9cd camcontrol.8: Descriptions before examples
This page has a lot of examples, so having them in the previous order
can be confusing. Rewrite to the normal order where the descriptions
come before the command, followed by a colon, which is still clear even
jumping to the middle of the section.

PR:			291759
MFC after:		3 days
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D54285
2025-12-23 08:40:29 -05:00
Dag-Erling Smørgrav 745c6c0431 Resurrect standalone command
While command(1) is now classified by POSIX as an intrinsic utility and
no longer required to exist as a standalone program, it turns out that
we still have a use for it (cf. env(1)), so resurrect it.

PR:		291879
Fixes:		4100bd6caa ("usr.bin: Remove intrinsic utilities")
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D54341
2025-12-23 11:36:39 +01:00
Xin LI ae12432049 MFV 762f11d98d: xz 5.8.2.
MFC after:	7 days
2025-12-23 00:24:13 -08:00
Wei Hu d0a2bd2765 mana: support jumbo packet size
Remove the restriction of up to 4k packet size. Now the driver
supports up to MJUM16BYTES size packets as long as hardware
supporting it.

Tested on VMs in Azure.

Tested by:	whu
MFC after:	1 week
Sponsored by:	Microsoft
2025-12-23 07:00:38 +00:00
Wei Hu 44f656641c Hyper-V: hn: just call vf's ioctl when changing mtu
When changing mtu, if a vf is attached to the netvsc interface, just
calling its ioctl to change vf's mtu is good enough.

Tested by:	whu
MFC after:	3 days
Sponsored by:	Microsoft
2025-12-23 05:38:40 +00:00
Rick Macklem b94e4c7037 RELNOTES: Add an entry for 8e3fd450cc and friends 2025-12-22 18:51:41 -08:00
Rick Macklem 60eb371c2b UPDATING: Add an entry for commit 9f49f436a9 2025-12-22 15:28:59 -08:00
Rick Macklem e35191ccf3 nfs: Add some support for POSIX draft ACLs
An internet draft (expected to become an RFC someday)
https://datatracker.ietf.org/doc/draft-ietf-nfsv4-posix-acls
describes an extension to NFSv4.2 to handle POSIX draft ACLs.

This is the final patch in the series that enables
the extension of NFSv4.2 to support POSIX draft ACLs.
At this time, only UFS mounted with the "acls" option
will work, and only for FreeBSD built with these patches.
Patches for client and server for the Linux kernel are
in the works.  (I'll admit my next little project is
cleaning the Linux patches up for submission for upstream.)

To make these changes really useful, the FreeBSD port
of OpenZFS needs to be patched to add POSIX draft ACL
support.  (Support for POSIX draft ACLs is already in
the Linux port of OpenZFS.)

Interopeability with NFSv4.2 clients and servers that
do not support this extension should not be a problem.

Fixes:	a35bbd5d9f ("nfscommon: Add some support for POSIX draft ACLs")
2025-12-22 15:22:09 -08:00
Rick Macklem 9f49f436a9 nfs: Add some support for POSIX draft ACLs
An internet draft (expected to become an RFC someday)
https://datatracker.ietf.org/doc/draft-ietf-nfsv4-posix-acls
describes an extension to NFSv4.2 to handle POSIX draft ACLs.

This is the fifth of several patches that implement the
above draft.

This one mostly adds an extra argument to two functions
in nfscommon.ko.  Unfortunately, these functions are
called in many places, so the changes are numerous, but
straightforward.

Since the internal KAPI between the NFS modules is changed
by this commit, all of nfscommon.ko, nfscl.ko and nfsd.ko
must be rebuilt from sources.

There should be no semantics change for the series at
this point.

Fixes:	a35bbd5d9f ("nfscommon: Add some support for POSIX draft ACLs")
2025-12-22 13:51:15 -08:00
Poul-Henning Kamp 1b1fb628a1 Quirk Realtek RTL8153 to config#1 so if_cdce claims it. Works much better. 2025-12-22 21:24:42 +00:00
Alan Somers f51e9d0e09 fusefs: Fix further intermittency in the BadServer.ShortWrite test case
After being unmounted, the mockfs server would occasionally read from
/dev/fuse again, if the main function didn't exit fast enough, getting
an ENODEV error.  Handle that appropriately.

Reported by:	Siva Mahadevan <me@svmhdvn.name>
Fixes:		d86025c1d4
MFC after:	1 week
Reviewed by:	Siva Mahadevan <me@svmhdvn.name>
Differential Revision: https://reviews.freebsd.org/D54331
2025-12-22 10:18:16 -07:00
Kristof Provost 4f35a84b32 atf_python: support setting interface mtu
Teach the vnet support code to set interface MTU. Some tests make use of
this, so have the framework handle it.

Adapt a few pf tests to use this.

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D54333
2025-12-22 17:28:33 +01:00
Mark Johnston 3a4275a5f1 telnet: Remove usage of ALIGN
gcc doesn't like ALIGN() being applied to an array type.  Just use
__aligned instead.

Reported by:	Jenkins
Reviewed by:	brooks
Fixes:		80203a27e9 ("Add sys/_align.h replacing machine/_align.h")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54290
2025-12-22 15:18:52 +00:00
Mark Johnston da8ab13249 inotify: Avoid resetting the cookie
The IN_MOVED_FROM and _TO events only apply to names in a watched
directory, never to a watched directory itself.  So, the cookie value
there is always zero, and in particular we should not reset the
caller-provided cookie value, as it may be used later.

Add a regression test.

Reported by:	arrowd
MFC after:	1 week
2025-12-22 14:47:27 +00:00
Mark Johnston 15178d8ed2 pf: Fix state handling when ICMP packets are diverted
Commit 66f2f1c832 ("pf: handle divert packets") missed a case that I
happened to hit while testing something.

Add a regression test for the ICMP case, based on the existing test.
Fix a buglet in the existing test (missing whitespace after "[").

Reviewed by:	kp
Sponsored by:	OPNsense
Sponsored by:	Klara, Inc.
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D54321
2025-12-22 14:47:27 +00:00
Konstantin Belousov 183513d15f sys/netipsec: ensure sah stability during input callback processing
Citing ae: this fixes some rare panics, that are reported in
derived projects: `panic: esp_input_cb: Unexpected address family'.

Reported by:	ae
Tested by:	ae, Daniel Dubnikov <ddaniel@nvidia.com>
Reviewed by:	ae, Ariel Ehrenberg <aehrenberg@nvidia.com> (previous version)
Sponsored by:	NVidia networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54325
2025-12-22 14:31:25 +02:00