Re: [PATCH -next] ftrace: Fix potential warning in trace_printk_seq during ftrace_dump

From: Tengda Wu
Date: Thu Aug 21 2025 - 21:35:57 EST




On 2025/8/21 22:51, Steven Rostedt wrote:
> On Thu, 21 Aug 2025 09:53:53 +0800
> Tengda Wu <wutengda@xxxxxxxxxxxxxxx> wrote:
>
>> There remains an edge case that concerns me: if size is 0, setting len to
>> size - 1 would cause an underflow. Should we handle this edge case?
>
> When the trace_seq is allocated, the size is set to 8K. If size is ever
> zero, then there would be no buffer. So no, we should not worry about that
> edge case because if it happened then we have a lot of other things to
> worry about.
>
> -- Steve

Got it, thanks for the clarification.

-- Tengda