linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Geyslan G. Bem" <geyslan@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-br@googlegroups.com
Subject: Re: [PATCH v2] fs: binfmt_elf: Add ELF header consistency checks
Date: Thu, 21 Nov 2013 01:39:19 +0000	[thread overview]
Message-ID: <20131121013918.GI10323@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1384994071-12283-1-git-send-email-geyslan@gmail.com>

On Wed, Nov 20, 2013 at 09:34:31PM -0300, Geyslan G. Bem wrote:
> The member 'e_ehsize' that holds the ELF header size is compared
> with the elfhdr struct size. If not equal, goes out.
> If 'e_phoff' holds 0 the object has no program header table, so
> goes out.
> Ensures the file being loaded has the correct data encoding, checking
> 'e_ident[EI_DATA]' against 'ELF_DATA'.
> 
> Besides the checks being in accordance with the ELF Specifications,
> they increase the binary consistency reducing the use of malformed ones.

This is completely misguided.  We are allowed to reject such binaries,
but what's the point of doing that?

  reply	other threads:[~2013-11-21  1:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-21  0:34 [PATCH v2] fs: binfmt_elf: Add ELF header consistency checks Geyslan G. Bem
2013-11-21  1:39 ` Al Viro [this message]
2013-11-21 10:52   ` Geyslan Gregório Bem
2013-11-22  9:45     ` Geyslan Gregório Bem

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=20131121013918.GI10323@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=geyslan@gmail.com \
    --cc=kernel-br@googlegroups.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 NNTP newsgroup(s).