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

Side by Side Diff: sandbox/win/src/sandbox_policy_base.cc

Issue 1856993003: Implement sandbox hooks to forward OPM related GDI system calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaced shared memory implementation. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/win/src/sandbox_policy_base.h" 5 #include "sandbox/win/src/sandbox_policy_base.h"
6 6
7 #include <sddl.h> 7 #include <sddl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 stdout_handle_(INVALID_HANDLE_VALUE), 130 stdout_handle_(INVALID_HANDLE_VALUE),
131 stderr_handle_(INVALID_HANDLE_VALUE), 131 stderr_handle_(INVALID_HANDLE_VALUE),
132 integrity_level_(INTEGRITY_LEVEL_LAST), 132 integrity_level_(INTEGRITY_LEVEL_LAST),
133 delayed_integrity_level_(INTEGRITY_LEVEL_LAST), 133 delayed_integrity_level_(INTEGRITY_LEVEL_LAST),
134 mitigations_(0), 134 mitigations_(0),
135 delayed_mitigations_(0), 135 delayed_mitigations_(0),
136 is_csrss_connected_(true), 136 is_csrss_connected_(true),
137 policy_maker_(NULL), 137 policy_maker_(NULL),
138 policy_(NULL), 138 policy_(NULL),
139 lowbox_sid_(NULL), 139 lowbox_sid_(NULL),
140 lockdown_default_dacl_(false) { 140 lockdown_default_dacl_(false),
141 enable_opm_redirection_(false) {
141 ::InitializeCriticalSection(&lock_); 142 ::InitializeCriticalSection(&lock_);
142 dispatcher_.reset(new TopLevelDispatcher(this)); 143 dispatcher_.reset(new TopLevelDispatcher(this));
143 } 144 }
144 145
145 PolicyBase::~PolicyBase() { 146 PolicyBase::~PolicyBase() {
146 TargetSet::iterator it; 147 TargetSet::iterator it;
147 for (it = targets_.begin(); it != targets_.end(); ++it) { 148 for (it = targets_.begin(); it != targets_.end(); ++it) {
148 TargetProcess* target = (*it); 149 TargetProcess* target = (*it);
149 delete target; 150 delete target;
150 } 151 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } 657 }
657 658
658 HANDLE PolicyBase::GetStdoutHandle() { 659 HANDLE PolicyBase::GetStdoutHandle() {
659 return stdout_handle_; 660 return stdout_handle_;
660 } 661 }
661 662
662 HANDLE PolicyBase::GetStderrHandle() { 663 HANDLE PolicyBase::GetStderrHandle() {
663 return stderr_handle_; 664 return stderr_handle_;
664 } 665 }
665 666
667 void PolicyBase::SetEnableOPMRedirection() {
668 enable_opm_redirection_ = true;
669 }
670
671 bool PolicyBase::GetEnableOPMRedirection() {
672 return enable_opm_redirection_;
673 }
674
666 bool PolicyBase::SetupAllInterceptions(TargetProcess* target) { 675 bool PolicyBase::SetupAllInterceptions(TargetProcess* target) {
667 InterceptionManager manager(target, relaxed_interceptions_); 676 InterceptionManager manager(target, relaxed_interceptions_);
668 677
669 if (policy_) { 678 if (policy_) {
670 for (int i = 0; i < IPC_LAST_TAG; i++) { 679 for (int i = 0; i < IPC_LAST_TAG; i++) {
671 if (policy_->entry[i] && !dispatcher_->SetupService(&manager, i)) 680 if (policy_->entry[i] && !dispatcher_->SetupService(&manager, i))
672 return false; 681 return false;
673 } 682 }
674 } 683 }
675 684
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 break; 777 break;
769 } 778 }
770 779
771 default: { return SBOX_ERROR_UNSUPPORTED; } 780 default: { return SBOX_ERROR_UNSUPPORTED; }
772 } 781 }
773 782
774 return SBOX_ALL_OK; 783 return SBOX_ALL_OK;
775 } 784 }
776 785
777 } // namespace sandbox 786 } // namespace sandbox
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698