Re: [PATCH] panic: lib: Add TAINT for FAULT_INJECTION
From: Greg Kroah-Hartman
Date: Fri Apr 11 2025 - 10:35:05 EST
On Fri, Apr 11, 2025 at 08:53:55AM -0400, Steven Rostedt wrote:
> --- a/lib/fault-inject.c
> +++ b/lib/fault-inject.c
> @@ -176,6 +176,9 @@ bool should_fail_ex(struct fault_attr *attr, ssize_t size, int flags)
> if (atomic_read(&attr->times) != -1)
> atomic_dec_not_zero(&attr->times);
>
> + if (pr_notice_once("Tainting kernel with TAINT_FAULT_INJECTION\n"))
> + add_taint(TAINT_FAULT_INJECTION, LOCKDEP_STILL_OK);
It took me a while to think that this is the proper place to put it, but
it seems reasonable enough in the end, as you only will set the flag if
a "failure" actually happens.
Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>