7 ms·
How is it possible in 2015 that major kernels are vulnerable to arbitrary code execution via null pointer dereference? Because they're monolithic, bloated, and
by Animats 12y ago
How is it possible in 2015 that major kernels are vulnerable to arbitrary code execution via null pointer dereference?
Because they're monolithic, bloated, and written in C.
(Rust guys, please don't screw up. We need a win there.)
- danieldk 12y ago> (Rust guys, please don't screw up. We need a win there.) While it's true that Rust would help here, it is very unlikely that a Rust kernel project would get as far as e.g. Linux and let alone replace it. Of course, rewriting and existing kernel stepwise would be interesting, if possible.
- runeks 12y ago> Of course, rewriting and existing kernel stepwise would be interesting, if possible. Perhaps it's possible to write a new kernel in Rust, and have it be backwards compatible with Linux, by "wrapping" the Linux kernel and drivers in sandboxes? So a Rust kernel with some kind of built-in environment isolation, in which it can run the real Linux kernel. The running Linux kernel would then access physical hardware through a wrapper in the Rust kernel, while the Rust kernel would access hardware directly. That's really the only way I see this project gaining widespread adoption: by leveraging Linux. Linux simply has too much momentum to be replaced with something non-compatible. Of course, a Rust kernel could be useful for all kinds of things other than replacing Linux. Like a Mirage OS-type kernel that uses Rust to write drivers in Rust (instead of OCaml).
- pjmlp 12y agoI don't see that happening with Linux, though. Linux as a UNIX clone, will never use anything else other than C. Replacing C in MirageOS sounds more likely.
- icebraining 12y agoWouldn't that essentially be an hypervisor written in Rust?
- Animats 12y agoThat's what I'm thinking. Take a look at http://spin.atomicobject.com/2014/09/27/reimagining-operating-systems/ http://spin.atomicobject.com/2014/09/27/reimagining-operatin... for an overview of what's going on in this area. If you're running containers on a hypervisor, with files on storage servers elsewhere, most of the Linux kernel is dead weight. Most of the kernel can be replaced by a modest glue library. Here's one, written in OCaml: http://anil.recoil.org/papers/2013-asplos-mirage.pdf http://anil.recoil.org/papers/2013-asplos-mirage.pdf As containers catch on, we'll see more systems specialized to run nothing but containers. They will be much simpler than Linux or Windows. System administration will be external, as it is for cloud systems like Amazon AWS now.
- geofft 12y agoThis is vaguely the idea behind Joanna Rutkowska and co.'s Qubes: there are lots of Linux kernels in different Xen domains, one for each class of userspace apps (banking, gaming, etc.) and one for each low-level service (networking, graphics, etc.). For instance, if the Linux kernel is vulnerable to a local privilege escalation, and the DHCP client is vulnerable to arbitrary code execution, on a traditional system, anyone on the other side of your Ethernet cable can root your machine. Under Qubes, all they can do is root the Xen domain that's providing networking -- but that's not significantly more power than they had than by being on the other end of your network cable, since that domain does nothing other than networking. https://qubes-os.org/ https://qubes-os.org/ I'm not convinced that Linux is unkillable, though. This thread is about OS X, I'm typing this on an OS X machine, etc. I suspect that if you do a good job of working with people's hardware (Apple has an advantage, of course), you can run Chrome, and you can run anything that's portable between OS X and Linux, you can get pretty far.
- denim_chicken 12y agoSuch naivety.
- istvan__ 12y agoUnfortunately Rust itself has limited space to secure a kernel. We need a major change in operating systems to have a safer environment that is not trivial to exploit. My list goes as: - kernel memory and userspace memory is hardware separated as it was originally with some early architectures More about it here: http://phrack.org/issues/64/6.html#article http://phrack.org/issues/64/6.html#article - microkernels Having a formally verified ring0 execution block and everything else is running in a less privileged space, this would allow kernels to protect themselves against bad drivers and other parts of the operating system that can be used as attack surface today - safe userland this is I guess where Rust could help the most, having a memory safe low level language
- pjmlp 12y agoSeverals attempts have been made in secure OS, the major problem is the prevalence of UNIX monoculture in the mainstream desktop and server environments, that has came to be. UNIX is married with C, so any attempt to replace C, means breaking with the UNIX mindset, which has proven very hard to do. Even successful research projects like Oberon, failed to cater the industry, and this was before UNIX became widespread. Regarding microkernels, most of the embedded space OS are actually using microkernels. I am following MirageOS, HaLVM and Microsoft's Ironclad as possible safer OS. This is why also also like what Apple, Google and Microsoft do on their mobile OS to reduce the amount of allowed unsafe code. Even though it isn't at kernel level.
- geofft 12y ago> UNIX is married with C, so any attempt to replace C, means breaking with the UNIX mindset, which has proven very hard to do. I don't believe this is particularly true, although I haven't explored it very far. UNIX is married with the API/ABI exposed by the so-called "C" library. So far, there have been no languages that offer native interoperability with C and have gained significant popularity, other than C++, and C++ is certainly pretty popular on UNIX (Qt, gcc, etc.). Rust does offer that and is (evidently) picking up a ton of steam, and you can get to the point where stupid tricks that previously required a C derivative can be done in Rust. http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-static-linux-binary-in-rust.html http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-... In fairness, this often also requires things like "C" strings, the "C" locale, etc. But those things can either be done smoothly enough from Rust, or are wrong anyway, that I think there's a chance to break the C stranglehold here.
- microcolonel 12y agoI'm setting up a system with SeL4. None of the systems you're suggesting have formal proofs of correctness, and this one not only has such proofs, but is written in C.
- geofft 12y agoWhat is the process for patching seL4? How does e.g. adding a parameter to an existing function affect the proof, and what's the process for proving additional predicates?
- microcolonel 12y agoThe proofs are publicly available, though I can imagine there would be significant... overhead involved in adding functions to the system.