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

Wrong memory pages permissions restoration #1

Open
xtsop opened this issue Feb 9, 2017 · 1 comment
Open

Wrong memory pages permissions restoration #1

xtsop opened this issue Feb 9, 2017 · 1 comment

Comments

@xtsop
Copy link

xtsop commented Feb 9, 2017

I see that after decrypting .rodata section you are reverting the decrypted memory pages using mprotect() to Read-Execute permissions. While this is necessary when decrypting the .text, it is not so for data sections, essentially making it a hot target for shellcode placement. If I'm missing anything, let me know.

@tweksteen
Copy link
Owner

By default, the .rodata section is already executable (see http://xn--thibaud-dya.fr/rodata.html) and yes, it is an heresy. For now, the code is simply returning that page into its previous state.

Feel free to push upstream (glibc, gold) to try to get that change implemented/widely used. Additionally, I could also modify that part of the code to verify the previous permissions and restore them exactly (feel free to send a patch).

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

2 participants