mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pu Lehui <pulehui@huawei.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: <mhiramat@kernel.org>, <mathieu.desnoyers@efficios.com>,
	Pu Lehui <pulehui@huaweicloud.com>,
	<linux-kernel@vger.kernel.org>,
	<linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] tracing: Fix missing errno when zero parser->idx in trace_pid_write
Date: Mon, 8 Sep 2025 10:47:10 +0800	[thread overview]
Message-ID: <f1cb1d05-d4da-4a5f-a7b2-0316feda71ff@huawei.com> (raw)
In-Reply-To: <20250905153926.68b47107@gandalf.local.home>


On 2025/9/6 3:39, Steven Rostedt wrote:
> On Wed, 3 Sep 2025 12:15:16 +0800
> Pu Lehui <pulehui@huawei.com> wrote:
> 
>> As for this fault injection syzkaller issue, shall we need to silence
>> it? How about the below fix?
> 
> I usually don't care about fault injections because it causes "faults" that
> would only happen if the system was about to crash. But anyway..

agree!

> 
>>
>> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
>> index e6b50b416e63..c17c031e7917 100644
>> --- a/kernel/trace/trace.c
>> +++ b/kernel/trace/trace.c
>> @@ -834,7 +834,11 @@ int trace_pid_write(struct trace_pid_list
>> *filtered_pids,
>>                   /* copy the current bits to the new max */
>>                   ret = trace_pid_list_first(filtered_pids, &pid);
>>                   while (!ret) {
>> -                       trace_pid_list_set(pid_list, pid);
>> +                       ret = trace_pid_list_set(pid_list, pid);
>> +                       if (ret) {
>> +                               trace_parser_put(&parser);
>> +                               return ret;
>> +                       }
> 
> make it:
> 
> 			if (ret < 0)
> 				goto out;
> 
>>                           ret = trace_pid_list_next(filtered_pids, pid +
>> 1, &pid);
>>                           nr_pids++;
>>                   }
> 
> And put the out label just before the trace_parser_put().
> 
> Oh, and add one space before the "out:" label. That makes diffs of patches
> show the function when changes are after the label and not the label itself.

Looks like an interesting ops. Will do

> 
> -- Steve
> 

      reply	other threads:[~2025-09-08  3:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21  7:17 Pu Lehui
2025-08-28  2:02 ` Pu Lehui
2025-08-28  2:58   ` Steven Rostedt
2025-09-02 15:09 ` kernel test robot
2025-09-05 19:03   ` Steven Rostedt
2025-09-11  8:23     ` Oliver Sang
2025-09-11 14:04       ` Steven Rostedt
2025-09-03  4:15 ` Pu Lehui
2025-09-05 19:39   ` Steven Rostedt
2025-09-08  2:47     ` Pu Lehui [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=f1cb1d05-d4da-4a5f-a7b2-0316feda71ff@huawei.com \
    --to=pulehui@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=pulehui@huaweicloud.com \
    --cc=rostedt@goodmis.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®