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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc

Issue 430363003: Linux sandbox: restrict setpriority() in baseline policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nit. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h ('k') | 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 "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux/futex.h> 10 #include <linux/futex.h>
11 #include <linux/net.h> 11 #include <linux/net.h>
12 #include <sched.h> 12 #include <sched.h>
13 #include <signal.h> 13 #include <signal.h>
14 #include <sys/ioctl.h> 14 #include <sys/ioctl.h>
15 #include <sys/mman.h> 15 #include <sys/mman.h>
16 #include <sys/prctl.h> 16 #include <sys/prctl.h>
17 #include <sys/resource.h>
17 #include <sys/stat.h> 18 #include <sys/stat.h>
19 #include <sys/time.h>
18 #include <sys/types.h> 20 #include <sys/types.h>
19 #include <unistd.h> 21 #include <unistd.h>
20 22
21 #include "base/basictypes.h" 23 #include "base/basictypes.h"
22 #include "base/logging.h" 24 #include "base/logging.h"
23 #include "base/macros.h" 25 #include "base/macros.h"
24 #include "build/build_config.h" 26 #include "build/build_config.h"
25 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" 27 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
26 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h" 28 #include "sandbox/linux/seccomp-bpf/linux_seccomp.h"
27 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" 29 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 FUTEX_WAKE, 237 FUTEX_WAKE,
236 FUTEX_REQUEUE, 238 FUTEX_REQUEUE,
237 FUTEX_CMP_REQUEUE, 239 FUTEX_CMP_REQUEUE,
238 FUTEX_WAKE_OP, 240 FUTEX_WAKE_OP,
239 FUTEX_WAIT_BITSET, 241 FUTEX_WAIT_BITSET,
240 FUTEX_WAKE_BITSET), 242 FUTEX_WAKE_BITSET),
241 Allow()) 243 Allow())
242 .Default(CrashSIGSYSFutex()); 244 .Default(CrashSIGSYSFutex());
243 } 245 }
244 246
247 ResultExpr RestrictGetSetpriority(pid_t target_pid) {
248 const Arg<int> which(0);
249 const Arg<int> who(1);
250 return If(which == PRIO_PROCESS,
251 If(who == 0 || who == target_pid, Allow()).Else(Error(EPERM)))
252 .Else(CrashSIGSYS());
253 }
254
245 } // namespace sandbox. 255 } // namespace sandbox.
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698