diff options
author | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-12 15:23:35 +0000 |
---|---|---|
committer | jschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-12 15:23:35 +0000 |
commit | 8b615de52644092891367b304f3b4663cc6daba6 (patch) | |
tree | 7814b2d138c0d8374c9724fc088f4bac839d7aea /sandbox | |
parent | e1e4764e8bb875391a5888bfb2996b86fa538a4f (diff) | |
download | chromium_src-8b615de52644092891367b304f3b4663cc6daba6.zip chromium_src-8b615de52644092891367b304f3b4663cc6daba6.tar.gz chromium_src-8b615de52644092891367b304f3b4663cc6daba6.tar.bz2 |
Don't switch to RtlCreateUserThread until after lockdown.
BUG=91413
TEST=None.
Review URL: http://codereview.chromium.org/7552014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/src/process_thread_interception.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sandbox/src/process_thread_interception.cc b/sandbox/src/process_thread_interception.cc index e98b588..e847908 100644 --- a/sandbox/src/process_thread_interception.cc +++ b/sandbox/src/process_thread_interception.cc @@ -407,7 +407,16 @@ HANDLE WINAPI TargetCreateThread(CreateThreadFunction orig_CreateThread, 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 @@ HANDLE WINAPI TargetCreateThread(CreateThreadFunction orig_CreateThread, 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; |