diff options
author | 2023-04-17 17:21:46 -0700 | |
---|---|---|
committer | 2023-04-18 12:45:10 -0700 | |
commit | 30bbfe3236b01b81ed5f4a91cd9d87a236b182e3 (patch) | |
tree | d61ee97ae4edc217413d9531d90d07e683991f3d /tools/testing/selftests/bpf/progs/test_log_fixup.c | |
parent | libbpf: improve handling of unresolved kfuncs (diff) | |
download | wireguard-linux-30bbfe3236b01b81ed5f4a91cd9d87a236b182e3.tar.xz wireguard-linux-30bbfe3236b01b81ed5f4a91cd9d87a236b182e3.zip |
selftests/bpf: add missing __weak kfunc log fixup test
Add test validating that libbpf correctly poisons and reports __weak
unresolved kfuncs in post-processed verifier log.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230418002148.3255690-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | tools/testing/selftests/bpf/progs/test_log_fixup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_log_fixup.c b/tools/testing/selftests/bpf/progs/test_log_fixup.c index 60450cb0e72e..1bd48feaaa42 100644 --- a/tools/testing/selftests/bpf/progs/test_log_fixup.c +++ b/tools/testing/selftests/bpf/progs/test_log_fixup.c @@ -61,4 +61,14 @@ int use_missing_map(const void *ctx) return value != NULL; } +extern int bpf_nonexistent_kfunc(void) __ksym __weak; + +SEC("?raw_tp/sys_enter") +int use_missing_kfunc(const void *ctx) +{ + bpf_nonexistent_kfunc(); + + return 0; +} + char _license[] SEC("license") = "GPL"; |