public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [RFC] elf: Add elf checks for main executable
Date: Thu, 18 Nov 2021 12:08:27 -0800	[thread overview]
Message-ID: <CAMe9rOr_iFjaqSQyOVcPL4pguOoDwK451jRjWVfFPCRQWVtVXQ@mail.gmail.com> (raw)
In-Reply-To: <87wnl5cjwy.fsf@oldenburg.str.redhat.com>

On Thu, Nov 18, 2021 at 12:01 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu:
>
> >  On Thu, Nov 18, 2021 at 11:55 AM Adhemerval Zanella
> > <adhemerval.zanella@linaro.org> wrote:
> >>
> >> The ELF header integrity check is only done on open_verify(), i.e,
> >> for objects explicitly loaded.  For main executable (issued with
> >> execve() for the binary) only kernel checks are done, which does
> >> not check EI_ABIVERSION.
> >
> > I believe the EI_ABIVERSION check on the executable should be
> > done in kernel, not in glibc, so that static PIE can be checked easily.
>
> There is no need to check statically linked binaries.  The kernel does
> not do any relocation processing.  The link editor plus the rest of the
> toolchain can make sure t hat the built-in relocator can process the
> relocations in the program.

You are right.   But if we want to change ld.so on all glibc branches
to check EI_ABIVERSION, won't it be easier to implement something
like DT_REQUIRED, DT_MANDATORY, DT_CRITICAL?

-- 
H.J.

  parent reply	other threads:[~2021-11-18 20:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 19:55 Adhemerval Zanella
2021-11-18 19:58 ` H.J. Lu
2021-11-18 20:00   ` Adhemerval Zanella
2021-11-18 20:01   ` Florian Weimer
2021-11-18 20:03     ` Adhemerval Zanella
2021-11-18 20:08     ` H.J. Lu [this message]
2021-11-19  1:06       ` H.J. Lu
2021-11-18 20:00 ` Florian Weimer
2021-11-18 20:02   ` Adhemerval Zanella
2021-11-18 20:05     ` Florian Weimer

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=CAMe9rOr_iFjaqSQyOVcPL4pguOoDwK451jRjWVfFPCRQWVtVXQ@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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).