diff options
| author | Chee Yang Lee <chee.yang.lee@intel.com> | 2023-08-16 09:29:58 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-08-30 04:52:35 -1000 |
| commit | b2e02ea2beb600e110339857fdcb602ffd271b89 (patch) | |
| tree | e6a8c9f06c9a8b88d8039be7e046c73a1523f568 | |
| parent | aa63b25cbe25d89ab07ca11ee72c17cab68df8de (diff) | |
| download | poky-b2e02ea2beb600e110339857fdcb602ffd271b89.tar.gz | |
curl: fix CVE-2023-32001
(From OE-Core rev: f6ab54c91d18d5ebb0c7e27e41f49fc17c9d8c1c)
Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-support/curl/curl/CVE-2023-32001.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-support/curl/curl_8.0.1.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2023-32001.patch b/meta/recipes-support/curl/curl/CVE-2023-32001.patch new file mode 100644 index 0000000000..c9ca3ae514 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2023-32001.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | CVE: CVE-2023-32001 | ||
| 2 | Upstream-Status: Backport [https://github.com/curl/curl/commit/0c667188e0c6cda615a036b8a2b4125f2c404dde] | ||
| 3 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
| 4 | |||
| 5 | |||
| 6 | From 0c667188e0c6cda615a036b8a2b4125f2c404dde Mon Sep 17 00:00:00 2001 | ||
| 7 | From: SaltyMilk <soufiane.elmelcaoui@gmail.com> | ||
| 8 | Date: Mon, 10 Jul 2023 21:43:28 +0200 | ||
| 9 | Subject: [PATCH] fopen: optimize | ||
| 10 | |||
| 11 | Closes #11419 | ||
| 12 | --- | ||
| 13 | lib/fopen.c | 12 ++++++------ | ||
| 14 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/lib/fopen.c b/lib/fopen.c | ||
| 17 | index c9c9e3d6e73a2..b6e3cadddef65 100644 | ||
| 18 | --- a/lib/fopen.c | ||
| 19 | +++ b/lib/fopen.c | ||
| 20 | @@ -56,13 +56,13 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, | ||
| 21 | int fd = -1; | ||
| 22 | *tempname = NULL; | ||
| 23 | |||
| 24 | - if(stat(filename, &sb) == -1 || !S_ISREG(sb.st_mode)) { | ||
| 25 | - /* a non-regular file, fallback to direct fopen() */ | ||
| 26 | - *fh = fopen(filename, FOPEN_WRITETEXT); | ||
| 27 | - if(*fh) | ||
| 28 | - return CURLE_OK; | ||
| 29 | + *fh = fopen(filename, FOPEN_WRITETEXT); | ||
| 30 | + if(!*fh) | ||
| 31 | goto fail; | ||
| 32 | - } | ||
| 33 | + if(fstat(fileno(*fh), &sb) == -1 || !S_ISREG(sb.st_mode)) | ||
| 34 | + return CURLE_OK; | ||
| 35 | + fclose(*fh); | ||
| 36 | + *fh = NULL; | ||
| 37 | |||
| 38 | result = Curl_rand_hex(data, randsuffix, sizeof(randsuffix)); | ||
| 39 | if(result) | ||
diff --git a/meta/recipes-support/curl/curl_8.0.1.bb b/meta/recipes-support/curl/curl_8.0.1.bb index ecef173df2..bcfe4a6088 100644 --- a/meta/recipes-support/curl/curl_8.0.1.bb +++ b/meta/recipes-support/curl/curl_8.0.1.bb | |||
| @@ -17,6 +17,7 @@ SRC_URI = " \ | |||
| 17 | file://CVE-2023-28319.patch \ | 17 | file://CVE-2023-28319.patch \ |
| 18 | file://CVE-2023-28320.patch \ | 18 | file://CVE-2023-28320.patch \ |
| 19 | file://CVE-2023-28321.patch \ | 19 | file://CVE-2023-28321.patch \ |
| 20 | file://CVE-2023-32001.patch \ | ||
| 20 | " | 21 | " |
| 21 | SRC_URI[sha256sum] = "0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0" | 22 | SRC_URI[sha256sum] = "0a381cd82f4d00a9a334438b8ca239afea5bfefcfa9a1025f2bf118e79e0b5f0" |
| 22 | 23 | ||
