diff options
| -rw-r--r-- | meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch | 82 | ||||
| -rw-r--r-- | meta-oe/recipes-printing/cups/cups-filters_2.0.1.bb | 10 |
2 files changed, 87 insertions, 5 deletions
diff --git a/meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch b/meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch new file mode 100644 index 0000000000..b8338e333a --- /dev/null +++ b/meta-oe/recipes-printing/cups/cups-filters/CVE-2025-64524.patch | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | From 4230ceaec8a6751f724a0d556ce4650d52a83a02 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 3 | Date: Wed, 12 Nov 2025 15:47:24 +0100 | ||
| 4 | Subject: [PATCH] rastertopclx.c: Fix infinite loop caused by crafted file | ||
| 5 | |||
| 6 | From: Zdenek Dohnal <zdohnal@redhat.com> | ||
| 7 | |||
| 8 | Infinite loop happened because of crafted input raster file, which led | ||
| 9 | into heap buffer overflow of `CompressBuf` array. | ||
| 10 | |||
| 11 | Based on comments there should be always some `count` when compressing | ||
| 12 | the data, and processing of crafted file ended with offset and count | ||
| 13 | being 0. | ||
| 14 | |||
| 15 | Fixes CVE-2025-64524 | ||
| 16 | |||
| 17 | CVE: CVE-2025-64524 | ||
| 18 | Upstream-Status: Backport [https://github.com/OpenPrinting/cups-filters/commit/956283c74a34ae924266a2a63f8e5f529a1abd06] | ||
| 19 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
| 20 | --- | ||
| 21 | filter/rastertopclx.c | 25 +++++++++++++++++++++++-- | ||
| 22 | 1 file changed, 23 insertions(+), 2 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/filter/rastertopclx.c b/filter/rastertopclx.c | ||
| 25 | index ded86f1..39cb378 100644 | ||
| 26 | --- a/filter/rastertopclx.c | ||
| 27 | +++ b/filter/rastertopclx.c | ||
| 28 | @@ -825,10 +825,10 @@ StartPage(cf_filter_data_t *data, // I - filter data | ||
| 29 | } | ||
| 30 | |||
| 31 | if (header->cupsCompression) | ||
| 32 | - CompBuffer = malloc(DotBufferSize * 4); | ||
| 33 | + CompBuffer = calloc(DotBufferSize * 4, sizeof(unsigned char)); | ||
| 34 | |||
| 35 | if (header->cupsCompression >= 3) | ||
| 36 | - SeedBuffer = malloc(DotBufferSize); | ||
| 37 | + SeedBuffer = calloc(DotBufferSize, sizeof(unsigned char)); | ||
| 38 | |||
| 39 | SeedInvalid = 1; | ||
| 40 | |||
| 41 | @@ -1159,6 +1159,13 @@ CompressData(unsigned char *line, // I - Data to compress | ||
| 42 | seed ++; | ||
| 43 | count ++; | ||
| 44 | } | ||
| 45 | + | ||
| 46 | + // | ||
| 47 | + // Bail out if we don't have count to compress | ||
| 48 | + // | ||
| 49 | + | ||
| 50 | + if (count == 0) | ||
| 51 | + break; | ||
| 52 | } | ||
| 53 | |||
| 54 | // | ||
| 55 | @@ -1252,6 +1259,13 @@ CompressData(unsigned char *line, // I - Data to compress | ||
| 56 | |||
| 57 | count = line_ptr - start; | ||
| 58 | |||
| 59 | + // | ||
| 60 | + // Bail out if we don't have count to compress | ||
| 61 | + // | ||
| 62 | + | ||
| 63 | + if (count == 0) | ||
| 64 | + break; | ||
| 65 | + | ||
| 66 | #if 0 | ||
| 67 | fprintf(stderr, | ||
| 68 | "DEBUG: offset=%d, count=%d, comp_ptr=%p(%d of %d)...\n", | ||
| 69 | @@ -1424,6 +1438,13 @@ CompressData(unsigned char *line, // I - Data to compress | ||
| 70 | |||
| 71 | count = (line_ptr - start) / 3; | ||
| 72 | |||
| 73 | + // | ||
| 74 | + // Bail out if we don't have count to compress | ||
| 75 | + // | ||
| 76 | + | ||
| 77 | + if (count == 0) | ||
| 78 | + break; | ||
| 79 | + | ||
| 80 | // | ||
| 81 | // Place mode 10 compression data in the buffer; each sequence | ||
| 82 | // starts with a command byte that looks like: | ||
diff --git a/meta-oe/recipes-printing/cups/cups-filters_2.0.1.bb b/meta-oe/recipes-printing/cups/cups-filters_2.0.1.bb index e488bd3039..a6eedda5d7 100644 --- a/meta-oe/recipes-printing/cups/cups-filters_2.0.1.bb +++ b/meta-oe/recipes-printing/cups/cups-filters_2.0.1.bb | |||
| @@ -5,11 +5,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=6d5b952b53dbe7752199903d082e5f07" | |||
| 5 | 5 | ||
| 6 | DEPENDS = "libcupsfilters libppd glib-2.0 poppler" | 6 | DEPENDS = "libcupsfilters libppd glib-2.0 poppler" |
| 7 | 7 | ||
| 8 | SRC_URI = " \ | 8 | SRC_URI = "https://github.com/OpenPrinting/${BPN}/releases/download/${PV}/${BP}.tar.xz \ |
| 9 | https://github.com/OpenPrinting/${BPN}/releases/download/${PV}/${BP}.tar.xz \ | 9 | file://fix-make-race.patch \ |
| 10 | file://fix-make-race.patch \ | 10 | file://0001-Fix-build-failure-with-GCC-15-and-std-c23.patch \ |
| 11 | file://0001-Fix-build-failure-with-GCC-15-and-std-c23.patch \ | 11 | file://CVE-2025-64524.patch \ |
| 12 | " | 12 | " |
| 13 | SRC_URI[sha256sum] = "39e71de3ce06762b342749f1dc7cba6817738f7bf4d322c1bb9ab10b8569ab80" | 13 | SRC_URI[sha256sum] = "39e71de3ce06762b342749f1dc7cba6817738f7bf4d322c1bb9ab10b8569ab80" |
| 14 | 14 | ||
| 15 | UPSTREAM_CHECK_URI = "https://github.com/OpenPrinting/cups-filters/releases" | 15 | UPSTREAM_CHECK_URI = "https://github.com/OpenPrinting/cups-filters/releases" |
