From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF54BE732E7 for ; Thu, 28 Sep 2023 15:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232029AbjI1Pxq (ORCPT ); Thu, 28 Sep 2023 11:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230274AbjI1Pxp (ORCPT ); Thu, 28 Sep 2023 11:53:45 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9AED6 for ; Thu, 28 Sep 2023 08:53:43 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-59b59e1ac70so263329857b3.1 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=1695916422; x=1696521222; darn=vger.kernel.org; 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=KXiXbrkpQlP+lSXsiWVTqR4slreLDNcPdZCtJdV1ZzhKA79VJPMzmCPW/wUKuPp6Ky +cSCaHVHUo3c6jJTXAQC/gs9iwCiZPIfWGRFFXGRsXXJGyJDJnOSar+aDPtDCWNgRV9f YPZsyb6TGZWmvfllkdpoy7GWaXRdDAj6nxfqC9Nq/CVu1wEm83O9su4jKtHl3+wCD9nZ mwAPqS6VcvBzB7mV5Hbu7Lh5wxdNSfxLxe7ETQ1xK18S0ZWsB2UAmr7L0+vSJC96n2mj KTYmZoRItSzeX4wylE9lZBeAccAhoZlqAeVeL5PmKBcP/BSpOAGodEpt8VoUi7RysDu9 D/uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695916422; x=1696521222; 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=IECCdireCsVMAj4C8HcxVZwli98RkCV2Mt4dr/NONrcejnCDVD8ulanAFimcs0XNHR 4Oc8e3V5L8qrC0imp3EZ3PHahXB+6AllsDRvrfvfhzzENk7PBr4gATJVPN20T6Ac6pUA v+4N2ksvEBL8PFW2dJD0EEyUXY05XHQLxME9gfqk+Sf7bzzJQySSnbsibUfx+ZAymC3a njB6u9u7d6ZYLQc4gyEU3OFl0IJyzmzvl99R3IIxiA4WthnKPI4YZhWTQbp+3fMIU9bU 1bhscRULJUTLDIUOgM5S7nEd78n1B19BMHh485Oqme5wH6WPDUJST+CHxOhwaVpZQVjK Njkw== X-Gm-Message-State: AOJu0Yxbijml9HKOJGTTpktqUewQ44FbSqZDtTx7OtbX+UrNd9FDEe8l 8n38qEqs9AKwD4FSUJphB7N3JrMDwr0= 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> 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" Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 >