linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] KASAN: prohibit KASAN+STRUCTLEAK combination
@ 2018-04-19 17:24 Dmitry Vyukov
  2018-04-19 20:43 ` Kees Cook
  2018-04-30 23:41 ` Kees Cook
  0 siblings, 2 replies; 9+ messages in thread
From: Dmitry Vyukov @ 2018-04-19 17:24 UTC (permalink / raw)
  To: linux-mm, akpm
  Cc: Dmitry Vyukov, kasan-dev, Fengguang Wu, Sergey Senozhatsky,
	Andrey Ryabinin, Kees Cook

Currently STRUCTLEAK inserts initialization out of live scope of
variables from KASAN point of view. This leads to KASAN false
positive reports. Prohibit this combination for now.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: linux-mm@kvack.org
Cc: kasan-dev@googlegroups.com
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Kees Cook <keescook@google.com>

---

This combination leads to periodic confusion
and pointless debugging:

https://marc.info/?l=linux-kernel&m=151991367323082
https://marc.info/?l=linux-kernel&m=151992229326243
https://lkml.org/lkml/2017/11/30/33

Changes since v1:
 - replace KASAN with KASAN_EXTRA
   Only KASAN_EXTRA enables variable scope checking
---
 arch/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8e0d665c8d53..75dd23acf133 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -464,6 +464,10 @@ config GCC_PLUGIN_LATENT_ENTROPY
 config GCC_PLUGIN_STRUCTLEAK
 	bool "Force initialization of variables containing userspace addresses"
 	depends on GCC_PLUGINS
+	# Currently STRUCTLEAK inserts initialization out of live scope of
+	# variables from KASAN point of view. This leads to KASAN false
+	# positive reports. Prohibit this combination for now.
+	depends on !KASAN_EXTRA
 	help
 	  This plugin zero-initializes any structures containing a
 	  __user attribute. This can prevent some classes of information
-- 
2.17.0.484.g0c8726318c-goog

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-01  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 17:24 [PATCH v2] KASAN: prohibit KASAN+STRUCTLEAK combination Dmitry Vyukov
2018-04-19 20:43 ` Kees Cook
2018-04-20  5:33   ` Dennis Zhou
2018-04-20  5:56     ` Dmitry Vyukov
2018-04-21 21:06       ` Dennis Zhou
2018-04-21 21:13         ` Kees Cook
2018-04-22  0:15           ` Dennis Zhou
2018-04-30 23:41 ` Kees Cook
2018-05-01  0:36   ` Dennis Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox