Summary: | SELinux is preventing /app/bin/krita from execmod access on the file /memfd:JITCode:/app/lib/libQt5Qml.so.5 | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Timothée Ravier <tim> |
Component: | General | Assignee: | amyspark <amy> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | amy, halla, hi |
Priority: | NOR | ||
Version: | 5.1.1 | ||
Target Milestone: | --- | ||
Platform: | Flatpak | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/krita/commit/0ae8ecb44487a3aaa27a7dea30eb67fe65e076af | Version Fixed In: | |
Sentry Crash Report: |
Description
Timothée Ravier
2022-09-21 13:25:52 UTC
Might be related to https://bugzilla.redhat.com/show_bug.cgi?id=1686675. Might be related to the fact that Krita in Flathub uses an old Qt version. Honestly, I have no idea what all of this means... The flathub reports says this should be reported to us, but what are we supposed to do? As shown in the official Qt bug report (https://bugreports.qt.io/browse/QTBUG-58508), this should have been fixed in the Qt side in 5.11. We're definitely not doing anything except use Qt QML ourselves. I don't know if this should be marked as RESOLVED UPSTREAM, since the Flathub package clearly isn't of our own authorship. Halla? Yeah, I'm not sure either... Upstream (if it's an issue in Qt) or downstream (if it's an issue in flatpak, but the flatpak people told Timothée to report here). But I don't see what _we_ can do about this... One of the commenters mentioned on the issue it also occurred for them using the AppImage on AlmaLinux 9 https://github.com/flathub/org.kde.krita/issues/66#issuecomment-1252893268 Does AlmaLinux also have SELinux enabled by default? Hm, a better question is: if you run Krita under SELinux with Qt 5.15, does it show the issue? (In reply to amyspark from comment #6) > Does AlmaLinux also have SELinux enabled by default? Yes, I spun up AlmaLinux 9 on a VM and can repo the issue mentioned there using the AppImage. I can also verify SELinux is enabled out of the box. I'm not sure if the policy shipped by AlmaLinux and CentOS differ from the Fedora ones as Fedora works fine. SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed Memory protection checking: actual (secure) Max kernel policy version: 33 > Hm, a better question is: if you run Krita under SELinux with Qt 5.15, does it show the issue? Is there a AppImage of Krita using Qt 5.15 for testing? The distro repos don't seem to include Krita. There's no 5.15 AppImage as it's a Qt version we don't support it officially. But I think I found the reason for this issue, Qt truly fixed their JIT much later: https://codereview.qt-project.org/c/qt/qtdeclarative/+/329522 Unfortunately it's a mix of three different Qt branches, which makes it a royal mess to cherry-pick safely. I've got the branch ready, will try to build it tomorrow. Sending the draft MR just in case. A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1592 Okay, so someone needs to build and test this; I don't think any Krita developer that uses Linux uses selinux. I'm the one that asked for it to be reported here as Krita is not using the same version of Qt as everyone else so we can not just update it without your input. Thanks for the investigation. I attempted a build with the patches from the MR, getting this error currently. jsruntime/qv4function.cpp:49:10: fatal error: private/qv4functiontable_p.h: No such file or directory 49 | #include <private/qv4functiontable_p.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:11117: .obj/qv4function.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/run/build/qtdeclarative/src/qml' make[1]: *** [Makefile:56: sub-qml-make_first-ordered] Error 2 make[1]: Leaving directory '/run/build/qtdeclarative/src' make: *** [Makefile:50: sub-src-make_first] Error 2 FB: host_command_exited_cb 656805 512 (In reply to Long Vu from comment #14) > I attempted a build with the patches from the MR, getting this error > currently. > > jsruntime/qv4function.cpp:49:10: fatal error: private/qv4functiontable_p.h: > No such file or directory > 49 | #include <private/qv4functiontable_p.h> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > compilation terminated. > make[2]: *** [Makefile:11117: .obj/qv4function.o] Error 1 > make[2]: *** Waiting for unfinished jobs.... > make[2]: Leaving directory '/run/build/qtdeclarative/src/qml' > make[1]: *** [Makefile:56: sub-qml-make_first-ordered] Error 2 > make[1]: Leaving directory '/run/build/qtdeclarative/src' > make: *** [Makefile:50: sub-src-make_first] Error 2 > FB: host_command_exited_cb 656805 512 I updated the patches, didn't know Qt shipped pregenerated headers too. Please try again and let me know how it goes? Git commit 6f95172f6146c696d60a0af94b00d817e4c69117 by L. E. Segovia. Committed on 23/09/2022 at 13:14. Pushed by lsegovia into branch 'master'. 3rdparty: don't let Qt enable JIT under hardened SELinux policies Although the official bug report [1] said it was fixed in 5.11, in reality it was only fixed in 6.1 (with a 5.15 backport) [2]. [1]: https://bugreports.qt.io/browse/QTBUG-58508 [2]: https://codereview.qt-project.org/c/qt/qtdeclarative/+/329522 (cherry picked from commit fca57a28c902218fb5b950d655bc0c473e0b2bce) A +1045 -0 3rdparty/ext_qt/0134-V4-Generate-function-tables-on-64bit-windows.patch A +46 -0 3rdparty/ext_qt/0135-Use-lowercase-name-for-window-header.patch A +203 -0 3rdparty/ext_qt/0136-JIT-When-making-memory-writable-include-the-exceptio.patch A +480 -0 3rdparty/ext_qt/0137-masm-Add-error-handling-for-failed-mprotect.patch A +39 -0 3rdparty/ext_qt/0138-Fix-Clang-10-warning-about-converting-ULLONG_MAX-to-.patch A +128 -0 3rdparty/ext_qt/0139-Fix-Wdeprecated-copy-warnings.patch M +6 -0 3rdparty/ext_qt/CMakeLists.txt https://invent.kde.org/graphics/krita/commit/6f95172f6146c696d60a0af94b00d817e4c69117 Git commit 0ae8ecb44487a3aaa27a7dea30eb67fe65e076af by L. E. Segovia. Committed on 23/09/2022 at 13:16. Pushed by lsegovia into branch 'krita/5.1'. 3rdparty: don't let Qt enable JIT under hardened SELinux policies Although the official bug report [1] said it was fixed in 5.11, in reality it was only fixed in 6.1 (with a 5.15 backport) [2]. [1]: https://bugreports.qt.io/browse/QTBUG-58508 [2]: https://codereview.qt-project.org/c/qt/qtdeclarative/+/329522 (cherry picked from commit fca57a28c902218fb5b950d655bc0c473e0b2bce) (cherry picked from commit 6f95172f6146c696d60a0af94b00d817e4c69117) A +1045 -0 3rdparty/ext_qt/0134-V4-Generate-function-tables-on-64bit-windows.patch A +46 -0 3rdparty/ext_qt/0135-Use-lowercase-name-for-window-header.patch A +203 -0 3rdparty/ext_qt/0136-JIT-When-making-memory-writable-include-the-exceptio.patch A +480 -0 3rdparty/ext_qt/0137-masm-Add-error-handling-for-failed-mprotect.patch A +39 -0 3rdparty/ext_qt/0138-Fix-Clang-10-warning-about-converting-ULLONG_MAX-to-.patch A +128 -0 3rdparty/ext_qt/0139-Fix-Wdeprecated-copy-warnings.patch M +6 -0 3rdparty/ext_qt/CMakeLists.txt https://invent.kde.org/graphics/krita/commit/0ae8ecb44487a3aaa27a7dea30eb67fe65e076af |