[PATCH 0/3] elf: load the main program from AT_EXECFD
Christian Brauner
brauner@kernel.org
Wed Jul 15 21:11:22 GMT 2026
On 2026-07-15 21:05 +0900, Andreas K. Huettel wrote:
> Am Mittwoch, 15. Juli 2026, 19:13:02 Japanische Normalzeit schrieb Christian Brauner:
> > A Linux binfmt_misc handler can dispatch a program to a chosen dynamic
> > linker. This is how you run a program under a different or newer ld.so.
> > When the handler is registered with the 'O' (open binary) or 'C'
> > (credentials) flag, the kernel keeps the executed file open across the
> > dispatch. It hands the descriptor to the interpreter in the AT_EXECFD
> > auxiliary vector entry. This is the SVR4 contract. AT_EXECFD is "the
> > file descriptor of the program to load", the alternative to AT_PHDR.
> > FreeBSD's rtld consumes it, and qemu-user has consumed it since 2013.
> >
> > The GNU dynamic linker never has. When such a handler dispatches to
> > ld.so, the descriptor is ignored. It leaks into the new program. ld.so
> > opens the executable again, this time by the path spliced into the
> > argument vector.
>
> No matter where this discussion goes, it's post-release material.
Certainly. I don't remember the release cycle policies, sorry.
More information about the Libc-alpha
mailing list