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

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

Issue 487143003: sandbox: Add Arm64 support for seccomp-BPF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review changes Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/sandbox_linux.gypi ('k') | sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
index 1a6bec503fcfc5124bc4d778af0bc38c31486043..05cef744720f95d33e3cad8da7a40117dde53688 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -120,6 +120,13 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
return Allow();
}
+#if defined(__aarch64__)
+ // These are needed for thread creation.
+ // TODO(leecam): Check jln's fix for this and remove these 'allows'.
+ if (sysno == __NR_sigaltstack || sysno == __NR_setpriority)
+ return Allow();
+#endif
+
if (sysno == __NR_clone) {
return RestrictCloneToThreadsAndEPERMFork();
}
@@ -132,11 +139,13 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
return RestrictFcntlCommands();
#endif
+#if !defined(__aarch64__)
// fork() is never used as a system call (clone() is used instead), but we
// have seen it in fallback code on Android.
if (sysno == __NR_fork) {
return Error(EPERM);
}
+#endif
if (sysno == __NR_futex)
return RestrictFutex();
@@ -147,7 +156,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
return If(advice == MADV_DONTNEED, Allow()).Else(Error(EPERM));
}
-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
+ defined(__aarch64__)
if (sysno == __NR_mmap)
return RestrictMmapFlags();
#endif
@@ -163,7 +173,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
if (sysno == __NR_prctl)
return sandbox::RestrictPrctl();
-#if defined(__x86_64__) || defined(__arm__) || defined(__mips__)
+#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
+ defined(__aarch64__)
if (sysno == __NR_socketpair) {
// Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen.
COMPILE_ASSERT(AF_UNIX == PF_UNIX, af_unix_pf_unix_different);
« no previous file with comments | « sandbox/linux/sandbox_linux.gypi ('k') | sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698