diff options
| author | Mathieu Dubois-Briand <mathieu.dubois-briand@hyprua.org> | 2022-12-08 13:39:26 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-23 23:05:44 +0000 |
| commit | b4fc8a65f51796154fb9eba9eb05dc068fe0673b (patch) | |
| tree | 599b9918107e52f5b6f112fe7103b8e289a1d52d /meta/recipes-support | |
| parent | 80e00ba9b9812272abff8d2687e27e98bf2f48f3 (diff) | |
| download | poky-b4fc8a65f51796154fb9eba9eb05dc068fe0673b.tar.gz | |
curl: Fix CVE CVE-2022-35260
(From OE-Core rev: fe81ee17a2dc9924178fdd98614ed9e264204492)
Signed-off-by: Mathieu Dubois-Briand <mbriand@witekio.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
| -rw-r--r-- | meta/recipes-support/curl/curl/CVE-2022-35260.patch | 68 | ||||
| -rw-r--r-- | meta/recipes-support/curl/curl_7.69.1.bb | 1 |
2 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2022-35260.patch b/meta/recipes-support/curl/curl/CVE-2022-35260.patch new file mode 100644 index 0000000000..476c996b0a --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2022-35260.patch | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | From 3ff3989ec53d9ddcf4bdd99f5d5788dd87486768 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Daniel Stenberg <daniel@haxx.se> | ||
| 3 | Date: Tue, 4 Oct 2022 14:37:24 +0200 | ||
| 4 | Subject: [PATCH] netrc: replace fgets with Curl_get_line | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | CVE: CVE-2022-35260 | ||
| 8 | Reference to upstream patch: https://github.com/curl/curl/commit/c97ec984fb2bc919a3aa863e0476dffa377b184c | ||
| 9 | |||
| 10 | Make the parser only accept complete lines and avoid problems with | ||
| 11 | overly long lines. | ||
| 12 | |||
| 13 | Reported-by: Hiroki Kurosawa | ||
| 14 | |||
| 15 | Closes #9789 | ||
| 16 | --- | ||
| 17 | lib/curl_get_line.c | 4 ++-- | ||
| 18 | lib/netrc.c | 5 +++-- | ||
| 19 | 2 files changed, 5 insertions(+), 4 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c | ||
| 22 | index c4194851ae09..4b9eea9e631c 100644 | ||
| 23 | --- a/lib/curl_get_line.c | ||
| 24 | +++ b/lib/curl_get_line.c | ||
| 25 | @@ -28,8 +28,8 @@ | ||
| 26 | #include "memdebug.h" | ||
| 27 | |||
| 28 | /* | ||
| 29 | - * get_line() makes sure to only return complete whole lines that fit in 'len' | ||
| 30 | - * bytes and end with a newline. | ||
| 31 | + * Curl_get_line() makes sure to only return complete whole lines that fit in | ||
| 32 | + * 'len' bytes and end with a newline. | ||
| 33 | */ | ||
| 34 | char *Curl_get_line(char *buf, int len, FILE *input) | ||
| 35 | { | ||
| 36 | diff --git a/lib/netrc.c b/lib/netrc.c | ||
| 37 | index 1c9da31993c9..93239132c9d8 100644 | ||
| 38 | --- a/lib/netrc.c | ||
| 39 | +++ b/lib/netrc.c | ||
| 40 | @@ -31,6 +31,7 @@ | ||
| 41 | #include "netrc.h" | ||
| 42 | #include "strtok.h" | ||
| 43 | #include "strcase.h" | ||
| 44 | +#include "curl_get_line.h" | ||
| 45 | |||
| 46 | /* The last 3 #include files should be in this order */ | ||
| 47 | #include "curl_printf.h" | ||
| 48 | @@ -83,7 +84,7 @@ static int parsenetrc(const char *host, | ||
| 49 | char netrcbuffer[4096]; | ||
| 50 | int netrcbuffsize = (int)sizeof(netrcbuffer); | ||
| 51 | |||
| 52 | - while(!done && fgets(netrcbuffer, netrcbuffsize, file)) { | ||
| 53 | + while(!done && Curl_get_line(netrcbuffer, netrcbuffsize, file)) { | ||
| 54 | tok = strtok_r(netrcbuffer, " \t\n", &tok_buf); | ||
| 55 | if(tok && *tok == '#') | ||
| 56 | /* treat an initial hash as a comment line */ | ||
| 57 | @@ -169,7 +170,7 @@ static int parsenetrc(const char *host, | ||
| 58 | |||
| 59 | tok = strtok_r(NULL, " \t\n", &tok_buf); | ||
| 60 | } /* while(tok) */ | ||
| 61 | - } /* while fgets() */ | ||
| 62 | + } /* while Curl_get_line() */ | ||
| 63 | |||
| 64 | out: | ||
| 65 | if(!retcode) { | ||
| 66 | -- | ||
| 67 | 2.34.1 | ||
| 68 | |||
diff --git a/meta/recipes-support/curl/curl_7.69.1.bb b/meta/recipes-support/curl/curl_7.69.1.bb index 31aa9d7185..63faae6296 100644 --- a/meta/recipes-support/curl/curl_7.69.1.bb +++ b/meta/recipes-support/curl/curl_7.69.1.bb | |||
| @@ -40,6 +40,7 @@ SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \ | |||
| 40 | file://CVE-2022-32208.patch \ | 40 | file://CVE-2022-32208.patch \ |
| 41 | file://CVE-2022-35252.patch \ | 41 | file://CVE-2022-35252.patch \ |
| 42 | file://CVE-2022-32221.patch \ | 42 | file://CVE-2022-32221.patch \ |
| 43 | file://CVE-2022-35260.patch \ | ||
| 43 | " | 44 | " |
| 44 | 45 | ||
| 45 | SRC_URI[md5sum] = "ec5fc263f898a3dfef08e805f1ecca42" | 46 | SRC_URI[md5sum] = "ec5fc263f898a3dfef08e805f1ecca42" |
