linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] tracing: Simplify the max length test when using the filtering temp buffer
Date: Wed, 9 Jun 2021 15:21:52 -0700	[thread overview]
Message-ID: <CAHk-=wj3S_DxdQkXVaQKcUBCyjiYHC3KqPBTMY151rvZzqKVFQ@mail.gmail.com> (raw)
In-Reply-To: <20210609220537.927890401@goodmis.org>

On Wed, Jun 9, 2021 at 3:05 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
>                 val = this_cpu_inc_return(trace_buffered_event_cnt);
> -               if ((len < (PAGE_SIZE - sizeof(*entry) - sizeof(entry->array[0]))) && val == 1) {
> +               if (val == 1 && unlikely(len < max_len)) {

unlikely? No.

Also, I still think that "len < max_len" should actually be "len <=
max_len".  It should be ok to use the whole page, no?

Unless there is some *other* overflow issue, and "len" doesn't contain
a terminating NUL character or something like that.

              Linus

  reply	other threads:[~2021-06-09 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 22:04 [PATCH 0/2] tracing: Simplify and document the trace event filtering temp buffer code Steven Rostedt
2021-06-09 22:04 ` [PATCH 1/2] tracing: Simplify the max length test when using the filtering temp buffer Steven Rostedt
2021-06-09 22:21   ` Linus Torvalds [this message]
2021-06-09 22:36     ` Steven Rostedt
2021-06-09 22:04 ` [PATCH 2/2] tracing: Add better comments for the filtering temp buffer use case Steven Rostedt

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='CAHk-=wj3S_DxdQkXVaQKcUBCyjiYHC3KqPBTMY151rvZzqKVFQ@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).