Public bug reported:

Previously, bpf_dynptr_slice() functions prototype was included in
the auto-generated vmlinux.h header functions. But with recent updates
(from 6.17.0-10.10 to 6.17.0-11.11) bpftool doesn't put the prototype
for bpf_dynptr_slice() into vmlinux.h even though the function is
included in .BTF section. This results in the following compilation
error:

CLNG-BPF [test_progs] dynptr_success.bpf.o
make[1]: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
make: Leaving directory 
'/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
stderr:
progs/dynptr_success.c:524:9: error: call to undeclared function 
'bpf_dynptr_slice'; ISO C99 and later do not support implicit function 
declarations [-Wimplicit-function-declaration]
524 | data = bpf_dynptr_slice(&ptr, 0, NULL, 1);
| ^
progs/dynptr_success.c:524:9: note: did you mean 'bpf_dynptr_size'?
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h:162097:14:
 note: 'bpf_dynptr_size' declared here
162097 | extern __u32 bpf_dynptr_size(const struct bpf_dynptr *p) __weak __ksym;
| ^
progs/dynptr_success.c:524:7: error: incompatible integer to pointer conversion 
assigning to '__u64 *' (aka 'unsigned long long *') from 'int' 
[-Wint-conversion]
524 | data = bpf_dynptr_slice(&ptr, 0, NULL, 1);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
progs/dynptr_success.c:541:9: error: call to undeclared function 
'bpf_dynptr_slice'; ISO C99 and later do not support implicit function 
declarations [-Wimplicit-function-declaration]
541 | data = bpf_dynptr_slice(&ptr, 0, NULL, 10);
| ^
progs/dynptr_success.c:541:7: error: incompatible integer to pointer conversion 
assigning to 'char *' from 'int' [-Wint-conversion]
541 | data = bpf_dynptr_slice(&ptr, 0, NULL, 10);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
make[1]: *** [Makefile:733: 
/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/dynptr_success.bpf.o]
 Error 1
make: *** [Makefile:208: all] Error 2

Straightforward fix is to include "bpf_kfuncs.h" in dynptr_success.c
as is done in dynptr_fail.c.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: linux (Ubuntu Questing)
     Importance: Undecided
         Status: New

** Also affects: linux (Ubuntu Questing)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2138361

Title:
  questing selftests/bpf:setup dynptr_success.c compilation issue
  bpf_dynptr_slice undefined

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2138361/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to