[PATCH] KVM: arm/arm64: Fix HYP unmapping going off limits

Marc Zyngier marc.zyngier at arm.com
Mon Dec 11 01:19:42 PST 2017


On 11/12/17 09:05, Christoffer Dall wrote:
> On Thu, Dec 07, 2017 at 11:45:45AM +0000, Marc Zyngier wrote:
>> When we unmap the HYP memory, we try to be clever and unmap one
>> PGD at a time. If we start with a non-PGD aligned address and try
>> to unmap a whole PGD, things go horribly wrong in unmap_hyp_range
>> (addr and end can never match, and it all goes really badly as we
>> keep incrementing pgd and parse random memory as page tables...).
>>
>> The obvious fix is to let unmap_hyp_range do what it does best,
>> which is to iterate over a range.
> 
> Would you mind terribly if I add the following to the commit message?
> 
>   The size of the linear mapping, which begins at PAGE_OFFSET, can be
>   easily calculated by subtracting PAGE_OFFSET form high_memory, because
>   high_memory is defined as the linear map address of the last byte of
>   DRAM, plus one.
>   
>   The size of the vmalloc region is given trivially by VMALLOC_END -
>   VMALLOC_START.

Please do!

> Otherwise:
> 
> Reviewed-by: Christoffer Dall <christoffer.dall at linaro.org>
Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...



More information about the linux-arm-kernel mailing list