6 ms·
This Summer in Redox: A Complete Rewrite of the Kernel
- snvzz 10y agoI applaud lessons taken from Liedtke/L4, a major step in the right direction. Now I can look at that project seriously, rather than consider it yet another pre-Liedtke mistake. I'm not so sure, however, about concurrency in the kernel. The locks and added complexity certainly aren't going to help keep WCET low and bound. NICTA's SSRG did study this: https://ts.data61.csiro.au/publications/nictaabstracts/Peters_DEH_15.abstract.pml https://ts.data61.csiro.au/publications/nictaabstracts/Peter...
- Yoric 10y agoOut of curiosity, do you have a reference to "lessons taken from Liedtke/L4"? Out of the blue, I have no clue what it means :)
- snvzz 10y agoI'm thinking mostly about the principle of minimality (what can be out of the kernel should be). But there's some more contributions from L4. The ACM did a talk on those insights 20 years later: https://www.youtube.com/watch?v=RdoaFc5-1Rk https://www.youtube.com/watch?v=RdoaFc5-1Rk The associated NICTA SSRG paper: https://ts.data61.csiro.au/publications/nictaabstracts/Elphinstone_Heiser_13.abstract.pml https://ts.data61.csiro.au/publications/nictaabstracts/Elphi... A more recent NICTA SSRG paper: https://ts.data61.csiro.au/publications/nictaabstracts/Heiser_Elphinstone_16.abstract.pml https://ts.data61.csiro.au/publications/nictaabstracts/Heise...
- cm3 10y agoYeah, I wish they had teamed up with Robigalia in order to build on seL4 or at least translated that 1:1 to Rust, foregoing the verified nature of seL4.
- snvzz 10y ago> foregoing the verified nature of seL4 If anything, seL4 is the fastest L4 out there, proving that they can be fast and proven at the same time. So, why would anyone want to do that?
- cm3 10y agoBecause Redox's aim is to be as little non-Rust as possible. I agree it'd be ill-advised to rewrite seL4 rather than use it, even though it's been a while since a revision was verified, because it's been battle tested, is continually improved and small enough to trust.
- cm3 10y agoWe really need to have a mainstream desktop microkernel operating system because: 1. no need anymore for kernel bypass mechanisms (too many to name for linux, btw) 2. decoupling of drivers from the kernel 3. instead of waiting for a backport of a new syscall to an LTS kernel, something like that will be just part of your system's stdlib 4. extremely reduced need to reboot a machine 5. driver faults can be recovered from gracefully, just like in Erlang's supervisor scheme 6. seL4's capability system allows for a safer system overall, with less hacks Seeing how even Intel is introducing a message passing network with growing number of cores in their mainstream CPU designs, we should be over the general objections regarding a message passing design. They call it QMD, and it's something they already have in their Xeon Phi line for some time for obvious reasons, just as countless other general purpose or special purpose chip designs have had for a long time. I wonder if one could get funding for an effort like Robigalia to reach production quality and have Servo running on it. Given the feature set of Servo, it's a safe bet that the required features would provide a reasonably complete system to replace your Linux machine. The bigger struggle would be getting hardware vendors to contribute to FreeBSD and Linux drivers to also provide some level of support for a non-C code base. Though, moving up to that abstraction and language level should make it easier to write working hardware drivers.
- cm3 10y ago
- mickronome 10y agoI thinl the paper is a bit unclear about how one can come to that conclusion since concerning the Redis benchmark they state "The figure shows that throughput is independent of thekernel variant. Further investigation reveals that overall system throughput is limited by the network bandwidth, andthat the all cores have significant idle time." If you are network limited you might not _really_ be testing in-kernel locking in the general case. But there might be something about the kernel that allow them to generalise even with low load, but I can't see anything obvious that would make a certain kernel immune to high load induced issues, but then I'm largely ignorant about L4 et al.
- naasking 10y ago> I can't see anything obvious that would make a certain kernel immune to high load induced issues, but then I'm largely ignorant about L4 et al. The typical system call in a modern microkernel costs on the order of hundreds of cycles. Fine-grained locking would by itself probably double this cost for almost no gain. Just waiting the hundreds of cycles is likely to be just as good as a fine-grained lock in such kernels, and the complexity savings are significant.
- valarauca1 10y agoI was midly in shock when I looked in to L4 message passing times [1]. 250-300 cycles on x86_64 processors, and ~150-300 on ARM. As somebody interested in concurrency what is being done internally to pull off this speed, but maintain extra-thread consistency in a SMT-type system? As far as I know even a x86_64 memory fence will require around >2,000 cycles. I understand you create a notification object to pass a message, but don't you have to collect these notification objects at some point? Edit 1: I'm reading the manual [2], but I'm just becoming more confused. If you are passing register files, swapping stacks normally takes ~3ns even with small stacks. Or is the 300 cycles just the send time? [1] https://ts.data61.csiro.au/publications/nictaabstracts/8988.pdf https://ts.data61.csiro.au/publications/nictaabstracts/8988.... [2] https://sel4.systems/Info/Docs/seL4-manual-2.0.0.pdf https://sel4.systems/Info/Docs/seL4-manual-2.0.0.pdf
- mtgx 10y agoWill the TFS also support native encryption like Apple's APFS?
- Yoric 10y agoI just talked to Ticki and he said he would support that. As a personal note: is it really the right place to support encryption? I seem to remember that APFS's encryption had a pretty bad reputation in terms of actual security.
- xenadu02 10y ago> I seem to remember that APFS's encryption had a pretty bad reputation in terms of actual security. Based on what exactly? APFS actually has really good security. You can encrypt on a per-file or per-directory basis. Each per-file key can be encrypted with different levels (the shared key or per-user keys, so permission bypasses are useless).
- nwmcsween 10y agoThat's actually a really bad form of encryption as you leak info on per file encryption.
- johncolanduoni 10y agoAll the alternatives I've seen lose authentication, so it's at least not so clear cut.
- Yoric 10y agoAs in I'm pretty sure that in a previous job, I received semi-official government-issued guidelines: « Don't use it, we know how to crack it, and we're pretty sure that we're not the only ones. If you value your data, use TrueCrypt instead. » It was pretty thin on details, and the stuff may have been fixed in the meantime, but here you go.
- deleted 10y ago
- naasking 10y agoIs there a documentation reference for "scheme-centric capabilities"? Most people who use the term "capabilities" use it incorrectly, or their capabilities have the wrong properties which destroys some of their benefits, so I'm curious what redox is doing here. Skimming through the code in the fork [1], it looks like they place restrictions on sending capabilities in a misguided attempt to "enhance security" [1]. But this compromises the property that actually makes capabilities so much better: unrestricted delegation leads to the principle of least authority via fine-grained permissions. The fact that capabilities can be passed arbitrarily leads you naturally to defining fine-grained authorizations so that eventual abuse can be minimized, detected, and revoked. If you have other "security" mechanisms restricting delegation, then you can get sloppy and start aggregating permissions into larger groups, thus making inevitable vulnerabilities much worse than they otherwise would be. [1] https://github.com/ticki/kernel/blob/master/kernel/capability.rs https://github.com/ticki/kernel/blob/master/kernel/capabilit...
- Yoric 10y ago> But this compromises the property that actually makes capabilities so much better: unrestricted delegation leads to the principle of least authority via fine-grained permissions. The fact that capabilities can be passed arbitrarily leads you naturally to defining fine-grained authorizations so that eventual abuse can be minimized, detected, and revoked. Really? I would have assumed that letting anyone send capabilities to anyone without going through the kernel was a highway towards privilege escalation. Do you have documentation on this topic? I'm pretty interested – in particular since I'm hoping to contribute to this fork.
- naasking 10y ago> Really? I would have assumed that letting anyone send capabilities to anyone without going through the kernel was a highway towards privilege escalation. "Unrestricted" in my post doesn't mean "you can send to anyone", it means "no restrictions on passing capabilities beyond that defined by the capability model". The capability security model requires that you can only send capabilities via your other capabilities. So if you have a capability to another process, then you can send any of your other capabilities to that process. The Redox design appears to violate this. The capability model is actually simple and surprisingly common. Take any memory-safe object-oriented language, and remove static mutable state and the file system and network APIs (all sources of "ambient authority"). An object reference is now a capability. Passing an object reference via method parameters is a capability send, and you can only pass around references you actually have, and only to objects to which you have references. That's capability security. You can look at any context and see precisely what side-effects can occur simply by analyzing the set of object references available in that context. It's bad design to define functions that take a huge number of parameters, but it's also bad security. Capability security aligns maintainability concerns with security concerns thus yielding POLA. Edit: as for documentation, I'm not sure if you want OS documentation, or general capability documentation. The seL4 and EROS papers are good for capabilities in operating systems, the E and Joe-E programming languages are good references for capabilities in general.
- cm3 10y ago> In order to continue the development in a reasonable speed, we stop conforming to the specification of ZFS. As such, we can no longer call it a ZFS implementation. They have their valid reasons, but it's a shame, because an implementation of the very complex ZFS filesystem in Rust would have been a great thing to have. Not to mention the ability to mount redox zfs images with illumos or FreeBSD or ZOL.
- jackpot51 10y agoTFS will be mountable on any OS with FUSE - Linux, BSD, illumos, and OS X
- Yoric 10y agoWell, there's the problem of testing the implementation on every OS.
- johncolanduoni 10y agoI'm also disheartened by the description of TFS's layering. It seems like they go with block level encryption instead of something with authentication.
- forgottenacc57 10y agoThe server would be interesting if it implemented libvirt virtual network and virtual hard disk drivers so it could run on cloud hosts. Does it?
- nwmcsween 10y agoThe kernel from this limited bit of info is almost an exokernel, it's missing the most important bits, an asyncish syscall api and proper capabilities. Batching is a nice mitigation but not ideal, an ideal way to mitigate context switches would be a data-driven api that let's the kernel (due to info the kernel has access to) decide. Both a data-driven api and exokernel with a proper language you could apply optimizations across the entire operating system.