aboutsummaryrefslogtreecommitdiffstats
path: root/testing/chromium/musl-sandbox.patch
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-07-09 16:49:42 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2015-07-09 16:52:32 +0200
commitcc6c17a85095cd71cd581de3195b65bd264726ae (patch)
treeab601a313068d71c4be6d424964e23c3e009f0e9 /testing/chromium/musl-sandbox.patch
parent39a731b6e965237ea12617bf41e4610d8b0eddf1 (diff)
downloadaports-cc6c17a85095cd71cd581de3195b65bd264726ae.tar.bz2
aports-cc6c17a85095cd71cd581de3195b65bd264726ae.tar.xz
testing/chromium: fix sandbox mode
Diffstat (limited to 'testing/chromium/musl-sandbox.patch')
-rw-r--r--testing/chromium/musl-sandbox.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/chromium/musl-sandbox.patch b/testing/chromium/musl-sandbox.patch
new file mode 100644
index 0000000000..ef69e550dc
--- /dev/null
+++ b/testing/chromium/musl-sandbox.patch
@@ -0,0 +1,48 @@
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.cld
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -111,23 +111,13 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test = flags == kAndroidCloneMask ||
+- flags == kObsoleteAndroidCloneMask ||
+- flags == kGlibcPthreadFlags;
+-
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc.orig
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -416,12 +416,12 @@
+ #endif
+ case __NR_epoll_create1:
+ case __NR_epoll_ctl:
++ case __NR_epoll_pwait:
+ return true;
+ default:
+ #if defined(__x86_64__)
+ case __NR_epoll_ctl_old:
+ #endif
+- case __NR_epoll_pwait:
+ #if defined(__x86_64__)
+ case __NR_epoll_wait_old:
+ #endif