summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/glib-networking/glib-networking/CVE-2025-60018.patch83
-rw-r--r--meta/recipes-core/glib-networking/glib-networking_2.72.2.bb1
2 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-networking/glib-networking/CVE-2025-60018.patch b/meta/recipes-core/glib-networking/glib-networking/CVE-2025-60018.patch
new file mode 100644
index 0000000000..4ccf1cd43b
--- /dev/null
+++ b/meta/recipes-core/glib-networking/glib-networking/CVE-2025-60018.patch
@@ -0,0 +1,83 @@
1From 4dd540505d40babe488404f3174ec39f49a84485 Mon Sep 17 00:00:00 2001
2From: Michael Catanzaro <mcatanzaro@redhat.com>
3Date: Mon, 4 Aug 2025 15:10:21 -0500
4Subject: [PATCH] openssl: properly check return value when writing to BIO
5 objects
6
7In particular, we will read out of bounds, and then write the invalid
8memory, if BIO_write() fails when getting the PROP_CERTIFICATE_PEM
9property. Here we attempt to check the return value, but the check is
10not correct.
11
12This also fixes a leak of the BIO in the same place.
13
14Also add error checking to PROP_SUBJECT_NAME and PROP_ISSUER_NAME, for
15good measure.
16
17Fixes #226
18
19CVE: CVE-2025-60018
20
21Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib-networking/-/commit/4dd540505d40babe488404f3174ec39f49a84485]
22
23Signed-off-by: Rajeshkumar Ramasamy <rajeshkumar.ramasamy@windriver.com>
24---
25 tls/openssl/gtlscertificate-openssl.c | 25 +++++++++++++++----------
26 1 file changed, 15 insertions(+), 10 deletions(-)
27
28diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
29index 648f3e8..b536559 100644
30--- a/tls/openssl/gtlscertificate-openssl.c
31+++ b/tls/openssl/gtlscertificate-openssl.c
32@@ -362,15 +362,12 @@ g_tls_certificate_openssl_get_property (GObject *object,
33 case PROP_CERTIFICATE_PEM:
34 bio = BIO_new (BIO_s_mem ());
35
36- if (!PEM_write_bio_X509 (bio, openssl->cert) || !BIO_write (bio, "\0", 1))
37- certificate_pem = NULL;
38- else
39+ if (PEM_write_bio_X509 (bio, openssl->cert) == 1 && BIO_write (bio, "\0", 1) == 1)
40 {
41 BIO_get_mem_data (bio, &certificate_pem);
42 g_value_set_string (value, certificate_pem);
43-
44- BIO_free_all (bio);
45 }
46+ BIO_free_all (bio);
47 break;
48
49 case PROP_PRIVATE_KEY:
50@@ -411,8 +408,12 @@ g_tls_certificate_openssl_get_property (GObject *object,
51 case PROP_SUBJECT_NAME:
52 bio = BIO_new (BIO_s_mem ());
53 name = X509_get_subject_name (openssl->cert);
54- X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS);
55- BIO_write (bio, "\0", 1);
56+ if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
57+ BIO_write (bio, "\0", 1) != 1)
58+ {
59+ BIO_free_all (bio);
60+ break;
61+ }
62 BIO_get_mem_data (bio, (char **)&name_string);
63 g_value_set_string (value, name_string);
64 BIO_free_all (bio);
65@@ -421,9 +422,13 @@ g_tls_certificate_openssl_get_property (GObject *object,
66 case PROP_ISSUER_NAME:
67 bio = BIO_new (BIO_s_mem ());
68 name = X509_get_issuer_name (openssl->cert);
69- X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS);
70- BIO_write (bio, "\0", 1);
71- BIO_get_mem_data (bio, &name_string);
72+ if (X509_NAME_print_ex (bio, name, 0, XN_FLAG_SEP_COMMA_PLUS) < 0 ||
73+ BIO_write (bio, "\0", 1) != 1)
74+ {
75+ BIO_free_all (bio);
76+ break;
77+ }
78+ BIO_get_mem_data (bio, (char **)&name_string);
79 g_value_set_string (value, name_string);
80 BIO_free_all (bio);
81 break;
82--
832.48.1
diff --git a/meta/recipes-core/glib-networking/glib-networking_2.72.2.bb b/meta/recipes-core/glib-networking/glib-networking_2.72.2.bb
index 746d1bc39c..32d50135bb 100644
--- a/meta/recipes-core/glib-networking/glib-networking_2.72.2.bb
+++ b/meta/recipes-core/glib-networking/glib-networking_2.72.2.bb
@@ -24,6 +24,7 @@ GNOMEBASEBUILDCLASS = "meson"
24inherit gnomebase gettext upstream-version-is-even gio-module-cache ptest-gnome 24inherit gnomebase gettext upstream-version-is-even gio-module-cache ptest-gnome
25 25
26SRC_URI += "file://run-ptest" 26SRC_URI += "file://run-ptest"
27SRC_URI += "file://CVE-2025-60018.patch"
27 28
28FILES:${PN} += "\ 29FILES:${PN} += "\
29 ${libdir}/gio/modules/libgio*.so \ 30 ${libdir}/gio/modules/libgio*.so \