ARM: KVM: Fix unaligned unmap_range leak
authorChristoffer Dall <christoffer.dall@linaro.org>
Tue, 6 Aug 2013 20:50:54 +0000 (13:50 -0700)
committerChristoffer Dall <christoffer.dall@linaro.org>
Thu, 2 Oct 2014 15:17:58 +0000 (17:17 +0200)
commit3b180da00d212c6968ab821dcf85f3776929a44d
treea306dba0ed5ca2ec2967a056c5d3627842d84515
parenta043deb0317044bdeda876d2170de0b24c2bfba8
ARM: KVM: Fix unaligned unmap_range leak

The unmap_range function did not properly cover the case when the start
address was not aligned to PMD_SIZE or PUD_SIZE and an entire pte table
or pmd table was cleared, causing us to leak memory when incrementing
the addr.

The fix is to always move onto the next page table entry boundary
instead of adding the full size of the VA range covered by the
corresponding table level entry.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
(cherry picked from commit d3840b26614d8ce3db53c98061d9fcb1b9ccb0dd)
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm/kvm/mmu.c