arm/arm64: KVM: Ensure memslots are within KVM_PHYS_SIZE

commit c3058d5da2 upstream.

When creating or moving a memslot, make sure the IPA space is within the
addressable range of the guest.  Otherwise, user space can create too
large a memslot and KVM would try to access potentially unallocated page
table entries when inserting entries in the Stage-2 page tables.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
[ luis: backported to 3.16: used shannon's backport for 3.14 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
This commit is contained in:
Christoffer Dall 2014-10-10 12:14:29 +02:00 • committed by Luis Henriques
commit ca2d284cf1