From: Richard Henderson Date: Thu, 6 Jan 2022 22:57:36 +0000 (-0800) Subject: linux-user: Map signal number in PR_GET_PDEATHSIG X-Git-Tag: v7.0.0-rc0~94^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1edebb36ea1809c7882a7be9654260adbbfdcb35;p=thirdparty%2Fqemu.git linux-user: Map signal number in PR_GET_PDEATHSIG Convert the host signal number to guest signal number before returning the value to the guest. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220106225738.103012-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index eff107b8bcf..b17cfe31c8b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6444,7 +6444,8 @@ static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2, int deathsig; ret = get_errno(prctl(PR_GET_PDEATHSIG, &deathsig, arg3, arg4, arg5)); - if (!is_error(ret) && put_user_s32(deathsig, arg2)) { + if (!is_error(ret) && + put_user_s32(host_to_target_signal(deathsig), arg2)) { return -TARGET_EFAULT; } return ret;