Hacker News new | ask | show | jobs
by grapheneos 20 days ago
Our posts were only about the Linux kernel, not an overall OS built on top of it. We weren't talking about the API design inherited from Unix or compatibility with software written for it. We also weren't talking about why it was created but rather the design choices.
2 comments

Yes, smaller and verifiable kernels would help a lot against buggy and malicious code. Let alone stability and robustness.

Then, I for one, would not change C for anything else. The problem is not the language (which is just a tool), the problem is the coding (and the coders).

Having languages themselves be built like microkernels would help security a hell of a lot too however
> Having languages themselves be built like microkernels

What does that mean? Like... small stdlib with everything moved to extra libraries? Languages don't really have a ring 0 so I'm not sure how to read this even though it feels like a maybe-interesting take

Yeah, currently popular languages don't have any separation, internal isolation, any way to limit or monitor authority (and use of that authority) to access and use resources at all. Programs and any part of them usually have full ambient authority, meaning they can just name and use resources (importing libraries by name, opening any files by stating file paths, ...) without restrictions.

Instead, (parts of) programs should be restrictable to pure computation by denying any external resource access by default, unless explicitly granted or approved more (to the minimum they need, following the principle of least authority).

See: https://en.wikipedia.org/wiki/E_(programming_language) or any of the languages listed here: https://en.wikipedia.org/wiki/Object-capability_model#Langua...

Having a microkernel OS isn't really sufficient if you want to "hollow out the attack surface" well, because many programs (including imported libraries) consist of hundreds of thousands of lines of code made by hundreds or thousands of people (and now also AI). So programs should be internally compartmentalizable as well. Only this, imported libraries being able to sandbox their imported libraries and so on recursively truly reduces the possible effects of vulnerabilities to a minimum.

And only programming languages (or virtual machines i guess) can achieve these types of guarantees in a platform independent way.

Oh, you want an object-capability language; I didn't connect those dots. Yes, that would be an excellent compliment and now that you've spelled it out I can see the analogy.
It does not mean anything to me.

What counts is not the mental model programmers build in their minds. It's the machine code that executes inside CPUs.

A language that can monitor and (ideally: provably - the mental model applying exactly at the hardware level, assuming no shenanigans there) limit the effects of a program's components and isolate them against each other is strictly better than one that can't.

Case in point: https://hforsten.com/redefining-the-number-2-in-python.html

Add a zillion past, present and future supply chain attacks as examples too

I struggle to see a meaningful difference.

The UNIX command line userland philosophy was not to architect a rigid user facing system in advance but enable ad hoc, as needed edge case problem solving.

Linus solved the problem of not having UNIX kernel sources by designing the Linux kernel from his experience as a UNIX user solving problems as they appeared not through advanced speculation and architecture. The connection seems obvious to me.

And this doesn't say anything that wasn't obvious this whole time. It's just in the spirit of the don't architect based on speculation but reality, LLMs didn't exist and didn't need to be accounted for. No corporation, nation state or script kiddie had enough compute back then.

This is all like config DSLs; it all been coming up again and again the entire 30ish I been paying attention to Linux/Unix.

Never contributed code back then though. I was more interested in EE, building electronics back then but was curious enough about Linux to build kernels and eventually Slackware. Really not all that interested in code today even; it's just how it works