Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1726574
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: execve(NULL, argv, envp) for nommu? |
| Date | 2017-09-05 11:10 +0200 |
| Message-ID | <umi1P-Ly-5@gated-at.bofh.it> (permalink) |
| References | <umi1P-Ly-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
CC Oleg, lkml On Tue, Sep 5, 2017 at 9:34 AM, Rob Landley <rob@landley.net> wrote: > For years I've wanted an execve() system call modification that let me > pass a NULL as the first argument to say "re-exec this program please". > Because on nommu you've got to exec something to unblock vfork(), and > daemons (or things like busybox and toybox) want to re-exec themselves. > I just hit this again trying to implement a nommu-friendly strace(): the > one on github doesn't SIGSTOP the child before the execve() of the > process to trace because vfork(), and just races and misses the first > few system calls on nommu instead...) > > The problem with exec /proc/self/exe is A) I haven't necessarily got > /proc mounted, B) in a chroot the original binary might not be in scope > anymore. But I'm already _running_ this program. If I could fork() I > could already get a second copy of the sucker and call main() again > myself if necessary, but I can't, so... > > I'm aware there's a possible "but what if it was suid and it's already > dropped privileges" argument, and I'm fine with execve(NULL) not > honoring the suid bit if people feel that way. I just wanna unblock > vfork() while still running this code. (A way to detect I did this would > be great too, but the normal tweaking of argv[] or envp[] to let main > know we're a child still works.) > > Is there a _reason_ the kernel doesn't do this, or has nobody bothered > to code it up yet? > > Rob
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: execve(NULL, argv, envp) for nommu? Geert Uytterhoeven <geert@linux-m68k.org> - 2017-09-05 11:10 +0200
Re: execve(NULL, argv, envp) for nommu? Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-09-05 15:30 +0200
Re: execve(NULL, argv, envp) for nommu? Rob Landley <rob@landley.net> - 2017-09-06 03:20 +0200
Re: execve(NULL, argv, envp) for nommu? Rob Landley <rob@landley.net> - 2017-09-08 23:20 +0200
csiph-web