cilium/ebpf v0.9.3 - Prevent livelocks loading BPF programs while profiling
release ·
This is a bugfix release for an endless loop that could occur when running a pprof session while loading a BPF program.
@danobi published an article with a deep-dive into the problem: https://dxuuu.xyz/bpf-go-pprof.html.
If a thread receives a signal while blocked in BPF_PROG_LOAD, the verifier can cooperatively interrupt itself by checking pending signals for the thread and return -EAGAIN from the syscall to request userspace to retry.
During a Go pprof session, threads are routinely sent a SIGPROF to make them dump profiling information, which can lead to a runaway reaction if the program takes longer to verify than the interrupt frequency. To prevent this, the SIGPROF signal is now masked during BPF_PROG_LOAD.
What’s Changed
- CI: test on 5.19 by @lmb in https://github.com/cilium/ebpf/pull/793
- prep work for BTF marshaling by @lmb in https://github.com/cilium/ebpf/pull/791
- cmd/bpf2go: test against clang-14 by default by @lmb in https://github.com/cilium/ebpf/pull/794
- btf: fix IntEncoding by @lmb in https://github.com/cilium/ebpf/pull/797
- bpf2go: use [16]byte instead of uint128 by @Benjamin-Yim in https://github.com/cilium/ebpf/pull/799
- Semaphore: remove manual Go installation, expedite ‘cache restore’ by @ti-mo in https://github.com/cilium/ebpf/pull/803
- Prevent pprof from causing BPF verifier livelocks by @ti-mo in https://github.com/cilium/ebpf/pull/805
- bpf2go: add flag for alternative filename stem by @MarcusWichelmann in https://github.com/cilium/ebpf/pull/770
- README: update to reflect the project’s situation in H2 2022 by @ti-mo in https://github.com/cilium/ebpf/pull/804
- sys: use SIG_BLOCK and SIG_UNBLOCK from x/sys/unix by @lmb in https://github.com/cilium/ebpf/pull/807
New Contributors
- @Benjamin-Yim made their first contribution in https://github.com/cilium/ebpf/pull/799
- @MarcusWichelmann made their first contribution in https://github.com/cilium/ebpf/pull/770
Full Changelog: https://github.com/cilium/ebpf/compare/v0.9.2...v0.9.3