Title: [239249] trunk/Source/WTF
Revision
239249
Author
da...@apple.com
Date
2018-12-14 23:48:18 -0800 (Fri, 14 Dec 2018)

Log Message

Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
https://bugs.webkit.org/show_bug.cgi?id=192738
rdar://problem/37502342

Reviewed by Mark Lam.

* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
like the one in tryLargeZeroedMemalignVirtual in bmalloc.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (239248 => 239249)


--- trunk/Source/WTF/ChangeLog	2018-12-15 07:42:38 UTC (rev 239248)
+++ trunk/Source/WTF/ChangeLog	2018-12-15 07:48:18 UTC (rev 239249)
@@ -1,3 +1,15 @@
+2018-12-14  Darin Adler  <da...@apple.com>
+
+        Verify size is valid in USE_SYSTEM_MALLOC version of tryAllocateZeroedVirtualPages
+        https://bugs.webkit.org/show_bug.cgi?id=192738
+        rdar://problem/37502342
+
+        Reviewed by Mark Lam.
+
+        * wtf/Gigacage.cpp:
+        (Gigacage::tryAllocateZeroedVirtualPages): Added a RELEASE_ASSERT just
+        like the one in tryLargeZeroedMemalignVirtual in bmalloc.
+
 2018-12-14  David Kilzer  <ddkil...@apple.com>
 
         clang-tidy: Fix unnecessary copy of AtomicString each time one is logged

Modified: trunk/Source/WTF/wtf/Gigacage.cpp (239248 => 239249)


--- trunk/Source/WTF/wtf/Gigacage.cpp	2018-12-15 07:42:38 UTC (rev 239248)
+++ trunk/Source/WTF/wtf/Gigacage.cpp	2018-12-15 07:48:18 UTC (rev 239249)
@@ -41,9 +41,10 @@
     return FastMalloc::tryMalloc(size);
 }
 
-void* tryAllocateZeroedVirtualPages(Kind, size_t size)
+void* tryAllocateZeroedVirtualPages(Kind, size_t requestedSize)
 {
-    size = roundUpToMultipleOf(WTF::pageSize(), size);
+    size_t size = roundUpToMultipleOf(WTF::pageSize(), requestedSize);
+    RELEASE_ASSERT(size >= requestedSize);
     void* result = OSAllocator::reserveAndCommit(size);
 #if !ASSERT_DISABLED
     if (result) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to