Title: [145018] trunk/Source/WTF
Revision
145018
Author
[email protected]
Date
2013-03-06 18:14:37 -0800 (Wed, 06 Mar 2013)

Log Message

Don't give PageAllocationAligned the option to allocate executable memory
https://bugs.webkit.org/show_bug.cgi?id=111657

Reviewed by Geoffrey Garen.

* wtf/PageAllocationAligned.cpp:
(WTF::PageAllocationAligned::allocate):
* wtf/PageAllocationAligned.h:
(PageAllocationAligned):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (145017 => 145018)


--- trunk/Source/WTF/ChangeLog	2013-03-07 01:39:20 UTC (rev 145017)
+++ trunk/Source/WTF/ChangeLog	2013-03-07 02:14:37 UTC (rev 145018)
@@ -1,3 +1,15 @@
+2013-03-06  Oliver Hunt  <[email protected]>
+
+        Don't give PageAllocationAligned the option to allocate executable memory
+        https://bugs.webkit.org/show_bug.cgi?id=111657
+
+        Reviewed by Geoffrey Garen.
+
+        * wtf/PageAllocationAligned.cpp:
+        (WTF::PageAllocationAligned::allocate):
+        * wtf/PageAllocationAligned.h:
+        (PageAllocationAligned):
+
 2013-03-04  Jer Noble  <[email protected]>
 
         Default mouse cursor behavior should be auto-hide for full screen video with custom controls

Modified: trunk/Source/WTF/wtf/PageAllocationAligned.cpp (145017 => 145018)


--- trunk/Source/WTF/wtf/PageAllocationAligned.cpp	2013-03-07 01:39:20 UTC (rev 145017)
+++ trunk/Source/WTF/wtf/PageAllocationAligned.cpp	2013-03-07 02:14:37 UTC (rev 145018)
@@ -28,7 +28,7 @@
 
 namespace WTF {
 
-PageAllocationAligned PageAllocationAligned::allocate(size_t size, size_t alignment, OSAllocator::Usage usage, bool writable, bool executable)
+PageAllocationAligned PageAllocationAligned::allocate(size_t size, size_t alignment, OSAllocator::Usage usage, bool writable)
 {
     ASSERT(isPageAligned(size));
     ASSERT(isPageAligned(alignment));
@@ -43,11 +43,9 @@
     int protection = PROT_READ;
     if (writable)
         protection |= PROT_WRITE;
-    if (executable)
-        protection |= PROT_EXEC;
 
     vm_address_t address = 0;
-    vm_map(current_task(), &address, size, alignmentMask, flags, MEMORY_OBJECT_NULL, 0, FALSE, protection, PROT_READ | PROT_WRITE | PROT_EXEC, VM_INHERIT_DEFAULT);
+    vm_map(current_task(), &address, size, alignmentMask, flags, MEMORY_OBJECT_NULL, 0, FALSE, protection, PROT_READ | PROT_WRITE, VM_INHERIT_DEFAULT);
     return PageAllocationAligned(reinterpret_cast<void*>(address), size);
 #else
     size_t alignmentDelta = alignment - pageSize();
@@ -60,7 +58,7 @@
     void* alignedBase = reinterpret_cast<uintptr_t>(reservationBase) & alignmentMask
         ? reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(reservationBase) & ~alignmentMask) + alignment)
         : reservationBase;
-    OSAllocator::commit(alignedBase, size, writable, executable);
+    OSAllocator::commit(alignedBase, size, writable, false);
 
     return PageAllocationAligned(alignedBase, size, reservationBase, reservationSize);
 #endif

Modified: trunk/Source/WTF/wtf/PageAllocationAligned.h (145017 => 145018)


--- trunk/Source/WTF/wtf/PageAllocationAligned.h	2013-03-07 01:39:20 UTC (rev 145017)
+++ trunk/Source/WTF/wtf/PageAllocationAligned.h	2013-03-07 02:14:37 UTC (rev 145018)
@@ -41,7 +41,7 @@
     using PageBlock::size;
     using PageBlock::base;
 
-    static PageAllocationAligned allocate(size_t size, size_t alignment, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true, bool executable = false);
+    static PageAllocationAligned allocate(size_t size, size_t alignment, OSAllocator::Usage usage = OSAllocator::UnknownUsage, bool writable = true);
 
     void deallocate();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to