summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
authorHugo SIMELIERE <hsimeliere.opensource@witekio.com>2024-02-19 13:11:06 +0100
committerSteve Sakoman <steve@sakoman.com>2024-02-28 03:32:09 -1000
commit35e45b6d515695bd0e1fdab5ae0e0e00fa4e07e7 (patch)
treeee24e926bd32289e1f815d4a260cc1ad27ab5eda /meta/recipes-connectivity
parent43691193b4d65eb45399bb02289dadea9f6ab46f (diff)
downloadpoky-35e45b6d515695bd0e1fdab5ae0e0e00fa4e07e7.tar.gz
libuv: fix CVE-2024-24806
Upstream-Status: Backport [https://github.com/libuv/libuv/commit/0f2d7e784a256b54b2385043438848047bc2a629] Upstream-Status: Backport [https://github.com/libuv/libuv/commit/3530bcc30350d4a6ccf35d2f7b33e23292b9de70] Upstream-Status: Backport [https://github.com/libuv/libuv/commit/e0327e1d508b8207c9150b6e582f0adf26213c39] (From OE-Core rev: 9aa207a91a78309015aa0070a98769c821a7ecd6) Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r--meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch56
-rw-r--r--meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch44
-rw-r--r--meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch31
-rw-r--r--meta/recipes-connectivity/libuv/libuv_1.44.2.bb6
4 files changed, 136 insertions, 1 deletions
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch
new file mode 100644
index 0000000000..d263cced8d
--- /dev/null
+++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-1.patch
@@ -0,0 +1,56 @@
1From b8ee33667d265b936d60ee7f0ba0b22463ccb019 Mon Sep 17 00:00:00 2001
2From: Ben Noordhuis <info@bnoordhuis.nl>
3Date: Thu, 18 Jan 2024 14:51:40 +0100
4Subject: [PATCH] fix: always zero-terminate idna output
5
6Upstream-Status: Backport [https://github.com/libuv/libuv/commit/0f2d7e784a256b54b2385043438848047bc2a629]
7CVE: CVE-2024-24806
8
9Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6
10Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
11---
12 src/idna.c | 5 +++--
13 test/test-idna.c | 4 ++++
14 2 files changed, 7 insertions(+), 2 deletions(-)
15
16diff --git a/src/idna.c b/src/idna.c
17index 93d982ca..ce7f2746 100644
18--- a/src/idna.c
19+++ b/src/idna.c
20@@ -308,8 +308,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
21 return rc;
22 }
23
24- if (d < de)
25- *d++ = '\0';
26+ if (d >= de)
27+ return UV_EINVAL;
28
29+ *d++ = '\0';
30 return d - ds; /* Number of bytes written. */
31 }
32diff --git a/test/test-idna.c b/test/test-idna.c
33index f4fad965..d079be55 100644
34--- a/test/test-idna.c
35+++ b/test/test-idna.c
36@@ -99,6 +99,7 @@ TEST_IMPL(utf8_decode1) {
37 TEST_IMPL(utf8_decode1_overrun) {
38 const char* p;
39 char b[1];
40+ char c[1];
41
42 /* Single byte. */
43 p = b;
44@@ -112,6 +113,9 @@ TEST_IMPL(utf8_decode1_overrun) {
45 ASSERT_EQ((unsigned) -1, uv__utf8_decode1(&p, b + 1));
46 ASSERT_EQ(p, b + 1);
47
48+ b[0] = 0x7F;
49+ ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 1, c, c + 1));
50+
51 return 0;
52 }
53
54--
552.43.0
56
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch
new file mode 100644
index 0000000000..b0ed5f0ea2
--- /dev/null
+++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-2.patch
@@ -0,0 +1,44 @@
1From 96f881c8f600da33ec4ecec450ec491990ce613b Mon Sep 17 00:00:00 2001
2From: Ben Noordhuis <info@bnoordhuis.nl>
3Date: Thu, 18 Jan 2024 14:52:38 +0100
4Subject: [PATCH] fix: reject zero-length idna inputs
5
6Upstream-Status: Backport [https://github.com/libuv/libuv/commit/3530bcc30350d4a6ccf35d2f7b33e23292b9de70]
7CVE: CVE-2024-24806
8
9Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6
10Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
11---
12 src/idna.c | 3 +++
13 test/test-idna.c | 1 +
14 2 files changed, 4 insertions(+)
15
16diff --git a/src/idna.c b/src/idna.c
17index ce7f2746..858b19d0 100644
18--- a/src/idna.c
19+++ b/src/idna.c
20@@ -274,6 +274,9 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
21 char* ds;
22 int rc;
23
24+ if (s == se)
25+ return UV_EINVAL;
26+
27 ds = d;
28
29 si = s;
30diff --git a/test/test-idna.c b/test/test-idna.c
31index d079be55..d59b521e 100644
32--- a/test/test-idna.c
33+++ b/test/test-idna.c
34@@ -114,6 +114,7 @@ TEST_IMPL(utf8_decode1_overrun) {
35 ASSERT_EQ(p, b + 1);
36
37 b[0] = 0x7F;
38+ ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 0, c, c + 1));
39 ASSERT_EQ(UV_EINVAL, uv__idna_toascii(b, b + 1, c, c + 1));
40
41 return 0;
42--
432.43.0
44
diff --git a/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch
new file mode 100644
index 0000000000..733660cf05
--- /dev/null
+++ b/meta/recipes-connectivity/libuv/libuv/CVE-2024-24806-3.patch
@@ -0,0 +1,31 @@
1From a7443ee6b3b3c6a12708148aa9bb001b7782905c Mon Sep 17 00:00:00 2001
2From: Santiago Gimeno <santiago.gimeno@gmail.com>
3Date: Wed, 7 Feb 2024 20:27:58 +0100
4Subject: [PATCH] test: empty strings are not valid IDNA
5
6Upstream-Status: Backport [https://github.com/libuv/libuv/commit/e0327e1d508b8207c9150b6e582f0adf26213c39]
7CVE: CVE-2024-24806
8
9Fixes: https://github.com/libuv/libuv/security/advisories/GHSA-f74f-cvh7-c6q6
10Signed-off-by: Hugo SIMELIERE <hsimeliere.opensource@witekio.com>
11---
12 test/test-idna.c | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/test/test-idna.c b/test/test-idna.c
16index d59b521e..37da38de 100644
17--- a/test/test-idna.c
18+++ b/test/test-idna.c
19@@ -150,8 +150,8 @@ TEST_IMPL(idna_toascii) {
20 /* Illegal inputs. */
21 F("\xC0\x80\xC1\x80", UV_EINVAL); /* Overlong UTF-8 sequence. */
22 F("\xC0\x80\xC1\x80.com", UV_EINVAL); /* Overlong UTF-8 sequence. */
23+ F("", UV_EINVAL);
24 /* No conversion. */
25- T("", "");
26 T(".", ".");
27 T(".com", ".com");
28 T("example", "example");
29--
302.43.0
31
diff --git a/meta/recipes-connectivity/libuv/libuv_1.44.2.bb b/meta/recipes-connectivity/libuv/libuv_1.44.2.bb
index 27e79276b5..e2cd3c3247 100644
--- a/meta/recipes-connectivity/libuv/libuv_1.44.2.bb
+++ b/meta/recipes-connectivity/libuv/libuv_1.44.2.bb
@@ -6,7 +6,11 @@ LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d" 6LIC_FILES_CHKSUM = "file://LICENSE;md5=ad93ca1fffe931537fcf64f6fcce084d"
7 7
8SRCREV = "0c1fa696aa502eb749c2c4735005f41ba00a27b8" 8SRCREV = "0c1fa696aa502eb749c2c4735005f41ba00a27b8"
9SRC_URI = "git://github.com/libuv/libuv.git;branch=v1.x;protocol=https" 9SRC_URI = "git://github.com/libuv/libuv.git;branch=v1.x;protocol=https \
10 file://CVE-2024-24806-1.patch \
11 file://CVE-2024-24806-2.patch \
12 file://CVE-2024-24806-3.patch \
13 "
10UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)" 14UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
11 15
12S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"