41 ms·
Wasm doesn't really have "arrays", so I don't think wasm checking them would really make sense. I guess you could argue that this is a distinction without a dif
by steveklabnik 8y ago
Wasm doesn't really have "arrays", so I don't think wasm checking them would really make sense. I guess you could argue that this is a distinction without a difference. You still won't get memory unsafety, which in my mind, is the higher order bit. YMMV of course.
- pjmlp 8y agoIt is possible to corrupt data on the stack due to out of bounds.
- steveklabnik 8y agoYes, bugs can always exist.
- rixed 8y agoNot sure what you mean by that, but probably not that stack corruption is a necessary evil of any language.
- pjmlp 8y agoNot when you use a VM that actually cares about security at all layers, but anyway WASM is doing everything better. /s
- Rusky 8y agoUsing such a VM requires rewriting existing C code. Wasm's approach allows that to happen incrementally, where it matters, by using memory safe languages like Rust, instead of relying on the VM.
- pjmlp 8y agoNot at all, as proven by memory tagging on Solaris/SPARC, iOS and upcoming Android/ARM v8.3. So leaving memory tagging out of WASM was a deliberate design decision. There are already better alternatives to write secure code if using C is not a requirement, so again nothing new on WASM other than its hype.
- Rusky 8y agoSure, and we use software memory tagging with things like LLVM sanitizers. It's great. But a) the hardware Wasm needs to support doesn't have tagging, and b) the software equivalent requires support from the allocator and has a large performance penalty. So yes, it was a deliberate design decision, taken in order to support existing C programs on the Web. This is really getting tiring- learning from the past is great, but fetishizing it to the point of denying anything new has any value is... not.
- pjmlp 8y agoWASM wouldn't even be a thing if it wasn't for Mozilla politics against PNaCL. Tiring is the continuous advertising that WASM is the second coming of Christ in VM implementations.
- Rusky 8y agoThose "politics" were there for a reason. Wasm is a solid improvement over PNaCl, which I will note you have curiously left out of all your other old-VM-worship claims.
- ridiculous_fish 8y agoYou do get memory unsafety. OpenSSL compiled to wasm would still be vulnerable to Heartbleed. The JVM would prevent it.
- steveklabnik 8y agoPlease re-read what Rusky said; the point is about the boundary. Yes, wasm programs can mess up their own memory. That’s not what I’m talking about. I should be more clear about this in the future though, thanks.
- ridiculous_fish 8y agoI don't understand this point. We don't say that C is memory safe because of the kernel boundary, even though this boundary does provide important safety guarantees. edit: I guess this viewpoint makes sense for the use case of "thousands of wasm programs in the same process." They are protected from each other, in a sense qualitatively the same as Unix processes. This is still a much weaker guarantee than the JVM provides.
- nindalf 8y agoIf the memory safety of your own code is a high priority, consider writing in Rust. If you’re trying to get a C codebase to run everywhere, then that’s fine too but it seems unrealistic to expect the wasm run time to magically make it memory safe.
- littlestymaar 8y agoThe goal is to allow existing C code to run, so in the end you'll need the same freedom when it comes to memory access. The difference between this and plain process is that the sandbox uses a capability-based security model, instead of giving all the user's rights to the process [1]. [1]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas...
- 8y ago