Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Side by Side Diff: chrome_elf/blacklist/blacklist_interceptions.cc

Issue 171153003: Catch EXCEPTION_IN_PAGE_ERROR errors in SafeGetImageInfo (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removing space Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Implementation of NtMapViewOfSection intercept for 32 bit builds. 5 // Implementation of NtMapViewOfSection intercept for 32 bit builds.
6 // 6 //
7 // TODO(robertshield): Implement the 64 bit intercept. 7 // TODO(robertshield): Implement the 64 bit intercept.
8 8
9 #include "chrome_elf/blacklist/blacklist_interceptions.h" 9 #include "chrome_elf/blacklist/blacklist_interceptions.h"
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 PIMAGE_NT_HEADERS headers = pe.GetNTHeaders(); 143 PIMAGE_NT_HEADERS headers = pe.GetNTHeaders();
144 if (headers) { 144 if (headers) {
145 if (headers->OptionalHeader.AddressOfEntryPoint) 145 if (headers->OptionalHeader.AddressOfEntryPoint)
146 *flags |= sandbox::MODULE_HAS_ENTRY_POINT; 146 *flags |= sandbox::MODULE_HAS_ENTRY_POINT;
147 if (headers->OptionalHeader.SizeOfCode) 147 if (headers->OptionalHeader.SizeOfCode)
148 *flags |= sandbox::MODULE_HAS_CODE; 148 *flags |= sandbox::MODULE_HAS_CODE;
149 } 149 }
150 } 150 }
151 } __except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? 151 } __except((GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ||
152 GetExceptionCode() == EXCEPTION_IN_PAGE_ERROR) ?
152 EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { 153 EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
153 out_name->clear(); 154 out_name->clear();
154 } 155 }
155 } 156 }
156 157
157 base::string16 GetImageInfoFromLoadedModule(HMODULE module, uint32* flags) { 158 base::string16 GetImageInfoFromLoadedModule(HMODULE module, uint32* flags) {
158 std::string out_name; 159 std::string out_name;
159 base::win::PEImage pe(module); 160 base::win::PEImage pe(module);
160 SafeGetImageInfo(pe, &out_name, flags); 161 SafeGetImageInfo(pe, &out_name, flags);
161 return base::string16(out_name.begin(), out_name.end()); 162 return base::string16(out_name.begin(), out_name.end());
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 NTSTATUS WINAPI BlNtMapViewOfSection64( 234 NTSTATUS WINAPI BlNtMapViewOfSection64(
234 HANDLE section, HANDLE process, PVOID *base, ULONG_PTR zero_bits, 235 HANDLE section, HANDLE process, PVOID *base, ULONG_PTR zero_bits,
235 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size, 236 SIZE_T commit_size, PLARGE_INTEGER offset, PSIZE_T view_size,
236 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect) { 237 SECTION_INHERIT inherit, ULONG allocation_type, ULONG protect) {
237 return BlNtMapViewOfSection(g_nt_map_view_of_section_func, section, process, 238 return BlNtMapViewOfSection(g_nt_map_view_of_section_func, section, process,
238 base, zero_bits, commit_size, offset, view_size, 239 base, zero_bits, commit_size, offset, view_size,
239 inherit, allocation_type, protect); 240 inherit, allocation_type, protect);
240 } 241 }
241 #endif 242 #endif
242 } // namespace blacklist 243 } // namespace blacklist
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698