# Re: STABLE REQ: \[PATCH v5 06/10\] tracing: Fix subbuf resize races with trace\_pipe\_raw readers

- From: Vincent Donnefort \<vdonnefort@google.com\>
- Date: 2026-09-01 13:50:21 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/09/17492005
- Thread: https://ratatoskr.run/stable/2026/09/17491517/t.md

```text
On Tue, Sep 01, 2026 at 01:34:44PM +0100, Lee Jones wrote:
> 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@google.com>
> 
> 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

Steven hasn't taken all the patches from v5, a few of them were not ready yet.

The latest version is v8 [1]... and I am about to send a v9.

[1] https://lore.kernel.org/all/20260826094528.3738023-1-vdonnefort@google.com/ 

-- 
Vincent
```
