[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/11] linux-user: Fix broken m68k signal handling on
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 10/11] linux-user: Fix broken m68k signal handling on 64 bit hosts |
Date: |
Tue, 27 Jan 2015 23:07:21 +0200 |
From: Peter Maydell <address@hidden>
The m68k signal frame setup code which writes the signal return
trampoline code to the stack was assuming that a 'long' was 32 bits;
on 64 bit systems this meant we would end up writing the 32 bit
(2 insn) trampoline sequence to retaddr+4,retaddr+6 instead of
the intended retaddr+0,retaddr+2, resulting in a guest crash when
it tried to execute the invalid zero-bytes at retaddr+0.
Fix by using uint32_t instead; also use uint16_t rather than short
for consistency. This fixes bug LP:1404690.
Reported-by: Michel Boaventura
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/signal.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 8065710..5bb399e 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -5066,7 +5066,7 @@ static void setup_frame(int sig, struct target_sigaction
*ka,
/* moveq #,d0; trap #0 */
__put_user(0x70004e40 + (TARGET_NR_sigreturn << 16),
- (long *)(frame->retcode));
+ (uint32_t *)(frame->retcode));
/* Set up to return from userspace */
@@ -5200,8 +5200,8 @@ static void setup_rt_frame(int sig, struct
target_sigaction *ka,
/* moveq #,d0; notb d0; trap #0 */
__put_user(0x70004600 + ((TARGET_NR_rt_sigreturn ^ 0xff) << 16),
- (long *)(frame->retcode + 0));
- __put_user(0x4e40, (short *)(frame->retcode + 4));
+ (uint32_t *)(frame->retcode + 0));
+ __put_user(0x4e40, (uint16_t *)(frame->retcode + 4));
if (err)
goto give_sigsegv;
--
2.1.4
- [Qemu-devel] [PULL 00/11] linux-user-updates, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 03/11] linux-user/arm/nwfpe: Delete unused aCC array, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 04/11] linux-user/main.c: Call cpu_exec_start/end on all target archs, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 08/11] linux-user: Fix ioctl cmd type mismatch on 64-bit targets, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 01/11] linux-user/signal.c: Remove current_exec_domain_sig(), riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 09/11] mips64-linux-user: Fix definition of struct sigaltstack, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 06/11] linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_user, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 11/11] linux-user: support target-to-host SCM_CREDENTIALS, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 07/11] linux-user: translate resource also for prlimit64, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 05/11] linux-user/main.c: Mark end_exclusive() as possibly unused, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 10/11] linux-user: Fix broken m68k signal handling on 64 bit hosts,
riku . voipio <=
- [Qemu-devel] [PULL 02/11] linux-user/alpha: Add define for NR_shmat to enable shmat syscall, riku . voipio, 2015/01/27
- Re: [Qemu-devel] [PULL 00/11] linux-user-updates, Peter Maydell, 2015/01/27