mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Akinobu Mita <akinobu.mita@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Petr Mladek <pmladek@suse.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC][PATCH] panic: lib: Add TAINT for FAULT_INJECTION
Date: Thu, 10 Apr 2025 13:51:14 -0700	[thread overview]
Message-ID: <20250410135114.1c8bc2987b9a968d92b3a55a@linux-foundation.org> (raw)
In-Reply-To: <20250410144359.526476bc@gandalf.local.home>

On Thu, 10 Apr 2025 14:43:59 -0400 Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <rostedt@goodmis.org>
> 
> There's been several times where syzbot reports a bug that was caused by a
> fault injection, but it doesn't report this fact in its email reports.
> The bug report could happen in code that wasn't involved with the fault
> injection due to the code that faulted not cleaning up things properly,
> leading to an unstable kernel, which in turn can trigger issues elsewhere
> that doesn't have a bug (much like a proprietary module could do).
> 
> It would be very useful if the syzbot report notified the developer that
> the test had injected faults into the kernel.
> 
> Introduce a new taint flag 'V' that gets set when a fault injection takes
> place. (Note, there's not many taint flags left, so 'V' looked as good as
> any other value).
> 
> This will let the syzbot see that the kernel had a fault injection during
> the test and can report that it happened when sending out its emails.
> 
> It may also be useful for other bug reports.

Seems sane.  Does any userspace tooling need an update for this?

> --- 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?

>  	return true;
>  }
>  
> -- 
> 2.47.2

  reply	other threads:[~2025-04-10 20:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 18:43 Steven Rostedt
2025-04-10 20:51 ` Andrew Morton [this message]
2025-04-11  1:25   ` Steven Rostedt

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=20250410135114.1c8bc2987b9a968d92b3a55a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=akinobu.mita@gmail.com \
    --cc=dvyukov@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®