STABLE REQ: [PATCH v5 06/10] tracing: Fix subbuf resize races with trace_pipe_raw readers
From: Lee Jones
Date: Tue Sep 01 2026 - 08:35:00 EST
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 <vdonnefort@xxxxxxxxxx>
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