linux/tools/testing/selftests/bpf/verifier
Maxim Mikityanskiy bee109b7b3 bpf: Fix error message on kfunc arg type mismatch
When "arg#%d expected pointer to ctx, but got %s" error is printed, both
template parts actually point to the type of the argument, therefore, it
will also say "but got PTR", regardless of what was the actual register
type.

Fix the message to print the register type in the second part of the
template, change the existing test to adapt to the new format, and add a
new test to test the case when arg is a pointer to context, but reg is a
scalar.

Fixes: 00b85860fe ("bpf: Rewrite kfunc argument handling")
Signed-off-by: Maxim Mikityanskiy <maxim@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/bpf/20240909133909.1315460-1-maxim@isovalent.com
2024-09-09 15:58:17 -07:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
atomic_and.c
atomic_bounds.c bpf: Propagate stack bounds to registers in atomics w/ BPF_FETCH 2021-02-02 18:23:29 -08:00
atomic_cmpxchg.c bpf: Fix accesses to uninit stack slots 2023-12-08 14:19:00 -08:00
atomic_fetch.c
atomic_fetch_add.c bpf: Add tests for new BPF atomic operations 2021-01-14 18:34:29 -08:00
atomic_invalid.c
atomic_or.c
atomic_xchg.c
atomic_xor.c
basic.c
basic_call.c selftests: bpf: break up test_verifier 2019-01-27 21:37:45 -08:00
basic_instr.c selftests/bpf: Fix a test_verifier failure 2023-07-27 18:54:16 -07:00
basic_stx_ldx.c
bpf_loop_inline.c selftests/bpf: Skip callback tests if jit is disabled in test_verifier 2024-01-23 20:27:41 -08:00
bpf_st_mem.c selftests/bpf: Add test for immediate spilled to stack 2023-11-01 22:30:27 -07:00
calls.c bpf: Fix error message on kfunc arg type mismatch 2024-09-09 15:58:17 -07:00
ctx_sk_lookup.c selftests/bpf: Add tests for accessing ingress_ifindex in bpf_sk_lookup 2021-11-10 16:29:59 -08:00
ctx_skb.c
dead_code.c selftests, bpf: Test that dead ldx_w insns are accepted 2021-08-13 17:46:26 +02:00
direct_value_access.c
event_output.c
jit.c
jmp32.c selftests/bpf: Add F_NEEDS_EFFICIENT_UNALIGNED_ACCESS to some tests 2023-07-05 14:34:23 +02:00
jset.c bpf, selftests: Adjust few selftest outcomes wrt unreachable code 2021-06-14 23:06:38 +02:00
jump.c bpf, selftests: Add verifier test case for imm=0,umin=0,umax=1 scalar 2022-07-01 12:56:27 -07:00
junk_insn.c
ld_abs.c
ld_dw.c
ld_imm64.c
map_kptr.c selftests/bpf: fix some typos in selftests 2024-09-05 13:07:47 -07:00
perf_event_sample_period.c
precise.c bpf: Remove mark_precise_scalar_ids() 2024-07-29 12:53:14 -07:00
scale.c selftests/bpf: two scale tests 2019-04-16 10:18:15 +02:00
sleepable.c
wide_access.c selftests/bpf: Mark tests that require unaligned memory access 2020-11-18 17:45:35 -08:00