diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch new file mode 100644 index 0000000000..da3bd37e87 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-9955_5.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | From 7211ae501eb0de1044983f2dfb00091a58fbd66c Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Modra <amodra@gmail.com> | ||
3 | Date: Tue, 27 Jun 2017 09:45:04 +0930 | ||
4 | Subject: [PATCH] More fixes for bfd_get_section_contents change | ||
5 | |||
6 | PR binutils/21665 | ||
7 | * libbfd.c (_bfd_generic_get_section_contents): Delete abort. | ||
8 | Use unsigned file pointer type, and remove cast. | ||
9 | * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise. | ||
10 | Add "count", not "sz". | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | CVE: CVE-2017-9955 #5 | ||
14 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
15 | |||
16 | --- | ||
17 | bfd/ChangeLog | 8 ++++++++ | ||
18 | bfd/libbfd.c | 18 ++++-------------- | ||
19 | 2 files changed, 12 insertions(+), 14 deletions(-) | ||
20 | |||
21 | Index: git/bfd/ChangeLog | ||
22 | =================================================================== | ||
23 | --- git.orig/bfd/ChangeLog | ||
24 | +++ git/bfd/ChangeLog | ||
25 | @@ -1,3 +1,11 @@ | ||
26 | +2017-06-27 Alan Modra <amodra@gmail.com> | ||
27 | + | ||
28 | + PR binutils/21665 | ||
29 | + * libbfd.c (_bfd_generic_get_section_contents): Delete abort. | ||
30 | + Use unsigned file pointer type, and remove cast. | ||
31 | + * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise. | ||
32 | + Add "count", not "sz". | ||
33 | + | ||
34 | 2017-06-26 Pedro Alves <palves@redhat.com> | ||
35 | |||
36 | PR binutils/21665 | ||
37 | Index: git/bfd/libbfd.c | ||
38 | =================================================================== | ||
39 | --- git.orig/bfd/libbfd.c | ||
40 | +++ git/bfd/libbfd.c | ||
41 | @@ -780,7 +780,7 @@ _bfd_generic_get_section_contents (bfd * | ||
42 | bfd_size_type count) | ||
43 | { | ||
44 | bfd_size_type sz; | ||
45 | - file_ptr filesz; | ||
46 | + ufile_ptr filesz; | ||
47 | if (count == 0) | ||
48 | return TRUE; | ||
49 | |||
50 | @@ -804,14 +804,9 @@ _bfd_generic_get_section_contents (bfd * | ||
51 | else | ||
52 | sz = section->size; | ||
53 | filesz = bfd_get_file_size (abfd); | ||
54 | - if (filesz < 0) | ||
55 | - { | ||
56 | - /* This should never happen. */ | ||
57 | - abort (); | ||
58 | - } | ||
59 | if (offset + count < count | ||
60 | || offset + count > sz | ||
61 | - || (section->filepos + offset + count) > (bfd_size_type) filesz) | ||
62 | + || section->filepos + offset + count > filesz) | ||
63 | { | ||
64 | bfd_set_error (bfd_error_invalid_operation); | ||
65 | return FALSE; | ||
66 | @@ -834,7 +829,7 @@ _bfd_generic_get_section_contents_in_win | ||
67 | { | ||
68 | #ifdef USE_MMAP | ||
69 | bfd_size_type sz; | ||
70 | - file_ptr filesz; | ||
71 | + ufile_ptr filesz; | ||
72 | |||
73 | if (count == 0) | ||
74 | return TRUE; | ||
75 | @@ -868,13 +863,8 @@ _bfd_generic_get_section_contents_in_win | ||
76 | else | ||
77 | sz = section->size; | ||
78 | filesz = bfd_get_file_size (abfd); | ||
79 | - if (filesz < 0) | ||
80 | - { | ||
81 | - /* This should never happen. */ | ||
82 | - abort (); | ||
83 | - } | ||
84 | if (offset + count > sz | ||
85 | - || (section->filepos + offset + sz) > (bfd_size_type) filesz | ||
86 | + || section->filepos + offset + count > filesz | ||
87 | || ! bfd_get_file_window (abfd, section->filepos + offset, count, w, | ||
88 | TRUE)) | ||
89 | return FALSE; | ||