diff mbox series

[v2,12/15] linux-user/s390x: Fix frame_addr corruption in setup_frame

Message ID 20210428193408.233706-13-richard.henderson@linaro.org
State Superseded
Headers show
Series linux-user/s390x: some signal fixes | expand

Commit Message

Richard Henderson April 28, 2021, 7:34 p.m. UTC
The original value of frame_addr is still required for
its use in the call to unlock_user_struct below.

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

---
 linux-user/s390x/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Comments

David Hildenbrand April 29, 2021, 7:21 a.m. UTC | #1
On 28.04.21 21:34, Richard Henderson wrote:
> The original value of frame_addr is still required for

> its use in the call to unlock_user_struct below.

> 

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

> ---

>   linux-user/s390x/signal.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

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

> index bc41b01c5d..81ba59b46a 100644

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

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

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

>       env->psw.addr = ka->_sa_handler;

>   

>       env->regs[2] = sig;

> -    env->regs[3] = frame_addr += offsetof(typeof(*frame), sc);

> +    env->regs[3] = frame_addr + offsetof(typeof(*frame), sc);

>   

>       /*

>        * We forgot to include these in the sigcontext.

> 


Reviewed-by: David Hildenbrand <david@redhat.com>


-- 
Thanks,

David / dhildenb
diff mbox series

Patch

diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index bc41b01c5d..81ba59b46a 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -168,7 +168,7 @@  void setup_frame(int sig, struct target_sigaction *ka,
     env->psw.addr = ka->_sa_handler;
 
     env->regs[2] = sig;
-    env->regs[3] = frame_addr += offsetof(typeof(*frame), sc);
+    env->regs[3] = frame_addr + offsetof(typeof(*frame), sc);
 
     /*
      * We forgot to include these in the sigcontext.