summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch')
-rw-r--r--recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch139
1 files changed, 0 insertions, 139 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch b/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch
deleted file mode 100644
index 7708a4c0..00000000
--- a/recipes-qt/qt5/qtwebengine/chromium/0014-chromium-Fix-sandbox-Aw-snap-for-syscalls-403-and-40.patch
+++ /dev/null
@@ -1,139 +0,0 @@
1From d073427b25915e1784c3d74296b68fef0076ceb0 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
3Date: Mon, 20 Apr 2020 23:56:48 +0200
4Subject: [PATCH] chromium: Fix sandbox 'Aw, snap' for syscalls 403 and 407
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9Taken as is from meta-browser. Saw my application freeze for syscall 0407
10trouble:
11
12| ../../../../git/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0407
13
14Original commit message:
15
16* syscall 403: reported by ArchLinux users [1-2]
17* syscall 407: reported by me [3]
18
19Looking at [4-5] it seems that glibc (>=2.31?) introduced extra syscalls for
2032Bit systems to handle time64:
21
22* __NR_clock_gettime -> __NR_clock_gettime64
23* __NR_clock_nanosleep -> __NR_clock_nanosleep_time64
24
25To fix
26| ../../sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0403
27| ../../sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0407
28
29we handle new systemcalls in the same way as 64bit systems do and 32bit systems
30did before glibc 2.31.
31
32[1] https://bugs.archlinux32.org/index.php?do=details&task_id=105
33[2] https://bbs.archlinux32.org/viewtopic.php?id=2897
34[3] https://github.com/OSSystems/meta-browser/issues/357
35[4] https://sourceware.org/git/?p=glibc.git;a=commit;h=2e44b10b42d68d9887ccab17b76db5d7bbae4fb6
36[5] https://github.com/bminor/glibc/blob/019d828669df966dc4ef2684fce0b1c17bef9aae/sysdeps/unix/sysv/linux/clock_gettime.c#L30
37
38Upstream Status: Pending [Have no idea where to send this]
39
40Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
41Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
42---
43 .../sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | 9 ++++++++-
44 .../syscall_parameters_restrictions_unittests.cc | 6 ++++++
45 .../sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | 6 ++++++
46 .../sandbox/linux/system_headers/arm_linux_syscalls.h | 8 ++++++++
47 .../sandbox/linux/system_headers/mips_linux_syscalls.h | 8 ++++++++
48 5 files changed, 36 insertions(+), 1 deletion(-)
49
50diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
51index 712f9699a94..2a80dd2d2b3 100644
52--- a/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
53+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
54@@ -148,7 +148,14 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
55 return Allow();
56 #endif
57
58- if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep) {
59+ if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep
60+#if defined(__NR_clock_gettime64)
61+ || sysno == __NR_clock_gettime64
62+#endif
63+#if defined(__NR_clock_nanosleep_time64)
64+ || sysno == __NR_clock_nanosleep_time64
65+#endif
66+ ) {
67 return RestrictClockID();
68 }
69
70diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
71index b6c8c637746..81972a9d998 100644
72--- a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
73+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
74@@ -60,6 +60,12 @@ class RestrictClockIdPolicy : public bpf_dsl::Policy {
75 case __NR_clock_gettime:
76 case __NR_clock_getres:
77 case __NR_clock_nanosleep:
78+#if defined(__NR_clock_nanosleep_time64)
79+ case __NR_clock_nanosleep_time64:
80+#endif
81+#if defined(__NR_clock_gettime64)
82+ case __NR_clock_gettime64:
83+#endif
84 return RestrictClockID();
85 default:
86 return Allow();
87diff --git a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
88index d9d18822f67..0db8745cb57 100644
89--- a/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
90+++ b/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
91@@ -39,6 +39,12 @@ bool SyscallSets::IsAllowedGettime(int sysno) {
92 // filtered by RestrictClokID().
93 case __NR_clock_gettime: // Parameters filtered by RestrictClockID().
94 case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID().
95+#if defined(__NR_clock_gettime64)
96+ case __NR_clock_gettime64: // Parameters filtered by RestrictClockID().
97+#endif
98+#if defined(__NR_clock_nanosleep_time64)
99+ case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID().
100+#endif
101 case __NR_clock_settime: // Privileged.
102 #if defined(__i386__) || \
103 (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
104diff --git a/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h b/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
105index 1addd53843c..5de2162f981 100644
106--- a/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
107+++ b/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h
108@@ -1385,6 +1385,14 @@
109 #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
110 #endif
111
112+#if !defined(__NR_clock_gettime64)
113+#define __NR_clock_gettime64 (__NR_SYSCALL_BASE+403)
114+#endif
115+
116+#if !defined(__NR_clock_nanosleep_time64)
117+#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE+407)
118+#endif
119+
120 // ARM private syscalls.
121 #if !defined(__ARM_NR_BASE)
122 #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
123diff --git a/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h b/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
124index ddbf97f3d8b..fa01b3bbc66 100644
125--- a/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
126+++ b/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h
127@@ -1433,4 +1433,12 @@
128 #define __NR_memfd_create (__NR_Linux + 354)
129 #endif
130
131+#if !defined(__NR_clock_gettime64)
132+#define __NR_clock_gettime64 (__NR_Linux + 403)
133+#endif
134+
135+#if !defined(__NR_clock_nanosleep_time64)
136+#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
137+#endif
138+
139 #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_