Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init
Previously, in the case where (gpa + len) wrapped around, the entire region was not validated, as the comment claimed. It doesn't actually seem that wraparound should be allowed here at all. Furthermore, since some callers don't check the return code from this function, it seems prudent to clear ghc->memslot in the event of an error. Fixes: 8f96452 ("KVM: Allow cross page reads and writes from cached translations.") Reported-by: Cfir Cohen <[email protected]> Signed-off-by: Jim Mattson <[email protected]> Reviewed-by: Cfir Cohen <[email protected]> Reviewed-by: Marc Orr <[email protected]> Cc: Andrew Honig <[email protected]> Signed-off-by: Radim Krčmář <[email protected]>
- Loading branch information