Bug 1110760 - Increase the chances of the wow_helper target code symbols being in the assumed order. r=aklotz
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 06 Jan 2015 07:32:40 +0900
changeset 222576 7df8d663997106d269d07c31d535824cbc585c8d
parent 222575 2d03b2b604af335c57d8c54491e210b1b0d75758
child 222577 c2845100484dfbeb1063bc3c22f3fca715d366b6
push id28068
push usercbook@mozilla.com
push dateThu, 08 Jan 2015 13:16:34 +0000
treeherdermozilla-central@2880e05d5e32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1110760
milestone37.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 1110760 - Increase the chances of the wow_helper target code symbols being in the assumed order. r=aklotz
security/sandbox/chromium/sandbox/win/wow_helper/target_code.cc
--- a/security/sandbox/chromium/sandbox/win/wow_helper/target_code.cc
+++ b/security/sandbox/chromium/sandbox/win/wow_helper/target_code.cc
@@ -2,16 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include "sandbox/win/wow_helper/target_code.h"
 
 namespace sandbox {
 
 // Hooks NtMapViewOfSection to detect the load of dlls.
+#pragma code_seg(push, code, ".TargetCode$A")
 NTSTATUS WINAPI TargetNtMapViewOfSection(
     PatchInfo *patch_info, HANDLE process, PVOID *base, ULONG_PTR zero_bits,
     SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size,
     SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect) {
   NTSTATUS ret = patch_info->orig_MapViewOfSection(patch_info->section, process,
                                                    base, zero_bits, commit_size,
                                                    offset, view_size, inherit,
                                                    allocation_type, protect);
@@ -20,15 +21,18 @@ NTSTATUS WINAPI TargetNtMapViewOfSection
   timeout.QuadPart = -(5 * 10000000);  // 5 seconds.
 
   // The wait is alertable.
   patch_info->signal_and_wait(patch_info->dll_load, patch_info->continue_load,
                               TRUE, &timeout);
 
   return ret;
 }
+#pragma code_seg(pop, code)
 
 // Marks the end of the code to copy to the target process.
+#pragma code_seg(push, code, ".TargetCode$B")
 NTSTATUS WINAPI TargetEnd() {
   return STATUS_SUCCESS;
 }
+#pragma code_seg(pop, code)
 
 }  // namespace sandbox