]> granicus.if.org Git - openssl/commitdiff
Multiblock corrupted pointer fix
authorMatt Caswell <matt@openssl.org>
Mon, 2 Mar 2015 09:27:10 +0000 (09:27 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 19 Mar 2015 11:11:02 +0000 (11:11 +0000)
OpenSSL 1.0.2 introduced the "multiblock" performance improvement. This
feature only applies on 64 bit x86 architecture platforms that support AES
NI instructions. A defect in the implementation of "multiblock" can cause
OpenSSL's internal write buffer to become incorrectly set to NULL when
using non-blocking IO. Typically, when the user application is using a
socket BIO for writing, this will only result in a failed connection.
However if some other BIO is used then it is likely that a segmentation
fault will be triggered, thus enabling a potential DoS attack.

CVE-2015-0290

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
ssl/s3_pkt.c

index 66fa9d1d163f998a48c5b4a6db9d9245a92b3baf..cf02e49f766cd27ef157fa5255f28a7559454907 100644 (file)
@@ -804,7 +804,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
 
             i = ssl3_write_pending(s, type, &buf[tot], nw);
             if (i <= 0) {
-                if (i < 0) {
+                if (i < 0 && (!s->wbio || !BIO_should_retry(s->wbio))) {
                     OPENSSL_free(wb->buf);
                     wb->buf = NULL;
                 }