Exceptions in BPF
summary
Adds a new runtime primitive where BPF throw aborts execution and invokes a global exception callback with a cookie to choose the return value; the loader runs a preverification pass to mark functions that can reach throw and emit frame descriptors so the runtime can unwind each frame and call helpers (BPF_sk_release, BPF_object_drop). Uses include assertions, cancelable programs that let long or unprovable loops be interrupted, and building user‑managed heaps and spinlocks with cancellation for deadlock recovery; memory writes still need runtime bounds checks.
AI-written summary · about
chapters (12)
- 0:00Introduction to speaker
- 0:20What are BPF exceptions
- 3:54Resource cleanup on exceptions
- 7:07Pre-verification pass for throw calls
- 8:34Catching exceptions mid-execution
- 10:44Exceptions beyond assertions
- 11:24Cancelling BPF programs
- 12:25Use cases for cancellation
- 16:17Verifier complexity with maps
- 17:21Building data structures safely
- 19:51Future of BPF verification
- 20:18Q&A session
related talks
34mWhat's new in the BPF world?
36mThe journey of BPF from restricted C language towards extended and safe C.
20mGentle Introduction to EBPF
31meBPF 101
43mHotBPF++: A More Powerful Memory Protection for the Linux Kernel
36meBPF for Runtime Security
28mDeveloping Modern eBPF Applications
42mA Deep Dive Into eBPF Program Loader
