-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Zip may call __iterator_get_unchecked twice with the same index #82291
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-criticalCritical priorityCritical priorityT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Here
__iterator_get_uncheckedis called for potential side effects untilself.index == self.a.size(), ignoring however that it could have already been called innext_backwith those indexes.rust/library/core/src/iter/adapters/zip.rs
Lines 200 to 208 in 0148b97
Playground link that demonstrates how this can be exploited to get two mutable references to the same data and cause an use-after-free bug.