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: content/app/startup_helper_win.cc

Issue 10690058: Add sandbox support for Windows process mitigations (Closed) Base URL: https://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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 | content/common/sandbox_policy.cc » ('j') | content/common/sandbox_policy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/startup_helper_win.cc
===================================================================
--- content/app/startup_helper_win.cc (revision 155197)
+++ content/app/startup_helper_win.cc (working copy)
@@ -10,7 +10,7 @@
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/win/windows_version.h"
-#include "sandbox/win/src/dep.h"
+#include "sandbox/win/src/process_mitigations.h"
#include "sandbox/win/src/sandbox_factory.h"
namespace {
@@ -37,12 +37,18 @@
void InitializeSandboxInfo(sandbox::SandboxInterfaceInfo* info) {
info->broker_services = sandbox::SandboxFactory::GetBrokerServices();
- if (!info->broker_services)
+ if (!info->broker_services) {
info->target_services = sandbox::SandboxFactory::GetTargetServices();
-
- if (base::win::GetVersion() < base::win::VERSION_VISTA) {
- // Enforces strong DEP support. Vista uses the NXCOMPAT flag in the exe.
- sandbox::SetCurrentProcessDEP(sandbox::DEP_ENABLED);
+ } else {
+ // Ensure the proper mitigations are enforced for the broker process.
cpu_(ooo_6.6-7.5) 2012/09/07 19:22:55 consider using browser instead of broker when in c
jschuh 2012/09/07 20:23:14 Done.
+ sandbox::SetProcessMitigationsForCurrentProcess(
+ sandbox::TargetPolicy::MITIGATION_HEAP_TERMINATE |
+ sandbox::TargetPolicy::MITIGATION_DEP |
+ sandbox::TargetPolicy::MITIGATION_DEP_NO_ATL_THUNK |
+ sandbox::TargetPolicy::MITIGATION_RELOCATE_IMAGE |
+ sandbox::TargetPolicy::MITIGATION_RELOCATE_IMAGE_REQUIRED |
+ sandbox::TargetPolicy::MITIGATION_BOTTOM_UP_ASLR |
+ sandbox::TargetPolicy::MITIGATION_DLL_SEARCH_ORDER);
}
}
« no previous file with comments | « no previous file | content/common/sandbox_policy.cc » ('j') | content/common/sandbox_policy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698