News for hackers. Stuff that matters.
Re:Critical Bluetooth vulnerability in Android by haggy on Friday February 07, 2020 @08:30AM (#22265724)
This is not a constructive comment. Saying an entire OS "would have been safer on this language" is just trolling. Comment should be reported IMO.
Re:Critical Bluetooth vulnerability in Android by fulafel on Friday February 07, 2020 @08:59AM (#22265949)
This is userspace code, it's a legit point to criticise use of a memory-unsafe language here. It's 2020 after all, 24 years after "Smashing the stack for fun and profit" and 24 years into the golden age of C exploits while safer practical systems languages have existed. And also a legit point to promote Rust, even if it's a little too new for this codebase.
Re:Critical Bluetooth vulnerability in Android by chungus_khan on Friday February 07, 2020 @10:15AM (#22266708)
The transition in perception of UNIX and C from being buggy, inconsistent, foot-gun-laden corporate messes to being treated like the immutable ancient ways has certainly been a trip.
Re:Critical Bluetooth vulnerability in Android by sadfklsjlkjwt on Friday February 07, 2020 @10:47AM (#22267054)
Isn't that because Os's based on Linux don't share a single LOC with commercial Unices?
Re:Critical Bluetooth vulnerability in Android by pjc50 on Friday February 07, 2020 @08:57AM (#22265939)
The entire raison d'etre of Rust is that it can be safer in exactly these cases where C or C++ is unsafe, and aims towards their eventual replacement.

This will take a couple of decades, but it's a worthwhile effort.

Re:Critical Bluetooth vulnerability in Android by zymhan on Friday February 07, 2020 @09:14AM (#22266080)
Sure but until someone demonstrates at least a basic PoC using Rust to replace some Android C code, suggesting that it can is just speculation at best.
Re:Critical Bluetooth vulnerability in Android by zamalek on Friday February 07, 2020 @10:52AM (#22267127)
Re:Critical Bluetooth vulnerability in Android by zymhan on Friday February 07, 2020 @11:32AM (#22267636)
I'm certain that you cannot simply drop-replace an Android OS component with a Fuschia component.

My point is, of course Rust is a memory safe language, and of course it would theoretically prevent overflow exploits, but throwing in "you should've used Rust" when this news is announced isn't helping anything. I am certain that Android devs are at least aware of Rust and it's benefits.

Re:Critical Bluetooth vulnerability in Android by est31 on Friday February 07, 2020 @12:46PM (#22268593)
> I am certain that Android devs are at least aware of Rust and it's benefits.

There is still not a single Android ROM component that's written in Rust. Cuttlefish uses crosvm which is Rust based, but it's a VM for Android testing rather than a ROM component. So they aren't even ready yet to experiment with shipping small components in Rust. Same goes for Chrome btw, it currently has a "no Rust allowed" policy, which is IMO very sad.

So yeah I think it's worthwhile to talk about why AOSP doesn't have Rust components yet, especially as patching is sadly not available (yet) for most deployed devices. Large fleets of devices will have the bug for eternity. Therefore, prevention of vulnerabilities becomes even more important, which Rust helps doing. Your program won't be free of them, but as I pointed out above, these bluetooth vulns fall into the class that safe Rust eliminates.

Re:Critical Bluetooth vulnerability in Android by est31 on Friday February 07, 2020 @12:17PM (#22268258)
I've said nowhere that all of Android should be written in Rust. I've only said that had this specific component been written in Rust, the issues wouldn't have shown up. Of course the code base is old and predates Rust.

But I think this vulnerability serves as an important lesson about which language to choose for new projects in the embedded area. Thus I'm very glad that Google uses Rust for its new OpenSK security key firmware. I hope that future versions of Android will adopt Rust, at least in newly written components. Some Google developed Android related projects are already using Rust, like Cuttlefish which uses crosvm.

Re:Critical Bluetooth vulnerability in Android by SQueeeeeL on Friday February 07, 2020 @09:07AM (#22266023)
I mean, they did link to a bunch of source code spots... so it's not completely unconstructive.
Re:Critical Bluetooth vulnerability in Android by ptx on Saturday February 08, 2020 @07:28AM (#22275403)
Since Android includes a deeply integrated Java implementation that they've put a lot of work into, which includes an AOT compiler, why wouldn't they write services like this one in Java?
Re:Critical Bluetooth vulnerability in Android by eeZah7Ux on Friday February 07, 2020 @10:15AM (#22266711)
...especially when the large majority of HN readers are already aware of rust "thanks" to the rust evangelism strikeforce.
Re:Critical Bluetooth vulnerability in Android by dx87 on Friday February 07, 2020 @10:23AM (#22266792)
A day or two ago there was an embedded software developer here claiming that low-level C developers "know what they're doing", so any languages with built-in safety features impose unnecessary safety restrictions, and that since any software can have bugs, there is no reason to use anything but C. Once that kind of stubborn attitude dies out, maybe we'll stop seeing people leave comments saying "This could have been prevented if they had used language X".
Re:Critical Bluetooth vulnerability in Android by eeZah7Ux on Sunday February 09, 2020 @08:49AM (#22282074)
The downvotes are really telling.