diff options
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/curl/curl/CVE-2016-8619.patch | 56 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl_7.50.1.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2016-8619.patch b/meta/recipes-support/curl/curl/CVE-2016-8619.patch new file mode 100644 index 0000000000..2c8f0599b2 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2016-8619.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From 91239f7040b1f026d4d15765e7e3f58e92e93761 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Stenberg <daniel@haxx.se> | ||
3 | Date: Wed, 28 Sep 2016 12:56:02 +0200 | ||
4 | Subject: [PATCH] krb5: avoid realloc(0) | ||
5 | |||
6 | If the requested size is zero, bail out with error instead of doing a | ||
7 | realloc() that would cause a double-free: realloc(0) acts as a free() | ||
8 | and then there's a second free in the cleanup path. | ||
9 | |||
10 | CVE-2016-8619 | ||
11 | |||
12 | Bug: https://curl.haxx.se/docs/adv_20161102E.html | ||
13 | Reported-by: Cure53 | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | https://curl.haxx.se/CVE-2016-8619.patch | ||
17 | CVE: CVE-2016-8619 | ||
18 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
19 | |||
20 | --- | ||
21 | lib/security.c | 9 ++++++--- | ||
22 | 1 file changed, 6 insertions(+), 3 deletions(-) | ||
23 | |||
24 | diff --git a/lib/security.c b/lib/security.c | ||
25 | index a268d4a..4cef8f8 100644 | ||
26 | --- a/lib/security.c | ||
27 | +++ b/lib/security.c | ||
28 | @@ -190,19 +190,22 @@ socket_write(struct connectdata *conn, curl_socket_t fd, const void *to, | ||
29 | static CURLcode read_data(struct connectdata *conn, | ||
30 | curl_socket_t fd, | ||
31 | struct krb5buffer *buf) | ||
32 | { | ||
33 | int len; | ||
34 | - void* tmp; | ||
35 | + void *tmp = NULL; | ||
36 | CURLcode result; | ||
37 | |||
38 | result = socket_read(fd, &len, sizeof(len)); | ||
39 | if(result) | ||
40 | return result; | ||
41 | |||
42 | - len = ntohl(len); | ||
43 | - tmp = realloc(buf->data, len); | ||
44 | + if(len) { | ||
45 | + /* only realloc if there was a length */ | ||
46 | + len = ntohl(len); | ||
47 | + tmp = realloc(buf->data, len); | ||
48 | + } | ||
49 | if(tmp == NULL) | ||
50 | return CURLE_OUT_OF_MEMORY; | ||
51 | |||
52 | buf->data = tmp; | ||
53 | result = socket_read(fd, buf->data, len); | ||
54 | -- | ||
55 | 2.9.3 | ||
56 | |||
diff --git a/meta/recipes-support/curl/curl_7.50.1.bb b/meta/recipes-support/curl/curl_7.50.1.bb index 5c63996df1..544110134c 100644 --- a/meta/recipes-support/curl/curl_7.50.1.bb +++ b/meta/recipes-support/curl/curl_7.50.1.bb | |||
@@ -15,6 +15,7 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ | |||
15 | SRC_URI += " file://configure_ac.patch \ | 15 | SRC_URI += " file://configure_ac.patch \ |
16 | file://CVE-2016-8615.patch \ | 16 | file://CVE-2016-8615.patch \ |
17 | file://CVE-2016-8618.patch \ | 17 | file://CVE-2016-8618.patch \ |
18 | file://CVE-2016-8619.patch \ | ||
18 | " | 19 | " |
19 | 20 | ||
20 | SRC_URI[md5sum] = "015f6a0217ca6f2c5442ca406476920b" | 21 | SRC_URI[md5sum] = "015f6a0217ca6f2c5442ca406476920b" |