3 ms·
The kernel enforces that the code flow graph is a DAG (among other things). From a pure encoding perspective, you could build a program that had loops (eBPF is
by monocasa 9y ago
The kernel enforces that the code flow graph is a DAG (among other things). From a pure encoding perspective, you could build a program that had loops (eBPF is a fairly standard RISC like instruction set), but the kernel will reject it.
- ori_b 9y agoInteresting, it seems that you could enforce that the control flow graph is a dag simply by making jump displacements unsigned. If you can only jump forward, you automatically get a DAG.
- monocasa 9y agoYeah, cBPF does that IIRC, but eBPF has other constraints on the byte code too that mean that you have to do a full graph walk anyway.