王张军
王张军

Reputation: 11

Android 13 can not load ebpf kporbe program

For aosp 13. I have two ebpf program. one is tracepoint type, another is kprobe type. traceponit works well. But kprobe program when compile successful, and push to /system/etc/bpf/, after reboot. It not auto load to the /sys/fs/bpf/

my example very sample :

DEFINE_BPF_PROG("kprobe/tcp_sendmsg", AID_ROOT, AID_ROOT, kb_do_tcp_sendmsg)  
(void *ctx){
    return 0;      
} 

my kernel is 4.19.190. the CONFIG_KPROBE is y.

Upvotes: 0

Views: 560

Answers (1)

magicdian
magicdian

Reputation: 1

how about this one.

SEC("kprobe/tcp_sendmsg")
int kprobe__ tcp_sendmsg(void *ctx){
    return 0;      
} 

I‘m also working on eBPF kprobe on android, want to attach to ip_finish_output, currently stuck at how to include skbuff.h header...

Upvotes: 0

Related Questions