mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valdis.Kletnieks@vt.edu
To: Roy Lee <roylee17@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] give elf_check_arch() a chance for checking endian mismatch
Date: Sun, 23 Mar 2008 01:06:00 -0400	[thread overview]
Message-ID: <25483.1206248760@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Thu, 20 Mar 2008 03:03:30 +0800." <000101c889f3$ef5989e0$ce0c9da0$@com>

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

On Thu, 20 Mar 2008 03:03:30 +0800, Roy Lee said:

(Sorry for late reply, catching up finally)

> I'd like to warn for endianess mismatch, or unsupported feature( hardware
> float point support) when loading an ELF file.

> -       if (loc->elf_ex.e_type != ET_EXEC && loc->elf_ex.e_type != ET_DYN)
> -               goto out;
>         if (!elf_check_arch(&loc->elf_ex))
>                 goto out;
> +       if (loc->elf_ex.e_type != ET_EXEC && loc->elf_ex.e_type != ET_DYN)
> +               goto out;

It would seem to me that if it isn't an ET_EXEC or ET_DYN, the question of
whether it passes elf_check_arch() would be rather moot?  In any case, you
don't get to actually *warn* for it, because you end up with a 'goto out'
in either case, and elf_check_arch is a pretty small macro on most archs.

Also, if you change the order there, do you want to also change the order
in load_elf_interp(), where the equivalent test is done? 

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

  reply	other threads:[~2008-03-23  5:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 19:03 Roy Lee
2008-03-23  5:06 ` Valdis.Kletnieks [this message]
2008-03-23  9:41   ` Roy Lee

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=25483.1206248760@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roylee17@gmail.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

all inboxes | Powered by JetHome®