Handle /proc/self/exe in execve
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest1 patch 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | linux-user: Handle /proc/self/exe in syscall execvelinux-user/ | +12 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Qemu-devel] [PATCH 0/1] Handle /proc/self/exe in execve
From: Olivier Dion <[email protected]>
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(-)
Signature · 1 line
2.22.0