summaryrefslogtreecommitdiff
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2017-12-06 19:45:47 +0300
committerWill Deacon <will.deacon@arm.com>2017-12-06 22:08:05 +0300
commitcb968afc789821cdf9e17e79ef08ab90e5bae0f2 (patch)
treebfebdce5e2dd33cc1c05aa9dbd574bd8cc933b6b /arch/ia64/kernel
parentd96cc49bff5a7735576cc6f6f111f875d101cec8 (diff)
downloadlinux-cb968afc789821cdf9e17e79ef08ab90e5bae0f2.tar.xz
arm64/sve: Avoid dereference of dead task_struct in KVM guest entry
When deciding whether to invalidate FPSIMD state cached in the cpu, the backend function sve_flush_cpu_state() attempts to dereference __this_cpu_read(fpsimd_last_state). However, this is not safe: there is no guarantee that this task_struct pointer is still valid, because the task could have exited in the meantime. This means that we need another means to get the appropriate value of TIF_SVE for the associated task. This patch solves this issue by adding a cached copy of the TIF_SVE flag in fpsimd_last_state, which we can check without dereferencing the task pointer. In particular, although this patch is not a KVM fix per se, this means that this check is now done safely in the KVM world switch path (which is currently the only user of this code). Signed-off-by: Dave Martin <Dave.Martin@arm.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Christoffer Dall <christoffer.dall@linaro.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/ia64/kernel')
0 files changed, 0 insertions, 0 deletions