Skip to contentSkip to conversation

kasan: add missing Kconfig dependencies

PATCH In review Arnd Bergmann 3 participants 4 messages Dec 10, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kasan: add missing Kconfig dependencies

Building with CONFIG_KASAN=y when neither KASAN_GENERIC nor KASAN_SW_TAGS can be selected leads to a build error:

arch/arm64/mm/kasan_init.c: In function 'kasan_pte_populate':
arch/arm64/mm/kasan_init.c:106:28: error: 'KASAN_SHADOW_INIT' undeclared (first use in this function); did you mean 'KASAN_SHADOW_END'?

We should really only allow enabling KASAN when all its dependencies are met as it was before the introduction of CONFIG_KASAN_SW_TAGS.

Fixes b8440cc16515 ("kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS")
---
 lib/Kconfig.kasan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.kasan +2 -0
index b5d0cbfce4a1..83286bca2f70 100644
@@ -15,6 +15,8 @@ if HAVE_ARCH_KASAN
 
 config KASAN
 	bool "KASAN: runtime memory debugger"
+	depends on CC_HAS_KASAN_GENERIC || CC_HAS_KASAN_SW_TAGS
+	depends on (SLUB && SYSFS) || (SLAB && !DEBUG_SLAB)
 	help
 	  Enables KASAN (KernelAddressSANitizer) - runtime memory debugger,
 	  designed to find out-of-bounds accesses and use-after-free bugs.
Signature · 1 line
2.20.0
#1 lore raw
Quoted 4 lines · Arnd Bergmann

Building with CONFIG_KASAN=y when neither KASAN_GENERIC nor KASAN_SW_TAGS can be selected leads to a build error:

Quoted 8 lines

arch/arm64/mm/kasan_init.c: In function 'kasan_pte_populate':
arch/arm64/mm/kasan_init.c:106:28: error: 'KASAN_SHADOW_INIT' undeclared (first use in this function); did you mean 'KASAN_SHADOW_END'?

We should really only allow enabling KASAN when all its dependencies are met as it was before the introduction of CONFIG_KASAN_SW_TAGS.

Fixes b8440cc16515 ("kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS")

Hi Arnd,

Is this a patch against linux-next? The issue has been addressed by v13 of the patchset, which is now in the mm tree and should end up in the linux-next soon AFAIU.

Thanks!

Quoted 20 lines
---
 lib/Kconfig.kasan | 2 ++
 1 file changed, 2 insertions(+)
lib/Kconfig.kasan +2 -1
index b5d0cbfce4a1..83286bca2f70 100644
@@ -15,6 +15,8 @@ if HAVE_ARCH_KASAN
 
 config KASAN
        bool "KASAN: runtime memory debugger"
+       depends on CC_HAS_KASAN_GENERIC || CC_HAS_KASAN_SW_TAGS
+       depends on (SLUB && SYSFS) || (SLAB && !DEBUG_SLAB)
        help
          Enables KASAN (KernelAddressSANitizer) - runtime memory debugger,
          designed to find out-of-bounds accesses and use-after-free bugs.
--

2.20.0

#2 lore raw
Quoted 12 lines · Andrey Konovalov
Quoted 10 lines · Arnd Bergmann

Building with CONFIG_KASAN=y when neither KASAN_GENERIC nor KASAN_SW_TAGS can be selected leads to a build error:

arch/arm64/mm/kasan_init.c: In function 'kasan_pte_populate':
arch/arm64/mm/kasan_init.c:106:28: error: 'KASAN_SHADOW_INIT' undeclared (first use in this function); did you mean 'KASAN_SHADOW_END'?

We should really only allow enabling KASAN when all its dependencies are met as it was before the introduction of CONFIG_KASAN_SW_TAGS.

Quoted 8 lines
Quoted 2 lines
Fixes b8440cc16515 ("kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS")

Hi Arnd,

Is this a patch against linux-next? The issue has been addressed by v13 of the patchset, which is now in the mm tree and should end up in the linux-next soon AFAIU.

Yes, I tested on today's linux-next. I'll drop the patch tomorrow then from my test tree.

Arnd

#3 lore raw
In reply to Andrey Konovalov

Hi Andrey,

Quoted 4 lines · On Mon, 10 Dec 2018 22:14:57 +0100 Andrey Konovalov <[email protected]>…

Is this a patch against linux-next? The issue has been addressed by v13 of the patchset, which is now in the mm tree and should end up in the linux-next soon AFAIU.

It may be in the mmots series, but it is not (yet) in the mmotm series and so won't appear in linux-next today (unless Andrew updates mmotm soon).

Signature · 2 lines
Cheers,
Stephen Rothwell