summaryrefslogtreecommitdiff
path: root/crypto/algapi.c
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2018-06-15 16:47:26 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2018-06-21 09:14:44 +0100
commit2955bcc8c309bb8f2c773db4798649aa802a491f (patch)
treeaf509ec9869a2ab5c5453369728a8559b752aa99 /crypto/algapi.c
parentb3eb56b629d1095dde56fa37f4d7bcd5f783c8b2 (diff)
KVM: arm64: Avoid mistaken attempts to save SVE state for vcpus
Commit e6b673b ("KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing") uses fpsimd_save() to save the FPSIMD state for a vcpu when scheduling the vcpu out. However, currently current's value of TIF_SVE is restored before calling fpsimd_save() which means that fpsimd_save() may erroneously attempt to save SVE state from the vcpu. This enables current's vector state to be polluted with guest data. current->thread.sve_state may be unallocated or not large enough, so this can also trigger a NULL dereference or buffer overrun. Instead of this, TIF_SVE should be configured properly for the guest when calling fpsimd_save() with the vcpu context loaded. This patch ensures this by delaying restoration of current's TIF_SVE until after the call to fpsimd_save(). Fixes: e6b673b741ea ("KVM: arm64: Optimise FPSIMD handling to reduce guest/host thrashing") Signed-off-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'crypto/algapi.c')
0 files changed, 0 insertions, 0 deletions