]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Map signal number in PR_GET_PDEATHSIG
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 6 Jan 2022 22:57:36 +0000 (14:57 -0800)
committerLaurent Vivier <laurent@vivier.eu>
Tue, 11 Jan 2022 17:40:44 +0000 (18:40 +0100)
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>
linux-user/syscall.c

index eff107b8bcfd11cfa887297e205161aa6a3aff21..b17cfe31c8b499c39e8222e96049faa07a7e0eea 100644 (file)
@@ -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;