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 "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> |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 NOTREACHED(); | 297 NOTREACHED(); |
298 return CrashSIGSYS(); | 298 return CrashSIGSYS(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 ResultExpr RestrictPrlimit64(pid_t target_pid) { | 302 ResultExpr RestrictPrlimit64(pid_t target_pid) { |
303 const Arg<pid_t> pid(0); | 303 const Arg<pid_t> pid(0); |
304 return If(pid == 0 || pid == target_pid, Allow()).Else(CrashSIGSYS()); | 304 return If(pid == 0 || pid == target_pid, Allow()).Else(CrashSIGSYS()); |
305 } | 305 } |
306 | 306 |
| 307 ResultExpr RestrictGetrusage() { |
| 308 const Arg<int> who(0); |
| 309 return If(who == RUSAGE_SELF, Allow()).Else(CrashSIGSYS()); |
| 310 } |
| 311 |
307 } // namespace sandbox. | 312 } // namespace sandbox. |
OLD | NEW |