RFC 9669: The eBPF instruction set as a standard
Summary
Dave Thaler published the BPF instruction set architecture as an IETF standard in RFC 9669, dated October 2024. The text originated from the file instruction-set.rst in the Linux kernel and describes instruction encoding, registers and instructions independently of any single implementation. According to the RFC, BPF no longer stands for anything, although it once meant Berkeley Packet Filter.
From packet filter to runtime
The RFC notes that BPF originally stood for Berkeley Packet Filter. Because the technology can do far more than filter packets today, BPF counts as a standalone term; the old method is called cBPF for distinction, today's eBPF.
Instructions are 64 bits long; a wide encoding appends another 64 bits. Programs work with registers 0 to 10. Conformance groups such as base32, base64, atomic32 or divmul32 define which instructions an implementation must support; only base32 is mandatory.
Security through verification
BPF programs run in privileged environments such as an operating system kernel. The security section refers to verifiers that ensure programs terminate in reasonable time and only access memory safely; it names Linux and PREVAIL as examples.
The RFC regards interpreters as a risk, for instance through speculative execution, when they run in the same address space as confidential data. It therefore recommends compilers that translate to machine code before execution.
Ideas
- BPF is no longer an acronym.
- An instruction is 64 bits long, wide instructions 128 bits.
- Programs use registers 0 to 10.
- Every implementation must support the base32 conformance group.
- Verifiers check programs before execution.
- According to the RFC, compilers are safer than interpreters.
Insights
- A kernel technology only becomes a platform other operating systems can use through an independent specification.
- BPF's security lies less in the instruction set than in the verifier, which the RFC deliberately leaves out.
Facts
- RFC 9669 is dated October 2024 and has the status Proposed Standard.
- The document was generated from instruction-set.rst in the Linux kernel repository.
- The acknowledgements name Alexei Starovoitov and Daniel Borkmann, among others.
- An IANA registry manages the conformance groups.
References
Remarks
- The RFC index lists November 2024 as the month of publication, while the document header says October 2024.
Recommendations
- On Linux, disable unprivileged BPF with kernel.unprivileged_bpf_disabled if it is not needed.
- Use the BPF JIT compiler instead of the interpreter.
- In your own BPF programs, use only the conformance groups that all target platforms support.
Read the RFC at the RFC Editor
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.