News for hackers. Stuff that matters.
Re:Rust’s standard library was vulnerable for years and nobo... by jack1243star on Tuesday February 12, 2019 @08:43AM (#19143338)
Here's an example of a quite high profile Rust project discovered to have been (ab)using unsafe:

https://www.reddit.com/r/rust/comments/8s7gei/unsafe_rust_in...

Re:Rust’s standard library was vulnerable for years and nobo... by steveklabnik on Tuesday February 12, 2019 @09:19AM (#19143613)
... and, due to said awareness, the issues were all fixed. The presence of the unsafe keyword made the audit much easier. Everything is working as intended!
Re:Rust’s standard library was vulnerable for years and nobo... by HugoDaniel on Tuesday February 12, 2019 @09:27AM (#19143672)
Re:Rust’s standard library was vulnerable for years and nobo... by Nimelrian on Tuesday February 12, 2019 @09:54AM (#19143902)
Good rust code doesn't have to be free of unsafe blocks. In some cases you can't avoid them, e.g. when doing memory mapping. Instead, the unsafe blocks semantically designate areas you should keep an eye on. I rather have 20 unsafe one-liners surrounded by safe wrappers in a project with several thousand LOC, than a 1k LOC C project where I have to take extra care with every step.
Re:Rust’s standard library was vulnerable for years and nobo... by steveklabnik on Tuesday February 12, 2019 @10:08AM (#19144030)
Sure. I haven’t looked at these exact blocks, but the point is that they were using tons of unsafe that they didn’t need to. Unsafe exists to be used, when it’s neccesary.

11 now? Iirc it was on the order of 100 before.

Re:Rust’s standard library was vulnerable for years and nobo... by HugoDaniel on Tuesday February 12, 2019 @10:21AM (#19144139)
11 files, showing only the top two references per file. In a proper grep it shows about 35 unsafe references. Not bad indeed.
Re:Rust’s standard library was vulnerable for years and nobo... by phkahler on Tuesday February 12, 2019 @09:36AM (#19143747)
From that link:

>> Folks who are considering using actix-web might want to follow this thread about its heavy use of unsafe Rust.

It's one thing to make heavy use of a small bit of unsafe Rust. It's another to use unsafe heavily - like someone who just refuses to use the language properly and therefore just keeps writing unsafe code. It's not clear from the wording which case this was but they do say it was fixed, rather than declaring it an unmitigated disaster ;-)