diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-28 15:33:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-28 15:33:15 -0400 |
commit | c622fc5f54cb0c7ea2e6fedba27ba533b97657d8 (patch) | |
tree | 43710a0d44928f750633f395c89636ad3f6372dd /security | |
parent | 8e61ea11c23b108c8ce062f791dfa737896da346 (diff) | |
parent | 173e6ee21e2b3f477f07548a79c43b8d9cfbb37d (diff) |
Merge tag 'meminit-v5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull structleak fix from Kees Cook:
"Disable gcc-based stack variable auto-init under KASAN (Arnd
Bergmann).
This fixes a bunch of build warnings under KASAN and the
gcc-plugin-based stack auto-initialization features (which are
arguably redundant, so better to let KASAN control this)"
* tag 'meminit-v5.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
structleak: disable STRUCTLEAK_BYREF in combination with KASAN_STACK
Diffstat (limited to 'security')
-rw-r--r-- | security/Kconfig.hardening | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index a1ffe2eb4d5f..af4c979b38ee 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening | |||
@@ -61,6 +61,7 @@ choice | |||
61 | config GCC_PLUGIN_STRUCTLEAK_BYREF | 61 | config GCC_PLUGIN_STRUCTLEAK_BYREF |
62 | bool "zero-init structs passed by reference (strong)" | 62 | bool "zero-init structs passed by reference (strong)" |
63 | depends on GCC_PLUGINS | 63 | depends on GCC_PLUGINS |
64 | depends on !(KASAN && KASAN_STACK=1) | ||
64 | select GCC_PLUGIN_STRUCTLEAK | 65 | select GCC_PLUGIN_STRUCTLEAK |
65 | help | 66 | help |
66 | Zero-initialize any structures on the stack that may | 67 | Zero-initialize any structures on the stack that may |
@@ -70,9 +71,15 @@ choice | |||
70 | exposures, like CVE-2017-1000410: | 71 | exposures, like CVE-2017-1000410: |
71 | https://git.kernel.org/linus/06e7e776ca4d3654 | 72 | https://git.kernel.org/linus/06e7e776ca4d3654 |
72 | 73 | ||
74 | As a side-effect, this keeps a lot of variables on the | ||
75 | stack that can otherwise be optimized out, so combining | ||
76 | this with CONFIG_KASAN_STACK can lead to a stack overflow | ||
77 | and is disallowed. | ||
78 | |||
73 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL | 79 | config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL |
74 | bool "zero-init anything passed by reference (very strong)" | 80 | bool "zero-init anything passed by reference (very strong)" |
75 | depends on GCC_PLUGINS | 81 | depends on GCC_PLUGINS |
82 | depends on !(KASAN && KASAN_STACK=1) | ||
76 | select GCC_PLUGIN_STRUCTLEAK | 83 | select GCC_PLUGIN_STRUCTLEAK |
77 | help | 84 | help |
78 | Zero-initialize any stack variables that may be passed | 85 | Zero-initialize any stack variables that may be passed |