Browse code

Bump version to 2.0.0 and Fix CVE-2018-20330

Change-Id: Ic1680c34a092c5a2d8772197063ccb6dc3783bdd
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6561
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

gsujayvmw authored on 2019/01/23 18:09:31
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+diff --git a/turbojpeg.c b/turbojpeg.c
1
+index 90a9ce6a0..3f7cd6406 100644
2
+--- a/turbojpeg.c
3
+@@ -1,5 +1,5 @@
4
+ /*
5
+- * Copyright (C)2009-2018 D. R. Commander.  All Rights Reserved.
6
++ * Copyright (C)2009-2019 D. R. Commander.  All Rights Reserved.
7
+  *
8
+  * Redistribution and use in source and binary forms, with or without
9
+  * modification, are permitted provided that the following conditions are met:
10
+@@ -1960,7 +1960,8 @@ DLLEXPORT unsigned char *tjLoadImage(const char *filename, int *width,
11
+                                      int align, int *height, int *pixelFormat,
12
+                                      int flags)
13
+ {
14
+-  int retval = 0, tempc, pitch;
15
++  int retval = 0, tempc;
16
++  size_t pitch;
17
+   tjhandle handle = NULL;
18
+   tjinstance *this;
19
+   j_compress_ptr cinfo = NULL;
20
+@@ -2013,7 +2014,9 @@ DLLEXPORT unsigned char *tjLoadImage(const char *filename, int *width,
21
+   *pixelFormat = cs2pf[cinfo->in_color_space];
22
+ 
23
+   pitch = PAD((*width) * tjPixelSize[*pixelFormat], align);
24
+-  if ((dstBuf = (unsigned char *)malloc(pitch * (*height))) == NULL)
25
++  if ((unsigned long long)pitch * (unsigned long long)(*height) >
26
++      (unsigned long long)((size_t)-1) ||
27
++      (dstBuf = (unsigned char *)malloc(pitch * (*height))) == NULL)
28
+     _throwg("tjLoadImage(): Memory allocation failure");
29
+ 
30
+   if (setjmp(this->jerr.setjmp_buffer)) {
31
+
... ...
@@ -1,17 +1,17 @@
1 1
 Summary:        fork of the original IJG libjpeg which uses SIMD.
2 2
 Name:           libjpeg-turbo
3
-Version:        1.5.2
4
-Release:        2%{?dist}
3
+Version:        2.0.0
4
+Release:        1%{?dist}
5 5
 License:        IJG
6 6
 URL:            http://sourceforge.net/projects/libjpeg-turbo
7 7
 Group:          System Environment/Libraries
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 Source0:        http://downloads.sourceforge.net/libjpeg-turbo/%{name}-%{version}.tar.gz
11
-%define sha1    libjpeg-turbo=e788f6defa58b4393a5e1685c018f3b962971457
12
-Patch0:         libjpeg-turbo-CVE-2017-15232-1.patch
13
-Patch1:         libjpeg-turbo-CVE-2017-15232-2.patch
11
+%define sha1    libjpeg-turbo=6d74b609294b6bae5a7cde035f7d6b80d60ebb77
12
+Patch0:         libjpeg-turbo-CVE-2018-20330.patch
14 13
 BuildRequires:  nasm
14
+BuildRequires:  cmake
15 15
 Requires:       nasm
16 16
 %description
17 17
 libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to accelerate baseline JPEG compression and decompression. libjpeg is a library that implements JPEG image encoding, decoding and transcoding.
... ...
@@ -20,21 +20,24 @@ libjpeg-turbo is a fork of the original IJG libjpeg which uses SIMD to accelerat
20 20
 Summary:        Header and development files
21 21
 Requires:       %{name} = %{version}-%{release}
22 22
 %description    devel
23
-It contains the libraries and header files to create applications 
23
+It contains the libraries and header files to create applications
24 24
 
25 25
 %prep
26 26
 %setup -q
27 27
 %patch0 -p1
28
-%patch1 -p1
28
+
29 29
 %build
30
-./configure \
31
-    --prefix=%{_prefix} \
32
-    --disable-static \
33
-    --mandir=/usr/share/man \
34
-    --with-jpeg8
30
+mkdir -p build
31
+cd build
32
+cmake \
33
+      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
34
+      -DCMAKE_SKIP_RPATH:BOOL=YES \
35
+      -DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
36
+      -DENABLE_STATIC:BOOL=NO ..
35 37
 make %{?_smp_mflags}
36 38
 
37 39
 %install
40
+cd build
38 41
 make DESTDIR=%{buildroot} install
39 42
 find %{buildroot} -name '*.la' -delete
40 43
 
... ...
@@ -47,16 +50,19 @@ find %{buildroot} -name '*.la' -delete
47 47
 %files
48 48
 %defattr(-,root,root)
49 49
 %{_bindir}/*
50
-%{_libdir}/*.so.*
50
+/usr/lib64/*.so*
51 51
 %{_datadir}/*
52 52
 
53 53
 %files devel
54 54
 %defattr(-,root,root)
55 55
 %{_includedir}/*
56
-%{_libdir}/*.so
57
-%{_libdir}/pkgconfig/*.pc
56
+#%{_libdir}/*.so
57
+#%{_libdir}/pkgconfig/*.pc
58
+/usr/lib64/pkgconfig/*.pc
58 59
 
59 60
 %changelog
61
+*   Tue Jan 22 2019 Sujay G <gsujay@vmware.com> 2.0.0-1
62
+-   Bump version to 2.0.0 and Fix CVE-2018-20330
60 63
 *   Mon Dec 11 2017 Xiaolin Li <xiaolinl@vmware.com> 1.5.2-2
61 64
 -   Fix CVE-2017-15232
62 65
 *   Wed Aug 09 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.5.2-1