module/retpoline: Warn about missing retpoline in module
authorAndi Kleen <[email protected]>
Thu, 25 Jan 2018 23:50:28 +0000 (15:50 -0800)
committerThomas Gleixner <[email protected]>
Fri, 26 Jan 2018 14:03:56 +0000 (15:03 +0100)
commitcaf7501a1b4ec964190f31f9c3f163de252273b8
treef626e796eb8f30eca268595ca07dc90e00b06ec3
parentc940a3fb1e2e9b7d03228ab28f375fb5a47ff699
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
arch/x86/kernel/cpu/bugs.c
include/linux/module.h
kernel/module.c
scripts/mod/modpost.c