Skip to contentSkip to conversation

qtwebengine: replace patch with chromium flags

PATCH In review Vivien Didelot 2 participants 4 messages Oct 6, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qtwebengine: replace patch with chromium flags

Instead of maintaining an inappropriate hack on qtwebengine to disable seccomp filter sandbox, export the corresponding chromium flag in the QTWEBENGINE_CHROMIUM_FLAGS environment variable.

---
 .../qt5/qtbase-conf/ti33x/qt_env.sh           |  5 +++
 ...-disable-SECCOMP-BPF-Sandbox-at-star.patch | 32 -------------------
 .../recipes-qt/qt5/qtwebengine_git.bbappend   |  4 ---
 3 files changed, 5 insertions(+), 36 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch
meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh +5 -0
index 29fa2969..96526393 100644
@@ -7,3 +7,8 @@ export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json
 export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
 export QT_QPA_EGLFS_ALWAYS_SET_MODE=1
 export QT_WAYLAND_SHELL_INTEGRATION=wl-shell
+
+# SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
+# from the pthread implementation. Disable this feature temporarily until
+# those issues are resolved.
+export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"
meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch deleted +0 -32
deleted file mode 100644
index 09f1870d..00000000
@@ -1,32 +0,0 @@
-From 77fc6e4391562a1f84d82b58319a73de08242797 Mon Sep 17 00:00:00 2001
-From: Eric Ruei <[email protected]>
-Date: Fri, 8 Mar 2019 18:17:06 -0500
-Subject: [PATCH 3/3] qtwebengine: HACK: disable SECCOMP-BPF Sandbox at startup
-
-SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
-from the pthread implementation
-Disable this feature temporarily until those issues are resolved.
-
-Upstream-Status: Inappropriate [HACK]
-
-Signed-off-by: Eric Ruei <[email protected]>
----
- src/core/web_engine_context.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
-index 48e5bc4..9ba3fa4 100644
---- a/src/core/web_engine_context.cpp
-+++ b/src/core/web_engine_context.cpp
-@@ -347,6 +347,8 @@ WebEngineContext::WebEngineContext()
-         parsedCommandLine->AppendSwitch(switches::kNoSandbox);
- #elif defined(Q_OS_LINUX)
-         parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSetuidSandbox);
-+        // HACK: disable seccomp filter sandbox for now because it does not work
-+        parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSeccompFilterSandbox);
- #endif
-     } else {
-         parsedCommandLine->AppendSwitch(switches::kNoSandbox);
--- 
-1.9.1
-
meta-arago-distro/recipes-qt/qt5/qtwebengine_git.bbappend +0 -4
index c50b020f..6459bbf7 100644
@@ -1,8 +1,4 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 PR_append = ".arago1"
 
-SRC_URI += " \
-    file://0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch \
-"
-
 DEPENDS += "bison-native"
Signature · 1 line
2.33.0
#1 lore raw
Quoted 17 lines · Vivien Didelot

Instead of maintaining an inappropriate hack on qtwebengine to disable seccomp filter sandbox, export the corresponding chromium flag in the QTWEBENGINE_CHROMIUM_FLAGS environment variable.

---
 .../qt5/qtbase-conf/ti33x/qt_env.sh           |  5 +++
 ...-disable-SECCOMP-BPF-Sandbox-at-star.patch | 32 -------------------
 .../recipes-qt/qt5/qtwebengine_git.bbappend   |  4 ---
 3 files changed, 5 insertions(+), 36 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch
meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh +0 -0
index 29fa2969..96526393 100644

meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json · line 14

Quoted 8 lines
meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh +5 -0
@@ -7,3 +7,8 @@ export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json
 export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
 export QT_QPA_EGLFS_ALWAYS_SET_MODE=1
 export QT_WAYLAND_SHELL_INTEGRATION=wl-shell
+
+# SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
+# from the pthread implementation. Disable this feature temporarily until
+# those issues are resolved.
+export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"

Why is this only done for ti33x platform? What about other platforms?

Quoted 53 lines
meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch deleted +0 -32
deleted file mode 100644
index 09f1870d..00000000
@@ -1,32 +0,0 @@
-From 77fc6e4391562a1f84d82b58319a73de08242797 Mon Sep 17 00:00:00 2001
-From: Eric Ruei <[email protected]>
-Date: Fri, 8 Mar 2019 18:17:06 -0500
-Subject: [PATCH 3/3] qtwebengine: HACK: disable SECCOMP-BPF Sandbox at startup
-
-SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
-from the pthread implementation
-Disable this feature temporarily until those issues are resolved.
-
-Upstream-Status: Inappropriate [HACK]
-
-Signed-off-by: Eric Ruei <[email protected]>
----
- src/core/web_engine_context.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
-index 48e5bc4..9ba3fa4 100644
---- a/src/core/web_engine_context.cpp
-+++ b/src/core/web_engine_context.cpp
-@@ -347,6 +347,8 @@ WebEngineContext::WebEngineContext()
-         parsedCommandLine->AppendSwitch(switches::kNoSandbox);
- #elif defined(Q_OS_LINUX)
-         parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSetuidSandbox);
-+        // HACK: disable seccomp filter sandbox for now because it does not work
-+        parsedCommandLine->AppendSwitch(service_manager::switches::kDisableSeccompFilterSandbox);
- #endif
-     } else {
-         parsedCommandLine->AppendSwitch(switches::kNoSandbox);
--- 
-1.9.1
-
meta-arago-distro/recipes-qt/qt5/qtwebengine_git.bbappend +0 -4
index c50b020f..6459bbf7 100644
@@ -1,8 +1,4 @@
 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 PR_append = ".arago1"
 
-SRC_URI += " \
-    file://0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch \
-"
-
 DEPENDS += "bison-native"
Signature · 1 line
2.33.0
Signature · 4 lines
Regards,
Denys Dmytriyenko <[email protected]>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964
#2 lore raw

Hi Denys,

Quoted 13 lines · On Wed, 06 Oct 2021 19:19:56 -0400 Denys Dmytriyenko <[email protected]> wrote:
Quoted 12 lines · Vivien Didelot

Instead of maintaining an inappropriate hack on qtwebengine to disable seccomp filter sandbox, export the corresponding chromium flag in the QTWEBENGINE_CHROMIUM_FLAGS environment variable.

---
 .../qt5/qtbase-conf/ti33x/qt_env.sh           |  5 +++
 ...-disable-SECCOMP-BPF-Sandbox-at-star.patch | 32 -------------------
 .../recipes-qt/qt5/qtwebengine_git.bbappend   |  4 ---
 3 files changed, 5 insertions(+), 36 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch
Quoted 15 lines

meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json · line 14

Quoted 13 lines
meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh +5 -0
index 29fa2969..96526393 100644
@@ -7,3 +7,8 @@ export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json
 export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
 export QT_QPA_EGLFS_ALWAYS_SET_MODE=1
 export QT_WAYLAND_SHELL_INTEGRATION=wl-shell
+
+# SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
+# from the pthread implementation. Disable this feature temporarily until
+# those issues are resolved.
+export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"

Why is this only done for ti33x platform? What about other platforms?

Good catch! Should I bbappend the qtwebengine recipe instead to deploy a new qtwebengine_env.sh file containing QTWEBENGINE_CHROMIUM_FLAGS?

Thanks,

Vivien

#3 lore raw
Quoted 32 lines · Vivien Didelot

Hi Denys,

Quoted 13 lines · On Wed, 06 Oct 2021 19:19:56 -0400 Denys Dmytriyenko <[email protected]> wrote:
Quoted 12 lines · Vivien Didelot

Instead of maintaining an inappropriate hack on qtwebengine to disable seccomp filter sandbox, export the corresponding chromium flag in the QTWEBENGINE_CHROMIUM_FLAGS environment variable.

---
 .../qt5/qtbase-conf/ti33x/qt_env.sh           |  5 +++
 ...-disable-SECCOMP-BPF-Sandbox-at-star.patch | 32 -------------------
 .../recipes-qt/qt5/qtwebengine_git.bbappend   |  4 ---
 3 files changed, 5 insertions(+), 36 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-qt/qt5/qtwebengine/0003-qtwebengine-HACK-disable-SECCOMP-BPF-Sandbox-at-star.patch
Quoted 15 lines

meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json · line 14

Quoted 13 lines
meta-arago-distro/recipes-qt/qt5/qtbase-conf/ti33x/qt_env.sh +5 -0
index 29fa2969..96526393 100644
@@ -7,3 +7,8 @@ export QT_QPA_EGLFS_KMS_CONFIG=/etc/qt5/eglfs_kms_cfg.json
 export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
 export QT_QPA_EGLFS_ALWAYS_SET_MODE=1
 export QT_WAYLAND_SHELL_INTEGRATION=wl-shell
+
+# SECCOMP-BPF Sandbox does not work due to unexpected FUTEX_UNLOCK_PI call
+# from the pthread implementation. Disable this feature temporarily until
+# those issues are resolved.
+export QTWEBENGINE_CHROMIUM_FLAGS="--disable-seccomp-filter-sandbox"

Why is this only done for ti33x platform? What about other platforms?

Quoted 2 lines

Good catch! Should I bbappend the qtwebengine recipe instead to deploy a new qtwebengine_env.sh file containing QTWEBENGINE_CHROMIUM_FLAGS?

Can you add to both qt_env.sh files - generic and ti33x specific?

Signature · 4 lines
Regards,
Denys Dmytriyenko <[email protected]>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186  6D76 4209 0272 9A92 C964