-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory sanitizer : false positive regression in nightly-2023-01-18 #107149
Comments
And it worked on
|
That looks like noundef mismatch between C and Rust on return value due to #106294. Building Rust with |
Rust MSAN produces false positives when C clang version is not up to the latest version. See rust-lang/rust#107149
Thank you very much @tmiasko C is compiled with
|
Rust MSAN produces false positives when C clang version is not up to the latest version. See rust-lang/rust#107149 Will fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55239&q=label%3AProj-suricata and such Should the fix be generic for other projects ?
We encountered this in: rust-bitcoin/rust-secp256k1#573 And was just about to open an issue with this Minimal Reproducible Example: (a few lines of code) https://github.com/elichai/msan_c_rust_bug but it sounds like this is a bug coming from mismatching llvm definitions? |
The Memory Sanitizer is giving a false positive at the moment in `nightly`. Adding compiler flags resolves the issue. I didn't grok the exact root cause but this fixes it (cut'n'pasta from the issue [0]). [0] rust-lang/rust#107149
The Memory Sanitizer is giving a false positive at the moment in `nightly`. Adding compiler flags resolves the issue. I didn't grok the exact root cause but this fixes it (cut'n'pasta from the issue [0]). [0] rust-lang/rust#107149
The Memory Sanitizer is giving a false positive at the moment in `nightly`. Adding compiler flags resolves the issue. I didn't grok the exact root cause but this fixes it (cut'n'pasta from the issue [0]). [0] rust-lang/rust#107149
5a3f13e Overcome ASAN false positive regression (Tobin C. Harding) Pull request description: The Memory Sanitizer is giving a false positive at the moment in `nightly`. Adding compiler flags resolves the issue. I didn't grok the exact root cause but this fixes it (cut'n'pasta from the issue [0]). Props to elichai for working this out: #573 (comment) [0] rust-lang/rust#107149 ACKs for top commit: apoelstra: ACK 5a3f13e Tree-SHA512: 873145b732f7574c93ecc1bbabd9d82a1e501a39d1e2184770f71a07ffb72468783ab1b3fbfef8ef377c7e7a4b8c45253da1fce11660152d3369902136f1c049
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
Having |
Rust MSAN produces false positives when C clang version is not up to the latest version. See rust-lang/rust#107149 Will fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55239&q=label%3AProj-suricata and such Should the fix be generic for other projects ?
Looks like there was another regression between
Is this the same issue or another one ? |
Mismatch in LLVM version between clang and rustc? Rust was upgraded to LLVM 16 in #109474. Also, clang 16 enabled sanitize-memory-param-retval, which matches rustc defaults now. |
Thanks @tmiasko :-) |
Meant to fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=57490&q=label%3AProj-suricata Cf rust-lang/rust#107149 When will oss-fuzz use clang 16 for C ?
Do any of the other participants have a response to @RalfJung 's point here? It definitely seems odd. |
If I'm reading this issue correctly, we have a msan instrumented C program compiled with clang 15 and a msan instrumented Rust binary compiled with Rust/LLVM 16. I believe in order for sanitizers in general to work correctly, all of the instrumented objects in your program need to be compiled against the same version of the sanitizer runtime. Since this is somewhat expected as the sanitizer versions do not match, I'm going to close this issue. |
Code
This comes from oss-fuzz cf https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=55286&q=label%3AProj-suricata
This is with
RUSTFLAGS='--cfg fuzzing -Zsanitizer=memory -Cdebuginfo=1 -Cforce-frame-pointers -Zsanitizer-memory-track-origins'
It happens with C code calling a rust function which returns
std::ptr::null_mut()
, and then C code checks the pointer for NULLBasically, it reports use of uninitialized value at
https://github.com/OISF/suricata/blob/a24d7dc45c818054f97448ce42ca9ba270b3b8e4/src/detect-dce-iface.c#L151
And
rs_dcerpc_iface_parse
is returningstd::ptr::null_mut()
cf https://github.com/OISF/suricata/blob/a24d7dc45c818054f97448ce42ca9ba270b3b8e4/rust/src/dcerpc/detect.rs#L243
I expected to see this happen: no report from Memory sanitizer
Instead, this happened:
Version it worked on
It most recently worked on: nightly-2023-01-17
Version with regression
rustc --version --verbose
:Sorry it is nightly-2023-01-18
The text was updated successfully, but these errors were encountered: