Skip to content

execveat() call is useless when re-executing qeme is the choice #347

Description

@robang74

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions