From: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
Subject: [PATCH] wifi: ieee80211: Fix for fragmented action frames
Date: Thu, 11 Aug 2022 10:48:04 +1200 [thread overview]
Message-ID: <20220810224804.2137240-1-gilad.itzkovitch@morsemicro.com> (raw)
The robust management frame check ensures a station exists for
the frame before proceeding, but there are some action frame
categories which don't require an existing station, and so the
_ieee80211_is_robust_mgmt_frame function peeks into the
action frame's payload to identify the category and filter them out.
In some scenarios, e.g. DPP at S1G data rates, action frames
can get fragmented. This commit adds an extra check to ensure
we don't peek into the payload of fragmented frames beyond the
first fragment.
Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
---
include/linux/ieee80211.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 55e6f4ad0ca6..5da9608fdce3 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -4124,6 +4124,7 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
if (ieee80211_is_action(hdr->frame_control)) {
u8 *category;
+ u16 sc;
/*
* Action frames, excluding Public Action frames, are Robust
@@ -4134,6 +4135,17 @@ static inline bool _ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr)
*/
if (ieee80211_has_protected(hdr->frame_control))
return true;
+
+ /*
+ * Some action frames do not have a STA associated with them,
+ * so we rule them out from the robust management frame check.
+ * The category is within the payload, so we only proceed if
+ * we're checking the first fragment.
+ */
+ sc = le16_to_cpu(hdr->seq_ctrl);
+ if (sc & IEEE80211_SCTL_FRAG)
+ return false;
+
category = ((u8 *) hdr) + 24;
return *category != WLAN_CATEGORY_PUBLIC &&
*category != WLAN_CATEGORY_HT &&
--
2.25.1
next reply other threads:[~2022-08-10 22:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 22:48 Gilad Itzkovitch [this message]
2022-08-25 8:08 ` Johannes Berg
2022-08-29 3:43 ` Gilad Itzkovitch
2022-08-29 7:17 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220810224804.2137240-1-gilad.itzkovitch@morsemicro.com \
--to=gilad.itzkovitch@morsemicro.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®