diff mbox series

[4/8] linux-user: Convert signal number for FUTEX_FD

Message ID 20220829021006.67305-5-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user: Futex improvements | expand

Commit Message

Richard Henderson Aug. 29, 2022, 2:10 a.m. UTC
The val argument to FUTEX_FD is a signal number.  Convert to match
the host, as it will be converted back when the signal is delivered.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Vivier Sept. 27, 2022, 9:56 a.m. UTC | #1
Le 29/08/2022 à 04:10, Richard Henderson a écrit :
> The val argument to FUTEX_FD is a signal number.  Convert to match
> the host, as it will be converted back when the signal is delivered.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   linux-user/syscall.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 8bf4b79a9e..f50cc70f1a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -7778,6 +7778,7 @@ static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr,
>           timeout = 0;
>           break;
>       case FUTEX_FD:
> +        val = target_to_host_signal(val);
>           timeout = 0;
>           break;
>       case FUTEX_CMP_REQUEUE:

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8bf4b79a9e..f50cc70f1a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7778,6 +7778,7 @@  static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr,
         timeout = 0;
         break;
     case FUTEX_FD:
+        val = target_to_host_signal(val);
         timeout = 0;
         break;
     case FUTEX_CMP_REQUEUE: