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

ScanForFunctions: Skip invalid code sections. May help #12414. #12418

Merged
merged 1 commit into from
Oct 13, 2019

Conversation

hrydgard
Copy link
Owner

This is an immediately obvious way that #10501 could have started crashing when loading things.

@@ -1274,6 +1274,11 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAdd
std::vector<SectionID> codeSections = reader.GetCodeSections();
for (SectionID id : codeSections) {
u32 start = reader.GetSectionAddr(id);
if (!Memory::IsValidAddress(start)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe should validate end too, clamping it to valid. I wonder if this is some game hack.

-[Unknown]

Copy link
Owner Author

Choose a reason for hiding this comment

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

Could very well be, good to have the checks either way though. Yeah, I could have used IsValidRange, I'll switch to that.

@unknownbrackets unknownbrackets merged commit 8a6a494 into master Oct 13, 2019
@unknownbrackets unknownbrackets added this to the v1.10.0 milestone Oct 13, 2019
@hrydgard hrydgard deleted the skip-invalid-code-sections branch October 13, 2019 14:17
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