Taken verbatim from CentOS Stream 10 merge request 3068, which cherry-picks
upstream commit 2abd5287f083 ("KVM: x86: Check for invalid/obsolete root
*after* making MMU pages available") by Sean Christopherson and Paolo
Bonzini.
If reclaiming shadow pages zaps an in-use root, KVM would go on to map
memory into a root already marked invalid. Child shadow pages inherit
their parent's role, so any children created during the map/fetch land on
the list of active MMU pages while flagged invalid, breaking the invariant
introduced in 5.9 that invalid pages are never on that list. The fix moves
the is_page_fault_stale() check to after make_mmu_pages_available().
Applies with --fuzz=0 against arch/x86/kvm/mmu/{mmu.c,paging_tmpl.h}, no
fuzz and no offsets. Verified against the centos-stream-10 main branch: the
el10_2 z-stream tree this kernel is built from (6.12.0-211.38.1.el10_2) is
not published as a branch or tag, but both hunks sit in direct_page_fault()
and FNAME(page_fault)(), which are unchanged across 6.12 z-streams.
Note that MR 3068 is still a Draft upstream. If Red Hat revises it before
merge, this patch needs to be re-synced.
JIRA: RHEL-224013
|
||
|---|---|---|
| files | ||
| scripts | ||
| config.yaml | ||