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

Unified Diff: content/common/sandbox_policy.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
Index: content/common/sandbox_policy.cc
===================================================================
--- content/common/sandbox_policy.cc (revision 154997)
+++ content/common/sandbox_policy.cc (working copy)
@@ -25,6 +25,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/process_type.h"
#include "content/public/common/sandbox_init.h"
+#include "sandbox/win/src/process_mitigations.h"
#include "sandbox/win/src/sandbox.h"
#include "sandbox/win/src/sandbox_nt_util.h"
#include "sandbox/win/src/win_utils.h"
@@ -726,6 +727,27 @@
return process;
}
+ uint64 mitigations = MITIGATION_RELOCATE_IMAGE |
+ MITIGATION_RELOCATE_IMAGE_REQUIRED |
+ MITIGATION_HEAP_TERMINATE |
+ MITIGATION_BOTTOM_UP_ASLR |
+ MITIGATION_HIGH_ENTROPY_ASLR |
+ MITIGATION_DLL_SEARCH |
+ MITIGATION_EXTENSION_DLL_DISABLE;
+ // TODO(jschuh): Make NaCl work with DEP and SEHOP
+ if (type != content::PROCESS_TYPE_NACL_LOADER) {
+ mitigations |= MITIGATION_DEP | MITIGATION_DEP_NO_ATL_THUNK |
+ MITIGATION_SEHOP;
+ }
+ if (policy->SetProcessMitigations(mitigations) != sandbox::SBOX_ALL_OK)
+ return 0;
+
+ mitigations = MITIGATION_STRICT_HANDLE_CHECKS;
+ if (policy->SetDelayedProcessMitigations(mitigations) !=
+ sandbox::SBOX_ALL_OK) {
+ return 0;
+ }
+
if (type == content::PROCESS_TYPE_PLUGIN) {
AddGenericDllEvictionPolicy(policy);
AddPluginDllEvictionPolicy(policy);

Powered by Google App Engine
This is Rietveld 408576698