8 ms·
Memory safety for the world’s largest software project
- djbusby 4y agoSo, when Rust is actually in the kernel would it be possible for some C based routines to call them? Like the article seems to mention things I've seen as "helper" functions, so a mostly C module can get some memory safe benefits? Or do whole components need to be rewritten?
- borodi 4y agoTheoretically yes, rust binaries can have C-apis and other code can call them just fine.
- kibwen 4y agoWith the caveat that, naturally, these APIs can only expose concepts that C can understand, so you're a bit limited. No generics, for example.
- maximilianburke 4y agoYep! At our company, for example, we have built a plugin for PAM in Rust which exposes all the necessary functions with a C interface.
- hpb42 4y agoThis sounds really interesting! Is the source available somewhere?
- spullara 4y agoThe RUST FFI is just the C function interface. You can completely fool the C code that you are also C code.
- steveklabnik 4y agoNot only is it possible, being able to do so well is a design constraint on the language.
- Gigachad 4y agoI’m so excited for this project. I feel like this is going to bring in a new generation of programmers to kernel development.
- VWWHFSfQ 4y agoWhen GCC support [0] lands it's going to be a complete game-changer. [0] https://github.com/rust-lang/rustc_codegen_gcc https://github.com/rust-lang/rustc_codegen_gcc
- gkbrk 4y agoI think the GCC Front-End For Rust [1] is going to have an even larger impact going forward. [1]: https://github.com/Rust-GCC/gccrs https://github.com/Rust-GCC/gccrs
- jeffbee 4y agoCan we talk about “world’s largest”? This seems extremely unlikely by any measure.
- 3a2d29 4y agokinda feel like the title is earned. Linux (to my knowledge) is the most used operating system in the world and runs on all of the top 500 fastest super computers.
- captn3m0 4y agoMINIX also makes that claim by virtue of running on the Intel ME.
- VWWHFSfQ 4y agoWhat do you think is a larger software project? Could argue for SQLite being deployed more widely. But it's hardly even 1% of the overall code surface of the Linux kernel.
- fomine3 4y agoAndroid? They need to develop "repo" tool to use git. Similarly, Windows should be bigger (though it's closed source) so they develop VFSforGit tool.
- fastball 4y agoAndroid runs a linux kernel under the hood, so it seems hard to make the argument that it is a bigger software project. As for windows, I'm fairly certain that more devices run the linux kernel than Windows as well.
- fomine3 4y agoI think "Largest" is for codebase size. For most widespread software project, it would be SQLite or Zlib.
- poppafuze 4y agoBringing a language whose community growth mindshare teeters on a university license into the kernel would be more destructive than bringing back BitKeeper, but more slow, subtle, and thorough.
- userbinator 4y agoOne critical example of such infrastructure is the Linux kernel, used in most servers in the world as well as in billions of devices. ...billions of devices which the manufacturer does not want you to own, to be fair, and for which full ownership requires breaking through the security features that initiatives like this are trying to strengthen. You might think that's a political/social issue and this is merely a technical one, but if the tech advances ahead without such consideration, eventually there might be no way to oppose. That's why things like this always make me feel considerable unease... "The road to hell is paved with good intentions."
- amarshall 4y ago> breaking through the security features that initiatives like this are trying to strengthen Could you elaborate why Kernel memory safety via Rust impedes “full ownership”?
- nequo 4y agoMemory safety means fewer bugs means harder to root your Android device and use the hardware you paid for in ways you want? Just guessing. It’s high time we had competitive open-source options in the smartphone space.
- izacus 4y agoDevices like Google Pixel support installing your own rooted Android together with actually adding a new signature to boot loader so you get a fully secure device - it's how projects like CalyxOS can guarantee privacy. There's absolutely no need to defend security holes in an OS when you have options for proper secure installation of rooted OS available. You just need to put money where your wishes are and not buy locked down OEM devices.
- nequo 4y agoThat is good to know, thank you!
- encryptluks2 4y ago
- steveklabnik 4y agoThe core maintainers were involved in the decision to give this a shot.
- mwcampbell 4y agoWhy does the introduction of Rust as a second language in the kernel mean the end of Linux's "good run"?
- vardump 4y agoAs a Rust outsider, I really can't agree with someone saying Rust community is toxic!
- jokabrink 4y agoQuestion regarding licensing: [1] states that a source file can be "one of the compatible GPL variants and alternatively under a permissive license like BSD, MIT etc." Looking at a rust source file inside the dev tree 'Rust-for-Linux' [2], it is licensed as "Apache-2.0 OR MIT". However, Apache-2.0 appears to be incompatible with GPL-2.0 [3]. How come that the licensing in such a way is possible with the Linux licensing rules? [1] https://github.com/torvalds/linux/blob/master/Documentation/process/license-rules.rst https://github.com/torvalds/linux/blob/master/Documentation/... [2] https://github.com/Rust-for-Linux/linux/blob/rust/rust/alloc/alloc.rs https://github.com/Rust-for-Linux/linux/blob/rust/rust/alloc... [3] https://opensource.stackexchange.com/questions/1357/can-i-link-a-apache-2-0-library-into-software-under-gplv2 https://opensource.stackexchange.com/questions/1357/can-i-li... Edit: Another quote from [1]: "[...], though individual source files can have a different license which is required to be compatible with the GPL-2.0:"
- viraptor 4y agoWith alternatives like that, you choose what applies, so if it's licensed as "MIT or literally-anything-else", it's still valid. Now why they chose to add Apache2, that is interesting. A guess: if contributions to the project also need to be mit-or-asl2, then maybe that would force the patent grant clause to apply for contributions? (even if it doesn't change anything for the users)
- aldonius 4y agoThe core Rust project (and consequently much of the ecosystem) is dual-licensed MIT or Apache-2.0, so it's not at all surprising to see that continue here.
- jokabrink 4y agoAh, I see, thanks. Somehow I hadn't looked at GPL-2.0 compatibility of the MIT license, which would have answered the question.