Skip to content

Commit 25597f6

Browse files
vittyvkbonzini
authored andcommitted
Revert "KVM: x86: work around leak of uninitialized stack contents"
handle_vmptrst()/handle_vmread() stopped injecting #PF unconditionally and switched to nested_vmx_handle_memory_failure() which just kills the guest with KVM_EXIT_INTERNAL_ERROR in case of MMIO access, zeroing 'exception' in kvm_write_guest_virt_system() is not needed anymore. This reverts commit 541ab2a. Signed-off-by: Vitaly Kuznetsov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7a35e51 commit 25597f6

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

arch/x86/kvm/x86.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5647,13 +5647,6 @@ int kvm_write_guest_virt_system(struct kvm_vcpu *vcpu, gva_t addr, void *val,
56475647
/* kvm_write_guest_virt_system can pull in tons of pages. */
56485648
vcpu->arch.l1tf_flush_l1d = true;
56495649

5650-
/*
5651-
* FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED
5652-
* is returned, but our callers are not ready for that and they blindly
5653-
* call kvm_inject_page_fault. Ensure that they at least do not leak
5654-
* uninitialized kernel stack memory into cr2 and error code.
5655-
*/
5656-
memset(exception, 0, sizeof(*exception));
56575650
return kvm_write_guest_virt_helper(addr, val, bytes, vcpu,
56585651
PFERR_WRITE_MASK, exception);
56595652
}

0 commit comments

Comments
 (0)