]> git.eshelyaron.com Git - emacs.git/commit
Fix execution of /proc/self/exe within child processes
authorPo Lu <luangruo@yahoo.com>
Fri, 5 May 2023 11:04:32 +0000 (19:04 +0800)
committerPo Lu <luangruo@yahoo.com>
Fri, 5 May 2023 11:04:32 +0000 (19:04 +0800)
commit0fbe79727b07879cb4f0a5cb8d7288353c082bd0
tree921d949e0403488deba0ae13cc55ef736d095e23
parent2ba6c5035c904426d564eac47381480158cbbb9e
Fix execution of /proc/self/exe within child processes

* exec/exec.h (struct exec_tracee): New field `new_child'.
Also, make `waiting_for_syscall' a bitfield.
* exec/trace.c (PTRACE_GETEVENTMSG): New declaration.
(MAX_TRACEES): Bump to 4096.
(handle_clone_prepare): New function.
(handle_clone): If required, set `new_child' and wait for a
ptrace event describing the parent to arrive.
(after_fork): Clear new field.
(exec_waitpid): Upon a ptrace event describing a clone, create
the child's tracee if it doesn't already exist.  Otherwise, copy
over the parent's cmdline and start running it.
exec/exec.h
exec/trace.c