public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] error-injection: Add prompt for function error injection
@ 2022-11-21 15:44 Steven Rostedt
  2022-11-21 19:32 ` Borislav Petkov
  2022-11-21 22:24 ` [PATCH] error-injection: Add prompt for function error injection Masami Hiramatsu
  0 siblings, 2 replies; 44+ messages in thread
From: Steven Rostedt @ 2022-11-21 15:44 UTC (permalink / raw)
  To: LKML
  Cc: Linus Torvalds, Masami Hiramatsu, Andrew Morton, Peter Zijlstra,
	Kees Cook, Josh Poimboeuf, KP Singh, Chris Mason, Mark Rutland,
	Alexei Starovoitov, Florent Revest, Greg Kroah-Hartman,
	Christoph Hellwig

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The config to be able to inject error codes into any function annotated
with ALLOW_ERROR_INJECTION() is enabled when CONFIG_FUNCTION_ERROR_INJECTION
is enabled. But unfortunately, this is always enabled on x86 when KPROBES
is enabled, and there's no way to turn it off.

As kprobes is useful for observability of the kernel, it is useful to have
it enabled in production environments. But error injection should be
avoided. Add a prompt to the config to allow it to be disabled even when
kprobes is enabled, and get rid of the "def_bool y".

This is a kernel debug feature (it's in Kconfig.debug), and should have
never been something enabled by default.

Cc: stable@vger.kernel.org
Fixes: 540adea3809f6 ("error-injection: Separate error-injection from kprobe")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 lib/Kconfig.debug | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index c3c0b077ade3..9ee72d8860c3 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1874,8 +1874,14 @@ config NETDEV_NOTIFIER_ERROR_INJECT
 	  If unsure, say N.
 
 config FUNCTION_ERROR_INJECTION
-	def_bool y
+	bool "Fault-injections of functions"
 	depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
+	help
+	  Add fault injections into various functions that are annotated with
+	  ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return
+	  value of theses functions. This is useful to test error paths of code.
+
+	  If unsure, say N
 
 config FAULT_INJECTION
 	bool "Fault-injection framework"
-- 
2.35.1


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

end of thread, other threads:[~2022-12-06  2:05 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 15:44 [PATCH] error-injection: Add prompt for function error injection Steven Rostedt
2022-11-21 19:32 ` Borislav Petkov
2022-11-21 23:36   ` Alexei Starovoitov
2022-11-22  0:09     ` Masami Hiramatsu
2022-11-22  0:24     ` Steven Rostedt
2022-11-22  0:40       ` Steven Rostedt
2022-11-22 10:39     ` Borislav Petkov
2022-11-22 17:42       ` Chris Mason
2022-11-22 18:16         ` Borislav Petkov
2022-11-22 18:29         ` Steven Rostedt
2022-11-22 19:51           ` Chris Mason
2022-11-30 22:37             ` Andrew Morton
2022-12-01 16:58               ` Alexei Starovoitov
2022-12-01 17:39                 ` Benjamin Tissoires
2022-12-01 21:12                 ` Andrew Morton
2022-12-01 21:13                 ` Linus Torvalds
2022-12-02  0:46                   ` Jiri Kosina
2022-12-02  0:57                     ` Linus Torvalds
2022-12-02  1:03                       ` Jiri Kosina
2022-12-02  1:32                         ` Steven Rostedt
2022-12-02  1:41                   ` Alexei Starovoitov
2022-12-02 15:56                     ` Theodore Ts'o
2022-12-02 21:27                       ` Alexei Starovoitov
2022-12-02 23:17                         ` Steven Rostedt
2022-12-03  0:55                           ` Alexei Starovoitov
2022-12-04 22:50                         ` Masami Hiramatsu
2022-12-06  2:05                           ` Alexei Starovoitov
2022-12-02 14:55                   ` Benjamin Tissoires
2022-12-02 19:30                     ` Alexei Starovoitov
2022-12-05 17:01                       ` Benjamin Tissoires
2022-12-01 14:41         ` Masami Hiramatsu
2022-12-01 16:37           ` [RFC PATCH] panic: Add new taint flag for fault injection Masami Hiramatsu (Google)
2022-12-01 16:39             ` Kees Cook
2022-12-01 16:48               ` Steven Rostedt
2022-12-01 16:53                 ` Kees Cook
2022-12-01 19:14                   ` Steven Rostedt
2022-12-01 21:00                     ` Chris Mason
2022-12-01 21:18                       ` Linus Torvalds
2022-12-02  6:17                         ` Christoph Hellwig
2022-12-01 21:25                       ` Steven Rostedt
2022-12-01 21:29                         ` Steven Rostedt
2022-12-02  0:46                     ` Masami Hiramatsu
2022-12-01 16:40             ` Steven Rostedt
2022-11-21 22:24 ` [PATCH] error-injection: Add prompt for function error injection Masami Hiramatsu

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