[PATCH 1/3] elf: load the main program from AT_EXECFD when run as a binfmt interpreter
Florian Weimer
fweimer@redhat.com
Wed Jul 15 11:10:18 GMT 2026
* Christian Brauner:
> +struct link_map *
> +_dl_map_object_execfd (int fd, const char *name)
> +{
> + struct filebuf fb;
> + bool found_other_class = false;
> +
> + /* The kernel hands over the descriptor with the file position at
> + zero, but an explicit loader invocation need not; the header check
> + in open_verify reads sequentially. */
> + __lseek (fd, 0, SEEK_SET);
This does not seem quite right. If we need to deal with weird file
pointers in shared files, we can't use read(v) for reading data, and
would have to use pread(v) instead.
Thanks,
Florian
More information about the Libc-alpha
mailing list