Re: [PATCH] tracing: Do not allow mmap() of persistent ring buffer

Masami Hiramatsu
2025-02-15T15:37:05Z

On Fri, 14 Feb 2025 09:59:43 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 14 Feb 2025 23:36:13 +0900
> Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> > >
> > > It's not supported. If you try it, it will crash. This prevents reading via
> > > mmap() on a boot buffer. I don't know what you are asking. Once this patch
> > > is applied, mmap() will always fail on the boot buffer before or after you
> > > start it.
> >
> > Hmm, I meant it is supported for other non-persisten ring buffer, isn't it?
>
> Correct. It is supported in other buffers, but it just isn't supported in
> the persistent one.
>
> This patch only disables mmap if it's trying to mmap a persistent one.
>
> I guess I don't understand your concern.

My concern is related to the fixes policy. If this is a "fix", we will
backport the new "disables mmap on persistent ring buffer" limitation
to the stable kernel (that was not documented previously.)

However, from the user point of view, "mmap() ring buffers" is already
supported (although it did not work on stable kernel for now). Thus I think
the "Fix" is expected as "fixing mmap() persistent ring buffer".

Thank you,

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>