Title: [261954] branches/safari-609-branch/Source/WTF
Revision
261954
Author
[email protected]
Date
2020-05-20 14:17:34 -0700 (Wed, 20 May 2020)

Log Message

Cherry-pick r261598. rdar://problem/63461433

    catch_mach_exception_raise_state() should fail early if the faulting address is not of interest.
    https://bugs.webkit.org/show_bug.cgi?id=211799
    <rdar://problem/62939204>

    Reviewed by Saam Barati.

    * wtf/threads/Signals.cpp:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261598 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WTF/ChangeLog (261953 => 261954)


--- branches/safari-609-branch/Source/WTF/ChangeLog	2020-05-20 21:05:46 UTC (rev 261953)
+++ branches/safari-609-branch/Source/WTF/ChangeLog	2020-05-20 21:17:34 UTC (rev 261954)
@@ -1,3 +1,29 @@
+2020-05-20  Alan Coon  <[email protected]>
+
+        Cherry-pick r261598. rdar://problem/63461433
+
+    catch_mach_exception_raise_state() should fail early if the faulting address is not of interest.
+    https://bugs.webkit.org/show_bug.cgi?id=211799
+    <rdar://problem/62939204>
+    
+    Reviewed by Saam Barati.
+    
+    * wtf/threads/Signals.cpp:
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261598 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-05-12  Mark Lam  <[email protected]>
+
+            catch_mach_exception_raise_state() should fail early if the faulting address is not of interest.
+            https://bugs.webkit.org/show_bug.cgi?id=211799
+            <rdar://problem/62939204>
+
+            Reviewed by Saam Barati.
+
+            * wtf/threads/Signals.cpp:
+
 2020-05-12  Mark Lam  <[email protected]>
 
         Cherry-pick r260165, r261538. rdar://problem/63156083

Modified: branches/safari-609-branch/Source/WTF/wtf/threads/Signals.cpp (261953 => 261954)


--- branches/safari-609-branch/Source/WTF/wtf/threads/Signals.cpp	2020-05-20 21:05:46 UTC (rev 261953)
+++ branches/safari-609-branch/Source/WTF/wtf/threads/Signals.cpp	2020-05-20 21:17:34 UTC (rev 261954)
@@ -204,6 +204,14 @@
     if (signal == Signal::BadAccess) {
         ASSERT_UNUSED(dataCount, dataCount == 2);
         info.faultingAddress = reinterpret_cast<void*>(exceptionData[1]);
+#if CPU(ADDRESS64)
+        // If the faulting address is out of the range of any valid memory, we would
+        // not have any reason to handle it. Just let the default handler take care of it.
+        static constexpr unsigned validAddressBits = OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH);
+        static constexpr uintptr_t invalidAddressMask = ~((1ull << validAddressBits) - 1);
+        if (bitwise_cast<uintptr_t>(info.faultingAddress) & invalidAddressMask)
+            return KERN_FAILURE;
+#endif
     }
 
     bool didHandle = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to