Le 27/04/2021 à 10:45, Wind Li a écrit :
> qemu patch:  
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 95d79ddc43..227d9b1b0e 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -8537,7 +8537,7 @@ static abi_long do_syscall1(void *cpu_env, int num, 
> abi_long arg1,
>               * before the execve completes and makes it the other
>               * program's problem.
>               */
> -            ret = get_errno(safe_execve(p, argp, envp));
> +            ret = get_errno(safe_execve(is_proc_myself(p, "exe") ? exec_path 
> : p, argp, envp));
>              unlock_user(p, arg1, 0);
>  
>              goto execve_end;
> 

I think this is the good approach to fix the problem, but exec_path can be not 
set in the case of
AT_EXECFD (binfmt_misc with credential flag) because we use execfd instead. You 
should use
do_openat() to get the file descriptor and execveat() to start the process.

Thanks,
Laurent

Reply via email to