deepin-kernel/net/wireless
Mathy Vanhoef 4ee5ab9d4c wifi: prevent A-MSDU attacks in mesh networks
commit 737bb912ebbe4571195c56eba557c4d7315b26fb upstream.

This patch is a mitigation to prevent the A-MSDU spoofing vulnerability
for mesh networks. The initial update to the IEEE 802.11 standard, in
response to the FragAttacks, missed this case (CVE-2025-27558). It can
be considered a variant of CVE-2020-24588 but for mesh networks.

This patch tries to detect if a standard MSDU was turned into an A-MSDU
by an adversary. This is done by parsing a received A-MSDU as a standard
MSDU, calculating the length of the Mesh Control header, and seeing if
the 6 bytes after this header equal the start of an rfc1042 header. If
equal, this is a strong indication of an ongoing attack attempt.

This defense was tested with mac80211_hwsim against a mesh network that
uses an empty Mesh Address Extension field, i.e., when four addresses
are used, and when using a 12-byte Mesh Address Extension field, i.e.,
when six addresses are used. Functionality of normal MSDUs and A-MSDUs
was also tested, and confirmed working, when using both an empty and
12-byte Mesh Address Extension field.

It was also tested with mac80211_hwsim that A-MSDU attacks in non-mesh
networks keep being detected and prevented.

Note that the vulnerability being patched, and the defense being
implemented, was also discussed in the following paper and in the
following IEEE 802.11 presentation:

https://papers.mathyvanhoef.com/wisec2025.pdf
https://mentor.ieee.org/802.11/dcn/25/11-25-0949-00-000m-a-msdu-mesh-spoof-protection.docx

Cc: stable@vger.kernel.org
Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@kuleuven.be>
Link: https://patch.msgid.link/20250616004635.224344-1-Mathy.Vanhoef@kuleuven.be
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ec6392061de6681148b63ee6c8744da833498cdd)
2025-07-22 16:16:41 +08:00
..
certs wifi: cfg80211: fix certs build to not depend on file order 2024-01-01 12:42:39 +00:00
.gitignore
Kconfig
Makefile cfg80211: fix CONFIG_CFG80211_EXTRA_REGDB_KEYDIR typo 2022-03-01 14:10:14 +01:00
ap.c wifi: nl80211: add MLO_LINK_ID to CMD_STOP_AP event 2023-02-14 12:09:17 +01:00
chan.c wifi: cfg80211: annotate iftype_data pointer with sparse 2024-04-26 20:46:40 +08:00
core.c wifi: cfg80211: init wiphy_work before allocating rfkill fails 2025-07-03 11:32:08 +08:00
core.h Revert "wifi: cfg80211: check wiphy mutex is held for wdev mutex" 2024-12-10 20:41:40 +08:00
debugfs.c wifi: cfg80211: debugfs: fix return type in ht40allow_map_read() 2022-08-25 10:04:46 +02:00
debugfs.h
ethtool.c wifi: cfg80211: use strscpy to replace strlcpy 2022-07-15 11:43:12 +02:00
ibss.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
lib80211.c
lib80211_crypt_ccmp.c wifi: use struct_group to copy addresses 2022-09-03 16:40:06 +02:00
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
mesh.c wifi: cfg80211: do some rework towards MLO link APIs 2022-06-20 12:54:58 +02:00
mlme.c wifi: cfg80211: fix assoc response warning on failed links 2023-10-23 13:25:30 +02:00
nl80211.c wifi: nl80211: reject cooked mode if it is set along with other flags 2025-03-18 15:20:51 +08:00
nl80211.h wifi: nl80211: Remove unused declaration nl80211_pmsr_dump_results() 2023-08-22 21:40:40 +02:00
ocb.c wifi: cfg80211: ocb: don't leave if not joined 2023-08-22 21:40:39 +02:00
of.c
pmsr.c wifi: cfg80211: pmsr: use correct nla_get_uX functions 2024-12-10 20:26:32 +08:00
radiotap.c
rdev-ops.h wifi: cfg80211: fix 6 GHz scan request building 2024-12-10 20:39:27 +08:00
reg.c wifi: cfg80211: regulatory: improve invalid hints checking 2025-03-18 15:20:51 +08:00
reg.h
scan.c wifi: cfg80211: fix out-of-bounds access during multi-link element defragmentation 2025-05-23 23:45:47 +08:00
sme.c wifi: cfg80211: sme: init n_channels before channels[] access 2024-12-23 21:10:05 +08:00
sysfs.c wifi: cfg80211: fully move wiphy work to unbound workqueue 2024-12-10 20:26:32 +08:00
sysfs.h
trace.c
trace.h wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class 2024-12-10 20:25:43 +08:00
util.c wifi: prevent A-MSDU attacks in mesh networks 2025-07-22 16:16:41 +08:00
wext-compat.c wifi: cfg80211: remove support for static WEP 2023-01-18 17:31:44 +01:00
wext-compat.h wifi: cfg80211: Avoid clashing function prototypes 2022-11-16 11:31:47 +02:00
wext-core.c wifi: cfg80211: add a flag to disable wireless extensions 2024-04-03 15:28:54 +02:00
wext-priv.c
wext-proc.c
wext-sme.c wifi: cfg80211: wext: hold wiphy lock in siwgenie 2023-06-07 19:53:11 +02:00
wext-spy.c