-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 core::iter::repeat_n #130140
Labels
A-iterators
Area: Iterators
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Sep 9, 2024
lukas-code
added
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
A-iterators
Area: Iterators
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Sep 9, 2024
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Sep 9, 2024
same issue with its fn main() {
let x = std::iter::repeat_n(String::from("use after free"), 0);
println!("{x:?}");
} |
cc @scottmcm, I think you implemented this. ^^ |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-critical |
rustbot
added
P-critical
Critical priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Sep 9, 2024
5 tasks
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Sep 26, 2024
…homcc,traviscross Document subtleties of `ManuallyDrop` After seeing rust-lang#130140 and rust-lang#130141, I figured that `ManuallyDrop` needs documentation explaining its subtleties, hence this PR. See also rust-lang/unsafe-code-guidelines#245
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Sep 27, 2024
Rollup merge of rust-lang#130279 - theemathas:manually-drop-docs, r=thomcc,traviscross Document subtleties of `ManuallyDrop` After seeing rust-lang#130140 and rust-lang#130141, I figured that `ManuallyDrop` needs documentation explaining its subtleties, hence this PR. See also rust-lang/unsafe-code-guidelines#245
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-iterators
Area: Iterators
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-critical
Critical priority
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
core::iter::repeat_n
currently unconditionally derivesClone
. However,it will also drop its inner object if
n
is 0, which can cause a UAF if it's cloned afterwards.Running the above program segfaults:
Edit: Made the segfault quicker/more reliable.
The text was updated successfully, but these errors were encountered: