Re:BleedingTooth: Linux Bluetooth Zero-Click Remote Code Exe...
by Aachen on Wednesday April 07, 2021 @04:28PM
(#26730767)
Dumb question (not a kernel or C developer): can't you call into code compiled from a memory safe language, like in a shared object file?
[ Parent
| on HN ]
Re:BleedingTooth: Linux Bluetooth Zero-Click Remote Code Exe...
by loeg on Wednesday April 07, 2021 @06:52PM
(#26732585)
Yeah, and we're slowly slowly moving towards that model. One barrier is that some safe languages, like Rust, support far fewer target platforms than the Linux kernel does. There are C compilers for everything, but only a few Rust backends.
Something similar to Wuffs[0] (posted on HN very recently), which compiles down to C, might be a good compromise between portability and safe languages. (There may be some contorted way to have Rust emit C, too.)
Re:BleedingTooth: Linux Bluetooth Zero-Click Remote Code Exe...
by nine_k on Wednesday April 07, 2021 @08:48PM
(#26733696)
Rust uses LLVM, which likely should have easier time being ported than an entire Rust compiler. Rust handles cross-compilation pretty well so you don't have to compile on an actual embedded device, or something.
I wonder if an LLVM backend that issues a very simple and predictable subset of C would be a viable way to support exotic old architectures which only have a C compiler. LLVM-cbe is a thing: https://github.com/JuliaComputing/llvm-cbe
Re:BleedingTooth: Linux Bluetooth Zero-Click Remote Code Exe...
by pjmlp on Wednesday April 07, 2021 @04:51PM
(#26731076)
Definitely, for example check how to make Go .so libraries.
https://medium.com/swlh/build-and-use-go-packages-as-c-libra...
Naturally the runtime also comes along, but that is another matter.