Re: [PATCH 0/3] elf: load the main program from AT_EXECFD

Christian Brauner <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <20260715-grummeln-winkelmesser-patentfrei-79ee72ac8856@brauner>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.