]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: reject HTC bit for management frames
authorJohannes Berg <johannes.berg@intel.com>
Fri, 18 Jul 2025 18:23:06 +0000 (20:23 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 21 Jul 2025 17:35:45 +0000 (19:35 +0200)
Management frames sent by userspace should never have the
order/HTC bit set, reject that. It could also cause some
confusion with the length of the buffer and the header so
the validation might end up wrong.

Link: https://patch.msgid.link/20250718202307.97a0455f0f35.I1805355c7e331352df16611839bc8198c855a33f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/mlme.c

index bb5bc6ff09d48e19d82b8e680ab15211bd402bd7..46394eb2086f6e8f1c38da4a743ef4e6f5f80413 100644 (file)
@@ -867,7 +867,8 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
 
        mgmt = (const struct ieee80211_mgmt *)params->buf;
 
-       if (!ieee80211_is_mgmt(mgmt->frame_control))
+       if (!ieee80211_is_mgmt(mgmt->frame_control) ||
+           ieee80211_has_order(mgmt->frame_control))
                return -EINVAL;
 
        stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE;