Re: [kvm-devel] [PATCH] KVM: MMU: Fix host memory corruption on i386 with >= 4GB ram




* Avi Kivity <avi@xxxxxxxxxxxx> wrote:

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().

Signed-off-by: Avi Kivity <avi@xxxxxxxxxxxx>

i have tested this, albeit with less than 4GB RAM.

Acked-by: Ingo Molnar <mingo@xxxxxxx>

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH] sched: Fix __load_balance_iterator() for cfq with only one task
    ... Fix this by checking if the last entity was a task or not. ... pairs not running on the same CPU as buddies, shouldn't this be fixed in a ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: 2.6.18-rt1
    ... the fix. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... Copyright 2006 by Maurice Eugene Heskett, ...
    (Linux-Kernel)
  • Re: [PATCH] sched: Fix __load_balance_iterator() for cfq with only one task
    ... It is caused by the following code-path. ... Fix this by checking if the last entity was a task or not. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH 4/5] x86: Add config variables for SMP_MAX
    ... the right fix is below. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH -mmotm] Remove ->nopfn check from use_zero_page
    ... This patch is needed to at least compile. ... Also includes fix to endless bad page states once you boot. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)