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/baseline_policy.h" | 5 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/mman.h> | 8 #include <sys/mman.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 #include <sys/syscall.h> | 10 #include <sys/syscall.h> |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 if (SyscallSets::IsKill(sysno)) { | 175 if (SyscallSets::IsKill(sysno)) { |
176 return RestrictKillTarget(current_pid, sysno); | 176 return RestrictKillTarget(current_pid, sysno); |
177 } | 177 } |
178 | 178 |
179 if (SyscallSets::IsFileSystem(sysno) || | 179 if (SyscallSets::IsFileSystem(sysno) || |
180 SyscallSets::IsCurrentDirectory(sysno)) { | 180 SyscallSets::IsCurrentDirectory(sysno)) { |
181 return Error(fs_denied_errno); | 181 return Error(fs_denied_errno); |
182 } | 182 } |
183 | 183 |
| 184 if (SyscallSets::IsSeccomp(sysno)) |
| 185 return Error(EPERM); |
| 186 |
184 if (SyscallSets::IsAnySystemV(sysno)) { | 187 if (SyscallSets::IsAnySystemV(sysno)) { |
185 return Error(EPERM); | 188 return Error(EPERM); |
186 } | 189 } |
187 | 190 |
188 if (SyscallSets::IsUmask(sysno) || | 191 if (SyscallSets::IsUmask(sysno) || |
189 SyscallSets::IsDeniedFileSystemAccessViaFd(sysno) || | 192 SyscallSets::IsDeniedFileSystemAccessViaFd(sysno) || |
190 SyscallSets::IsDeniedGetOrModifySocket(sysno) || | 193 SyscallSets::IsDeniedGetOrModifySocket(sysno) || |
191 SyscallSets::IsProcessPrivilegeChange(sysno)) { | 194 SyscallSets::IsProcessPrivilegeChange(sysno)) { |
192 return Error(EPERM); | 195 return Error(EPERM); |
193 } | 196 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 DCHECK_EQ(syscall(__NR_getpid), current_pid_); | 234 DCHECK_EQ(syscall(__NR_getpid), current_pid_); |
232 } | 235 } |
233 return EvaluateSyscallImpl(fs_denied_errno_, current_pid_, sysno); | 236 return EvaluateSyscallImpl(fs_denied_errno_, current_pid_, sysno); |
234 } | 237 } |
235 | 238 |
236 ResultExpr BaselinePolicy::InvalidSyscall() const { | 239 ResultExpr BaselinePolicy::InvalidSyscall() const { |
237 return CrashSIGSYS(); | 240 return CrashSIGSYS(); |
238 } | 241 } |
239 | 242 |
240 } // namespace sandbox. | 243 } // namespace sandbox. |
OLD | NEW |