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

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

Issue 2484393004: Linux Sandbox: Whitelist prlimit64 when used as getrlimit (Closed)
Patch Set: Linux Sandbox: Whitelist prlimit64 when used as getrlimit Created 4 years 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
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 #ifndef SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_ 5 #ifndef SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_
6 #define SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_ 6 #define SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_
7 7
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // CLOCK_REALTIME, and CLOCK_THREAD_CPUTIME_ID. In particular, this disallows 91 // CLOCK_REALTIME, and CLOCK_THREAD_CPUTIME_ID. In particular, this disallows
92 // access to arbitrary per-{process,thread} CPU-time clock IDs (such as those 92 // access to arbitrary per-{process,thread} CPU-time clock IDs (such as those
93 // returned by {clock,pthread}_getcpuclockid), which can leak information 93 // returned by {clock,pthread}_getcpuclockid), which can leak information
94 // about the state of the host OS. 94 // about the state of the host OS.
95 SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictClockID(); 95 SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictClockID();
96 96
97 // Restrict the flags argument to getrandom() to allow only no flags, or 97 // Restrict the flags argument to getrandom() to allow only no flags, or
98 // GRND_NONBLOCK. 98 // GRND_NONBLOCK.
99 SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictGetRandom(); 99 SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictGetRandom();
100 100
101 // Restrict the new_limit argument to prlimit64() to NULL, and the pid argument
Jorge Lucangeli Obes 2016/11/22 16:06:39 "only allow only" -> "only allow"
102 // to the current process (or 0), to only allow only getting rlimits on the
103 // current process. Otherwise, fail gracefully; see crbug.com/160157.
104 SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictPrlimitToGetrlimit(pid_t target_pid);
105
101 } // namespace sandbox. 106 } // namespace sandbox.
102 107
103 #endif // SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_ 108 #endif // SANDBOX_LINUX_SECCOMP_BPF_HELPERS_SYSCALL_PARAMETERS_RESTRICTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698