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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc

Issue 568533002: Linux sandbox: allow sigaltstack in Android baseline policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // non-ASan builds. 113 // non-ASan builds.
114 return Allow(); 114 return Allow();
115 } 115 }
116 #endif // defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || 116 #endif // defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||
117 // defined(MEMORY_SANITIZER) 117 // defined(MEMORY_SANITIZER)
118 118
119 if (IsBaselinePolicyAllowed(sysno)) { 119 if (IsBaselinePolicyAllowed(sysno)) {
120 return Allow(); 120 return Allow();
121 } 121 }
122 122
123 #if defined(__aarch64__) 123 #if defined(OS_ANDROID)
124 // These are needed for thread creation. 124 // Needed for thread creation.
125 // TODO(leecam): Check jln's fix for this and remove these 'allows'. 125 if (sysno == __NR_sigaltstack)
126 if (sysno == __NR_sigaltstack || sysno == __NR_setpriority)
127 return Allow(); 126 return Allow();
128 #endif 127 #endif
129 128
130 if (sysno == __NR_clone) { 129 if (sysno == __NR_clone) {
131 return RestrictCloneToThreadsAndEPERMFork(); 130 return RestrictCloneToThreadsAndEPERMFork();
132 } 131 }
133 132
134 if (sysno == __NR_fcntl) 133 if (sysno == __NR_fcntl)
135 return RestrictFcntlCommands(); 134 return RestrictFcntlCommands();
136 135
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 DCHECK_EQ(syscall(__NR_getpid), current_pid_); 247 DCHECK_EQ(syscall(__NR_getpid), current_pid_);
249 } 248 }
250 return EvaluateSyscallImpl(fs_denied_errno_, current_pid_, sysno); 249 return EvaluateSyscallImpl(fs_denied_errno_, current_pid_, sysno);
251 } 250 }
252 251
253 ResultExpr BaselinePolicy::InvalidSyscall() const { 252 ResultExpr BaselinePolicy::InvalidSyscall() const {
254 return CrashSIGSYS(); 253 return CrashSIGSYS();
255 } 254 }
256 255
257 } // namespace sandbox. 256 } // namespace sandbox.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698