summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch')
-rw-r--r--meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch
new file mode 100644
index 0000000000..95ea809ef2
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-reassembly-buffer-handling.patch
@@ -0,0 +1,48 @@
1From d2d1a324ce937628e4d9d9999fe113819b7d4478 Mon Sep 17 00:00:00 2001
2From: Jouni Malinen <jouni@codeaurora.org>
3Date: Wed, 17 Apr 2019 02:21:20 +0300
4Subject: [PATCH 3/3] EAP-pwd peer: Fix reassembly buffer handling
5
6Unexpected fragment might result in data->inbuf not being allocated
7before processing and that could have resulted in NULL pointer
8dereference. Fix that by explicitly checking for data->inbuf to be
9available before using it.
10
11Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
12Signed-off-by: Adrian Bunk <bunk@stusta.de>
13Upstream-Status: Backport
14CVE: CVE-2019-11555
15---
16 src/eap_peer/eap_pwd.c | 9 ++++++++-
17 1 file changed, 8 insertions(+), 1 deletion(-)
18
19diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
20index 46894a5..76fcad4 100644
21--- a/src/eap_peer/eap_pwd.c
22+++ b/src/eap_peer/eap_pwd.c
23@@ -932,6 +932,13 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
24 * buffer and ACK the fragment
25 */
26 if (EAP_PWD_GET_MORE_BIT(lm_exch) || data->in_frag_pos) {
27+ if (!data->inbuf) {
28+ wpa_printf(MSG_DEBUG,
29+ "EAP-pwd: No buffer for reassembly");
30+ ret->methodState = METHOD_DONE;
31+ ret->decision = DECISION_FAIL;
32+ return NULL;
33+ }
34 data->in_frag_pos += len;
35 if (data->in_frag_pos > wpabuf_size(data->inbuf)) {
36 wpa_printf(MSG_INFO, "EAP-pwd: Buffer overflow attack "
37@@ -958,7 +965,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
38 /*
39 * we're buffering and this is the last fragment
40 */
41- if (data->in_frag_pos) {
42+ if (data->in_frag_pos && data->inbuf) {
43 wpa_printf(MSG_DEBUG, "EAP-pwd: Last fragment, %d bytes",
44 (int) len);
45 pos = wpabuf_head_u8(data->inbuf);
46--
472.7.4
48