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

Side by Side Diff: content/common/sandbox_linux/bpf_gpu_policy_linux.cc

Issue 252323005: Linux sandbox: allow *kill in the GPU process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 case __NR_sched_getaffinity: 178 case __NR_sched_getaffinity:
179 case __NR_sched_setaffinity: 179 case __NR_sched_setaffinity:
180 case __NR_setpriority: 180 case __NR_setpriority:
181 return ErrorCode(ErrorCode::ERR_ALLOWED); 181 return ErrorCode(ErrorCode::ERR_ALLOWED);
182 case __NR_access: 182 case __NR_access:
183 case __NR_open: 183 case __NR_open:
184 case __NR_openat: 184 case __NR_openat:
185 DCHECK(broker_process_); 185 DCHECK(broker_process_);
186 return sandbox->Trap(GpuSIGSYS_Handler, broker_process_); 186 return sandbox->Trap(GpuSIGSYS_Handler, broker_process_);
187 default: 187 default:
188 // Allow *kill from the GPU process temporarily until fork()
189 // is denied here.
190 if (SyscallSets::IsKill(sysno))
191 return ErrorCode(ErrorCode::ERR_ALLOWED);
188 if (SyscallSets::IsEventFd(sysno)) 192 if (SyscallSets::IsEventFd(sysno))
189 return ErrorCode(ErrorCode::ERR_ALLOWED); 193 return ErrorCode(ErrorCode::ERR_ALLOWED);
190 194
191 // Default on the baseline policy. 195 // Default on the baseline policy.
192 return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno); 196 return SandboxBPFBasePolicy::EvaluateSyscall(sandbox, sysno);
193 } 197 }
194 } 198 }
195 199
196 bool GpuProcessPolicy::PreSandboxHook() { 200 bool GpuProcessPolicy::PreSandboxHook() {
197 // Warm up resources needed by the policy we're about to enable and 201 // Warm up resources needed by the policy we're about to enable and
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), 260 broker_process_ = new BrokerProcess(GetFSDeniedErrno(),
257 read_whitelist, 261 read_whitelist,
258 write_whitelist); 262 write_whitelist);
259 // The initialization callback will perform generic initialization and then 263 // The initialization callback will perform generic initialization and then
260 // call broker_sandboxer_callback. 264 // call broker_sandboxer_callback.
261 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, 265 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox,
262 broker_sandboxer_allocator))); 266 broker_sandboxer_allocator)));
263 } 267 }
264 268
265 } // namespace content 269 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698