bpf: export btf_ctx_access to modules.
authorKui-Feng Lee <thinker.li@gmail.com>
Fri, 19 Jan 2024 22:50:04 +0000 (14:50 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Wed, 24 Jan 2024 01:12:52 +0000 (17:12 -0800)
The module requires the use of btf_ctx_access() to invoke
bpf_tracing_btf_ctx_access() from a module. This function is valuable for
implementing validation functions that ensure proper access to ctx.

Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
Link: https://lore.kernel.org/r/20240119225005.668602-14-thinker.li@gmail.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
kernel/bpf/btf.c

index 5c3e526a2dece82cda31ca364ebc515a5cc34e08..edef96ceffa397eac6448710368677f1e6f8c050 100644 (file)
@@ -6322,6 +6322,7 @@ bool btf_ctx_access(int off, int size, enum bpf_access_type type,
                __btf_name_by_offset(btf, t->name_off));
        return true;
 }
+EXPORT_SYMBOL_GPL(btf_ctx_access);
 
 enum bpf_struct_walk_result {
        /* < 0 error */