Re: [RFC][PATCH] panic: lib: Add TAINT for FAULT_INJECTION
From: Steven Rostedt
Date: Thu Apr 10 2025 - 21:25:06 EST
On Thu, 10 Apr 2025 13:51:14 -0700
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> > It may also be useful for other bug reports.
>
> Seems sane. Does any userspace tooling need an update for this?
Well, the syzbot does show the taints in their reports. It can use that to
explicitly state that the kernel has fault injections, or at least the
developer can see the taint.
>
> > --- 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);
> >
> > + pr_notice_once("Tainting kernel with TAINT_FAULT_INJECTION\n");
> > + add_taint(TAINT_FAULT_INJECTION, LOCKDEP_STILL_OK);
>
> if (pr_notice_once("Tainting kernel with TAINT_FAULT_INJECTION\n"))
> add_taint(TAINT_FAULT_INJECTION, LOCKDEP_STILL_OK);
>
> perhaps?
I'm fine with that too. I can send a v2.
-- Steve
>
> > return true;
> > }
> >