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

Unified Diff: sandbox/win/tests/common/controller.cc

Issue 1626623003: [Win10 sandbox mitigations] Four new Win10 mitigations added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: sandbox/win/tests/common/controller.cc
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc
index 8d3e29dd9600bf643b55cdc46b01d2fe89a70baa..4d877135bb4e4bdd11dd5abd028f2bb9f09fbc37 100644
--- a/sandbox/win/tests/common/controller.cc
+++ b/sandbox/win/tests/common/controller.cc
@@ -94,17 +94,28 @@ TestRunner::TestRunner(JobLevel job_level, TokenLevel startup_token,
TokenLevel main_token)
: is_init_(false), is_async_(false), no_sandbox_(false),
target_process_id_(0) {
- Init(job_level, startup_token, main_token);
+ Init(job_level, startup_token, main_token, false);
+}
+
+TestRunner::TestRunner(bool enable_create_process)
+ : is_init_(false),
+ is_async_(false),
+ no_sandbox_(false),
+ target_process_id_(0) {
+ Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN,
+ enable_create_process);
}
TestRunner::TestRunner()
: is_init_(false), is_async_(false), no_sandbox_(false),
target_process_id_(0) {
- Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN);
+ Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN, false);
}
-void TestRunner::Init(JobLevel job_level, TokenLevel startup_token,
- TokenLevel main_token) {
+void TestRunner::Init(JobLevel job_level,
+ TokenLevel startup_token,
+ TokenLevel main_token,
+ bool enable_create_process) {
broker_ = NULL;
policy_ = NULL;
timeout_ = kDefaultTimeout;
@@ -124,9 +135,11 @@ void TestRunner::Init(JobLevel job_level, TokenLevel startup_token,
policy_->SetJobLevel(job_level, 0);
policy_->SetTokenLevel(startup_token, main_token);
- // Close all ALPC ports.
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
- policy_->AddKernelObjectToClose(L"ALPC Port", NULL);
+ if (!enable_create_process) {
Will Harris 2016/01/25 19:32:36 Can this not be moved to InternalRunTest and a new
penny 2016/01/26 22:37:10 Done. Excellent idea. For some reason I didn't c
+ // Close all ALPC ports.
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
+ policy_->AddKernelObjectToClose(L"ALPC Port", NULL);
+ }
}
is_init_ = true;
« sandbox/win/src/process_mitigations_test.cc ('K') | « sandbox/win/tests/common/controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698