Commit graph

151483 commits

Author SHA1 Message Date
Michael Tuexen
ccd9c1ef4e icmp: use per rate limit randomized jitter
Using the same random jitter for multiple rate limits allows an
attacker to use one rate limiter to figure out the current jitter
and then use this knowledge to de-randomize the other rate limiters.
This can be mitigated by using a separate randomized jitter for each
rate limiter.
This issue was reported as issue number 10 in Keyu Man et al.:
SCAD: Towards a Universal and Automated Network Side-Channel
Vulnerability Detection

Reviewed by:		rrs, Peter Lei, glebius
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D48804

(cherry picked from commit 923c223f27e792e51ca13c476428adbbf6887551)
2025-02-12 11:04:10 +01:00
Konstantin Belousov
cba91bf59c unlink, rmdir: call notify_upper from VOP pre method instead of syscall
PR:	254210

(cherry picked from commit 1a0cb938f7b461edc40316cb44a80438df674174)
2025-02-11 03:11:49 +02:00
Kevin Bowling
50202e05a3 net: if_media for 100BASE-BX
d82c3e81:
net: if_media for 100BASE-BX

Renumber 1000BASE-BX and add 100BASE-BX sequentially

I added this 1000BASE-BX in 78c63ed260fa20b3500aedfe41dc0dcae9593f51 but
did not connect it to any code yet, appologize for the churn.

7835a4ad:
net: if_media fix syntax/build

Fixes:		d82c3e815a5f ("net: if_media for 100BASE-BX")

(cherry picked from commit d82c3e815a5fc0069562b69145ad695f9aa183f9)
(cherry picked from commit 7835a4ad6948290c92ea55c7be34ae72f4e2b0bd)
2025-02-10 17:48:35 -07:00
Bjoern A. Zeeb
51b3a9dacf lindebugfs: use __func__ not __FUNCTION__
Change to the C99 version and not the old gcc name.
No functional changes.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	dumbbell, emaste
Differential Revision: https://reviews.freebsd.org/D48736

(cherry picked from commit 94e6c8d7d19de68b29233e59c85b16c645c1a872)
2025-02-10 14:52:12 +00:00
Bjoern A. Zeeb
0735e8ddc3 rtw88/rtw89: avoid duplicate top-level directory with debugfs
If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.

Sponsored by:	The FreeBSD Foundation
X-Note:		ath1[01]k and mt76 likely will need a similar change

(cherry picked from commit b4886c4ece3e692c294aa853da7aec849f8d00a2)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
9689622f98 rtw88/rtw89: add module_param to enable/disable HT/VHT and EHT
In order to better test HT and VHT support with LinuxKPI add (tunable)
options disabled by default to on-demand enable HT/VHT
and for rtw89 also EHT.

It is expected that we will remove this FreeBSD-specific code again in
the future.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7a5b55e3b448744b099c274763992cba2e3ebce5)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
be330cd9f9 rtw89: turn on debugfs support
Following 07f6575585bf also turn on debugfs support for rtw89.

Sponnsored by:	The FreeBSD Foundation

(cherry picked from commit 446eab491e523e3d7586e11cb16448e524297da4)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
787787fa89 iwlwifi: module correct -DCONFIG_*
Remove the =1 from -DCONFIG_* in the conditional cases.
They are not needed.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 411c857b4ccedd6491dff9a35e952bc49d053053)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
bd42a25673 LinuxKPI: 802.11: turn on debugfs for iwlwifi and rtw88
Make iwlwifi compile with debugfs after the last updates and turn it on
for both iwlwifi and rtw88 in order to be able to get at least some
useful information on driver/firwmare state.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 07f6575585bf69ae48dffe87c4578057ae4782d8)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
fde943a07e LinuxKPI: 802.11: remove rate_lowest_index()
rate_lowest_index() is no longer used anywhere in our code.
Garbage collect it.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 1b840f09b6b379c0aae5a558ba5a4ed6bb571a85)
2025-02-10 14:52:11 +00:00
Bjoern A. Zeeb
6d24089732 LinuxKPI; 802.11 initalize ic_vht_cap.supp_mcs
Given the channel struct has an extra bool we cannot assign the
information 1:1 to net80211.  While the caps where assigned the
suppoerted mcs sets were not.  Fix that.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit ecb2e5f9c30a8c0ae491d07b2300e37eb599c298)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
1a7956f64b LinuxKPI: 802.11: implement ieee80211_get_{he,eht}_iftype_cap{,_vif}
Implement the combination of all four functions, the *_vif versions
from mac80211.h as a wrapper to the non-*_vif ones in cfg80211.h.
Put the function pairs next to each other and in the right files
and harmonize argument naming, etc.

Both of them have shown up too often in the todo-tracing to bother
enough to implement them now for a time in the future when we will
support HE/EHT.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit c75a558d0729da87ee3c016b57cc8f5ac4fc65d0)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
706c18c8b6 LinuxKPI: 802.11: improve the IMPROVE_HT() macro
Let the macro take a format string and arguments and
add __func__, __LINE__ to the output.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4cdb785bbd7e26cc3f2ed0bb4e5cf7ea83c400b)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
08e6f5e449 LinuxKPI: 802.11: add a print mask for ieee80211_rx_status_flags bits
Add a print mask for use with %b to aid debugging.  It is a lot easier
to read names than numbers.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f1aeb5d850cf26418fb70a16d1304b92c45b5f1d)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
69aeb770a9 LinuxKPI: 802.11: implement wiphy_{,un}lock()
This will help us to get minimally better lock coverage in iwlwifi
though not yet against the LinuxKPI implementation which will likely
switch to this in the future.  At least the TODO() logging noise is
out of the way.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 95a7aa8009877ca95d81967f9af568ef832bb565)
2025-02-10 14:52:10 +00:00
Bjoern A. Zeeb
950dc789cc LinuxKPI: 802.11: make HT compile again
Bring in changes missed during the last driver updates to make HT
compile when enabled.

Sponsored by:	The FreeBSD Foundation
Fixes:		7b43f4d064195

(cherry picked from commit 943a19c666d67424cdde6cbcd096f28359b2d314)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
4eaf978df5 net80211: add IEEE80211_IS_LOCKED()
When trying to sort out a teardown locking problem (downcall in the
driver can sleep) I found that the fan-out tree was getting too big
to fix net80211 locking per-se for this while working on entirely
different problems.
Add IEEE80211_IS_LOCKED() so the driver can check and un-/re-lock as
necessary (as we do in other cases already) to avoid panics on
debug kernels left and right.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48475

(cherry picked from commit 054c5ddf587a7a0c430cf64dbf100b718eafdcc5)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
4d027e53be net80211: (v)ht: use macros at hand
Rather than duplicating the manual logic here and leaving a comment,
use the self-explanatory macros we already have.

No functional changes intended.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48359

(cherry picked from commit 5fdc4824a5e2646a07c0638eca9f5c81b0b85fd5)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
b7be66e4e8 net80211: add missing 80Mhz and 160Mhz channel ranges
We have two arrays, one for 80Mhz and one for 160Mhz.  Both were lacking
frequency ranges for more possibly available configurations (the other
bits of what is valid are for regdomain to set right).

Sponsored by:	The FreeBSD Foundation
Fixes:		67f4aa3878, 04e7bb08a5
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D48357

(cherry picked from commit 1832eb102e10c7f2891c032ecf7b265b75d3cd50)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
594d6c7141 net80211: correct typo s/Insure/Ensure/
No functional changes.

Sposnored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D48358

(cherry picked from commit e6d40f90110ad8026f1af3fa68f836463936ea78)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
1a083d59b6 net80211: HT: check for feature support in ht_recv_action_ht_txchwidth()
ht_recv_action_ht_txchwidth() can blindly change the channel width to
40 Mhz whether or not that is supported.  If 20/40 is not supported
there is nothing to do as the channel width cannot change in that case.

While here mark unused arguments with __unused.

Sponosred by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47857

(cherry picked from commit 30e8252353d95cc77f787ef784942a551d3e0567)
2025-02-10 14:52:09 +00:00
Bjoern A. Zeeb
1a472e9357 net80211: HT: add missing bit descriptions for IEEE80211_AGGR_BITS
The print mask for IEEE80211_AGGR_BITS is missing three fields.
Add them for completness.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47858

(cherry picked from commit 8437d7d6a4d6827ccb78c06341c6e3d847da44dd)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
c5978cd3e4 net80211 / LinuxKPI 802.11: use enum ieee80211_sta_rx_bw for ni_chw
net80211 node ni_chw currently encodes the channel width as Mhz number.
LinuxKPI 802.11 uses enum ieee80211_sta_rx_bw for the same.

Rather than keeping the "20" and "40" throughout the code (eventually
expanded to 80/160/320) switch them over to use the enum throughout.

Once we get to 320Mhz channel widths we would otherwise also need to
extend the uint8_t in struct ieee80211_node; making
enum ieee80211_sta_rx_bw __packed allows us for lots more channel
widths without breaking the KBI.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47891

(cherry picked from commit ca389486a9599768e0ba69dca13c208020623083)
(cherry picked from commit 2c8b0d6205f6f98855773e3a82640b50abb2f2f6)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
36ace2a923 net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage
if STBC will be allowed for VHT RX/TX.
For RX this will only allow us to turn it off but no fine grained
control of the number of supported spatial streams.

Introduce IEEE80211_FVHT_CHANWIDTH_MASK as a helper to make the
spelling out of the IEEE80211_FVHT_MASK more readable.

Update ifconfig to allow setting of these flags.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47838

(cherry picked from commit 243f6925bf818a64f3c996c6a89fec6c8a6ff058)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
b6d4dc0b30 net80211: name IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_{NONE -> NO160}
IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_NONE is confusing as the field does
indicate that the STA does not support 160 (or 80+80) Mhz.
[802.11ac: Table 8-183v-Subfields of the VHT Capabilities Info field]
All the other bits are related to the support of 160Mhz so make it
clear that it does not mean that we do not support any VHT CHAN WIDTH
but merely do not support the optional 160/80+80.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47837

(cherry picked from commit 116102101a566ec8924b397c1523d362008fb35c)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
e7f6461837 net80211: add missing reference for struct ieee80211_vht_mcs_info
Sponsored by:	The FreeBSD Foundation
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D47836

(cherry picked from commit 4294f1cac15300046369d7e464ce96363839757c)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
25017e9971 LinuxKPI: firmware: change order filenames trying to load firmware
Given we have the support in main and stable/14 to load plain firmware
files from /boot/firmware/ make use of that.  Switch the order to
try the original unmangled filename and path first before trying any
replacements.
This reduces time and console noise (especially under bootverbose).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D47682

(cherry picked from commit 30d2f84ef2cba12c67c62a9fe4e1d8e22cf27bf9)
2025-02-10 14:52:08 +00:00
Bjoern A. Zeeb
e6698f0614 rtw89: update Realtek's rtw89 driver.
This adds support for the Realtek 8922AE PCI
wireless network (Wi-Fi 7) adapter.

This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 6d67aabd63555ab62a2f2b7f52a75ef100a2fe75)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
3de0d1929d rtw88: update Realtek's rtw88 driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:   The FreeBSD Foundation

(cherry picked from commit 11c53278a8a3e86e14377f09bbaa7bad193d3713)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
1ff77e61c6 iwlwifi: avoid (hard) hang on loading module
For certain users or chipsets (reports were for CNVi devices but
we are not sure if this is limited or specific to them) loading
if_iwlwifi hangs.

The reason for this is that a SYSINIT (module_load_order()) has not
yet run in this case and the Linux driver tries to load the
chipsets-specific module.  On FreeBSD all supported sub-modules are
part of if_iwlwifi so we do not have to load them separately but
calling into kern_kldload via LinuxKPI request_module while loading
the module gives us a hard hang.

iwlwifi calls request_module_nowait() so we can simply skip over this
and continue and the SYSINIT will do the job later if no other
dependencies fail.

Sponsored by:	The FreeBSD Foundation
PR:		282789
Tested by:	Ruslan Makhmatkhanov, Pete Wright
Differential Revision: https://reviews.freebsd.org/D47994

(cherry picked from commit 87e140a5c6f89eea7ea6320d1ae34566492abfc0)
(cherry picked from commit 5d09d1070737c43738e433b547af1a90c0f10bf1)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
f4e352ef16 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a4128aad8503277614f2d214011ef60a19447b83)
2025-02-10 14:52:07 +00:00
Bjoern A. Zeeb
c57e8af7d5 LinuxKPI: 802.11: adjustments for v6.11 iwlwifi, rtw88 and rtw89
Bring in the LinuxKPI 802.11 compat bits which are altering
the mac80211 KPI.

* In struct ieee80211_bss_conf chandef -> chanreq.
* Various struct ieee80211_ops gained a link_id arguemnt,
  stop gained a suspend flag.
* Various functions gained a link_id argument.
* ieee80211_tx_status() was renamed to ieee80211_tx_status_skb()

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7b43f4d064195bcf66816cb9fe350a1392fe24ce)
2025-02-10 14:52:06 +00:00
Doug Moore
2ee9d7dcdb libkern: don't use MPASS
Using MPASS in libkern breaks buildworld.  Replace MPASS with KASSERT
in three places.

(cherry picked from commit 08f6f78f81e21b21dd002a9389436b0333cb3488)
2025-02-10 08:16:25 -06:00
Doug Moore
16b7da6f7a dev/mana: replace power2 function
Replace is_power_of_2(length) with power2(length).  When length != 0, as in
this case, they produce the same result.  This will allow an implementation
of is_power_of_two to be dropped.

Reviewed by:	alc, markj
Differential Revision:	https://reviews.freebsd.org/D45536

(cherry picked from commit a94ed493b50752cee09245fc312c63b00331f217)
2025-02-10 04:50:32 -06:00
Doug Moore
7bcc7a0b88 libkern: avoid local var in order_base_2()
order_base_2(n) is implemented with a variable, which keeps it from
being used at file scope. Implement it instead as ilog2(2*n-1), which
produces a different result when 2*n overflows, which appears unlikely
in practice.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D46826

(cherry picked from commit b7cbf741d55468ba34305a14ac3acc1c286af034)
2025-02-10 04:30:05 -06:00
Doug Moore
6f309b9d56 log2: move log2 functions from linuxkpi to libkern
Linux has a header file that defines an ilog2 function and some simple
functions/macros that use it: roundup_pow_of_two, is_power_of_2,
rounddown_pow_of_two, and order_base_2.  This change moves three of
those simple functions (all but is_power_of_2) from linuxkpi to
libkern.  It also deletes a few implementations of these functions
that have previously been copied into code for various device drivers,
so that they can use the libkern version.  The is_power_of_2 macro was
not moved because powerof2 in param.h provides almost the same service
already (except that they disagree about whether 0 is a power of two).

Since the linux definitions of these functions were copied into
FreeBSD 11 years ago, linux has improved them, and this change
provides those improvements.  In particular, a giant table of log
values for evaluating ilog2 for constant values is no longer
necessary.

Reviewed by:	alc, markj (previous version)
Differential Revision:	https://reviews.freebsd.org/D45536

(cherry picked from commit c8b0c33b03ac072413b27bed2bdae2ae27426f3a)
2025-02-10 04:29:23 -06:00
Mark Johnston
7443532d5e drm2: Remove one more implementation of ilog2()
Reviewed by:	dougm
Fixes:		b0056b31e900 ("libkern: add ilog2 macro")
Differential Revision:	https://reviews.freebsd.org/D45504

(cherry picked from commit c70c791f06601309201f6ca99d39fee83f5dd368)
2025-02-10 04:28:24 -06:00
Doug Moore
4ed1837853 libkern: add ilog2 macro
The kernel source contains several definitions of an ilog2 function;
some are slower than necessary, and one of them is incorrect.
Elimininate them all and define an ilog2 macro in libkern to replace
them, in a way that is fast, correct for all argument types, and, in a
GENERIC kernel, includes a check for an invalid zero parameter.

Folks at Microsoft have verified that having a correct ilog2
definition for their MANA driver doesn't break it.

Reviewed by:	alc, markj, mhorne (older version), jhibbits (older version)
Differential Revision:	https://reviews.freebsd.org/D45170
Differential Revision:	https://reviews.freebsd.org/D45235

(cherry picked from commit b0056b31e90029553894d17c441cbb2c06d31412)
2025-02-10 04:27:12 -06:00
Gordon Bergling
f424cf5940 mlx4ib(4): Fix some typos in device messages
- s/availible/available/

(cherry picked from commit 84e3ffac12a8dcfeae0a5e0b25afe447ff2d5fa8)
2025-02-10 07:54:24 +01:00
Andreas Kempe
a44843bfa1 ng_hci: add support for Bluetooth Secure Simple Pairing
Add additional messages that allow for secure simple pairing.

PR:		265066
Sponsored by:	The FreeBSD Foundation (review and commit)

(cherry picked from commit 4ae0fa8a2f8bff9a5e96dbfd862b03172c88e697)
2025-02-09 00:36:04 +00:00
Konstantin Belousov
9938f64089 audit/audit.c: fix typo KERNEL_PANICED->KERNEL_PANICKED
(cherry picked from commit 96dcff1a317f648886febbc15e606b4c6c45d11c)
2025-02-08 02:26:56 +02:00
Konstantin Belousov
3ba04b9f31 audit(9): do not touch VFS if panicing
(cherry picked from commit 53ece2bea9ffa654aaa50e5ed66341160194179f)
2025-02-08 02:26:56 +02:00
Andrew Gallatin
d942e2828c mlx5en: Fix SIOCSIFCAPNV
In 4cc5d081d8c23, a change was introduced that manipulated
drv_ioctl_data->reqcap using IFCAP2 bits.  This was noticed
when creating a mixed lagg with mce0 and ixl0 caused the
interfaces' txcsum caps to be disabled.

Fixes: 4cc5d081d8c23
Reviewed by: glebius
Sponsored by: Netflix
MFC After: 7 days

(cherry picked from commit 36fdc42c6a4c828d334471438c4f852e4b5a25e2)
2025-02-07 10:31:40 -05:00
Mark Johnston
794283f94b thread: Add a missing include of asan.h
I didn't notice this during testing because invariants-enabled kernels
implicitly include asan.h via kassert.h.

Reported by:	Lexi Winter <lexi@le-Fay.org>
Fixes:		800da341bc4a ("thread: Simplify sanitizer integration with thread creation")

(cherry picked from commit 7a7063cc54274a44192fb65c71360a5e72c171b9)
2025-02-07 14:46:53 +00:00
Mark Johnston
0db4588bbe thread: Simplify sanitizer integration with thread creation
fork() may allocate a new thread in one of two ways: from UMA, or cached
in a freed proc that was just allocated from UMA.  In either case, KASAN
and KMSAN need to initialize some state; in particular they need to
initialize the shadow mapping of the new thread's stack.

This is done differently between KASAN and KMSAN, which is confusing.
This patch improves things a bit:
- Add a new thread_recycle() function, which moves all kernel stack
  handling out of kern_fork.c, since it doesn't really belong there.
- Then, thread_alloc_stack() has only one local caller, so just inline
  it.
- Avoid redundant shadow stack initialization: thread_alloc()
  initializes the KMSAN shadow stack (via kmsan_thread_alloc()) even
  through vm_thread_new() already did that.
- Add kasan_thread_alloc(), for consistency with kmsan_thread_alloc().

No functional change intended.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44891

(cherry picked from commit 800da341bc4a35f4b4d82d104b130825d9a42ffa)
2025-02-07 14:46:53 +00:00
FUKAUMI Naoki
703c6df052 ure(4): Add support for ELECOM EDC-QUA3C
ELECOM EDC-QUA3C is a USB3.1 Gen1 Type-A/C 2.5GBASE-T network adapter.
This also works as a cdce(4) device by:

usbconfig -d X.Y set_config 1
  or
usbconfig -d X.Y set_config 2

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1578

(cherry picked from commit dc273058cb0b6bef075e77272afc66f1a1fd3889)
2025-02-07 14:46:53 +00:00
Mark Johnston
bd8c494343 dtrace: Use size_t instead of uintptr_t to represent buffer offsets
This eases porting of DTrace to CHERI, where uintptr_t and size_t aren't
interchangeable.

No functional change intended.

Reviewed by:	Domagoj Stolfa <domagoj.stolfa@gmail.com>
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D48625

(cherry picked from commit ba9cff7aa2eb62d84bead503cd606d1586ea8388)
2025-02-07 14:46:53 +00:00
Bjoern A. Zeeb
618afeb7f3 LinuxKPI 802.11 / rtw88: make packets flow again
In 886653492945f we added checks for packets to only go out if the
station is known to the firmware (amongst others) as there are
implications in drivers.
Unfortunately rtw88 does not support the mac80211 (*sta_state)() KPI
but only the fallback (*sta_add/remove)() in which case the station is
only added to firmware when going from AUTH to ASSOC.  That means we
had no chance to get authenticated anymore.

PR:	283142, 274382
Fixes:	886653492945f (make sure we can send DISASSOC or DEAUTH frames)
Tested by:	imb protected-networks.net, oleg.nauman gmail.com
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48161

(cherry picked from commit 2372f8cc640c2f4ab82831e6ac0e27ab6c18321a)
2025-02-06 20:52:42 +00:00
Kirk McKusick
5572827428 Defer the January 19, 2038 date limit in UFS1 filesystems to February 7, 2106
Standardize the definition of a UFS dinode

Differential Revision: https://reviews.freebsd.org/D48472

(cherry picked from commit 1111a44301da39d7b7459c784230e1405e8980f8)
(cherry picked from commit aa90fbed151de512ab6e59f75df009533a15751f)
(cherry picked from commit 256389eaf158acaf67f0530764be8af68edee78c)
(cherry picked from commit 6cd973d903c8f214d84daf91eb75047631bf1618)
(cherry picked from commit e1ebda4458bbaf7d85fb803e20f3afc5441f24d9)
2025-02-06 11:25:09 -08:00
Zhenlei Huang
2e4eaf3c13 ifnet: Detach BPF descriptors on interface vmove event
When an interface is moving to/from a vnet jail, it may still have BPF
descriptors attached. The userland (e.g. tcpdump) does not get noticed
that the interface is departing and still opens BPF descriptors thus
may result in leaking sensitive traffic (e.g. an interface is moved
back to parent jail but a user is still sniffing traffic over it in
the child jail).

Detach BPF descriptors so that the userland will be signaled.

Reviewed by:	ae
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D45727

(cherry picked from commit 1ed9b381d4701fc9f66741256e93b96e22273217)

ifnet: Fix build without BPF

The newly introduced function bpf_ifdetach() is only available when
device bpf is enabled.

Fixes:	1ed9b381d470 ifnet: Detach BPF descriptors on interface vmove event
(cherry picked from commit d8413a1c3ba235a79ae6b8cc35767a861855c7e2)
2025-02-07 02:37:01 +08:00