]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram
authorAvi Kivity <avi@qumranet.com>
Sun, 22 Apr 2007 09:28:49 +0000 (12:28 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 2 May 2007 00:05:54 +0000 (17:05 -0700)
commit036bb8535c517d6ea5669337ed709cd975369a2b
treee9ba3427ae9415abc873cae4c5fb5db1b8e1feb0
parent1c4b6343a17186145fdf658939c5682e916905bc
KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram

PAGE_MASK is an unsigned long, so using it to mask physical addresses on
i386 (which are 64-bit wide) leads to truncation.  This can result in
page->private of unrelated memory pages being modified, with disasterous
results.

Fix by not using PAGE_MASK for physical addresses; instead calculate
the correct value directly from PAGE_SIZE.  Also fix a similar BUG_ON().

Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/kvm/mmu.c