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

Unified Diff: sandbox/src/target_services.cc

Issue 7857022: Prevent the renderer from dying if launched under App-V/SoftGrid. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/src/target_services.cc
===================================================================
--- sandbox/src/target_services.cc (revision 100213)
+++ sandbox/src/target_services.cc (working copy)
@@ -71,8 +71,12 @@
// Failure here is a breach of security so the process is terminated.
void TargetServicesBase::LowerToken() {
- if (ERROR_SUCCESS !=
- SetProcessIntegrityLevel(g_shared_delayed_integrity_level))
+ DWORD error_code = SetProcessIntegrityLevel(g_shared_delayed_integrity_level);
+ // Here we don't terminate the process if the error is ERROR_INVALID_HANDLE,
+ // this is because this error is not possible in normal circumstances, unless
+ // it is hooked by sftldr_wow64.dll, in which case we prefer to keep running.
+ // See http://crbug.com/95888.
+ if (ERROR_SUCCESS != error_code && ERROR_INVALID_HANDLE != error_code)
::TerminateProcess(::GetCurrentProcess(), SBOX_FATAL_INTEGRITY);
process_state_.SetRevertedToSelf();
// If the client code as called RegOpenKey, advapi32.dll has cached some
« 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