mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
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
This commit is contained in:
@@ -61,6 +61,7 @@ choice
|
|||||||
config GCC_PLUGIN_STRUCTLEAK_BYREF
|
config GCC_PLUGIN_STRUCTLEAK_BYREF
|
||||||
bool "zero-init structs passed by reference (strong)"
|
bool "zero-init structs passed by reference (strong)"
|
||||||
depends on GCC_PLUGINS
|
depends on GCC_PLUGINS
|
||||||
|
depends on !(KASAN && KASAN_STACK=1)
|
||||||
select GCC_PLUGIN_STRUCTLEAK
|
select GCC_PLUGIN_STRUCTLEAK
|
||||||
help
|
help
|
||||||
Zero-initialize any structures on the stack that may
|
Zero-initialize any structures on the stack that may
|
||||||
@@ -70,9 +71,15 @@ choice
|
|||||||
exposures, like CVE-2017-1000410:
|
exposures, like CVE-2017-1000410:
|
||||||
https://git.kernel.org/linus/06e7e776ca4d3654
|
https://git.kernel.org/linus/06e7e776ca4d3654
|
||||||
|
|
||||||
|
As a side-effect, this keeps a lot of variables on the
|
||||||
|
stack that can otherwise be optimized out, so combining
|
||||||
|
this with CONFIG_KASAN_STACK can lead to a stack overflow
|
||||||
|
and is disallowed.
|
||||||
|
|
||||||
config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
|
config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
|
||||||
bool "zero-init anything passed by reference (very strong)"
|
bool "zero-init anything passed by reference (very strong)"
|
||||||
depends on GCC_PLUGINS
|
depends on GCC_PLUGINS
|
||||||
|
depends on !(KASAN && KASAN_STACK=1)
|
||||||
select GCC_PLUGIN_STRUCTLEAK
|
select GCC_PLUGIN_STRUCTLEAK
|
||||||
help
|
help
|
||||||
Zero-initialize any stack variables that may be passed
|
Zero-initialize any stack variables that may be passed
|
||||||
|
|||||||
Reference in New Issue
Block a user