From: Steven Rostedt <rostedt@goodmis.org>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev, "Hui Su" <sh_def@163.com>,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] tracing: Fix crash passing ERR_PTR to kthread_stop()
Date: Sun, 16 Aug 2026 19:15:08 -0400 [thread overview]
Message-ID: <20260816191508.27f87c31@robin> (raw)
In-Reply-To: <20260815191034.82D8F1F000E9@smtp.kernel.org>
On Sat, 15 Aug 2026 19:10:34 +0000
sashiko-bot@kernel.org wrote:
> > diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> > index 0356cae0cf74e..207f47f54dbbf 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 (IS_ERR(test_thread))
> > + return;
>
> [Severity: Medium]
> Does returning silently here cause the self-test framework to falsely report
> success when the workload thread cannot be created?
>
> The caller event_trace_self_tests() unconditionally prints "OK" after calling
> this function:
>
> kernel/trace/trace_events.c:event_trace_self_tests() {
> ...
> ftrace_event_enable_disable(file, 1);
> event_test_stuff();
> ftrace_event_enable_disable(file, 0);
>
> pr_cont("OK\n");
> }
> ...
> }
>
> Should event_test_stuff() propagate the error so that the caller can correctly
> report the test failure or skip it appropriately?
Right, this is just a boot up test that is only done for debugging.
This is not something for production. If it fails, it should not fail
silently. If anything, it should be:
if (WARN_ON(IS_ERR(test_thread))
return;
-- Steve
prev parent reply other threads:[~2026-08-16 23:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-15 19:01 [PATCH] tracing: Fix crash passing ERR_PTR to kthread_stop() Hui Su
2026-08-15 19:10 ` sashiko-bot
2026-08-16 23:15 ` Steven Rostedt [this message]
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=20260816191508.27f87c31@robin \
--to=rostedt@goodmis.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sh_def@163.com \
/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