Re: [PATCH 1/3] elf: load the main program from AT_EXECFD when run as a binfmt interpreter
Christian Brauner <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <20260715-zugemacht-unzweifelhaft-inhuman-50e9fff85246@brauner> |
On 2026-07-15 13:10 +0200, Florian Weimer wrote:
> * 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.
Yes, I'll switch to pread().