Commit d9c5ed0
committed
KVM: x86: Don't take kvm->lock when iterating over vCPUs in suspend notifier
When queueing vCPU PVCLOCK updates in response to SUSPEND or HIBERNATE,
don't take kvm->lock as doing so can trigger a largely theoretical
deadlock, it is perfectly safe to iterate over the xarray of vCPUs without
holding kvm->lock, and kvm->lock doesn't protect kvm_set_guest_paused() in
any way (pv_time.active and pvclock_set_guest_stopped_request are
protected by vcpu->mutex, not kvm->lock).
Reported-by: syzbot+352e553a86e0d75f5120@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/677c0f36.050a0220.3b3668.0014.GAE@google.com
Fixes: 7d62874 ("kvm: x86: implement KVM PM-notifier")
Reviewed-by: Paul Durrant <paul@xen.org>
Link: https://lore.kernel.org/r/20250201013827.680235-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>1 parent a64dcfb commit d9c5ed0
1 file changed
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6907 | 6907 | | |
6908 | 6908 | | |
6909 | 6909 | | |
6910 | | - | |
6911 | 6910 | | |
6912 | 6911 | | |
6913 | 6912 | | |
| |||
6919 | 6918 | | |
6920 | 6919 | | |
6921 | 6920 | | |
6922 | | - | |
6923 | 6921 | | |
6924 | 6922 | | |
6925 | 6923 | | |
| |||
0 commit comments