Re: [PATCH v2] tracing: Fix crash passing ERR_PTR to kthread_stop()

Steven Rostedt <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,dev.linux.lists.sashiko-reviews
Message-ID <20260817092642.0e65f5bf@robin>
On Mon, 17 Aug 2026 12:15:32 +0000
[email protected] wrote:

> > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> > index 0356cae0cf74e..9e941e5805f5e 100644
> > --- a/kernel/trace/trace_events.c
> > +++ b/kernel/trace/trace_events.c
> > @@ -3866,6 +3866,8 @@ static __init void event_test_stuff(void)
> >  	struct task_struct *test_thread;
> >  
> >  	test_thread = kthread_run(event_test_thread, NULL, "test-events");
> > +	if (WARN_ON(IS_ERR(test_thread)))
> > +		return;  
> 
> [Severity: High]
> Does this risk causing a console flood and soft lockup if thread creation
> persistently fails?
> 

If that happens than the system is doomed to begin with. We don't care
here. This patch is good enough. It's for a debugging feature, not
anything that would be run in production.

Just look at the name of the function: event_test_stuff()

This is where AI has a hard time with subtle requirements.

Thanks,

-- Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.