[RFC] elf: Add elf checks for main executable
Adhemerval Zanella
adhemerval.zanella@linaro.org
Thu Nov 18 20:03:29 GMT 2021
On 18/11/2021 17:01, Florian Weimer 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.
I was not really thinking about the relocation process itself, but
that the EI_ABIVERSION might advertise different things for different
libcs and the kernel should be agnostic regarding it.
More information about the Libc-alpha
mailing list