Re: [PATCH] firmware: cs_dsp: Replace strlcat() with seq_buf in KUnit tests
From: Richard Fitzgerald
Date: Tue Nov 24 2026 - 09:00:28 EST
On 24/11/2026 11:36 am, Andrey Zakharov wrote:
strlcat() is being removed from the kernel. It runs an unboundedReviewed-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>
strlen() on the destination, and its size argument is not tied to
the real buffer, see the issue below.
The bin and wmfw tests fill a 512 byte buffer with a repeated string
by calling strlcat() in a loop, and use the return value to detect
that the buffer is full. Use seq_buf_init() and seq_buf_puts() and
stop when seq_buf_has_overflowed() is true. kunit_kzalloc() returns
a zeroed buffer, so seq_buf_init() is enough here.