summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYogita Urade <yogita.urade@windriver.com>2025-01-09 12:25:27 +0000
committerArmin Kuster <akuster808@gmail.com>2025-01-22 19:16:49 -0500
commitff5e933e58384b180a339fb8808478db1ff4ade7 (patch)
treebaed0b6490b45113187957c0bc9662ae648f84e9
parente9e496dc64ed0abf602ea103ee10e6d3ffd918b9 (diff)
downloadmeta-openembedded-ff5e933e58384b180a339fb8808478db1ff4ade7.tar.gz
poppler: fix CVE-2024-56378
libpoppler.so in Poppler through 24.12.0 has an out-of-bounds read vulnerability within the JBIG2Bitmap::combine function in JBIG2Stream.cc. Reference: https://nvd.nist.gov/vuln/detail/CVE-2024-56378 Upstream patch: https://gitlab.freedesktop.org/poppler/poppler/-/commit/ade9b5ebed44b0c15522c27669ef6cdf93eff84e Signed-off-by: Yogita Urade <yogita.urade@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-support/poppler/poppler/CVE-2024-56378.patch78
-rw-r--r--meta-oe/recipes-support/poppler/poppler_22.04.0.bb1
2 files changed, 79 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/poppler/poppler/CVE-2024-56378.patch b/meta-oe/recipes-support/poppler/poppler/CVE-2024-56378.patch
new file mode 100644
index 0000000000..9f69702411
--- /dev/null
+++ b/meta-oe/recipes-support/poppler/poppler/CVE-2024-56378.patch
@@ -0,0 +1,78 @@
1From ade9b5ebed44b0c15522c27669ef6cdf93eff84e Mon Sep 17 00:00:00 2001
2From: Albert Astals Cid <aacid@kde.org>
3Date: Tue, 17 Dec 2024 18:59:01 +0100
4Subject: [PATCH] JBIG2Bitmap::combine: Fix crash on malformed files
5
6Fixes #1553
7
8CVE: CVE-2024-56378
9Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/ade9b5ebed44b0c15522c27669ef6cdf93eff84e]
10
11Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
12---
13 poppler/JBIG2Stream.cc | 15 +++++++++------
14 1 file changed, 9 insertions(+), 6 deletions(-)
15
16diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
17index 2276b5c..b9a62e1 100644
18--- a/poppler/JBIG2Stream.cc
19+++ b/poppler/JBIG2Stream.cc
20@@ -762,7 +762,7 @@ void JBIG2Bitmap::duplicateRow(int yDest, int ySrc)
21
22 void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, unsigned int combOp)
23 {
24- int x0, x1, y0, y1, xx, yy;
25+ int x0, x1, y0, y1, xx, yy, yyy;
26 unsigned char *srcPtr, *destPtr;
27 unsigned int src0, src1, src, dest, s1, s2, m1, m2, m3;
28 bool oneByte;
29@@ -809,14 +809,17 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, unsigned int combOp
30 oneByte = x0 == ((x1 - 1) & ~7);
31
32 for (yy = y0; yy < y1; ++yy) {
33- if (unlikely((y + yy >= h) || (y + yy < 0))) {
34+ if (unlikely(checkedAdd(y, yy, &yyy))) {
35+ continue;
36+ }
37+ if (unlikely((yyy >= h) || (yyy < 0))) {
38 continue;
39 }
40
41 // one byte per line -- need to mask both left and right side
42 if (oneByte) {
43 if (x >= 0) {
44- destPtr = data + (y + yy) * line + (x >> 3);
45+ destPtr = data + yyy * line + (x >> 3);
46 srcPtr = bitmap->data + yy * bitmap->line;
47 dest = *destPtr;
48 src1 = *srcPtr;
49@@ -839,7 +842,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, unsigned int combOp
50 }
51 *destPtr = dest;
52 } else {
53- destPtr = data + (y + yy) * line;
54+ destPtr = data + yyy * line;
55 srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
56 dest = *destPtr;
57 src1 = *srcPtr;
58@@ -869,7 +872,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, unsigned int combOp
59
60 // left-most byte
61 if (x >= 0) {
62- destPtr = data + (y + yy) * line + (x >> 3);
63+ destPtr = data + yyy * line + (x >> 3);
64 srcPtr = bitmap->data + yy * bitmap->line;
65 src1 = *srcPtr++;
66 dest = *destPtr;
67@@ -893,7 +896,7 @@ void JBIG2Bitmap::combine(JBIG2Bitmap *bitmap, int x, int y, unsigned int combOp
68 *destPtr++ = dest;
69 xx = x0 + 8;
70 } else {
71- destPtr = data + (y + yy) * line;
72+ destPtr = data + yyy * line;
73 srcPtr = bitmap->data + yy * bitmap->line + (-x >> 3);
74 src1 = *srcPtr++;
75 xx = x0;
76--
772.40.0
78
diff --git a/meta-oe/recipes-support/poppler/poppler_22.04.0.bb b/meta-oe/recipes-support/poppler/poppler_22.04.0.bb
index f49571caa9..af6ee67496 100644
--- a/meta-oe/recipes-support/poppler/poppler_22.04.0.bb
+++ b/meta-oe/recipes-support/poppler/poppler_22.04.0.bb
@@ -10,6 +10,7 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
10 file://CVE-2023-34872.patch \ 10 file://CVE-2023-34872.patch \
11 file://CVE-2024-6239-0001.patch \ 11 file://CVE-2024-6239-0001.patch \
12 file://CVE-2024-6239-0002.patch \ 12 file://CVE-2024-6239-0002.patch \
13 file://CVE-2024-56378.patch \
13 " 14 "
14SRC_URI[sha256sum] = "813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff" 15SRC_URI[sha256sum] = "813fb4b90e7bda63df53205c548602bae728887a60f4048aae4dbd9b1927deff"
15 16