OSDN Git Service

linux-user/s390x: Fix sigcontext sregs value
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 28 Apr 2021 19:33:59 +0000 (12:33 -0700)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 15 May 2021 19:44:38 +0000 (21:44 +0200)
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

index dcc6f7b..f8515dd 100644 (file)
@@ -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.  */