The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
Posted Oct 7, 2023 23:26 UTC (Sat) by helge.bahmann (subscriber, #56804)In reply to: The challenge of compiling for verified architectures by Cyberax
Parent article: The challenge of compiling for verified architectures
Roughly, this works by calling a function typed (void*)(uint64_t) through an indirect call (function pointer). While the WASM security model prevents you from directly assigning a function fn with signature void fn(void*) to the function pointer in question, you can cause the CPU to speculate that the call through your function pointer may end up in fn (via BTB poisoning) and therefore cause speculated access to arbitrary memory locations from WASM into the host address space (similarly applies to e.g. JacaScript). This can be exploited as really reliably for as long as the JIT ever emits an indirect call (and all JITs known to me do that, but notably researchers have also found ways to use the branch cascade resulting from switch/case-like constructs to cause the required BTB confusion).
From a high level point of view, you have to assume that any "protection" offered by a languages or runtimes type system to separate pointers from arbitrary integers can be circumvented by speculative confusion of branch targets.
Posted Oct 7, 2023 23:41 UTC (Sat)
by helge.bahmann (subscriber, #56804)
[Link]
Posted Oct 8, 2023 2:06 UTC (Sun)
by Cyberax (✭ supporter ✭, #52523)
[Link] (1 responses)
Wasmtime does have a mitigation for this particular vulnerability: https://bytecodealliance.org/articles/security-and-correc...
It's fair to say that WASM does not try to guarantee the lack of side-channels in general. Implementations try to add mitigations where they feel that it's reasonable, but are not fixated on that. eBPF probably has some advantage in that area, but I doubt it's really insurmountable.
Posted Oct 8, 2023 3:43 UTC (Sun)
by helge.bahmann (subscriber, #56804)
[Link]
Posted Oct 8, 2023 3:25 UTC (Sun)
by roc (subscriber, #30627)
[Link] (4 responses)
Posted Oct 8, 2023 5:04 UTC (Sun)
by ibukanov (subscriber, #3942)
[Link] (3 responses)
So Wasm sandbox requires too many dynamic checks to hope for reliable practical protection against SPECTRE and friends. EBP implementation in Linux, by reducing the number of runtime checks and constraining the code sufficiently, still managed to provide the protection against known attacks. Hence ability to provide practical protection against speculative leaks is a useful criterion to classify.
Posted Oct 8, 2023 7:06 UTC (Sun)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Does that include new and fancy features like iterators?
Posted Oct 8, 2023 9:57 UTC (Sun)
by roc (subscriber, #30627)
[Link] (1 responses)
I still think this is a poor way to draw a line between "sandbox" and "verifier". If Spectre vulnerabilities are found in eBPF will it cease to be a verifier and become a sandbox? That doesn't make sense to me.
Posted Oct 8, 2023 12:57 UTC (Sun)
by ibukanov (subscriber, #3942)
[Link]
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
The challenge of compiling for verified architectures
https://bytecodealliance.org/articles/security-and-correc...
The challenge of compiling for verified architectures