diff options
author | Archana Polampalli <archana.polampalli@windriver.com> | 2025-07-14 17:48:49 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-07-18 08:32:26 -0700 |
commit | de4b007ac0b3d3680e101f80f978e1040d51def3 (patch) | |
tree | 6132ea2f046fc32f2dd997cd5d9ab6dde9b248b3 | |
parent | 86182e972c5e7308a0f01ba1c3059f792e993d61 (diff) | |
download | poky-de4b007ac0b3d3680e101f80f978e1040d51def3.tar.gz |
gdk-pixbuf: fix CVE-2025-7345
A flaw exists in gdk‑pixbuf within the gdk_pixbuf__jpeg_image_load_increment function
(io-jpeg.c) and in glib’s g_base64_encode_step (glib/gbase64.c). When processing
maliciously crafted JPEG images, a heap buffer overflow can occur during Base64 encoding,
allowing out-of-bounds reads from heap memory, potentially causing application crashes or
arbitrary code execution.
(From OE-Core rev: 1803f965e4990be3fbdcd52544f0080e9c83800d)
Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch | 55 | ||||
-rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb | 1 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch new file mode 100644 index 0000000000..a8f23d3501 --- /dev/null +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2025-7345.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 4af78023ce7d3b5e3cec422a59bb4f48fa4f5886 Mon Sep 17 00:00:00 2001 | ||
2 | From: Matthias Clasen <mclasen@redhat.com> | ||
3 | Date: Fri, 11 Jul 2025 11:02:05 -0400 | ||
4 | Subject: [PATCH] jpeg: Be more careful with chunked icc data | ||
5 | |||
6 | We we inadvertendly trusting the sequence numbers not to lie. | ||
7 | If they do we would report a larger data size than we actually | ||
8 | allocated, leading to out of bounds memory access in base64 | ||
9 | encoding later on. | ||
10 | |||
11 | This has been assigned CVE-2025-7345. | ||
12 | |||
13 | Fixes: #249 | ||
14 | |||
15 | CVE: CVE-2025-7345 | ||
16 | |||
17 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/4af78023ce7d3b5e3cec422a59bb4f48fa4f5886] | ||
18 | |||
19 | Signed-off-by: Archana Polampalli <archana.polampalli@windriver.com> | ||
20 | --- | ||
21 | gdk-pixbuf/io-jpeg.c | 8 ++++++-- | ||
22 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c | ||
25 | index 3841fc0..9ee1d21 100644 | ||
26 | --- a/gdk-pixbuf/io-jpeg.c | ||
27 | +++ b/gdk-pixbuf/io-jpeg.c | ||
28 | @@ -356,6 +356,7 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma | ||
29 | context->icc_profile = g_new (gchar, chunk_size); | ||
30 | /* copy the segment data to the profile space */ | ||
31 | memcpy (context->icc_profile, marker->data + 14, chunk_size); | ||
32 | + ret = TRUE; | ||
33 | goto out; | ||
34 | } | ||
35 | |||
36 | @@ -377,12 +378,15 @@ jpeg_parse_exif_app2_segment (JpegExifContext *context, jpeg_saved_marker_ptr ma | ||
37 | /* copy the segment data to the profile space */ | ||
38 | memcpy (context->icc_profile + offset, marker->data + 14, chunk_size); | ||
39 | |||
40 | - /* it's now this big plus the new data we've just copied */ | ||
41 | - context->icc_profile_size += chunk_size; | ||
42 | + context->icc_profile_size = MAX (context->icc_profile_size, offset + chunk_size); | ||
43 | |||
44 | /* success */ | ||
45 | ret = TRUE; | ||
46 | out: | ||
47 | + if (!ret) { | ||
48 | + g_free (context->icc_profile); | ||
49 | + context->icc_profile = NULL; | ||
50 | + } | ||
51 | return ret; | ||
52 | } | ||
53 | |||
54 | -- | ||
55 | 2.40.0 | ||
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb index cca89a9059..471d72d8dd 100644 --- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb | |||
@@ -20,6 +20,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \ | |||
20 | file://run-ptest \ | 20 | file://run-ptest \ |
21 | file://fatal-loader.patch \ | 21 | file://fatal-loader.patch \ |
22 | file://0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch \ | 22 | file://0001-meson.build-allow-a-subset-of-tests-in-cross-compile.patch \ |
23 | file://CVE-2025-7345.patch \ | ||
23 | " | 24 | " |
24 | 25 | ||
25 | SRC_URI[sha256sum] = "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b" | 26 | SRC_URI[sha256sum] = "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b" |