summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2025-12-31 10:55:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2026-01-26 09:49:25 +0000
commitb06df1f496b016195039ab69d120e5a4f8de30c1 (patch)
treecf95041c0c36b186cb3ad6c4c1ea070e32525589 /meta/recipes-core
parent32417b8ef75d4a464d9da746fddc80561641333c (diff)
downloadpoky-b06df1f496b016195039ab69d120e5a4f8de30c1.tar.gz
glib-2.0: patch CVE-2025-14512
Pick patch from [1] linked from [2]. [1] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4935 [2] https://gitlab.gnome.org/GNOME/glib/-/issues/3845 (From OE-Core rev: 2fb84f36c77e0d049a71dcfa597a67d297cbfd0a) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-14512.patch70
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb1
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-14512.patch b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-14512.patch
new file mode 100644
index 0000000000..fd3ba765b1
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/CVE-2025-14512.patch
@@ -0,0 +1,70 @@
1From 1909d8ea9297287f1ff6862968608dcf06e60523 Mon Sep 17 00:00:00 2001
2From: Philip Withnall <pwithnall@gnome.org>
3Date: Thu, 4 Dec 2025 16:37:19 +0000
4Subject: [PATCH] gfileattribute: Fix integer overflow calculating escaping for
5 byte strings
6
7The number of invalid characters in the byte string (characters which
8would have to be percent-encoded) was only stored in an `int`, which
9gave the possibility of a long string largely full of invalid
10characters overflowing this and allowing an attacker-controlled buffer
11size to be allocated.
12
13This could be triggered by an attacker controlled file attribute (of
14type `G_FILE_ATTRIBUTE_TYPE_BYTE_STRING`), such as
15`G_FILE_ATTRIBUTE_THUMBNAIL_PATH` or `G_FILE_ATTRIBUTE_STANDARD_NAME`,
16being read by user code.
17
18Spotted by Codean Labs.
19
20Signed-off-by: Philip Withnall <pwithnall@gnome.org>
21
22Fixes: #3845
23
24CVE: CVE-2025-14512
25Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/glib/-/commit/1909d8ea9297287f1ff6862968608dcf06e60523]
26Signed-off-by: Peter Marko <peter.marko@siemens.com>
27---
28 gio/gfileattribute.c | 11 +++++++++--
29 1 file changed, 9 insertions(+), 2 deletions(-)
30
31diff --git a/gio/gfileattribute.c b/gio/gfileattribute.c
32index c6fde60fa..d3083e5bd 100644
33--- a/gio/gfileattribute.c
34+++ b/gio/gfileattribute.c
35@@ -20,6 +20,7 @@
36
37 #include "config.h"
38
39+#include <stdint.h>
40 #include <string.h>
41
42 #include "gfileattribute.h"
43@@ -271,11 +272,12 @@ valid_char (char c)
44 return c >= 32 && c <= 126 && c != '\\';
45 }
46
47+/* Returns NULL on error */
48 static char *
49 escape_byte_string (const char *str)
50 {
51 size_t i, len;
52- int num_invalid;
53+ size_t num_invalid;
54 char *escaped_val, *p;
55 unsigned char c;
56 const char hex_digits[] = "0123456789abcdef";
57@@ -293,7 +295,12 @@ escape_byte_string (const char *str)
58 return g_strdup (str);
59 else
60 {
61- escaped_val = g_malloc (len + num_invalid*3 + 1);
62+ /* Check for overflow. We want to check the inequality:
63+ * !(len + num_invalid * 3 + 1 > SIZE_MAX) */
64+ if (num_invalid >= (SIZE_MAX - len) / 3)
65+ return NULL;
66+
67+ escaped_val = g_malloc (len + num_invalid * 3 + 1);
68
69 p = escaped_val;
70 for (i = 0; i < len; i++)
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
index c5704a27bc..50701be3d0 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.72.3.bb
@@ -69,6 +69,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
69 file://CVE-2025-14087-01.patch \ 69 file://CVE-2025-14087-01.patch \
70 file://CVE-2025-14087-02.patch \ 70 file://CVE-2025-14087-02.patch \
71 file://CVE-2025-14087-03.patch \ 71 file://CVE-2025-14087-03.patch \
72 file://CVE-2025-14512.patch \
72 " 73 "
73SRC_URI:append:class-native = " file://relocate-modules.patch" 74SRC_URI:append:class-native = " file://relocate-modules.patch"
74 75