[PATCH] perf cs-etm: Avoid truncating AUX buffer sizes to int

Namhyung Kim namhyung at kernel.org
Thu Jul 23 22:47:15 PDT 2026


On Mon, 20 Jul 2026 11:01:21 +0100, Leo Yan wrote:
> cs_etm__get_trace() returns an int, but it used to return etmq->buf_len
> on success. That value comes from auxtrace_buffer::size, which is a
> size_t. For a large AUX trace block, returning the byte count through an
> int can overflow and make a valid buffer look like a negative error.
> 
> The callers do not need the actual byte count from cs_etm__get_trace().
> The buffer length is already stored in the etmq->buf_len. The callers
> only need to distinguish three states:
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung





More information about the linux-arm-kernel mailing list