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

cleanup: Revert all hacks added in #39234 to avoid feeding untrusted data to libbacktrace #77622

Closed
petrochenkov opened this issue Oct 6, 2020 · 2 comments · Fixed by #77748
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup. O-windows-gnu Toolchain: GNU, Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

#39234 is the PR that provided libbacktrace with the name of the current executable when libbacktrace was used for generating backtraces in the standard library.

libbacktrace had a history of crashes and buffer overruns, so #39234 had to apply some logic to ensure that the passed executable is right and doesn't get replaced or go away while the current process is running, all to avoid passing untrusted data to libbacktrace.

Now we use gimli instead of libbacktrace, and gimli is more reliable, and we can feed untrusted data to it.
In the worst case the backtrace will be incorrect or absent as a result.

So all hacks that were introduced #39234 and weren't removed in #74682 can be removed now.

@petrochenkov petrochenkov added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup. O-windows-gnu Toolchain: GNU, Operating system: Windows labels Oct 6, 2020
@jonas-schievink jonas-schievink added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Oct 6, 2020
@mati865
Copy link
Contributor

mati865 commented Oct 7, 2020

I can look into it this week if you don't have time (or don't want to).

@petrochenkov
Copy link
Contributor Author

@mati865
That would be great.
I'll clean this up myself next or this weekend if nobody gets to this earlier.
This should be a fast and easy task.

JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 10, 2020
…henkov

Dead code cleanup in windows-gnu std

Closes rust-lang#77622

This is the only leftover I could find.
@bors bors closed this as completed in 8368588 Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-cleanup Category: PRs that clean code up or issues documenting cleanup. O-windows-gnu Toolchain: GNU, Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants