Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: ovidiu.panait@windriver.com
Cc: stable@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Jann Horn <jannh@google.com>
Subject: Re: [PATCH 5.10 1/1] KVM: x86: do not report a vCPU as preempted outside instruction boundaries
Date: Sat, 13 May 2023 18:29:53 +0900	[thread overview]
Message-ID: <2023051347-supervise-curve-e084@gregkh> (raw)
In-Reply-To: <20230509133330.2638333-1-ovidiu.panait@windriver.com>

On Tue, May 09, 2023 at 04:33:30PM +0300, ovidiu.panait@windriver.com wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> commit 6cd88243c7e03845a450795e134b488fc2afb736 upstream.
> 
> If a vCPU is outside guest mode and is scheduled out, it might be in the
> process of making a memory access.  A problem occurs if another vCPU uses
> the PV TLB flush feature during the period when the vCPU is scheduled
> out, and a virtual address has already been translated but has not yet
> been accessed, because this is equivalent to using a stale TLB entry.
> 
> To avoid this, only report a vCPU as preempted if sure that the guest
> is at an instruction boundary.  A rescheduling request will be delivered
> to the host physical CPU as an external interrupt, so for simplicity
> consider any vmexit *not* instruction boundary except for external
> interrupts.
> 
> It would in principle be okay to report the vCPU as preempted also
> if it is sleeping in kvm_vcpu_block(): a TLB flush IPI will incur the
> vmentry/vmexit overhead unnecessarily, and optimistic spinning is
> also unlikely to succeed.  However, leave it for later because right
> now kvm_vcpu_check_block() is doing memory accesses.  Even
> though the TLB flush issue only applies to virtual memory address,
> it's very much preferrable to be conservative.
> 
> Reported-by: Jann Horn <jannh@google.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> [OP: use VCPU_STAT() for debugfs entries]
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> ---
> 5.10 backport of CVE-2022-39189 fix:
> https://bugs.chromium.org/p/project-zero/issues/detail?id=2309
> 

Now queued up, thanks.

greg k-h

      reply	other threads:[~2023-05-13  9:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 13:33 [PATCH 5.10 1/1] KVM: x86: do not report a vCPU as preempted outside instruction boundaries ovidiu.panait
2023-05-13  9:29 ` Greg KH [this message]

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=2023051347-supervise-curve-e084@gregkh \
    --to=greg@kroah.com \
    --cc=jannh@google.com \
    --cc=ovidiu.panait@windriver.com \
    --cc=pbonzini@redhat.com \
    --cc=stable@vger.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