diff options
author | Andreas Müller <schnitzeltony@gmail.com> | 2020-09-07 00:06:32 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2020-09-08 09:47:02 +0200 |
commit | afcde8567252191820ed07abcc241f3794b75988 (patch) | |
tree | 097720e658d4827d161b8d00a744046d0d9c3303 /recipes-qt/qt5/qtwebengine | |
parent | 761949d22ca5b280447a9e6796a2dd070c8479d8 (diff) | |
download | meta-qt5-afcde8567252191820ed07abcc241f3794b75988.tar.gz |
qtwebengine: Fix sandbox freeze for glibc >= 2.31 on 32 bit systems
* patch was taken from meta-browser. The only modification done was adding the
error seen
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qtwebengine')
-rw-r--r-- | recipes-qt/qt5/qtwebengine/chromium/0014-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtwebengine/chromium/0014-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch b/recipes-qt/qt5/qtwebengine/chromium/0014-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch new file mode 100644 index 00000000..1f4cb36c --- /dev/null +++ b/recipes-qt/qt5/qtwebengine/chromium/0014-Fix-sandbox-Aw-snap-for-syscalls-403-and-407.patch | |||
@@ -0,0 +1,141 @@ | |||
1 | From 18d864774916865ec44ccd011a4caf730943f0e9 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com> | ||
3 | Date: Mon, 20 Apr 2020 23:56:48 +0200 | ||
4 | Subject: [PATCH] Fix sandbox 'Aw, snap' for syscalls 403 and 407 | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Taken as is from meta-browser. Saw my application freeze for syscall 0407 | ||
10 | trouble: | ||
11 | |||
12 | | ../../../../git/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc:**CRASHING**:seccomp-bpf failure in syscall 0407 | ||
13 | |||
14 | Original commit message: | ||
15 | |||
16 | * syscall 403: reported by ArchLinux users [1-2] | ||
17 | * syscall 407: reported by me [3] | ||
18 | |||
19 | Looking at [4-5] it seems that glibc (>=2.31?) introduced extra syscalls for | ||
20 | 32Bit systems to handle time64: | ||
21 | |||
22 | * __NR_clock_gettime -> __NR_clock_gettime64 | ||
23 | * __NR_clock_nanosleep -> __NR_clock_nanosleep_time64 | ||
24 | |||
25 | To 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 | |||
29 | we handle new systemcalls in the same way as 64bit systems do and 32bit systems | ||
30 | did 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 | |||
38 | Upstream Status: Pending [Have no idea where to send this] | ||
39 | |||
40 | Signed-off-by: Andreas Müller <schnitzeltony@gmail.com> | ||
41 | --- | ||
42 | sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | 9 ++++++++- | ||
43 | .../syscall_parameters_restrictions_unittests.cc | 6 ++++++ | ||
44 | sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | 6 ++++++ | ||
45 | sandbox/linux/system_headers/arm_linux_syscalls.h | 8 ++++++++ | ||
46 | sandbox/linux/system_headers/mips_linux_syscalls.h | 8 ++++++++ | ||
47 | 5 files changed, 36 insertions(+), 1 deletion(-) | ||
48 | |||
49 | diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | ||
50 | index 768025ce1..87025d917 100644 | ||
51 | --- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | ||
52 | +++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc | ||
53 | @@ -148,7 +148,14 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, | ||
54 | return Allow(); | ||
55 | #endif | ||
56 | |||
57 | - if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep) { | ||
58 | + if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep | ||
59 | +#if defined(__NR_clock_gettime64) | ||
60 | + || sysno == __NR_clock_gettime64 | ||
61 | +#endif | ||
62 | +#if defined(__NR_clock_nanosleep_time64) | ||
63 | + || sysno == __NR_clock_nanosleep_time64 | ||
64 | +#endif | ||
65 | + ) { | ||
66 | return RestrictClockID(); | ||
67 | } | ||
68 | |||
69 | diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc | ||
70 | index b6c8c6377..245bc7131 100644 | ||
71 | --- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc | ||
72 | +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc | ||
73 | @@ -60,6 +60,12 @@ class RestrictClockIdPolicy : public bpf_dsl::Policy { | ||
74 | case __NR_clock_gettime: | ||
75 | case __NR_clock_getres: | ||
76 | case __NR_clock_nanosleep: | ||
77 | +#if defined(__NR_clock_nanosleep_time64) | ||
78 | + case __NR_clock_nanosleep_time64: | ||
79 | +#endif | ||
80 | +#if defined(__NR_clock_gettime64) | ||
81 | + case __NR_clock_gettime64: | ||
82 | +#endif | ||
83 | return RestrictClockID(); | ||
84 | default: | ||
85 | return Allow(); | ||
86 | diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | ||
87 | index d9d18822f..8bc262235 100644 | ||
88 | --- a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | ||
89 | +++ b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc | ||
90 | @@ -39,6 +39,12 @@ bool SyscallSets::IsAllowedGettime(int sysno) { | ||
91 | // filtered by RestrictClokID(). | ||
92 | case __NR_clock_gettime: // Parameters filtered by RestrictClockID(). | ||
93 | case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID(). | ||
94 | +#if defined(__NR_clock_gettime64) | ||
95 | + case __NR_clock_gettime64: // Parameters filtered by RestrictClockID(). | ||
96 | +#endif | ||
97 | +#if defined(__NR_clock_nanosleep_time64) | ||
98 | + case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID(). | ||
99 | +#endif | ||
100 | case __NR_clock_settime: // Privileged. | ||
101 | #if defined(__i386__) || \ | ||
102 | (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) | ||
103 | diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h | ||
104 | index 1addd5384..5de2162f9 100644 | ||
105 | --- a/sandbox/linux/system_headers/arm_linux_syscalls.h | ||
106 | +++ b/sandbox/linux/system_headers/arm_linux_syscalls.h | ||
107 | @@ -1385,6 +1385,14 @@ | ||
108 | #define __NR_memfd_create (__NR_SYSCALL_BASE+385) | ||
109 | #endif | ||
110 | |||
111 | +#if !defined(__NR_clock_gettime64) | ||
112 | +#define __NR_clock_gettime64 (__NR_SYSCALL_BASE+403) | ||
113 | +#endif | ||
114 | + | ||
115 | +#if !defined(__NR_clock_nanosleep_time64) | ||
116 | +#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE+407) | ||
117 | +#endif | ||
118 | + | ||
119 | // ARM private syscalls. | ||
120 | #if !defined(__ARM_NR_BASE) | ||
121 | #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000) | ||
122 | diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h b/sandbox/linux/system_headers/mips_linux_syscalls.h | ||
123 | index ddbf97f3d..fa01b3bbc 100644 | ||
124 | --- a/sandbox/linux/system_headers/mips_linux_syscalls.h | ||
125 | +++ b/sandbox/linux/system_headers/mips_linux_syscalls.h | ||
126 | @@ -1433,4 +1433,12 @@ | ||
127 | #define __NR_memfd_create (__NR_Linux + 354) | ||
128 | #endif | ||
129 | |||
130 | +#if !defined(__NR_clock_gettime64) | ||
131 | +#define __NR_clock_gettime64 (__NR_Linux + 403) | ||
132 | +#endif | ||
133 | + | ||
134 | +#if !defined(__NR_clock_nanosleep_time64) | ||
135 | +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) | ||
136 | +#endif | ||
137 | + | ||
138 | #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_ | ||
139 | -- | ||
140 | 2.21.1 | ||
141 | |||