Bug 1546545: Part 1 - Properly store pointer to sandboxed DLL intercepted method r=aklotz
authorDavid Parks <dparks@mozilla.com>
Fri, 26 Apr 2019 00:49:32 +0000
changeset 530625 8c9f054168c36736aa023991eaacd03965820328
parent 530624 4442722c78cd11e811a6830ea5a2da48507e8f40
child 530626 e9e6acc1b0cc8638b270543c7b39c944fc1698af
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1546545, 1533808
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1546545: Part 1 - Properly store pointer to sandboxed DLL intercepted method r=aklotz Bug 1533808 introduced code to intercept DLL methods that the Chromium sandbox had already intercepted. That patch did not store the the pointer to the intercepted function in the trampoline data, as is done when intercepting other methods. Differential Revision: https://phabricator.services.mozilla.com/D28612
mozglue/misc/interceptor/PatcherDetour.h
--- a/mozglue/misc/interceptor/PatcherDetour.h
+++ b/mozglue/misc/interceptor/PatcherDetour.h
@@ -590,23 +590,23 @@ class WindowsDllDetourPatcher final : pu
       }
 
       // Clear the instance pointer so that we don't try to reset a nonexistent
       // hook.
       tramp.Rewind();
       tramp.WriteEncodedPointer(nullptr);
     });
 
-    if (PatchIfTargetIsRecognizedTrampoline(tramp, origBytes, aDest,
-                                            aOutTramp)) {
+    tramp.WritePointer(origBytes.AsEncodedPtr());
+    if (!tramp) {
       return;
     }
 
-    tramp.WritePointer(origBytes.AsEncodedPtr());
-    if (!tramp) {
+    if (PatchIfTargetIsRecognizedTrampoline(tramp, origBytes, aDest,
+                                            aOutTramp)) {
       return;
     }
 
     tramp.StartExecutableCode();
 
 #if defined(_M_IX86)
     int pJmp32 = -1;
     while (origBytes.GetOffset() < 5) {