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: <YREG8Pzj5n5AIEAs@zn.tnic>
Date:   Mon, 9 Aug 2021 12:44:00 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
Cc:     x86@...nel.org, linux-edac@...r.kernel.org,
        linux-kernel@...r.kernel.org, Robert Richter <rric@...nel.org>,
        Tony Luck <tony.luck@...el.com>,
        James Morse <james.morse@....com>, yazen.ghannam@....com
Subject: Re: [PATCH] EDAC/mce_amd: Do not load edac_mce_amd module on guests

On Mon, Jun 28, 2021 at 12:27:40PM -0500, Smita Koralahalli wrote:
> Hypervisors may not expose SMCA feature to the guest.
> 
> Check for X86_FEATURE_HYPERVISOR on entry in mce_amd_init() and return
> -ENODEV if set.
> 
> Suggested-by: Borislav Petkov <bp@...e.de>
> Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
> ---
>  drivers/edac/mce_amd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
> index 5dd905a3f30c..1a1629166aa3 100644
> --- a/drivers/edac/mce_amd.c
> +++ b/drivers/edac/mce_amd.c
> @@ -1176,6 +1176,9 @@ static int __init mce_amd_init(void)
>  	    c->x86_vendor != X86_VENDOR_HYGON)
>  		return -ENODEV;
>  
> +	if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
> +		return -ENODEV;
> +
>  	if (boot_cpu_has(X86_FEATURE_SMCA)) {
>  		xec_mask = 0x3f;
>  		goto out;
> -- 
> 2.17.1

Applied, thanks.

-- 
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