News for hackers. Stuff that matters.
Re:‘Zero-click’ hacks are growing in popularity by Gigachad on Saturday February 19, 2022 @07:00AM (#30396467)
I was under the impression that even in rust unsafe blocks, you still had massive safety advantages over C and it isn’t just instant Wild West.
Re:‘Zero-click’ hacks are growing in popularity by chlorion on Saturday February 19, 2022 @08:52PM (#30402486)
I think unsafe rust is a lot more awkward to work with and easier to cause UB with compared to c and especially c++. This is just my opinion though!

&mut aliasing is a good example of running into instant UB in unsafe rust, but there are many more that you have to be aware of.

I would check out the unsafe rust "book" for yourself and see what you think. There is a section where you implement Vec and some other data structures from scratch!

https://doc.rust-lang.org/nomicon/intro.html

Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @07:03AM (#30396476)
I’d love to red team the program that thinks Rust unsafe is easier to get right than tight ANSI C.
Re:‘Zero-click’ hacks are growing in popularity by Closi on Saturday February 19, 2022 @07:39AM (#30396694)
Why compare 'non-tight' Rust against 'tight' C?

Surely we should compare tight Rust (with some 'tight' unsafe sections) against tight C?

Re:‘Zero-click’ hacks are growing in popularity by nyanpasu64 on Saturday February 19, 2022 @11:48AM (#30398432)
I think it's easier to write correct safe Rust than C, I wouldn't say it's easier to write correct Rust with unsafe blocks than C (many operations strip provenance, you can't free a &UnsafeCell<T> created from a Box<T>, you can't mix &mut and const but you might be able to mix Vec<T> and const (https://github.com/rust-lang/unsafe-code-guidelines/issues/2...), self-referential &mut or Pin<&mut> is likely unsound but undetermined), and it's absolutely more difficult to write sound unsafe Rust than C (sound unsafe Rust must make it impossible for callers to induce UB through any possible set of safe operations including interior mutability, logically inconsistent inputs, and panics).
Re:‘Zero-click’ hacks are growing in popularity by benreesman on Saturday February 19, 2022 @07:50AM (#30396756)
I must be more tired than I thought if I said “non-tight Rust” and forgot ten minutes later.

I just think if mistakes need to be literally low as possible you’ve got a better bet than Rust unsafe.

The language spec is smaller, the static analyzers have been getting tuned for decades, and the project leaders arent kinda hostile to people using it in the first place.

Re:‘Zero-click’ hacks are growing in popularity by qualudeheart on Saturday February 19, 2022 @04:59PM (#30400923)
We could set up a prediction market for this. A study would be performed of attempts ti pentest randomly selected unsafe Rust and tight ANSI C programs. A prediction market used to estimate the probability of either language winning before publication of results. Someone needs to make this a thing.
Re:‘Zero-click’ hacks are growing in popularity by LasEspuelas on Saturday February 19, 2022 @10:12AM (#30397685)
What is "tight ANSI C"?