diff options
| author | Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | 2020-11-11 18:57:33 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-20 10:44:34 +0000 |
| commit | eac703a29b1b918c58ac463c70309394f462dfb8 (patch) | |
| tree | 450b366ddac42121ea4adf6caf00d3e4b5f690f5 /meta | |
| parent | 99d3367dd81e248e07999b58ebd8afbaaa3faf97 (diff) | |
| download | poky-eac703a29b1b918c58ac463c70309394f462dfb8.tar.gz | |
freetype: fix CVE-2020-15999, backport from 2.10.4
(From OE-Core rev: b4a92a20a683a74423fd5a833d5c016f63dba2b4)
Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/recipes-graphics/freetype/freetype/0001-sfnt-Fix-heap-buffer-overflow-59308.patch | 51 | ||||
| -rw-r--r-- | meta/recipes-graphics/freetype/freetype_2.10.1.bb | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta/recipes-graphics/freetype/freetype/0001-sfnt-Fix-heap-buffer-overflow-59308.patch b/meta/recipes-graphics/freetype/freetype/0001-sfnt-Fix-heap-buffer-overflow-59308.patch new file mode 100644 index 0000000000..fa8a29b798 --- /dev/null +++ b/meta/recipes-graphics/freetype/freetype/0001-sfnt-Fix-heap-buffer-overflow-59308.patch | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | From a3bab162b2ae616074c8877a04556932998aeacd Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Werner Lemberg <wl@gnu.org> | ||
| 3 | Date: Mon, 19 Oct 2020 23:45:28 +0200 | ||
| 4 | Subject: [PATCH] [sfnt] Fix heap buffer overflow (#59308). | ||
| 5 | |||
| 6 | This is CVE-2020-15999. | ||
| 7 | |||
| 8 | * src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier. | ||
| 9 | |||
| 10 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=a3bab162b2ae616074c8877a04556932998aeacd] | ||
| 11 | |||
| 12 | Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> | ||
| 13 | --- | ||
| 14 | src/sfnt/pngshim.c | 14 +++++++------- | ||
| 15 | 1 file changed, 7 insertions(+), 7 deletions(-) | ||
| 16 | |||
| 17 | diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c | ||
| 18 | index 2e64e5846..f55016122 100644 | ||
| 19 | --- a/src/sfnt/pngshim.c | ||
| 20 | +++ b/src/sfnt/pngshim.c | ||
| 21 | @@ -332,6 +332,13 @@ | ||
| 22 | |||
| 23 | if ( populate_map_and_metrics ) | ||
| 24 | { | ||
| 25 | + /* reject too large bitmaps similarly to the rasterizer */ | ||
| 26 | + if ( imgHeight > 0x7FFF || imgWidth > 0x7FFF ) | ||
| 27 | + { | ||
| 28 | + error = FT_THROW( Array_Too_Large ); | ||
| 29 | + goto DestroyExit; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | metrics->width = (FT_UShort)imgWidth; | ||
| 33 | metrics->height = (FT_UShort)imgHeight; | ||
| 34 | |||
| 35 | @@ -340,13 +347,6 @@ | ||
| 36 | map->pixel_mode = FT_PIXEL_MODE_BGRA; | ||
| 37 | map->pitch = (int)( map->width * 4 ); | ||
| 38 | map->num_grays = 256; | ||
| 39 | - | ||
| 40 | - /* reject too large bitmaps similarly to the rasterizer */ | ||
| 41 | - if ( map->rows > 0x7FFF || map->width > 0x7FFF ) | ||
| 42 | - { | ||
| 43 | - error = FT_THROW( Array_Too_Large ); | ||
| 44 | - goto DestroyExit; | ||
| 45 | - } | ||
| 46 | } | ||
| 47 | |||
| 48 | /* convert palette/gray image to rgb */ | ||
| 49 | -- | ||
| 50 | 2.18.4 | ||
| 51 | |||
diff --git a/meta/recipes-graphics/freetype/freetype_2.10.1.bb b/meta/recipes-graphics/freetype/freetype_2.10.1.bb index d1c093054b..2d444bbf19 100644 --- a/meta/recipes-graphics/freetype/freetype_2.10.1.bb +++ b/meta/recipes-graphics/freetype/freetype_2.10.1.bb | |||
| @@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=4af6221506f202774ef74f64932878a1 | |||
| 14 | 14 | ||
| 15 | SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BP}.tar.xz \ | 15 | SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BP}.tar.xz \ |
| 16 | file://use-right-libtool.patch \ | 16 | file://use-right-libtool.patch \ |
| 17 | file://0001-sfnt-Fix-heap-buffer-overflow-59308.patch \ | ||
| 17 | " | 18 | " |
| 18 | SRC_URI[md5sum] = "bd42e75127f8431923679480efb5ba8f" | 19 | SRC_URI[md5sum] = "bd42e75127f8431923679480efb5ba8f" |
| 19 | SRC_URI[sha256sum] = "16dbfa488a21fe827dc27eaf708f42f7aa3bb997d745d31a19781628c36ba26f" | 20 | SRC_URI[sha256sum] = "16dbfa488a21fe827dc27eaf708f42f7aa3bb997d745d31a19781628c36ba26f" |
