execveat() call is useless when re-executing qeme is the choice
Considering this change:
|
- ? safe_execveat(dirfd, exe, argp, envp, flags) |
|
- : safe_execve(exe, argp, envp); |
|
+ ? safe_execveat(dirfd, "/proc/self/exe", argp, envp, flags) |
|
+ : safe_execve("/proc/self/exe", argp, envp); |
both system calls are re-excuting qemu to run the binary into the guest enviroment, and because of this the execveat() loses any meaning to exist:
ret = safe_execve("/proc/self/exe", argp, envp);
A single execve() would address correctly the qemu re-execution without forcing the execvat() to deal with a "no path" that "has a path" situation. It is an optimisation or possibly a fix, if the execvat() branch hasn't tested yet (but probably it collapes into an execve() without failure).
execveat() call is useless when re-executing qeme is the choice
Considering this change:
binfmt/patches/buildkit-direct-execve-v10.2/0001-linux-user-have-execve-call-qemu-via-proc-self-exe-t.patch
Lines 83 to 86 in 2a6f895
both system calls are re-excuting qemu to run the binary into the guest enviroment, and because of this the execveat() loses any meaning to exist:
A single
execve()would address correctly the qemu re-execution without forcing theexecvat()to deal with a "no path" that "has a path" situation. It is an optimisation or possibly a fix, if theexecvat()branch hasn't tested yet (but probably it collapes into anexecve()without failure).