diff mbox series

[PULL,38/59] linux-user/s390x: Fix sigcontext sregs value

Message ID 20210518053131.87212-39-laurent@vivier.eu
State Accepted
Commit 4e4a08200b6ed60055c45a0f05f4515365785a92
Headers show
Series None | expand

Commit Message

Laurent Vivier May 18, 2021, 5:31 a.m. UTC
From: Richard Henderson <richard.henderson@linaro.org>


Using the host address of &frame->sregs is incorrect.
We need the guest address.

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

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

Message-Id: <20210428193408.233706-7-richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>

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

-- 
2.31.1
diff mbox series

Patch

diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c
index dcc6f7bc0274..f8515dd3329b 100644
--- a/linux-user/s390x/signal.c
+++ b/linux-user/s390x/signal.c
@@ -142,7 +142,7 @@  void setup_frame(int sig, struct target_sigaction *ka,
 
     save_sigregs(env, &frame->sregs);
 
-    __put_user((abi_ulong)(unsigned long)&frame->sregs, &frame->sc.sregs);
+    __put_user(frame_addr + offsetof(sigframe, sregs), &frame->sc.sregs);
 
     /* Set up to return from userspace.  If provided, use a stub
        already in userspace.  */