diff mbox series

[7/9] linux-user/nios2: Fix sigmask in setup_rt_frame

Message ID 20211001153347.1736014-10-richard.henderson@linaro.org
State Superseded
Headers show
Series nios2: Enable cross compile and fix signals | expand

Commit Message

Richard Henderson Oct. 1, 2021, 3:33 p.m. UTC
Do not cast the signal mask elements; trust __put_user.

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

-- 
2.25.1

Comments

Laurent Vivier Oct. 12, 2021, 6:16 a.m. UTC | #1
Le 01/10/2021 à 17:33, Richard Henderson a écrit :
> Do not cast the signal mask elements; trust __put_user.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  linux-user/nios2/signal.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c

> index 20b65aa06e..80e3d42fc9 100644

> --- a/linux-user/nios2/signal.c

> +++ b/linux-user/nios2/signal.c

> @@ -168,8 +168,7 @@ void setup_rt_frame(int sig, struct target_sigaction *ka,

>      target_save_altstack(&frame->uc.tuc_stack, env);

>      rt_setup_ucontext(&frame->uc, env);

>      for (i = 0; i < TARGET_NSIG_WORDS; i++) {

> -        __put_user((abi_ulong)set->sig[i],

> -                   (abi_ulong *)&frame->uc.tuc_sigmask.sig[i]);

> +        __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]);

>      }

>  

>      /* Set up to return from userspace; jump to fixed address sigreturn

> 


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

Patch

diff --git a/linux-user/nios2/signal.c b/linux-user/nios2/signal.c
index 20b65aa06e..80e3d42fc9 100644
--- a/linux-user/nios2/signal.c
+++ b/linux-user/nios2/signal.c
@@ -168,8 +168,7 @@  void setup_rt_frame(int sig, struct target_sigaction *ka,
     target_save_altstack(&frame->uc.tuc_stack, env);
     rt_setup_ucontext(&frame->uc, env);
     for (i = 0; i < TARGET_NSIG_WORDS; i++) {
-        __put_user((abi_ulong)set->sig[i],
-                   (abi_ulong *)&frame->uc.tuc_sigmask.sig[i]);
+        __put_user(set->sig[i], &frame->uc.tuc_sigmask.sig[i]);
     }
 
     /* Set up to return from userspace; jump to fixed address sigreturn