Re: [PATCH 1/3] elf: load the main program from AT_EXECFD when run as a binfmt interpreter
Florian Weimer <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
* 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