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

fix(cfi): Skip u64::MAX FDEs when converting DWARF #868

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

loewenheim
Copy link
Contributor

We have seen FDEs with an initial address of u64::MAX in user-provided DWARF files. Such FDEs will invariably fail to process because of either an address overflow error in gimli or an underflow in the length calculation in line 756. Therefore, we skip them immediately so we don't abort the processing of the entire file.

@loewenheim loewenheim requested review from tobias-wilfert and a team September 17, 2024 09:01
if fde.initial_address() == u64::MAX {
return Ok(());
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add test for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I can't see how—our only example is a debug file from Riot, and we can't put that on GH.

@tobias-wilfert
Copy link
Member

Presumably even if the address overflow error in gimli was not a thing we would then still hit the underflow for all these cases in line 756?

@loewenheim
Copy link
Contributor Author

Presumably even if the address overflow error in gimli was not a thing we would then still hit the underflow for all these cases in line 756?

Not sure, but I've verified that each of those entries hits one of the two problems.

@loewenheim loewenheim requested a review from Swatinem September 17, 2024 14:17
@loewenheim loewenheim merged commit 6e5bf06 into master Sep 17, 2024
13 checks passed
@loewenheim loewenheim deleted the fix/invalid-fdes branch September 17, 2024 14:47
loewenheim added a commit to getsentry/symbolicator that referenced this pull request Sep 18, 2024
This pulls in getsentry/symbolic#868,
allowing us to process some CFI in DWARF files that we
previously rejected as broken.
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.

4 participants