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]
Date:   Thu, 25 Jan 2018 15:53:36 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Andi Kleen <andi@...stfloor.org>, tglx@...utronix.de
Cc:     gregkh@...uxfoundation.org, dwmw@...zon.co.uk,
        linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
        x86@...nel.org, arjan@...ux.intel.com,
        Andi Kleen <ak@...ux.intel.com>, jeyu@...nel.org
Subject: Re: [PATCH v4] retpoline/module: Warn for missing retpoline in module

On 01/25/2018 03:50 PM, Andi Kleen wrote:

> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 390b3dc3d438..8766e13efe80 100644
> --- a/arch/x86/kernel/cpu/bugs.c
> +++ b/arch/x86/kernel/cpu/bugs.c
> @@ -11,6 +11,7 @@
>  #include <linux/init.h>
>  #include <linux/utsname.h>
>  #include <linux/cpu.h>
> +#include <linux/module.h>
>  
>  #include <asm/nospec-branch.h>
>  #include <asm/cmdline.h>
> @@ -94,6 +95,20 @@ static const char *spectre_v2_strings[] = {
>  
>  static enum spectre_v2_mitigation spectre_v2_enabled = SPECTRE_V2_NONE;
>  
> +static bool spectre_v2_bad_module;
> +
> +#ifdef RETPOLINE
> +bool retpoline_module_ok(bool has_retpoline)
> +{
> +	if (spectre_v2_enabled == SPECTRE_V2_NONE || has_retpoline)
> +		return true;
> +
> +	pr_err("system may be vunerable to spectre_v2\n");

	                      vulnerable

> +	spectre_v2_bad_module = true;
> +	return false;
> +}
> +#endif
> +
>  static void __init spec2_print_if_insecure(const char *reason)
>  {
>  	if (boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
> @@ -278,6 +293,7 @@ ssize_t cpu_show_spectre_v2(struct device *dev,
>  	if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2))
>  		return sprintf(buf, "Not affected\n");
>  
> -	return sprintf(buf, "%s\n", spectre_v2_strings[spectre_v2_enabled]);
> +	return sprintf(buf, "%s%s\n", spectre_v2_strings[spectre_v2_enabled],
> +			spectre_v2_bad_module ? " but vulnerable module loaded" : "");
>  }
>  #endif


-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ