Hacker News new | ask | show | jobs
by yjftsjthsd-h 19 days ago
> That most of the Linux kernel runs in https://en.wikipedia.org/wiki/Protection_ring 0 should have stopped decades ago

Do you have a way to do it on the hardware people actually have that doesn't destroy performance every time the CPU context switches? You can always move all your filesystems to FUSE if you like the performance...

3 comments

I can't answer the hardware part.

But i'm perplexed by the unrelenting, ever re-occurring "counterpoint" of performance whenever the topic of sound security architectures comes up. As if even a 2x slowdown would be unacceptable, so many Moore's law doublings after Linux has been created later, in exchange for a system that doesn't allow thousands of vulnerabilities, and would limit the effects of more, yet undetected ones.

I am fairly confident that you would find that most people, if offered the chance to take that performance hit in exchange for some security improvement, would not take the deal so quickly as you. Since this is (somewhat) in the context of mobile, I also have to point out that it's also going to be a battery hit and that might be an even harder sell.
Software has become doubly bad at the same rate that hardware has become doubly good, so we by no means have compute to spare. A 2x slowdown would absolutely be unacceptable. No business is going to pay for twice as much compute on their servers. No developer is going to pick the OS that takes 30 minutes to compile a large Rust program instead of 15 minutes. If you get double the performance for the same cost, it's not even a contest.
To me this looks like a world rushing toward catastrophic failure

Security isn't just a word, it's the security of the world as technology becomes ever more integrated and influential in it

I don't disagree that security is important, but you need a better pitch than "give up half of your compute for security" for a general-purpose OS, because the reality is nobody's buying with a sales pitch like that and you need a pitch that people will actually buy if you want to see that security manifest in the real world.
I’d gladly give up half of the compute on my devices for security if given the option.
Sadly no real mobile equivalent, but you might consider qubes-os on PC.
The better pitch is "give up half of your compute for security or give up all of your compute when your company is forced to shut down because of a security incident." Almost all of the work I do is patching or managing the orchestration that facilitates that patching. If my employer didn't think they had to pay me to do this I'm sure they wouldn't!
I've worked for too many companies that would always choose option 2.
> a 2x slowdown would be unacceptable, [...] in exchange for a system that doesn't allow thousands of vulnerabilities

OpenBSD fits the bill

OpenBSD has the same monolithic design in a memory-unsafe language that was criticized here. BSDs don't solve the issues alluded to in the thread.
Qubes OS uses type I hypervisor with hardware virtualization to provide security through compartmentalization. The performance hit is minimal.
Yes, it works alright for Windows, macOS, iOS, iPadOS, Android, Fuchsia.

And all those cars, rockets, factories powered by QNX, INTEGRITY,....

Ah, and those Switch games, nothing really that relevant.

> Yes, it works alright for Windows, macOS, iOS, iPadOS, Android, Fuchsia.

Other than Fuchsia (I assume), all of those are at most hybrid systems with the performance-sensitive drivers still in ring 0.

> And all those cars, rockets, factories powered by QNX, INTEGRITY,....

Yes, you can get away with a lot if you're willing to sacrifice performance for safety.

> Ah, and those Switch games, nothing really that relevant.

That actually is an interesting point. Do you know how that works? I'd guess either they're doing something fun in hardware or they've actually got something going on in software worth considering. (Unless the thing they're doing is impractical to port to more general-purpose systems)

> Other than Fuchsia (I assume), all of those are at most hybrid systems with the performance-sensitive drivers still in ring 0.

Not really.

Apple iDevices don't allow third parties to ship drivers to ring 0, all third party drivers are in userspace.

While macOS still allows for kexts, the official roadmap is that ring 0 is only for Apple, everyone else has to move into userspace drivers.

Android only allows ring 0 drivers for "legacy" Linux kernel drivers, all other drivers must use Android IPC since Android 8.

Windows 11 runs on top of Hyper-V, drivers run virtualised (Device Guard) and do several key kernel components (Secure Kernel), everything together is known as Virtualization-Based Security.

These features are also available on Windows 10, however there they need to be explicitly enabled.

Additionally, since Windows 8 several drivers have been pushed into UMDF, and since the whole fallout in 2024, that there is a new framework on the way for security folks to take their stuff out of the kernel.

Across all three vendors, the amount of application sandboxing keeps going beyond a plain Flatpak or Snap can do, and there is a lot more going on with XPC, Android IPC, COM (out-proc) than D-Bus gets used for.

Horizon works, because Nintendo is not doing Minix, like everyone does when they talk about microkernels, rather taking the lessons out of operating systems like QNX on how to pass capabilities around.

https://news.ycombinator.com/item?id=17534593