[Toybox] [Nommu] Week ending June 27ish.
Rich Felker
dalias at libc.org
Thu Jul 2 09:13:37 PDT 2015
On Thu, Jul 02, 2015 at 10:44:26AM -0400, Christopher Covington wrote:
> Hi Rob,
>
> On 06/29/2015 04:26 PM, Rob Landley wrote:
> > On 06/28/2015 09:57 PM, Rich Felker wrote:
>
> >> but the latter could be dangerous not to have setup right.
> >> I *think* (this needs checking) the new thread created manually by
> >> clone will use the same TLS pointer as the thread that called clone.
> >> In this case, libc internals will potentially be reading and writing
> >> the same data, without any synchronization.
> >
> > See "decided to just use fork(), which means re-exec /proc/self/exe as
> > necessary because exec(NULL) doesn't re-exec yourself despite multiple
> > proposals over the year that the kernel just DO that since the kernel
> > knows the right inode even if proc isn't mounted"...
>
> Is the following much different from the desired exec(NULL) behavior you're
> describing?
>
> > For example, if you have an open file descriptor on an executable file, you
> > can execute it by calling execveat(), passing the file descriptor, an empty
> > path, and the AT_EMPTY_PATH flag.
>
> https://lwn.net/Articles/649115/
It doesn't help, because a program does not have an open file
descriptor to its executable file. Obtaining one is just as hard as
obtaining a pathname (or using /proc/self/exe).
Rich
1435853617.0
More information about the Toybox
mailing list