selfrando icon indicating copy to clipboard operation
selfrando copied to clipboard

Get rid of original code after randomization with `m_in_place == false`

Open ahomescu opened this issue 8 years ago • 1 comments

As pointer out by @Sjlver, if m_in_place == false, i.e., we randomize to a secondary memory region and leave the new code there, then the original copy of .text remains in place and is both readable and executable. We should re-map it as read-only in this case, but this would require a bit of refactoring, since the code that fixes page protections after randomization is located outside ExecSectionProcessor.

ahomescu avatar Aug 09 '16 00:08 ahomescu

Looking over the code some more, I think we never have m_in_place == false on Linux, so this situation is never encountered. I'll do some experiments later.

ahomescu avatar Jan 07 '17 02:01 ahomescu