summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorHitendra Prajapati <hprajapati@mvista.com>2024-11-19 12:13:08 +0530
committerSteve Sakoman <steve@sakoman.com>2024-11-26 06:11:29 -0800
commita0e25e6652803043a2e9acd8f2493bf7ec45f161 (patch)
tree35a6a2f217c88aef59ab064453407d1bc8fb0f5e /meta
parentd1c25a3ce446a23e453e40ac2ba8f22b0e7ccefd (diff)
downloadpoky-a0e25e6652803043a2e9acd8f2493bf7ec45f161.tar.gz
libsoup: fix CVE-2024-52532
Upstream-Status: Backport from https://gitlab.gnome.org/GNOME/libsoup/-/commit/6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be && https://gitlab.gnome.org/GNOME/libsoup/-/commit/29b96fab2512666d7241e46c98cc45b60b795c0c (From OE-Core rev: 5a28744c74270905d4b29285589a399df4c9cb68) Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0001.patch42
-rw-r--r--meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0002.patch36
-rw-r--r--meta/recipes-support/libsoup/libsoup_3.4.4.bb5
3 files changed, 82 insertions, 1 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0001.patch b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0001.patch
new file mode 100644
index 0000000000..272abb3abf
--- /dev/null
+++ b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0001.patch
@@ -0,0 +1,42 @@
1From 29b96fab2512666d7241e46c98cc45b60b795c0c Mon Sep 17 00:00:00 2001
2From: Ignacio Casal Quinteiro <qignacio@amazon.com>
3Date: Wed, 2 Oct 2024 11:17:19 +0200
4Subject: [PATCH] websocket-test: disconnect error copy after the test ends
5
6Otherwise the server will have already sent a few more wrong
7bytes and the client will continue getting errors to copy
8but the error is already != NULL and it will assert.
9
10Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/29b96fab2512666d7241e46c98cc45b60b795c0c]
11CVE: CVE-2024-52532
12Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
13---
14 tests/websocket-test.c | 4 +++-
15 1 file changed, 3 insertions(+), 1 deletion(-)
16
17diff --git a/tests/websocket-test.c b/tests/websocket-test.c
18index b954b01..9b37780 100644
19--- a/tests/websocket-test.c
20+++ b/tests/websocket-test.c
21@@ -1489,8 +1489,9 @@ test_receive_invalid_encode_length_64 (Test *test,
22 GError *error = NULL;
23 InvalidEncodeLengthTest context = { test, NULL };
24 guint i;
25+ guint error_id;
26
27- g_signal_connect (test->client, "error", G_CALLBACK (on_error_copy), &error);
28+ error_id = g_signal_connect (test->client, "error", G_CALLBACK (on_error_copy), &error);
29 g_signal_connect (test->client, "message", G_CALLBACK (on_binary_message), &received);
30
31 /* We use 127(\x7f) as payload length with 65535 extended length */
32@@ -1503,6 +1504,7 @@ test_receive_invalid_encode_length_64 (Test *test,
33 WAIT_UNTIL (error != NULL || received != NULL);
34 g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR);
35 g_clear_error (&error);
36+ g_signal_handler_disconnect (test->client, error_id);
37 g_assert_null (received);
38
39 g_thread_join (thread);
40--
412.25.1
42
diff --git a/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0002.patch b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0002.patch
new file mode 100644
index 0000000000..a1690a9980
--- /dev/null
+++ b/meta/recipes-support/libsoup/libsoup-3.4.4/CVE-2024-52532-0002.patch
@@ -0,0 +1,36 @@
1From 6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be Mon Sep 17 00:00:00 2001
2From: Ignacio Casal Quinteiro <qignacio@amazon.com>
3Date: Wed, 11 Sep 2024 11:52:11 +0200
4Subject: [PATCH] websocket: process the frame as soon as we read data
5
6Otherwise we can enter in a read loop because we were not
7validating the data until the all the data was read.
8
9Fixes #391
10
11Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be]
12CVE: CVE-2024-52532
13Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
14---
15 libsoup/websocket/soup-websocket-connection.c | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/libsoup/websocket/soup-websocket-connection.c b/libsoup/websocket/soup-websocket-connection.c
19index 2f7d920..df8f67d 100644
20--- a/libsoup/websocket/soup-websocket-connection.c
21+++ b/libsoup/websocket/soup-websocket-connection.c
22@@ -1165,9 +1165,9 @@ soup_websocket_connection_read (SoupWebsocketConnection *self)
23 }
24
25 priv->incoming->len = len + count;
26- } while (count > 0);
27
28- process_incoming (self);
29+ process_incoming (self);
30+ } while (count > 0 && !priv->close_sent && !priv->io_closing);
31
32 if (end) {
33 if (!priv->close_sent || !priv->close_received) {
34--
352.25.1
36
diff --git a/meta/recipes-support/libsoup/libsoup_3.4.4.bb b/meta/recipes-support/libsoup/libsoup_3.4.4.bb
index 6f7cac4cf8..0e66715589 100644
--- a/meta/recipes-support/libsoup/libsoup_3.4.4.bb
+++ b/meta/recipes-support/libsoup/libsoup_3.4.4.bb
@@ -11,7 +11,10 @@ DEPENDS = "glib-2.0 glib-2.0-native libxml2 sqlite3 libpsl nghttp2"
11 11
12SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" 12SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
13 13
14SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz" 14SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \
15 file://CVE-2024-52532-0001.patch \
16 file://CVE-2024-52532-0002.patch \
17 "
15SRC_URI[sha256sum] = "291c67725f36ed90ea43efff25064b69c5a2d1981488477c05c481a3b4b0c5aa" 18SRC_URI[sha256sum] = "291c67725f36ed90ea43efff25064b69c5a2d1981488477c05c481a3b4b0c5aa"
16 19
17PROVIDES = "libsoup-3.0" 20PROVIDES = "libsoup-3.0"