5 ms·
Now that Linux is starting to be more receptive to rust (drivers only for now, but perhaps in kernel down the line), these parsers should be replaced by impleme
by nynx 6y ago
Now that Linux is starting to be more receptive to rust (drivers only for now, but perhaps in kernel down the line), these parsers should be replaced by implementations in Rust asap.
- geodel 6y agoYes, someone should just drop by kernel mailing list and ask a very logical question "Have you considered rewriting it in Rust?" That would help remedy the situation fast.
- nynx 6y agoOkay, yeah that wouldn't go over well. Despite that, i think it makes sense to replace very dangerous sections of the kernel with a safer implementation. Parsers are very difficult to make safe in C.
- vlovich123 6y agoActually it went over fine [1]. Rust support in the Linux kernel however is still very nascent, & only suitable for drivers. The reason is that rustc only supports the more popular systems (hence drivers for that system are suitable). There's work ongoing to expand the utility of Rust in the kernel on multiple fronts, but for something like this that's built on all platforms, it might take longer. ASN.1 & other crypto format parsers are ripe for being rewritten in Rust & no one would really blink an eye I think (provided the other pieces of support are available to support all the architectures Linux does). [1] https://lwn.net/Articles/829858/ https://lwn.net/Articles/829858/
- pjmlp 6y agoApparently they did, https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/rust?id=c77c8025525c36c9d2b9d82e4539403701276a1d https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-n...
- geodel 6y agoThey went above and beyond :). I was thinking small and talking only about parser.
- sitkack 6y agoYour snide comment is putting words into the mouth of nynx and then arguing against those words. A classic web forum tactic. Applying Rust to harden a parser is exactly where Rust is being used. The parent didn't not say Linux should be rewritten in Rust, only that it could be applied to a parser that takes untrusted input. As mentioned in a sibling comment, Rust support in the kernel is being worked on.
- hrvTGKFyDyko3aK 6y agoRust does not have tier 1 support for all the platforms that Linux supports.
- brink 6y agoThis kind of mentality is going to make people resent Rust, it's not really the culture we need. While it's technically true that Rust encourages safe practices, it's not a blanket fix-all for everything.
- sitkack 6y agoYou are criticizing nynx for something they didn't say. As mentioned in another subthread, Linux is working on Rust support but only for drivers at this time. Nynx did not say rewrite linux in Rust. They said apply Rust for making a secure ASN.1 parser, which is exactly where Rust should be applied to maintain safety properties. Rust is being applied to multiple commercial operating systems at the driver level to harden them against known issues. Windows is already running Rust code in its USB subsystem.
- selfhoster11 6y agoThat should not happen until Rust has support for all the platforms that Linux supports. As far as I know, Rust support is still missing on plenty of platforms.