Re: [PATCH v4 04/18] PCI/P2PDMA: Safely terminate ACS redirect lists

From: Jason Gunthorpe

Date: Mon Aug 24 2026 - 19:24:49 EST


On Fri, 21 Aug 2026 22:38:35 +0300, Leon Romanovsky <leon@xxxxxxxxxx> wrote:
> seq_buf marks an overflow by setting len to size + 1. The ACS diagnostic
> path unconditionally writes a terminator to buffer[len - 1], so a path
> with enough ACS ports to fill the 128-byte buffer writes one byte beyond
> the buffer when verbose diagnostics are requested.
>
> Use seq_buf_str() to terminate truncated output safely and remove the final
> semicolon only when the buffer did not overflow.
>
> [...]

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

--
Jason