diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-7304.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-7304.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-7304.patch new file mode 100644 index 0000000000..817a3f0176 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-7304.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | commit 4f3ca05b487e9755018b4c9a053a2e6c35d8a7df | ||
2 | Author: Nick Clifton <nickc@redhat.com> | ||
3 | Date: Tue Dec 6 16:53:57 2016 +0000 | ||
4 | |||
5 | Fix seg-fault in strip when copying a corrupt binary. | ||
6 | |||
7 | PR binutils/20931 | ||
8 | * elf.c (copy_special_section_fields): Check for an invalid | ||
9 | sh_link field before attempting to follow it. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | CVE: CVE-2017-7304 | ||
14 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
15 | |||
16 | Index: git/bfd/ChangeLog | ||
17 | =================================================================== | ||
18 | --- git.orig/bfd/ChangeLog 2017-09-04 16:13:03.512095249 +0530 | ||
19 | +++ git/bfd/ChangeLog 2017-09-04 16:16:25.173745111 +0530 | ||
20 | @@ -114,6 +114,12 @@ | ||
21 | (bfd_elf_final_link): Only initialize the extended symbol index | ||
22 | section if there are extended symbol tables to list. | ||
23 | |||
24 | + 2016-12-06 Nick Clifton <nickc@redhat.com> | ||
25 | + | ||
26 | + PR binutils/20931 | ||
27 | + * elf.c (copy_special_section_fields): Check for an invalid | ||
28 | + sh_link field before attempting to follow it. | ||
29 | + | ||
30 | 2016-12-05 Nick Clifton <nickc@redhat.com> | ||
31 | |||
32 | PR binutils/20905 | ||
33 | Index: git/bfd/elf.c | ||
34 | =================================================================== | ||
35 | --- git.orig/bfd/elf.c 2017-09-04 16:13:03.512095249 +0530 | ||
36 | +++ git/bfd/elf.c 2017-09-04 16:15:38.257359045 +0530 | ||
37 | @@ -1324,6 +1324,16 @@ | ||
38 | in the input bfd. */ | ||
39 | if (iheader->sh_link != SHN_UNDEF) | ||
40 | { | ||
41 | + /* See PR 20931 for a reproducer. */ | ||
42 | + if (iheader->sh_link >= elf_numsections (ibfd)) | ||
43 | + { | ||
44 | + (* _bfd_error_handler) | ||
45 | + /* xgettext:c-format */ | ||
46 | + (_("%B: Invalid sh_link field (%d) in section number %d"), | ||
47 | + ibfd, iheader->sh_link, secnum); | ||
48 | + return FALSE; | ||
49 | + } | ||
50 | + | ||
51 | sh_link = find_link (obfd, iheaders[iheader->sh_link], iheader->sh_link); | ||
52 | if (sh_link != SHN_UNDEF) | ||
53 | { | ||