| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/common/sandbox_linux/bpf_gpu_policy_linux.h" | 5 #include "content/common/sandbox_linux/bpf_gpu_policy_linux.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 RAW_CHECK(false); | 115 RAW_CHECK(false); |
| 116 return -ENOSYS; | 116 return -ENOSYS; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 class GpuBrokerProcessPolicy : public GpuProcessPolicy { | 120 class GpuBrokerProcessPolicy : public GpuProcessPolicy { |
| 121 public: | 121 public: |
| 122 static sandbox::bpf_dsl::Policy* Create() { | 122 static sandbox::bpf_dsl::Policy* Create() { |
| 123 return new GpuBrokerProcessPolicy(); | 123 return new GpuBrokerProcessPolicy(); |
| 124 } | 124 } |
| 125 virtual ~GpuBrokerProcessPolicy() {} | 125 ~GpuBrokerProcessPolicy() override {} |
| 126 | 126 |
| 127 virtual ResultExpr EvaluateSyscall(int system_call_number) const override; | 127 ResultExpr EvaluateSyscall(int system_call_number) const override; |
| 128 | 128 |
| 129 private: | 129 private: |
| 130 GpuBrokerProcessPolicy() {} | 130 GpuBrokerProcessPolicy() {} |
| 131 DISALLOW_COPY_AND_ASSIGN(GpuBrokerProcessPolicy); | 131 DISALLOW_COPY_AND_ASSIGN(GpuBrokerProcessPolicy); |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 // x86_64/i386 or desktop ARM. | 134 // x86_64/i386 or desktop ARM. |
| 135 // A GPU broker policy is the same as a GPU policy with open and | 135 // A GPU broker policy is the same as a GPU policy with open and |
| 136 // openat allowed. | 136 // openat allowed. |
| 137 ResultExpr GpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { | 137 ResultExpr GpuBrokerProcessPolicy::EvaluateSyscall(int sysno) const { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), | 283 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), |
| 284 read_whitelist, | 284 read_whitelist, |
| 285 write_whitelist); | 285 write_whitelist); |
| 286 // The initialization callback will perform generic initialization and then | 286 // The initialization callback will perform generic initialization and then |
| 287 // call broker_sandboxer_callback. | 287 // call broker_sandboxer_callback. |
| 288 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, | 288 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, |
| 289 broker_sandboxer_allocator))); | 289 broker_sandboxer_allocator))); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace content | 292 } // namespace content |
| OLD | NEW |