1
0
Fork 0
alistair23-linux/arch
Kees Cook 44c6dc940b Makefile: introduce CONFIG_CC_STACKPROTECTOR_AUTO
Nearly all modern compilers support a stack-protector option, and nearly
all modern distributions enable the kernel stack-protector, so enabling
this by default in kernel builds would make sense.  However, Kconfig does
not have knowledge of available compiler features, so it isn't safe to
force on, as this would unconditionally break builds for the compilers or
architectures that don't have support.  Instead, this introduces a new
option, CONFIG_CC_STACKPROTECTOR_AUTO, which attempts to discover the best
possible stack-protector available, and will allow builds to proceed even
if the compiler doesn't support any stack-protector.

This option is made the default so that kernels built with modern
compilers will be protected-by-default against stack buffer overflows,
avoiding things like the recent BlueBorne attack.  Selection of a specific
stack-protector option remains available, including disabling it.

Additionally, tiny.config is adjusted to use CC_STACKPROTECTOR_NONE, since
that's the option with the least code size (and it used to be the default,
so we have to explicitly choose it there now).

Link: http://lkml.kernel.org/r/1510076320-69931-4-git-send-email-keescook@chromium.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Tested-by: Laura Abbott <labbott@redhat.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-06 18:32:44 -08:00
..
alpha Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha 2018-02-02 13:46:21 -08:00
arc The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
arm Merge branch 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-02-04 10:57:43 -08:00
arm64 kasan: clean up KASAN_SHADOW_SCALE_SHIFT usage 2018-02-06 18:32:43 -08:00
blackfin The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
c6x The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
cris The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
frv The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
h8300 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
hexagon The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
ia64 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
m32r The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
m68k The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
metag The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
microblaze Microblaze patches for 4.16-rc1 2018-02-02 09:48:36 -08:00
mips The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
mn10300 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
nios2 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
openrisc The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
parisc The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
powerpc powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
riscv The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
s390 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
score The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
sh The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
sparc The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
tile The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
um The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
unicore32 The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
x86 Makefile: move stack-protector availability out of Kconfig 2018-02-06 18:32:44 -08:00
xtensa The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
.gitignore
Kconfig Makefile: introduce CONFIG_CC_STACKPROTECTOR_AUTO 2018-02-06 18:32:44 -08:00