From: Olivier Dion <d...@linutronix.de> When the emulated process try to execve itself through /proc/self/exe, QEMU user will be executed instead of the process.
The following short program demonstrated that: ---------------------------------------------------------------------- #include <stdio.h> #include <string.h> #include <unistd.h> static char *ARGV0 = "STOP"; static char *ARGV1 = "-this-is-not-an-option"; int main(int argc, char *argv[], char *environ[]) { (void)argc; if (strcmp(argv[0], ARGV0) == 0) return 0; argv[0] = ARGV0; argv[1] = ARGV1; execve("/proc/self/exe", (char **const)argv, (char **const)environ); perror("execve"); return 1; } ---------------------------------------------------------------------- Will output: ---------------------------------------------------------------------- qemu: unknown option 'this-is-not-an-option' ---------------------------------------------------------------------- Olivier Dion (1): linux-user: Handle /proc/self/exe in syscall execve linux-user/syscall.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.22.0