Join Nostr
2024-08-31 16:31:06 UTC
in reply to

Hoshino Lina (星乃リナ) 🩵 3D Yuri Wedding 2026!!! on Nostr: I don't think you appreciate the classes of bugs that Rust eliminates. "Memory ...

I don't think you appreciate the classes of bugs that Rust eliminates. "Memory safety" isn't just "don't have buffer overflows". It's also eliminating multithreaded race conditions. Missing locking problems. Complex codepaths that lead to an accidental UAF.

Quite frankly, if you review complex C code that is called across multiple threads and you don't spend a signficant amount of time thinking about those things... you're probably not doing a good job reviewing it.

How thorough a review would be required to catch the race condition UAF bug that I describe here?

https://github.com/AsahiLinux/linux/issues/309#issuecomment-2239280107

That code clearly went through review but it wasn't caught. In fact I dare say hours of additional review would probably not have caught that bug. You have to spend large amounts of time simulating potential execution scenarios in your head to catch it. It took me a long time to even understand it with the crash traceback in front of me.

That bug is impossible in safe Rust.