2 ms·
The bug is in the C code that Rust is interacting with. If anything, you seem to be making an argument in favor of replacing even more of the C code with Rust s
by saghm 3mo ago
The bug is in the C code that Rust is interacting with. If anything, you seem to be making an argument in favor of replacing even more of the C code with Rust so that this doesn't happen.
What you seem to think is a defense of C is accidentally just providing ammunition to the "rewrite it in Rust" crusade that I'm guessing you're very much not a fan of. There are very solid arguments against rewriting everything in Rust, and you're arguably doing more harm than good by making a counterproductive one.
- inigyou 3mo agoRust wouldn't have helped, because this is a logic bug in the kernel, that creates a memory bug in userspace. The relevant kernel code would probably be marked "unsafe" with or without the bug.
- saghm 3mo ago> Rust wouldn't have helped, because this is a logic bug in the kernel, that creates a memory bug in userspace. Unless I'm misunderstanding, the bug is kernel code accessing out-of-bounds memory in an array. That would 100% not segfault in normal Rust code. > The relevant kernel code would probably be marked "unsafe" with or without the bug. I mean, sure, if you remove the safety rails that prevent you from running off the side of the cliff, then you will in practice likely ending up running off the cliff. If you have to explicitly do that though, it still makes it a lot more obvious that this is a risk than if you refuse to have safety rails anyway for any purpose.
- vlovich123 3mo agoThe kernel bug I believe hasn’t been root caused quite yet although the LLM does seem to have potentially found an unrelated problem.
- saghm 3mo agoInteresting, I hadn't heard that! That does sound like it's just as premature to claim Rust wouldn't have prevented it as it is to claim it would have, which I think stands as valid criticism of the comment I originally responded to.
- vlovich123 3mo agoIt’s not. If you look at the analysis, the bug is present only in one version of the kernel everything else the same. It’s the kernel. Also here’s a kernel developer confirming they think it’s the kernel: https://news.ycombinator.com/item?id=49134550 https://news.ycombinator.com/item?id=49134550