summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhabu Bindu <bhabu.bindu@kpit.com>2022-11-29 09:27:19 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-07 15:02:45 +0000
commitbfec99ed33d00ecb6d4d66e706e16a6a97a6e9eb (patch)
tree65a9a50ee90b6a3b70520318af2d3751921c5c96
parentb1ea1218bd548612dfc5ef94fb5b2d15b5637bca (diff)
downloadpoky-bfec99ed33d00ecb6d4d66e706e16a6a97a6e9eb.tar.gz
curl: Fix CVE-2022-42915
HTTP proxy double-free Link: https://security-tracker.debian.org/tracker/CVE-2022-42915 (From OE-Core rev: 4754f33d7ec96f72351853463540c8b1a3f4bc0c) Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/curl/curl/CVE-2022-42915.patch53
-rw-r--r--meta/recipes-support/curl/curl_7.82.0.bb1
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-support/curl/curl/CVE-2022-42915.patch b/meta/recipes-support/curl/curl/CVE-2022-42915.patch
new file mode 100644
index 0000000000..0f37a80e09
--- /dev/null
+++ b/meta/recipes-support/curl/curl/CVE-2022-42915.patch
@@ -0,0 +1,53 @@
1From 55e1875729f9d9fc7315cec611bffbd2c817ad89 Mon Sep 17 00:00:00 2001
2From: Daniel Stenberg <daniel@haxx.se>
3Date: Thu, 6 Oct 2022 14:13:36 +0200
4Subject: [PATCH] http_proxy: restore the protocol pointer on error
5
6Reported-by: Trail of Bits
7
8Closes #9790
9
10CVE: CVE-2022-42915
11Upstream-Status: Backport [https://github.com/curl/curl/commit/55e1875729f9d9fc7315cec611bffbd2c817ad89]
12Signed-off-by: Bhabu Bindu <bhabu.bindu@kpit.com>
13---
14 lib/http_proxy.c | 6 ++----
15 lib/url.c | 9 ---------
16 2 files changed, 2 insertions(+), 13 deletions(-)
17
18diff --git a/lib/http_proxy.c b/lib/http_proxy.c
19index 1f87f6c62aa40..cc20b3a801941 100644
20--- a/lib/http_proxy.c
21+++ b/lib/http_proxy.c
22@@ -212,10 +212,8 @@ void Curl_connect_done(struct Curl_easy *data)
23 Curl_dyn_free(&s->rcvbuf);
24 Curl_dyn_free(&s->req);
25
26- /* restore the protocol pointer, if not already done */
27- if(s->prot_save)
28- data->req.p.http = s->prot_save;
29- s->prot_save = NULL;
30+ /* restore the protocol pointer */
31+ data->req.p.http = s->prot_save;
32 data->info.httpcode = 0; /* clear it as it might've been used for the
33 proxy */
34 data->req.ignorebody = FALSE;
35diff --git a/lib/url.c b/lib/url.c
36index 690c53c81a3c1..be5ffca2d8b20 100644
37--- a/lib/url.c
38+++ b/lib/url.c
39@@ -751,15 +751,6 @@ static void conn_shutdown(struct Curl_easy *data, struct connectdata *conn)
40 DEBUGASSERT(data);
41 infof(data, "Closing connection %ld", conn->connection_id);
42
43-#ifndef USE_HYPER
44- if(conn->connect_state && conn->connect_state->prot_save) {
45- /* If this was closed with a CONNECT in progress, cleanup this temporary
46- struct arrangement */
47- data->req.p.http = NULL;
48- Curl_safefree(conn->connect_state->prot_save);
49- }
50-#endif
51-
52 /* possible left-overs from the async name resolvers */
53 Curl_resolver_cancel(data);
diff --git a/meta/recipes-support/curl/curl_7.82.0.bb b/meta/recipes-support/curl/curl_7.82.0.bb
index a3e29a583d..87f4cd13aa 100644
--- a/meta/recipes-support/curl/curl_7.82.0.bb
+++ b/meta/recipes-support/curl/curl_7.82.0.bb
@@ -31,6 +31,7 @@ SRC_URI = "https://curl.se/download/${BP}.tar.xz \
31 file://CVE-2022-35252.patch \ 31 file://CVE-2022-35252.patch \
32 file://CVE-2022-32221.patch \ 32 file://CVE-2022-32221.patch \
33 file://CVE-2022-42916.patch \ 33 file://CVE-2022-42916.patch \
34 file://CVE-2022-42915.patch \
34 " 35 "
35SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c" 36SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"
36 37