diff options
author | Yogita Urade <yogita.urade@windriver.com> | 2025-01-22 05:00:04 +0000 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2025-02-04 14:41:01 -0800 |
commit | a20ce51ca0e9fb1a89f3388123d17e65f7f2fc40 (patch) | |
tree | f226bb7b2c40ee8765fe03eff149eeeb63515382 | |
parent | 0bd3f27be016b7f0935b2ed5b0dc481689cf10ef (diff) | |
download | meta-openembedded-a20ce51ca0e9fb1a89f3388123d17e65f7f2fc40.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.patch | 77 | ||||
-rw-r--r-- | meta-oe/recipes-support/poppler/poppler_23.04.0.bb | 1 |
2 files changed, 78 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..f94b8fed1f --- /dev/null +++ b/meta-oe/recipes-support/poppler/poppler/CVE-2024-56378.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | From ade9b5ebed44b0c15522c27669ef6cdf93eff84e Mon Sep 17 00:00:00 2001 | ||
2 | From: Albert Astals Cid <aacid@kde.org> | ||
3 | Date: Tue, 17 Dec 2024 18:59:01 +0100 | ||
4 | Subject: [PATCH] JBIG2Bitmap::combine: Fix crash on malformed files | ||
5 | |||
6 | Fixes #1553 | ||
7 | |||
8 | CVE: CVE-2024-56378 | ||
9 | Upstream-Status: Backport [https://gitlab.freedesktop.org/poppler/poppler/-/commit/ade9b5ebed44b0c15522c27669ef6cdf93eff84e] | ||
10 | |||
11 | Signed-off-by: Yogita Urade <yogita.urade@windriver.com> | ||
12 | --- | ||
13 | poppler/JBIG2Stream.cc | 15 +++++++++------ | ||
14 | 1 file changed, 9 insertions(+), 6 deletions(-) | ||
15 | |||
16 | diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc | ||
17 | index 77ffeb2..bdc51d0 100644 | ||
18 | --- a/poppler/JBIG2Stream.cc | ||
19 | +++ b/poppler/JBIG2Stream.cc | ||
20 | @@ -765,7 +765,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 | @@ -812,14 +812,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 | @@ -842,7 +845,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 | @@ -872,7 +875,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 | @@ -896,7 +899,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 | -- | ||
77 | 2.40.0 | ||
diff --git a/meta-oe/recipes-support/poppler/poppler_23.04.0.bb b/meta-oe/recipes-support/poppler/poppler_23.04.0.bb index e57760d853..e76692bbee 100644 --- a/meta-oe/recipes-support/poppler/poppler_23.04.0.bb +++ b/meta-oe/recipes-support/poppler/poppler_23.04.0.bb | |||
@@ -11,6 +11,7 @@ SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \ | |||
11 | file://CVE-2023-34872.patch \ | 11 | file://CVE-2023-34872.patch \ |
12 | file://CVE-2024-6239-0001.patch \ | 12 | file://CVE-2024-6239-0001.patch \ |
13 | file://CVE-2024-6239-0002.patch \ | 13 | file://CVE-2024-6239-0002.patch \ |
14 | file://CVE-2024-56378.patch \ | ||
14 | " | 15 | " |
15 | SRC_URI[sha256sum] = "b6d893dc7dcd4138b9e9df59a13c59695e50e80dc5c2cacee0674670693951a1" | 16 | SRC_URI[sha256sum] = "b6d893dc7dcd4138b9e9df59a13c59695e50e80dc5c2cacee0674670693951a1" |
16 | 17 | ||