lkundrak / rpms / hostapd

Forked from rpms/hostapd 4 years ago
Clone
John W. Linville e7af6e8
From ef566a4d4f74022e1fdb0a2addfe81e6de9f4aae Mon Sep 17 00:00:00 2001
John W. Linville e7af6e8
From: Jouni Malinen <j@w1.fi>
John W. Linville e7af6e8
Date: Wed, 29 Apr 2015 02:21:53 +0300
John W. Linville e7af6e8
Subject: [PATCH] AP WMM: Fix integer underflow in WMM Action frame parser
John W. Linville e7af6e8
John W. Linville e7af6e8
The length of the WMM Action frame was not properly validated and the
John W. Linville e7af6e8
length of the information elements (int left) could end up being
John W. Linville e7af6e8
negative. This would result in reading significantly past the stack
John W. Linville e7af6e8
buffer while parsing the IEs in ieee802_11_parse_elems() and while doing
John W. Linville e7af6e8
so, resulting in segmentation fault.
John W. Linville e7af6e8
John W. Linville e7af6e8
This can result in an invalid frame being used for a denial of service
John W. Linville e7af6e8
attack (hostapd process killed) against an AP with a driver that uses
John W. Linville e7af6e8
hostapd for management frame processing (e.g., all mac80211-based
John W. Linville e7af6e8
drivers).
John W. Linville e7af6e8
John W. Linville e7af6e8
Thanks to Kostya Kortchinsky of Google security team for discovering and
John W. Linville e7af6e8
reporting this issue.
John W. Linville e7af6e8
John W. Linville e7af6e8
Signed-off-by: Jouni Malinen <j@w1.fi>
John W. Linville e7af6e8
---
John W. Linville e7af6e8
 src/ap/wmm.c | 3 +++
John W. Linville e7af6e8
 1 file changed, 3 insertions(+)
John W. Linville e7af6e8
John W. Linville e7af6e8
diff --git a/src/ap/wmm.c b/src/ap/wmm.c
John W. Linville e7af6e8
index 6d4177c..314e244 100644
John W. Linville e7af6e8
--- a/src/ap/wmm.c
John W. Linville e7af6e8
+++ b/src/ap/wmm.c
John W. Linville e7af6e8
@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_data *hapd,
John W. Linville e7af6e8
 		return;
John W. Linville e7af6e8
 	}
John W. Linville e7af6e8
 
John W. Linville e7af6e8
+	if (left < 0)
John W. Linville e7af6e8
+		return; /* not a valid WMM Action frame */
John W. Linville e7af6e8
+
John W. Linville e7af6e8
 	/* extract the tspec info element */
John W. Linville e7af6e8
 	if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) {
John W. Linville e7af6e8
 		hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
John W. Linville e7af6e8
-- 
John W. Linville e7af6e8
1.9.1
John W. Linville e7af6e8