<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 25, 2019 at 4:05 PM Trevor Gamblin <<a href="mailto:trevor.gamblin@windriver.com">trevor.gamblin@windriver.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 10/25/19 11:02 AM, akuster808 wrote:<br>
<br>
><br>
> On 10/25/19 5:22 AM, Trevor Gamblin wrote:<br>
>> Backport upstream fix to zeus.<br>
>><br>
>> Signed-off-by: Trevor Gamblin <<a href="mailto:trevor.gamblin@windriver.com" target="_blank">trevor.gamblin@windriver.com</a>><br>
> Does this affect Master?<br>
><br>
> - armin<br>
>> ---<br>
>> .../binutils/binutils-2.32.inc | 1 +<br>
>> .../binutils/binutils/CVE-2019-17450.patch | 99 +++++++++++++++++++<br>
>> 2 files changed, 100 insertions(+)<br>
>> create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
>><br>
>> diff --git a/meta/recipes-devtools/binutils/binutils-2.32.inc b/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
>> index 19baf8a883..1e96cf494d 100644<br>
>> --- a/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
>> +++ b/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
>> @@ -49,6 +49,7 @@ SRC_URI = "\<br>
>> file://CVE-2019-12972.patch \<br>
>> file://CVE-2019-14250.patch \<br>
>> file://CVE-2019-14444.patch \<br>
>> + file://CVE-2019-17450.patch \<br>
>> "<br>
>> S = "${WORKDIR}/git"<br>
>> <br>
>> diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch b/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
>> new file mode 100644<br>
>> index 0000000000..a6ce0b9a8a<br>
>> --- /dev/null<br>
>> +++ b/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
>> @@ -0,0 +1,99 @@<br>
>> +From 09dd135df9ebc7a4b640537e23e26a03a288a789 Mon Sep 17 00:00:00 2001<br>
>> +From: Alan Modra <<a href="mailto:amodra@gmail.com" target="_blank">amodra@gmail.com</a>><br>
>> +Date: Wed, 9 Oct 2019 00:07:29 +1030<br>
>> +Subject: [PATCH] PR25078, stack overflow in function find_abstract_instance<br>
>> +<br>
>> +Selectively backporting fix for bfd/dwarf2.c, but not the ChangeLog<br>
>> +file. There are newer versions of binutils, but none of them contain the<br>
>> +commit fixing CVE-2019-17450, so backport it to master and zeus.<br>
>> +<br>
>> +Upstream-Status: Backport [<a href="https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=063c511bd79" rel="noreferrer" target="_blank">https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=063c511bd79</a>]<br>
>> +CVE: CVE-2019-17450<br>
>> +Signed-off-by: Trevor Gamblin <<a href="mailto:trevor.gamblin@windriver.com" target="_blank">trevor.gamblin@windriver.com</a>><br>
>> +<br>
>> + PR 25078<br>
>> + * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add<br>
>> + recur_count. Error on recur_count reaching 100 rather than<br>
>> + info_ptr matching orig_info_ptr. Adjust calls.<br>
>> +<br>
>> +---<br>
>> + bfd/dwarf2.c | 35 +++++++++++++++++------------------<br>
>> + 1 file changed, 17 insertions(+), 18 deletions(-)<br>
>> +<br>
>> +diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c<br>
>> +index 0b4e485582..20ec9e2e56 100644<br>
>> +--- a/bfd/dwarf2.c<br>
>> ++++ b/bfd/dwarf2.c<br>
>> +@@ -2803,13 +2803,13 @@ lookup_symbol_in_variable_table (struct comp_unit *unit,<br>
>> + }<br>
>> +<br>
>> + static bfd_boolean<br>
>> +-find_abstract_instance (struct comp_unit * unit,<br>
>> +- bfd_byte * orig_info_ptr,<br>
>> +- struct attribute * attr_ptr,<br>
>> +- const char ** pname,<br>
>> +- bfd_boolean * is_linkage,<br>
>> +- char ** filename_ptr,<br>
>> +- int * linenumber_ptr)<br>
>> ++find_abstract_instance (struct comp_unit *unit,<br>
>> ++ struct attribute *attr_ptr,<br>
>> ++ unsigned int recur_count,<br>
>> ++ const char **pname,<br>
>> ++ bfd_boolean *is_linkage,<br>
>> ++ char **filename_ptr,<br>
>> ++ int *linenumber_ptr)<br>
>> + {<br>
>> + bfd *abfd = unit->abfd;<br>
>> + bfd_byte *info_ptr;<br>
>> +@@ -2820,6 +2820,14 @@ find_abstract_instance (struct comp_unit * unit,<br>
>> + struct attribute attr;<br>
>> + const char *name = NULL;<br>
>> +<br>
>> ++ if (recur_count == 100)<br>
>> ++ {<br>
>> ++ _bfd_error_handler<br>
>> ++ (_("DWARF error: abstract instance recursion detected"));<br>
>> ++ bfd_set_error (bfd_error_bad_value);<br>
>> ++ return FALSE;<br>
>> ++ }<br>
>> ++<br>
>> + /* DW_FORM_ref_addr can reference an entry in a different CU. It<br>
>> + is an offset from the .debug_info section, not the current CU. */<br>
>> + if (attr_ptr->form == DW_FORM_ref_addr)<br>
>> +@@ -2939,15 +2947,6 @@ find_abstract_instance (struct comp_unit * unit,<br>
>> + info_ptr, info_ptr_end);<br>
>> + if (info_ptr == NULL)<br>
>> + break;<br>
>> +- /* It doesn't ever make sense for DW_AT_specification to<br>
>> +- refer to the same DIE. Stop simple recursion. */<br>
>> +- if (info_ptr == orig_info_ptr)<br>
>> +- {<br>
>> +- _bfd_error_handler<br>
>> +- (_("DWARF error: abstract instance recursion detected"));<br>
>> +- bfd_set_error (bfd_error_bad_value);<br>
>> +- return FALSE;<br>
>> +- }<br>
>> + switch (<a href="http://attr.name" rel="noreferrer" target="_blank">attr.name</a>)<br>
>> + {<br>
>> + case DW_AT_name:<br>
>> +@@ -2961,7 +2960,7 @@ find_abstract_instance (struct comp_unit * unit,<br>
>> + }<br>
>> + break;<br>
>> + case DW_AT_specification:<br>
>> +- if (!find_abstract_instance (unit, info_ptr, &attr,<br>
>> ++ if (!find_abstract_instance (unit, &attr, recur_count + 1,<br>
>> + &name, is_linkage,<br>
>> + filename_ptr, linenumber_ptr))<br>
>> + return FALSE;<br>
>> +@@ -3175,7 +3174,7 @@ scan_unit_for_symbols (struct comp_unit *unit)<br>
>> +<br>
>> + case DW_AT_abstract_origin:<br>
>> + case DW_AT_specification:<br>
>> +- if (!find_abstract_instance (unit, info_ptr, &attr,<br>
>> ++ if (!find_abstract_instance (unit, &attr, 0,<br>
>> + &func->name,<br>
>> + &func->is_linkage,<br>
>> + &func->file,<br>
>> +--<br>
>> +2.23.0<br>
>> +<br>
It does, but I'm working on an upgrade for binutils to 2.33 for master <br>
that I'll then apply this (and another CVE patch) on top of.</blockquote><div dir="auto"><br></div><div dir="auto">Then sequence it first so it can be backported to Zeus straightforwardly then you can do the 2.33 upgrade </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div></div>