linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Add kernel config option for fuzz testing.
@ 2020-03-07 13:58 Tetsuo Handa
  2020-03-07 16:28 ` Jiri Slaby
  2020-03-08  6:52 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 19+ messages in thread
From: Tetsuo Handa @ 2020-03-07 13:58 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Matthew Garrett, Andi Kleen, Theodore Y . Ts'o,
	Greg Kroah-Hartman, Alexander Viro, Petr Mladek,
	Sergey Senozhatsky, Arnd Bergmann, Jiri Slaby, Steven Rostedt,
	Linus Torvalds, LKML, Tetsuo Handa, Dmitry Vyukov

While syzkaller is finding many bugs, sometimes syzkaller examines
stupid operations. Currently we prevent syzkaller from examining
stupid operations by blacklisting syscall arguments and/or disabling
whole functionality using existing kernel config options, but it is
a whack-a-mole approach. We need cooperation from kernel side [1].

This patch introduces a kernel config option which allows disabling
only specific operations. This kernel config option should be enabled
only when building kernels for fuzz testing.

We discussed possibility of disabling specific operations at run-time
using some lockdown mechanism [2], but conclusion seems that build-time
control (i.e. kernel config option) fits better for this purpose.
Since patches for users of this kernel config option will want a lot of
explanation [3], this patch provides only kernel config option for them.

[1] https://github.com/google/syzkaller/issues/1622
[2] https://lkml.kernel.org/r/CACdnJutc7OQeoor6WLTh8as10da_CN=crs79v3Fp0mJTaO=+yw@mail.gmail.com
[3] https://lkml.kernel.org/r/20191216163155.GB2258618@kroah.com

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Dmitry Vyukov <dvyukov@google.com>
---
 lib/Kconfig.debug | 10 ++++++++++
 1 file changed, 10 insertions(+)

Changes since v1:
  Drop users of this kernel config option.
  Update patch description.

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 53e786e0a604..e360090e24c5 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2208,4 +2208,14 @@ config HYPERV_TESTING
 
 endmenu # "Kernel Testing and Coverage"
 
+config KERNEL_BUILT_FOR_FUZZ_TESTING
+       bool "Build kernel for fuzz testing"
+       default n
+       help
+	 Say N unless you are building kernels for fuzz testing.
+	 Saying Y here disables several things that legitimately cause
+	 damage under a fuzzer workload (e.g. copying to arbitrary
+	 user-specified kernel address, changing console loglevel,
+	 freezing filesystems).
+
 endmenu # Kernel hacking
-- 
2.18.2


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

end of thread, other threads:[~2020-04-10  4:39 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-07 13:58 [PATCH v2] Add kernel config option for fuzz testing Tetsuo Handa
2020-03-07 16:28 ` Jiri Slaby
2020-03-08  6:52   ` Greg Kroah-Hartman
2020-03-08 16:13     ` Linus Torvalds
2020-03-09 11:22       ` Tetsuo Handa
2020-03-09 13:23         ` Steven Rostedt
2020-03-09 15:39     ` Jiri Slaby
2020-03-10  6:30       ` Dmitry Vyukov
2020-03-11 14:11         ` Steven Rostedt
2020-03-12 19:23           ` Dmitry Vyukov
2020-03-12 21:59             ` Tetsuo Handa
2020-03-12 22:29               ` Steven Rostedt
2020-03-13  8:31                 ` Peter Zijlstra
2020-03-15  5:54                 ` Dmitry Vyukov
2020-03-21  4:49         ` Tetsuo Handa
2020-03-24 10:37           ` Dmitry Vyukov
2020-03-26 11:10             ` Tetsuo Handa
2020-04-10  4:38               ` Tetsuo Handa
2020-03-08  6:52 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).