summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libexif/files/CVE-2020-0452.patch
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2020-12-30 10:39:53 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-31 11:56:38 +0000
commit46d837442ab216941df2d02f60c69155463e02d8 (patch)
tree6e64e8e44ec89b5497b1c9726f5a1eb99324a02b /meta/recipes-support/libexif/files/CVE-2020-0452.patch
parent69952f5bf247fc42103a249a48213017f50e319d (diff)
downloadopenembedded-core-46d837442ab216941df2d02f60c69155463e02d8.tar.gz
libexif: fix CVE-2020-0198; CVE-2020-0452
Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/libexif/files/CVE-2020-0452.patch')
-rw-r--r--meta/recipes-support/libexif/files/CVE-2020-0452.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-support/libexif/files/CVE-2020-0452.patch b/meta/recipes-support/libexif/files/CVE-2020-0452.patch
new file mode 100644
index 0000000000..a117b8b369
--- /dev/null
+++ b/meta/recipes-support/libexif/files/CVE-2020-0452.patch
@@ -0,0 +1,39 @@
+From 302acd49eba0a125b0f20692df6abc6f7f7ca53e Mon Sep 17 00:00:00 2001
+From: Changqing Li <changqing.li@windriver.com>
+Date: Wed, 30 Dec 2020 10:18:51 +0800
+Subject: [PATCH] fixed a incorrect overflow check that could be optimized
+ away.
+
+inspired by:
+https://android.googlesource.com/platform/external/libexif/+/8e7345f3bc0bad06ac369d6cbc1124c8ceaf7d4b
+
+https://source.android.com/security/bulletin/2020-11-01
+
+CVE-2020-0452
+
+Upsteam-Status: Backport[https://github.com/libexif/libexif/commit/9266d14b5ca4e29b970fa03272318e5f99386e06]
+CVE: CVE-2020-0452
+
+Signed-off-by: Changqing Li <changqing.li@windriver.com>
+---
+ libexif/exif-entry.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libexif/exif-entry.c b/libexif/exif-entry.c
+index 5de215f..3a6ce84 100644
+--- a/libexif/exif-entry.c
++++ b/libexif/exif-entry.c
+@@ -1371,8 +1371,8 @@ exif_entry_get_value (ExifEntry *e, char *val, unsigned int maxlen)
+ {
+ unsigned char *utf16;
+
+- /* Sanity check the size to prevent overflow */
+- if (e->size+sizeof(uint16_t)+1 < e->size) break;
++ /* Sanity check the size to prevent overflow. Note EXIF files are 64kb at most. */
++ if (e->size >= 65536 - sizeof(uint16_t)*2) break;
+
+ /* The tag may not be U+0000-terminated , so make a local
+ U+0000-terminated copy before converting it */
+--
+2.17.1
+