aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-01-06 14:57:36 -0800
committerLaurent Vivier <laurent@vivier.eu>2022-01-11 18:40:44 +0100
commit1edebb36ea1809c7882a7be9654260adbbfdcb35 (patch)
treedf11bf49087672365b695c7101cb505149588caf /linux-user
parent08f5f973491b7e575231afbb1fa5c96f39c257b2 (diff)
downloadqemu-1edebb36ea1809c7882a7be9654260adbbfdcb35.zip
qemu-1edebb36ea1809c7882a7be9654260adbbfdcb35.tar.gz
qemu-1edebb36ea1809c7882a7be9654260adbbfdcb35.tar.bz2
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 <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220106225738.103012-3-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/syscall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index eff107b..b17cfe3 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;