summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2023-12-14 17:13:29 -0800
committerAlexei Starovoitov <ast@kernel.org>2023-12-19 18:06:46 -0800
commitf18c3d88deedf0defc3e4800341cc7bcaaabcdf9 (patch)
treed57714bbf760073e1542452360d88ebc854d443b /tools
parentc5a7244759b1eeacc59d0426fb73859afa942d0d (diff)
downloadlinux-stable-f18c3d88deedf0defc3e4800341cc7bcaaabcdf9.tar.gz
linux-stable-f18c3d88deedf0defc3e4800341cc7bcaaabcdf9.tar.bz2
linux-stable-f18c3d88deedf0defc3e4800341cc7bcaaabcdf9.zip
bpf: reuse subprog argument parsing logic for subprog call checks
Remove duplicated BTF parsing logic when it comes to subprog call check. Instead, use (potentially cached) results of btf_prepare_func_args() to abstract away expectations of each subprog argument in generic terms (e.g., "this is pointer to context", or "this is a pointer to memory of size X"), and then use those simple high-level argument type expectations to validate actual register states to check if they match expectations. Acked-by: Eduard Zingerman <eddyz87@gmail.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20231215011334.2307144-6-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/progs/test_global_func5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_global_func5.c b/tools/testing/selftests/bpf/progs/test_global_func5.c
index cc55aedaf82d..257c0569ff98 100644
--- a/tools/testing/selftests/bpf/progs/test_global_func5.c
+++ b/tools/testing/selftests/bpf/progs/test_global_func5.c
@@ -26,7 +26,7 @@ int f3(int val, struct __sk_buff *skb)
}
SEC("tc")
-__failure __msg("expected pointer to ctx, but got PTR")
+__failure __msg("expects pointer to ctx")
int global_func5(struct __sk_buff *skb)
{
return f1(skb) + f2(2, skb) + f3(3, skb);