Re: [PATCH bpf v4 03/20] selftests/bpf: Replace strncpy() with strscpy()

From: Eduard Zingerman

Date: Mon Feb 23 2026 - 18:00:10 EST


On Mon, 2026-02-23 at 14:32 -0800, Ihor Solodrai wrote:
> On 2/23/26 2:28 PM, Eduard Zingerman wrote:
> > On Mon, 2026-02-23 at 11:07 -0800, Ihor Solodrai wrote:
> >
> > [...]
> >
> > > diff --git a/tools/testing/selftests/bpf/prog_tests/align.c b/tools/testing/selftests/bpf/prog_tests/align.c
> > > index 24c509ce4e5b..841a166b8081 100644
> > > --- a/tools/testing/selftests/bpf/prog_tests/align.c
> > > +++ b/tools/testing/selftests/bpf/prog_tests/align.c
> > > @@ -633,7 +633,7 @@ static int do_test_single(struct bpf_align_test *test)
> > > } else {
> > > ret = 0;
> > > /* We make a local copy so that we can strtok() it */
> > > - strncpy(bpf_vlog_copy, bpf_vlog, sizeof(bpf_vlog_copy));
> > > + strscpy(bpf_vlog_copy, bpf_vlog);
> > > start = strstr(bpf_vlog_copy, main_pass_start);
> > > if (!start) {
> > > ret = 1;
> >
> > This hunk no longer applies.
>
>
> Hmm... Applies for me. What revision did you try?
>
> $ git log -1 --oneline
> 6de23f81a5e0 (HEAD, tag: v7.0-rc1, origin/bpf) Linux 7.0-rc1
>
> $ b4 shazam 20260223190736.649171-1-ihor.solodrai@xxxxxxxxx
> Grabbing thread from lore.kernel.org/all/20260223190736.649171-1-ihor.solodrai@xxxxxxxxx/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Analyzing 22 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Analyzing 103 code-review messages
> Checking attestation on all messages, may take a moment...
> ---

Uh-oh, it is for 'bpf' tree. I applied to 'bpf-next', sorry for the noise.

[...]