Changeset 92635 in webkit
- Timestamp:
- Aug 8, 2011 2:28:53 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r92618 r92635 1 2011-08-08 Oliver Hunt <oliver@apple.com> 2 3 Using mprotect to create guard pages breaks our use of madvise to release executable memory 4 https://bugs.webkit.org/show_bug.cgi?id=65870 5 6 Reviewed by Gavin Barraclough. 7 8 Use mmap rather than mprotect to clear guard page permissions. 9 10 * wtf/OSAllocatorPosix.cpp: 11 (WTF::OSAllocator::reserveAndCommit): 12 1 13 2011-08-08 Oliver Hunt <oliver@apple.com> 2 14 -
trunk/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp
r87308 r92635 105 105 } 106 106 if (result && includesGuardPages) { 107 mprotect(result, pageSize(), PROT_NONE); 108 mprotect(static_cast<char*>(result) + bytes - pageSize(), pageSize(), PROT_NONE); 107 // We use mmap to remap the guardpages rather than using mprotect as 108 // mprotect results in multiple references to the code region. This 109 // breaks the madvise based mechanism we use to return physical memory 110 // to the OS. 111 mmap(result, pageSize(), PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANON, fd, 0); 112 mmap(static_cast<char*>(result) + bytes - pageSize(), pageSize(), PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANON, fd, 0); 109 113 } 110 114 return result;
Note: See TracChangeset
for help on using the changeset viewer.