foniod / redbpf

Rust library for building and running BPF/eBPF modules
Apache License 2.0
1.71k stars 136 forks source link

Find if get or get_mut method of RedBPF maps are called #250

Closed rhdxmr closed 2 years ago

rhdxmr commented 2 years ago

Previously cargo-bpf raises an error if the alignment of value is greater than 8 bytes. But this is inappropriate to some BPF program that never calls get/get_mut. Since calling these methods creates references of possibly misaligned data, it is okay to permit values that have alignment greater than 8 bytes if get/get_mut is not called anywhere in BPF programs.

Find if get/get_mut method is called by inspecting LLVM bitcode and raise an error.

Signed-off-by: Junyeong Jeong rhdxmr@gmail.com