aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-04-29 02:21:53 +0300
committerMichael Bestas <mikeioannina@gmail.com>2015-11-11 19:39:15 +0200
commit01d5bf8e065431d2e090959d3b188ae71cabf1b4 (patch)
treeae3cd01e2179eb14d9b9cbbb47f73960c14eae90
parenta549bf5c2dd9578a0b737dc6e74d65897cf4aa80 (diff)
downloadandroid_external_wpa_supplicant_8-01d5bf8e065431d2e090959d3b188ae71cabf1b4.tar.gz
android_external_wpa_supplicant_8-01d5bf8e065431d2e090959d3b188ae71cabf1b4.tar.bz2
android_external_wpa_supplicant_8-01d5bf8e065431d2e090959d3b188ae71cabf1b4.zip
AP WMM: Fix integer underflow in WMM Action frame parser
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. Change-Id: I8f1f9734f74124df51eba4f075f7b9bc14af1332 Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--src/ap/wmm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ap/wmm.c b/src/ap/wmm.c
index d21c82f6..f12109b8 100644
--- a/src/ap/wmm.c
+++ b/src/ap/wmm.c
@@ -280,6 +280,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,