diff options
author | Thiruvadi Rajaraman <trajaraman@mvista.com> | 2017-09-20 13:22:09 +0530 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-07 17:10:08 +0000 |
commit | 226c2fd1f720da30abf906179c64061e9f121dfc (patch) | |
tree | d2233a3df2b98689fae0eeafa491db14d41ba6e1 /meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch | |
parent | fdee751f82a4299b0ac0bdc42708f6253e950505 (diff) | |
download | poky-226c2fd1f720da30abf906179c64061e9f121dfc.tar.gz |
binutils: CVE-2017-8394
Source: git://sourceware.org/git/binutils-gdb.git
MR: 74166
Type: Security Fix
Disposition: Backport from binutils-2_29
ChangeID: d614742d33a55da6cafede60cd171766afb0aa1d
Description:
PR 21414, null pointer deref of _bfd_elf_large_com_section sym
PR 21414
* section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
* elf.c (lcomm_sym): New.
(_bfd_elf_large_com_section): Use lcomm_sym section symbol.
* bfd-in2.h: Regenerate.
Affects: <= 2.29
Author: Alan Modra <amodra@gmail.com>
(From OE-Core rev: 0d6e08ffc4760947653ad9368d594074d506f697)
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/binutils/binutils/CVE-2017-8394_1.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch b/meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch new file mode 100644 index 0000000000..e1dfd8bb40 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | commit 821e6ff6299aa39e841ca50e1ae8a98e3554fd5f | ||
2 | Author: Alan Modra <amodra@gmail.com> | ||
3 | Date: Wed Oct 12 09:41:33 2016 +1030 | ||
4 | |||
5 | BFD_FAKE_SECTION macro params | ||
6 | |||
7 | Order NAME, IDX, FLAGS as per STD_SECTION macro. | ||
8 | |||
9 | * section.c (BFD_FAKE_SECTION): Reorder parameters. Formatting. | ||
10 | (STD_SECTION): Adjust to suit. | ||
11 | * elf.c (_bfd_elf_large_com_section): Likewise. | ||
12 | * bfd-in2.h: Regenerate. | ||
13 | |||
14 | Upstream-Status: Backport | ||
15 | |||
16 | CVE: CVE-2017-8394 | ||
17 | Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com> | ||
18 | |||
19 | |||
20 | Index: git/bfd/bfd-in2.h | ||
21 | =================================================================== | ||
22 | --- git.orig/bfd/bfd-in2.h 2017-09-20 12:54:42.423465338 +0530 | ||
23 | +++ git/bfd/bfd-in2.h 2017-09-20 13:02:48.000000000 +0530 | ||
24 | @@ -1767,9 +1767,9 @@ | ||
25 | #define bfd_section_removed_from_list(ABFD, S) \ | ||
26 | ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) | ||
27 | |||
28 | -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ | ||
29 | +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ | ||
30 | /* name, id, index, next, prev, flags, user_set_vma, */ \ | ||
31 | - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ | ||
32 | + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ | ||
33 | \ | ||
34 | /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ | ||
35 | 0, 0, 1, 0, \ | ||
36 | Index: git/bfd/elf.c | ||
37 | =================================================================== | ||
38 | --- git.orig/bfd/elf.c 2017-09-20 12:54:44.503474440 +0530 | ||
39 | +++ git/bfd/elf.c 2017-09-20 13:02:48.000000000 +0530 | ||
40 | @@ -10984,10 +10984,12 @@ | ||
41 | return n; | ||
42 | } | ||
43 | |||
44 | -/* It is only used by x86-64 so far. */ | ||
45 | +/* It is only used by x86-64 so far. | ||
46 | + ??? This repeats *COM* id of zero. sec->id is supposed to be unique, | ||
47 | + but current usage would allow all of _bfd_std_section to be zero. t*/ | ||
48 | asection _bfd_elf_large_com_section | ||
49 | - = BFD_FAKE_SECTION (_bfd_elf_large_com_section, | ||
50 | - SEC_IS_COMMON, NULL, "LARGE_COMMON", 0); | ||
51 | + = BFD_FAKE_SECTION (_bfd_elf_large_com_section, NULL, | ||
52 | + "LARGE_COMMON", 0, SEC_IS_COMMON); | ||
53 | |||
54 | void | ||
55 | _bfd_elf_post_process_headers (bfd * abfd, | ||
56 | Index: git/bfd/section.c | ||
57 | =================================================================== | ||
58 | --- git.orig/bfd/section.c 2017-09-20 12:54:43.815471454 +0530 | ||
59 | +++ git/bfd/section.c 2017-09-20 13:02:48.000000000 +0530 | ||
60 | @@ -700,9 +700,9 @@ | ||
61 | .#define bfd_section_removed_from_list(ABFD, S) \ | ||
62 | . ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) | ||
63 | . | ||
64 | -.#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ | ||
65 | +.#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ | ||
66 | . {* name, id, index, next, prev, flags, user_set_vma, *} \ | ||
67 | -. { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ | ||
68 | +. { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ | ||
69 | . \ | ||
70 | . {* linker_mark, linker_has_input, gc_mark, decompress_status, *} \ | ||
71 | . 0, 0, 1, 0, \ | ||
72 | @@ -764,7 +764,7 @@ | ||
73 | }; | ||
74 | |||
75 | #define STD_SECTION(NAME, IDX, FLAGS) \ | ||
76 | - BFD_FAKE_SECTION(_bfd_std_section[IDX], FLAGS, &global_syms[IDX], NAME, IDX) | ||
77 | + BFD_FAKE_SECTION(_bfd_std_section[IDX], &global_syms[IDX], NAME, IDX, FLAGS) | ||
78 | |||
79 | asection _bfd_std_section[] = { | ||
80 | STD_SECTION (BFD_COM_SECTION_NAME, 0, SEC_IS_COMMON), | ||