mirror of https://github.com/xemu-project/xemu.git
linux-user/aarch64: Do not allow duplicate or short sve records
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>
This commit is contained in:
parent
5726597c3b
commit
affb1a50b9
|
@ -318,10 +318,13 @@ static int target_restore_sigframe(CPUARMState *env,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TARGET_SVE_MAGIC:
|
case TARGET_SVE_MAGIC:
|
||||||
|
if (sve || size < sizeof(struct target_sve_context)) {
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
if (cpu_isar_feature(aa64_sve, env_archcpu(env))) {
|
if (cpu_isar_feature(aa64_sve, env_archcpu(env))) {
|
||||||
vq = sve_vq(env);
|
vq = sve_vq(env);
|
||||||
sve_size = QEMU_ALIGN_UP(TARGET_SVE_SIG_CONTEXT_SIZE(vq), 16);
|
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;
|
sve = (struct target_sve_context *)ctx;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue