For the 3Dfx graphics (Voddoo 1/2, etc.), malloc is used to locate memory and then mprotect to change the permissions.
Reasons why malloc is not recommended as a tool:
- Permits only set with the granularity page, but the memory obtained by malloc is unlikely to be the page aligned, and
therefore the permission setting in the adjacent memory will also be terminated, possibly breaking things or denying
permissions of access.
- If you do not reset the previous permissions before calling the free, you can break the inside of malloc.
- Replace malloc () with mmap ().
- Replace free () with munmap ().
In my GNU / Linux system in particular (my dear CentOS Linux 6.7), the application is dropped with a message
"mprotect: permission denied.", It drove me crazy ehh ! .
I solved it with these replacements in a patch and until now, it works (and I already did several tests, ehh!) .
If any of you have this problem, use it!
2 posts • Page 1 of 1
Merged at rev 1224.