[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 37/45] linux-user/aarch64: Do not allow duplicate or short sve rec
From: |
Peter Maydell |
Subject: |
[PULL 37/45] linux-user/aarch64: Do not allow duplicate or short sve records |
Date: |
Mon, 11 Jul 2022 14:57:42 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
In parse_user_sigframe, the kernel rejects duplicate sve records,
or records that are smaller than the header. We were silently
allowing these cases to pass, dropping the record.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220708151540.18136-38-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
linux-user/aarch64/signal.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c
index 8b352abb97c..8fbe98d72f2 100644
--- a/linux-user/aarch64/signal.c
+++ b/linux-user/aarch64/signal.c
@@ -318,10 +318,13 @@ static int target_restore_sigframe(CPUARMState *env,
break;
case TARGET_SVE_MAGIC:
+ if (sve || size < sizeof(struct target_sve_context)) {
+ goto err;
+ }
if (cpu_isar_feature(aa64_sve, env_archcpu(env))) {
vq = sve_vq(env);
sve_size = QEMU_ALIGN_UP(TARGET_SVE_SIG_CONTEXT_SIZE(vq), 16);
- if (!sve && size == sve_size) {
+ if (size == sve_size) {
sve = (struct target_sve_context *)ctx;
break;
}
--
2.25.1
- [PULL 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming, (continued)
- [PULL 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming, Peter Maydell, 2022/07/11
- [PULL 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming, Peter Maydell, 2022/07/11
- [PULL 16/45] target/arm: Handle SME in sve_access_check, Peter Maydell, 2022/07/11
- [PULL 19/45] target/arm: Implement SME MOVA, Peter Maydell, 2022/07/11
- [PULL 21/45] target/arm: Export unpredicated ld/st from translate-sve.c, Peter Maydell, 2022/07/11
- [PULL 24/45] target/arm: Implement FMOPA, FMOPS (non-widening), Peter Maydell, 2022/07/11
- [PULL 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL, Peter Maydell, 2022/07/11
- [PULL 26/45] target/arm: Implement FMOPA, FMOPS (widening), Peter Maydell, 2022/07/11
- [PULL 31/45] target/arm: Reset streaming sve state on exception boundaries, Peter Maydell, 2022/07/11
- [PULL 33/45] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS, Peter Maydell, 2022/07/11
- [PULL 37/45] linux-user/aarch64: Do not allow duplicate or short sve records,
Peter Maydell <=
- [PULL 34/45] linux-user/aarch64: Reset PSTATE.SM on syscalls, Peter Maydell, 2022/07/11
- [PULL 30/45] target/arm: Implement SCLAMP, UCLAMP, Peter Maydell, 2022/07/11
- [PULL 36/45] linux-user/aarch64: Tidy target_restore_sigframe error return, Peter Maydell, 2022/07/11
- [PULL 39/45] linux-user/aarch64: Move sve record checks into restore, Peter Maydell, 2022/07/11
- [PULL 35/45] linux-user/aarch64: Add SM bit to SVE signal context, Peter Maydell, 2022/07/11
- [PULL 44/45] target/arm: Enable SME for user-only, Peter Maydell, 2022/07/11
- [PULL 28/45] target/arm: Implement PSEL, Peter Maydell, 2022/07/11
- [PULL 20/45] target/arm: Implement SME LD1, ST1, Peter Maydell, 2022/07/11