From 7986921c089dbbe2bf1b9f87c522e571a7061c96 Mon Sep 17 00:00:00 2001 From: "jschuh@chromium.org" Date: Thu, 13 Sep 2012 22:29:33 +0000 Subject: Add sandbox support for Windows process mitigations BUG=147752 Review URL: https://codereview.chromium.org/10690058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156657 0039d316-1c4b-4281-b951-d872f2087c98 --- sandbox/win/src/target_process.cc | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'sandbox/win/src/target_process.cc') diff --git a/sandbox/win/src/target_process.cc b/sandbox/win/src/target_process.cc index 164b2a9..4eea180 100644 --- a/sandbox/win/src/target_process.cc +++ b/sandbox/win/src/target_process.cc @@ -35,27 +35,6 @@ void CopyPolicyToTarget(const void* source, size_t size, void* dest) { } } -// Reserve a random range at the bottom of the address space in the target -// process to prevent predictable alocations at low addresses. -void PoisonLowerAddressRange(HANDLE process) { - unsigned int limit; - rand_s(&limit); - char* ptr = 0; - const size_t kMask64k = 0xFFFF; - // Random range (512k-16.5mb) in 64k steps. - const char* end = ptr + ((((limit % 16384) + 512) * 1024) & ~kMask64k); - while (ptr < end) { - MEMORY_BASIC_INFORMATION memory_info; - if (!::VirtualQueryEx(process, ptr, &memory_info, sizeof(memory_info))) - break; - size_t size = std::min((memory_info.RegionSize + kMask64k) & ~kMask64k, - static_cast(end - ptr)); - if (ptr && memory_info.State == MEM_FREE) - ::VirtualAllocEx(process, ptr, size, MEM_RESERVE, PAGE_NOACCESS); - ptr += size; - } -} - } namespace sandbox { @@ -168,8 +147,6 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, } lockdown_token_.Close(); - PoisonLowerAddressRange(process_info.process_handle()); - DWORD win_result = ERROR_SUCCESS; // Assign the suspended target to the windows job object. -- cgit v1.1