diff options
author | Andrii Bordunov via Openembedded-core <openembedded-core@lists.openembedded.org> | 2019-08-13 23:25:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-08 22:52:27 +0100 |
commit | 1b628384281a809ea8a23904fb628fdafa52e0d2 (patch) | |
tree | 19131d1bb3f62fc425e546bab1294704a3ab0e53 /meta/recipes-support/curl/curl/CVE-2019-3823.patch | |
parent | 20ee17a579f89c2cdf39496b5bfd20d815414a3c (diff) | |
download | poky-1b628384281a809ea8a23904fb628fdafa52e0d2.tar.gz |
curl: fix CVE-2018-16890 CVE-2019-3822 CVE-2019-3823
(From OE-Core rev: 75a4b4d8fb14414bbe2e38be8ccda0af94ef9b40)
Signed-off-by: Kevin Weng <t-keweng@microsoft.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/curl/curl/CVE-2019-3823.patch')
-rw-r--r-- | meta/recipes-support/curl/curl/CVE-2019-3823.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2019-3823.patch b/meta/recipes-support/curl/curl/CVE-2019-3823.patch new file mode 100644 index 0000000000..194e6e6430 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2019-3823.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 40f6c913f63cdbfa81daa7ac7f1c7415bb99edeb Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel Gustafsson <daniel@yesql.se> | ||
3 | Date: Sat, 19 Jan 2019 00:42:47 +0100 | ||
4 | Subject: [PATCH 3/3] smtp: avoid risk of buffer overflow in strtol | ||
5 | |||
6 | If the incoming len 5, but the buffer does not have a termination | ||
7 | after 5 bytes, the strtol() call may keep reading through the line | ||
8 | buffer until is exceeds its boundary. Fix by ensuring that we are | ||
9 | using a bounded read with a temporary buffer on the stack. | ||
10 | |||
11 | Bug: https://curl.haxx.se/docs/CVE-2019-3823.html | ||
12 | Reported-by: Brian Carpenter (Geeknik Labs) | ||
13 | CVE-2019-3823 | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | [https://github.com/curl/curl/commit | ||
17 | /39df4073e5413fcdbb5a38da0c1ce6f1c0ceb484] | ||
18 | |||
19 | CVE: CVE-2019-3823 | ||
20 | |||
21 | Signed-off-by: Kevin Weng <t-keweng@microsoft.com> | ||
22 | --- | ||
23 | lib/smtp.c | 8 ++++++-- | ||
24 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/lib/smtp.c b/lib/smtp.c | ||
27 | index ecf10a41a..1b9f92d30 100644 | ||
28 | --- a/lib/smtp.c | ||
29 | +++ b/lib/smtp.c | ||
30 | @@ -5,7 +5,7 @@ | ||
31 | * | (__| |_| | _ <| |___ | ||
32 | * \___|\___/|_| \_\_____| | ||
33 | * | ||
34 | - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
35 | + * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
36 | * | ||
37 | * This software is licensed as described in the file COPYING, which | ||
38 | * you should have received as part of this distribution. The terms | ||
39 | @@ -207,8 +207,12 @@ static bool smtp_endofresp(struct connectdata *conn, char *line, size_t len, | ||
40 | Section 4. Examples of RFC-4954 but some e-mail servers ignore this and | ||
41 | only send the response code instead as per Section 4.2. */ | ||
42 | if(line[3] == ' ' || len == 5) { | ||
43 | + char tmpline[6]; | ||
44 | + | ||
45 | result = TRUE; | ||
46 | - *resp = curlx_sltosi(strtol(line, NULL, 10)); | ||
47 | + memset(tmpline, '\0', sizeof(tmpline)); | ||
48 | + memcpy(tmpline, line, (len == 5 ? 5 : 3)); | ||
49 | + *resp = curlx_sltosi(strtol(tmpline, NULL, 10)); | ||
50 | |||
51 | /* Make sure real server never sends internal value */ | ||
52 | if(*resp == 1) | ||
53 | -- | ||
54 | 2.22.0 | ||
55 | |||