[SRU][Q][PATCH 1/1] UBUNTU: SAUCE: selftests/bpf: fix invisible function prototypes for dynptr_success.
Mehmet Basaran
mehmet.basaran at canonical.com
Wed Jan 14 10:28:32 UTC 2026
BugLink: https://bugs.launchpad.net/bugs/2138361
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.
Signed-off-by: Mehmet Basaran <mehmet.basaran at canonical.com>
---
tools/testing/selftests/bpf/progs/dynptr_success.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/progs/dynptr_success.c b/tools/testing/selftests/bpf/progs/dynptr_success.c
index 8315273cb900..f484fcd322ab 100644
--- a/tools/testing/selftests/bpf/progs/dynptr_success.c
+++ b/tools/testing/selftests/bpf/progs/dynptr_success.c
@@ -8,6 +8,7 @@
#include <bpf/bpf_tracing.h>
#include "bpf_misc.h"
#include "errno.h"
+#include "bpf_kfuncs.h"
#define PAGE_SIZE_64K 65536
--
2.43.0
More information about the kernel-team
mailing list