summaryrefslogtreecommitdiffstats
path: root/meta-gnome/recipes-gimp
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-12-29 15:52:53 +0100
committerKhem Raj <raj.khem@gmail.com>2025-12-31 08:28:49 -0800
commita0b41204afe57f9b2b3f2e8ff496be72d04e0eb7 (patch)
treebe6719fa4d8b4d1e31fe181f3cfbe6aae1595a11 /meta-gnome/recipes-gimp
parent9742869636a9bfa3981f25badce259ee0ff88d80 (diff)
downloadmeta-openembedded-a0b41204afe57f9b2b3f2e8ff496be72d04e0eb7.tar.gz
gimp: patch CVE-2025-14422
Details: https://nvd.nist.gov/vuln/detail/CVE-2025-14422 Pick the patch referenced by the NVD report. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-gnome/recipes-gimp')
-rw-r--r--meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch66
-rw-r--r--meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb12
2 files changed, 73 insertions, 5 deletions
diff --git a/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch b/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch
new file mode 100644
index 0000000000..420e013916
--- /dev/null
+++ b/meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch
@@ -0,0 +1,66 @@
1From 0a941cab81396d65a8ab547847f8c542039e214f Mon Sep 17 00:00:00 2001
2From: Gyorgy Sarvari <skandigraun@gmail.com>
3Date: Sun, 23 Nov 2025 16:43:51 +0000
4Subject: [PATCH] plug-ins: Fix ZDI-CAN-28273
5
6From: Alx Sa <cmyk.student@gmail.com>
7
8Resolves #15286
9Adds a check to the memory allocation
10in pnm_load_raw () with g_size_checked_mul ()
11to see if the size would go out of bounds.
12If so, we don't try to allocate and load the
13image.
14
15CVE: CVE-2025-14422
16Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/4ff2d773d58064e6130495de498e440f4a6d5edb]
17Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
18---
19 plug-ins/common/file-pnm.c | 13 +++++++++++--
20 1 file changed, 11 insertions(+), 2 deletions(-)
21
22diff --git a/plug-ins/common/file-pnm.c b/plug-ins/common/file-pnm.c
23index 32a33a4..9d349e9 100644
24--- a/plug-ins/common/file-pnm.c
25+++ b/plug-ins/common/file-pnm.c
26@@ -674,7 +674,7 @@ load_image (GFile *file,
27 GError **error)
28 {
29 GInputStream *input;
30- GeglBuffer *buffer;
31+ GeglBuffer *buffer = NULL;
32 GimpImage * volatile image = NULL;
33 GimpLayer *layer;
34 char buf[BUFLEN + 4]; /* buffer for random things like scanning */
35@@ -708,6 +708,9 @@ load_image (GFile *file,
36 g_object_unref (input);
37 g_free (pnminfo);
38
39+ if (buffer)
40+ g_object_unref (buffer);
41+
42 if (image)
43 gimp_image_delete (image);
44
45@@ -1060,6 +1063,7 @@ pnm_load_raw (PNMScanner *scan,
46 const Babl *format = NULL;
47 gint bpc;
48 guchar *data, *d;
49+ gsize data_size;
50 gushort *s;
51 gint x, y, i;
52 gint start, end, scanlines;
53@@ -1070,7 +1074,12 @@ pnm_load_raw (PNMScanner *scan,
54 bpc = 1;
55
56 /* No overflow as long as gimp_tile_height() < 1365 = 2^(31 - 18) / 6 */
57- data = g_new (guchar, gimp_tile_height () * info->xres * info->np * bpc);
58+ if (! g_size_checked_mul (&data_size, gimp_tile_height (), info->xres) ||
59+ ! g_size_checked_mul (&data_size, data_size, info->np) ||
60+ ! g_size_checked_mul (&data_size, data_size, bpc))
61+ CHECK_FOR_ERROR (FALSE, info->jmpbuf, _("Unsupported maximum value."));
62+
63+ data = g_new (guchar, data_size);
64
65 input = pnmscanner_input (scan);
66
diff --git a/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb b/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
index 9f38cdcd03..f529930dff 100644
--- a/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
+++ b/meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb
@@ -56,11 +56,13 @@ GIDOCGEN_MESON_OPTION = "gi-docgen"
56GIDOCGEN_MESON_ENABLE_FLAG = "enabled" 56GIDOCGEN_MESON_ENABLE_FLAG = "enabled"
57GIDOCGEN_MESON_DISABLE_FLAG = "disabled" 57GIDOCGEN_MESON_DISABLE_FLAG = "disabled"
58 58
59SRC_URI = "https://download.gimp.org/gimp/v3.0/${BP}.tar.xz" 59SRC_URI = "https://download.gimp.org/gimp/v3.0/${BP}.tar.xz \
60SRC_URI += "file://0001-gimp-cross-compile-fix-for-bz2.patch" 60 file://0001-gimp-cross-compile-fix-for-bz2.patch \
61SRC_URI += "file://0002-meson.build-reproducibility-fix.patch" 61 file://0002-meson.build-reproducibility-fix.patch \
62SRC_URI += "file://0001-meson.build-dont-check-for-lgi.patch" 62 file://0001-meson.build-dont-check-for-lgi.patch \
63SRC_URI += "file://0001-meson.build-require-iso-codes-native.patch" 63 file://0001-meson.build-require-iso-codes-native.patch \
64 file://CVE-2025-14422.patch \
65 "
64SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b" 66SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b"
65 67
66PACKAGECONFIG[aa] = "-Daa=enabled,-Daa=disabled,aalib" 68PACKAGECONFIG[aa] = "-Daa=enabled,-Daa=disabled,aalib"