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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240904153004.GAZth8_Jz_aJh_C_ur@fat_crate.local>
Date: Wed, 4 Sep 2024 17:30:04 +0200
From: Borislav Petkov <bp@...en8.de>
To: Kai Huang <kai.huang@...el.com>
Cc: dave.hansen@...el.com, kirill.shutemov@...ux.intel.com,
	tglx@...utronix.de, peterz@...radead.org, mingo@...hat.com,
	x86@...nel.org, hpa@...or.com, luto@...nel.org,
	linux-kernel@...r.kernel.org, thomas.lendacky@....com,
	pbonzini@...hat.com, seanjc@...gle.com
Subject: Re: [PATCH v5 2/5] x86/kexec: do unconditional WBINVD for bare-metal
 in relocate_kernel()

On Fri, Aug 16, 2024 at 12:29:18AM +1200, Kai Huang wrote:
> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> index 9c9ac606893e..07ca9d3361a3 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -392,7 +392,7 @@ void machine_kexec(struct kimage *image)
>  				       (unsigned long)page_list,
>  				       image->start,
>  				       image->preserve_context,
> -				       host_mem_enc_active);
> +				       !boot_cpu_has(X86_FEATURE_HYPERVISOR));

Everytime you feel the need to check a X86_FEATURE_ flag, make sure you use
cpu_feature_enabled().

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ