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

Unified Diff: content/common/sandbox_win.cc

Issue 2862563004: Create CSRSS Lockdown feature for finching (Closed)
Patch Set: Created 3 years, 8 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: content/common/sandbox_win.cc
diff --git a/content/common/sandbox_win.cc b/content/common/sandbox_win.cc
index c1ab69baa8fefd2271cb313e901a640ab4811520..eab4521ba41d3a5f8420e70866c0937c4c3816a0 100644
--- a/content/common/sandbox_win.cc
+++ b/content/common/sandbox_win.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/debug/activity_tracker.h"
#include "base/debug/profiler.h"
+#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/hash.h"
#include "base/logging.h"
@@ -601,9 +602,23 @@ sandbox::ResultCode SetJobLevel(const base::CommandLine& cmd_line,
return policy->SetJobLevel(job_level, ui_exceptions);
}
+// This is for finch. See also crbug.com/464430 for details.
+const base::Feature kEnableCsrssLockdownFeature{
+ "EnableCsrssLockdown", base::FEATURE_DISABLED_BY_DEFAULT};
+
// TODO(jschuh): Need get these restrictions applied to NaCl and Pepper.
// Just have to figure out what needs to be warmed up first.
sandbox::ResultCode AddBaseHandleClosePolicy(sandbox::TargetPolicy* policy) {
+ if (base::win::GetVersion() >= base::win::VERSION_WIN10) {
+ if (base::FeatureList::IsEnabled(kEnableCsrssLockdownFeature)) {
+ // Close all ALPC ports.
+ sandbox::ResultCode ret =
+ policy->AddKernelObjectToClose(L"ALPC Port", NULL);
+ if (ret != sandbox::SBOX_ALL_OK) {
+ return ret;
+ }
+ }
+ }
// TODO(cpu): Add back the BaseNamedObjects policy.
base::string16 object_path = PrependWindowsSessionPath(
L"\\BaseNamedObjects\\windows_shell_global_counters");
« no previous file with comments | « no previous file | testing/variations/fieldtrial_testing_config.json » ('j') | testing/variations/fieldtrial_testing_config.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698