Browse code

patch CVE-2017-8421. Bug 1838020

Change-Id: I641eb5c3ac308cc0e2c1e626d725484f2f16af92
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2691
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

Priyesh Padmavilasom authored on 2017/05/17 04:37:11
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+--- a/binutils/objdump.c
1
+@@ -3379,6 +3379,14 @@ dump_relocs_in_section (bfd *abfd,
2
+       return;
3
+     }
4
+ 
5
++  if ((bfd_get_file_flags (abfd) & (BFD_IN_MEMORY | BFD_LINKER_CREATED)) == 0
6
++      && relsize > get_file_size (bfd_get_filename (abfd)))
7
++    {
8
++      printf (" (too many: 0x%x)\n", section->reloc_count);
9
++      bfd_set_error (bfd_error_file_truncated);
10
++      bfd_fatal (bfd_get_filename (abfd));
11
++    }
12
++
13
+   relpp = (arelent **) xmalloc (relsize);
14
+   relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Contains a linker, an assembler, and other tools
2 2
 Name:		binutils
3 3
 Version:	2.28
4
-Release:	1%{?dist}
4
+Release:	2%{?dist}
5 5
 License:	GPLv2+
6 6
 URL:		http://www.gnu.org/software/binutils
7 7
 Group:		System Environment/Base
... ...
@@ -10,6 +10,7 @@ Distribution: 	Photon
10 10
 Source0:	http://ftp.gnu.org/gnu/binutils/%{name}-%{version}.tar.bz2
11 11
 %define sha1 binutils=f8b033731f6baa437d429c60e2623570f1ef9d6b
12 12
 Patch0:         binutils-CVE-2017-6969.patch
13
+Patch1:         binutils-CVE-2017-8421.patch
13 14
 %description
14 15
 The Binutils package contains a linker, an assembler,
15 16
 and other tools for handling object files.
... ...
@@ -22,6 +23,7 @@ for handling compiled objects.
22 22
 %prep
23 23
 %setup -q
24 24
 %patch0 -p1
25
+%patch1 -p1
25 26
 %build
26 27
 install -vdm 755 ../binutils-build
27 28
 cd ../binutils-build
... ...
@@ -189,6 +191,8 @@ make %{?_smp_mflags} check
189 189
 %{_libdir}/libopcodes.so
190 190
 
191 191
 %changelog
192
+*	Tue May 16 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.28-2
193
+-	Patch for CVE-2017-8421
192 194
 *       Thu Apr 06 2017 Anish Swaminathan <anishs@vmware.com> 2.28-1
193 195
 -       Upgraded to version 2.28
194 196
 -       Apply patch for CVE-2017-6969