[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250402131431.218d3458@gandalf.local.home>
Date: Wed, 2 Apr 2025 13:14:31 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Masami
Hiramatsu <mhiramat@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Vincent Donnefort <vdonnefort@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>, Jann
Horn <jannh@...gle.com>
Subject: Re: [PATCH v5 3/4] tracing: Use vmap_page_range() to map memmap
ring buffer
On Wed, 2 Apr 2025 13:03:37 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:
> That also means all the tricks to determine where the page in the ring
> buffer came from can go away.
I wonder, just to be safe, if I should add in the ring buffer mapping code:
/* If the buffer is not part of the normal memory, do not allow mapping */
if (!virt_addr_valid(cpu_buffer->reader_page->page))
return -ENODEV;
?
As the buffer can come from anywhere, but we only allow a memory mapping to
user space if the buffer is from the normal memory allocator.
Currently, this patch series has the caller (the tracing code) prevent
allowing memmap to be user mapped. Perhaps the above should include a
WARN_ON_ONCE()?
-- Steve
Powered by blists - more mailing lists