lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220728000221.19088-1-jarkko@profian.com>
Date:   Thu, 28 Jul 2022 03:02:21 +0300
From:   Jarkko Sakkinen <jarkko@...fian.com>
To:     Paolo Bonzini <pbonzini@...hat.com>
Cc:     Jarkko Sakkinen <jarkko@...fian.com>, stable@...r.kernel.org,
        Jarkko Sakkinen <jarkko@...nel.org>,
        Sean Christopherson <seanjc@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
        "H. Peter Anvin" <hpa@...or.com>,
        Brijesh Singh <brijesh.singh@....com>,
        Isaku Yamahata <isaku.yamahata@...el.com>,
        kvm@...r.kernel.org (open list:KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)),
        linux-kernel@...r.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND
        64-BIT))
Subject: [PATCH] KVM: x86/mmu: Fix incorrect use of CONFIG_RETPOLINE

Use "#ifdef" instead of "#if", as it is possible to select KVM
without enabling RETPOLINE.

Adding the following list of flags on top of tinyconfig is an
example of a failing config file:

CONFIG_64BIT=y
CONFIG_PCI=y
CONFIG_ACPI=y
CONFIG_VIRTUALIZATION=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_CRYPTO=y
CONFIG_DMADEVICES=y
CONFIG_X86_MCE=y
CONFIG_RETPOLINE=y
CONFIG_MEMORY_FAILURE=y
CONFIG_KVM=y
CONFIG_KVM_AMD=y
CONFIG_CRYPTO_DEV_CCP=y
CONFIG_CRYPTO_DEV_CCP_DD=y
CONFIG_CRYPTO_DEV_SP_CCP=y
CONFIG_CRYPTO_DEV_SP_PSP=y
CONFIG_KVM_AMD_SEV=y
CONFIG_AMD_MEM_ENCRYPT=y
CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT=n

Cc: stable@...r.kernel.org # 5.19
Cc: Jarkko Sakkinen <jarkko@...nel.org>
Fixes: d1f5c8366288 ("KVM: x86/mmu: Introduce kvm_mmu_map_tdp_page() for use by TDX and SNP")
Signed-off-by: Jarkko Sakkinen <jarkko@...fian.com>
---
 arch/x86/kvm/mmu/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 0b99ee4ea184..e08c7e85bbb9 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -4213,7 +4213,7 @@ kvm_pfn_t kvm_mmu_map_tdp_page(struct kvm_vcpu *vcpu, gpa_t gpa,
 		 * direct_page_fault() when appropriate.
 		 */
 		//r = direct_page_fault(vcpu, &fault);
-#if CONFIG_RETPOLINE
+#ifdef CONFIG_RETPOLINE
 		if (fault.is_tdp)
 			r = kvm_tdp_page_fault(vcpu, &fault);
 #else
-- 
2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ