diff options
Diffstat (limited to 'meta/recipes-multimedia/libtiff/files')
-rw-r--r-- | meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch b/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch new file mode 100644 index 0000000000..6d082bb613 --- /dev/null +++ b/meta/recipes-multimedia/libtiff/files/CVE-2017-7598.patch | |||
@@ -0,0 +1,65 @@ | |||
1 | From 3cfd62d77c2a7e147a05bd678524c345fa9c2bb8 Mon Sep 17 00:00:00 2001 | ||
2 | From: erouault <erouault> | ||
3 | Date: Wed, 11 Jan 2017 13:28:01 +0000 | ||
4 | Subject: [PATCH] * libtiff/tif_dirread.c: avoid division by floating point 0 | ||
5 | in TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(), | ||
6 | and return 0 in that case (instead of infinity as before presumably) | ||
7 | Apparently some sanitizers do not like those divisions by zero. Fixes | ||
8 | http://bugzilla.maptools.org/show_bug.cgi?id=2644 | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | |||
12 | CVE: CVE-2017-7598 | ||
13 | Signed-off-by: Rajkumar Veer <rveer@mvista.com> | ||
14 | Index: tiff-4.0.7/ChangeLog | ||
15 | =================================================================== | ||
16 | --- tiff-4.0.7.orig/ChangeLog 2017-04-25 16:14:59.858612730 +0530 | ||
17 | +++ tiff-4.0.7/ChangeLog 2017-04-25 18:11:36.048107127 +0530 | ||
18 | @@ -1,3 +1,4 @@ | ||
19 | + | ||
20 | 2017-01-12 Even Rouault <even.rouault at spatialys.com> | ||
21 | |||
22 | * libtiff/tif_ojpeg.c: fix leak in OJPEGReadHeaderInfoSecTablesQTable, | ||
23 | @@ -8,6 +9,14 @@ | ||
24 | |||
25 | 2017-01-11 Even Rouault <even.rouault at spatialys.com> | ||
26 | |||
27 | + * libtiff/tif_dirread.c: avoid division by floating point 0 in | ||
28 | + TIFFReadDirEntryCheckedRational() and TIFFReadDirEntryCheckedSrational(), | ||
29 | + and return 0 in that case (instead of infinity as before presumably) | ||
30 | + Apparently some sanitizers do not like those divisions by zero. | ||
31 | + Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2644 | ||
32 | + | ||
33 | +2017-01-11 Even Rouault <even.rouault at spatialys.com> | ||
34 | + | ||
35 | * libtiff/tif_dir.c, tif_dirread.c, tif_dirwrite.c: implement various clampings | ||
36 | of double to other data types to avoid undefined behaviour if the output range | ||
37 | isn't big enough to hold the input value. | ||
38 | Index: tiff-4.0.7/libtiff/tif_dirread.c | ||
39 | =================================================================== | ||
40 | --- tiff-4.0.7.orig/libtiff/tif_dirread.c 2017-04-25 16:14:59.858612730 +0530 | ||
41 | +++ tiff-4.0.7/libtiff/tif_dirread.c 2017-04-25 18:16:21.836111576 +0530 | ||
42 | @@ -2880,7 +2880,10 @@ | ||
43 | m.l = direntry->tdir_offset.toff_long8; | ||
44 | if (tif->tif_flags&TIFF_SWAB) | ||
45 | TIFFSwabArrayOfLong(m.i,2); | ||
46 | - if (m.i[0]==0) | ||
47 | + /* Not completely sure what we should do when m.i[1]==0, but some */ | ||
48 | + /* sanitizers do not like division by 0.0: */ | ||
49 | + /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */ | ||
50 | + if (m.i[0]==0 || m.i[1]==0) | ||
51 | *value=0.0; | ||
52 | else | ||
53 | *value=(double)m.i[0]/(double)m.i[1]; | ||
54 | @@ -2908,7 +2911,10 @@ | ||
55 | m.l=direntry->tdir_offset.toff_long8; | ||
56 | if (tif->tif_flags&TIFF_SWAB) | ||
57 | TIFFSwabArrayOfLong(m.i,2); | ||
58 | - if ((int32)m.i[0]==0) | ||
59 | + /* Not completely sure what we should do when m.i[1]==0, but some */ | ||
60 | + /* sanitizers do not like division by 0.0: */ | ||
61 | + /* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */ | ||
62 | + if ((int32)m.i[0]==0 || m.i[1]==0) | ||
63 | *value=0.0; | ||
64 | else | ||
65 | *value=(double)((int32)m.i[0])/(double)m.i[1]; | ||