]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP WMM: Fix integer underflow in WMM Action frame parser
authorJouni Malinen <j@w1.fi>
Tue, 28 Apr 2015 23:21:53 +0000 (02:21 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 3 May 2015 15:26:50 +0000 (18:26 +0300)
The length of the WMM Action frame was not properly validated and the
length of the information elements (int left) could end up being
negative. This would result in reading significantly past the stack
buffer while parsing the IEs in ieee802_11_parse_elems() and while doing
so, resulting in segmentation fault.

This can result in an invalid frame being used for a denial of service
attack (hostapd process killed) against an AP with a driver that uses
hostapd for management frame processing (e.g., all mac80211-based
drivers).

Thanks to Kostya Kortchinsky of Google security team for discovering and
reporting this issue.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/wmm.c

index 6d4177c2a847c6d0cd909e9fda7706fa0066fe90..314e244bc956a4614803f27a64442619ed0c406a 100644 (file)
@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_data *hapd,
                return;
        }
 
+       if (left < 0)
+               return; /* not a valid WMM Action frame */
+
        /* extract the tspec info element */
        if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) {
                hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,