public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Willgerodt, Felix" <felix.willgerodt@intel.com>
Cc: Keith Seitz <keiths@redhat.com>,
	 "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/1] gdb: Fix segfault with a negative .dynamic section size
Date: Mon, 13 Nov 2023 10:15:36 -0700	[thread overview]
Message-ID: <87fs19tw07.fsf@tromey.com> (raw)
In-Reply-To: <MN2PR11MB4566F86D474588F0F1E358F18EB3A@MN2PR11MB4566.namprd11.prod.outlook.com> (Felix Willgerodt's message of "Mon, 13 Nov 2023 09:58:14 +0000")

>>>>> Willgerodt, Felix <felix.willgerodt@intel.com> writes:

> BFD: warning: bin/poc has a section extending past end of file
> Reading symbols from poc...       
                                                                                               
> warning: Loadable section ".dynamic" outside of ELF segments
>   in bin/poc                                                                    
                                                                                               
> warning: Discarding section .dynamic which has a section size (fffffffa40) larger than the file size [in module bin/poc]

> About size validation:
> I don't see how we can realistically do that. We don't want to restrict
> users that have a big binary and enough system memory.
> Nor do I see any indication that this is a real world problem right now,
> and that there are users with a big .dynamic section that experience
> memory pressure and still want to debug.
> To me the state with my patch is good enough. There are warnings
> to figure this out easily. And we even get the backtrace now.

It seems from the above that BFD is doing some simple sanity checks,
like a section cannot be larger than the file.  So maybe gdb could
replicate or reuse these.

Tom

  reply	other threads:[~2023-11-13 17:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  9:16 Felix Willgerodt
2023-11-10 19:00 ` Keith Seitz
2023-11-13  9:58   ` Willgerodt, Felix
2023-11-13 17:15     ` Tom Tromey [this message]
2023-11-14 15:41       ` Willgerodt, Felix
2023-11-14 16:29         ` Tom Tromey
2023-11-15  8:51           ` Willgerodt, Felix
2023-11-15 14:52             ` Tom Tromey
2023-11-13 15:59   ` Willgerodt, Felix
2023-11-13 17:16 ` 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=87fs19tw07.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=felix.willgerodt@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).