Re: [PATCH v5 3/4] tracing: Use vmap_page_range() to map memmap ring buffer
From: Steven Rostedt
Date: Wed Apr 02 2025 - 13:13:34 EST
On Wed, 2 Apr 2025 13:03:37 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> 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