News for hackers. Stuff that matters.
Re:Smart pointers for the kernel by uecker on Saturday October 19, 2024 @01:33AM (#41885850)
I agree about what you write.. Also please note that I am not saying unsafe blocks are a bad idea. In fact, I think they are a great idea. But note that people run around saying "it is sufficient to audit unsafe blocks" but they really should say "audit unsafe and carefully analyze all logic elsewhere that may lead to a violation of their assumptions". You could argue "this is what they mean", but IMHO it is not quite the same thing and part of the usual exaggeration of the benefit of Rust safety, which I believe to be dangerously naive.
Re:Smart pointers for the kernel by Dylan16807 on Saturday October 19, 2024 @04:06PM (#41890366)
It's more like "audit unsafe and make sure it's impossible for safe code elsewhere to lead to a violation of its assumptions".

If you need to look at the safe code that calls into you when making your safety proof, then your unsafe code is incorrect and should immediately fail the audit.

Treat external safe code as unknown and malicious. Prove your unsafe code is correct anyway.

Re:Smart pointers for the kernel by wbl on Monday October 21, 2024 @08:39AM (#41903533)
The goal when writing unsafe blocks is that no calls ever lead to a violation not let's silently load all the footguns.