Skip to contentSkip to conversation

Can eBPF programs call kfuncs of out-of-tree modules?

DISCUSSION Shuyi Cheng 2 participants 2 messages Aug 15, 2023 BPF

lore
Share & tools
lore
#0 lore raw

Hello.

Recently we found that eBPF can call kernel functions, but we don’t know whether it is possible to call register_btf_kfunc_id_set in the out-of-tree module, and enable eBPF programs of types such as kprobe and tracepoint to call functions defined in out-of-tree modules.

Thanks in advance!

reviewer
#1 lore raw
Quoted 3 lines · Shuyi Cheng

Hello.

Recently we found that eBPF can call kernel functions, but we don’t know whether it is possible to call register_btf_kfunc_id_set in the out-of-tree module, and enable eBPF programs of types such as kprobe and tracepoint to call functions defined in out-of-tree modules.

Never tried but I think it is possible. register_btf_kfunc_id_set() can be used in modules.

btf.c:EXPORT_SYMBOL_GPL(register_btf_kfunc_id_set);

Quoted 3 lines

Thanks in advance!