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

should elf_image be mmap-ed with +X? #62

Open
mustime opened this issue Nov 26, 2020 · 0 comments
Open

should elf_image be mmap-ed with +X? #62

mustime opened this issue Nov 26, 2020 · 0 comments

Comments

@mustime
Copy link

mustime commented Nov 26, 2020

Having realized that library loaded by WDynamicLibOpen with memory protection readonly.

base_ = mmap(nullptr, len_, PROT_READ, MAP_PRIVATE, fd, 0);

There is a possible scenario, if the target library is not already loaded in current process, i.e, whale::FindExecuteMemoryRange returns empty whale::MemoryRange. And the library would be loaded by WDynamicLibOpen with readonly protection. Therefore the function resolved by WDynamicLibSymbol should be resided in the same readonly region, causing an attempted call of these functions to raise segment fault error.

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

No branches or pull requests

1 participant