Skip to content
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

vec_deque::Iter has unsound Debug implementation #53566

Closed
RalfJung opened this issue Aug 21, 2018 · 1 comment

Comments

@RalfJung
Copy link
Member

commented Aug 21, 2018

Found by @MaloJaffre: The following code causes UB (not observable through crashes, but still):

use std::collections::VecDeque;
fn main() {
    println!("{:?}", VecDeque::<u32>::new().iter());
}

This will create a VecDeque ring with capacity 8, then turn that into a slice for Iter, and then print that entire slice. Run it in Miri to see for yourself (Miri is in the "tools" menu).

MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 21, 2018

@shepmaster shepmaster changed the title vec_deque::Iter has unsound Debig implementation vec_deque::Iter has unsound Debug implementation Aug 21, 2018

MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 21, 2018

MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 22, 2018

MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 22, 2018

MaloJaffre added a commit to MaloJaffre/rust that referenced this issue Aug 22, 2018

bors added a commit that referenced this issue Aug 23, 2018

Auto merge of #53571 - MaloJaffre:vecdeque-emergency, r=RalfJung
Fix unsoundness for VecDeque

 See individual commit for more details.

r? @RalfJung.

Fixes #53566, fixes #53529

@bors bors closed this in #53571 Aug 23, 2018

@nluedtke

This comment has been minimized.

Copy link

commented Jul 19, 2019

This was assigned CVE-2019-1010299.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.