<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 &lt;<a href="mailto:trevor.gamblin@windriver.com">trevor.gamblin@windriver.com</a>&gt; 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>
&gt;<br>
&gt; On 10/25/19 5:22 AM, Trevor Gamblin wrote:<br>
&gt;&gt; Backport upstream fix to zeus.<br>
&gt;&gt;<br>
&gt;&gt; Signed-off-by: Trevor Gamblin &lt;<a href="mailto:trevor.gamblin@windriver.com" target="_blank">trevor.gamblin@windriver.com</a>&gt;<br>
&gt; Does this affect Master?<br>
&gt;<br>
&gt; - armin<br>
&gt;&gt; ---<br>
&gt;&gt;   .../binutils/binutils-2.32.inc                |  1 +<br>
&gt;&gt;   .../binutils/binutils/CVE-2019-17450.patch    | 99 +++++++++++++++++++<br>
&gt;&gt;   2 files changed, 100 insertions(+)<br>
&gt;&gt;   create mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
&gt;&gt;<br>
&gt;&gt; diff --git a/meta/recipes-devtools/binutils/binutils-2.32.inc b/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
&gt;&gt; index 19baf8a883..1e96cf494d 100644<br>
&gt;&gt; --- a/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
&gt;&gt; +++ b/meta/recipes-devtools/binutils/binutils-2.32.inc<br>
&gt;&gt; @@ -49,6 +49,7 @@ SRC_URI = &quot;\<br>
&gt;&gt;        file://CVE-2019-12972.patch \<br>
&gt;&gt;        file://CVE-2019-14250.patch \<br>
&gt;&gt;        file://CVE-2019-14444.patch \<br>
&gt;&gt; +     file://CVE-2019-17450.patch \<br>
&gt;&gt;   &quot;<br>
&gt;&gt;   S  = &quot;${WORKDIR}/git&quot;<br>
&gt;&gt;   <br>
&gt;&gt; diff --git a/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch b/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
&gt;&gt; new file mode 100644<br>
&gt;&gt; index 0000000000..a6ce0b9a8a<br>
&gt;&gt; --- /dev/null<br>
&gt;&gt; +++ b/meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch<br>
&gt;&gt; @@ -0,0 +1,99 @@<br>
&gt;&gt; +From 09dd135df9ebc7a4b640537e23e26a03a288a789 Mon Sep 17 00:00:00 2001<br>
&gt;&gt; +From: Alan Modra &lt;<a href="mailto:amodra@gmail.com" target="_blank">amodra@gmail.com</a>&gt;<br>
&gt;&gt; +Date: Wed, 9 Oct 2019 00:07:29 +1030<br>
&gt;&gt; +Subject: [PATCH] PR25078, stack overflow in function find_abstract_instance<br>
&gt;&gt; +<br>
&gt;&gt; +Selectively backporting fix for bfd/dwarf2.c, but not the ChangeLog<br>
&gt;&gt; +file. There are newer versions of binutils, but none of them contain the<br>
&gt;&gt; +commit fixing CVE-2019-17450, so backport it to master and zeus.<br>
&gt;&gt; +<br>
&gt;&gt; +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>
&gt;&gt; +CVE: CVE-2019-17450<br>
&gt;&gt; +Signed-off-by: Trevor Gamblin &lt;<a href="mailto:trevor.gamblin@windriver.com" target="_blank">trevor.gamblin@windriver.com</a>&gt;<br>
&gt;&gt; +<br>
&gt;&gt; +    PR 25078<br>
&gt;&gt; +    * dwarf2.c (find_abstract_instance): Delete orig_info_ptr, add<br>
&gt;&gt; +    recur_count.  Error on recur_count reaching 100 rather than<br>
&gt;&gt; +    info_ptr matching orig_info_ptr.  Adjust calls.<br>
&gt;&gt; +<br>
&gt;&gt; +---<br>
&gt;&gt; + bfd/dwarf2.c | 35 +++++++++++++++++------------------<br>
&gt;&gt; + 1 file changed, 17 insertions(+), 18 deletions(-)<br>
&gt;&gt; +<br>
&gt;&gt; +diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c<br>
&gt;&gt; +index 0b4e485582..20ec9e2e56 100644<br>
&gt;&gt; +--- a/bfd/dwarf2.c<br>
&gt;&gt; ++++ b/bfd/dwarf2.c<br>
&gt;&gt; +@@ -2803,13 +2803,13 @@ lookup_symbol_in_variable_table (struct comp_unit *unit,<br>
&gt;&gt; + }<br>
&gt;&gt; +<br>
&gt;&gt; + static bfd_boolean<br>
&gt;&gt; +-find_abstract_instance (struct comp_unit *   unit,<br>
&gt;&gt; +-                   bfd_byte *           orig_info_ptr,<br>
&gt;&gt; +-                   struct attribute *   attr_ptr,<br>
&gt;&gt; +-                   const char **        pname,<br>
&gt;&gt; +-                   bfd_boolean *        is_linkage,<br>
&gt;&gt; +-                   char **              filename_ptr,<br>
&gt;&gt; +-                   int *                linenumber_ptr)<br>
&gt;&gt; ++find_abstract_instance (struct comp_unit *unit,<br>
&gt;&gt; ++                   struct attribute *attr_ptr,<br>
&gt;&gt; ++                   unsigned int recur_count,<br>
&gt;&gt; ++                   const char **pname,<br>
&gt;&gt; ++                   bfd_boolean *is_linkage,<br>
&gt;&gt; ++                   char **filename_ptr,<br>
&gt;&gt; ++                   int *linenumber_ptr)<br>
&gt;&gt; + {<br>
&gt;&gt; +   bfd *abfd = unit-&gt;abfd;<br>
&gt;&gt; +   bfd_byte *info_ptr;<br>
&gt;&gt; +@@ -2820,6 +2820,14 @@ find_abstract_instance (struct comp_unit *   unit,<br>
&gt;&gt; +   struct attribute attr;<br>
&gt;&gt; +   const char *name = NULL;<br>
&gt;&gt; +<br>
&gt;&gt; ++  if (recur_count == 100)<br>
&gt;&gt; ++    {<br>
&gt;&gt; ++      _bfd_error_handler<br>
&gt;&gt; ++   (_(&quot;DWARF error: abstract instance recursion detected&quot;));<br>
&gt;&gt; ++      bfd_set_error (bfd_error_bad_value);<br>
&gt;&gt; ++      return FALSE;<br>
&gt;&gt; ++    }<br>
&gt;&gt; ++<br>
&gt;&gt; +   /* DW_FORM_ref_addr can reference an entry in a different CU. It<br>
&gt;&gt; +      is an offset from the .debug_info section, not the current CU.  */<br>
&gt;&gt; +   if (attr_ptr-&gt;form == DW_FORM_ref_addr)<br>
&gt;&gt; +@@ -2939,15 +2947,6 @@ find_abstract_instance (struct comp_unit *   unit,<br>
&gt;&gt; +                                     info_ptr, info_ptr_end);<br>
&gt;&gt; +          if (info_ptr == NULL)<br>
&gt;&gt; +            break;<br>
&gt;&gt; +-         /* It doesn&#39;t ever make sense for DW_AT_specification to<br>
&gt;&gt; +-            refer to the same DIE.  Stop simple recursion.  */<br>
&gt;&gt; +-         if (info_ptr == orig_info_ptr)<br>
&gt;&gt; +-           {<br>
&gt;&gt; +-             _bfd_error_handler<br>
&gt;&gt; +-               (_(&quot;DWARF error: abstract instance recursion detected&quot;));<br>
&gt;&gt; +-             bfd_set_error (bfd_error_bad_value);<br>
&gt;&gt; +-             return FALSE;<br>
&gt;&gt; +-           }<br>
&gt;&gt; +          switch (<a href="http://attr.name" rel="noreferrer" target="_blank">attr.name</a>)<br>
&gt;&gt; +            {<br>
&gt;&gt; +            case DW_AT_name:<br>
&gt;&gt; +@@ -2961,7 +2960,7 @@ find_abstract_instance (struct comp_unit *   unit,<br>
&gt;&gt; +                }<br>
&gt;&gt; +              break;<br>
&gt;&gt; +            case DW_AT_specification:<br>
&gt;&gt; +-             if (!find_abstract_instance (unit, info_ptr, &amp;attr,<br>
&gt;&gt; ++             if (!find_abstract_instance (unit, &amp;attr, recur_count + 1,<br>
&gt;&gt; +                                           &amp;name, is_linkage,<br>
&gt;&gt; +                                           filename_ptr, linenumber_ptr))<br>
&gt;&gt; +                return FALSE;<br>
&gt;&gt; +@@ -3175,7 +3174,7 @@ scan_unit_for_symbols (struct comp_unit *unit)<br>
&gt;&gt; +<br>
&gt;&gt; +            case DW_AT_abstract_origin:<br>
&gt;&gt; +            case DW_AT_specification:<br>
&gt;&gt; +-             if (!find_abstract_instance (unit, info_ptr, &amp;attr,<br>
&gt;&gt; ++             if (!find_abstract_instance (unit, &amp;attr, 0,<br>
&gt;&gt; +                                           &amp;func-&gt;name,<br>
&gt;&gt; +                                           &amp;func-&gt;is_linkage,<br>
&gt;&gt; +                                           &amp;func-&gt;file,<br>
&gt;&gt; +--<br>
&gt;&gt; +2.23.0<br>
&gt;&gt; +<br>
It does, but I&#39;m working on an upgrade for binutils to 2.33 for master <br>
that I&#39;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>