18 ms·
The Jury Is In: Monolithic OS Design Is Flawed [pdf]
- imglorp 8y agoThe title is missing "from a security standpoint". Of course, everything is a tradeoff. TLDR: > We have presented what is, to the best of our knowledge, the first quantitative empirical assessment of the security implications of operating system structure, i.e. monolithic vs microkernel-based design. > Our results provide very strong evidence that operating- system structure has a strong effect on security. 96% of crit- ical Linux exploits would not reach critical severity in a microkernel-based system, 57% would be reduced to low severity, the majority of which would be eliminated alto- gether if the system was based on a verified microkernel. Even without verification, a microkernel-based design alone would completely prevent 29% of exploits. > Given the limited number of documented exploits, we have to assume our results to have a statistical uncertainty of about nine percentage points. Taking this into account, the results remain strong. The conclusion is inevitable: > From the security point of view, the monolithic OS design is flawed and a root cause of the majority of compromises. It is time for the world to move to an OS structure appropriate for 21st century security requirements
- digi_owl 8y agoThe age old joke about the computer encased in concrete at the bottom of the ocean does indeed come to mind.
- da_chicken 8y ago> The title is missing "from a security standpoint". I mean, kind of, but since maintaining system security and integrity is a core function of the OS -- in fact, it is the primary gatekeeper in terms of all system security -- it means that "being secure" and "being correct" are often synonymous terms for an operating system. After all, if we don't care about security at all we can all run CP/M or run everything as root. Now, sure, you can say that the whole thing is bullshit because verified microkernels are so difficult to design that the end result would be an unusable system, but all that suggests is that when you design your kernel you should aim for a hybrid and compromise more on the side of a microkernel where you can.
- gjm11 8y agoSo, they've looked at a sample of exploits that were critical on Linux and established that most wouldn't have been critical on a hypothetical otherwise-similar microkernel system. But they haven't looked at a sample of exploits that were critical on an actual microkernel OS and seen how many would have been less serious (or not arisen) on a hypothetical otherwise-similar monolithic-kernel system. It reminds me of a nice observation in "Surely you're joking, Mr Feynman". Feynman developed some nonstandard ways of solving mathematical problems. Other people came to him and he repeatedly solved problems they'd been stuck on. "He must be much smarter than us!" But the problems they brought to him were selected as ones they couldn't do, so of course he'd look better than them on those. They never bothered asking him problems he couldn't do but they could, because they'd already done them. Now, maybe the authors of the paper are confident that there's no way that a microkernel design could encourage or exacerbate vulnerabilities. But so far as I can see they don't offer any actual argument for that proposition.
- nickpsecurity 8y ago"But they haven't looked at a sample of exploits that were critical on an actual microkernel OS and seen how many would have been less serious (or not arisen) on a hypothetical otherwise-similar monolithic-kernel system." Cuz they don't exist so far. Microkernel-based systems will have same kinds of bugs as monoliths if coded in same language for same hardware. From there, the microkernel architecture leads less bugs in number (less code), less in severity (more isolation), and sometimes less difficulty in patching or recovery. If looking for microkernel-based bugs, I'd look for errors in concurrency and passing data over IPC. Monolithic system are using more concurrency and middleware than ever now, though. Even more than microkernels from what I see if talking about all the strategies and their implementations vs a few, standardized primitives. So, even those areas central to microkernel design seem like problems shared with modern monoliths. So, the status quo is that the monoliths mostly add problems and increase their severity. Vice versa, the microkernels mostly subtract them in number and/or severity. The field evidence shows this with most of the data on bugs and vulnerability coming from monolith users. From there, someone might want to try to see if the opposite is true. Burden of proof is on them, though, with the status quo being quite reasonable. And that investigation, as I said, might find "microkernel" problems that hold in how modern monoliths are used (esp service and web architectures). Still worth attempting since they might surprise us with what they find. :) To be clear, that's all about the architectural patterns. I think combining all the potential benefits of microkernels in a system vs a simple monolith could lead to more bugs in microkernel. Most of the problems in software will come from complexity and QA level regardless of architectural style. So, my post is written with assumption that we're talking about large, complex systems done with one style or the other.
- Steko 8y agoI examined all fatal car crashes in the United States between pi day and Bloomsday in 2015 and assigned them a Mitigation Score based on the hypothetical that the people involved were instead walking. 98.3% of fatalities would have been prevented. The jury is in: ban all horseless carriages.
- fulafel 8y agoIt would be more credible if the authors were able to distinguish between exploit and vulnerability.
- nasoieu 8y agoThat chart with the growth of the Linux kernel discredits everything. The Linux kernel continues to grow because they are obsessed with keeping all drivers in mainline instead of having a stable API for them as any sane project would.
- rhencke 8y agoI believe one of the reasons Linux continues to be successful today is _because_ they keep the drivers in mainline _without_ a stable API. It is a key motivator to ensure drivers remain available and supported well into the future of Linux.
- pjmlp 8y agoWhich given the way legacy AMD drivers story has been handled on Ubuntu, it is quite far from actually being so. My Asus Netbook no longer gets all the acceleration options that it used to have pre 16.04. Linux is successful because it is a free beer UNIX clone.
- core-questions 8y agoWomp womp. Most of those netbooks are unusably slow anyhow, and were when they were brand new too. Run an older kernel on there and call it a day.
- matachuan 8y agoOf course it's about Gernot Heiser's verified ukernel...
- pweissbrod 8y agoI wonder if there exists a parallel dimension where linux is microkernel design and folks are pushing for monolothic citing the driver friendliness and performance
- andrewstuart2 8y agoIf parallel dimensions exist, then it's most certainly one of the closest dimensions to ours. If I'm sure of one thing, it's that as soon as we decided to build everything as Microkernels, we'd have the same squeaky wheels touting the massive benefits of Monotlithic OS design. We're hilariously cyclical in our preferences. "Think of all the runtime efficiencies of the shared memory, and how much easier it would be to develop on the shared codebase!"
- gregmac 8y agoThis isn't specific to software: The grass is always greener on the other side.
- bena 8y agoI think it's just a matter of being deep in the weeds on whatever thing we're currently invested in. When we choose a direction, we see all the difficulties that path provides and kind of forget about all of the things it gives us. And when looking at the other option, we see all the things that would overcome our difficulties while assuming that we get to keep everything good from the current path. Everything is a trade off.
- deleted 8y ago[deleted]
- KMag 8y agoThe dirty secret is that we take a microkernel, rename the syscalls as "upcalls", throw in some hardware emulation code as a less efficient and uglier API for software that can't be bothered to be ported, and call it a hypervisor. Also, your phone's baseband processor almost certainly runs a microkernel, and likely so does your car.
- nkkollaw 8y agoLinux is the most popular OS in the world (of course, counting Android), so I guess this means it doesn't really matter is monolithic is flawed, or it is not flawed enough.
- gnulinux 8y agoIsn't GNU/Linux (so, no Android) alone most popular OS too, thanks to servers and cloud? Any data on this?
- JdeBP 8y agoActually, MINIX, the operating system used in the ME in modern Intel chipsets, is possibly now one of the most widely deployed operating systems on the planet. * https://news.ycombinator.com/item?id=15642116 https://news.ycombinator.com/item?id=15642116 * https://news.ycombinator.com/item?id=15634014 https://news.ycombinator.com/item?id=15634014 * https://news.ycombinator.com/item?id=15697888 https://news.ycombinator.com/item?id=15697888 * https://news.ycombinator.com/item?id=15641592 https://news.ycombinator.com/item?id=15641592
- pjmlp 8y agoSure it matters, because Android Oreo has actually forked Linux into a microkernel like design, where drivers run as separate processes and use Android IPC to talk with the kernel.
- Symmetry 8y ago
- brewski 8y agoThis is like saying Linux is more secure than Windows because not all of Window's critical vulnerabilities appear in Linux.
- Jweb_Guru 8y agoWhat classes of vulnerabilities are you referring to that are likely to show up in a microkernel-based design but not in a monolithic one? Do you think adding those classes of vulnerabilities to the picture will result in more, about the same, or fewer critical security issues between the systems overall, and why? Please be specific.
- paulie_a 8y agoTrue but in the case of windows gdi has been a never ending pinata of critical bugs.
- mikkergp 8y agoWell, the obvious solution is to design our Kernel's on Kubernetes.
- steveklabnik 8y agohttps://www.qubes-os.org/ https://www.qubes-os.org/
- snug 8y agoA reasonably secure os? I think that's one thing I don't want just reasonable
- steveklabnik 8y agoIt's kinda self-deprecating humor; the (now ex) Tor developers I know use it. Nothing is ever 100% secure.
- przmk 8y agoIt's definitely better than software claiming to have military grade encryption.
- yjftsjthsd-h 8y agoIt's like the lesswrong folks; step one was accepting that there are too many flaws to fix everything, and then step two was to do our best anyways.
- qu4z-2 8y agoAlso mutt, with "All mail clients suck. This one just sucks less."
- wpdev_63 8y agoIt's not secure if the hardware compromised. Not much is.
- throw7 8y agoThe Jury Is In: Microkernel OS Design Is Flawed. See I can make clickbait titled papers also.
- Jweb_Guru 8y agoGreat, now all you have to do is build a secure (preferably formally verified) monolithic kernel, exhaustively, thoroughly research all the vulnerabilities in popular micokernels, find evidence to support your thesis, write up the paper, and get it peer reviewed, and you're all set!
- flurrything 8y agoCan you? Where is that paper? I only see a title.
- 0xdeadbeefbabe 8y ago> We find that almost all exploits are at least mitigated to less than critical severity, and 40% completely eliminated This probably sounds trollish, but security isn't that important. An OS architecture has to take into account other things too.
- guy98238710 8y agoIt's kind of pointless to have a faster server at the cost of seeing that server owned by someone else.
- swiley 8y agoIn a perfect wrold microkernel OSes would be perfect but then it's all pointless. In real life there are certain parts of the OS that have to work or the whole device stops working. Furthermore: the isolation of dynamic and less tested application code from these parts is generally a good idea, that's why monolithic OSes are so popular; they're simply less demanding.
- ysleepy 8y agoNobody claims faults of core functions must be survivable in microkernel designs. The restarting of driver processes is a nice trick, but in the end the isolation and clean interfacing are particularly useful in an imperfect world. The goal is to minimize the trusted computing base (TCB) so that it is, at least to some degree, verifiably correct. Then tack on features using isolated components.
- nine_k 8y agoI'd hazard to say that every design is "flawed" in some regards: there's no way to achieve all desirable qualities and none of undesirable qualities. For one, some desirable qualities contradict each other. So "${thing} is flawed" is not precise enough; an interesting statement would be "${thing} is not the best choice for ${conditions}". A monolithic OS is not the best choice for a high-reliability system on unreliable hardware. A microkernel OS that widely uses hardware memory protection is not the best choice for a controller with 4KB of RAM. A unikernel setup is not the best choice for a desktop system where the user is expected to constantly install new software. Etc, etc. In other words, the ancient concept of "right tool for the job" still applies.
- amelius 8y ago> In other words, the ancient concept of "right tool for the job" still applies. Or use a multi-tool ;)
- m3mpp 8y agoman, a lot of words to say nothing...
- loup-vaillant 8y agoThe main point remains: server and desktop OS kernels are a critical piece of infrastructure, worthy of full machine checked verification. In this context, it should be pretty obvious that a design that fails to minimise the trusted computing base is flawed. Even if a kernel vulnerability is unlikely to kill any given user, the sum of all the crashes, hacks, patching effort… is huge. I bet my hat rewriting the entire kernel for all popular OSes would be far cheaper worldwide than not doing it. (Of course, this won't happen any time soon, because path dependence and network effects. Unless maybe someone works seriously on the 30 million lines problem described by Casey Muratory.) > In other words, the ancient concept of "right tool for the job" still applies. Absolutely. Monolithic kernels are clearly the wrong tool for the job.
- 77pt77 8y agoStill waiting for GNU hurd.
- htor 8y agognu hurd was released in 2015, but very few people are working on it i'm afraid. https://www.gnu.org/software/hurd/news/2015-04-29-debian_gnu_hurd_2015.html https://www.gnu.org/software/hurd/news/2015-04-29-debian_gnu...
- xj9 8y agohurd isn't even interesting. seL4 is faster, has production applications, and is formally verified. you can even use seL4 as a base platform in genode[0]. [0]: https://genode.org/documentation/platforms/index https://genode.org/documentation/platforms/index
- acd 8y agoThere is a reason why kernel code run in privileged mode, speed! If you run more kernel code in privileged mode then you do not need to copy as much data between the kernel and user space. Vs a micro kernel you will have to copy more data up to user space. Copying data to user space causes context switches and gives less performance. Larger mono kernels: Speed Micro kernels have advantages such as: smaller privileged attack surface and thus more secure, more crash proof as you can restart user land processes for example device drivers https://en.wikipedia.org/wiki/Microkernel https://en.wikipedia.org/wiki/Microkernel
- pradn 8y agoDo you really need to do a full copy? What if you had a shared page and notified the user process when the data in the page was available at a certain offset. Take a look at this paper (FlexSC: Flexible System Call Scheduling with Exception-Less System Calls): https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Soares.pdf https://www.usenix.org/legacy/event/osdi10/tech/full_papers/...
- tlb 8y agoSharing pages between user processes and kernel is extremely bug-prone, because threads in the user process can mutate the data while the kernel is reading it, leading to all kinds of race conditions. You can't depend on user processes respecting mutexes for security. You can make this work by removing the page from the user process before making it available to the kernel, but the synchronization overhead of doing this (especially on a NUMA system) is probably worse than copying moderate amounts of data.
- pradn 8y agoHmm. Perhaps temporarily switching the TLB entry to read-only mode for that page during kernel accesses? There might be some interesting software-hardware co-design solutions here.
- naasking 8y ago> If you run more kernel code in privileged mode then you do not need to copy as much data between the kernel and user space. Microkernels don't copy data into the kernel address space, they copy data between userland address spaces. Which still happens in monolithic systems anyway when you're doing IPC. These are typically short messages, often only data passed in registers. And if copying is going to be a bottleneck, then you negotiate a shared address space just like in Unix, and no more copying.
- nwmcsween 8y agoIMO a microkernel isn't a design worth pursuing as there will always be overhead. Instead an exokernel with a simple monolithic 'multiplexing' kernel or a language that has 100% safety (not really possible).
- enitihas 8y agoReminds me of the famous Torvalds Tanenbaum debate. https://groups.google.com/forum/m/#!topic/comp.os.minix/wlhw16QWltI https://groups.google.com/forum/m/#!topic/comp.os.minix/wlhw...
- CGamesPlay 8y agoAh, this was great! > Linus "my first, and hopefully last flamefest" Torvalds
- thsowers 8y agoThanks so much for the share, great gems in here, I still found myself surprised at this: > True, linux is monolithic, and I agree that microkernels are nicer. It's hard to believe that he was only 23 when he wrote this
- pjmlp 8y agoWhy? In Portugal we finish our 5 year engineering university degrees at the age of 23.
- tinco 8y agoI think thinking about operating systems is precisely the sort of thing 23 year old college students do. I know a few in my class did, I was hyped up by MS's Singularity OS back then. Unfortunately they were not aware yet that Windows was going to lose the Server OS war and they never pulled Singularity out of research. Operating Systems is a 2nd year course in most universities.
- travbrack 8y ago>I also agree that linux takes the non-portability to an extreme: I got my 386 last January, and linux was partly a project to teach me about it. Times sure have changed
- Sporktacular 8y agoSome super low quality commentary here. Straight to the Monolithic/Microkernal tribalism, talk of parallel dimensions, as long as we ignore the content of the paper - which remains far more empirical and convincing than any rebuttal seen here.
- GirlsCanCode 8y agoThat's why I use the most popular microkernel OS ever: Windows 10.
- jacquesm 8y agoThe jury was in in the mid 1990's, but Linus Torvalds doesn't know when he's wrong and to listen to his betters. Linux succeeded because of its community, not because of its architecture. QnX has shown the strength of microkernels for decades, they are far more stable and much easier to work on than monoliths. The (small) speed penalty should be well worth the price of admission.
- iamcreasy 8y ago> QnX has shown the strength of microkernels for decades Could you elaborate on this one please?
- jacquesm 8y agoQnX is so common that if you removed it from the industrial world the world would literally grind to a halt. Machinery and vehicles would stop moving, factories would stop producing, chemical plants would (hopefully!) shut down and airplanes would no longer take off (or would have a much harder time trying to land without the usual guidance systems), boats would drift and messages would stop being sent through many systems that you probably would never have heard of. For one example of such a system: A computerized way to communicate the availability of cargo and space to brokers all over the world, on a good Monday morning several million such messages are sent with a guaranteed maximum time between the first and the last such message sent (to ensure a fair market). QnX is extremely pervasive and it - and other OS's like it - are so reliable that people tend to forget the systems it powers. Blackberry made a pretty smart move with their acquisition of QnX, pity that it did not end with QnX being open sourced, that would have been very nice.
- alexandercrohde 8y agoJust as a casual reader of this comment, a few tips: - The rhetoric about the world grinding to a halt isn't really pertinent and makes you look unreliable. Also, no, not "literally." I think what you're getting at is that it's chosen for high-reliability systems, with the implication being that it's chosen for its superior reliability(?) - But I say this because it sounds like you have some knowledge as to how this obscure microkernal is used and sharing that is valuable to the community. It's just a shame if the message gets lost in the delivery.
- justicezyx 8y agoNow it's a good time to revive microkernel for prime as server less offers the abstraction for making transition transparent to users and application developers. Anyone tried that?
- nostrademons 8y agoMuch of the cloud/virtualization industry is actually built on exokernels; a hypervisor is basically the commercially-viable version of an exokernel. The unikernel movement is an attempt to revive the LibOS and use exokernels as they were originally designed (i.e. move OS abstractions into user-space and not have a whole OS running on top of an OS), but there've been several pragmatic barriers that've kept them from gaining all that much adoption.
- justicezyx 8y agoI think I am mostly want to say to the advocate of a certain on machine first-level software infrastructure above hardware to feel more free to try to prove their technology is the best. I am not too much about particular alternatives.
- renox 8y agoOK so seL4 is safer than Linux, that's not really news.. I have questions about seL4 though: is it able to manage several multicore CPU efficiently? What about power management, does it work?
- gnufx 8y agoContrary to what's written about microkernel speed: Systems I used in the '80s to great effect used at least the moral equivalent of a microkernel ("Nucleus"). They were fast (compared with VAXen etc.) for interactive use and supported real-time processes. (Some visitors thought context switching was a bit slow, assuming "microseconds" meant "milliseconds".) The filesystem was fast enough to dispel the assumption a "database" was always required for speedy experimental data access rather than a file per spectrum. https://en.wikipedia.org/wiki/OS4000 https://en.wikipedia.org/wiki/OS4000 The performance wasn't just because Nucleus initially was in hard/firmware; two later software implementations were performant (on faster hardware). Also, as the article is about security: at least the original Nucleus also supported an A1/B3-level secure OS.