From: Steven Rostedt <rostedt@goodmis.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Theodore Ts'o <tytso@mit.edu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Chris Mason <clm@meta.com>, Borislav Petkov <bp@alien8.de>,
LKML <linux-kernel@vger.kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Kees Cook <keescook@chromium.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
KP Singh <kpsingh@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Florent Revest <revest@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Christoph Hellwig <hch@infradead.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: [PATCH] error-injection: Add prompt for function error injection
Date: Fri, 2 Dec 2022 18:17:24 -0500 [thread overview]
Message-ID: <20221202181724.4ec93cf0@gandalf.local.home> (raw)
In-Reply-To: <20221202212711.5ot66apmazm4yz6y@macbook-pro-6.dhcp.thefacebook.com>
On Fri, 2 Dec 2022 13:27:11 -0800
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -1874,8 +1874,12 @@ config NETDEV_NOTIFIER_ERROR_INJECT
> If unsure, say N.
>
> config FUNCTION_ERROR_INJECTION
Why not just call this "ERROR_INJECTION" having this be FUNCTION and the
one for functions be FUNC is confusing.
> + bool
> +
> +config FUNC_ERROR_INJECTION
> bool "Fault-injections of functions"
> depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
> + select FUNCTION_ERROR_INJECTION
> help
> Add fault injections into various functions that are annotated with
> ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return
> @@ -1883,6 +1887,17 @@ config FUNCTION_ERROR_INJECTION
>
> If unsure, say N
>
> +config SYSCALL_ERROR_INJECTION
> + bool "Error injections in syscalls"
> + depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
> + select FUNCTION_ERROR_INJECTION
> + default y
IIUC, Linus prefers everything to be "default n" unless there's a really
good reason for it. Like only making other options available, but not doing
anything to the kernel. I do have DYNAMIC_FTRACE as "default y" but that's
only because it depends on CONFIG_FUNCTION_TRACER and nobody that enables
that should have DYNAMIC_FTRACE off (except for academia).
> + help
> + Allows error injection framework to return errors from syscalls.
> + BPF may modify return values of syscalls as well.
And here's the thing. If BPF returns anything *but* an error, then this is
a misnomer and incorrect. Name it something else like "HIJACK_SYSCALLS".
> +
> + If unsure, say Y
And I'm curious, why Y if unsure?
-- Steve
> +
> config FAULT_INJECTION
> bool "Fault-injection framework"
> depends on DEBUG_KERNEL
> diff --git a/lib/error-inject.c b/lib/error-inject.c
> index 1afca1b1cdea..9ba868eb8c43 100644
> --- a/lib/error-inject.c
> +++ b/lib/error-inject.c
> @@ -71,6 +71,10 @@ static void populate_error_injection_list(struct error_injection_entry *start,
>
> mutex_lock(&ei_mutex);
> for (iter = start; iter < end; iter++) {
> + if (iter->etype != EI_ETYPE_SYSCALL &&
> + !IS_ENABLED(CONFIG_FUNC_ERROR_INJECTION))
> + continue;
> +
> entry = (unsigned long)dereference_symbol_descriptor((void *)iter->addr);
>
> if (!kernel_text_address(entry) ||
> @@ -189,6 +193,8 @@ static const char *error_type_string(int etype)
> return "ERRNO_NULL";
> case EI_ETYPE_TRUE:
> return "TRUE";
> + case EI_ETYPE_SYSCALL:
> + return "SYSCALL";
> default:
> return "(unknown)";
> }
next prev parent reply other threads:[~2022-12-02 23:17 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221202181724.4ec93cf0@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=bp@alien8.de \
--cc=clm@meta.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=peterz@infradead.org \
--cc=revest@chromium.org \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox