public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: [PATCH] libelf: Allow updating phdrs for any e_type.
Date: Mon, 11 Jul 2016 09:57:46 +0200	[thread overview]
Message-ID: <1468223866.7820.19.camel@redhat.com> (raw)
In-Reply-To: 1467812778-15633-1-git-send-email-mjw@redhat.com

[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]

On Wed, 2016-07-06 at 15:46 +0200, Mark Wielaard wrote:
> elf[32|64]_updatenull would sanity check the e_type before allowing to
> update the phdrs. This prevents creating an ET_REL file with phdrs. It
> also prevents creating any vendor specific ELF file having phdrs. We
> only check this when updating/writing out the file. But we would just
> in such file. Don't prevent people from creating unexpected ELF files.
> elflint will warn for such files.
> 
> While writing a new testcase for this another bug was found that
> prevented updating a just created phdr because elf_getphdrnum would
> sanity check the phdr offset in the file (which doesn't exist yet).
> Fix that by only doing such a sanity check if the phdrs haven't been
> read in or created yet.
> 
> This second bug should have been found by the existing elfshphehdr
> test, but that test contained a typo checking elf_getphdrnum.
> It tested that the called failed when there were no phdrs, but then
> elf_getphdrnum should simply succeed and return zero.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1352232

I pushed this to master.

             reply	other threads:[~2016-07-11  7:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  7:57 Mark Wielaard [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-07-06 13:46 Mark Wielaard

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=1468223866.7820.19.camel@redhat.com \
    --to=mjw@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /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).