Message ID | 20190506143051.984481239@linuxfoundation.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
On 5/6/19 5:32 PM, Greg Kroah-Hartman wrote: > From: Arnd Bergmann <arnd@arndb.de> > > commit e7c52b84fb18f08ce49b6067ae6285aca79084a8 upstream. > This is a fix/workaround for the previous patch c5caf21ab0cf "kasan: turn on -fsanitize-address-use-after-scope" which shouldn't be in the -stable. So without c5caf21ab0cf we don't need this one.
On Mon, May 06, 2019 at 05:58:59PM +0300, Andrey Ryabinin wrote: > > > On 5/6/19 5:32 PM, Greg Kroah-Hartman wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > > > commit e7c52b84fb18f08ce49b6067ae6285aca79084a8 upstream. > > > > This is a fix/workaround for the previous patch c5caf21ab0cf "kasan: turn on -fsanitize-address-use-after-scope" > which shouldn't be in the -stable. So without c5caf21ab0cf we don't need this one. Great, will go drop this now as well! greg k-h
--- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -197,6 +197,7 @@ config ENABLE_MUST_CHECK config FRAME_WARN int "Warn for stack frames larger than (needs gcc 4.4)" range 0 8192 + default 3072 if KASAN_EXTRA default 2048 if GCC_PLUGIN_LATENT_ENTROPY default 1024 if !64BIT default 2048 if 64BIT --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -20,6 +20,17 @@ config KASAN Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB (the resulting kernel does not boot). +config KASAN_EXTRA + bool "KAsan: extra checks" + depends on KASAN && DEBUG_KERNEL && !COMPILE_TEST + help + This enables further checks in the kernel address sanitizer, for now + it only includes the address-use-after-scope check that can lead + to excessive kernel stack usage, frame size warnings and longer + compile time. + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more + + choice prompt "Instrumentation type" depends on KASAN --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -29,7 +29,9 @@ else endif endif +ifdef CONFIG_KASAN_EXTRA CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) +endif CFLAGS_KASAN_NOSANITIZE := -fno-builtin