Socket.dev warns about Rust Tokio library obfuscation
1–2 of 2 posts
Re: Socket.dev warns about Rust Tokio library obfuscation
#2If you click Show details, the LLM explains
> This module is not malicious and contains no IO or exfiltration. It contains unsafe code that is likely incorrect: `unsync_load` reinterprets the in-memory `AtomicU16` struct as a raw `u16` via a pointer cast and `ptr::read`, invoking undefined behaviour and breaking atomic concurrency guarantees.
This is wrong: the function documents its safety conditions, and its few callers are either single-threaded or guarded by a mutex. There seem to be cases where it is concurrently read without a mutex, but this is allowed https://doc.rust-lang.org/1.97.0/std/sync/atomic/#:~:text=pe...