diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2017-12-07 11:45:45 +0000 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2017-12-18 10:53:23 +0100 |
commit | 7839c672e58bf62da8f2f0197fefb442c02ba1dd (patch) | |
tree | 8e65a53e308e23a09aa89399db03ea9edc10f697 /net/ipv4/inet_timewait_sock.c | |
parent | bfe766cf65fb65e68c4764f76158718560bdcee5 (diff) | |
download | op-kernel-dev-7839c672e58bf62da8f2f0197fefb442c02ba1dd.zip op-kernel-dev-7839c672e58bf62da8f2f0197fefb442c02ba1dd.tar.gz |
KVM: arm/arm64: Fix HYP unmapping going off limits
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.
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.
Cc: stable@vger.kernel.org
Reported-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'net/ipv4/inet_timewait_sock.c')
0 files changed, 0 insertions, 0 deletions