diff options
| author | Vijay Anusuri <vanusuri@mvista.com> | 2025-05-06 21:27:29 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-05-14 09:08:57 -0700 |
| commit | 929989c6c3ef8a4dafc9fb001590b8595aa62871 (patch) | |
| tree | 4f028709944c1ae047184d4bfd482d7dbb583921 | |
| parent | e2e65311f8fd7b84af2c5cf7b4e9940c9649e025 (diff) | |
| download | poky-929989c6c3ef8a4dafc9fb001590b8595aa62871.tar.gz | |
libsoup-2.4: Fix CVE-2024-52532
Upstream-Status: Backport from https://gitlab.gnome.org/GNOME/libsoup/-/commit/6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be
&
https://gitlab.gnome.org/GNOME/libsoup/-/commit/29b96fab2512666d7241e46c98cc45b60b795c0c
& https://gitlab.gnome.org/GNOME/libsoup/-/commit/4c9e75c6676a37b6485620c332e568e1a3f530ff
(From OE-Core rev: dfde13ecffad3426846bd4b366d1e0cdb77b1be0)
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
4 files changed, 127 insertions, 0 deletions
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-1.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-1.patch new file mode 100644 index 0000000000..68eb942762 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-1.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | From 6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ignacio Casal Quinteiro <qignacio@amazon.com> | ||
| 3 | Date: Wed, 11 Sep 2024 11:52:11 +0200 | ||
| 4 | Subject: [PATCH] websocket: process the frame as soon as we read data | ||
| 5 | |||
| 6 | Otherwise we can enter in a read loop because we were not | ||
| 7 | validating the data until the all the data was read. | ||
| 8 | |||
| 9 | Fixes #391 | ||
| 10 | |||
| 11 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/6adc0e3eb74c257ed4e2a23eb4b2774fdb0d67be] | ||
| 12 | CVE: CVE-2024-52532 | ||
| 13 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 14 | --- | ||
| 15 | libsoup/soup-websocket-connection.c | 4 ++-- | ||
| 16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c | ||
| 19 | index a4095e1..9d5f4f8 100644 | ||
| 20 | --- a/libsoup/soup-websocket-connection.c | ||
| 21 | +++ b/libsoup/soup-websocket-connection.c | ||
| 22 | @@ -1140,9 +1140,9 @@ soup_websocket_connection_read (SoupWebsocketConnection *self) | ||
| 23 | } | ||
| 24 | |||
| 25 | pv->incoming->len = len + count; | ||
| 26 | - } while (count > 0); | ||
| 27 | |||
| 28 | - process_incoming (self); | ||
| 29 | + process_incoming (self); | ||
| 30 | + } while (count > 0 && !pv->close_sent && !pv->io_closing); | ||
| 31 | |||
| 32 | if (end) { | ||
| 33 | if (!pv->close_sent || !pv->close_received) { | ||
| 34 | -- | ||
| 35 | 2.25.1 | ||
| 36 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-2.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-2.patch new file mode 100644 index 0000000000..e4e2d03d58 --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-2.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 29b96fab2512666d7241e46c98cc45b60b795c0c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Ignacio Casal Quinteiro <qignacio@amazon.com> | ||
| 3 | Date: Wed, 2 Oct 2024 11:17:19 +0200 | ||
| 4 | Subject: [PATCH] websocket-test: disconnect error copy after the test ends | ||
| 5 | |||
| 6 | Otherwise the server will have already sent a few more wrong | ||
| 7 | bytes and the client will continue getting errors to copy | ||
| 8 | but the error is already != NULL and it will assert | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/29b96fab2512666d7241e46c98cc45b60b795c0c] | ||
| 11 | CVE: CVE-2024-52532 | ||
| 12 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 13 | --- | ||
| 14 | tests/websocket-test.c | 4 +++- | ||
| 15 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/tests/websocket-test.c b/tests/websocket-test.c | ||
| 18 | index 06c443bb5..6a48c1f9b 100644 | ||
| 19 | --- a/tests/websocket-test.c | ||
| 20 | +++ b/tests/websocket-test.c | ||
| 21 | @@ -1539,8 +1539,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 | @@ -1553,6 +1554,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 | -- | ||
| 41 | GitLab | ||
| 42 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-3.patch b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-3.patch new file mode 100644 index 0000000000..edcca86e8c --- /dev/null +++ b/meta/recipes-support/libsoup/libsoup-2.4/CVE-2024-52532-3.patch | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | From 4c9e75c6676a37b6485620c332e568e1a3f530ff Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon McVittie <smcv@debian.org> | ||
| 3 | Date: Wed, 13 Nov 2024 14:14:23 +0000 | ||
| 4 | Subject: [PATCH] websocket-test: Disconnect error signal in another place | ||
| 5 | |||
| 6 | This is the same change as commit 29b96fab "websocket-test: disconnect | ||
| 7 | error copy after the test ends", and is done for the same reason, but | ||
| 8 | replicating it into a different function. | ||
| 9 | |||
| 10 | Fixes: 6adc0e3e "websocket: process the frame as soon as we read data" | ||
| 11 | Resolves: https://gitlab.gnome.org/GNOME/libsoup/-/issues/399 | ||
| 12 | Signed-off-by: Simon McVittie <smcv@debian.org> | ||
| 13 | |||
| 14 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libsoup/-/commit/4c9e75c6676a37b6485620c332e568e1a3f530ff] | ||
| 15 | CVE: CVE-2024-52532 | ||
| 16 | Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> | ||
| 17 | --- | ||
| 18 | tests/websocket-test.c | 4 +++- | ||
| 19 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/tests/websocket-test.c b/tests/websocket-test.c | ||
| 22 | index 6a48c1f9..723f2857 100644 | ||
| 23 | --- a/tests/websocket-test.c | ||
| 24 | +++ b/tests/websocket-test.c | ||
| 25 | @@ -1508,8 +1508,9 @@ test_receive_invalid_encode_length_16 (Test *test, | ||
| 26 | GError *error = NULL; | ||
| 27 | InvalidEncodeLengthTest context = { test, NULL }; | ||
| 28 | guint i; | ||
| 29 | + guint error_id; | ||
| 30 | |||
| 31 | - g_signal_connect (test->client, "error", G_CALLBACK (on_error_copy), &error); | ||
| 32 | + error_id = g_signal_connect (test->client, "error", G_CALLBACK (on_error_copy), &error); | ||
| 33 | g_signal_connect (test->client, "message", G_CALLBACK (on_binary_message), &received); | ||
| 34 | |||
| 35 | /* We use 126(~) as payload length with 125 extended length */ | ||
| 36 | @@ -1522,6 +1523,7 @@ test_receive_invalid_encode_length_16 (Test *test, | ||
| 37 | WAIT_UNTIL (error != NULL || received != NULL); | ||
| 38 | g_assert_error (error, SOUP_WEBSOCKET_ERROR, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR); | ||
| 39 | g_clear_error (&error); | ||
| 40 | + g_signal_handler_disconnect (test->client, error_id); | ||
| 41 | g_assert_null (received); | ||
| 42 | |||
| 43 | g_thread_join (thread); | ||
| 44 | -- | ||
| 45 | GitLab | ||
| 46 | |||
diff --git a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb index bd58773ba3..6125c0624a 100644 --- a/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb +++ b/meta/recipes-support/libsoup/libsoup-2.4_2.74.3.bb | |||
| @@ -16,6 +16,9 @@ SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz \ | |||
| 16 | file://CVE-2024-52530.patch \ | 16 | file://CVE-2024-52530.patch \ |
| 17 | file://CVE-2024-52531-1.patch \ | 17 | file://CVE-2024-52531-1.patch \ |
| 18 | file://CVE-2024-52531-2.patch \ | 18 | file://CVE-2024-52531-2.patch \ |
| 19 | file://CVE-2024-52532-1.patch \ | ||
| 20 | file://CVE-2024-52532-2.patch \ | ||
| 21 | file://CVE-2024-52532-3.patch \ | ||
| 19 | " | 22 | " |
| 20 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" | 23 | SRC_URI[sha256sum] = "e4b77c41cfc4c8c5a035fcdc320c7bc6cfb75ef7c5a034153df1413fa1d92f13" |
| 21 | 24 | ||
