This is a note to let you know that I've just added the patch titled

    mac80211: check management frame header length

to the 3.6-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mac80211-check-management-frame-header-length.patch
and it can be found in the queue-3.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 4a4f1a5808c8bb0b72a4f6e5904c53fb8c9cd966 Mon Sep 17 00:00:00 2001
From: Johannes Berg <[email protected]>
Date: Fri, 26 Oct 2012 00:33:36 +0200
Subject: mac80211: check management frame header length

From: Johannes Berg <[email protected]>

commit 4a4f1a5808c8bb0b72a4f6e5904c53fb8c9cd966 upstream.

Due to pskb_may_pull() checking the skb length, all
non-management frames are checked on input whether
their 802.11 header is fully present. Also add that
check for management frames and remove a check that
is now duplicate. This prevents accessing skb data
beyond the frame end.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 net/mac80211/rx.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1430,7 +1430,6 @@ ieee80211_rx_h_defragment(struct ieee802
        frag = sc & IEEE80211_SCTL_FRAG;
 
        if (likely((!ieee80211_has_morefrags(fc) && frag == 0) ||
-                  (rx->skb)->len < 24 ||
                   is_multicast_ether_addr(hdr->addr1))) {
                /* not fragmented */
                goto out;
@@ -2867,10 +2866,15 @@ static void __ieee80211_rx_handle_packet
        if (ieee80211_is_data(fc) || ieee80211_is_mgmt(fc))
                local->dot11ReceivedFragmentCount++;
 
-       if (ieee80211_is_mgmt(fc))
-               err = skb_linearize(skb);
-       else
+       if (ieee80211_is_mgmt(fc)) {
+               /* drop frame if too short for header */
+               if (skb->len < ieee80211_hdrlen(fc))
+                       err = -ENOBUFS;
+               else
+                       err = skb_linearize(skb);
+       } else {
                err = !pskb_may_pull(skb, ieee80211_hdrlen(fc));
+       }
 
        if (err) {
                dev_kfree_skb(skb);


Patches currently in stable-queue which might be from [email protected] 
are

queue-3.6/mac80211-use-blacklist-for-duplicate-ie-check.patch
queue-3.6/cfg80211-fix-antenna-gain-handling.patch
queue-3.6/mac80211-verify-that-skb-data-is-present.patch
queue-3.6/mac80211-only-process-mesh-config-header-on-frames-that-ra_match.patch
queue-3.6/mac80211-make-sure-data-is-accessible-in-eapol-check.patch
queue-3.6/wireless-drop-invalid-mesh-address-extension-frames.patch
queue-3.6/mac80211-fix-ssid-copy-on-ibss-join.patch
queue-3.6/mac80211-check-management-frame-header-length.patch
queue-3.6/mac80211-don-t-inspect-sequence-control-field-on-control-frames.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to