History

ring-buffer: Initialise reader page order in rb_allocate_cpu_buffer()

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).

Vincent Donnefort committed 3 months ago

Commit 6d014e41 parent bf98d7b1 file · +1 −0Browse files

Unified · Split

kernel/trace/ring_buffer.c+1−0
@@ -2510,6 +2510,7 @@ rb_allocate_cpu_buffer(struct trace_buffer *buffer, long nr_pages, int cpu) · 2509 unmodified lines
25102510 bpage = alloc_cpu_page(cpu);
25112511 if (!bpage)
25122512 return NULL;
2513+ bpage->order = cpu_buffer->buffer->subbuf_order;
25132514
25142515 rb_check_bpage(cpu_buffer, bpage);
25152516