linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] Add kernel config option for tweaking kernel behavior.
@ 2020-04-13  6:33 Tetsuo Handa
  2020-04-13  8:14 ` Greg Kroah-Hartman
  2020-04-13 18:13 ` Linus Torvalds
  0 siblings, 2 replies; 11+ messages in thread
From: Tetsuo Handa @ 2020-04-13  6:33 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, Peter Zijlstra, LKML, Tetsuo Handa,
	Dmitry Vyukov

Existing kernel config options are defined based on "whether you want to
enable this module/feature or not". And such granularity is sometimes
too rough-grained for fuzzing tools which try to find bugs inside each
module/feature.

While syzkaller (one of fuzzing tools) is finding many bugs, sometimes
syzkaller examines stupid operations. Some examples of such operations
are: changing console loglevel which in turn makes it impossible to get
kernel messages when a crash happens, freezing filesystems which in turn
causes khungtaskd to needlessly complain, programmatically sending
Ctrl-Alt-Del which in turn causes the system to needlessly reboot.
Currently we prevent syzkaller from examining stupid operations by
blacklisting syscall arguments and/or disabling whole functionality
using existing kernel config options. But such approach is difficult to
maintain and needlessly prevents fuzzers from testing kernel code. [1]

We want fuzzers to test as much coverage as possible while we want
fuzzers not to try stupid operations. To achieve this goal, we want
cooperation from kernel side, and build-time branching (i.e. kernel
config options) will be the simplest and the most reliable.

Therefore, this patch introduces a kernel config option which allows
selecting fine-grained kernel config options for tweaking kernel's
behavior. Each fine-grained kernel config option will be added by future
patches. For ease of management, grouping kernel config options for
allowing e.g. syzkaller to select all fine-grained kernel config options
which e.g. syzkaller wants would be added by future patches.

[1] https://lkml.kernel.org/r/CACT4Y+a6KExbggs4mg8pvoD554PcDqQNW4sM15X-tc=YONCzYw@mail.gmail.com

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

Changes since v2 ( https://lkml.kernel.org/r/20200307135822.3894-1-penguin-kernel@I-love.SAKURA.ne.jp ):
  Reduce the role of this kernel config option from "enable everything
  which would be useful for fuzz testing" to "simply serve as a gate for
  hiding individual kernel config option", for we should use individual
  kernel config option for tweaking individual kernel behavior.

Changes since v1 ( https://lkml.kernel.org/r/20191216095955.9886-1-penguin-kernel@I-love.SAKURA.ne.jp ):
  Drop users of this kernel config option.
  Update patch description.

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 50c1f5f08e6f..a7c3ebc21428 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2223,4 +2223,15 @@ config HYPERV_TESTING
 
 endmenu # "Kernel Testing and Coverage"
 
+menuconfig TWEAK_KERNEL_BEHAVIOR
+	bool "Tweak kernel behavior"
+	help
+	  Saying Y here allows modifying kernel behavior via kernel
+	  config options which will become visible by selecting this
+	  config option.
+
+if TWEAK_KERNEL_BEHAVIOR
+
+endif # TWEAK_KERNEL_BEHAVIOR
+
 endmenu # Kernel hacking
-- 
2.18.2


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

end of thread, other threads:[~2020-04-18 15:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13  6:33 [PATCH v3] Add kernel config option for tweaking kernel behavior Tetsuo Handa
2020-04-13  8:14 ` Greg Kroah-Hartman
2020-04-18 14:28   ` Tetsuo Handa
2020-04-18 14:39     ` Greg Kroah-Hartman
2020-04-18 15:08       ` Tetsuo Handa
2020-04-13 18:13 ` Linus Torvalds
2020-04-14  8:02   ` Tetsuo Handa
2020-04-15  0:05     ` Tetsuo Handa
2020-04-15  1:14       ` Linus Torvalds
2020-04-15  1:43         ` Steven Rostedt
2020-04-16  0:47   ` Tetsuo Handa

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).