Gnu utils rewritten in rust

What are the thoughts on this rust busybox.

Busybox in rust and it will give more stable and memory safety in firmware and making openwrt a most secure router firmware available. And 70%of all vulnerabilities happens due to memory related issues.
Now rust has been added in linux kernel. What are the thoughts on this.

1 Like

None of the busybox networking utilities used by OpenWrt (ntpd, udhcpc) are implemented there, so it's a non-starter. Improved security for local core utilities might be a nice addition on paper, but with OpenWrt being a mostly single-user system with most things running as root, hardening against potential local exploits that would lead to privilege escalation would not significantly improve overall security.

Apart from that rust does not support all CPU architectures supported by OpenWrt.

And finally, a mostly fully featured busybox that implements way more applets than this rust thing is around ~1.1MB in size (see https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/) while the uncompressed coreutils multicall executable from https://github.com/uutils/coreutils/releases/download/0.0.18/coreutils-0.0.18-x86_64-unknown-linux-musl.tar.gz is already over 8MB large. This is bigger than the entire OpenWrt firmware in some cases.

4 Likes

yes but it can be trimmed down to what is needed only but i think we need to wait until that have more support and a drop in replacement for busybox

It already is larger than busybox with way less features. There won't be any trimming down.

i did not lookinto it but i really dont know why it is big. i think it was not developed routers in mind.
i think it can be trimmed to the only part that actually needed.

knock yourself out
let us know when you've managed to make it smaller than busybox.

i have said it can be i didnot said that surely also i have not said i have look into the codes .i have to learn rust first before looking that

you sure have a lot of opinions for a person who

1 haven't looked at the code
2 isn't familiar with the programming language used

I am learning and rust is good it is memory safe...

There's already a number of other re-writes of BusyBox in various forms (ToyBox is one such).
There's nothing particularly 'special' about a Rust version. Rust is not magic. And it's not magically 'memory safe' either. In fact there's an entire facet of Rust that is dedicated to 'unsafe' operations
https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html

When writing low level interfaces, a large volume of that work will require 'unsafe' mechanisms and hence not be 'memory safe' by virtue.

If the Rust version can get to a similar functionality level, and similar size, then it might be useful. But I think OpenWRT has enough other challenges, there's not much interest in also taking on board the development of another such BusyBox replacement.

1 Like