mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eiichi Tsukata <devel@etsukata.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] tracing: Fix out-of-range read in trace_stack_print()
Date: Sun, 30 Jun 2019 18:03:59 +0900	[thread overview]
Message-ID: <398c816d-e80e-9277-569a-2a6b5632e812@etsukata.com> (raw)
In-Reply-To: <20190614163136.25115131@gandalf.local.home>



On 2019/06/15 5:31, Steven Rostedt wrote:
...

> 
>>
>> Fixes: 4a9bd3f134dec ("tracing: Have dynamic size event stack traces")
> 
> Actually it fixes:
> 
>  4285f2fcef80 ("tracing: Remove the ULONG_MAX stack trace hackery")
> 
> Because before that, a ULONG_MAX was inserted into the buffer.
> 
> -- Steve

Thank you for the advice.
Now there is no ULONG_MAX marker, so I should have fixed it by just
removing `*p != ULONG_MAX` check, right?


Thanks

Eiichi

> 
>> Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
>> ---
>>  kernel/trace/trace_output.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
>> index 54373d93e251..ba751f993c3b 100644
>> --- a/kernel/trace/trace_output.c
>> +++ b/kernel/trace/trace_output.c
>> @@ -1057,7 +1057,7 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
>>  
>>  	trace_seq_puts(s, "<stack trace>\n");
>>  
>> -	for (p = field->caller; p && *p != ULONG_MAX && p < end; p++) {
>> +	for (p = field->caller; p && p < end && *p != ULONG_MAX; p++) {
>>  
>>  		if (trace_seq_has_overflowed(s))
>>  			break;
> 

      reply	other threads:[~2019-06-30  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10  4:00 Eiichi Tsukata
2019-06-14 20:31 ` Steven Rostedt
2019-06-30  9:03   ` Eiichi Tsukata [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=398c816d-e80e-9277-569a-2a6b5632e812@etsukata.com \
    --to=devel@etsukata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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®