diff options
| author | Lee Chee Yang <chee.yang.lee@intel.com> | 2020-12-30 17:01:40 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-12-31 11:56:41 +0000 |
| commit | ee867453ff2116620c07f0bb3bea725d7aa60731 (patch) | |
| tree | b259f29e977624a646333432cd7ca8272023916b | |
| parent | b9a5c512bcec764cc7e82ae6a6cfbb05c1c89012 (diff) | |
| download | poky-ee867453ff2116620c07f0bb3bea725d7aa60731.tar.gz | |
gdk-pixbuf: fix CVE-2020-29385
Backport patch from
https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81
image file in upstream patch is for test purpose only, it cause error during
do_patch so drop it:
File tests/test-images/fail/hang_114.gif: git binary diffs are not supported.
(From OE-Core rev: 7cd401b7c60dba91f6fb10395ab4a10a267cf23d)
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2020-29385.patch | 55 | ||||
| -rw-r--r-- | meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb | 1 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2020-29385.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2020-29385.patch new file mode 100644 index 0000000000..3fef2bc1eb --- /dev/null +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/CVE-2020-29385.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Robert Ancell <robert.ancell@canonical.com> | ||
| 3 | Date: Mon, 30 Nov 2020 12:26:12 +1300 | ||
| 4 | Subject: [PATCH 02/13] gif: Fix LZW decoder accepting invalid LZW code. | ||
| 5 | |||
| 6 | The code value after a reset wasn't being validated, which means we would | ||
| 7 | accept invalid codes. This could cause an infinite loop in the decoder. | ||
| 8 | |||
| 9 | Fixes CVE-2020-29385 | ||
| 10 | |||
| 11 | Fixes https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/164 | ||
| 12 | |||
| 13 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/bdd3acbd48a575d418ba6bf1b32d7bda2fae1c81] | ||
| 14 | CVE: CVE-2020-29385 | ||
| 15 | Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> | ||
| 16 | |||
| 17 | --- | ||
| 18 | gdk-pixbuf/lzw.c | 13 +++++++------ | ||
| 19 | 1 files changed, 7 insertions(+), 6 deletions(-) | ||
| 20 | create mode 100644 tests/test-images/fail/hang_114.gif | ||
| 21 | |||
| 22 | diff --git a/gdk-pixbuf/lzw.c b/gdk-pixbuf/lzw.c | ||
| 23 | index 9e052a6f7..105daf2b1 100644 | ||
| 24 | --- a/gdk-pixbuf/lzw.c | ||
| 25 | +++ b/gdk-pixbuf/lzw.c | ||
| 26 | @@ -195,19 +195,20 @@ lzw_decoder_feed (LZWDecoder *self, | ||
| 27 | if (self->last_code != self->clear_code && self->code_table_size < MAX_CODES) { | ||
| 28 | if (self->code < self->code_table_size) | ||
| 29 | add_code (self, self->code); | ||
| 30 | - else if (self->code == self->code_table_size) | ||
| 31 | + else | ||
| 32 | add_code (self, self->last_code); | ||
| 33 | - else { | ||
| 34 | - /* Invalid code received - just stop here */ | ||
| 35 | - self->last_code = self->eoi_code; | ||
| 36 | - return output_length; | ||
| 37 | - } | ||
| 38 | |||
| 39 | /* When table is full increase code size */ | ||
| 40 | if (self->code_table_size == (1 << self->code_size) && self->code_size < LZW_CODE_MAX) | ||
| 41 | self->code_size++; | ||
| 42 | } | ||
| 43 | |||
| 44 | + /* Invalid code received - just stop here */ | ||
| 45 | + if (self->code >= self->code_table_size) { | ||
| 46 | + self->last_code = self->eoi_code; | ||
| 47 | + return output_length; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | /* Convert codeword into indexes */ | ||
| 51 | n_written += write_indexes (self, output + n_written, output_length - n_written); | ||
| 52 | } | ||
| 53 | -- | ||
| 54 | 2.25.1 | ||
| 55 | |||
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb index 3dec5ed052..16708fd581 100644 --- a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb +++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.40.0.bb | |||
| @@ -24,6 +24,7 @@ SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \ | |||
| 24 | file://0004-Do-not-run-tests-when-building.patch \ | 24 | file://0004-Do-not-run-tests-when-building.patch \ |
| 25 | file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \ | 25 | file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \ |
| 26 | file://missing-test-data.patch \ | 26 | file://missing-test-data.patch \ |
| 27 | file://CVE-2020-29385.patch \ | ||
| 27 | " | 28 | " |
| 28 | 29 | ||
| 29 | SRC_URI_append_class-target = " \ | 30 | SRC_URI_append_class-target = " \ |
