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

Unified Diff: sandbox/src/process_thread_interception.cc

Issue 7552014: Don't switch to RtlCreateUserThread until after lockdown. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 5 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/process_thread_interception.cc
===================================================================
--- sandbox/src/process_thread_interception.cc (revision 95144)
+++ sandbox/src/process_thread_interception.cc (working copy)
@@ -407,7 +407,16 @@
PVOID parameter,
DWORD creation_flags,
LPDWORD thread_id) {
+// Try the normal CreateThread; switch to RtlCreateUserThread if needed.
+ static bool use_create_thread = true;
HANDLE thread;
+ if (use_create_thread) {
+ thread = orig_CreateThread(thread_attributes, stack_size, start_address,
+ parameter, creation_flags, thread_id);
+ if (thread)
+ return thread;
+ }
+
PSECURITY_DESCRIPTOR sd =
thread_attributes ? thread_attributes->lpSecurityDescriptor : NULL;
CLIENT_ID client_id;
@@ -419,6 +428,8 @@
if (!NT_SUCCESS(result))
return 0;
+ // CSRSS is closed if we got here, so use RtlCreateUserThread from here on.
+ use_create_thread = false;
if (thread_id)
*thread_id = HandleToUlong(client_id.UniqueThread);
return thread;
« 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