wifi: mac80211: Fix for Rx fragmented action frames
authorGilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
Thu, 24 Nov 2022 00:53:36 +0000 (13:53 +1300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 14 Feb 2023 13:48:25 +0000 (14:48 +0100)
The ieee80211_accept_frame() function performs a number of early checks
to decide whether or not further processing needs to be done on a frame.
One of those checks is the ieee80211_is_robust_mgmt_frame() function.
It requires to peek into the frame payload, but because defragmentation
does not occur until later on in the receive path, this peek is invalid
for any fragment other than the first one. Also, in this scenario there
is no STA and so the fragmented frame will be dropped later on in the
process and will not reach the upper stack. This can happen with large
action frames at low rates, for example, we see issues with DPP on S1G.

This change will only check if the frame is robust if it's the first
fragment. Invalid fragmented packets will be discarded later after
defragmentation is completed.

Signed-off-by: Gilad Itzkovitch <gilad.itzkovitch@morsemicro.com>
Link: https://lore.kernel.org/r/20221124005336.1618411-1-gilad.itzkovitch@morsemicro.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index 8965508928f37155d79b413ece86e04e5421710e..7bcd77384191238aecb68b7d8b74c601f69dc1da 100644 (file)
@@ -4284,7 +4284,8 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
        case NL80211_IFTYPE_STATION:
                if (!bssid && !sdata->u.mgd.use_4addr)
                        return false;
-               if (ieee80211_is_robust_mgmt_frame(skb) && !rx->sta)
+               if (ieee80211_is_first_frag(hdr->seq_ctrl) &&
+                   ieee80211_is_robust_mgmt_frame(skb) && !rx->sta)
                        return false;
                if (multicast)
                        return true;