diff options
author | Samuel Seay <lightningth@gmail.com> | 2013-01-02 10:53:46 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-01-07 17:37:09 +0100 |
commit | beb526b12134a6b6744125deec5a7fe24a8f92e3 (patch) | |
tree | 3c49eb13f965e3308a841d39d4fa8b9e586efa3d /linux-user/signal.c | |
parent | 88a78d9093917096feffeba66802be27d0e64ead (diff) |
PPC: fix segfault in signal handling code
Removed h2g() macro around the ka->_sa_handler due to the _sa_handler being a
guest memory address.
Changed the __put_user to put_user as it was attempting to put a value at the
stack address but the new address is a guest memory address, __put_user is
for host memory addresses.
Signed-off-by: Samuel Seay <LightningTH@GMail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[agraf: change subject line, reformat commit message]
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'linux-user/signal.c')
-rw-r--r-- | linux-user/signal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/signal.c b/linux-user/signal.c index 95e2ffa007..c43b8ac30a 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -4584,7 +4584,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, signal = current_exec_domain_sig(sig); - err |= __put_user(h2g(ka->_sa_handler), &sc->handler); + err |= __put_user(ka->_sa_handler, &sc->handler); err |= __put_user(set->sig[0], &sc->oldmask); #if defined(TARGET_PPC64) err |= __put_user(set->sig[0] >> 32, &sc->_unused[3]); @@ -4606,7 +4606,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, /* Create a stack frame for the caller of the handler. */ newsp = frame_addr - SIGNAL_FRAMESIZE; - err |= __put_user(env->gpr[1], (target_ulong *)(uintptr_t) newsp); + err |= put_user(env->gpr[1], newsp, target_ulong); if (err) goto sigsegv; |