summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch')
-rw-r--r--meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch79
1 files changed, 0 insertions, 79 deletions
diff --git a/meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch b/meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch
deleted file mode 100644
index cfeb1ca13c..0000000000
--- a/meta/recipes-devtools/elfutils/files/CVE-2018-16062.patch
+++ /dev/null
@@ -1,79 +0,0 @@
1From 29e31978ba51c1051743a503ee325b5ebc03d7e9 Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Sat, 18 Aug 2018 13:27:48 +0200
4Subject: [PATCH] libdw, readelf: Make sure there is enough data to read full
5 aranges header.
6
7dwarf_getaranges didn't check if there was enough data left to read both
8the address and segment size. readelf didn't check there was enough data
9left to read the segment size.
10
11https://sourceware.org/bugzilla/show_bug.cgi?id=23541
12
13CVE: CVE-2018-16062
14Upstream-Status: Backport
15
16Signed-off-by: Mark Wielaard <mark@klomp.org>
17---
18 libdw/ChangeLog | 5 +++++
19 libdw/dwarf_getaranges.c | 4 ++++
20 src/ChangeLog | 5 +++++
21 src/readelf.c | 2 ++
22 4 files changed, 16 insertions(+)
23
24diff --git a/libdw/ChangeLog b/libdw/ChangeLog
25index cb4f34e..472d922 100644
26--- a/libdw/ChangeLog
27+++ b/libdw/ChangeLog
28@@ -1,3 +1,8 @@
29+2018-08-18 Mark Wielaard <mark@klomp.org>
30+
31+ * dwarf_getaranges.c (dwarf_getaranges.c): Make sure there is enough
32+ data to read the address and segment size.
33+
34 2018-06-28 Mark Wielaard <mark@klomp.org>
35
36 * dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
37diff --git a/libdw/dwarf_getaranges.c b/libdw/dwarf_getaranges.c
38index bff9c86..de5b81b 100644
39--- a/libdw/dwarf_getaranges.c
40+++ b/libdw/dwarf_getaranges.c
41@@ -148,6 +148,10 @@ dwarf_getaranges (Dwarf *dbg, Dwarf_Aranges **aranges, size_t *naranges)
42 length_bytes, &offset, IDX_debug_info, 4))
43 goto fail;
44
45+ /* Next up two bytes for address and segment size. */
46+ if (readp + 2 > readendp)
47+ goto invalid;
48+
49 unsigned int address_size = *readp++;
50 if (unlikely (address_size != 4 && address_size != 8))
51 goto invalid;
52diff --git a/src/ChangeLog b/src/ChangeLog
53index 8c89f83..2f9f774 100644
54--- a/src/ChangeLog
55+++ b/src/ChangeLog
56@@ -1,3 +1,8 @@
57+2018-08-18 Mark Wielaard <mark@klomp.org>
58+
59+ * readelf.c (print_debug_aranges_section): Make sure there is enough
60+ data to read the header segment size.
61+
62 2018-06-25 Mark Wielaard <mark@klomp.org>
63
64 * readelf.c (print_decoded_line_section): Use dwarf_next_lines
65diff --git a/src/readelf.c b/src/readelf.c
66index 7b5707f..7b488ac 100644
67--- a/src/readelf.c
68+++ b/src/readelf.c
69@@ -5447,6 +5447,8 @@ print_debug_aranges_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
70 goto next_table;
71 }
72
73+ if (readp + 1 > readendp)
74+ goto invalid_data;
75 unsigned int segment_size = *readp++;
76 printf (gettext (" Segment size: %6" PRIu64 "\n\n"),
77 (uint64_t) segment_size);
78--
792.9.3