]> www.infradead.org Git - users/jedix/linux-maple.git/commit
retpoline/module: Taint kernel for missing retpoline in module
authorAndi Kleen <ak@linux.intel.com>
Thu, 4 Jan 2018 14:37:08 +0000 (14:37 +0000)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 8 Feb 2018 18:14:57 +0000 (10:14 -0800)
commit0c2b670605d6ae8df9abdae476d676f6a9ebd6e5
tree49feee475ec09a328c2d133f164519d152508391
parentfdf98b0e18037d58c0450bf7b80b69272fc7b4a8
retpoline/module: Taint kernel for missing retpoline in module

There's a risk that a kernel that has full retpoline mitigations
becomes vulnerable when a module gets loaded that hasn't been
compiled with the right compiler or the right option.

We cannot fix it, but should at least warn the user when that
happens.

Add a flag to each module if it has been compiled with RETPOLINE

When the a module hasn't been compiled with a retpoline
aware compiler, print a warning and set a taint flag.

For modules it is checked at compile time, however it cannot
check assembler or other non compiled objects used in the module link.

Due to lack of better letter it uses taint option 'Z'

We only set the taint flag for incorrectly compiled modules
now, not for the main kernel, which already has other
report mechanisms.

Also make sure to report vulnerable for spectre if such a module
has been loaded.

v2: Change warning message
v3: Port to latest tree
Cc: jeyu@kernel.org
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
(cherry picked from commit abc01f3c4bbd927f5e47cc6dff99a76a393d1bbe)
Orabug: 27477743
CVE: CVE-2017-5715
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Conflicts:
        Documentation/oops-tracing.txt
  (dmj: patch had Documentation/admin-guide/tainted-kernels.rst)
        arch/x86/kernel/cpu/bugs_64.c
  (dmj: patch had arch/x86/kernel/cpu/bugs.c)
include/linux/kernel.h
kernel/module.c
kernel/panic.c
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Documentation/oops-tracing.txt
arch/x86/include/asm/processor.h
arch/x86/kernel/cpu/bugs_64.c
include/linux/kernel.h
kernel/module.c
kernel/panic.c
scripts/mod/modpost.c