LKML Archive on
 help / color / Atom feed
From: Paolo Bonzini <>
Cc: Boris Ostrovsky <>,
Subject: [FYI PATCH 1/5] x86/kvm: Be careful not to clear KVM_VCPU_FLUSH_TLB bit
Date: Thu, 30 Jan 2020 19:01:52 +0100
Message-ID: <> (raw)
In-Reply-To: <>

From: Boris Ostrovsky <>

kvm_steal_time_set_preempted() may accidentally clear KVM_VCPU_FLUSH_TLB
bit if it is called more than once while VCPU is preempted.

This is part of CVE-2019-3016.

(This bug was also independently discovered by Jim Mattson

Signed-off-by: Boris Ostrovsky <>
Reviewed-by: Joao Martins <>
Signed-off-by: Paolo Bonzini <>
 arch/x86/kvm/x86.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cf91713..8c93691 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3504,6 +3504,9 @@ static void kvm_steal_time_set_preempted(struct kvm_vcpu *vcpu)
 	if (!(vcpu-> & KVM_MSR_ENABLED))
+	if (vcpu->
+		return;
 	kvm_write_guest_offset_cached(vcpu->kvm, &vcpu->,

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 18:01 [FYI PATCH 0/5] Missing TLB flushes Paolo Bonzini
2020-01-30 18:01 ` Paolo Bonzini [this message]
2020-01-30 18:01 ` [FYI PATCH 2/5] x86/kvm: Introduce kvm_(un)map_gfn() Paolo Bonzini
2020-01-30 18:01 ` [FYI PATCH 3/5] x86/kvm: Cache gfn to pfn translation Paolo Bonzini
2020-01-30 18:01 ` [FYI PATCH 4/5] x86/KVM: Make sure KVM_VCPU_FLUSH_TLB flag is not missed Paolo Bonzini
2020-01-30 18:01 ` [FYI PATCH 5/5] x86/KVM: Clean up host's steal time structure Paolo Bonzini
2020-02-01  5:53 ` [FYI PATCH 0/5] Missing TLB flushes Wanpeng Li

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git
	git clone --mirror lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone