Chromium Code Reviews| Index: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
| diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
| index 43f633ed78e398654441e2c182b1614ce0176360..ee03e91cd0ccc469aa20e67177007f872502fc1a 100644 |
| --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
| +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc |
| @@ -361,4 +361,12 @@ ResultExpr RestrictGetRandom() { |
| return If((flags & ~kGoodFlags) == 0, Allow()).Else(CrashSIGSYS()); |
| } |
| +ResultExpr RestrictPrlimitToGetrlimit(pid_t target_pid) { |
| + const Arg<pid_t> pid(0); |
| + const Arg<uintptr_t> new_limit(2); |
| + // Only allow 'get' operations, and only for the current process |
|
Jorge Lucangeli Obes
2016/11/28 15:10:04
Nit: end with period.
Daniel Kurtz
2016/11/28 18:38:44
Done.
|
| + return If(AllOf(new_limit == 0, AnyOf(pid == 0, pid == target_pid)), Allow()) |
| + .Else(Error(EPERM)); |
| +} |
| + |
| } // namespace sandbox. |