News for hackers. Stuff that matters.
Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by pengaru on Monday August 07, 2023 @01:24PM (#37037587)
It's not about the code existing, it's about the code being an integral part of a monolithic architecture vs. "servers" facilitating a microkernel design like hurd/mach.
Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Monday August 07, 2023 @01:30PM (#37037684)
But that is silly? If I have to audit the code for my system running, I would have to audit the code for each of the "servers" as well? If not, why not?

To that end, how different is it, actually? And what are the other tradeoffs?

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by pengaru on Monday August 07, 2023 @01:37PM (#37037789)
The servers are run in isolated address spaces like processes, taking advantage of MMU protection for more of the low-level facilities.

Ask yourself why it's safer to use FUSE filesystems on Linux when mounting untrusted block devices/image files than the in-kernel filesystem drivers and maybe it'll become clear why this is advantageous.

Or if you're familiar with containers and why that's a good thing, you can think of it as containerizing the kernel's subsystems/drivers.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Monday August 07, 2023 @01:49PM (#37037982)
This... didn't answer my question? For many that are concerned with containers and such, they also have to audit the container process code. Such that, fine, try to use that to inflate the numbers on Linux.

Pointing at literally decades of device drivers as why the size of the code is bad, while acknowledging that it will take time to write device drivers so this will work on a respectable amount of hardware just feels weird.

That all said, please don't take this as a criticism of any of these ideas. I confess seeing Hurd in the headlines gave me a smile. Is nice to see people can still work on many ideas out there. I am only questioning the "size of code bad!" right next to "it will take us a long time to replicate a large portion of the code we just pointed at."

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by tlb on Monday August 07, 2023 @01:47PM (#37037954)
That's the big unknown question with microkernels. It was (in the 90s) a reasonable theory that a microkernel could be much more robust and secure and easy to develop than a monolithic kernel.

It would be more robust because individual services could crash and restart. That could really work for, say, WiFi drivers. It doesn't quite work for disk drivers or the file system, since how do you even restart something without a file system?

It would be more secure because drivers would live in isolated memory spaces. So a non-critical piece like a printer driver couldn't read memory from something more critical like a file system. Part of what changed since microkernels were originally proposed is that drivers are often split into low- and high-level parts. So a printer driver in Linux consists of a standard USB or network driver in the kernel, plus a user-level driver that can be worked on like a microservice. And the WiFi driver is a low-level driver plus wpa_supplicant running at user level. The USB and network drivers are shared with critical services, so you can't easily restart them anyway.

It would be easier to develop because you can restart just the piece you're working on without rebooting the whole kernel. That's a plausible argument, but somewhat undermined by HURD taking 30 years to develop. But there were many other reasons for that.

I guess the way to convince yourself one way or another is to try writing a driver for both.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Monday August 07, 2023 @01:55PM (#37038065)
Right, I remember parts of that history. Memory protection schemes in other operating systems didn't exactly stay static, though. And a ton of the optimizations that monolithic kernels (mostly looking at windows) did went away just with the lack of need for them. Heck, at the time, Mac wasn't even a preemptive multitasking operating system.

And "drivers" could just restart is laughable with a role play of it. Ok, your wifi driver restarted. What are the protocols to get everyone caught up between that driver and your application for what messages were lost and the messages that are now arriving? This is effectively no different from any distributed application where similar things are unsurprisingly hard to achieve well.

I'll state that I think this is a laudable goal. And I'm happy to see people working on it. Would be thrilled to be shown I'm wrong.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by klodolph on Monday August 07, 2023 @02:20PM (#37038444)
If your WiFi driver crashes and restarts, at the minimum, I think it could be treated as if you lost network connectivity for a short time. This is a situation that applications should be able to handle anyway, since it happens all the time on laptops.

There are plenty of applications out there that just don’t respond to configuration changes gracefully. For example, if you have a music program running, and then you plug a MIDI keyboard in, is the new MIDI keyboard recognized by your music program? Maybe so, and you can use it immediately. Maybe not, and you have to restart the application.

If your MIDI driver crashes, maybe the music program doesn’t handle it gracefully, and you have to quit and relaunch the program. But that is miles better than crashing the system and rebooting.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Monday August 07, 2023 @02:38PM (#37038693)
It really depends on what all is done "in the driver," though? Since, per the application, the data may have been passed off to the driver with a successful message pass. And if I have to have secrets in the driver for it to be able to connect to access points and such, it seems dubious how protected from all of my secrets the system can be between all parties.

MIDI is actually an easy example, all told. If I unplug and replug a keyboard in, I expect it to probably not handle any persistent state of the keyboard correctly. (For fun, it is common for the "at rest" value of peddles to be discovered at connect time. Good luck with that if the driver crashes.)

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by klodolph on Monday August 07, 2023 @06:36PM (#37041898)
> Since, per the application, the data may have been passed off to the driver with a successful message pass.

The application already knows that the data is not guaranteed to be delivered, or even sent at all. That’s just the nature of network programming—it’s inherently unreliable.

> And if I have to have secrets in the driver for it to be able to connect to access points and such, it seems dubious how protected from all of my secrets the system can be between all parties.

To make an analogy—locking your front door doesn’t protect thieves from stealing your plastic flamingoes and garden gnomes, but it does make it harder to steal the $50,000 in cash you have hidden under the mattress.

The point of isolation is to reduce the effect of failures. If you have a buggy WiFi driver, in a monolithic kernel, that could be really bad—it could even be a remotely exploitable vulnerability in the kernel itself. In other words, you have no front door, and the thieves can steal the $50,000 hidden under your mattress. If your WiFi driver is unprivileged, then the thieves have only broken through your front gate, and they can only steal your garden gnomes and plastic flamingoes. They need to combine the vulnerability with a local privilege escalation vulnerability, or be happy with the value of plastic flamingoes.

> For fun, it is common for the "at rest" value of peddles to be discovered at connect time.

The keyboard itself does this, either when it’s turned on, or through the configuration menu (or not at all). It’s not something that has anything to do with drivers or connecting the keyboard.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Tuesday August 08, 2023 @12:15AM (#37044445)
Applications are usually written to know that anything sent over the network could be lost. You don't usually do the same for sending to the different devices. Are you expecting retry logic in all places sending to a device?

We /could/ turn all computation into remote procedure calls. There is plenty of precedence that that will not end well. You do it where you have to. Not everywhere.

And fair point on the device learning its "off" position at startup. Though, that really leans into another point I made in another branch. That level of "isolated and can restart" is already largely accomplished by having extra compute on the devices you are connecting to. I really can't see much benefit it doing everything in the RPC paradigm.

I get the promise. I'm not buying the evidence that you can solve this by making it transparent that all things are "servers" and some are remote.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by klodolph on Tuesday August 08, 2023 @11:29AM (#37050473)
> Applications are usually written to know that anything sent over the network could be lost.

Generally they are—when you make an HTTP request, the client waits until it receives an HTTP response before it reports success.

> We /could/ turn all computation into remote procedure calls. There is plenty of precedence that that will not end well. You do it where you have to. Not everywhere.

I think you may be having some kind of a different conversation here. I don’t understand your position, and I don’t think you understand mine.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Tuesday August 08, 2023 @01:15PM (#37052381)
Microkernels treating every system in the machine as a "service" is literally asking developers to treat everything as a distributed system. No? Was literally a selling point early on in the literature for them.

There are good arguments for this in some environments.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by CRConrad on Monday August 21, 2023 @02:27PM (#37213471)
> For fun, it is common for the "at rest" value of

pedals

> to be discovered at connect time.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by strbean on Monday August 07, 2023 @02:16PM (#37038378)
> Ok, your wifi driver restarted. What are the protocols to get everyone caught up between that driver and your application for what messages were lost and the messages that are now arriving?

TCP?

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Monday August 07, 2023 @02:47PM (#37038842)
Doesn't fully help? Could actually be more difficult if you let the driver do the TCP ack. And you are likely going to back yourself into a situation where you need TCP between the application and the driver... Remember, at that point, it is just a message pass, as well.

There is a good article somewhere about how you have to do end to end for any of this to really work.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by rcxdude on Tuesday August 08, 2023 @08:54AM (#37048283)
If your network stack is running isolated to your wifi driver (with the interface being frames to send and receive), it's fine: the network stack just sees some dropped packets the same as if something else dropped them. If your network stack with your TCP state crashes, then it's a bit trickier: the connection will likely be dropped, which requires an application-level retry, which also will generally already exist to deal with more significant network issues. I don't think you've picked a great example for this kind of problem.
Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by taeric on Tuesday August 08, 2023 @01:23PM (#37052524)
I would assume that the TCP state would be part of the "networking service" that is isolated from my application. As such, I'm assuming the more complicated situation there.

That said, I don't make too big of a defense of networking being a bad choice. At large, that is literally where you have to do distributed computing anyway; so, agreed a lot of it will be covered for a lot of applications. I was trying to stick to the examples others chose as I'm not really trying to "gotcha" to anyone. My main point was honestly more about how similar that is to how we are today. If you were in a microkernel, is it any easier? Because that is the original goal post here.

I do further question why you'd want to do that for every subsystem interaction, and if you really want to have to redo all kernel context swaps and local message passes if something went wrong locally.

Re:GNU/Hurd strikes back: How to use the legendary OS in a (... by rcxdude on Tuesday August 08, 2023 @08:50AM (#37048247)
It can be done though: see what Windows has managed to do with graphics drivers. I've experienced a full crash of the graphics driver and windows just restarted it and kept on trucking, the only casualty being the 3D application which presumably triggered the crash. It's not just a matter of sprinkling the microkernel architecture on your system, but something like that is a prerequisite.