lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b49ca48-ff6b-40ed-8322-e0c9791d1d17@kernel.org>
Date: Sat, 4 Oct 2025 10:51:36 +0200
From: Matthieu Baerts <matttbe@...nel.org>
To: Eduard Zingerman <eddyz87@...il.com>, ihor.solodrai@...ux.dev,
 alan.maguire@...cle.com
Cc: bpf@...r.kernel.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
 Andrii Nakryiko <andrii@...nel.org>, Alexei Starovoitov <ast@...nel.org>,
 Daniel Borkmann <daniel@...earbox.net>,
 Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>,
 Yonghong Song <yonghong.song@...ux.dev>,
 John Fastabend <john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>,
 Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>,
 Jiri Olsa <jolsa@...nel.org>, Shuah Khan <shuah@...nel.org>,
 Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
 Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>
Subject: Re: [PATCH bpf] selftests/bpf: fix implicit-function-declaration
 errors

Hi Eduard,

On 04/10/2025 01:37, Eduard Zingerman wrote:
> On Fri, 2025-10-03 at 17:24 +0200, Matthieu Baerts (NGI0) wrote:
>> When trying to build the latest BPF selftests, with a debug kernel
>> config, Pahole 1.30 and CLang 20.1.8 (and GCC 15.2), I got these errors:
>>
>>   progs/dynptr_success.c:579:9: error: call to undeclared function 'bpf_dynptr_slice'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>>     579 |         data = bpf_dynptr_slice(&ptr, 0, NULL, 1);
>>         |                ^
>>   progs/dynptr_success.c:579:9: note: did you mean 'bpf_dynptr_size'?
>>   .virtme/build-debug-btf//tools/include/vmlinux.h:120280:14: note: 'bpf_dynptr_size' declared here
>>    120280 | extern __u32 bpf_dynptr_size(const struct bpf_dynptr *p) __weak __ksym;
>>           |              ^
>>   progs/dynptr_success.c:579:7: error: incompatible integer to pointer conversion assigning to '__u64 *' (aka 'unsigned long long *') from 'int' [-Wint-conversion]
>>     579 |         data = bpf_dynptr_slice(&ptr, 0, NULL, 1);
>>         |              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>   progs/dynptr_success.c:596:9: error: call to undeclared function 'bpf_dynptr_slice'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>>     596 |         data = bpf_dynptr_slice(&ptr, 0, NULL, 10);
>>         |                ^
>>   progs/dynptr_success.c:596:7: error: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
>>     596 |         data = bpf_dynptr_slice(&ptr, 0, NULL, 10);
>>         |              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I don't have these errors without the debug kernel config from
>> kernel/configs/debug.config. With the debug kernel, bpf_dynptr_slice()
>> is not declared in vmlinux.h. It is declared there without debug.config.
>>
>> The fix is similar to what is done in dynptr_fail.c which is also using
>> bpf_dynptr_slice(): bpf_kfuncs.h is now included.
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@...nel.org>
>> ---
> 
> I can reproduce similar issue when including
> kernel/configs/debug.config with my regular dev config, but for
> different functions: bpf_rcu_read_{un,}lock().

Thank you for having checked! I also had issues with these functions on
my side, when testing on top of 'net'.

> However, this is not a way to fix this.
> Kfuncs are not supposed to just disappear from DWARF.

Indeed. But strange it was fine before. Or fine without debug.config.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ