Millions of lines of code, all running in supervisor mode. One bug is all it takes to compromise the entire system. The monolithic UNIX kernel was a good design in the 60s; Today, we should know better[0][1]. 0. https://sel4.systems/ 1. https://genode.org/
Kernel bugs hide for 2 years on average. Some hide for 20
71–80 of 186 posts
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#72Earlier quoted context omitted.
I'd argue, that while null ref and those classes of bugs may decrease, logic errors will increase. Rust is not an extraordinary readable language in my opinion, especially in the kernel where the kernel has its own data structures. IMHO Apple did it right in their kernel stack, they have a restricted subset of C++ that you can write drivers with. Which is also why in my opinion Zig is much more suitable, because it a…
> Zig is much more suitable, because it actually addresses the readability aspect How? It doesn't look very different from Rust. In terms of readability Swift does stand out among LLVM frontends, don't know if it is or can be used for systems programming though.
I think they are right in that claim, but in making it so, at least some of the code loses some of the readability of Swift. For truly low-level code, you’ll want to give up on classes, may not want to have copy-on-write collections, and may need to add quite a few some annotations.
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#73[flagged]
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#74Re: Kernel bugs hide for 2 years on average. Some hide for 20
#75Before the "rewrite it in Rust" comments take over the thread: It is worth noting that the class of bugs described here (logic errors in highly concurrent state machines, incorrect hardware assumptions) wouldn't necessarily be caught by the borrow checker. Rust is fantastic for memory safety, but it will not stop you from misunderstanding the spec of a network card or writing a race condition in unsafe logic that int…
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#76[dead]
I don't, which is why I use Qubes OS providing security through compartmentalization.
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#77Earlier quoted context omitted.
One of my favorite Firefox bugs was some I don’t quite remember the details of, but went something like this: “There’s a crash while using this config file.” Something more complex than that, but ultimately a crash of some kind. Years later, like 20 years later, the bug was closed. You see, they re-wrote the config parser in Rust, and now this is fixed.” That’s cool but it’s not the part I remember. The part I always…
To be fair, any rewrite could have fixed it, didn't have to wait for Rust.
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#78Am I the only unreasonable maniac who wants a very long-term stable, seL4-like capability-based, ubiquitous, formally-verified μkernel that rarely/never crashes completely* because drivers are just partially-elevated programs sprinkled with transaction guards and rollback code for critical multiple resource access coordination patterns? (I miss hacking on MINIX 2.)
* And never need to reboot or interrupt server/user desktop activities because the core μkernel basically never changes since it's tiny and proven correct.
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#79Before the "rewrite it in Rust" comments take over the thread: It is worth noting that the class of bugs described here (logic errors in highly concurrent state machines, incorrect hardware assumptions) wouldn't necessarily be caught by the borrow checker. Rust is fantastic for memory safety, but it will not stop you from misunderstanding the spec of a network card or writing a race condition in unsafe logic that int…
I don't think 70% of bugs are memory safety issues. In my experience it's closer to 5%.
Re: Kernel bugs hide for 2 years on average. Some hide for 20
#80Before the "rewrite it in Rust" comments take over the thread: It is worth noting that the class of bugs described here (logic errors in highly concurrent state machines, incorrect hardware assumptions) wouldn't necessarily be caught by the borrow checker. Rust is fantastic for memory safety, but it will not stop you from misunderstanding the spec of a network card or writing a race condition in unsafe logic that int…
It's worth noting that if you write memory safe code but mis-program a DMA transfer, or trigger a bug in a PCIe device, it's possible for the hardware to give you memory-safety problems by splatting invalid data over a region that's supposed to contain something else.