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)
Avoid the creation of a /usr/tests/sys/vm/stack/.debug directory by
placing sys/vm/stack test debug symbols under /usr/lib/debug.
Reviewed by: emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48796
(cherry picked from commit 88d448ec815c1fda27be94846f88ccd96251febd)
(cherry picked from commit 955f974a1a37cf3ae8b241327b1fef74c8932855)
Remove extra slashes that end up in the metalog. These double slashes
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.
For example, consider the following metalog excerpt:
./base/aaa type=dir
./base//aaa/bbb type=dir
If sorted, would turn out:
./base//aaa/bbb type=dir
./base/aaa type=dir
Apparently missing the ./base/aaa directory in the specification.
Luckily here are no subdirectories.
Reviewed by: imp, emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48779
(cherry picked from commit bccaf0262dcab84be49c42cc6b7a81c279c44b62)
Remove an extra slash that ends up in the metalog. This double slash
can produce an invalid specification file if there are subdirectories
down the hierarchy when sorted.
For example, consider the following metalog excerpt:
./base/aaa type=dir
./base//aaa/bbb type=dir
If sorted, would turn out:
./base//aaa/bbb type=dir
./base/aaa type=dir
Apparently missing the ./base/aaa directory in the specification.
Luckily here are no subdirectories.
Reviewed by: imp, emaste
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48778
(cherry picked from commit 841856570e7b623c4f1283939936ffa005d2fcf4)
Print the desired partition index together with the starting LBA and the
size. Otherwise, when only one code partition is desired, the
configuration partition (/cfg) may not end up in the third slice, thus
breaking the scripts that expect it there.
This was the previous approach, changed in 587c054bea ("nanobsd: Use
gpart and create code image before full disk image").
Fix it by printing the index as the last column to reduce the chances of
breaking current overrides, and using it as the gpart index.
PR: 262098
Reviewed by: imp
Approved by: emaste (mentor)
Fixes: 587c054bea ("nanobsd: Use gpart and create code image before full disk image")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47835
(cherry picked from commit dc4b36b96333f2ab05f3c454f0df2e0a0d4d451d)
Replaced by arm-optimized-routines in commit 2e8ff4d1d5 ("Switch to
Arm Optimized Routines for mem* & str*").
Reviewed by: andrew
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48500
(cherry picked from commit 4a7d6666c5ddd135b2023b4b3b4962770ff2e73b)
install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.
If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.
Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.
PR: 284119
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48504
(cherry picked from commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f)
Set _localbase variable from within /etc/defaults/periodic.conf
for use by periodic scripts.
This fixes e5d7100c09, no other functional changes intended.
Reported by: gahr, otis
Reviewed by: markj, gahr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D47486
(cherry picked from commit c8b89c11a1181e900acb638cfde7a55e92553175)
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)
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)
Set media mode correctly to IFM_IEEE80211_VHT5G if vht_enabled is set
on the channel. Otherwise we'll end up setting 11NA.
Not a problem on first sight given net80211 does the upgrade to VHT
for us. But we would not set iv_des_mode ("desired mode") on the vap.
Setting this will put a contraint on/help scanning for our desired
(VHT) channels to my understanding of the code.
Sponsored by: The FreeBSD Foundation
Reviewed by: cy, adrian
Differential Revision: https://reviews.freebsd.org/D35978
(cherry picked from commit a0e45db6f6eb6660e78921bbd5307fa7fc13d0a9)
Also hide the other vht options on -vht and only show vht40/80/160/80p80
when vht is enabled.
While here fix some whitespace and comments.
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48326
(cherry picked from commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075)
Anyone testing VHT options would wonder about these extra two printfs
by now. Remove them from the tree before I have to do so locally again
in another branch.
Sponsored by: The FreeBSD Foundation
Fixes: e9bb7f9aa1
Reviewed by: adrian, emaste
Differential Revision: https://reviews.freebsd.org/D48319
(cherry picked from commit 91a4107d6d3028acd96df96de33b8a7665d3eb03)
ETSI had one 160Mhz band in regdomain but the other two were missing.
Add them. I am always confused that the bands use the center frequency
of the 20Mhz edge channels rather than the actual edges so it seems we
are only configuring 140Mhz instead of 160Mhz.
We will have to go through the entire regdomain file one
day and make sure to verify all the power levels.
Sponsored by: The FreeSBD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D48356
(cherry picked from commit a3a308f0f29b14d522c56dd88231e27fdf206104)
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)
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)
Following 07f6575585bf also turn on debugfs support for rtw89.
Sponnsored by: The FreeBSD Foundation
(cherry picked from commit 446eab491e523e3d7586e11cb16448e524297da4)
Remove the =1 from -DCONFIG_* in the conditional cases.
They are not needed.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 411c857b4ccedd6491dff9a35e952bc49d053053)
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)
rate_lowest_index() is no longer used anywhere in our code.
Garbage collect it.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 1b840f09b6b379c0aae5a558ba5a4ed6bb571a85)
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)
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)
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)
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)
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)
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)
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)
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)
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)
No functional changes.
Sposnored by: The FreeBSD Foundation
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D48358
(cherry picked from commit e6d40f90110ad8026f1af3fa68f836463936ea78)
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)
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)
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)
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)
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)
Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D47836
(cherry picked from commit 4294f1cac15300046369d7e464ce96363839757c)
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)
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)
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)
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)
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)
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)
Using MPASS in libkern breaks buildworld. Replace MPASS with KASSERT
in three places.
(cherry picked from commit 08f6f78f81e21b21dd002a9389436b0333cb3488)
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)
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)