diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-07-11 22:33:26 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-11 18:35:22 -0700 |
commit | fd14e26686ae1729c25cf9c938eed826eb825e9d (patch) | |
tree | 44b821eefc2b4a105fc2f5dd75825e0274dae7c1 /net | |
parent | ef47a5e4f1aaf1d0e2e6875e34b2c9595897bef6 (diff) | |
download | linux-3.10-fd14e26686ae1729c25cf9c938eed826eb825e9d.tar.gz linux-3.10-fd14e26686ae1729c25cf9c938eed826eb825e9d.tar.bz2 linux-3.10-fd14e26686ae1729c25cf9c938eed826eb825e9d.zip |
mac80211: fix duplicate retransmission detection
commit 6b0f32745dcfba01d7be33acd1b40306c7a914c6 upstream.
The duplicate retransmission detection code in mac80211
erroneously attempts to do the check for every frame,
even frames that don't have a sequence control field or
that don't use it (QoS-Null frames.)
This is problematic because it causes the code to access
data beyond the end of the SKB and depending on the data
there will drop packets erroneously.
Correct the code to not do duplicate detection for such
frames.
I found this error while testing AP powersave, it lead
to retransmitted PS-Poll frames being dropped entirely
as the data beyond the end of the SKB was always zero.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/rx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 8e295262025..83f6d29202a 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -932,8 +932,14 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx) struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); - /* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */ - if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) { + /* + * Drop duplicate 802.11 retransmissions + * (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery") + */ + if (rx->skb->len >= 24 && rx->sta && + !ieee80211_is_ctl(hdr->frame_control) && + !ieee80211_is_qos_nullfunc(hdr->frame_control) && + !is_multicast_ether_addr(hdr->addr1)) { if (unlikely(ieee80211_has_retry(hdr->frame_control) && rx->sta->last_seq_ctrl[rx->seqno_idx] == hdr->seq_ctrl)) { |