[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/12] linux-user/signal.c: Ensure AArch64 signal fra
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 10/12] linux-user/signal.c: Ensure AArch64 signal frame isn't too small |
Date: |
Tue, 10 Apr 2018 13:17:22 +0100 |
The AArch64 signal frame design was extended for SVE in commit
8c5931de0ac77388096d79ceb, so that instead of having a fixed setup we
now add various records to the frame, with some of them possibly
overflowing into an extra space outside the original 4K reserved
block in the target_sigcontext. However, we failed to ensure that we
always at least allocate the 4K reserved block. This is ABI, and
some userspace programs rely on it. In particular the dash shell
would segfault if the frame wasn't as big enough.
(Compare the kernel's sigframe_size() function in
arch/arm64/kernel/signal.c.)
Reported-by: Richard Henwood <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-id: address@hidden
Fixes: https://bugs.launchpad.net/bugs/1761535
Fixes: 8c5931de0ac77388096d79ceb
Signed-off-by: Peter Maydell <address@hidden>
---
linux-user/signal.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 046d4c8aa0..8d9e6e8410 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -1850,6 +1850,12 @@ static void target_setup_frame(int usig, struct
target_sigaction *ka,
fr_ofs = layout.total_size;
layout.total_size += sizeof(struct target_rt_frame_record);
+ /* We must always provide at least the standard 4K reserved space,
+ * even if we don't use all of it (this is part of the ABI)
+ */
+ layout.total_size = MAX(layout.total_size,
+ sizeof(struct target_rt_sigframe));
+
frame_addr = get_sigframe(ka, env, layout.total_size);
trace_user_setup_frame(env, frame_addr);
if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) {
--
2.16.2
- [Qemu-devel] [PULL 00/12] target-arm queue, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 10/12] linux-user/signal.c: Ensure AArch64 signal frame isn't too small,
Peter Maydell <=
- [Qemu-devel] [PULL 12/12] fpu: Fix rounding mode for floatN_to_uintM_round_to_zero, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 09/12] cpus.c: ensure running CPU recalculates icount deadlines on timer expiry, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 11/12] tcg: Introduce tcg_set_insn_start_param, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 01/12] hw/arm: Allow manually specified /psci node, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 08/12] target/arm: Report unsupported MPU region sizes more clearly, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 03/12] target-arm: Check undefined opcodes for SWP in A32 decoder, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 05/12] hw/sd/bcm2835_sdhost: Don't raise spurious interrupts, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 04/12] hw/sd/bcm2835_sdhost: Add tracepoints, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 07/12] hw/arm/fsl-imx: Fix introspection problem with fsl-imx6 and fsl-imx7, Peter Maydell, 2018/04/10
- [Qemu-devel] [PULL 02/12] hw/arm/integratorcp: Don't do things that could be fatal in the instance_init, Peter Maydell, 2018/04/10