From: Will Newton <will.newton@linaro.org>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Patch Tracking <patches@linaro.org>
Subject: Re: [PATCH] gdb/dwarf2read.c: Sanity check DW_AT_sibling values.
Date: Tue, 05 Nov 2013 13:36:00 -0000 [thread overview]
Message-ID: <CANu=DmiydWzcKLfYe_J7TUVEDizPziM_2kUMoajBKvp5BFF7hQ@mail.gmail.com> (raw)
In-Reply-To: <8761s8w46p.fsf@fleche.redhat.com>
On 4 November 2013 15:57, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Will" == Will Newton <will.newton@linaro.org> writes:
>
> Will> When reading objects with corrupt debug information it is possible that
> Will> the sibling chain can form a loop, which leads to an infinite loop and
> Will> memory exhaustion.
>
> Will> Avoid this situation by disregarding and DW_AT_sibling values that point
> Will> to a lower address than the current entry.
>
> Thanks for doing this.
>
> Will> + const gdb_byte *sibling_ptr = buffer + dwarf2_get_ref_die_offset (&attr).sect_off;
>
> This line is too long, it should be split somewhere.
Thanks, I'll fix these.
> Will> + if (sibling_ptr < info_ptr)
> Will> + complaint (&symfile_complaints,
> Will> + _("DW_AT_sibling points backwards"));
>
> I wonder whether the check should be "<=".
I'm not sure. It looks to me that info_ptr at this point will point to
the next attribute/DIE which could be a valid sibling?
--
Will Newton
Toolchain Working Group, Linaro
next prev parent reply other threads:[~2013-11-05 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-01 21:21 Will Newton
2013-11-04 15:57 ` Tom Tromey
2013-11-05 13:36 ` Will Newton [this message]
2013-11-05 17:23 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANu=DmiydWzcKLfYe_J7TUVEDizPziM_2kUMoajBKvp5BFF7hQ@mail.gmail.com' \
--to=will.newton@linaro.org \
--cc=gdb-patches@sourceware.org \
--cc=patches@linaro.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox