diff options
| author | Archana Polampalli <archana.polampalli@windriver.com> | 2025-07-14 14:55:11 +0530 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-07-21 09:17:59 -0700 |
| commit | 76e0206da09bd9478c22db534b4b75f810b46fe0 (patch) | |
| tree | 60e4b9033ec4a151ec1e66207908610a9c23308e | |
| parent | 40c7590281942e0dfbc8087da28d5ecd3ce20aca (diff) | |
| download | poky-76e0206da09bd9478c22db534b4b75f810b46fe0.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: bb80f57bc3818937d5a207040bfd44021dee4e6e)
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.12.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.12.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.12.bb index 96487a284a..48f3c778c9 100644 --- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.12.bb +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.12.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] = "b9505b3445b9a7e48ced34760c3bcb73e966df3ac94c95a148cb669ab748e3c7" | 26 | SRC_URI[sha256sum] = "b9505b3445b9a7e48ced34760c3bcb73e966df3ac94c95a148cb669ab748e3c7" |
