diff options
author | Thiruvadi Rajaraman <trajaraman@mvista.com> | 2017-09-04 16:44:08 +0530 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-07 17:10:07 +0000 |
commit | d827c876357e1ff81a81955f145eaf98247b151f (patch) | |
tree | 6c7622d0f951ec72b3d4ae262181f54c2dd1ea85 /meta/recipes-devtools | |
parent | 742b9c8a28889a01a6055c59c4c5726bf032d617 (diff) | |
download | poky-d827c876357e1ff81a81955f145eaf98247b151f.tar.gz |
binutils: CVE-2017-7303
Source: git://sourceware.org/git/binutils-gdb.git
MR: 74205
Type: Security Fix
Disposition: Backport from binutils-2_28-branch
ChangeID: db5bfb63661d39846c3b03353e1383c621759d48
Description:
Fix seg-fault attempting to strip a corrupt binary.
PR binutils/20922
* elf.c (find_link): Check for null headers before attempting to
match them.
Affects: <= 2.28
Author: Nick Clifton <nickc@redhat.com>
(From OE-Core rev: ef1a98976886560396a514458edb80a21f09b808)
Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
Reviewed-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Armin Kuster <akuster@mvista.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils-2.27.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-7303.patch | 55 |
2 files changed, 56 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.27.inc b/meta/recipes-devtools/binutils/binutils-2.27.inc index 936cdc3c98..b60aa8a69d 100644 --- a/meta/recipes-devtools/binutils/binutils-2.27.inc +++ b/meta/recipes-devtools/binutils/binutils-2.27.inc | |||
@@ -65,6 +65,7 @@ SRC_URI = "\ | |||
65 | file://CVE-2017-7227.patch \ | 65 | file://CVE-2017-7227.patch \ |
66 | file://CVE-2017-7301.patch \ | 66 | file://CVE-2017-7301.patch \ |
67 | file://CVE-2017-7302.patch \ | 67 | file://CVE-2017-7302.patch \ |
68 | file://CVE-2017-7303.patch \ | ||
68 | " | 69 | " |
69 | S = "${WORKDIR}/git" | 70 | S = "${WORKDIR}/git" |
70 | 71 | ||
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-7303.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-7303.patch new file mode 100644 index 0000000000..59a3b17461 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-7303.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | commit a55c9876bb111fd301b4762cf501de0040b8f9db | ||
2 | Author: Nick Clifton <nickc@redhat.com> | ||
3 | Date: Mon Dec 5 13:35:50 2016 +0000 | ||
4 | |||
5 | Fix seg-fault attempting to strip a corrupt binary. | ||
6 | |||
7 | PR binutils/20922 | ||
8 | * elf.c (find_link): Check for null headers before attempting to | ||
9 | match them. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | CVE: CVE-2017-7303 | ||
14 | Signed-off-by: Thiruvadi Rajaraman <tarjaraman@mvista.com> | ||
15 | |||
16 | Index: git/bfd/ChangeLog | ||
17 | =================================================================== | ||
18 | --- git.orig/bfd/ChangeLog 2017-09-04 16:06:08.996688391 +0530 | ||
19 | +++ git/bfd/ChangeLog 2017-09-04 16:09:26.810320541 +0530 | ||
20 | @@ -124,6 +124,10 @@ | ||
21 | (aout_link_add_symbols): Fix off by one error checking for | ||
22 | overflow of string offset. | ||
23 | |||
24 | + PR binutils/20922 | ||
25 | + * elf.c (find_link): Check for null headers before attempting to | ||
26 | + match them. | ||
27 | + | ||
28 | PR binutils/20921 | ||
29 | * aoutx.h (squirt_out_relocs): Check for and report any relocs | ||
30 | that could not be recognised. | ||
31 | Index: git/bfd/elf.c | ||
32 | =================================================================== | ||
33 | --- git.orig/bfd/elf.c 2017-09-04 16:05:55.612577527 +0530 | ||
34 | +++ git/bfd/elf.c 2017-09-04 16:08:35.709900050 +0530 | ||
35 | @@ -1249,13 +1249,19 @@ | ||
36 | Elf_Internal_Shdr ** oheaders = elf_elfsections (obfd); | ||
37 | unsigned int i; | ||
38 | |||
39 | - if (section_match (oheaders[hint], iheader)) | ||
40 | + BFD_ASSERT (iheader != NULL); | ||
41 | + | ||
42 | + /* See PR 20922 for a reproducer of the NULL test. */ | ||
43 | + if (oheaders[hint] != NULL | ||
44 | + && section_match (oheaders[hint], iheader)) | ||
45 | return hint; | ||
46 | |||
47 | for (i = 1; i < elf_numsections (obfd); i++) | ||
48 | { | ||
49 | Elf_Internal_Shdr * oheader = oheaders[i]; | ||
50 | |||
51 | + if (oheader == NULL) | ||
52 | + continue; | ||
53 | if (section_match (oheader, iheader)) | ||
54 | /* FIXME: Do we care if there is a potential for | ||
55 | multiple matches ? */ | ||