Re: [PATCH] tracing: Reject tracefs buffer size values that overflow bytes

From: Steven Rostedt

Date: Tue Jun 02 2026 - 16:10:14 EST


On Tue, 2 Jun 2026 18:43:34 +0000
Sam Moelius <sam.moelius@xxxxxxxxxxxxxxx> wrote:

> From: Samuel Moelius <sam.moelius@xxxxxxxxxxxxxxx>
>
> `tracing_entries_write()` accepts a `buffer_size_kb` value as
> `unsigned long`, checks only for zero, then shifts left by 10. On
> 64-bit, writing `18014398509481984` KB wraps the byte count to zero
> and the ring buffer resize path accepts it as a tiny buffer instead
> of rejecting an impossible huge size.
>
> The fix also adds the same pre-scale overflow check to
> `buffer_subbuf_size_write()`.

Honestly, enter stupid values, get stupid results.

I don't think this is necessary. Nothing breaks but the person may get
confused by being confused by the confusing entries they make.

-- Steve