diff options
author | zangrc <zangrc.fnst@cn.fujitsu.com> | 2021-01-08 23:03:53 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-01-07 22:57:45 -0800 |
commit | 936c02f1cf406de2e9de46e421eb617a083c0c69 (patch) | |
tree | 2ff640e30d8753e91a7491ae9277478c72add44f | |
parent | 1a0dff00a4f51312c71d7c25356c4d8e97833911 (diff) | |
download | meta-openembedded-936c02f1cf406de2e9de46e421eb617a083c0c69.tar.gz |
openjpeg: upgrade 2.3.1 -> 2.4.0
CVE-2020-15389.patch
CVE-2020-6851.patch
CVE-2020-8112.patch
Removed since these are included in 2.4.0.
Fixed an error where openjpeg.h could not be found.
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg/0001-This-patch-fixed-include-dir-to-usr-include-.-Obviou.patch | 36 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-15389.patch | 51 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-6851.patch | 36 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch | 50 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg_2.4.0.bb (renamed from meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb) | 6 |
5 files changed, 38 insertions, 141 deletions
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg/0001-This-patch-fixed-include-dir-to-usr-include-.-Obviou.patch b/meta-oe/recipes-graphics/openjpeg/openjpeg/0001-This-patch-fixed-include-dir-to-usr-include-.-Obviou.patch new file mode 100644 index 0000000000..663f499df6 --- /dev/null +++ b/meta-oe/recipes-graphics/openjpeg/openjpeg/0001-This-patch-fixed-include-dir-to-usr-include-.-Obviou.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 3e4fe4c42d4d63c36df966baea87da6fbc032553 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
3 | Date: Thu, 7 Jan 2021 16:05:28 +0900 | ||
4 | Subject: [PATCH] This patch fixed include dir to /usr/include/. Obviously, it | ||
5 | is not suitble for cross-compile. So, removed this patch temporarily. | ||
6 | https://github.com/uclouvain/openjpeg/issues/1174 | ||
7 | |||
8 | Upsteam-Status: Pending | ||
9 | https://github.com/uclouvain/openjpeg/issues/1320 | ||
10 | |||
11 | Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com> | ||
12 | --- | ||
13 | cmake/OpenJPEGConfig.cmake.in | 6 +++++- | ||
14 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/cmake/OpenJPEGConfig.cmake.in b/cmake/OpenJPEGConfig.cmake.in | ||
17 | index 8a726697..2925108a 100644 | ||
18 | --- a/cmake/OpenJPEGConfig.cmake.in | ||
19 | +++ b/cmake/OpenJPEGConfig.cmake.in | ||
20 | @@ -27,8 +27,12 @@ if(EXISTS ${SELF_DIR}/OpenJPEGTargets.cmake) | ||
21 | # This is an install tree | ||
22 | include(${SELF_DIR}/OpenJPEGTargets.cmake) | ||
23 | |||
24 | + # We find a relative path from the PKG directory to header files. | ||
25 | + set(PKG_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_PACKAGE_DIR@") | ||
26 | set(INC_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_INCLUDE_DIR@") | ||
27 | - get_filename_component(OPENJPEG_INCLUDE_DIRS "${INC_DIR}" ABSOLUTE) | ||
28 | + file(RELATIVE_PATH PKG_TO_INC_RPATH "${PKG_DIR}" "${INC_DIR}") | ||
29 | + | ||
30 | + get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" ABSOLUTE) | ||
31 | |||
32 | else() | ||
33 | if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake) | ||
34 | -- | ||
35 | 2.25.1 | ||
36 | |||
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-15389.patch b/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-15389.patch deleted file mode 100644 index f5ce11a27f..0000000000 --- a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-15389.patch +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | From e8e258ab049240c2dd1f1051b4e773b21e2d3dc0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Even Rouault <even.rouault@spatialys.com> | ||
3 | Date: Sun, 28 Jun 2020 14:19:59 +0200 | ||
4 | Subject: [PATCH] opj_decompress: fix double-free on input directory with mix | ||
5 | of valid and invalid images (CVE-2020-15389) | ||
6 | |||
7 | Fixes #1261 | ||
8 | |||
9 | Credits to @Ruia-ruia for reporting and analysis. | ||
10 | --- | ||
11 | src/bin/jp2/opj_decompress.c | 8 ++++---- | ||
12 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
13 | |||
14 | --- end of original header --- | ||
15 | |||
16 | CVE: CVE-2020-15389 | ||
17 | |||
18 | Upstream-Status: Backport [git://github.com/uclouvain/openjpeg.git] | ||
19 | |||
20 | Signed-off-by: Joe Slater <joe.slater@windriver.com> | ||
21 | |||
22 | --- | ||
23 | diff --git a/src/bin/jp2/opj_decompress.c b/src/bin/jp2/opj_decompress.c | ||
24 | index 7eeb0952..2634907f 100644 | ||
25 | --- a/src/bin/jp2/opj_decompress.c | ||
26 | +++ b/src/bin/jp2/opj_decompress.c | ||
27 | @@ -1316,10 +1316,6 @@ static opj_image_t* upsample_image_components(opj_image_t* original) | ||
28 | int main(int argc, char **argv) | ||
29 | { | ||
30 | opj_decompress_parameters parameters; /* decompression parameters */ | ||
31 | - opj_image_t* image = NULL; | ||
32 | - opj_stream_t *l_stream = NULL; /* Stream */ | ||
33 | - opj_codec_t* l_codec = NULL; /* Handle to a decompressor */ | ||
34 | - opj_codestream_index_t* cstr_index = NULL; | ||
35 | |||
36 | OPJ_INT32 num_images, imageno; | ||
37 | img_fol_t img_fol; | ||
38 | @@ -1393,6 +1389,10 @@ int main(int argc, char **argv) | ||
39 | |||
40 | /*Decoding image one by one*/ | ||
41 | for (imageno = 0; imageno < num_images ; imageno++) { | ||
42 | + opj_image_t* image = NULL; | ||
43 | + opj_stream_t *l_stream = NULL; /* Stream */ | ||
44 | + opj_codec_t* l_codec = NULL; /* Handle to a decompressor */ | ||
45 | + opj_codestream_index_t* cstr_index = NULL; | ||
46 | |||
47 | if (!parameters.quiet) { | ||
48 | fprintf(stderr, "\n"); | ||
49 | -- | ||
50 | 2.17.1 | ||
51 | |||
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-6851.patch b/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-6851.patch deleted file mode 100644 index 1e14149c85..0000000000 --- a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-6851.patch +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | From 024b8407392cb0b82b04b58ed256094ed5799e04 Mon Sep 17 00:00:00 2001 | ||
2 | From: Even Rouault <even.rouault@spatialys.com> | ||
3 | Date: Sat, 11 Jan 2020 01:51:19 +0100 | ||
4 | Subject: [PATCH] opj_j2k_update_image_dimensions(): reject images whose | ||
5 | coordinates are beyond INT_MAX (fixes #1228) | ||
6 | |||
7 | CVE: CVE-2020-6851 | ||
8 | |||
9 | Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> | ||
10 | |||
11 | --- | ||
12 | src/lib/openjp2/j2k.c | 8 ++++++++ | ||
13 | 1 file changed, 8 insertions(+) | ||
14 | |||
15 | diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c | ||
16 | index 14f6ff41..922550eb 100644 | ||
17 | --- a/src/lib/openjp2/j2k.c | ||
18 | +++ b/src/lib/openjp2/j2k.c | ||
19 | @@ -9236,6 +9236,14 @@ static OPJ_BOOL opj_j2k_update_image_dim | ||
20 | l_img_comp = p_image->comps; | ||
21 | for (it_comp = 0; it_comp < p_image->numcomps; ++it_comp) { | ||
22 | OPJ_INT32 l_h, l_w; | ||
23 | + if (p_image->x0 > (OPJ_UINT32)INT_MAX || | ||
24 | + p_image->y0 > (OPJ_UINT32)INT_MAX || | ||
25 | + p_image->x1 > (OPJ_UINT32)INT_MAX || | ||
26 | + p_image->y1 > (OPJ_UINT32)INT_MAX) { | ||
27 | + opj_event_msg(p_manager, EVT_ERROR, | ||
28 | + "Image coordinates above INT_MAX are not supported\n"); | ||
29 | + return OPJ_FALSE; | ||
30 | + } | ||
31 | |||
32 | l_img_comp->x0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->x0, | ||
33 | (OPJ_INT32)l_img_comp->dx); | ||
34 | -- | ||
35 | 2.17.1 | ||
36 | |||
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch b/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch deleted file mode 100644 index 6158601af0..0000000000 --- a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From 05f9b91e60debda0e83977e5e63b2e66486f7074 Mon Sep 17 00:00:00 2001 | ||
2 | From: Even Rouault <even.rouault@spatialys.com> | ||
3 | Date: Thu, 30 Jan 2020 00:59:57 +0100 | ||
4 | Subject: [PATCH] opj_tcd_init_tile(): avoid integer overflow | ||
5 | |||
6 | That could lead to later assertion failures. | ||
7 | |||
8 | Fixes #1231 / CVE-2020-8112 | ||
9 | |||
10 | CVE: CVE-2020-8112 | ||
11 | |||
12 | Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> | ||
13 | --- | ||
14 | src/lib/openjp2/tcd.c | 20 ++++++++++++++++++-- | ||
15 | 1 file changed, 18 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c | ||
18 | index deecc4df..aa419030 100644 | ||
19 | --- a/src/lib/openjp2/tcd.c | ||
20 | +++ b/src/lib/openjp2/tcd.c | ||
21 | @@ -905,8 +905,24 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, | ||
22 | /* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */ | ||
23 | l_tl_prc_x_start = opj_int_floordivpow2(l_res->x0, (OPJ_INT32)l_pdx) << l_pdx; | ||
24 | l_tl_prc_y_start = opj_int_floordivpow2(l_res->y0, (OPJ_INT32)l_pdy) << l_pdy; | ||
25 | - l_br_prc_x_end = opj_int_ceildivpow2(l_res->x1, (OPJ_INT32)l_pdx) << l_pdx; | ||
26 | - l_br_prc_y_end = opj_int_ceildivpow2(l_res->y1, (OPJ_INT32)l_pdy) << l_pdy; | ||
27 | + { | ||
28 | + OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->x1, | ||
29 | + (OPJ_INT32)l_pdx)) << l_pdx; | ||
30 | + if (tmp > (OPJ_UINT32)INT_MAX) { | ||
31 | + opj_event_msg(manager, EVT_ERROR, "Integer overflow\n"); | ||
32 | + return OPJ_FALSE; | ||
33 | + } | ||
34 | + l_br_prc_x_end = (OPJ_INT32)tmp; | ||
35 | + } | ||
36 | + { | ||
37 | + OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->y1, | ||
38 | + (OPJ_INT32)l_pdy)) << l_pdy; | ||
39 | + if (tmp > (OPJ_UINT32)INT_MAX) { | ||
40 | + opj_event_msg(manager, EVT_ERROR, "Integer overflow\n"); | ||
41 | + return OPJ_FALSE; | ||
42 | + } | ||
43 | + l_br_prc_y_end = (OPJ_INT32)tmp; | ||
44 | + } | ||
45 | /*fprintf(stderr, "\t\t\tprc_x_start=%d, prc_y_start=%d, br_prc_x_end=%d, br_prc_y_end=%d \n", l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end ,l_br_prc_y_end );*/ | ||
46 | |||
47 | l_res->pw = (l_res->x0 == l_res->x1) ? 0U : (OPJ_UINT32)(( | ||
48 | -- | ||
49 | 2.20.1 | ||
50 | |||
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb b/meta-oe/recipes-graphics/openjpeg/openjpeg_2.4.0.bb index a0740a2740..8e264bf71b 100644 --- a/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb +++ b/meta-oe/recipes-graphics/openjpeg/openjpeg_2.4.0.bb | |||
@@ -8,11 +8,9 @@ DEPENDS = "libpng tiff lcms zlib" | |||
8 | SRC_URI = " \ | 8 | SRC_URI = " \ |
9 | git://github.com/uclouvain/openjpeg.git \ | 9 | git://github.com/uclouvain/openjpeg.git \ |
10 | file://0002-Do-not-ask-cmake-to-export-binaries-they-don-t-make-.patch \ | 10 | file://0002-Do-not-ask-cmake-to-export-binaries-they-don-t-make-.patch \ |
11 | file://CVE-2020-6851.patch \ | 11 | file://0001-This-patch-fixed-include-dir-to-usr-include-.-Obviou.patch \ |
12 | file://CVE-2020-8112.patch \ | ||
13 | file://CVE-2020-15389.patch \ | ||
14 | " | 12 | " |
15 | SRCREV = "57096325457f96d8cd07bd3af04fe81d7a2ba788" | 13 | SRCREV = "37ac30ceff6640bbab502388c5e0fa0bff23f505" |
16 | S = "${WORKDIR}/git" | 14 | S = "${WORKDIR}/git" |
17 | 15 | ||
18 | inherit cmake | 16 | inherit cmake |