public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jan Grulich <jgrulich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/qt6-qtbase] rawhide: Upstream backport:
Date: Thu, 01 Oct 2026 14:53:19 GMT	[thread overview]
Message-ID: <179086639910.1.12000874406973346803.rpms-qt6-qtbase-c3dd3fe417d7@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/qt6-qtbase
            Branch : rawhide
            Commit : c3dd3fe417d776886a3f4b3b245f597313780eaa
            Author : Jan Grulich <jgrulich@redhat.com>
            Date   : 2026-10-01T16:52:36+02:00
            Stats  : +60/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/qt6-qtbase/c/c3dd3fe417d776886a3f4b3b245f597313780eaa?branch=rawhide

            Log:
            Upstream backport:
Fix crash when fontconfig fallback pattern has no charset

---
diff --git a/qt6-qtbase.spec b/qt6-qtbase.spec
index af9d05b..e62681e 100644
--- a/qt6-qtbase.spec
+++ b/qt6-qtbase.spec
@@ -48,7 +48,7 @@ BuildRequires: pkgconfig(libsystemd)
 Name:    qt6-qtbase
 Summary: Qt6 - QtBase components
 Version: 6.11.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 License: LGPL-3.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0
 Url:     http://qt-project.org/
@@ -100,6 +100,7 @@ Patch58: qtbase-libglvnd.patch
 
 # Upstream patches
 Patch100: qtbase-qiconloader-dont-consider-fallbackthemename-in-themename.patch
+Patch101: qtbase-fix-crash-when-fontconfig-fallback-pattern-has-no-charset.patch
 
 # Do not check any files in %%{_qt6_plugindir}/platformthemes/ for requires.
 # Those themes are there for platform integration. If the required libraries are
@@ -951,6 +952,10 @@ make check -k ||:
 %{_qt6_datadir}/wayland/protocols/
 
 %changelog
+* Thu Oct 01 2026 Jan Grulich <jgrulich@redhat.com> - 6.11.2-3
+- Upstream backport:
+  Fix crash when fontconfig fallback pattern has no charset
+
 * Tue Aug 25 2026 Jan Grulich <jgrulich@redhat.com> - 6.11.2-2
 - Upstream backport:
   QIconLoader: don't consider fallbackThemeName() in themeName()

diff --git a/qtbase-fix-crash-when-fontconfig-fallback-pattern-has-no-charset.patch b/qtbase-fix-crash-when-fontconfig-fallback-pattern-has-no-charset.patch
new file mode 100644
index 0000000..c99f4ed
--- /dev/null
+++ b/qtbase-fix-crash-when-fontconfig-fallback-pattern-has-no-charset.patch
@@ -0,0 +1,54 @@
+From 80ddc8dee6a05cd619085e29fc21ff92c4b877a8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Imre=20P=C3=A9ntek?= <pentek.imre@gmail.com>
+Date: Sat, 4 Jul 2026 20:13:18 +0200
+Subject: [PATCH] Fix crash when fontconfig fallback pattern has no charset
+
+QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter() passed
+the address of an uninitialized FcCharSet* to FcPatternGetCharSet()
+and then called FcCharSetHasChar() on it without checking the result.
+A pattern returned by FcFontMatch() is not guaranteed to carry an
+FC_CHARSET element: fontconfig treats the charset as optional, and
+caches produced by other fontconfig builds (e.g. a bundled snapshot
+that indexed .woff/.woff2 files it could not parse as empty patterns)
+can legally serve charset-less patterns. In that case the uninitialized
+pointer is dereferenced inside FcCharSetHasChar() and the process
+crashes with SIGSEGV; builds hardened with
+-ftrivial-auto-var-init=pattern crash deterministically at 0xfefe...
+
+Observed in the wild on Arch/Manjaro after the fontconfig 2.18.1
+upgrade: every Qt application (Qt Creator, CopyQ, KeePassXC, ...)
+crashed in FcCharSetHasChar via QFontEngineMulti::glyphIndex() as soon
+as any glyph fallback lookup ran, because stale fontconfig caches
+served a charset-less pattern for every FcFontMatch() call.
+
+Initialize the pointer and check the FcPatternGetCharSet() result.
+When no charset can be obtained, keep the optimistic default (load the
+engine) exactly as we already do when no match pattern is available,
+so glyph coverage is decided by the font engine itself.
+
+Pick-to: 6.12 6.11 6.8
+Change-Id: I18687e0a7b7a0019a459155395636768ad9ea964
+Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
+---
+ src/gui/text/unix/qfontenginemultifontconfig.cpp | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/gui/text/unix/qfontenginemultifontconfig.cpp b/src/gui/text/unix/qfontenginemultifontconfig.cpp
+index 6419a764f79f..f13943ff5835 100644
+--- a/src/gui/text/unix/qfontenginemultifontconfig.cpp
++++ b/src/gui/text/unix/qfontenginemultifontconfig.cpp
+@@ -25,9 +25,11 @@ bool QFontEngineMultiFontConfig::shouldLoadFontEngineForCharacter(int at, uint u
+     bool charSetHasChar = true;
+     FcPattern *matchPattern = getMatchPatternForFallback(at - 1);
+     if (matchPattern != nullptr) {
+-        FcCharSet *charSet;
+-        FcPatternGetCharSet(matchPattern, FC_CHARSET, 0, &charSet);
+-        charSetHasChar = FcCharSetHasChar(charSet, ucs4);
++        FcCharSet *charSet = nullptr;
++        if (FcPatternGetCharSet(matchPattern, FC_CHARSET, 0, &charSet) == FcResultMatch
++            && charSet != nullptr) {
++            charSetHasChar = FcCharSetHasChar(charSet, ucs4);
++        }
+     }
+ 
+     return charSetHasChar;

             reply	other threads:[~2026-10-01 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 14:53 Jan Grulich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-25  6:35 [rpms/qt6-qtbase] rawhide: Upstream backport: Jan Grulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179086639910.1.12000874406973346803.rpms-qt6-qtbase-c3dd3fe417d7@fedoraproject.org \
    --to=jgrulich@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox