diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-12-29 15:52:53 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-12-31 08:28:49 -0800 |
| commit | a0b41204afe57f9b2b3f2e8ff496be72d04e0eb7 (patch) | |
| tree | be6719fa4d8b4d1e31fe181f3cfbe6aae1595a11 /meta-gnome/recipes-gimp | |
| parent | 9742869636a9bfa3981f25badce259ee0ff88d80 (diff) | |
| download | meta-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.patch | 66 | ||||
| -rw-r--r-- | meta-gnome/recipes-gimp/gimp/gimp_3.0.6.bb | 12 |
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 @@ | |||
| 1 | From 0a941cab81396d65a8ab547847f8c542039e214f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Sun, 23 Nov 2025 16:43:51 +0000 | ||
| 4 | Subject: [PATCH] plug-ins: Fix ZDI-CAN-28273 | ||
| 5 | |||
| 6 | From: Alx Sa <cmyk.student@gmail.com> | ||
| 7 | |||
| 8 | Resolves #15286 | ||
| 9 | Adds a check to the memory allocation | ||
| 10 | in pnm_load_raw () with g_size_checked_mul () | ||
| 11 | to see if the size would go out of bounds. | ||
| 12 | If so, we don't try to allocate and load the | ||
| 13 | image. | ||
| 14 | |||
| 15 | CVE: CVE-2025-14422 | ||
| 16 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gimp/-/commit/4ff2d773d58064e6130495de498e440f4a6d5edb] | ||
| 17 | Signed-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 | |||
| 22 | diff --git a/plug-ins/common/file-pnm.c b/plug-ins/common/file-pnm.c | ||
| 23 | index 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" | |||
| 56 | GIDOCGEN_MESON_ENABLE_FLAG = "enabled" | 56 | GIDOCGEN_MESON_ENABLE_FLAG = "enabled" |
| 57 | GIDOCGEN_MESON_DISABLE_FLAG = "disabled" | 57 | GIDOCGEN_MESON_DISABLE_FLAG = "disabled" |
| 58 | 58 | ||
| 59 | SRC_URI = "https://download.gimp.org/gimp/v3.0/${BP}.tar.xz" | 59 | SRC_URI = "https://download.gimp.org/gimp/v3.0/${BP}.tar.xz \ |
| 60 | SRC_URI += "file://0001-gimp-cross-compile-fix-for-bz2.patch" | 60 | file://0001-gimp-cross-compile-fix-for-bz2.patch \ |
| 61 | SRC_URI += "file://0002-meson.build-reproducibility-fix.patch" | 61 | file://0002-meson.build-reproducibility-fix.patch \ |
| 62 | SRC_URI += "file://0001-meson.build-dont-check-for-lgi.patch" | 62 | file://0001-meson.build-dont-check-for-lgi.patch \ |
| 63 | SRC_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 | " | ||
| 64 | SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b" | 66 | SRC_URI[sha256sum] = "246c225383c72ef9f0dc7703b7d707084bbf177bd2900e94ce466a62862e296b" |
| 65 | 67 | ||
| 66 | PACKAGECONFIG[aa] = "-Daa=enabled,-Daa=disabled,aalib" | 68 | PACKAGECONFIG[aa] = "-Daa=enabled,-Daa=disabled,aalib" |
