diff --git a/security/Kconfig b/security/Kconfig index 65d29c37d1fc..8b6c5e9528e0 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -272,5 +272,7 @@ config DEFAULT_SECURITY default "apparmor" if DEFAULT_SECURITY_APPARMOR default "" if DEFAULT_SECURITY_DAC +source "security/Kconfig.hardening" + endmenu diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening new file mode 100644 index 000000000000..ee68aec4f7ff --- /dev/null +++ b/security/Kconfig.hardening @@ -0,0 +1,32 @@ +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