diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan
index 624ae1df7984c1bc75d39b5ff3becafb2f98310e..fba9909e31b717606b46263ff8f7c2e50220ea2f 100644
--- a/lib/Kconfig.kasan
+++ b/lib/Kconfig.kasan
@@ -156,6 +156,7 @@ config KASAN_STACK_ENABLE
 
 config KASAN_STACK
 	int
+	depends on KASAN_GENERIC || KASAN_SW_TAGS
 	default 1 if KASAN_STACK_ENABLE || CC_IS_GCC
 	default 0