diff options
author | J0WI <J0WI@users.noreply.github.com> | 2019-05-10 13:07:41 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-05-11 16:11:48 +0000 |
commit | 43c8f8a8f1a15295d3639577e4b8d50292b28225 (patch) | |
tree | f1722196474c6eda08e91c4818d369cebfd32732 | |
parent | cd59f21ab2503a734b4b9871a3b007abb84d1d4f (diff) | |
download | aports-43c8f8a8f1a15295d3639577e4b8d50292b28225.tar.bz2 aports-43c8f8a8f1a15295d3639577e4b8d50292b28225.tar.xz |
main/wpa_supplicant: security fixes
CVE-2019-11-5555
3 files changed, 98 insertions, 1 deletions
diff --git a/main/wpa_supplicant/0014-EAP-pwd-server-Fix-reassembly-buffer-handling.patch b/main/wpa_supplicant/0014-EAP-pwd-server-Fix-reassembly-buffer-handling.patch new file mode 100644 index 0000000000..620d67da02 --- /dev/null +++ b/main/wpa_supplicant/0014-EAP-pwd-server-Fix-reassembly-buffer-handling.patch @@ -0,0 +1,45 @@ +From fe76f487e28bdc61940f304f153a954cf36935ea Mon Sep 17 00:00:00 2001 +From: Jouni Malinen <jouni@codeaurora.org> +Date: Wed, 17 Apr 2019 01:55:32 +0300 +Subject: [PATCH 1/3] EAP-pwd server: Fix reassembly buffer handling + +data->inbuf allocation might fail and if that were to happen, the next +fragment in the exchange could have resulted in NULL pointer +dereference. Unexpected fragment with more bit might also be able to +trigger this. Fix that by explicitly checking for data->inbuf to be +available before using it. + +Signed-off-by: Jouni Malinen <jouni@codeaurora.org> +--- + src/eap_server/eap_server_pwd.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c +index 11bef55..38e2af8 100644 +--- a/src/eap_server/eap_server_pwd.c ++++ b/src/eap_server/eap_server_pwd.c +@@ -912,6 +912,12 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv, + * the first and all intermediate fragments have the M bit set + */ + if (EAP_PWD_GET_MORE_BIT(lm_exch) || data->in_frag_pos) { ++ if (!data->inbuf) { ++ wpa_printf(MSG_DEBUG, ++ "EAP-pwd: No buffer for reassembly"); ++ eap_pwd_state(data, FAILURE); ++ return; ++ } + if ((data->in_frag_pos + len) > wpabuf_size(data->inbuf)) { + wpa_printf(MSG_DEBUG, "EAP-pwd: Buffer overflow " + "attack detected! (%d+%d > %d)", +@@ -932,7 +938,7 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv, + * last fragment won't have the M bit set (but we're obviously + * buffering fragments so that's how we know it's the last) + */ +- if (data->in_frag_pos) { ++ if (data->in_frag_pos && data->inbuf) { + pos = wpabuf_head_u8(data->inbuf); + len = data->in_frag_pos; + wpa_printf(MSG_DEBUG, "EAP-pwd: Last fragment, %d bytes", +-- +2.7.4 + diff --git a/main/wpa_supplicant/0015-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch b/main/wpa_supplicant/0015-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch new file mode 100644 index 0000000000..1a23e0fa90 --- /dev/null +++ b/main/wpa_supplicant/0015-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch @@ -0,0 +1,45 @@ +From d2d1a324ce937628e4d9d9999fe113819b7d4478 Mon Sep 17 00:00:00 2001 +From: Jouni Malinen <jouni@codeaurora.org> +Date: Wed, 17 Apr 2019 02:21:20 +0300 +Subject: [PATCH 3/3] EAP-pwd peer: Fix reassembly buffer handling + +Unexpected fragment might result in data->inbuf not being allocated +before processing and that could have resulted in NULL pointer +dereference. Fix that by explicitly checking for data->inbuf to be +available before using it. + +Signed-off-by: Jouni Malinen <jouni@codeaurora.org> +--- + src/eap_peer/eap_pwd.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c +index 46894a5..76fcad4 100644 +--- a/src/eap_peer/eap_pwd.c ++++ b/src/eap_peer/eap_pwd.c +@@ -932,6 +932,13 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, + * buffer and ACK the fragment + */ + if (EAP_PWD_GET_MORE_BIT(lm_exch) || data->in_frag_pos) { ++ if (!data->inbuf) { ++ wpa_printf(MSG_DEBUG, ++ "EAP-pwd: No buffer for reassembly"); ++ ret->methodState = METHOD_DONE; ++ ret->decision = DECISION_FAIL; ++ return NULL; ++ } + data->in_frag_pos += len; + if (data->in_frag_pos > wpabuf_size(data->inbuf)) { + wpa_printf(MSG_INFO, "EAP-pwd: Buffer overflow attack " +@@ -958,7 +965,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret, + /* + * we're buffering and this is the last fragment + */ +- if (data->in_frag_pos) { ++ if (data->in_frag_pos && data->inbuf) { + wpa_printf(MSG_DEBUG, "EAP-pwd: Last fragment, %d bytes", + (int) len); + pos = wpabuf_head_u8(data->inbuf); +-- +2.7.4 + diff --git a/main/wpa_supplicant/APKBUILD b/main/wpa_supplicant/APKBUILD index 5a045d7888..adf01f8796 100644 --- a/main/wpa_supplicant/APKBUILD +++ b/main/wpa_supplicant/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=wpa_supplicant pkgver=2.7 -pkgrel=2 +pkgrel=3 pkgdesc="A utility providing key negotiation for WPA wireless networks" url="https://w1.fi/wpa_supplicant/" arch="all" @@ -30,11 +30,16 @@ source="https://w1.fi/releases/$pkgname-$pkgver.tar.gz 0011-EAP-pwd-client-Verify-received-scalar-and-element.patch 0012-EAP-pwd-server-Verify-received-scalar-and-element.patch 0013-EAP-pwd-Check-element-x-y-coordinates-explicitly.patch + 0014-EAP-pwd-server-Fix-reassembly-buffer-handling.patch + 0015-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch + config wpa_cli.sh" # secfixes: +# 2.7-r3: +# - CVE-2019-11555 # 2.7-r2: # - CVE-2019-9494 # - CVE-2019-9495 @@ -138,5 +143,7 @@ c2ebe127e0d14c56b9e274a6f8f97c5fb763edc9dc7a3cab4cb1748d29a4d514c240e398ab140542 509aaef9f32eabbc3b7d257fb85d424db89a383a1708353d52f8c26f3cac602b351615c6775731193ca9403da368052482aa8294927e9d1880f567a08e3056da 0011-EAP-pwd-client-Verify-received-scalar-and-element.patch 217714f651b489f9bc9dad1485b1ea409b0d9c40aef70a4c343f59261198175e5360e6dff99773a7a7358731e010f6c334a095f4868adc9f914a4c4085fb3092 0012-EAP-pwd-server-Verify-received-scalar-and-element.patch 39cb011348a4723b52405bd6cd85f78da1a80e077b61ef0c489e5a0a03e21e30de38378554f1a81092b65cd923d1c3c430821812037a7607f582038d3ba26687 0013-EAP-pwd-Check-element-x-y-coordinates-explicitly.patch +7038044885871271ac724790663d5c0a428db83b41a691747be7a618ae893670a98f3ba52a297937249084296b0e9bcfd791edaa3928548efddb259e1a15f46c 0014-EAP-pwd-server-Fix-reassembly-buffer-handling.patch +99c734fe395b4231aa6a097a08a00e5dab65ea9c37a7c83b1904a37c39307d9e7e95485734b0d483687126f4100c75f8a7b1420f0a2edcbfe07b454a14548822 0015-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch 6707991f9a071f2fcb09d164d31d12b1f52b91fbb5574b70b8d6f9727f72bbe42b03dd66d10fcc2126f5b7e49ac785657dec90e88b4bf54a9aa5638582f6e505 config 212c4265afce2e72b95a32cd785612d6c3e821b47101ead154136d184ac4add01434ada6c87edbb9a98496552e76e1a4d79c6b5840e3a5cfe5e6d602fceae576 wpa_cli.sh" |