From 8f7f959da3ea185ef74ef9d89499aae8039c0c4a Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Sat, 23 Jan 2021 23:31:04 +0100 Subject: [PATCH] Fix sandbox issue on 32-bit architectures with glibc >= 2.31 (from Debian) * Sat Jan 23 2021 Kevin Kofler - 5.15.2-7 - Fix sandbox issue on 32-bit architectures with glibc >= 2.31 (from Debian) Unlike the other sandbox fix, this one also affects stable Fedora releases, but it affects only 32-bit architectures such as armv7hl or the i386 multilib, not 64-bit architectures such as x86_64 or aarch64. --- qt5-qtwebengine.spec | 10 ++- ...e-src-5.15.2-sandbox-time64-syscalls.patch | 89 +++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 qtwebengine-everywhere-src-5.15.2-sandbox-time64-syscalls.patch diff --git a/qt5-qtwebengine.spec b/qt5-qtwebengine.spec index df8a719..400e25c 100644 --- a/qt5-qtwebengine.spec +++ b/qt5-qtwebengine.spec @@ -53,7 +53,7 @@ Summary: Qt5 - QtWebEngine components Name: qt5-qtwebengine Version: 5.15.2 -Release: 6%{?dist} +Release: 7%{?dist} # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details # See also http://qt-project.org/doc/qt-5.0/qtdoc/licensing.html @@ -101,8 +101,10 @@ Patch24: qtwebengine-everywhere-src-5.11.3-aarch64-new-stat.patch Patch26: qtwebengine-everywhere-5.13.2-use-python2.patch # Missing #includes for gcc-11 Patch27: qtwebengine-gcc11.patch -# Fix sandbox issue breaking text rendering with glibc 2.33 (#1904652) +# Fix sandbox issue breaking text rendering with glibc >= 2.33 (#1904652) Patch28: qtwebengine-everywhere-src-5.15.2-#1904652.patch +# Fix sandbox issue on 32-bit architectures with glibc >= 2.31 (from Debian) +Patch29: qtwebengine-everywhere-src-5.15.2-sandbox-time64-syscalls.patch ## Upstream patches: @@ -406,6 +408,7 @@ popd %patch26 -p1 -b .use-python2 %patch27 -p1 -b .gcc11 %patch28 -p1 -b .rh#1904652 +%patch29 -p1 -b .sandbox-time64-syscalls # the xkbcommon config/feature was renamed in 5.12, so need to adjust QT_CONFIG references # when building on older Qt releases @@ -636,6 +639,9 @@ done %changelog +* Sat Jan 23 2021 Kevin Kofler - 5.15.2-7 +- Fix sandbox issue on 32-bit architectures with glibc >= 2.31 (from Debian) + * Sat Jan 23 2021 Kevin Kofler - 5.15.2-6 - Reenable system ICU on F33+, ICU 67 supported since 5.15.1 according to Debian diff --git a/qtwebengine-everywhere-src-5.15.2-sandbox-time64-syscalls.patch b/qtwebengine-everywhere-src-5.15.2-sandbox-time64-syscalls.patch new file mode 100644 index 0000000..6a98dd4 --- /dev/null +++ b/qtwebengine-everywhere-src-5.15.2-sandbox-time64-syscalls.patch @@ -0,0 +1,89 @@ +Description: fix seccomp-bpf failures in syscalls 0403, 0407 + glibc ≥ 2.31 uses these syscalls on 32-bit platforms: + . + - https://sourceware.org/git/?p=glibc.git;a=commit;h=2e44b10b42d68d98 + - https://sourceware.org/git/?p=glibc.git;a=commit;h=ec138c67cbda8b58 +Author: Andreas Müller +Forwarded: no +Last-Update: 2020-09-02 + +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +@@ -148,7 +148,14 @@ ResultExpr EvaluateSyscallImpl(int fs_de + return Allow(); + #endif + +- if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep) { ++ if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep ++#if defined(__NR_clock_gettime64) ++ || sysno == __NR_clock_gettime64 ++#endif ++#if defined(__NR_clock_nanosleep_time64) ++ || sysno == __NR_clock_nanosleep_time64 ++#endif ++ ) { + return RestrictClockID(); + } + +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc +@@ -60,6 +60,12 @@ class RestrictClockIdPolicy : public bpf + case __NR_clock_gettime: + case __NR_clock_getres: + case __NR_clock_nanosleep: ++#if defined(__NR_clock_nanosleep_time64) ++ case __NR_clock_nanosleep_time64: ++#endif ++#if defined(__NR_clock_gettime64) ++ case __NR_clock_gettime64: ++#endif + return RestrictClockID(); + default: + return Allow(); +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -39,6 +39,12 @@ bool SyscallSets::IsAllowedGettime(int s + // filtered by RestrictClokID(). + case __NR_clock_gettime: // Parameters filtered by RestrictClockID(). + case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID(). ++#if defined(__NR_clock_gettime64) ++ case __NR_clock_gettime64: // Parameters filtered by RestrictClockID(). ++#endif ++#if defined(__NR_clock_nanosleep_time64) ++ case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID(). ++#endif + case __NR_clock_settime: // Privileged. + #if defined(__i386__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) +--- 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,14 @@ + #define __NR_memfd_create (__NR_SYSCALL_BASE+385) + #endif + ++#if !defined(__NR_clock_gettime64) ++#define __NR_clock_gettime64 (__NR_SYSCALL_BASE+403) ++#endif ++ ++#if !defined(__NR_clock_nanosleep_time64) ++#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE+407) ++#endif ++ + // ARM private syscalls. + #if !defined(__ARM_NR_BASE) + #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000) +--- 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,12 @@ + #define __NR_memfd_create (__NR_Linux + 354) + #endif + ++#if !defined(__NR_clock_gettime64) ++#define __NR_clock_gettime64 (__NR_Linux + 403) ++#endif ++ ++#if !defined(__NR_clock_nanosleep_time64) ++#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) ++#endif ++ + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_