Re: [PATCH v3] KVM: Skip gfn-based MMU notifier invalidations for guest_memfd-only memslots

From: Sean Christopherson

Date: Mon Nov 16 2026 - 18:56:21 EST


On Sat, Nov 14, 2026, Sean Christopherson wrote:
> On Fri, Nov 13, 2026, Lorenzo Stoakes (ARM) wrote:
> > On Fri, Nov 13, 2026 at 08:40:00AM -0800, Sean Christopherson wrote:
> > And a VMM that's doing something broken (i.e. trying to take advantage of this
> > as a vulnerability), could then intentionally set up a gmem-only slot to point
> > at ordinary anon memory, munmap(), and have a UAF on the underlying folio due to
> > no MMU notifier invalidation.
>
> Ya, Sashiko flagged this as well. I was initially planning on adding the check
> in kvm_mmu_prefetch_sptes(), but adding the check in kvm_prefetch_pages() is
> better since the work-in-progress prefetching for x86's TDP MMU will share some
> of the prefetching checks, but will go through the normal fault-in path instead
> of using kvm_prefetch_pages(). The return should be -EINVAL or so though.
>
> I'll send a patch on Monday.

Slight addendum: I'm going to a v4 of this "series". I original thought the bug
was already reachable, but I was conflating this issue with something else.