Skip to contentSkip to conversation

BPF selftests compilation failure due to selftests-bpf-initialize-operation-name-before-use.patch

DISCUSSION Shung-Hsi Yu 3 participants 4 messages Jul 21 – Jul 23 Stable branch

lore
Share & tools
lore
#0 lore raw

Hi Sasha,

I am running into BPF selftests compilation error on 6.18 (but it possibly affect other branches as well, haven't check) due to selftests-bpf-initialize-operation-name-before-use.patch currently sitting in stable-queue:

/tmp/work/linux-stable/linux-stable/tools/testing/selftests/bpf/prog_tests/verifier_log.c: In function ‘verif_btf_log_subtest’:
/tmp/work/linux-stable/linux-stable/tools/testing/selftests/bpf/prog_tests/verifier_log.c:320:9: error: implicit declaration of function ‘strscpy’; did you mean ‘strlcpy’? [-Werror=implicit-function-declaration]

  320 |         strscpy(op_name, "log_fixed", sizeof(op_name));
      |         ^~~~~~~
      |         strlcpy

Can you pick up commit 63c49efc987a ("selftests/bpf: Add simple strscpy() implementation") along? I think that should be enough to fix the build failure.

maintainer
#1 lore raw
Quoted 9 lines · Shung-Hsi Yu

Hi Sasha,

I am running into BPF selftests compilation error on 6.18 (but it possibly affect other branches as well, haven't check) due to selftests-bpf-initialize-operation-name-before-use.patch currently sitting in stable-queue:

/tmp/work/linux-stable/linux-stable/tools/testing/selftests/bpf/prog_tests/verifier_log.c: In function ‘verif_btf_log_subtest’:
/tmp/work/linux-stable/linux-stable/tools/testing/selftests/bpf/prog_tests/verifier_log.c:320:9: error: implicit declaration of function ‘strscpy’; did you mean ‘strlcpy’? [-Werror=implicit-function-declaration]

Quoted 7 lines
  320 |         strscpy(op_name, "log_fixed", sizeof(op_name));
      |         ^~~~~~~
      |         strlcpy

Can you pick up commit 63c49efc987a ("selftests/bpf: Add simple strscpy() implementation") along? I think that should be enough to fix the build failure.

Now applied, thanks.

greg k-h

maintainer
#2 lore raw
In reply to Shung-Hsi Yu
Quoted 3 lines

Can you pick up commit 63c49efc987a ("selftests/bpf: Add simple strscpy() implementation") along? I think that should be enough to fix the build failure.

Greg has already picked it up for 6.18, which covers the tree you hit.

The offending selftests patch is also queued for 6.12 and 6.6, and you were right that they're affected too. Unfortunately 63c49efc987a doesn't apply there as-is: it depends on 9a6a6a319157 ("tools/testing:
add linux/args.h header and fix radix, VMA tests"), which isn't in either tree.

Could you send adapted backports of the strscpy helper for 6.12.y and 6.6.y? I'll hold off on those branches until then.

Signature · 2 lines
Thanks,
Sasha
#3 lore raw
Quoted 10 lines · Sasha Levin
Quoted 3 lines

Can you pick up commit 63c49efc987a ("selftests/bpf: Add simple strscpy() implementation") along? I think that should be enough to fix the build failure.

Greg has already picked it up for 6.18, which covers the tree you hit.

The offending selftests patch is also queued for 6.12 and 6.6, and you were right that they're affected too. Unfortunately 63c49efc987a doesn't apply there as-is: it depends on 9a6a6a319157 ("tools/testing: add linux/args.h header and fix radix, VMA tests"), which isn't in either tree.

Could you send adapted backports of the strscpy helper for 6.12.y and 6.6.y? I'll hold off on those branches until then.

Ack, I can give it a try.