hostapd: Fix bugs from CVE-2015-4141 to CVE-2015-4146
PATCH 1/1 hostapd: Fix bugs from CVE-2015-4141 to CVE-2015-4146
hostapd: Fix bugs from CVE-2015-4141 to CVE-2015-4146
These patches are originally from:
http://w1.fi/security/2015-2/
http://w1.fi/security/2015-3/
http://w1.fi/security/2015-4/
The relationships between CVE number and patch file are as follows:
CVE-2015-4141
0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
CVE-2015-4142
0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
CVE-2015-4143
0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch 0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
CVE-2015-4144
CVE-2015-4145
0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch 0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch
CVE-2015-4146
0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
--- ...integer-underflow-in-WMM-Action-frame-par.patch | 45 +++++++++++++ ...r-Fix-payload-length-validation-for-Commi.patch | 77 ++++++++++++++++++++++ ...Fix-HTTP-chunked-transfer-encoding-parser.patch | 53 +++++++++++++++ ...ver-Fix-payload-length-validation-for-Com.patch | 70 ++++++++++++++++++++ ...r-Fix-Total-Length-parsing-for-fragment-r.patch | 56 ++++++++++++++++ ...ver-Fix-Total-Length-parsing-for-fragment.patch | 54 +++++++++++++++ ...eer-Fix-asymmetric-fragmentation-behavior.patch | 36 ++++++++++ 7 files changed, 391 insertions(+) create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch create mode 100644 meta/recipes-connectivity/hostapd/hostapd/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch create mode 100644
meta/recipes-connectivity/hostapd/hostapd/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
meta/recipes-connectivity/hostapd/hostapd/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch new file +45 -0
@@ -0,0 +1,45 @@ +Upstream-Status: Backport + +Signed-off-by: Fan Xin <[email protected]> + +From ef566a4d4f74022e1fdb0a2addfe81e6de9f4aae Mon Sep 17 00:00:00 2001 +From: Jouni Malinen <[email protected]> +Date: Wed, 29 Apr 2015 02:21:53 +0300 +Subject: [PATCH] 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. + +Signed-off-by: Jouni Malinen <[email protected]> +--- + src/ap/wmm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/ap/wmm.c b/src/ap/wmm.c +index 6d4177c..314e244 100644 +--- a/src/ap/wmm.c ++++ b/src/ap/wmm.c +@@ -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, +-- +1.9.1 +
meta/recipes-connectivity/hostapd/hostapd/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch new file +77 -0
77 lines not on this page · raw message
meta/recipes-connectivity/hostapd/hostapd/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch new file +53 -0
53 lines not on this page · raw message
meta/recipes-connectivity/hostapd/hostapd/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch new file +70 -0
70 lines not on this page · raw message
meta/recipes-connectivity/hostapd/hostapd/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch new file +56 -0
56 lines not on this page · raw message
meta/recipes-connectivity/hostapd/hostapd/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch new file +54 -0
54 lines not on this page · raw message
meta/recipes-connectivity/hostapd/hostapd/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch new file +36 -0
@@ -0,0 +1,36 @@ +Upstream-Status: Backport + +Signed-off-by: Fan Xin <[email protected]> + +From 28a069a545b06b99eb55ad53f63f2c99e65a98f6 Mon Sep 17 00:00:00 2001 +From: Jouni Malinen <[email protected]> +Date: Sat, 2 May 2015 19:26:28 +0300 +Subject: [PATCH 5/5] EAP-pwd peer: Fix asymmetric fragmentation behavior + +The L (Length) and M (More) flags needs to be cleared before deciding +whether the locally generated response requires fragmentation. This +fixes an issue where these flags from the server could have been invalid +for the following message. In some cases, this could have resulted in +triggering the wpabuf security check that would terminate the process +due to invalid buffer allocation. + +Signed-off-by: Jouni Malinen <[email protected]> +--- + src/eap_peer/eap_pwd.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c +index 1d2079b..e58b13a 100644 +--- a/src/eap_peer/eap_pwd.c ++++ b/src/eap_peer/eap_pwd.c +@@ -968,6 +968,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, + /* + * we have output! Do we need to fragment it? + */ ++ lm_exch = EAP_PWD_GET_EXCHANGE(lm_exch); + len = wpabuf_len(data->outbuf); + if ((len + EAP_PWD_HDR_SIZE) > data->mtu) { + resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_PWD, data->mtu, +-- +1.9.1 +
Signature · 3 lines
1.8.4.2 --