4 ms·
> It was brought up because this disclaimer was also present in the CVE-2025-0665 advisory[0], which is essentially a double-free but on file descriptor level
by Galanwe 2y ago
> It was brought up because this disclaimer was also present in the CVE-2025-0665 advisory[0], which is essentially a double-free but on file descriptor level
I don't see how Rust would have prevented calling close() two times with the same eventfd.
- Munksgaard 2y agoThe same way Rust prevents calling close() two times on a file.
- technion 2y agoThe standard for rust is that close() gets called automatically when the file descriptor goes out of scope. I believe you could choose to do it manually but that's unusual coding.
- Munksgaard 2y agoThere isn't actually any close() function in the std::fs::File: https://doc.rust-lang.org/std/fs/struct.File.html https://doc.rust-lang.org/std/fs/struct.File.html
- ibotty 2y agoAnd if there were one (`drop` kind-of is that function though), it will consume the file handle so you cannot call it again.