From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3DDB347A3 for ; Thu, 28 Sep 2023 15:53:43 +0000 (UTC) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-59f4f2a9ef0so224730717b3.2 for ; Thu, 28 Sep 2023 08:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695916423; x=1696521223; darn=lists.linux.dev; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=9+KF8Dx6gkORPNY9sE+tILxrgD0oMG3WrnAvRuzUSWM=; b=mq3B0tPr91UFgh0H0fRW6Ear4Yu9p5WlxrdXWynxJoPf6+z30fhYoxEXvBdv53W34G QHqojQ6C65aMyaUr6YfF9imkodXkhNcwh1xcBT3ocxwmURUg7IpK70z/xYYEu84jaUd/ adCGtO5f0eYAPztxNyc4hwszRrhVxFm8sa3JqWLWJRw+u2LVNMrd+7VHKAV4Ibfc92C9 u3nv47qIvSQTUOu8X3YnJkmPzPYxZ1rN5eNsnfbO2FTQQ9HZU2bLoF2p4mJNtrs6NTz2 5x6I6dFnaCib10CqNYwgoJtqDp7A5fC6yeoAJ6SKiBQVfA1F9FCR1XXrvWVGNLGzKgjS P08Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695916423; x=1696521223; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9+KF8Dx6gkORPNY9sE+tILxrgD0oMG3WrnAvRuzUSWM=; b=GF/GGfuMhCP0oY4PXDQ9yxS8HhXeuTMn3zcF0dF1q+G+5I6AJ+lR8c8gH3HE2wpSXb wk7am66uaGSPKq9qCplU4xvyt6iKrBHjMBJzoV6B9OexN6a0NhpPkHk6Mby9NGmzr4+Z iAXy1DiOF1XJVShTYYr7VAsRiL/CU/+oUjdNQV8iCB4EvCU7k94Qr7GofVNpGVyyGRK8 A2jrgGKDyMoizXvs76jsWDZTf9JI5v/4CIj35lji5LXtKNXCX686tNUtyl7MNfP7TzXd ZQj0DUP8VUhNNW+TiYAHMb9O3mINTaa4aMu+J0NCRiS1eLtpQGo+76DiCYM4MPoW0Mp6 OAdQ== X-Gm-Message-State: AOJu0YzX6Lxh9ZTRhViS/YRMO6s6q/DjzxY32KBGZwPrwx30oRtBcUM+ sL2wZW8D20aeAVanc+bygjPP1VObl+A= X-Google-Smtp-Source: AGHT+IH4A7qKg2XydOJbmIvwuoLA9BPXAXOV4ldgBhSu0+Vajy3UmXpajmDHZC2VBSfPhVz068mClgDbRP0= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:bc05:0:b0:59b:f138:c843 with SMTP id a5-20020a81bc05000000b0059bf138c843mr31557ywi.3.1695916422752; Thu, 28 Sep 2023 08:53:42 -0700 (PDT) Date: Thu, 28 Sep 2023 08:53:41 -0700 In-Reply-To: <20230928150428.199929-2-mlevitsk@redhat.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20230928150428.199929-1-mlevitsk@redhat.com> <20230928150428.199929-2-mlevitsk@redhat.com> Message-ID: Subject: Re: [PATCH 1/5] x86: KVM: SVM: fix for x2avic CVE-2023-5090 From: Sean Christopherson To: Maxim Levitsky Cc: kvm@vger.kernel.org, Will Deacon , Borislav Petkov , Dave Hansen , Suravee Suthikulpanit , Thomas Gleixner , Paolo Bonzini , x86@kernel.org, Robin Murphy , iommu@lists.linux.dev, Ingo Molnar , Joerg Roedel , "H. Peter Anvin" , linux-kernel@vger.kernel.org, stable@vger.kernel.org Content-Type: text/plain; charset="us-ascii" KVM: SVM: for the shortlog scope And my preference is to have the shortlog explain the code change and leave the CVE reference to a line in the changelog. CVE numbers are meaningless without context, e.g. listing the CVE isn't going to be at all helpful for future readers that look at shortlogs. E.g. KVM: SVM: Always refresh x2APIC MSR intercepts when x2AVIC is enabled or KVM: SVM: Update MSR intercepts for x2AVIC when guest disables x2APIC On Thu, Sep 28, 2023, Maxim Levitsky wrote: > The following problem exists since the x2avic was enabled in the KVM: Just "x2avic" > svm_set_x2apic_msr_interception is called to enable the interception of () after functions > the x2apic msrs. > > In particular it is called at the moment the guest resets its apic. > > Assuming that the guest's apic was in x2apic mode, the reset will bring > it back to the xapic mode. > > The svm_set_x2apic_msr_interception however has an erroneous check for > '!apic_x2apic_mode()' which prevents it from doing anything in this case. > > As a result of this, all x2apic msrs are left unintercepted, and that > exposes the bare metal x2apic (if enabled) to the guest. > Oops. > > Remove the erroneous '!apic_x2apic_mode()' check to fix that. > > Cc: stable@vger.kernel.org Fixes: 4d1d7942e36a ("KVM: SVM: Introduce logic to (de)activate x2AVIC mode") > Signed-off-by: Maxim Levitsky > --- > arch/x86/kvm/svm/svm.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > index 9507df93f410a63..acdd0b89e4715a3 100644 > --- a/arch/x86/kvm/svm/svm.c > +++ b/arch/x86/kvm/svm/svm.c > @@ -913,8 +913,7 @@ void svm_set_x2apic_msr_interception(struct vcpu_svm *svm, bool intercept) > if (intercept == svm->x2avic_msrs_intercepted) > return; > > - if (!x2avic_enabled || > - !apic_x2apic_mode(svm->vcpu.arch.apic)) > + if (!x2avic_enabled) > return; > > for (i = 0; i < MAX_DIRECT_ACCESS_MSRS; i++) { > -- > 2.26.3 >