You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are a team of researchers studying memory safety in Rust. As part of our ongoing research, we tested ioctl-rs (version: 0.2.0) and found that the following code snippet is reported as undefined behavior by Miri:
Running `/home/rose/.rustup/toolchains/nightly-2025-12-06-x86_64-unknown-linux-gnu/bin/cargo-miri runner target/miri/x86_64-unknown-linux-gnu/debug/case10`
error: Undefined Behavior: reading memory at alloc119[0x0..0x4], but memory is uninitialized at [0x0..0x4], and this operation requires initialized memory
--> /home/rose/projects/lifesonar-tests1/new_crates/analyze-poc/ioctl-rs-0.2.0/src/lib.rs:45:36
|
Root-Cause Hypothesis
After analyzing the Miri report and the source code, we assume the UB is rooted in:
Suspect location: src/lib.rs:45
Invariant being broken: uninitialized memory read (use of mem::uninitialized)
Causality chain: tiocmget uses mem::uninitialized to create bits, passes &mut bits into ioctl, Miri reports reading uninitialized memory
Command used:
MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-tree-borrows" RUSTFLAGS=-Awarnings RUST_BACKTRACE=1 cargo miri run
Possible Fix
Use MaybeUninit to replace mem::uninitialized()
We would appreciate it if you could take a look and confirm whether this behavior indicates a real issue, or if it is a false positive / expected limitation of Miri.
Thank you very much for your time and for maintaining this great project!
Activity