]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()
authorVincent Donnefort <vdonnefort@google.com>
Thu, 6 Aug 2026 21:13:03 +0000 (22:13 +0100)
committerSteven Rostedt <rostedt@goodmis.org>
Sun, 9 Aug 2026 02:26:11 +0000 (22:26 -0400)
In rb_allocate_cpu_buffer(), bpage->order was omitted, leaving it as 0.
This is an issue for a ring-buffer with subbufs bigger than PAGE_SIZE if
when freed: free_buffer_page() relies on this value. Align the value
with the actual allocation size (buffer::subbuf_order).

Cc: stable@vger.kernel.org
Fixes: f9b94daa542a ("ring-buffer: Set new size of the ring buffer sub page")
Link: https://patch.msgid.link/20260806211306.3704194-4-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c

index 6cbd80ccef37724bdf24335f6d54c64162cada1c..760a00e8505cf4a4474101d8723ed0a609da9506 100644 (file)
@@ -2510,6 +2510,7 @@ rb_allocate_cpu_buffer(struct trace_buffer *buffer, long nr_pages, int cpu)
        bpage = alloc_cpu_page(cpu);
        if (!bpage)
                return NULL;
+       bpage->order = cpu_buffer->buffer->subbuf_order;
 
        rb_check_bpage(cpu_buffer, bpage);