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

Only parse the last SHT_SYMTAB in Elf::parse() #297

Merged
merged 1 commit into from
Jan 2, 2022
Merged

Only parse the last SHT_SYMTAB in Elf::parse() #297

merged 1 commit into from
Jan 2, 2022

Conversation

Lichtso
Copy link
Contributor

@Lichtso Lichtso commented Dec 31, 2021

Only parse the last SHT_SYMTAB, because all earlier ones are not used anyway.
This improves the runtime complexity from O(n^2) to O(n),
and makes the parsing more robust against crazy inputs.

because all earlier ones are not used anyway.
Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

This was O(n^2) before because it would parse every symtab and every symtab could have referenced the entire string table, is that correct?

@m4b m4b merged commit 6efb91c into m4b:master Jan 2, 2022
@m4b
Copy link
Owner

m4b commented Jan 2, 2022

Also I never received that binary which was the original impetus for changing string table to avoid DoS attacks :) would still be interested to see such a thing, can send to my email m4b dot github dot io atsign gmail.com

@Lichtso Lichtso deleted the performance_of_elf_parse branch January 3, 2022 21:24
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