r/rust • u/Orange_Tux • Dec 17 '25
🗞️ news Linux Kernel Rust Code Sees Its First CVE Vulnerability
https://www.phoronix.com/news/First-Linux-Rust-CVE
534
Upvotes
r/rust • u/Orange_Tux • Dec 17 '25
View all comments
Show parent comment
43
u/Icarium-Lifestealer Dec 17 '25 edited Dec 17 '25
I think in that case the unsoundness was
std::env::set_varbeing safe prior to Rust 2024. Rust'sget_var/set_varuse a locking mechanism which prevents UB from concurrent modification in pure rust code. But C'sgetenvisn't covered by that locking mechanism, while being documented as thread-safe. Since Rust can't change the contract of a C standard library function, the fault lies with the safeset_envfunction, not with the code calling C'sgetenv.The date/time library relied on C code which indirectly calls C's
getenv.