| 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..061bfb480322ce27c95a844436c8a0775d02c37d 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.
|
| + return If(AllOf(new_limit == 0, AnyOf(pid == 0, pid == target_pid)), Allow())
|
| + .Else(Error(EPERM));
|
| +}
|
| +
|
| } // namespace sandbox.
|
|
|