NACK/Cmnt: [SRU][Q][PATCH 0/1] UBUNTU: SAUCE: selftests/bpf: fix invisible function prototypes for dynptr_success.

Edoardo Canepa edoardo.canepa at canonical.com
Wed Jan 14 15:04:28 UTC 2026


Rejected for the following reasons:

This is not an issue with the C-style inclusion, it is specific to BPF 
compiling process and it's a known issue in pahole fixed here:

https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?h=next&id=09c1e9c924da02dc02bba0a3e59490e64449df96

The discussion is here https://lkml.org/lkml/2025/10/4/104 but it is 
relative to kernel 6.18 and pahole 1.31. We should further evaluate what 
to do

for 6.17.

On 1/14/26 11:28, Mehmet Basaran wrote:
> BugLink: https://bugs.launchpad.net/bugs/2138361
>
> [Impact]
> 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
>
> [Fix]
> Straightforward fix is to include "bpf_kfuncs.h" in dynptr_success.c
> as is done in dynptr_fail.c.
>
> [Test]
> Issue is reproduced/tested locally. After the change, selftests/bpf passes.
>
> [Where problems could occur]
> This change is made in selftests/bpf so doesn't effect kernel itself.
> However, during future patch application this might require adjustments.
>
> Mehmet Basaran (1):
>    UBUNTU: SAUCE: selftests/bpf: fix invisible function prototypes for
>      dynptr_success.
>
>   tools/testing/selftests/bpf/progs/dynptr_success.c | 1 +
>   1 file changed, 1 insertion(+)
>
> --
> 2.43.0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x20F88172E14F6784.asc
Type: application/pgp-keys
Size: 3167 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20260114/1f932a14/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20260114/1f932a14/attachment-0001.sig>


More information about the kernel-team mailing list