All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org,
	ak@linux.intel.com, mingo@kernel.org, dwmw2@infradead.org
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/pti] module/retpoline: Warn about missing retpoline in module
Date: Sat, 27 Jan 2018 14:40:33 +0100	[thread overview]
Message-ID: <20180127134033.vmesim52s5hqh4hp@pd.tnic> (raw)
In-Reply-To: <tip-caf7501a1b4ec964190f31f9c3f163de252273b8@git.kernel.org>

On Fri, Jan 26, 2018 at 06:59:06AM -0800, tip-bot for Andi Kleen wrote:
> Commit-ID:  caf7501a1b4ec964190f31f9c3f163de252273b8
> Gitweb:     https://git.kernel.org/tip/caf7501a1b4ec964190f31f9c3f163de252273b8
> Author:     Andi Kleen <ak@linux.intel.com>
> AuthorDate: Thu, 25 Jan 2018 15:50:28 -0800
> Committer:  Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Fri, 26 Jan 2018 15:03:56 +0100
> 
> module/retpoline: Warn about missing retpoline in module
> 
> There's a risk that a kernel which has full retpoline mitigations becomes
> vulnerable when a module gets loaded that hasn't been compiled with the
> right compiler or the right option.
> 
> To enable detection of that mismatch at module load time, add a module info
> string "retpoline" at build time when the module was compiled with
> retpoline support. This only covers compiled C source, but assembler source
> or prebuilt object files are not checked.
> 
> If a retpoline enabled kernel detects a non retpoline protected module at
> load time, print a warning and report it in the sysfs vulnerability file.
> 
> [ tglx: Massaged changelog ]
> 
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: gregkh@linuxfoundation.org
> Cc: torvalds@linux-foundation.org
> Cc: jeyu@kernel.org
> Cc: arjan@linux.intel.com
> Link: https://lkml.kernel.org/r/20180125235028.31211-1-andi@firstfloor.org
> ---
>  arch/x86/kernel/cpu/bugs.c | 17 ++++++++++++++++-
>  include/linux/module.h     |  9 +++++++++
>  kernel/module.c            | 11 +++++++++++
>  scripts/mod/modpost.c      |  9 +++++++++
>  4 files changed, 45 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
> index 390b3dc..4a39d7b 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>
> @@ -93,6 +94,19 @@ static const char *spectre_v2_strings[] = {
>  #define pr_fmt(fmt)     "Spectre V2 mitigation: " fmt
>  
>  static enum spectre_v2_mitigation spectre_v2_enabled = SPECTRE_V2_NONE;
> +static bool spectre_v2_bad_module;

allnoconfig says:

arch/x86/kernel/cpu/bugs.c:97:13: warning: ‘spectre_v2_bad_module’ defined but not used [-Wunused-variable]
 static bool spectre_v2_bad_module;
             ^

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

      parent reply	other threads:[~2018-01-27 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 23:50 [PATCH v4] retpoline/module: Warn for missing retpoline in module Andi Kleen
2018-01-25 23:53 ` Randy Dunlap
2018-01-26 14:59 ` [tip:x86/pti] module/retpoline: Warn about " tip-bot for Andi Kleen
2018-01-26 17:51   ` Randy Dunlap
2018-01-27 13:40   ` Borislav Petkov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180127134033.vmesim52s5hqh4hp@pd.tnic \
    --to=bp@alien8.de \
    --cc=ak@linux.intel.com \
    --cc=dwmw2@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.