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..83b7c8b784f7d210df5dadb0340fd9486539f4a6 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(0); |
|
Jorge Lucangeli Obes
2016/11/22 16:06:39
They cannot both be argument index 0, can they?
i
Daniel Kurtz
2016/11/23 00:21:14
https://codesearch.chromium.org/chromium/src/sandb
|
| + // Only allow 'get' operations, and only for the current process |
| + return If(AllOf(new_limit == 0, AnyOf(pid == 0, pid == target_pid)), Allow()) |
| + .Else(Error(EPERM)); |
| +} |
| + |
| } // namespace sandbox. |