Commit graph

298204 commits

Author SHA1 Message Date
Bjoern A. Zeeb
c8a6676eb6 LinuxKPI: 802.11: crypto pn lengths
Define the last missing PN length and for consistency use them
in struct ieee80211_key_seq (even though a 6 is a 6 is a 6).

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-03-18 09:22:00 +00:00
Bjoern A. Zeeb
7513a0afe5 net80211: make use of IEEE80211_KEY_BITS for debug messages
Use %b with IEEE80211_KEY_BITS for the debug logging in
ieee80211_crypto.c rather than just printing the hex value, which
makes some of the messages more obvious and avoids having the header
file next to one at all times.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D49369
2025-03-18 09:21:57 +00:00
Bjoern A. Zeeb
db8ceb8e59 net80211: cleanup keyidx argument of ieee80211_notify_michael_failure()
Instead of passing -1 to the function in ieee80211_crypto_demic(),
use the defined IEEE80211_KEYIX_NONE.
net80211 uses ieee80211_keyix not u_int as type for the key index
internally.  Use that.  This also helps when printing the -1 unsigned
as it stays within the expected numerical scope and makes the debug
message more readable.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D49368
2025-03-18 09:21:47 +00:00
Bjoern A. Zeeb
0461600dea net80211: correct IEEE80211_KEY_BITS
Not only are some of the bits missing, \4 and following were also
off-by-one.  Correct that so we can use them instead of reading
hex numbers.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D49366
2025-03-18 09:21:31 +00:00
Konstantin Belousov
12bff22669 .git-blame-ignore-revs: one more revision for rtld
Sponsored by:	The FreeBSD Foundation
2025-03-18 03:36:05 +02:00
Konstantin Belousov
1c8cdd807a rtld: fix several style(9) bugs
Sponsored by:	The FreeBSD Foundation
2025-03-18 03:34:03 +02:00
Navdeep Parhar
6460c327f6 libifconfig: Fix nits in the descriptions of active 100G cables.
This is a cosmetic change affecting the "plugged: ..." line in the
output of ifconfig -v.  Both the 100G active cables were missing a
closing parenthesis.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2025-03-17 16:05:25 -07:00
Mark Johnston
f506d5af50 uma: Avoid excessive per-CPU draining
After commit 389a3fa693, uma_reclaim_domain(UMA_RECLAIM_DRAIN_CPU)
calls uma_zone_reclaim_domain(UMA_RECLAIM_DRAIN_CPU) twice on each zone
in addition to globally draining per-CPU caches. This was unintended
and is unnecessarily slow; in particular, draining per-CPU caches
requires binding to each CPU.

Stop draining per-CPU caches when visiting each zone, just do it once in
pcpu_cache_drain_safe() to minimize the amount of expensive sched_bind()
calls.

Fixes:		389a3fa693 ("uma: Add UMA_ZONE_UNMANAGED")
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	gallatin, kib
Differential Revision:	https://reviews.freebsd.org/D49349
2025-03-17 20:12:58 +01:00
Vladimir Kondratyev
027b93c2f5 acpi_asus_wmi(4): Handle TUF-specific hotkeys internally
- Cycle TUF laptop RGB mode on AURA key press
- Switch TUF 'Throttle Thermal Policy' with 'Fan' key

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D48985
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
d5bf6a7245 acpi_asus_wmi(4): Add support for WMI event queue
Event codes are expected to be retrieved from a queue on at least some
models. Specifically, very likely the ACPI WMI devices with _UID ATK are
queued whereas those with ASUSWMI are not.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48984
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
f134662a1a acpi_asus_wmi(4): Improve keyboard backlight support.
- Fix maximal keyboard backlight level, Although Linux source code
  comment says that backlight level is encoded in 3 bits of data,
  actual code limits maximum level to 3.
- Add backlight(9) support for keyboard
- Turn off/on keyboard backlight on suspend/resume

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48983
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
5e41194bfc acpi_asus_wmi(4): Add EVDEV support
Use input event device to export hotkey events.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48982
2025-03-17 18:45:14 +03:00
Cheng Cui
a8d2bccb87
tcp cc: use tcp_compute_pipe() for pipe in xx_post_recovery() directly
This follows up with commit 67787d2004, and obsoletes the non-default
pipe calculation from commit 46f5848237 nearly 25 years ago.

Reviewed by: rscheff
Differential Revision: https://reviews.freebsd.org/D49247
2025-03-17 09:00:50 -04:00
Warner Losh
b0375f78e3 usb-msctest: Be more conservative setting GETMAXLUN quirk
Only set the GETMAXLUN quirk when it causes an error, but don't set it
when it returns 0. Since we reset the device when we set any quirk, only
set this quirk when it generates an error so umass will avoid it. When
the command works, there's no reason for umass to avoid it at all.

MFC After: 1 week
Sponsored by: Netflix
2025-03-16 13:23:25 -06:00
Cyrus Rahman
b39f500e6a stand: lines with comments a '"' in loader.conf are ignored
So the problem is that the lua parser in /boot/lua/config.lua is
splitting the line on the '=', sending the first match to the key and
the second to the value.

In the problem case, the value is:
   '"test b"               # This is "test_directive_b"'
Then the value gets matched against QVALEXPR = '"(.*)"'.

This cleans up the value by removing the first and last '"', but in this
case turns it into:
  test b"               # This is "test_directive_b
which then gets rejected in processEnvVar() with MSG_FAILSYN_QUOTE,
since values aren't allowed to contain '"'.

Changing QVALEXPR to '([-%w_]+)' fixes this problem.  Since the value is
explicitly prevented from containing quotes, it's not unreasonable to
load it from an expression that excludes them.  The only other place
this is used is in the 'exec="command"' expression, which also should
not contain '"' in the command value.

PR: 265001
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35975
2025-03-16 08:46:57 -06:00
Warner Losh
9ea38ca4a8 umass/quirk: Remove useless quirk for Transcend flash
I have several of these. They all work without these quirks (either the
auto quirk mechanism does the right thing, or a likely
soon-to-be-removed vendor catch-all does the right thing, or no probing
at all does the right hting).

Both PREVENT ALLOW and SYNCHRONIZE CACHE are (a) unimplemented but (b)
return the proper asc/ascq code so da just does the right thing, quirk
or no. This was a left-over from the days where you'd get scary error
messages, but we'd work just fine. Now that the scary error messages are
gone (and only a calm one under bootverbose), this can be deleted.

Sponsored by:		Netflix
2025-03-15 21:47:44 -06:00
Warner Losh
4804a461b5 umass/quirks: Remove nonsensical NO_GETMAXLUN quirks
We only try to do a GETMAXLUN query of BBB devices. If we're forcing the
device to be CBI, then it's not BBB. Delete the quirks from there. Also,
UFI devices are all CBI as well, so remove the quirk from there as well.
Confirmed this isn't needed with three different floppy disk drives I
have.

Sponsored by:		Netflix
2025-03-15 21:45:31 -06:00
Navdeep Parhar
011e3d0b8b cxgbe(4): Perform Conventional Reset instead of FLR on the device.
The driver uses bus_reset_child on its parent to reset itself but that
performs an FLR whereas the hardware needs a Conventional Reset[1] for
full re-initialization.  Add routines that perform conventional hot
reset and use them instead.  The available reset mechanisms are:
* PCIe secondary bus reset (default)
* PCIe link bounce

hw.cxgbe.reset_method can be used to override the default.  The internal
PL_RST is also available but is for testing only.

[1] 6.6.1 in PCI Express® Base Specification 5.0 version 1.0

MFC after:	1 month
Sponsored by:	Chelsio Communications
2025-03-15 18:16:42 -07:00
Maxim Konovalov
2bc9d7a3ac bsd-family-tree: add FreeBSD 13.5 2025-03-15 16:52:05 +00:00
Slava Shwartsman
5963423232 libibverbs: Extend support of NDR rates
NDR(106.25 Gbps) support exposed new data rates:
800 Gbps - NDR 8x.
1200 Gbps - NDR 12x.

Utility methods were updated to support the new rates mentioned above:
1) Rate to mult - Convert the IB rate enum to a multiple of 2.5 Gbps.
2) Rate to mbps - Convert IB rate enum to the mbps value.

In addition, speed_str() of ibv_devinfo was updated to consider the new
NDR rate.

Reference:      IB Spec Release 1.5
PR:             285305
MFC after:      1 week
Sponsored by:   NVidia networking

Change-Id: I77541e406f700585fbfeddc162d5a0e7b79a1c11
Signed-off-by: Slava Shwartsman <slavash@nvidia.com>
2025-03-15 06:44:07 +02:00
Doug Moore
b82d789759 vm_object: add getpages utility
vnode_pager_generic_getpages() and swap_pager_getpages_locked() each
include code to read a few pages behind, and a few pages ahead of, a
specified page range. The same code can serve each function, and that
code is encapsulated in a new vm_object_page function. For the swap
case, this also eliminates some needless linked-list traversal.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D49224
2025-03-14 21:43:44 -05:00
Ceri Davies
36782aaba4 wlanstats: update usage, improve man page
wlanstats prints the wrong usage statement, including a nonexistent -a
flag (*) and a description of -m that suggests multiple arguments.
Make the manpage slightly more clear.

(*) the implementation of that is #if 0 and the option was disabled
    in 530c13c540.

Sponsored by:	The FreeBSD Foundation (commit)
PR:		285413
MFC after:	3 days
Reviewed by:	ziaee
Differential Revision: https://reviews.freebsd.org/D49365
2025-03-14 21:04:51 +00:00
Ed Maste
222c850503 kern.mk: Update SSP comment (not limited to GCC)
Sponsored by:	The FreeBSD Foundation
2025-03-14 16:21:34 -04:00
Colin Percival
55c3348ed7 acpi_pci: Add quirk for DELAY-after-EJ0
On some EC2 instances, there is a race between removing a device from
the system and making the PCI bus stop reporting the presence of the
device.  As a result, a PCI BUS_RESCAN performed immediately after
the _EJ0 method returns "sees" the device which is being ejected, which
then causes problems later (e.g. we won't recognize a new device being
plugged into that slot because we never knew it was vacant).

On other operating systems the bus is synchronously marked as needing
to be rescanned but the rescan does not occur until O(1) seconds later.

Create a new ACPI_Q_DELAY_BEFORE_EJECT_RESCAN quirk and set it in EC2
AMIs, and add a 10 ms DELAY between _EJ0 and BUS_RESCAN when tht quirk
is set.

Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D49252
2025-03-14 11:35:35 -07:00
Ed Maste
1cae7121c6 Enable LLVM_BINUTILS by default
Starting in 2014 FreeBSD migrated from GNU binutils to ELF Tool Chain
tools.  At that time there were no usable LLVM versions of those tools,
but they have been developing rapidly since then.  Migrate to LLVML's
tools for both functionality and maintainability reasons.

This will eventually support the use of link-time optimization (LTO) in
the FreeBSD base system.  LTO runs optimization passes over the entire
executable (or library) at link time and thus allows for more effective
optimization than when performed on individual compilation units.

When using LTO object files (.o) including those contained in static
library archives (.a) contain LLVM IR bitcode rather than target
object code.  This means that utilities that operate on object files
need to support LLVM IR.

As with ELF Tool Chain the LLVM tools aim for command line and output
format compatibility with GNU binutils, although there are a few minor
differences.  Where these cause a material issue (breaking a port or
eliminating required functionality) we can submit LLVM bugs and work
on patches.

PR:		258872 (exp-run)
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49361
2025-03-14 13:29:06 -04:00
Bjoern A. Zeeb
4a4eee5533 iwlwifi: adjust a debug comment referring to a PR
A FreeBSD specific comment asked people to report to a PR if they see
this.  By now we got enough feedback and also left this in a release.
Simply point to the PR so people can check the status but not longer
ask to submit a report to the PR.

Sponsored by:	The FreeBSD Foundation
PR:		274382
MFC after:	3 days
2025-03-14 16:32:14 +00:00
Bjoern A. Zeeb
19df0c5abc LinuxKPI: make __kmalloc() play by the rules
According to Documentation/core-api/dma-api.rst kmalloc() is supposd
to provide physically contiguous memory. [1]

In order to guarantee that allocations are contiguous even if using
PAGE_SIZE or larger check the size and use contigmalloc if needed.
This makes use of 9e6544dd6e (and following) allowing free(9) to
also work for contigmalloced memory.

Sponsored by:	The FreeBSD Foundation
Pointed out by:	jhb [1]
Reviewed by:	jhb, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D46656
2025-03-14 16:24:52 +00:00
Bjoern A. Zeeb
a5c7b44d6a LinuxKPI: always use contig allocations in linux_alloc_kmem()
In linux_alloc_kmem() [used by *get_page*()] we always at least allocate
PAGE_SIZE and we want the allocation to be contiguous so it can be passed
to DMA.  Always use kmem_alloc_contig() and only change the low argument
depending on the GFP_DMA32 flag being given or not.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	jhb, dumbbell
Differential Revision: https://reviews.freebsd.org/D46661
2025-03-14 16:24:52 +00:00
Enji Cooper
d2a55e6a93 openssl: update ASM and version info for 3.0.16 import
MFC after:	1 week
MFC with:	0d0c8621fd
Differential Revision:	https://reviews.freebsd.org/D49297
2025-03-13 23:42:02 -07:00
Enji Cooper
0d0c8621fd openssl: Import OpenSSL 3.0.16
This release incorporates the following bug fixes and mitigations:
- [CVE-2024-13176](https://www.openssl.org/news/vulnerabilities.html#CVE-2024-13176
- [CVE-2024-9143](https://www.openssl.org/news/vulnerabilities.html#CVE-2024-9143)

Release notes can be found at:
https://openssl-library.org/news/openssl-3.0-notes/index.html

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D49296
2025-03-13 23:40:59 -07:00
Wei Hu
47f4137e44 mana: remove redundant doorbell in mana_poll_rx_cq()
With the last commit to refill the rx mbuf in batch, the doorbell
in mana_poll_rx_cq() becomes redundant. Remove it to save a few
microseconds spent in mmio call.

Reported by:	NetApp
Reviewed by:	Tallamraju, Sai
Tested by:	whu
Fixes:		9b8701b8 ("mana: refill the rx mbuf in batch")
MFC after:	3 days
Sponsored by:	Microsoft
2025-03-14 05:51:34 +00:00
Fabian Keil
f7856fe81d g_dev_orphan(): Return early if the device is already gone
The following panic was the result of running "cdcontrol eject" after
using the physical ejection key on the device before the tray was
actually ejected. So we have hardware racing software.

The device was loaded with a DVD.

Resulted in a NULL pointer dereference

g_dev_orphan() at g_dev_orphan+0x2e/frame 0xfffffe01eba0a9f0
g_resize_provider_event() at g_resize_provider_event+0x71/frame 0xfffffe01eba0aa20
g_run_events() at g_run_events+0x20e/frame 0xfffffe01eba0aa70
fork_exit() at fork_exit+0x85/frame 0xfffffe01eba0aab0
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01eba0aab0

Avoid this possibility and return early of dev is NULL already.

PR:  215856
Reviewed by: imp (I've triggered this once or twice over the years too)
Sponsored by: Netflix
2025-03-13 17:20:00 -06:00
Alexander Ziaee
732c168842
ObsoleteFiles: Remove if_rtwn.4 removal
if_rtwn.4 was previously removed, but actually it is correct because
the interfaces is called rtwn.

Fixes:			4262dbc579
MFC after:		3 days
Reported by:		bz
Approved by:		mhorne (mentor)
Differential Revision:	https://reviews.freebsd.org/D49323
2025-03-13 19:18:11 -04:00
Christos Margiolis
68b6567d09 snd_hda: Patch Framework AMD 13th gen
Redirect sound to headphone jack when plugged in.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D49346
2025-03-13 22:51:45 +01:00
Brooks Davis
d6c34d1444 rc.d/sendmail: remove a obsolete upgrade seatbelt
This check was in place to aid the transition from sendmail pre-8.10.
8.10 was released in 2000.  It's not possible to upgrade directly from
such as system (Freebsd 3?) to FreeBSD 15 so we can drop this.

Reviewed by:	gshapiro, jhb
Differential Revision:	https://reviews.freebsd.org/D49308
2025-03-13 19:41:35 +00:00
John Baldwin
f402078d09 device_pager: Assert that the handle is not NULL
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D49333
2025-03-13 12:57:40 -04:00
John Baldwin
00d78c5007 rwmlock/rwlock/sx: Print the pointer of destroyed locks in panic messages
Suggested by:	markj
Reviewed by:	kib, markj
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D49332
2025-03-13 12:57:06 -04:00
John Baldwin
a52a51a2d5 lockmgr/rmlock/rwlock/sx: Make various assertions more robust
Print pointers to locks instead of their names to avoid a nested panic
if the lock object is corrupted.

Reviewed by:	markj
Sponsored by:	AFRL, DARPA
Differential Revision:	https://reviews.freebsd.org/D49331
2025-03-13 12:57:06 -04:00
Gleb Smirnoff
c56e75390e inpcb: make sure we don't pass uninitialized faddr to in_pcbladdr()
This very theoretical edge case was discovered by Coverity, not sure if
it was introduced by 2af953b132 or was there before.

CID:			1593695
Fixes:			2af953b132
2025-03-13 09:53:40 -07:00
Gleb Smirnoff
5f42f87fc4 inpcb: in_pcbinshash() can't fail on connect(2)
CID:			1593687
2025-03-13 09:53:40 -07:00
Gleb Smirnoff
c78a14a2b8 inpcb: in_pcb_lport_dest() doesn't use lportp as input argument
This assignment just created false positive analyzer report.

CID:			1593692
2025-03-13 09:53:40 -07:00
Konstantin Belousov
9491ae6f0d procstat.1: correct description of the kstack subcommand after removal of swapping
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
d76a31ca74 procstat.1: document kqueues
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
8289705834 procstat.1: document rlimitusage
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
0832381247 procstat.1: sort subcommands
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
28f4cf9217 procstat(1): dump kqueues
Example output from the 'procstat -a kqueues':
    PID       KQFD   FILTER      IDENT      FLAGS     FFLAGS       DATA      UDATA     STATUS
   2323         13     READ          5          -          -          0 0x19c290616000          -
   2323         13     READ          8          -          -          0 0x19c29064f070          -
   2323         13     READ         10          -          -          0 0x19c29064f0e0          -
   2323         13   SIGNAL          1          C          -          0        0x0          -
   2323         13   SIGNAL          2          C          -          0        0x0          -
   2323         13   SIGNAL          3          C          -          0        0x0          -
   2323         13   SIGNAL         13          C          -          0        0x0          -
   2323         13   SIGNAL         14          C          -          0        0x0          -
   2323         13   SIGNAL         15          C          -          0        0x0          -
   2323         13   SIGNAL         20          C          -          0        0x0          -

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
bf46aec4b2 libprocstat: add helper to query knotes for specific kqueue
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
4cf6cae879 Document KERN_PROC_KQUEUE
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
e60f608eb9 Add sysctl kern.proc.kqueue
reporting registered events in the specified kqueue.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00
Konstantin Belousov
0a7c164d91 kern/sys_eventfd.c: fix includes
Remove redundant includes like sys/types.h and sys/param.h due to
sys/systm.h. Sort alphabetically.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D49163
2025-03-13 18:09:35 +02:00