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

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

Issue 315383003: Linux sandbox: restrict prctl in the baseline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android header workaround. Created 6 years, 6 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 | content/common/sandbox_linux/bpf_ppapi_policy_linux.cc » ('j') | 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 switch (sysno) { 172 switch (sysno) {
173 case __NR_ioctl: 173 case __NR_ioctl:
174 #if defined(__i386__) || defined(__x86_64__) 174 #if defined(__i386__) || defined(__x86_64__)
175 // The Nvidia driver uses flags not in the baseline policy 175 // The Nvidia driver uses flags not in the baseline policy
176 // (MAP_LOCKED | MAP_EXECUTABLE | MAP_32BIT) 176 // (MAP_LOCKED | MAP_EXECUTABLE | MAP_32BIT)
177 case __NR_mmap: 177 case __NR_mmap:
178 #endif 178 #endif
179 // We also hit this on the linux_chromeos bot but don't yet know what 179 // We also hit this on the linux_chromeos bot but don't yet know what
180 // weird flags were involved. 180 // weird flags were involved.
181 case __NR_mprotect: 181 case __NR_mprotect:
182 // TODO(jln): restrict prctl.
183 case __NR_prctl:
182 case __NR_sched_getaffinity: 184 case __NR_sched_getaffinity:
183 case __NR_sched_setaffinity: 185 case __NR_sched_setaffinity:
184 case __NR_setpriority: 186 case __NR_setpriority:
185 return ErrorCode(ErrorCode::ERR_ALLOWED); 187 return ErrorCode(ErrorCode::ERR_ALLOWED);
186 case __NR_access: 188 case __NR_access:
187 case __NR_open: 189 case __NR_open:
188 case __NR_openat: 190 case __NR_openat:
189 DCHECK(broker_process_); 191 DCHECK(broker_process_);
190 return sandbox->Trap(GpuSIGSYS_Handler, broker_process_); 192 return sandbox->Trap(GpuSIGSYS_Handler, broker_process_);
191 default: 193 default:
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 broker_process_ = new BrokerProcess(GetFSDeniedErrno(), 262 broker_process_ = new BrokerProcess(GetFSDeniedErrno(),
261 read_whitelist, 263 read_whitelist,
262 write_whitelist); 264 write_whitelist);
263 // The initialization callback will perform generic initialization and then 265 // The initialization callback will perform generic initialization and then
264 // call broker_sandboxer_callback. 266 // call broker_sandboxer_callback.
265 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox, 267 CHECK(broker_process_->Init(base::Bind(&UpdateProcessTypeAndEnableSandbox,
266 broker_sandboxer_allocator))); 268 broker_sandboxer_allocator)));
267 } 269 }
268 270
269 } // namespace content 271 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/sandbox_linux/bpf_ppapi_policy_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698