mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
KVM: interrupt kvm_gmem_populate() on signals
kvm_gmem_populate() is a potentially lengthy operation that can involve
multiple calls to the firmware. Interrupt it if a signal arrives.
Fixes: 1f6c06b177
("KVM: guest_memfd: Add interface for populating gmem pages with user data")
Cc: Isaku Yamahata <isaku.yamahata@intel.com>
Cc: Michael Roth <michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f99b052256
commit
d81473840c
1 changed files with 5 additions and 0 deletions
|
@ -629,6 +629,11 @@ long kvm_gmem_populate(struct kvm *kvm, gfn_t start_gfn, void __user *src, long
|
|||
gfn_t gfn = start_gfn + i;
|
||||
kvm_pfn_t pfn;
|
||||
|
||||
if (signal_pending(current)) {
|
||||
ret = -EINTR;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = __kvm_gmem_get_pfn(file, slot, gfn, &pfn, &max_order, false);
|
||||
if (ret)
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue