Skip to content

Commit 9a40d1b

Browse files
committed
enable ptests, modified existing patches and fix ssl-test
1 parent e04ef73 commit 9a40d1b

13 files changed

+273
-187
lines changed

SPECS/libsoup/CVE-2025-2784.patch

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ https://gitlab.gnome.org/GNOME/libsoup/-/commit/c415ad0b6771992e66c70edf373566c6
1010
.../content-sniffer/soup-content-sniffer.c | 10 +--
1111
libsoup/soup-session.c | 6 ++
1212
tests/auth-test.c | 76 +++++++++++++++++++
13-
tests/meson.build | 3 +
13+
tests/meson.build | 4 +-
1414
tests/sniffing-test.c | 48 ++++++++++++
15-
5 files changed, 138 insertions(+), 5 deletions(-)
15+
5 files changed, 138 insertions(+), 6 deletions(-)
1616

1717
diff --git a/libsoup/content-sniffer/soup-content-sniffer.c b/libsoup/content-sniffer/soup-content-sniffer.c
18-
index f6629ad..3c072c1 100644
18+
index 243d52e..4b4bbb0 100644
1919
--- a/libsoup/content-sniffer/soup-content-sniffer.c
2020
+++ b/libsoup/content-sniffer/soup-content-sniffer.c
2121
@@ -630,8 +630,11 @@ sniff_text_or_binary (SoupContentSniffer *sniffer, GBytes *buffer)
@@ -162,13 +162,14 @@ index 5dbc319..51431f2 100644
162162
main (int argc, char **argv)
163163
{
164164
diff --git a/tests/meson.build b/tests/meson.build
165-
index fc1cb3f..ff94a4f 100644
165+
index fc1cb3f..946395d 100644
166166
--- a/tests/meson.build
167167
+++ b/tests/meson.build
168-
@@ -91,6 +91,9 @@ tests = [
168+
@@ -90,7 +90,9 @@ tests = [
169+
{'name': 'session'},
169170
{'name': 'server-auth'},
170171
{'name': 'server'},
171-
{'name': 'sniffing'},
172+
- {'name': 'sniffing'},
172173
+ {'name': 'sniffing',
173174
+ 'depends': [test_resources],
174175
+ },
@@ -242,5 +243,5 @@ index 6116719..7857732 100644
242243

243244
g_uri_unref (base_uri);
244245
--
245-
2.45.3
246+
2.45.4
246247

SPECS/libsoup/CVE-2025-32050.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ https://gitlab.gnome.org/GNOME/libsoup/-/commit/9bb0a55de55c6940ced811a64fbca82f
1010
1 file changed, 1 insertion(+), 1 deletion(-)
1111

1212
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
13-
index 8382b8f..4468415 100644
13+
index 13fe683..40df826 100644
1414
--- a/libsoup/soup-headers.c
1515
+++ b/libsoup/soup-headers.c
16-
@@ -907,7 +907,7 @@ append_param_quoted (GString *string,
16+
@@ -912,7 +912,7 @@ append_param_quoted (GString *string,
1717
const char *name,
1818
const char *value)
1919
{
@@ -23,5 +23,5 @@ index 8382b8f..4468415 100644
2323
g_string_append (string, name);
2424
g_string_append (string, "=\"");
2525
--
26-
2.45.3
26+
2.45.4
2727

SPECS/libsoup/CVE-2025-32051.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ https://gitlab.gnome.org/GNOME/libsoup/-/commit/0713ba4a719da938dc8facc89fca99cd
1212
1 file changed, 11 insertions(+)
1313

1414
diff --git a/libsoup/soup-uri-utils.c b/libsoup/soup-uri-utils.c
15-
index be2b79b..ad70fe6 100644
15+
index 8fea9a6..ce9b2a1 100644
1616
--- a/libsoup/soup-uri-utils.c
1717
+++ b/libsoup/soup-uri-utils.c
18-
@@ -286,6 +286,7 @@ soup_uri_decode_data_uri (const char *uri,
18+
@@ -294,6 +294,7 @@ soup_uri_decode_data_uri (const char *uri,
1919
gboolean base64 = FALSE;
2020
char *uri_string;
2121
GBytes *bytes;
2222
+ const char *path;
2323

2424
g_return_val_if_fail (uri != NULL, NULL);
2525

26-
@@ -300,9 +301,19 @@ soup_uri_decode_data_uri (const char *uri,
26+
@@ -308,9 +309,19 @@ soup_uri_decode_data_uri (const char *uri,
2727

2828
if (content_type)
2929
*content_type = NULL;
@@ -44,5 +44,5 @@ index be2b79b..ad70fe6 100644
4444
start = uri_string + 5;
4545
comma = strchr (start, ',');
4646
--
47-
2.45.3
47+
2.45.4
4848

SPECS/libsoup/CVE-2025-32052.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ https://gitlab.gnome.org/GNOME/libsoup/-/commit/f182429e5b1fc034050510da20c93256
1212
1 file changed, 1 insertion(+), 1 deletion(-)
1313

1414
diff --git a/libsoup/content-sniffer/soup-content-sniffer.c b/libsoup/content-sniffer/soup-content-sniffer.c
15-
index 150d285..a772c7c 100644
15+
index 4b4bbb0..3c072c1 100644
1616
--- a/libsoup/content-sniffer/soup-content-sniffer.c
1717
+++ b/libsoup/content-sniffer/soup-content-sniffer.c
18-
@@ -529,7 +529,7 @@ sniff_unknown (SoupContentSniffer *sniffer, GBytes *buffer,
18+
@@ -521,7 +521,7 @@ sniff_unknown (SoupContentSniffer *sniffer, GBytes *buffer,
1919
guint index_pattern = 0;
2020
gboolean skip_row = FALSE;
2121

@@ -25,5 +25,5 @@ index 150d285..a772c7c 100644
2525
/* Skip insignificant white space ("WS" in the spec) */
2626
if (type_row->pattern[index_pattern] == ' ') {
2727
--
28-
2.45.3
28+
2.45.4
2929

SPECS/libsoup/CVE-2025-32053.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Upstream patch reference: https://gitlab.gnome.org/GNOME/libsoup/-/commit/eaed42
1010
1 file changed, 2 insertions(+), 2 deletions(-)
1111

1212
diff --git a/libsoup/content-sniffer/soup-content-sniffer.c b/libsoup/content-sniffer/soup-content-sniffer.c
13-
index b62e4888..5a181ff1 100644
13+
index 3c072c1..55e5754 100644
1414
--- a/libsoup/content-sniffer/soup-content-sniffer.c
1515
+++ b/libsoup/content-sniffer/soup-content-sniffer.c
16-
@@ -641,7 +641,7 @@ skip_insignificant_space (const char *resource, int *pos, int resource_length)
16+
@@ -641,7 +641,7 @@ skip_insignificant_space (const char *resource, gsize *pos, gsize resource_lengt
1717
(resource[*pos] == '\x0D')) {
1818
*pos = *pos + 1;
1919

@@ -22,7 +22,7 @@ index b62e4888..5a181ff1 100644
2222
return TRUE;
2323
}
2424

25-
@@ -704,7 +704,7 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, GBytes *buffer)
25+
@@ -701,7 +701,7 @@ sniff_feed_or_html (SoupContentSniffer *sniffer, GBytes *buffer)
2626
do {
2727
pos++;
2828

@@ -32,5 +32,5 @@ index b62e4888..5a181ff1 100644
3232
} while (resource[pos] != '>');
3333

3434
--
35-
GitLab
35+
2.45.4
3636

SPECS/libsoup/CVE-2025-32907.patch

Lines changed: 35 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ Closes #428
1010

1111
Part-of: <https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/452>
1212
Upstream Patch Reference: https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/452/diffs?commit_id=9bb92f7a685e31e10e9e8221d0342280432ce836
13+
https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/452/diffs?commit_id=eeace39ec686094ff6a05a43e5fce06e9c37f376
1314
---
1415
libsoup/soup-message-headers.c | 1 +
16+
meson.build | 4 +
1517
tests/meson.build | 1 +
16-
tests/server-mem-limit-test.c | 144 +++++++++++++++++++++++++++++++++
17-
3 files changed, 146 insertions(+)
18+
tests/server-mem-limit-test.c | 149 +++++++++++++++++++++++++++++++++
19+
4 files changed, 155 insertions(+)
1820
create mode 100644 tests/server-mem-limit-test.c
1921

2022
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
@@ -29,8 +31,23 @@ index c5168ea..9123dc1 100644
2931
}
3032
}
3133
}
34+
diff --git a/meson.build b/meson.build
35+
index ff5dc95..5ed4125 100644
36+
--- a/meson.build
37+
+++ b/meson.build
38+
@@ -389,6 +389,10 @@ configinc = include_directories('.')
39+
40+
prefix = get_option('prefix')
41+
42+
+if get_option('b_sanitize') != 'none'
43+
+ cdata.set_quoted('B_SANITIZE_OPTION', get_option('b_sanitize'))
44+
+endif
45+
+
46+
cdata.set_quoted('PACKAGE_VERSION', soup_version)
47+
cdata.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
48+
cdata.set_quoted('GETTEXT_PACKAGE', libsoup_api_name)
3249
diff --git a/tests/meson.build b/tests/meson.build
33-
index ff94a4f..d78df11 100644
50+
index 946395d..bf85f2b 100644
3451
--- a/tests/meson.build
3552
+++ b/tests/meson.build
3653
@@ -89,6 +89,7 @@ tests = [
@@ -39,14 +56,14 @@ index ff94a4f..d78df11 100644
3956
{'name': 'server-auth'},
4057
+ {'name': 'server-mem-limit'},
4158
{'name': 'server'},
42-
{'name': 'sniffing'},
4359
{'name': 'sniffing',
60+
'depends': [test_resources],
4461
diff --git a/tests/server-mem-limit-test.c b/tests/server-mem-limit-test.c
4562
new file mode 100644
46-
index 0000000..98f1c40
63+
index 0000000..65dc875
4764
--- /dev/null
4865
+++ b/tests/server-mem-limit-test.c
49-
@@ -0,0 +1,144 @@
66+
@@ -0,0 +1,149 @@
5067
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
5168
+/*
5269
+ * Copyright (C) 2025 Red Hat <www.redhat.com>
@@ -145,9 +162,9 @@ index 0000000..98f1c40
145162
+ return;
146163
+ #endif
147164
+
148-
+ range = g_string_sized_new (99 * 1024);
165+
+ range = g_string_sized_new (60 * 1024);
149166
+ g_string_append (range, "bytes=1024");
150-
+ while (range->len < 99 * 1024)
167+
+ while (range->len < 60 * 1024)
151168
+ g_string_append (range, chunk);
152169
+
153170
+ session = soup_test_session_new (NULL);
@@ -175,14 +192,19 @@ index 0000000..98f1c40
175192
+{
176193
+ int ret;
177194
+
178-
+ test_init (argc, argv, NULL);
179-
+
180-
+ #ifndef G_OS_WIN32
181-
+ struct rlimit new_rlimit = { 1024 * 1024 * 64, 1024 * 1024 * 64 };
195+
+ /* a build with an address sanitizer may crash on mmap() with the limit,
196+
+ thus skip the limit set in such case, even it may not necessarily
197+
+ trigger the bug if it regresses */
198+
+ #if !defined(G_OS_WIN32) && !defined(B_SANITIZE_OPTION)
199+
+ struct rlimit new_rlimit = { 1024UL * 1024UL * 1024UL * 2UL, 1024UL * 1024UL * 1024UL * 2UL };
182200
+ /* limit memory usage, to trigger too large memory allocation abort */
183201
+ g_assert_cmpint (setrlimit (RLIMIT_DATA, &new_rlimit), ==, 0);
202+
+ #else
203+
+ g_message ("server-mem-limit-test: Running without memory limit");
184204
+ #endif
185205
+
206+
+ test_init (argc, argv, NULL);
207+
+
186208
+ g_test_add ("/server-mem/range-overlaps", ServerData, NULL,
187209
+ server_setup, do_ranges_overlaps_test, server_teardown);
188210
+
@@ -192,70 +214,5 @@ index 0000000..98f1c40
192214
+ return ret;
193215
+}
194216
--
195-
2.34.1
196-
197-
198-
From abedf4259b478b2ad5c33af36fb163b5ace821c0 Mon Sep 17 00:00:00 2001
199-
From: Kevin Lockwood <v-klockwood@microsoft.com>
200-
Date: Fri, 13 Jun 2025 09:57:54 -0700
201-
Subject: [PATCH 2/2] server-mem-limit-test: Limit memory usage only when not
202-
built witha sanitizer
203-
204-
A build with -Db_sanitize=address crashes with failed mmap(), which is done
205-
inside libasan. The test requires 20.0TB of virtual memory when running with
206-
the sanitizer, which is beyond unsigned integer limits and may not trigger
207-
the bug anyway.
208-
209-
Part-of: <https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/452>
210-
Upstream Patch Reference: https://gitlab.gnome.org/GNOME/libsoup/-/merge_requests/452/diffs?commit_id=eeace39ec686094ff6a05a43e5fce06e9c37f376
211-
---
212-
meson.build | 4 ++++
213-
tests/server-mem-limit-test.c | 13 +++++++++----
214-
2 files changed, 13 insertions(+), 4 deletions(-)
215-
216-
diff --git a/meson.build b/meson.build
217-
index ff5dc95..5ed4125 100644
218-
--- a/meson.build
219-
+++ b/meson.build
220-
@@ -389,6 +389,10 @@ configinc = include_directories('.')
221-
222-
prefix = get_option('prefix')
223-
224-
+if get_option('b_sanitize') != 'none'
225-
+ cdata.set_quoted('B_SANITIZE_OPTION', get_option('b_sanitize'))
226-
+endif
227-
+
228-
cdata.set_quoted('PACKAGE_VERSION', soup_version)
229-
cdata.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
230-
cdata.set_quoted('GETTEXT_PACKAGE', libsoup_api_name)
231-
diff --git a/tests/server-mem-limit-test.c b/tests/server-mem-limit-test.c
232-
index 98f1c40..65dc875 100644
233-
--- a/tests/server-mem-limit-test.c
234-
+++ b/tests/server-mem-limit-test.c
235-
@@ -126,14 +126,19 @@ main (int argc, char **argv)
236-
{
237-
int ret;
238-
239-
- test_init (argc, argv, NULL);
240-
-
241-
- #ifndef G_OS_WIN32
242-
- struct rlimit new_rlimit = { 1024 * 1024 * 64, 1024 * 1024 * 64 };
243-
+ /* a build with an address sanitizer may crash on mmap() with the limit,
244-
+ thus skip the limit set in such case, even it may not necessarily
245-
+ trigger the bug if it regresses */
246-
+ #if !defined(G_OS_WIN32) && !defined(B_SANITIZE_OPTION)
247-
+ struct rlimit new_rlimit = { 1024UL * 1024UL * 1024UL * 2UL, 1024UL * 1024UL * 1024UL * 2UL };
248-
/* limit memory usage, to trigger too large memory allocation abort */
249-
g_assert_cmpint (setrlimit (RLIMIT_DATA, &new_rlimit), ==, 0);
250-
+ #else
251-
+ g_message ("server-mem-limit-test: Running without memory limit");
252-
#endif
253-
254-
+ test_init (argc, argv, NULL);
255-
+
256-
g_test_add ("/server-mem/range-overlaps", ServerData, NULL,
257-
server_setup, do_ranges_overlaps_test, server_teardown);
258-
259-
--
260-
2.34.1
217+
2.45.4
261218

SPECS/libsoup/CVE-2025-32909.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Link: https://gitlab.gnome.org/GNOME/libsoup/-/commit/ba4c3a6f988beff59e45801ab3
1010
1 file changed, 6 insertions(+), 1 deletion(-)
1111

1212
diff --git a/libsoup/content-sniffer/soup-content-sniffer.c b/libsoup/content-sniffer/soup-content-sniffer.c
13-
index 5a181ff1..aeee2e25 100644
13+
index 55e5754..3d0e831 100644
1414
--- a/libsoup/content-sniffer/soup-content-sniffer.c
1515
+++ b/libsoup/content-sniffer/soup-content-sniffer.c
16-
@@ -243,9 +243,14 @@ sniff_mp4 (SoupContentSniffer *sniffer, GBytes *buffer)
16+
@@ -240,9 +240,14 @@ sniff_mp4 (SoupContentSniffer *sniffer, GBytes *buffer)
1717
gsize resource_length;
1818
const char *resource = g_bytes_get_data (buffer, &resource_length);
1919
resource_length = MIN (512, resource_length);
@@ -30,5 +30,5 @@ index 5a181ff1..aeee2e25 100644
3030
box_size = ((box_size >> 24) |
3131
((box_size << 8) & 0x00FF0000) |
3232
--
33-
GitLab
33+
2.45.4
3434

SPECS/libsoup/CVE-2025-4476.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Fixes #440
1616
1 file changed, 1 insertion(+), 1 deletion(-)
1717

1818
diff --git a/libsoup/auth/soup-auth-digest.c b/libsoup/auth/soup-auth-digest.c
19-
index d8bb2910..292f2045 100644
19+
index 1742903..d3a0ab3 100644
2020
--- a/libsoup/auth/soup-auth-digest.c
2121
+++ b/libsoup/auth/soup-auth-digest.c
22-
@@ -220,7 +220,7 @@ soup_auth_digest_get_protection_space (SoupAuth *auth, GUri *source_uri)
22+
@@ -235,7 +235,7 @@ soup_auth_digest_get_protection_space (SoupAuth *auth, GUri *source_uri)
2323
if (uri &&
2424
g_strcmp0 (g_uri_get_scheme (uri), g_uri_get_scheme (source_uri)) == 0 &&
2525
g_uri_get_port (uri) == g_uri_get_port (source_uri) &&
@@ -29,5 +29,5 @@ index d8bb2910..292f2045 100644
2929
else
3030
dir = NULL;
3131
--
32-
GitLab
32+
2.45.4
3333

SPECS/libsoup/CVE-2025-46420.patch

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ https://gitlab.gnome.org/GNOME/libsoup/-/commit/c9083869ec2a3037e6df4bd86b45c419
1212
1 file changed, 5 insertions(+), 6 deletions(-)
1313

1414
diff --git a/libsoup/soup-headers.c b/libsoup/soup-headers.c
15-
index 4468415..d28ddff 100644
15+
index 40df826..99ff5e9 100644
1616
--- a/libsoup/soup-headers.c
1717
+++ b/libsoup/soup-headers.c
18-
@@ -530,7 +530,7 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
18+
@@ -538,7 +538,7 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
1919
GSList *unsorted;
2020
QualityItem *array;
2121
GSList *sorted, *iter;
@@ -24,7 +24,7 @@ index 4468415..d28ddff 100644
2424
const char *param, *equal, *value;
2525
double qval;
2626
int n;
27-
@@ -543,9 +543,8 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
27+
@@ -551,9 +551,8 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
2828
unsorted = soup_header_parse_list (header);
2929
array = g_new0 (QualityItem, g_slist_length (unsorted));
3030
for (iter = unsorted, n = 0; iter; iter = iter->next) {
@@ -35,7 +35,7 @@ index 4468415..d28ddff 100644
3535
param = skip_lws (semi + 1);
3636
if (*param != 'q')
3737
continue;
38-
@@ -577,15 +576,15 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
38+
@@ -585,15 +584,15 @@ soup_header_parse_quality_list (const char *header, GSList **unacceptable)
3939
if (qval == 0.0) {
4040
if (unacceptable) {
4141
*unacceptable = g_slist_prepend (*unacceptable,
@@ -55,5 +55,5 @@ index 4468415..d28ddff 100644
5555
qsort (array, n, sizeof (QualityItem), sort_by_qval);
5656
sorted = NULL;
5757
--
58-
2.45.3
58+
2.45.4
5959

0 commit comments

Comments
 (0)