summaryrefslogtreecommitdiffstats
path: root/kernel/bpf/verifier.c
diff options
context:
space:
mode:
authorKui-Feng Lee <thinker.li@gmail.com>2024-01-19 23:49:58 +0100
committerMartin KaFai Lau <martin.lau@kernel.org>2024-01-24 01:37:44 +0100
commit689423db3bda2244c24db8a64de4cdb37be1de41 (patch)
treea76dfd5a3ca0c8f459c06a9306ebbbb7fbc78c6d /kernel/bpf/verifier.c
parentbpf: pass btf object id in bpf_map_info. (diff)
downloadlinux-689423db3bda2244c24db8a64de4cdb37be1de41.tar.xz
linux-689423db3bda2244c24db8a64de4cdb37be1de41.zip
bpf: lookup struct_ops types from a given module BTF.
This is a preparation for searching for struct_ops types from a specified module. BTF is always btf_vmlinux now. This patch passes a pointer of BTF to bpf_struct_ops_find_value() and bpf_struct_ops_find(). Once the new registration API of struct_ops types is used, other BTFs besides btf_vmlinux can also be passed to them. Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com> Link: https://lore.kernel.org/r/20240119225005.668602-8-thinker.li@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'kernel/bpf/verifier.c')
-rw-r--r--kernel/bpf/verifier.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index e279491118b7..2a0fd2ccdb11 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -20298,7 +20298,7 @@ static int check_struct_ops_btf_id(struct bpf_verifier_env *env)
}
btf_id = prog->aux->attach_btf_id;
- st_ops_desc = bpf_struct_ops_find(btf_id);
+ st_ops_desc = bpf_struct_ops_find(btf_vmlinux, btf_id);
if (!st_ops_desc) {
verbose(env, "attach_btf_id %u is not a supported struct\n",
btf_id);