Skip to contentSkip to conversation

gimp: upgrade 2.10.36 -> 2.10.38

PATCH New [email protected] 1 participant 6 messages Jan 12

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 gimp: upgrade 2.10.36 -> 2.10.38

From: Ankur Tyagi <[email protected]>

Feature backport for Windows otherwise it is mostly a bug-fix release
https://gitlab.gnome.org/GNOME/gimp/-/blob/GIMP_2_10_38/NEWS

---
 .../recipes-gimp/gimp/{gimp_2.10.36.bb => gimp_2.10.38.bb}      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-gnome/recipes-gimp/gimp/{gimp_2.10.36.bb => gimp_2.10.38.bb} (95%)
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb renamed from meta-gnome/recipes-gimp/gimp/gimp_2.10.36.bb +1 -1
similarity index 95%
rename from meta-gnome/recipes-gimp/gimp/gimp_2.10.36.bb
rename to meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb
index 4526839ad6..34b5b89180 100644
@@ -47,7 +47,7 @@ SHPV = "${@gnome_verdir("${PV}")}"
 SRC_URI = "https://download.gimp.org/pub/${BPN}/v${SHPV}/${BP}.tar.bz2 \
            file://0001-configure-Keep-first-line-of-compiler-version-string.patch \
            file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch"
-SRC_URI[sha256sum] = "3d3bc3c69a4bdb3aea9ba2d5385ed98ea03953f3857aafd1d6976011ed7cdbb2"
+SRC_URI[sha256sum] = "50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e"
 
 EXTRA_OECONF = "--disable-python \
                 --without-webkit \
#1 lore raw

PATCH 2/6 gimp: ignore CVE-2007-3741

From: Peter Marko <[email protected]>

NVD still tracks this CVE as version-less, so explicit ignore is needed.

---
 meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb +2 -0
index 34b5b89180..32b51dcdb5 100644
@@ -70,3 +70,5 @@ do_compile:prepend() {
 FILES:${PN}  += "${datadir}/metainfo"
 
 RDEPENDS:${PN} += "mypaint-brushes-1.0"
+
+CVE_STATUS[CVE-2007-3741] = "not-applicable-platform: This only applies for Mandriva Linux"
#2 lore raw

PATCH 3/6 gimp: patch CVE-2025-14422

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-14422

---
 .../gimp/gimp/CVE-2025-14422.patch            | 64 +++++++++++++++++++
 meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb  |  4 +-
 2 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch
meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14422.patch new file +64 -0
new file mode 100644
index 0000000000..acaf5f199b
@@ -0,0 +1,64 @@
+From bea9e174a3c4c02338f6c64bab05e6a8c667c09f Mon Sep 17 00:00:00 2001
+From: Alx Sa <[email protected]>
+Date: Sun, 23 Nov 2025 16:43:51 +0000
+Subject: [PATCH] plug-ins: Fix ZDI-CAN-28273
+
+Resolves #15286
+Adds a check to the memory allocation
+in pnm_load_raw () with g_size_checked_mul ()
+to see if the size would go out of bounds.
+If so, we don't try to allocate and load the
+image.
+
+CVE: CVE-2025-14422
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/4ff2d773d58064e6130495de498e440f4a6d5edb]
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ plug-ins/common/file-pnm.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/plug-ins/common/file-pnm.c b/plug-ins/common/file-pnm.c
+index 2132eeccf4..f514c2b1d7 100644
+--- a/plug-ins/common/file-pnm.c
++++ b/plug-ins/common/file-pnm.c
+@@ -554,7 +554,7 @@ load_image (GFile   *file,
+             GError **error)
+ {
+   GInputStream    *input;
+-  GeglBuffer      *buffer;
++  GeglBuffer      *buffer = NULL;
+   gint32 volatile  image_ID = -1;
+   gint32           layer_ID;
+   char             buf[BUFLEN + 4];  /* buffer for random things like scanning */
+@@ -584,6 +584,9 @@ load_image (GFile   *file,
+       g_object_unref (input);
+       g_free (pnminfo);
+ 
++      if (buffer)
++        g_object_unref (buffer);
++
+       if (image_ID != -1)
+         gimp_image_delete (image_ID);
+ 
+@@ -819,6 +822,7 @@ pnm_load_raw (PNMScanner *scan,
+   GInputStream *input;
+   gint          bpc;
+   guchar       *data, *d;
++  gsize         data_size;
+   gushort      *s;
+   gint          x, y, i;
+   gint          start, end, scanlines;
+@@ -829,7 +833,12 @@ pnm_load_raw (PNMScanner *scan,
+     bpc = 1;
+ 
+   /* No overflow as long as gimp_tile_height() < 1365 = 2^(31 - 18) / 6 */
+-  data = g_new (guchar, gimp_tile_height () * info->xres * info->np * bpc);
++  if (! g_size_checked_mul (&data_size, gimp_tile_height (), info->xres) ||
++      ! g_size_checked_mul (&data_size, data_size, info->np)             ||
++      ! g_size_checked_mul (&data_size, data_size, bpc))
++    CHECK_FOR_ERROR (FALSE, info->jmpbuf, _("Unsupported maximum value."));
++
++  data = g_new (guchar, data_size);
+ 
+   input = pnmscanner_input (scan);
+ 
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb +3 -1
index 32b51dcdb5..096f40f79d 100644
@@ -46,7 +46,9 @@ SHPV = "${@gnome_verdir("${PV}")}"
 
 SRC_URI = "https://download.gimp.org/pub/${BPN}/v${SHPV}/${BP}.tar.bz2 \
            file://0001-configure-Keep-first-line-of-compiler-version-string.patch \
-           file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch"
+           file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch \
+           file://CVE-2025-14422.patch \
+"
 SRC_URI[sha256sum] = "50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e"
 
 EXTRA_OECONF = "--disable-python \
#3 lore raw

PATCH 4/6 gimp: patch CVE-2025-14425

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-14425

Patch referenced by the nvd report is for the file "file-jp2.c" which was renamed from "file-jp2-load.c" by commit[1] in the later versions.
[1] https://gitlab.gnome.org/GNOME/gimp/-/commit/19c57a9765ac3451c9cde94ccb06bec5ae06fbd8

---
 .../gimp/gimp/CVE-2025-14425.patch            | 70 +++++++++++++++++++
 meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb  |  1 +
 2 files changed, 71 insertions(+)
 create mode 100644 meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14425.patch
meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-14425.patch new file +70 -0
new file mode 100644
index 0000000000..459516ec9e
@@ -0,0 +1,70 @@
+From 012406d60ca09239403ce989cf9e793b82e47e74 Mon Sep 17 00:00:00 2001
+From: Alx Sa <[email protected]>
+Date: Wed, 12 Nov 2025 13:25:44 +0000
+Subject: [PATCH] plug-ins: Mitigate ZDI-CAN-28248 for JP2 images
+
+Resolves #15285
+Per the report, it's possible to exceed the size of the pixel buffer
+with a high precision_scaled value, as we size it to the width * bpp.
+This patch includes precision_scaled in the allocation calculation.
+It also adds a g_size_checked_mul () check to ensure there's no
+overflow, and moves the pixel and buffer memory freeing to occur
+in the out section so that it always runs even on failure.
+
+CVE: CVE-2025-14425
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/cd1c88a0364ad1444c06536731972a99bd8643fd]
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ plug-ins/common/file-jp2-load.c | 21 +++++++++++++++------
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/plug-ins/common/file-jp2-load.c b/plug-ins/common/file-jp2-load.c
+index 9ab43b5349..d29278a4d2 100644
+--- a/plug-ins/common/file-jp2-load.c
++++ b/plug-ins/common/file-jp2-load.c
+@@ -1055,9 +1055,10 @@ load_image (const gchar       *filename,
+   gint               width;
+   gint               height;
+   gint               num_components;
+-  GeglBuffer        *buffer;
++  GeglBuffer        *buffer = NULL;
+   gint               i, j, k, it;
+-  guchar            *pixels;
++  guchar            *pixels = NULL;
++  gsize              pixels_size;
+   const Babl        *file_format;
+   gint               bpp;
+   GimpPrecision      image_precision;
+@@ -1298,7 +1299,14 @@ load_image (const gchar       *filename,
+   bpp = babl_format_get_bytes_per_pixel (file_format);
+ 
+   buffer = gimp_drawable_get_buffer (layer_ID);
+-  pixels = g_new0 (guchar, width * bpp);
++  if (! g_size_checked_mul (&pixels_size, width, (bpp * (precision_scaled / 8))))
++    {
++      g_set_error (error, GIMP_PLUG_IN_ERROR, 0,
++                   _("Defined row size is too large in JP2 image '%s'."),
++                   gimp_file_get_utf8_name (filename));
++      goto out;
++    }
++  pixels = g_new0 (guchar, pixels_size);
+ 
+   for (i = 0; i < height; i++)
+     {
+@@ -1325,12 +1333,13 @@ load_image (const gchar       *filename,
+                          file_format, pixels, GEGL_AUTO_ROWSTRIDE);
+     }
+ 
+-  g_free (pixels);
+-
+-  g_object_unref (buffer);
+   gimp_progress_update (1.0);
+ 
+  out:
++  if (pixels)
++    g_free (pixels);
++  if (buffer)
++    g_object_unref (buffer);
+   if (profile)
+     g_object_unref (profile);
+   if (image)
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb +1 -0
index 096f40f79d..68daac776d 100644
@@ -48,6 +48,7 @@ SRC_URI = "https://download.gimp.org/pub/${BPN}/v${SHPV}/${BP}.tar.bz2 \
            file://0001-configure-Keep-first-line-of-compiler-version-string.patch \
            file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch \
            file://CVE-2025-14422.patch \
+           file://CVE-2025-14425.patch \
 "
 SRC_URI[sha256sum] = "50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e"
 
#4 lore raw

PATCH 5/6 gimp: ignore CVE-2025-48796

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Details: https://nvd.nist.gov/vuln/detail/CVE-2025-48796

The vulnerable function ani_load_image() was added[1] after the current version of GIMP[2], we can ignore the CVE.

[1] https://gitlab.gnome.org/GNOME/gimp/-/commit/aa51b9e19ece8a8c54a513fe33b6d65abcb0fbfb
[2] https://gitlab.gnome.org/GNOME/gimp/-/commits/GIMP_2_10_38/plug-ins/file-ico/ico-load.c?ref_type=tags

---
 meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb | 1 +
 1 file changed, 1 insertion(+)
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb +1 -0
index 68daac776d..064a797986 100644
@@ -75,3 +75,4 @@ FILES:${PN}  += "${datadir}/metainfo"
 RDEPENDS:${PN} += "mypaint-brushes-1.0"
 
 CVE_STATUS[CVE-2007-3741] = "not-applicable-platform: This only applies for Mandriva Linux"
+CVE_STATUS[CVE-2025-48796] = "cpe-incorrect: The current version (2.10.38) is not affected."
\ No newline at end of file
#5 lore raw

PATCH 6/6 gimp: patch CVE-2025-5473

In reply to [email protected]

From: Ankur Tyagi <[email protected]>

Detail: https://nvd.nist.gov/vuln/detail/CVE-2025-5473

Backport commit associated with the resolution of issue[1].

[1] https://gitlab.gnome.org/GNOME/gimp/-/issues/13910

---
 .../gimp/gimp/CVE-2025-5473.patch             | 38 +++++++++++++++++++
 meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb  |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-5473.patch
meta-gnome/recipes-gimp/gimp/gimp/CVE-2025-5473.patch new file +38 -0
new file mode 100644
index 0000000000..ef2eb48d61
@@ -0,0 +1,38 @@
+From 9e4ebb38ba85661ee62361f218d6c35ace502395 Mon Sep 17 00:00:00 2001
+From: Alx Sa <[email protected]>
+Date: Sat, 3 May 2025 14:13:46 +0000
+Subject: [PATCH] plug-ins: ZDI-CAN-26752 mitigation
+
+Resolves #13910
+Since ICO can store PNGs, it's possible to create an
+icon that's much larger than the stated image size and
+cause a buffer overflow.
+This patch adds a check to make sure the width * height * 4
+calculation does not overflow in addition to making sure it
+doesn't exceed the maximum allowed size for that icon.
+
+CVE: CVE-2025-5473
+Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/c855d1df60ebaf5ef8d02807d448eb088f147a2b]
+(cherry picked from commit c855d1df60ebaf5ef8d02807d448eb088f147a2b)
+Signed-off-by: Ankur Tyagi <[email protected]>
+---
+ plug-ins/file-ico/ico-load.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/plug-ins/file-ico/ico-load.c b/plug-ins/file-ico/ico-load.c
+index f44b805905..c144b6e2cd 100644
+--- a/plug-ins/file-ico/ico-load.c
++++ b/plug-ins/file-ico/ico-load.c
+@@ -295,7 +295,11 @@ ico_read_png (FILE    *fp,
+   png_read_info (png_ptr, info);
+   png_get_IHDR (png_ptr, info, &w, &h, &bit_depth, &color_type,
+                 NULL, NULL, NULL);
+-  if (w*h*4 > maxsize)
++  /* Check for overflow */
++  if ((w * h * 4) < w       ||
++      (w * h * 4) < h       ||
++      (w * h * 4) < (w * h) ||
++      (w * h * 4) > maxsize)
+     {
+       png_destroy_read_struct (&png_ptr, &info, NULL);
+       return FALSE;
meta-gnome/recipes-gimp/gimp/gimp_2.10.38.bb +1 -0
index 064a797986..36b0712976 100644
@@ -49,6 +49,7 @@ SRC_URI = "https://download.gimp.org/pub/${BPN}/v${SHPV}/${BP}.tar.bz2 \
            file://0001-libtool-Do-not-add-build-time-library-paths-to-LD_LI.patch \
            file://CVE-2025-14422.patch \
            file://CVE-2025-14425.patch \
+           file://CVE-2025-5473.patch \
 "
 SRC_URI[sha256sum] = "50a845eec11c8831fe8661707950f5b8446e35f30edfb9acf98f85c1133f856e"