aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils/CVE-2017-14932.patch
blob: a436031dc291065ef49596744e52e3ac6f1eab08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From e338894dc2e603683bed2172e8e9f25b29051005 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Tue, 26 Sep 2017 09:32:18 +0930
Subject: [PATCH] PR22204, Lack of DW_LNE_end_sequence causes "infinite" loop

	PR 22204
	* dwarf2.c (decode_line_info): Ensure line_ptr stays within
	bounds in inner loop.

Upstream-Status: Backport
Affects: <= 2.29.1
CVE: CVE-2017-14932
Signed-off-by: Armin Kuster <akuster@mvista.com>

---
 bfd/ChangeLog | 6 ++++++
 bfd/dwarf2.c  | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: git/bfd/dwarf2.c
===================================================================
--- git.orig/bfd/dwarf2.c
+++ git/bfd/dwarf2.c
@@ -2269,7 +2269,7 @@ decode_line_info (struct comp_unit *unit
       bfd_vma high_pc = 0;
 
       /* Decode the table.  */
-      while (! end_sequence)
+      while (!end_sequence && line_ptr < line_end)
 	{
 	  op_code = read_1_byte (abfd, line_ptr, line_end);
 	  line_ptr += 1;
Index: git/bfd/ChangeLog
===================================================================
--- git.orig/bfd/ChangeLog
+++ git/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-09-26  Alan Modra  <amodra@gmail.com>
+
+       PR 22204
+       * dwarf2.c (decode_line_info): Ensure line_ptr stays within
+       bounds in inner loop.
+
 2017-09-24  Alan Modra  <amodra@gmail.com>
 
        PR 22191