Re: patch: VFS: fix passing of AT_PHDR value in auxv to ELF interpreter

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: Quentin Godfroy <godfroy@...>, <linux-kernel@...>, Alexander Viro <viro@...>, linux-fsdevel <linux-fsdevel@...>, David A. Madore <David.Madore@...>, Eric W. Biederman <ebiederm@...>
Date: Sunday, May 6, 2007 - 7:43 pm

On Fri, May 04, 2007 at 09:24:05PM -0700, Jeremy Fitzhardinge wrote:

Indeed. And it has the advantage to work for prelinked objects. (but I
have to understand anyway how does the kernel handles prelinked (or not) pie
executables)

>

No, of course, but in my case I wanted to build an executable with a
modified rpath. I had to add a new PT_LOAD segment. To do so, as the
program header is generally located at the very beginning of the
executable, I had to copy it to the end, and so the address where it was
loaded was completely different.

The load address was typically 0x08048000, and the phdr location was
0x0804a570. But the kernel gave to the ld.so in the auxv the addr
0x08048570 for the phdr. And it provoked a segfault because of the .bss
which was between the segments. (and even if there was no .bss, it would
have worked only by chance because the segments could all fit in a page
of 4kb)

Quentin
-

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: patch: VFS: fix passing of AT_PHDR value in auxv to ELF ..., Jeremy Fitzhardinge, (Fri May 4, 7:31 pm)
Re: patch: VFS: fix passing of AT_PHDR value in auxv to ELF ..., Jeremy Fitzhardinge, (Sat May 5, 12:24 am)
Re: patch: VFS: fix passing of AT_PHDR value in auxv to ELF ..., Quentin Godfroy, (Sun May 6, 7:43 pm)