Skip to contentSkip to conversation

curl: fix CVE-2021-22945 through -22947

PATCH New [email protected] 1 participant 1 message Oct 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 curl: fix CVE-2021-22945 through -22947

From: Mingli Yu <[email protected]>

Backport patches to fix below CVEs:
- CVE-2021-22945
- CVE-2021-22946
- CVE-2021-22947

---
 .../curl/curl/CVE-2021-22945.patch            |  36 +++++
 .../curl/curl/CVE-2021-22946.patch            | 133 ++++++++++++++++++
 .../curl/curl/CVE-2021-22947.patch            |  91 ++++++++++++
 meta/recipes-support/curl/curl_7.75.0.bb      |   3 +
 4 files changed, 263 insertions(+)
 create mode 100644 meta/recipes-support/curl/curl/CVE-2021-22945.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2021-22946.patch
 create mode 100644 meta/recipes-support/curl/curl/CVE-2021-22947.patch
meta/recipes-support/curl/curl/CVE-2021-22945.patch new file +36 -0
new file mode 100644
index 0000000000..f5a7d38fa1
@@ -0,0 +1,36 @@
+From 43157490a5054bd24256fe12876931e8abc9df49 Mon Sep 17 00:00:00 2001
+From: z2_ on hackerone <>
+Date: Tue, 24 Aug 2021 09:50:33 +0200
+Subject: [PATCH] mqtt: clear the leftovers pointer when sending succeeds
+
+CVE-2021-22945
+
+Bug: https://curl.se/docs/CVE-2021-22945.html
+
+CVE: CVE-2021-22945
+
+Upstream-Status: Backport[https://github.com/curl/curl/commit/43157490a5054bd24256fe12876931e8abc9df49]
+
+Signed-off-by: Mingli Yu <[email protected]>
+---
+ lib/mqtt.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/mqtt.c b/lib/mqtt.c
+index f077e6c3d..fcd40b41e 100644
+--- a/lib/mqtt.c
++++ b/lib/mqtt.c
+@@ -128,6 +128,10 @@ static CURLcode mqtt_send(struct Curl_easy *data,
+     mq->sendleftovers = sendleftovers;
+     mq->nsend = nsend;
+   }
++  else {
++    mq->sendleftovers = NULL;
++    mq->nsend = 0;
++  }
+   return result;
+ }
+ 
+-- 
+2.17.1
+
meta/recipes-support/curl/curl/CVE-2021-22946.patch new file +133 -0

133 lines not on this page · raw message

meta/recipes-support/curl/curl/CVE-2021-22947.patch new file +91 -0

91 lines not on this page · raw message

meta/recipes-support/curl/curl_7.75.0.bb +3 -0
index d64e5e1f79..d9818b6f07 100644
@@ -21,6 +21,9 @@ SRC_URI = "https://curl.haxx.se/download/curl-${PV}.tar.bz2 \
            file://CVE-2021-22901.patch \
            file://CVE-2021-22924.patch \
            file://CVE-2021-22926.patch \
+           file://CVE-2021-22945.patch \
+           file://CVE-2021-22946.patch \
+           file://CVE-2021-22947.patch \
 "
 
 SRC_URI[sha256sum] = "50552d4501c178e4cc68baaecc487f466a3d6d19bbf4e50a01869effb316d026"
Signature · 1 line
2.17.1