diff options
Diffstat (limited to 'community/qt5-qtwebengine/musl-sandbox.patch')
-rw-r--r-- | community/qt5-qtwebengine/musl-sandbox.patch | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/community/qt5-qtwebengine/musl-sandbox.patch b/community/qt5-qtwebengine/musl-sandbox.patch index 45e3d9336e..ad64fae921 100644 --- a/community/qt5-qtwebengine/musl-sandbox.patch +++ b/community/qt5-qtwebengine/musl-sandbox.patch @@ -1,17 +1,12 @@ diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc -index 2577f02..b27300c 100644 +index 348ab6e8c..2eac6ef82 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc -@@ -129,23 +129,13 @@ namespace sandbox { - // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations. +@@ -139,21 +139,11 @@ namespace sandbox { + // present (as in newer versions of posix_spawn). 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 | @@ -26,17 +21,28 @@ index 2577f02..b27300c 100644 - const BoolExpr android_test = - AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask, - flags == kGlibcPthreadFlags); -- ++ 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; + + // The following two flags are the two important flags in any vfork-emulating + // clone call. EPERM any clone call that contains both of them. +@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() { + AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0, + (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags); + - return If(IsAndroid() ? android_test : glibc_test, Allow()) + return If(thread_clone_ok, Allow()) - .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM)) + .ElseIf(is_fork_or_clone_vfork, Error(EPERM)) .Else(CrashSIGSYSClone()); } diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc -index 9f1cdef..a2d703b 100644 +index 6e2bd4fee..9f9e4ad8a 100644 --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc -@@ -375,6 +375,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { +@@ -392,6 +392,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { #if defined(__i386__) case __NR_waitpid: #endif @@ -44,7 +50,7 @@ index 9f1cdef..a2d703b 100644 return true; case __NR_clone: // Should be parameter-restricted. case __NR_setns: // Privileged. -@@ -387,7 +388,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { +@@ -404,7 +405,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) case __NR_set_thread_area: #endif @@ -52,7 +58,7 @@ index 9f1cdef..a2d703b 100644 case __NR_unshare: #if !defined(__mips__) && !defined(__aarch64__) case __NR_vfork: -@@ -496,6 +496,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { +@@ -514,6 +514,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { case __NR_mlock: case __NR_munlock: case __NR_munmap: @@ -61,7 +67,7 @@ index 9f1cdef..a2d703b 100644 return true; case __NR_madvise: case __NR_mincore: -@@ -511,7 +513,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { +@@ -531,7 +533,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { case __NR_modify_ldt: #endif case __NR_mprotect: @@ -70,7 +76,7 @@ index 9f1cdef..a2d703b 100644 case __NR_munlockall: case __NR_readahead: diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/arm64_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/arm64_linux_syscalls.h -index 59d0eab..7ae7002 100644 +index 59d0eab8e..7ae700213 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/arm64_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/arm64_linux_syscalls.h @@ -1063,4 +1063,8 @@ @@ -83,22 +89,23 @@ index 59d0eab..7ae7002 100644 + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_ diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h -index 1addd53..7843b5e 100644 +index 1addd5384..d8811ce87 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h -@@ -1385,6 +1385,10 @@ +@@ -1385,6 +1385,11 @@ #define __NR_memfd_create (__NR_SYSCALL_BASE+385) #endif +#if !defined(__NR_membarrier) -+#define __NR_membarrier (__NR_SYSCALL_BASE+389) ++#define __NR_membarrier (__NR_SYSCALL_BASE+389)) +#endif + ++ // ARM private syscalls. #if !defined(__ARM_NR_BASE) #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000) diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/mips64_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/mips64_linux_syscalls.h -index ec75815..612fcfa 100644 +index ec75815a8..612fcfaa9 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/mips64_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/mips64_linux_syscalls.h @@ -1271,4 +1271,8 @@ @@ -111,7 +118,7 @@ index ec75815..612fcfa 100644 + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_ diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h -index ddbf97f..1742acd 100644 +index ddbf97f3d..1742acd4c 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h @@ -1433,4 +1433,8 @@ @@ -124,10 +131,10 @@ index ddbf97f..1742acd 100644 + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_ diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/x86_32_linux_syscalls.h -index a6afc62..7ed0a3b 100644 +index a6afc62d9..6ab7740de 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/x86_32_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/x86_32_linux_syscalls.h -@@ -1422,5 +1422,9 @@ +@@ -1422,5 +1422,10 @@ #define __NR_memfd_create 356 #endif @@ -135,13 +142,14 @@ index a6afc62..7ed0a3b 100644 +#define __NR_membarrier 375 +#endif + ++ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_ diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/x86_64_linux_syscalls.h -index 349504a..ea3c7c9 100644 +index 349504aee..6a6d4756f 100644 --- a/src/3rdparty/chromium/sandbox/linux/system_headers/x86_64_linux_syscalls.h +++ b/src/3rdparty/chromium/sandbox/linux/system_headers/x86_64_linux_syscalls.h -@@ -1290,5 +1290,9 @@ +@@ -1290,5 +1290,10 @@ #define __NR_memfd_create 319 #endif @@ -149,5 +157,6 @@ index 349504a..ea3c7c9 100644 +#define __NR_membarrier 324 +#endif + ++ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_ |