“...Rust in the kernel is dependent on *kernel* rules”
lkml.org
lkml.org
> I think a much better email from the thread to link to would be the earlier https://lkml.org/lkml/2022/9/19/840, where Linus actually talks about some of the challenges of kernel programming and how they differ from user-space programming.
I'm not quite happy with the way I put that. If you have better wording, feel free to chime in.
Personally I would prefer my pacemaker to miscount a beat than shutdown completely...
There are some people who would prefer the purity of "Panic" on a memory corruption/error, and there are some people who are operating space craft and safety critical systems where a "Panic" could lose lives.
This is why I don't buy-in completely with claims of safety, when we've been using Assembly/C/C++/Ada/etc. for decades. It's a trade off and you're not going to stop cosmic rays flipping your bits.
If the OS will encounter memory corruption, it cannot reliably do anything but restart. Anything else will risk further corruption and will make any investigation more difficult and effects more distant from the cause.
> and there are some people who are operating space craft and safety critical systems where a "Panic" could lose lives.
So could erratic behaviour.
A panic doesn't imply shutting down. If my api panics a system above it(systemd, docker, k8s) restarts the api from a known good state.
Memory corruption can do much worse.
Note: Hypervisor is not the right answer.
Any kernel that did panic would stop getting used by the majority of people pretty fast as being "too unreliable".
So will kernel that corrupts data, but panic is much easier to fix than corrupted data because it's closer to the source of the problem.
I'm honestly not surprised a discussion like this is popping up on LKML. At least Torvalds isn't up and swearing at these new contributors like he used to