[PATCH] linux-user: look up executable in emulation dir for execve syscall

Andreas Schwab posted 1 patch 2 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/mvmtsyixb4m.fsf@suse.de
Maintainers: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] linux-user: look up executable in emulation dir for execve syscall
Posted by Andreas Schwab 2 months, 1 week ago
Signed-off-by: Andreas Schwab <schwab@suse.de>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f7ca155679..e379ddb1b7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8972,6 +8972,7 @@ static int do_execv(CPUArchState *cpu_env, int dirfd,
     if (is_proc_myself(p, "exe")) {
         exe = exec_path;
     }
+    exe = path(exe);
     ret = is_execveat
         ? safe_execveat(dirfd, exe, argp, envp, flags)
         : safe_execve(exe, argp, envp);
-- 
2.52.0


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Re: [PATCH] linux-user: look up executable in emulation dir for execve syscall
Posted by Helge Deller 2 weeks, 1 day ago
Hello Andreas,

could you maybe explain why this is needed?
Did you face a real problem?

Helge

On 11/25/25 18:42, Andreas Schwab wrote:
> Signed-off-by: Andreas Schwab <schwab@suse.de>
> ---
>   linux-user/syscall.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index f7ca155679..e379ddb1b7 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -8972,6 +8972,7 @@ static int do_execv(CPUArchState *cpu_env, int dirfd,
>       if (is_proc_myself(p, "exe")) {
>           exe = exec_path;
>       }
> +    exe = path(exe);
>       ret = is_execveat
>           ? safe_execveat(dirfd, exe, argp, envp, flags)
>           : safe_execve(exe, argp, envp);
Re: [PATCH] linux-user: look up executable in emulation dir for execve syscall
Posted by Andreas Schwab 1 week, 5 days ago
On Jan 23 2026, Helge Deller wrote:

> could you maybe explain why this is needed?
> Did you face a real problem?

It allows the target to find the executable in the target sysroot.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."