angler-fishThe Vulnerability History Project

KVM: MMU: Validate all gptes during fetch, not just those used for new pages

      Currently, when we fetch an spte, we only verify that gptes match those that
the walker saw if we build new shadow pages for them.

However, this misses the following race:

  vcpu1            vcpu2

  walk
                  change gpte
                  walk
                  instantiate sp

  fetch existing sp

Fix by validating every gpte, regardless of whether it is used for building
a new sp or not.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    
commit 5991b33237b7fc7dd9f62ae04998c42217d444a7
+24 -9
expand_less