[ciqlts8_6] Multiple patches tested (2 commits)#1407
[ciqlts8_6] Multiple patches tested (2 commits)#1407ciq-kernel-automation[bot] wants to merge 2 commits into
Conversation
jira VULN-186742 cve CVE-2026-46113 commit-author Sean Christopherson <seanjc@google.com> commit - commit-source-sha 0cb2af2ea66ad95873455d8a1d0f6f4e13fef645 commit-source https://lore.kernel.org/all/20260626112634.1778506-1-pbonzini@redhat.com/ upstream-diff | This is a HAND-PORT, not a cherry-pick. Upstream commit 0cb2af2 fixes kvm_mmu_get_child_sp() by adding a spte_to_child_sp(*sptep)->gfn == gfn check to its -EEXIST reuse guard. That function (and spte_to_child_sp/kvm_mmu_child_role, the whole get_child_sp/get_shadow_page split) does NOT exist on this 4.18-based tree, which predates the ~6.2 KVM MMU refactor and still uses kvm_mmu_get_page() + link_shadow_page(). On this tree the interior-SPTE reuse happens in the fault-path walkers __direct_map() and FNAME(fetch): after drop_large_spte(), a present non-large SPTE is reused as-is (skipping the kvm_mmu_get_page() alloc path that would validate gfn), with no re-check that the referenced child shadow page still maps the expected gfn. The equivalent guard is therefore applied at each of the three reuse sites via a shared helper kvm_mmu_child_sp_matches(); on mismatch the stale child SPTE is zapped (mmu_page_zap_pte + remote flush) so the correct child is (re)allocated. kvm_mmu_child_role() factors out kvm_mmu_get_page()'s role derivation so the guard and the allocator cannot drift. Functionally equivalent to upstream. Commit 0cb2af2 ("KVM: x86: Fix shadow paging use-after-free due to unexpected GFN") fixes a shadow paging mismatch between the stored and computed GFNs. The bug can be triggered by changing a PDE mapping from outside the guest and then deleting a memslot: rmap_remove() misses entries whose leaf SPTE gfn does not match the gfn of the struct kvm_mmu_page. The freed shadow page's rmap entry survives, and later walks of that gfn (dirty logging, MMU notifier invalidation, ...) dereference an sptep in the freed page, causing the use-after-free. Fixes: 2032a93 ("KVM: MMU: Don't allocate gfns page for direct mmu pages") Reported-by: Hyunwoo Kim <imv4bel@gmail.com> Signed-off-by: Shreeya Patel <spatel@ciq.com>
jira VULN-191426 cve CVE-2026-53359 commit-author Paolo Bonzini <pbonzini@redhat.com> commit - commit-source-sha 81ccda3 commit-source https://lore.kernel.org/all/20260626112634.1778506-1-pbonzini@redhat.com/ upstream-diff | This is a HAND-PORT, not a cherry-pick. Upstream commit 81ccda3 fixes kvm_mmu_get_child_sp() by adding spte_to_child_sp(*sptep)->role.word == role.word to its -EEXIST reuse guard, on top of the unexpected-GFN check. That function does not exist on this 4.18-based tree (see the prerequisite "unexpected GFN" commit for the full rationale); the equivalent guard lives in the shared helper kvm_mmu_child_sp_matches() applied at the three fault-path reuse sites. This commit adds the role.word comparison to that helper, using kvm_mmu_child_role() to derive the expected role exactly as kvm_mmu_get_page() does. Functionally equivalent to upstream. Commit 0cb2af2 ("KVM: x86: Fix shadow paging use-after-free due to unexpected GFN") fixed a shadow paging mismatch between stored and computed GFNs. A similar hole remains if the modified PDE points to a non-leaf page: the gfn can be made to match, but the role does not. The original large 2MB page creates a kvm_mmu_page with direct=1, while the new 4KB mapping needs one with direct=0; because the reuse path did not compare the role, the direct=1 page was reused. Installing a leaf SPTE then records an rmap entry under the walk's gfn, but when that child is zapped its parent has direct=1 and kvm_mmu_page_get_gfn() computes the gfn as sp->gfn + index instead of using sp->gfns[], so the recorded entry is not removed. When the memslot is dropped the shadow page is freed but the rmap entry survives, and later walks dereference an sptep in the freed page, causing the use-after-free. Fixes: 2032a93 ("KVM: MMU: Don't allocate gfns page for direct mmu pages") Reported-by: Hyunwoo Kim <imv4bel@gmail.com> Signed-off-by: Shreeya Patel <spatel@ciq.com>
|
🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/28816580920 |
JIRA PR Check Results2 commit(s) with issues found: Commit
|
|
❌ Validation checks completed with issues View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/28816580920 |
|
Commit-source-sha is mangled on 51e2c75 The first 13 chars of it are correct o_O |
kerneltoast
left a comment
There was a problem hiding this comment.
I'm reworking this backport. drop_large_spte() was kept even though it's redundant now and the changes to the checks in FNAME(fetch) are missing !is_large_pte(*it.sptep). Several of the parameters passed to kvm_mmu_child_sp_matches() are never used too.
Summary
This PR has been automatically created after successful completion of all CI stages.
Commit Message(s)
Reproducing and testing Januscape
Prerequisites
Steps (inside the guest)
makesudo rmmod kvm_intelsudo insmod poc.kosudo rmmod pocsudo insmod poc.koExpected result
The host panics with a KVM shadow-MMU rmap corruption, with a signature like:
Verifying the fix
Install the patched kernel on the host, boot into it, and repeat the same PoC runs from the guest. With the fix applied the host survives all runs (no pte_list_remove)
Test Results
✅ Build Stage
✅ Boot Verification
✅ Kernel Selftests
✅ LTP Results
x86_64 regressions:
x86_64 newly passing:
🤖 This PR was automatically generated by GitHub Actions
Run ID: 28801347436