From: Sean Christopherson <seanjc@google.com>
To: James Houghton <jthoughton@google.com>
Cc: Jim Mattson <jmattson@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, Yosry Ahmed <yosry@kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] KVM: nVMX: Don't flush shadow VMCS12 to guest memory during vCPU teardown
Date: Thu, 10 Sep 2026 12:32:52 -0700 [thread overview]
Message-ID: <aqMF5GVp6qHb-WcY@google.com> (raw)
In-Reply-To: <aqMBidJ_96qroogH@google.com>
On Thu, Sep 10, 2026, Sean Christopherson wrote:
> On Thu, Sep 10, 2026, James Houghton wrote:
> > On Wed, Sep 9, 2026 at 12:00 PM Sean Christopherson <seanjc@google.com> wrote:
> > I wish we could just change the uaccess primitives, like
> > {,__}access_ok(), to check that `current->mm` is not NULL (and WARN
> > and return -EFAULT if it is NULL).
>
> That wouldn't help at all in this case, because the access_ok() check is done
> when memslots are modified. Which is the crux of KVM's problems: KVM decouples
> the initial checks from the accesses, relying on kvm->mm to
>
> And even if we hardened all of the uaccess helpers, we'd _still_ have problems,
> because it's not just a NULL current->mm that's problematic. The last reference
> to a VM file, i.e. to struct kvm, can be put by a different _process_. I.e. KVM
> still needs to guard against reading/writing guest memory using a valid, non-NULL
> current->mm that isn't kvm->mm. That can't be genericized in the uaccess APIs,
> because the rule that only a specific address space can be used is very much unique
> to KVM.
Oh, and I'm not saying we shouldn't try to harden the uaccess APIs to guard against
a NULL current->mm. That absolutely would be worthwhile. I'm just saying that for
KVM, it sadly isn't sufficient.
next prev parent reply other threads:[~2026-09-10 19:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 13:28 [PATCH] KVM: nVMX: Don't flush shadow VMCS12 to guest memory during vCPU teardown Jim Mattson
2026-09-08 13:57 ` sashiko-bot
2026-09-08 17:34 ` James Houghton
2026-09-08 19:12 ` Jim Mattson
2026-09-09 15:41 ` James Houghton
2026-09-09 19:00 ` Sean Christopherson
2026-09-10 18:58 ` James Houghton
2026-09-10 19:14 ` Sean Christopherson
2026-09-10 19:32 ` Sean Christopherson [this message]
2026-09-10 19:40 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aqMF5GVp6qHb-WcY@google.com \
--to=seanjc@google.com \
--cc=jmattson@google.com \
--cc=jthoughton@google.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=stable@vger.kernel.org \
--cc=yosry@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox