github cilium/ebpf v0.9.3
v0.9.3 - Prevent livelocks loading BPF programs while profiling

latest releases: v0.16.0, v0.15.0, v0.14.0...
2 years ago

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 #793
  • prep work for BTF marshaling by @lmb in #791
  • cmd/bpf2go: test against clang-14 by default by @lmb in #794
  • btf: fix IntEncoding by @lmb in #797
  • bpf2go: use [16]byte instead of uint128 by @Benjamin-Yim in #799
  • Semaphore: remove manual Go installation, expedite 'cache restore' by @ti-mo in #803
  • Prevent pprof from causing BPF verifier livelocks by @ti-mo in #805
  • bpf2go: add flag for alternative filename stem by @MarcusWichelmann in #770
  • README: update to reflect the project's situation in H2 2022 by @ti-mo in #804
  • sys: use SIG_BLOCK and SIG_UNBLOCK from x/sys/unix by @lmb in #807

New Contributors

Full Changelog: v0.9.2...v0.9.3

Don't miss a new ebpf release

NewReleases is sending notifications on new releases.