Commit Graph

305753 Commits

Author SHA1 Message Date
Bjoern A. Zeeb 32ea820982 LinuxKPI: 802.11: add compat.linuxkpi.80211.IF.dump_stas_queues
Extend the normal compat.linuxkpi.80211.IF.dump_stas sysctl by
queue information.  This was helpful for debugging various issues,
like selecting the outbound queue, stopping queues for BAR and helped
finding multiple bugs.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-12-29 02:48:14 +00:00
Ayrton Munoz b6672803a1 cross-build: Avoid adding <sys/cdefs.h> to SYSINCS
Summary:
The sys/cdefs.h in src is incompatible with glibc's sys/cdefs.h so
cross-building broke when the former was added to SYSINCS in 1c9ff80f06. This
commit adds a guard around that to only do that when building on FreeBSD. This
should fix github CI.

Test Plan:
Ran buildkernel using tools/build/make.py on linux in github CI and
locally on FreeBSD to double check nothing broke.

Reviewed by:    dim
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54385
2025-12-29 03:04:45 +01:00
Konstantin Belousov 3088263177 man pages: provide some description for extended errors
, related functions, and the EXTERROR_VERBOSE environment variable.

Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 874cdf6af6 exterr: in verbose mode, print the source file name
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 5685c07b5a Add automatically generated file libc/gen/exterr_cat_filenames.h
MFC after:	1 week
2025-12-29 03:16:25 +02:00
Konstantin Belousov 3ef25acf36 Add a script to auto-generate mapping from exterr category to source file
Reviewed by:	emaste, mkusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 54b52f655e fs/fuse: use dedicated category per source file
Submitted by:	mckusick
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 543c86636f exterr_test: loosen the error string pattern
After addition of the prot and max_prot values, the old error substring
no longer satisfy the check.

Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 14bd57d0a7 exterror.9: describe formatting of optional arguments
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 2904edaf2f vm/vm_mmap.c: inline erronous argument values for extended errors
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 42210fe8dc exterror: Add EXTERROR_VERBOSE env variable to control verbosity
If the variable is set and the process is not suid, __uexterr_format(),
used by err(3), prints errno/category/source line/pX always, not only
when there is no kernel message provided.

Requested by:	mckusick
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 8bff95f3ce exterror: add support for the format specifiers in the extended error msg
Note that we trust kernel code to only request the printout of integer
types, and use the 'j' modifier always.

Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Konstantin Belousov 37ddbbe553 libc/gen/err.c: remove 'extended error' herald from extended error output
Reviewed by:	emaste, mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D54380
2025-12-29 03:16:25 +02:00
Kyle Evans 541a98d7e2 compat: linux: use appropriate variables for copying out old timers
We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage.	A build with an LLVM21 cross-toolchain seems to catch
this.

Reported by:	Florian Limberger <flo purplekraken com>
Reviewed by:	markj
Fixes:		a1fd2911dd ("linux(4): Implement timer_settime64 syscall.")
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D52985
2025-12-28 23:03:33 +01:00
Alex Richardson 4cd7be3e81 sys/xen: Use __printflike() instead of format(printf)
The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:	1 week
2025-12-28 22:16:40 +01:00
Alex Richardson 3c0ea1b629 ocs_fc: Use __printflike() instead of format(printf)
The __printflike macro sets the format to freebsd_kprintf which recent
clang understands and warns about. Fixes the following error:
`passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]`

MFC after:	1 week
2025-12-28 22:16:24 +01:00
Dimitry Andric ae31c10537 bsd.sys.mk: add NO_WCHARACTER_CONVERSION and use it for googletest
This silences warnings about benign implicit character conversions in
googletest's gtest-printers.h.
2025-12-28 20:50:42 +01:00
Dimitry Andric 63d1c3c436 bsd.sys.mk: suppress some new clang 21 warnings for C++
Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:

Suppress -Wc++20-extensions, due to:

    /usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
       96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
          |                                                  ^

Suppress -Wc++23-lambda-attributes, due to:

    /usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
      462 |   if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
          |                                ^

Suppress -Wnullability-completeness, due to:

    /usr/include/c++/v1/string:1068:80: error: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Werror,-Wnullability-completeness]
     1068 |   _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n) {
          |                                                                                ^

MFC after:	3 days
2025-12-28 20:43:12 +01:00
Eugene Grosbein e51047118c ipfw.8: document how to delete nat configuration instance
MFC after:      3 days
2025-12-29 00:47:39 +07:00
Warner Losh b67a7c062b scsi: Make all da error messages greppable
Don't split the error messages across lines. We used to do that ages
ago, but have relaxed style(9) to encourage the opposite so all error
messages can be grepped. This constantly slows me down when I'm helping
others find issues, so start here by splitting according to normal
style(9) rules with a relaxed line length of 90.

Sponsored by:		Netflix
2025-12-28 10:32:05 -07:00
Eugene Grosbein 9fdf49e8a5 ipfw.8: fix misprint after previous change
rulese -> ruleset

MFC after:	3 days
X-MFC-with:	a7b8a5d37b
2025-12-29 00:19:35 +07:00
Eugene Grosbein a7b8a5d37b ipfw.8: fix documentation bug for setmark
A mark set with "setmark" keyword is intended to be "sticky"
and documented as such but in fact it is not yet,
as current implementation lacks "sticky" feature
and its implementation will be not MFC'd, most probably.

Correct the manual page until the implementation improved.

MFC after:	3 days
Discussed with:	Boris Lytochkin <lytboris@gmail.com> (author)
2025-12-29 00:05:22 +07:00
Zhenlei Huang 176075e661 locking.9: Tweak the table column width to fit 80 characters
While here, add some white spaces to improve the readability of source
code.

Reviewed by:	ziaee, #manpages
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D54121
2025-12-28 23:57:51 +08:00
Ed Maste c910c7a3d2 vt: Remove .fnt.uu from Makefile SUFFIXES
The uudecode make rule was removed years ago.

Fixes: 68510f3bac ("Remove uudecode make rule for vt fonts")
2025-12-28 10:53:45 -05:00
Warner Losh faeaa25f56 kernel: MK_REPRODUCIBLE_PATHS for full paths vs /usr/src
There are many environments that you do not want the paths to be
canonicalized. For example, if I always build a product from a specific
path in a jail that's dependent on the product version, I don't want
that to be sanitized to /usr/src because when I have profiling tools run
against multiple kernels, I can't do A/B testing and results processing
if everything points to /usr/src (sadly, the profiling tools cannot
remap back to the original like gdb can). Since we need both active at
the same time, symbloic link fallbacks don't work.

We do want the rest of the build to be reproducible, however. We'll get
the same binaries if we rebuild later since we always rebuild with the
same path.

Turn them both on for maximum reproduction for environments where that
cannot be guaranteed.

Sponsored by:		Netflix
Input from:		emaste, ivy
Differential Revision:	https://reviews.freebsd.org/D52959
2025-12-28 01:16:39 -07:00
Warner Losh 8e8d7d489f loader: Use C99 initializations for file_format
For greppability, use C99 initializers for the struct file_format.

Sponsored by:		Netflix
2025-12-27 22:37:56 -07:00
Warner Losh 424089a0fc loader: Fix powerpc64le by working around slof bug in qemu/slof
Fix powerpc 64 little endian booting by adding some padding. Due to

https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L114
https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L150

using <= instead of <, slof used to loop over the phdrs. It overruns by
1 and so on little endian it swizzles the first 32 bytes of .text. Work
around this by adding 32 bytes of padding after the headers. We should
fix this in slof, but it's in the just released QEMU 10.2, so we have to
pad things here for now.

Now powerpc64le + qemu works.

MFC After: 3 days (maybe EN too)
Reviewed by: adrian, jhibbits
Sponsored by: Netflix
2025-12-27 22:27:03 -07:00
Ed Maste f22cffe433 vt.4: Remove Xr to nonexistent vidcontrol(8)
PR: 291985
Fixes: a8740ba860 ("vt.4: Document increasing scrollback size")
2025-12-27 20:17:09 -05:00
Dimitry Andric e6546807f4 sh: avoid warnings about too-long initializer strings
Mark `optletter` and `t_op::op_text` as `__non_string`, to avoid
warnings from clang 21 similar to:

    bin/sh/options.h:77:36: error: initializer-string for character array is too long, array size is 19 but initializer has size 20 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
       77 | const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
          |                                    ^~~~~~~~~~~~~~~~~~~~~
    bin/test/test.c:153:3: error: initializer-string for character array is too long, array size is 2 but initializer has size 3 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      153 |         {"==",  STREQ},
          |          ^~~~

MFC after:	3 days
Reviewed by:	jilles
Differential Revision: https://reviews.freebsd.org/D54362
2025-12-27 22:58:25 +01:00
Dimitry Andric 086bedb11a tools.build: also add sys/_visible.h to SYSINCS
This is needed since sys/cdefs.h includes sys/_visible.h.

Reported by:	kib
Fixes:		1c9ff80f06
MFC after:	3 days
2025-12-27 00:11:17 +01:00
Doug Moore 939ac0c8fd vnode_pager: clean up undirty_pages()
The first (second) loop of vnode_pager_undirty_pages() includes an
if-test to test whether an iteration is the last (first). Move those
if-tests out of their loops.  That allows the compiler to unroll the
loops.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D54353
2025-12-26 16:07:34 -06:00
Igor Ostapenko 350f319731 kyua: Make "debug -p" skip writing stdout/stderr to tmp files
Reviewed by:	kp, ngie
Differential Revision:	https://reviews.freebsd.org/D54363
2025-12-26 20:06:56 +00:00
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