4 ms·
Yes, 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 situ
by geodel 6y ago
Yes, 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.