From: Marco Gerards <metgerards@student.han.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: consolidate ELF header checks
Date: Fri, 04 Feb 2005 22:25:03 +0000 [thread overview]
Message-ID: <87brb03qv4.fsf@marco.marco-g.com> (raw)
In-Reply-To: <20050201044708.GB3969@zulo.hadrons.org> (Guillem Jover's message of "Tue, 1 Feb 2005 05:47:08 +0100")
Guillem Jover <guillem@hadrons.org> writes:
Hi,
> I've spoken with Marco about creating a new elf helper loader module
> so other loaders can share common functions. Maybe later we can add
> a.out or coff helper modules... Or maybe even move most of the
> functionality from dl to the elf module.
>
> This patch merges common ELF header checks. Please test this on PPC
> as I've only tested on x86.
I've done that. I could load linux using this patch after a small
change.
> + if (size < sizeof (Elf_Ehdr))
> + return grub_error (GRUB_ERR_BAD_OS, "ELF size");
Please use a more descriptive error message.
> + return grub_error (GRUB_ERR_BAD_OS, "Generic ELF magic");
Same here.
> - /* Make sure that every section is within the core. */
> - if (size < e->e_shoff + e->e_shentsize * e->e_shnum)
> - return 0;
> + || e->e_machine != EM_386)
> + return grub_error (GRUB_ERR_BAD_OS, "Arch ELF magic");
And here.
> diff -Naupr -x CVS grub2-cvs/loader/powerpc/ieee1275/linux.c grub2.dl/loader/powerpc/ieee1275/linux.c
> --- grub2-cvs/loader/powerpc/ieee1275/linux.c 2005-02-01 04:34:13.000000000 +0100
> +++ grub2.dl/loader/powerpc/ieee1275/linux.c 2005-02-01 04:03:26.000000000 +0100
> + if (grub_dl_check_header (ehdr, sizeof(ehdr)))
The first ehdr should be &ehdr.
As far as I am concerned there are no other issues with this patch.
If someone else has problems with this patch, please tell me.
Otherwise I will commit it soon, if Guillem can fix these issues... :)
Thanks,
Marco
next prev parent reply other threads:[~2005-02-04 22:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-01 4:47 consolidate ELF header checks Guillem Jover
2005-02-01 19:26 ` Marco Gerards
2005-02-04 22:25 ` Marco Gerards [this message]
2005-02-04 22:40 ` Yoshinori K. Okuji
2005-02-05 14:10 ` Marco Gerards
2005-02-05 22:55 ` Yoshinori K. Okuji
2005-02-05 22:45 ` Guillem Jover
2005-02-06 11:02 ` Marco Gerards
2005-02-06 12:58 ` Yoshinori K. Okuji
2005-02-06 14:22 ` Marco Gerards
2005-02-06 21:28 ` Guillem Jover
2005-02-08 12:54 ` Yoshinori K. Okuji
2005-02-09 7:10 ` Guillem Jover
2005-02-10 19:21 ` Yoshinori K. Okuji
2005-02-11 17:25 ` Marco Gerards
2005-02-11 18:07 ` Yoshinori K. Okuji
2005-02-11 18:24 ` Marco Gerards
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=87brb03qv4.fsf@marco.marco-g.com \
--to=metgerards@student.han.nl \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.