struct target_ucontext_v2 is not at the begining of the signal frame,
therefore do_sigaltstack was being passed bogus arguments.

Signed-off-by: Timothy Edward Baldwin <t.e.baldwi...@members.leeds.ac.uk>
---
 linux-user/signal.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 
Changes since v1: Fix style.

diff --git a/linux-user/signal.c b/linux-user/signal.c
index 9a4d894..f6cb5ee 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -2062,8 +2062,11 @@ static int do_sigframe_return_v2(CPUARMState *env, 
target_ulong frame_addr,
         }
     }
 
-    if (do_sigaltstack(frame_addr + offsetof(struct target_ucontext_v2, 
tuc_stack), 0, get_sp_from_cpustate(env)) == -EFAULT)
+    if (do_sigaltstack(frame_addr
+                       + offsetof(struct rt_sigframe_v2, uc.tuc_stack),
+                       0, get_sp_from_cpustate(env)) == -EFAULT) {
         return 1;
+    }
 
 #if 0
     /* Send SIGTRAP if we're single-stepping */
-- 
2.1.4


Reply via email to