Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

Officeyutong
Copy link
Contributor

@Officeyutong Officeyutong commented Jun 13, 2024

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..

@Officeyutong Officeyutong marked this pull request as ready for review June 17, 2024 13:32
@Officeyutong Officeyutong requested a review from yunwei37 June 17, 2024 13:32
@yunwei37 yunwei37 merged commit fb8402f into eunomia-bpf:master Jun 20, 2024
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] bpftime load always enforce the userland ebpf program to use bpftime's own libbpf
2 participants