LWN: Comments on "Modernizing BPF for the next 10 years" https://lwn.net/Articles/977013/ This is a special feed containing comments posted to the individual LWN article titled "Modernizing BPF for the next 10 years". en-us Mon, 15 Sep 2025 13:18:49 +0000 Mon, 15 Sep 2025 13:18:49 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net WASM? https://lwn.net/Articles/977807/ https://lwn.net/Articles/977807/ Cyberax <div class="FormattedComment"> I doubt that this tracking adds any real value. For practical reasons, it's likely that just adding range-checking accessors should be enough for practical reasons.<br> <p> I'm also going to bet, that eBPF will grow pointer arithmetic that can re-interpret types in the future.<br> </div> Mon, 10 Jun 2024 17:11:13 +0000 WASM? https://lwn.net/Articles/977729/ https://lwn.net/Articles/977729/ roc <div class="FormattedComment"> The eBPF verifier does type propagation and checking and prevents pointer arithmetic. <a href="https://docs.kernel.org/6.1/bpf/verifier.html#register-value-tracking">https://docs.kernel.org/6.1/bpf/verifier.html#register-va...</a><br> It's not well documented and all very ad-hoc, but this is not the usual WASM array-of-bytes model.<br> <p> I think the closest WASM equivalent of this is reference types, which are pretty new. I don't see instructions for doing field load/stores via references yet.<br> </div> Mon, 10 Jun 2024 07:31:00 +0000 WASM all the way. https://lwn.net/Articles/977666/ https://lwn.net/Articles/977666/ Cyberax <div class="FormattedComment"> <span class="QuotedText">&gt; * to replace the eBPF VM in the kernel by the WASM VM, and to replace all the eBPF call sites with WASM equivalents</span><br> <p> First, it's not needed. eBPF can stay in its current roles and for legacy stuff like the actual packet filter. And eventually you can just run eBPF on top of WASM. This is perfectly doable right now, there's nothing special in eBPF.<br> <p> <span class="QuotedText">&gt; In the end, does it really matter which VM is used?</span><br> <p> Kinda yes. eBPF is becoming a generic VM, but built on top of a hacky NIH-ed instruction set that is a very poor fit for general purpose programming. And we'll be forever saddled with it, and all of its eventual bugs and misfeatures.<br> </div> Sat, 08 Jun 2024 18:35:42 +0000 WASM all the way. https://lwn.net/Articles/977663/ https://lwn.net/Articles/977663/ edeloget <div class="FormattedComment"> <span class="QuotedText">&gt; If they wanted the BPF programs to have certain properties (like, not getting stuck in an infinite loop) it seems like the compiler* ought to be responsible for analyzing and enforcing that not the BPF instruction set.</span><br> <p> I think I said this numerous times, but the kernel will still have to verify the program when it loads it. You do not want to allow arbitrary program to run in your kernel without proper checking first. Just like the web backend shall verify the user input, even if it's checked by the JS on the client side. It does not matter if you execute you web server in a super controlled environment, letting attacker-controlled values dance with your backend is not a good idea :)<br> <p> On the more general WASM vs BPF discussion, I have the feeling that the two serve different purposes using similar technology and techniques. eBPF evolved from BPF (which, as I understand it, predates WASM by 'some time') and was devised by network-minded people who wanted to enhance the possibilities of the venerable filtering language. WASM was clearly not designed with this in mind. Up to very recently, eBPF was significantly inferior to WASM in terms of VM(1) possibilities, but on the other end ePBF was really a good fit for the kernel itself. The recent enhancement of eBFP makes WASM look like a good replacement, but pushing WASM in the kernel would mean:<br> <p> * to replace the eBPF VM in the kernel by the WASM VM, and to replace all the eBPF call sites with WASM equivalents, which is going to be a daunting task ; while technicaly it seems to be feasible, noone has ever checked this, and their is a good possibility that some feature proposed by eBPF will not be implementable with an in-kernel WASM VM. <br> <p> Doing this would likely require multiple kernel release cycles, and in the end you'll get the same features as now. The value of such a change is limited (and I'm pretty sure that may of you would find ti quite ridicule to see this development U-turn.<br> <p> If you don't *replace* the VM but only add the WASM one, you'll have to maintain two similar VM in the kernel -- that does not look like a good idea to me (and the WASM VM would need years before it reach a state where it would be able to compete with the eBPF VM).<br> <p> * to tell everyone to stop using eBPF ; that looks like it's going to be easier, but let me introduce you to one of my friends, Cobol. <br> <p> In the end, does it really matter which VM is used? The kernel developpers are doing quite an incredible job with eBPF support, so WASM, at this point, would add nothing of value -- or, at least, too little to be really of interest. We also have compilers that spit out eBPF byte code, so we're not in need of "having to know yet another language". <br> <p> (1) I use the term VM quite loosely here ; I just mean: "whatever is used to execute the eBPF or WASM code as well as its controlled environment". <br> </div> Sat, 08 Jun 2024 18:15:16 +0000 WASM? https://lwn.net/Articles/977651/ https://lwn.net/Articles/977651/ aszs <div class="FormattedComment"> The BPF verifier validates pointers, (within its sandbox) WASM does not. <br> See, for example, <a href="https://dl.acm.org/doi/10.1145/3571208:">https://dl.acm.org/doi/10.1145/3571208:</a><br> "memory-unsafe C code remains unsafe when compiled to Wasm—and attackers can exploit buffer overflows and use-after-frees in Wasm almost as easily as they can on native platforms."<br> (And I just noticed one of that paper's authors is also a contributor to the Wasm spec)<br> </div> Sat, 08 Jun 2024 11:15:14 +0000 WASM? https://lwn.net/Articles/977636/ https://lwn.net/Articles/977636/ Cyberax <div class="FormattedComment"> WASM and BPF instructions and registers are equally typed. And access to memory is equally untyped: <a href="https://www.kernel.org/doc/html/latest/bpf/standardization/instruction-set.html#load-and-store-instructions">https://www.kernel.org/doc/html/latest/bpf/standardizatio...</a><br> <p> At this point there's no conceptual between WASM and eBPF. The eBPF runtime tries to be more resilient to timing attacks (via constant blinding), but that's a property of runtime. It can be added to WASM runtimes.<br> </div> Sat, 08 Jun 2024 02:25:40 +0000 WASM? https://lwn.net/Articles/977632/ https://lwn.net/Articles/977632/ roc <div class="FormattedComment"> BPF still has a different idea about memory, right? In WASM memory is basically a sandboxed array of bytes. AFAIK BPF is a bit more like a typed memory-safe language where you can't do pointer arithmetic but you can safely access objects scattered across the address space of the kernel.<br> </div> Fri, 07 Jun 2024 23:52:25 +0000 WASM all the way. https://lwn.net/Articles/977627/ https://lwn.net/Articles/977627/ python <div class="FormattedComment"> I agree. They would save themselves a lot of work. But perhaps "WASM wasn't invented here" so it is no good? (I could imagine certain kernel folks wanting nothing to do with "web people")<br> <p> I find the path that BPF is taking to be a bit baffling. I feel like they are making a systematic effort to reinvent the wheel (admittedly their wheel is very well suited for certain specific purposes). It feels BPF program are becoming something akin to kernel modules, but wrapped in a special/quirky permission protected half-bpf-userspace-half-kernel thingy.<br> <p> WASM, or just running (JIT?) compiled native instructions in a secure or virtualized environment seems like it would be a lot easier. If they wanted the BPF programs to have certain properties (like, not getting stuck in an infinite loop) it seems like the compiler* ought to be responsible for analyzing and enforcing that not the BPF instruction set.<br> <p> *a cross between something like the TLA+ theorem prover and a standard compiler. Rust does something like this for analyzing and enforcing proper memory access. But it easily could be done for other program properties.<br> </div> Fri, 07 Jun 2024 22:12:55 +0000 WASM? https://lwn.net/Articles/977586/ https://lwn.net/Articles/977586/ Cyberax <div class="FormattedComment"> <span class="QuotedText">&gt; Making BPF programs safely cancellable, with run-time timeouts to augment program verification, will probably become necessary. Starovoitov said that work was already in progress. </span><br> <p> So... Why not WASM?<br> <p> Like really. At this point, you've abandoned ALL the original reasons for BPF.<br> </div> Fri, 07 Jun 2024 16:00:24 +0000