hostapd: merge a security fix for a TLS message buffer overflow (CVE-2012-4445)
authorFelix Fietkau <nbd@openwrt.org>
Wed, 17 Oct 2012 18:18:17 +0000 (18:18 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 17 Oct 2012 18:18:17 +0000 (18:18 +0000)
Backport of r33815

SVN-Revision: 33816

package/hostapd/patches/001-CVE-2012-4445.patch [new file with mode: 0644]

diff --git a/package/hostapd/patches/001-CVE-2012-4445.patch b/package/hostapd/patches/001-CVE-2012-4445.patch
new file mode 100644 (file)
index 0000000..1b8bdd0
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/src/eap_server/eap_server_tls_common.c
++++ b/src/eap_server/eap_server_tls_common.c
+@@ -228,6 +228,14 @@ static int eap_server_tls_process_fragme
+                       return -1;
+               }
++              if (len > message_length) {
++                      wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in "
++                                 "first fragment of frame (TLS Message "
++                                 "Length %d bytes)",
++                                 (int) len, (int) message_length);
++                      return -1;
++              }
++
+               data->tls_in = wpabuf_alloc(message_length);
+               if (data->tls_in == NULL) {
+                       wpa_printf(MSG_DEBUG, "SSL: No memory for message");