mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Qiujun Huang <hqjagain@gmail.com>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH v4] tracing: Fix out of bounds write in get_trace_buf
Date: Thu, 29 Oct 2020 14:49:35 -0400	[thread overview]
Message-ID: <20201029144935.09c4ce8b@gandalf.local.home> (raw)
In-Reply-To: <20201029161905.4269-1-hqjagain@gmail.com>

On Fri, 30 Oct 2020 00:19:05 +0800
Qiujun Huang <hqjagain@gmail.com> wrote:

> The subscript should be nesting - 1, as nesting had self-added.
> 
> Fixes: 3d9622c12c887 ("tracing: Add barrier to trace_printk() buffer nesting modification")

Thanks, I'll still use the updated change log.

-- Steve

> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
> v4:
> Find the right patch which cause the problem.
> v3:
> Modify the way of array reference instead.
> v2:
> Fix a typo in the title.
> ---
>  kernel/trace/trace.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 528971714fc6..daa96215e294 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -3132,7 +3132,7 @@ static char *get_trace_buf(void)
>  
>  	/* Interrupts must see nesting incremented before we use the buffer */
>  	barrier();
> -	return &buffer->buffer[buffer->nesting][0];
> +	return &buffer->buffer[buffer->nesting - 1][0];
>  }
>  
>  static void put_trace_buf(void)


      reply	other threads:[~2020-10-29 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 16:19 Qiujun Huang
2020-10-29 18:49 ` 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=20201029144935.09c4ce8b@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=hqjagain@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.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

all inboxes | Powered by JetHome®