Repository navigation
Commit f4064ef
KVM: x86/mmu: Get root level from walkers when retrieving MMIO SPTE
commit 39b4d43 upstream.
Get the so called "root" level from the low level shadow page table
walkers instead of manually attempting to calculate it higher up the
stack, e.g. in get_mmio_spte(). When KVM is using PAE shadow paging,
the starting level of the walk, from the callers perspective, is not
the CR3 root but rather the PDPTR "root". Checking for reserved bits
from the CR3 root causes get_mmio_spte() to consume uninitialized stack
data due to indexing into sptes[] for a level that was not filled by
get_walk(). This can result in false positives and/or negatives
depending on what garbage happens to be on the stack.
Opportunistically nuke a few extra newlines.
Fixes: 95fb5b0 ("kvm: x86/mmu: Support MMIO in the TDP MMU")
Reported-by: Richard Herbert <rherbert@sympatico.ca>
Cc: Ben Gardon <bgardon@google.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20201218003139.2167891-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent afd6216 commit f4064ef
3 files changed
Lines changed: 13 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3485 | 3485 | | |
3486 | 3486 | | |
3487 | 3487 | | |
3488 | | - | |
| 3488 | + | |
3489 | 3489 | | |
3490 | 3490 | | |
3491 | 3491 | | |
3492 | 3492 | | |
3493 | 3493 | | |
3494 | | - | |
3495 | 3494 | | |
3496 | 3495 | | |
3497 | | - | |
| 3496 | + | |
| 3497 | + | |
3498 | 3498 | | |
3499 | 3499 | | |
3500 | 3500 | | |
| |||
3504 | 3504 | | |
3505 | 3505 | | |
3506 | 3506 | | |
3507 | | - | |
3508 | 3507 | | |
3509 | 3508 | | |
3510 | 3509 | | |
| |||
3517 | 3516 | | |
3518 | 3517 | | |
3519 | 3518 | | |
3520 | | - | |
3521 | | - | |
3522 | | - | |
| 3519 | + | |
3523 | 3520 | | |
3524 | 3521 | | |
3525 | 3522 | | |
| |||
3528 | 3525 | | |
3529 | 3526 | | |
3530 | 3527 | | |
3531 | | - | |
| 3528 | + | |
3532 | 3529 | | |
3533 | | - | |
| 3530 | + | |
3534 | 3531 | | |
3535 | 3532 | | |
3536 | 3533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
1151 | | - | |
| 1151 | + | |
| 1152 | + | |
1152 | 1153 | | |
1153 | 1154 | | |
1154 | 1155 | | |
1155 | 1156 | | |
1156 | 1157 | | |
1157 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
1158 | 1161 | | |
1159 | 1162 | | |
1160 | 1163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
0 commit comments