diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2021-10-11 11:40:49 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 11:48:46 +0100 |
commit | 266d5bdb10e199298b8e003c6f6ddbf240c7a501 (patch) | |
tree | 86fc8728ba6fc6b79511103388590cbfabf0783c /meta/recipes-support | |
parent | 12aa32c7e2447994753bc1fa15380ea21e53d3d7 (diff) | |
download | poky-266d5bdb10e199298b8e003c6f6ddbf240c7a501.tar.gz |
libexif: update 0.6.22 -> 0.6.23
(From OE-Core rev: 65a54f72e15f59bdf9d8c4618f3ef8510541d134)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/libexif/files/CVE-2020-0198.patch | 66 | ||||
-rw-r--r-- | meta/recipes-support/libexif/files/CVE-2020-0452.patch | 39 | ||||
-rw-r--r-- | meta/recipes-support/libexif/libexif_0.6.23.bb (renamed from meta/recipes-support/libexif/libexif_0.6.22.bb) | 6 |
3 files changed, 2 insertions, 109 deletions
diff --git a/meta/recipes-support/libexif/files/CVE-2020-0198.patch b/meta/recipes-support/libexif/files/CVE-2020-0198.patch deleted file mode 100644 index 2a48844cb2..0000000000 --- a/meta/recipes-support/libexif/files/CVE-2020-0198.patch +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | From ca71eda33fe8421f98fbe20eb4392473357c1c43 Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Wed, 30 Dec 2020 10:22:47 +0800 | ||
4 | Subject: [PATCH] fixed another unsigned integer overflow | ||
5 | |||
6 | first fixed by google in android fork, | ||
7 | https://android.googlesource.com/platform/external/libexif/+/1e187b62682ffab5003c702657d6d725b4278f16%5E%21/#F0 | ||
8 | |||
9 | (use a more generic overflow check method, also check second overflow instance.) | ||
10 | |||
11 | https://security-tracker.debian.org/tracker/CVE-2020-0198 | ||
12 | |||
13 | Upstream-Status: Backport[https://github.com/libexif/libexif/commit/ce03ad7ef4e8aeefce79192bf5b6f69fae396f0c] | ||
14 | CVE: CVE-2020-0198 | ||
15 | |||
16 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
17 | --- | ||
18 | libexif/exif-data.c | 10 ++++++---- | ||
19 | 1 file changed, 6 insertions(+), 4 deletions(-) | ||
20 | |||
21 | diff --git a/libexif/exif-data.c b/libexif/exif-data.c | ||
22 | index 8b280d3..34d58fc 100644 | ||
23 | --- a/libexif/exif-data.c | ||
24 | +++ b/libexif/exif-data.c | ||
25 | @@ -47,6 +47,8 @@ | ||
26 | #undef JPEG_MARKER_APP1 | ||
27 | #define JPEG_MARKER_APP1 0xe1 | ||
28 | |||
29 | +#define CHECKOVERFLOW(offset,datasize,structsize) (( offset >= datasize) || (structsize > datasize) || (offset > datasize - structsize )) | ||
30 | + | ||
31 | static const unsigned char ExifHeader[] = {0x45, 0x78, 0x69, 0x66, 0x00, 0x00}; | ||
32 | |||
33 | struct _ExifDataPrivate | ||
34 | @@ -327,7 +329,7 @@ exif_data_load_data_thumbnail (ExifData *data, const unsigned char *d, | ||
35 | exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail offset (%u).", o); | ||
36 | return; | ||
37 | } | ||
38 | - if (s > ds - o) { | ||
39 | + if (CHECKOVERFLOW(o,ds,s)) { | ||
40 | exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", "Bogus thumbnail size (%u), max would be %u.", s, ds-o); | ||
41 | return; | ||
42 | } | ||
43 | @@ -420,9 +422,9 @@ exif_data_load_data_content (ExifData *data, ExifIfd ifd, | ||
44 | } | ||
45 | |||
46 | /* Read the number of entries */ | ||
47 | - if ((offset + 2 < offset) || (offset + 2 < 2) || (offset + 2 > ds)) { | ||
48 | + if (CHECKOVERFLOW(offset, ds, 2)) { | ||
49 | exif_log (data->priv->log, EXIF_LOG_CODE_CORRUPT_DATA, "ExifData", | ||
50 | - "Tag data past end of buffer (%u > %u)", offset+2, ds); | ||
51 | + "Tag data past end of buffer (%u+2 > %u)", offset, ds); | ||
52 | return; | ||
53 | } | ||
54 | n = exif_get_short (d + offset, data->priv->order); | ||
55 | @@ -431,7 +433,7 @@ exif_data_load_data_content (ExifData *data, ExifIfd ifd, | ||
56 | offset += 2; | ||
57 | |||
58 | /* Check if we have enough data. */ | ||
59 | - if (offset + 12 * n > ds) { | ||
60 | + if (CHECKOVERFLOW(offset, ds, 12*n)) { | ||
61 | n = (ds - offset) / 12; | ||
62 | exif_log (data->priv->log, EXIF_LOG_CODE_DEBUG, "ExifData", | ||
63 | "Short data; only loading %hu entries...", n); | ||
64 | -- | ||
65 | 2.17.1 | ||
66 | |||
diff --git a/meta/recipes-support/libexif/files/CVE-2020-0452.patch b/meta/recipes-support/libexif/files/CVE-2020-0452.patch deleted file mode 100644 index a117b8b369..0000000000 --- a/meta/recipes-support/libexif/files/CVE-2020-0452.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From 302acd49eba0a125b0f20692df6abc6f7f7ca53e Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Wed, 30 Dec 2020 10:18:51 +0800 | ||
4 | Subject: [PATCH] fixed a incorrect overflow check that could be optimized | ||
5 | away. | ||
6 | |||
7 | inspired by: | ||
8 | https://android.googlesource.com/platform/external/libexif/+/8e7345f3bc0bad06ac369d6cbc1124c8ceaf7d4b | ||
9 | |||
10 | https://source.android.com/security/bulletin/2020-11-01 | ||
11 | |||
12 | CVE-2020-0452 | ||
13 | |||
14 | Upsteam-Status: Backport[https://github.com/libexif/libexif/commit/9266d14b5ca4e29b970fa03272318e5f99386e06] | ||
15 | CVE: CVE-2020-0452 | ||
16 | |||
17 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
18 | --- | ||
19 | libexif/exif-entry.c | 4 ++-- | ||
20 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
21 | |||
22 | diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c | ||
23 | index 5de215f..3a6ce84 100644 | ||
24 | --- a/libexif/exif-entry.c | ||
25 | +++ b/libexif/exif-entry.c | ||
26 | @@ -1371,8 +1371,8 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen) | ||
27 | { | ||
28 | unsigned char *utf16; | ||
29 | |||
30 | - /* Sanity check the size to prevent overflow */ | ||
31 | - if (e->size+sizeof(uint16_t)+1 < e->size) break; | ||
32 | + /* Sanity check the size to prevent overflow. Note EXIF files are 64kb at most. */ | ||
33 | + if (e->size >= 65536 - sizeof(uint16_t)*2) break; | ||
34 | |||
35 | /* The tag may not be U+0000-terminated , so make a local | ||
36 | U+0000-terminated copy before converting it */ | ||
37 | -- | ||
38 | 2.17.1 | ||
39 | |||
diff --git a/meta/recipes-support/libexif/libexif_0.6.22.bb b/meta/recipes-support/libexif/libexif_0.6.23.bb index 9ca96d548c..b33522dfc4 100644 --- a/meta/recipes-support/libexif/libexif_0.6.22.bb +++ b/meta/recipes-support/libexif/libexif_0.6.23.bb | |||
@@ -10,12 +10,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad" | |||
10 | def version_underscore(v): | 10 | def version_underscore(v): |
11 | return "_".join(v.split(".")) | 11 | return "_".join(v.split(".")) |
12 | 12 | ||
13 | SRC_URI = "https://github.com/libexif/libexif/releases/download/libexif-${@version_underscore("${PV}")}-release/libexif-${PV}.tar.xz \ | 13 | SRC_URI = "https://github.com/libexif/libexif/releases/download/v${PV}/libexif-${PV}.tar.xz \ |
14 | file://CVE-2020-0198.patch \ | ||
15 | file://CVE-2020-0452.patch \ | ||
16 | " | 14 | " |
17 | 15 | ||
18 | SRC_URI[sha256sum] = "5048f1c8fc509cc636c2f97f4b40c293338b6041a5652082d5ee2cf54b530c56" | 16 | SRC_URI[sha256sum] = "a740a99920eb81ae0aa802bb46e683ce6e0cde061c210f5d5bde5b8572380431" |
19 | 17 | ||
20 | UPSTREAM_CHECK_URI = "https://github.com/libexif/libexif/releases/" | 18 | UPSTREAM_CHECK_URI = "https://github.com/libexif/libexif/releases/" |
21 | 19 | ||