Re: [PATCH v2 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-10-27 Thread Michael Tokarev
27.10.2022 13:42, Michael Tokarev wrote: 27.10.2022 09:40, Laurent Vivier wrote: .. I tried O_CLOEXEC, but it seems the fd is closed before it is needed by execveat() to re-spawn the process, so it exits with an error (something like EBADF) It works here for me with a simple test program: #in

Re: [PATCH v2 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-10-27 Thread Michael Tokarev
27.10.2022 09:40, Laurent Vivier wrote: .. I tried O_CLOEXEC, but it seems the fd is closed before it is needed by execveat() to re-spawn the process, so it exits with an error (something like EBADF) It works here for me with a simple test program: #include #include #include #include #defi

Re: [PATCH v2 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-10-26 Thread Laurent Vivier
Le 26/10/2022 à 17:25, Michael Tokarev a écrit : 27.09.2022 15:43, Laurent Vivier wrote: Use exec_path to re-execute the binary from /proc/self/exe Fix do_openat() that should not use execfd. v2: - don't use execfd as it can't be closed and is usable by the child Why can't it be closed? I me

Re: [PATCH v2 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-10-26 Thread Michael Tokarev
27.09.2022 15:43, Laurent Vivier wrote: Use exec_path to re-execute the binary from /proc/self/exe Fix do_openat() that should not use execfd. v2: - don't use execfd as it can't be closed and is usable by the child Why can't it be closed? I mean, how about O_CLOEXEC? Your initial usage of ex

[PATCH v2 0/2] linux-user: handle /proc/self/exe with execve() syscall

2022-09-27 Thread Laurent Vivier
Use exec_path to re-execute the binary from /proc/self/exe Fix do_openat() that should not use execfd. v2: - don't use execfd as it can't be closed and is usable by the child Laurent Vivier (2): linux-user: handle /proc/self/exe with execve() syscall linux-user: don't use AT_EXECFD in do_ope