Re: [PATCH bpf-next v2 3/3] selftests/bpf: guarantee zero termination for veristat test buffers

Eduard Zingerman <[email protected]>
Newsgroups org.kernel.vger.bpf
Message-ID <[email protected]>
On Thu, 2026-08-13 at 23:38 +0000, [email protected] wrote:
> > selftests/bpf: guarantee zero termination for veristat test buffers
> > 
> > In veristat tests replace direct read() calls with calls to
> > read_output() utility function, which:
> > - guarantees that the input buffer is zero terminated;
> > - asserts that read operation succeeded.
> > 
> > Signed-off-by: Eduard Zingerman <[email protected]>
> 
> This looks like a bug fix rather than just a cleanup. The pre-existing
> code called read() on a buffer that was never zero terminated, then passed
> it to __CHECK_STR() which expands to strstr(). Because init_fixture() and
> teardown_fixture() reuse the same malloc()'d buffer across subtests,
> strstr() could match text from a previous run and report a false PASS, or
> read past the buffer end.
> 
> Should this include a Fixes tag pointing to the commit that added the
> veristat subtests with the unterminated read() calls?

Nope.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.