diff options
author | Sakib Sajal <sakib.sajal@windriver.com> | 2020-03-17 13:05:33 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-03-17 19:46:35 -0700 |
commit | f7e11c4c7504568cdbc1a9cfb8cbde0247cb1c92 (patch) | |
tree | 3ed6cb44ca724913f04f107c76e17326bbb9d6ad /meta-oe/recipes-graphics/openjpeg | |
parent | 464c317c850155caaead4eb77465560e4060c276 (diff) | |
download | meta-openembedded-f7e11c4c7504568cdbc1a9cfb8cbde0247cb1c92.tar.gz |
openjpeg: Fix CVE-2020-8112
Backport from upstream to fix heap-based buffer overflow.
Upstream-Status: Backport
CVE: CVE-2020-8112
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-graphics/openjpeg')
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch | 46 | ||||
-rw-r--r-- | meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch b/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch new file mode 100644 index 000000000..cb250530e --- /dev/null +++ b/meta-oe/recipes-graphics/openjpeg/openjpeg/CVE-2020-8112.patch | |||
@@ -0,0 +1,46 @@ | |||
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 | src/lib/openjp2/tcd.c | 20 ++++++++++++++++++-- | ||
11 | 1 file changed, 18 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c | ||
14 | index deecc4df..aa419030 100644 | ||
15 | --- a/src/lib/openjp2/tcd.c | ||
16 | +++ b/src/lib/openjp2/tcd.c | ||
17 | @@ -905,8 +905,24 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no, | ||
18 | /* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000) */ | ||
19 | l_tl_prc_x_start = opj_int_floordivpow2(l_res->x0, (OPJ_INT32)l_pdx) << l_pdx; | ||
20 | l_tl_prc_y_start = opj_int_floordivpow2(l_res->y0, (OPJ_INT32)l_pdy) << l_pdy; | ||
21 | - l_br_prc_x_end = opj_int_ceildivpow2(l_res->x1, (OPJ_INT32)l_pdx) << l_pdx; | ||
22 | - l_br_prc_y_end = opj_int_ceildivpow2(l_res->y1, (OPJ_INT32)l_pdy) << l_pdy; | ||
23 | + { | ||
24 | + OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->x1, | ||
25 | + (OPJ_INT32)l_pdx)) << l_pdx; | ||
26 | + if (tmp > (OPJ_UINT32)INT_MAX) { | ||
27 | + opj_event_msg(manager, EVT_ERROR, "Integer overflow\n"); | ||
28 | + return OPJ_FALSE; | ||
29 | + } | ||
30 | + l_br_prc_x_end = (OPJ_INT32)tmp; | ||
31 | + } | ||
32 | + { | ||
33 | + OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->y1, | ||
34 | + (OPJ_INT32)l_pdy)) << l_pdy; | ||
35 | + if (tmp > (OPJ_UINT32)INT_MAX) { | ||
36 | + opj_event_msg(manager, EVT_ERROR, "Integer overflow\n"); | ||
37 | + return OPJ_FALSE; | ||
38 | + } | ||
39 | + l_br_prc_y_end = (OPJ_INT32)tmp; | ||
40 | + } | ||
41 | /*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 );*/ | ||
42 | |||
43 | l_res->pw = (l_res->x0 == l_res->x1) ? 0U : (OPJ_UINT32)(( | ||
44 | -- | ||
45 | 2.20.1 | ||
46 | |||
diff --git a/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb b/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb index 4045148dd..42011efa9 100644 --- a/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb +++ b/meta-oe/recipes-graphics/openjpeg/openjpeg_2.3.1.bb | |||
@@ -9,6 +9,7 @@ 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://CVE-2020-6851.patch \ |
12 | file://CVE-2020-8112.patch \ | ||
12 | " | 13 | " |
13 | SRCREV = "57096325457f96d8cd07bd3af04fe81d7a2ba788" | 14 | SRCREV = "57096325457f96d8cd07bd3af04fe81d7a2ba788" |
14 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |