Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 359b9ad4 authored by Kees Cook's avatar Kees Cook Committed by Alexander Potapenko
Browse files

BACKPORT: security: Create "kernel hardening" config area



Right now kernel hardening options are scattered around various Kconfig
files. This can be a central place to collect these kinds of options
going forward. This is initially populated with the memory initialization
options from the gcc-plugins.

The Android backport only adds INIT_STACK_NONE, as GCC plugins are
unavailable in the Android 4.14 tree.

Change-Id: I55d317a1b90a980cb9eb79645e0661881b81b335
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
(cherry picked from commit 9f671e58159adea641f76c56d1f0bbdcb3c524ff)
Bug: 133428616
Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
parent 99419aac
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -272,5 +272,7 @@ config DEFAULT_SECURITY
	default "apparmor" if DEFAULT_SECURITY_APPARMOR
	default "" if DEFAULT_SECURITY_DAC

source "security/Kconfig.hardening"

endmenu
+32 −0
Original line number Diff line number Diff line
menu "Kernel hardening options"

menu "Memory initialization"

choice
	prompt "Initialize kernel stack variables at function entry"
	default INIT_STACK_NONE
	help
	  This option enables initialization of stack variables at
	  function entry time. This has the possibility to have the
	  greatest coverage (since all functions can have their
	  variables initialized), but the performance impact depends
	  on the function calling complexity of a given workload's
	  syscalls.

	  This chooses the level of coverage over classes of potentially
	  uninitialized variables. The selected class will be
	  initialized before use in a function.

	config INIT_STACK_NONE
		bool "no automatic initialization (weakest)"
		help
		  Disable automatic stack variable initialization.
		  This leaves the kernel vulnerable to the standard
		  classes of uninitialized stack variable exploits
		  and information exposures.

endchoice

endmenu

endmenu