KVM: Disallow all flags for KVM-internal memslots
Disallow all flags for KVM-internal memslots as all existing flags require some amount of userspace interaction to have any meaning. In addition to guarding against KVM goofs, explicitly disallowing dirty logging of KVM- internal memslots will (hopefully) allow exempting KVM-internal memslots from the KVM_MEM_MAX_NR_PAGES limit, which appears to exist purely because the dirty bitmap operations use a 32-bit index. Cc: Xiaoyao Li <xiaoyao.li@intel.com> Cc: Claudio Imbrenda <imbrenda@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Acked-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Link: https://lore.kernel.org/r/20250111002022.1230573-6-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>pull/1134/head
parent
344315e93d
commit
0cc3cb2151
|
|
@ -2057,6 +2057,9 @@ int kvm_set_internal_memslot(struct kvm *kvm,
|
|||
if (WARN_ON_ONCE(mem->slot < KVM_USER_MEM_SLOTS))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON_ONCE(mem->flags))
|
||||
return -EINVAL;
|
||||
|
||||
return kvm_set_memory_region(kvm, mem);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(kvm_set_internal_memslot);
|
||||
|
|
|
|||
Loading…
Reference in New Issue