summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2017-8394_1.patch
diff options
context:
space:
mode:
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.patch80
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 @@
1commit 821e6ff6299aa39e841ca50e1ae8a98e3554fd5f
2Author: Alan Modra <amodra@gmail.com>
3Date: 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
14Upstream-Status: Backport
15
16CVE: CVE-2017-8394
17Signed-off-by: Thiruvadi Rajaraman <trajaraman@mvista.com>
18
19
20Index: 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, \
36Index: 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,
56Index: 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),