Commit 813e3d11 authored by Quentin Perret's avatar Quentin Perret Committed by Keir Fraser
Browse files

ANDROID: KVM: arm64: Fix races when cheking hyp_vm->id_dying



__pkvm_start_teardown_vm() can update the hyp_vm->is_dying state while
it is being observed from pkvm_load_hyp_vcpu() given that both functions
only take the VM table's read lock, hence causing a race. Fix the race
by taking the write lock from __pkvm_start_teardown_vm(), and cleanup
the unnecessary (and inconsistent) use of READ_ONCE() for
hyp_vm->is_dying while at it.

Bug: 357781595
Bug: 227300338
Bug: 278749606
Change-Id: I06b89419e01d0ac7b34a67b7de4bfb59674bceb1
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
parent 06de2309
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment