Changeset 38187 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 6, 2008, 10:47:44 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r38185 r38187 1 2008-11-06 Alp Toker <[email protected]> 2 3 Reviewed by Cameron Zwarich. 4 5 https://bugs.webkit.org/show_bug.cgi?id=22033 6 [GTK] CTI/Linux r38064 crashes; JIT requires executable memory 7 8 Mark pages allocated by the FastMalloc mmap code path executable with 9 PROT_EXEC. This fixes crashes seen on CPUs and kernels that enforce 10 non-executable memory (like ExecShield on Fedora Linux) when the JIT 11 is enabled. 12 13 This patch does not resolve the issue on debug builds so affected 14 developers may still need to pass --disable-jit to configure. 15 16 * wtf/TCSystemAlloc.cpp: 17 (TryMmap): 18 (TryDevMem): 19 (TCMalloc_SystemRelease): 20 1 21 2008-11-06 Peter Gal <[email protected]> 2 22 -
trunk/JavaScriptCore/wtf/TCSystemAlloc.cpp
r37772 r38187 52 52 #include "UnusedParam.h" 53 53 54 #if HAVE(MMAP) 55 static const int cProtFlags = PROT_READ | PROT_WRITE 56 #if ENABLE(CTI) && PLATFORM(GTK) 57 | PROT_EXEC 58 #endif 59 ; 60 #endif 61 54 62 #ifndef MAP_ANONYMOUS 55 63 #define MAP_ANONYMOUS MAP_ANON … … 171 179 } 172 180 void* result = mmap(NULL, size + extra, 173 PROT_READ|PROT_WRITE,181 cProtFlags, 174 182 MAP_PRIVATE|MAP_ANONYMOUS, 175 183 -1, 0); … … 303 311 return NULL; 304 312 } 305 void *result = mmap(0, size + extra, PROT_WRITE|PROT_READ,313 void *result = mmap(0, size + extra, cProtFlags, 306 314 MAP_SHARED, physmem_fd, physmem_base); 307 315 if (result == reinterpret_cast<void*>(MAP_FAILED)) { … … 422 430 423 431 #if HAVE(MMAP) 424 void *newAddress = mmap(start, length, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0);432 void *newAddress = mmap(start, length, cProtFlags, MAP_PRIVATE|MAP_ANONYMOUS|MAP_FIXED, -1, 0); 425 433 UNUSED_PARAM(newAddress); 426 434 // If the mmap failed then that's ok, we just won't return the memory to the system.
Note:
See TracChangeset
for help on using the changeset viewer.