eunomia-bpf / bpftime

Userspace eBPF runtime for Observability, Network & General Extensions Framework
https://eunomia.dev/bpftime/
MIT License
788 stars 74 forks source link

fix: do not override symbols in userland eBPF programs with symbols provided by bpftime's bundled libbpf #305

Closed Officeyutong closed 3 months ago

Officeyutong commented 3 months ago

Closes #184 Use version script to limit dynamic exported symbols. Now only symbols needed for attaching was exported.

root@mnfe-pve:~/bpftime/example/opensnoop# nm ~/.bpftime/libbpftime-agent.so  -D | grep " T " 
0000000000214c20 T bpftime_agent_main
0000000000214bc0 T bpftime_hooked_main
0000000000216030 T _bpftime__setup_syscall_trace_callback
00000000002155b0 T __libc_start_main
0000000000215f90 T syscall_callback
root@mnfe-pve:~/bpftime# nm -D ~/.bpftime/libbpftime-syscall-server.so | grep " T "
0000000000066ac0 T close
0000000000066720 T epoll_create1
0000000000066580 T epoll_ctl
00000000000664d0 T epoll_wait
00000000000667c0 T ioctl
00000000000669f0 T mmap
0000000000066870 T mmap64
00000000000670b0 T munmap
0000000000066b50 T syscall

Non-dynamic symbols won't override symbols defined in injected executable.

More tests are needed..