-
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
Use-after-free in Drop impl for vec::Drain
#91772
Comments
@rustbot claim |
I have added debug printing for the slice length to
Which I interpret as any aligned, non-null pointer is valid for zero-length slices, which includes recently freed allocations. So this seems to be a false positive caused by miri not taking the slice length into account. |
That is not the case, unfortunately. Quoting from https://doc.rust-lang.org/nightly/core/ptr/index.html:
I am not happy with this rule, but currently, LLVM does not really let us a choice here (rust-lang/unsafe-code-guidelines#93). |
Added 1.59.0 milestone since that's my understanding of when the regression occurred. |
…imulacrum Fix zero-sized reference to deallocated memory fixes rust-lang#91772 r? `@camelid`
Removing prioritization label as per discussion on Zulip @rustbot label -I-prioritize |
MCVE (could be reduced further):
Originally found by miri-test-libstd. See this thread for more.
The text was updated successfully, but these errors were encountered: