4 ms·
wasm in the kernel when?
by nynx 6y ago
wasm in the kernel when?
- layoutIfNeeded 6y agoHopefully never
- Technically 6y ago....wtf why would you do this?
- Tuna-Fish 6y agoNever. eBPF is a good interface for running code in the kernel because of how restricted it is. Before loading a eBPF module, the kernel does a lof of verification on it, including proving that it terminates. This is famously rather hard on Turing-complete languages. (Although in this case could be solved by giving programs a fixed time budget per invocation.)
- emn13 6y agoGuaranteed termination isn't the only analysis worth having, especially since if your aim is termination (as opposed to leveraging that simplicity for other analysis) it's much easier to simply impose termination and be done with it. So, WASM isn't entirely unconstrained, and those constraints do allow some interesting analyses that true native code cannot support, e.g. symbolic execution: https://blog.trailofbits.com/2020/01/31/symbolically-executing-webassembly-in-manticore/ https://blog.trailofbits.com/2020/01/31/symbolically-executi... By it's very design it's aimed at running untrusted, even malicious code without exposing the host to security risks, while allowing the imposition of resource constraints. It doesn't sound completely absurd to me (not an expert in this) that some project might seek to use those safety guarantees as a way to avoid paying for the more heavyweight guarantees provided by the kernelspace/userspace split. A quick google find lots of people trying to get this to work; who knows - it might pay off.
- rhencke 6y agoIt was done in 2017: https://github.com/cervus-v/cervus https://github.com/cervus-v/cervus
- pjmlp 6y agoeBPF is already it, apparently people keep forgeting that WASM isn't the first nor is going to be the last polyglot bytecode format.
- CyberDildonics 6y agoI haven't seen anyone make that claim. WASM's value has always been in its pragmatic integration plan using what is already there.
- pjmlp 6y agoThen you haven't been paying attention to the "rewrite in WASM" advocacy force and how WASM "has invented" polyglot bytecode.
- CyberDildonics 6y agoI've been paying pretty close attention and read a lot of articles and discussions, starting when it was being created and I have never seen anything about either of those. No one actually writes WASM directly, so no one says to "rewrite in WASM". It is only an optimization, so the two uses are to speed up javascript and to compile native languages. No one even says "polygot bytecode", let alone says that WASM 'invented it'. Most programmers have already used something that uses a bytecode format, why would anyone say that?