Re:BPF: A New Type of Software
by manyworlds on Tuesday December 03, 2019 @09:28AM
(#21692471)
Doubtful. Webassembly is Turing complete, BPF isn’t. Running untrusted unbounded code in the kernel is not smart. BPF was invented with kernel constraints in mind, webassembly was invented with browser constraints in mind. Completely different use cases
[ Parent
| on HN ]
> Running untrusted unbounded code in the kernel is not smart.
Well currently we run code (e.g. drivers) as trusted full-permission code. Surely, web-assembly would be better than this from a security perspective.
Re:BPF: A New Type of Software
by manyworlds on Tuesday December 03, 2019 @10:19AM
(#21692976)
Generally kernel code is also written to specific constraints. Out-of-tree drivers are usually bad at conforming and hypothetical out-of-tree webassembly drivers would be bad for similar reasons. Memory safety isn’t enough, using kernel interfaces safely requires conformance that webassembly can’t statically guarantee like BPF can
Basic examples: code that takes a lock and never releases it, code that loops forever, code that leaks kernel resources.
What use case do you envision?
Out-of-tree drivers, support for closed-source drivers in Linux (assuming kernel API for wasm drivers is stable).
While I see how out-of-tree drivers using a stable API might be a desirable goal, I don't understand what WASM adds to the table. Maybe some degree of cross-arch portability, but that's already afforded by C and the kernel.