Thread (52 messages) flat view 52 messages, 7 authors, 15d ago

STABLE REQ: [PATCH v5 06/10] tracing: Fix subbuf resize races with trace_pipe_raw readers

From: Lee Jones <lee@kernel.org>
Date: 2026-09-01 12:34:49
Also in: lkml, stable

Dear Stable,
Concurrent subbuffer resizes may crash trace_pipe_raw readers or leak
uninitialized memory to userspace due to stale size values.

Modify ring_buffer_alloc_read_page() to let it handle the resizing of
a previous buffer_data_read_page if necessary and add a new
ring_buffer_read_page_size() which enable ring-buffer users to not use
the racy ring_buffer_subbuf_size_get(). This makes the spare_size member
of ftrace_buffer_info redundant.

Use those functions in trace_pipe_raw readers and handle in both the
case where the subbuf order is modified in the middle of the read.

Fixes: bce761d75745 ("ring-buffer: Read and write to ring buffers with custom sub buffer size")
Signed-off-by: Vincent Donnefort <redacted>
Not sure if this is the latest version or not?

I see review comments, but no v6.  Anyway, no matter, it'll do.

Could we have this applied to Stable please:

8a5f63637890 ("ring-buffer: Fix subbuf resize race with ring buffer readers")

-- 
Lee Jones
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help