Closed tiziano88 closed 3 months ago
One of my takeaways from the Rust-for-Linux RFC discussion on LKML is that trading liveness for safety is not ideal for a server/kernel. That is, panicking when something bad happens (eg array bounds check fails) prevents something bad happening but it may also cause loss of data, loss of logging (eg an attacker might quickly perform an attack and then crash the kernel before logging info can be saved), denial of service, and similar which are maybe just as bad as the original problem.
So, yes, really important to try to eliminate panics from the entire Rust codebase. A combination of fuzzing and our formal verification tools is the answer.
wrt Bytecode... The thing not to do is generate random files of bytes and call it good. You will find lots of ways to create malformed bytecode but you will only be getting coverage over the bytecode loader. You need multiple layers of fuzzing - each layer bypassing the issues that the previous layers have already checked.
(Did a variation of (4) on a microcontroller OS before - found some issues.)
We should ensure that no matter what happens while executing the Wasm module, there is no way to make the server (in production mode) panic, or produce any other macroscopically observable effect.
Perhaps we should also set up fuzzing, though I am not sure whether fuzzing the Wasm bytecode would be a productive way of doing this. We could also fuzz user requests, given a fixed Wasm module.
cc @alastairreid
_Originally posted by @conradgrobler in https://github.com/project-oak/oak/pull/1991#discussion_r617271100_