Skip to content

Conversation

bradfier
Copy link
Contributor

@bradfier bradfier commented May 13, 2020

findshlibs 0.5.0 has a serious defect in SharedLibrary::id, where it
uses file sizes and offsets when examining the PT_NOTE sections of an
ELF binary instead of the memory size/offset fields. This issue was
corrected by gimli-rs/findshlibs@046a431, but was released along with a
couple of semver breaking changes so it needs a bump in Cargo.toml to be
picked up.

This has a fairly major impact on projects where you have with_debug_meta enabled,
as it can lead to all sorts of issues, ranging from at best corrupted crash uploads reaching
Sentry, to SEGFAULTs when a thread panics, to wild UB as we try and read from totally
random memory addresses.

We have tested this in production by patching findshlibs with Cargo's patch function.

I'd suggest pushing out a 0.18.1 release for this if possible, given the impact of the above.

findshlibs 0.5.0 has a serious defect in `SharedLibrary::id`, where it
uses file sizes and offsets when examining the PT_NOTE sections of an
ELF binary instead of the memory size/offset fields. This issue was
corrected by gimli-rs/findshlibs@046a431, but was released along with a
couple of semver breaking changes so it needs a bump in Cargo.toml to be
picked up.
@bradfier
Copy link
Contributor Author

bradfier commented May 13, 2020

I noticed that you're in the middle of a pretty big refactor, and so it will probably be impossible to merge this as-is (or release a 0.18.1 from the current state of this tree).

If you want, you can cherry-pick bradfier@bf9590c onto a branch based off 0.18.0 and release that instead, it also passes the tests. I just can't work out how to get GitHub to open a PR that proposes that...

@jan-auer jan-auer requested a review from Swatinem May 13, 2020 11:27
@Swatinem Swatinem merged commit c7569a1 into getsentry:master May 13, 2020
@Swatinem
Copy link
Member

Thanks for the PR and the good explanation. I might just cut a 0.18.1 release, since there was also another fix that someone requested.
I would need at least a week to push a 0.19 out. BTW, I also plan to move this feature out of core into an integration later this week.

Swatinem pushed a commit that referenced this pull request May 14, 2020
findshlibs 0.5.0 has a serious defect in `SharedLibrary::id`, where it
uses file sizes and offsets when examining the PT_NOTE sections of an
ELF binary instead of the memory size/offset fields. This issue was
corrected by gimli-rs/findshlibs@046a431, but was released along with a
couple of semver breaking changes so it needs a bump in Cargo.toml to be
picked up.
@bradfier bradfier deleted the bump-findshlibs branch May 14, 2020 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants