News for hackers. Stuff that matters.
Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by drvdevd on Wednesday October 05, 2016 @07:07AM (#12642892)
I played around with getting a Rust kernel module to work before. And I eventually got a "hello world" in my dmesg. But what I realized in so doing was that seemingly 90% of the higher level features of Rust were lost to my module -- essentially I got the language memory security features (borrowing and ownership) but with very little standard library help, which made the whole endeavour seem much less practical still than just using C and libc (because I would have to reimplement a lot of that functionality in Rust -- Kernel Rust, if you will).

I think if the Rust communtiy wants to make it somehow to the Linux (or other UNIX or windows) Kernel space, there needs to be an effort to build Kernel Rust, if there isn't one already..

Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by dbaupp on Wednesday October 05, 2016 @02:18PM (#12646362)
When were you doing this? There's now a large chunk of the standard library[1] that's explicitly designed to be used in bare-metal/zero-dependency situations, and it even includes "fancy" things like the formatting infrastructure[2] (it has to be hooked up to a writable/IO device, but that's just a trait implementation away) and string processing, certainly more than the zero-allocation subset of libc.

[1]: https://doc.rust-lang.org/core/

[2]: https://doc.rust-lang.org/core/fmt/

Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by drvdevd on Wednesday October 05, 2016 @03:28PM (#12646974)
It has been at least 6 months and it's possible I just missed this! That's quite cool. Thanks! I will give this a try.
Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by gdamjan1 on Wednesday October 05, 2016 @07:45AM (#12643026)
well, you can't use libc for a kernel module either :)
Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by drvdevd on Wednesday October 05, 2016 @08:04AM (#12643104)
No, but there's 'kernel C' (not an actual/official name) with a large reproduction of much of libc ready for use there. printk() is a good example which actually has a format string implementation (https://www.kernel.org/doc/Documentation/printk-formats.txt)
Re:Linux Kernel Use-After-Free Remote Code Execution Vulnera... by gdamjan1 on Wednesday October 05, 2016 @08:47AM (#12643313)
right, that shouldn't be hard to map to rust I guess