diff options
author | Ladi Prosek <lprosek@redhat.com> | 2017-10-05 11:10:23 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-10-10 15:31:28 +0200 |
commit | 829ee279aed43faa5cb1e4d65c0cad52f2426c53 (patch) | |
tree | 4d820edec657b7fa4c79e1877b87ff86d5c3aed9 /mm/Kconfig.debug | |
parent | fd19d3b45164466a4adce7cbff448ba9189e1427 (diff) | |
download | op-kernel-dev-829ee279aed43faa5cb1e4d65c0cad52f2426c53.zip op-kernel-dev-829ee279aed43faa5cb1e4d65c0cad52f2426c53.tar.gz |
KVM: MMU: always terminate page walks at level 1
is_last_gpte() is not equivalent to the pseudo-code given in commit
6bb69c9b69c31 ("KVM: MMU: simplify last_pte_bitmap") because an incorrect
value of last_nonleaf_level may override the result even if level == 1.
It is critical for is_last_gpte() to return true on level == 1 to
terminate page walks. Otherwise memory corruption may occur as level
is used as an index to various data structures throughout the page
walking code. Even though the actual bug would be wherever the MMU is
initialized (as in the previous patch), be defensive and ensure here
that is_last_gpte() returns the correct value.
This patch is also enough to fix CVE-2017-12188.
Fixes: 6bb69c9b69c315200ddc2bc79aee14c0184cf5b2
Cc: stable@vger.kernel.org
Cc: Andy Honig <ahonig@google.com>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
[Panic if walk_addr_generic gets an incorrect level; this is a serious
bug and it's not worth a WARN_ON where the recovery path might hide
further exploitable issues; suggested by Andrew Honig. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mm/Kconfig.debug')
0 files changed, 0 insertions, 0 deletions