[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210609183653.0b77510c@rorschach.local.home>
Date: Wed, 9 Jun 2021 18:36:53 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] tracing: Simplify the max length test when using
the filtering temp buffer
On Wed, 9 Jun 2021 15:21:52 -0700
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, Jun 9, 2021 at 3:05 PM Steven Rostedt <rostedt@...dmis.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.
Bah, that was suppose to be "likely()" :-p
>
> Also, I still think that "len < max_len" should actually be "len <=
> max_len". It should be ok to use the whole page, no?
Sure, I was still being paranoid. ;-)
>
> Unless there is some *other* overflow issue, and "len" doesn't contain
> a terminating NUL character or something like that.
>
No, this is kind of like an internal "malloc", where the caller is
passing in the length via "len" of what it needs.
-- Steve
Powered by blists - more mailing lists