Accepting request 1146775 from home:krop:Qt6:Release

Qt 6.6.2 (finally)

OBS-URL: https://build.opensuse.org/request/show/1146775
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt6/qt6-base?expand=0&rev=95
This commit is contained in:
Christophe Marin 2024-02-16 23:09:40 +00:00 committed by Git OBS Bridge
parent d0a5cf7b6d
commit 5ff1f94298
9 changed files with 17 additions and 1487 deletions

View File

@ -1,38 +0,0 @@
From 658607a34ead214fbacbc2cca44915655c318ea9 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Tue, 12 Dec 2023 20:51:56 +0100
Subject: [PATCH] HPack: fix a Yoda Condition
Putting the variable on the LHS of a relational operation makes the
expression easier to read. In this case, we find that the whole
expression is nonsensical as an overflow protection, because if
name.size() + value.size() overflows, the result will exactly _not_
be > max() - 32, because UB will have happened.
To be fixed in a follow-up commit.
As a drive-by, add parentheses around the RHS.
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I35ce598884c37c51b74756b3bd2734b9aad63c09
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
src/network/access/http2/hpacktable.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/access/http2/hpacktable.cpp b/src/network/access/http2/hpacktable.cpp
index 74a09a207ffb..c8c5d098c80a 100644
--- a/src/network/access/http2/hpacktable.cpp
+++ b/src/network/access/http2/hpacktable.cpp
@@ -27,7 +27,7 @@ HeaderSize entry_size(QByteArrayView name, QByteArrayView value)
// 32 octets of overhead."
const unsigned sum = unsigned(name.size() + value.size());
- if (std::numeric_limits<unsigned>::max() - 32 < sum)
+ if (sum > (std::numeric_limits<unsigned>::max() - 32))
return HeaderSize();
return HeaderSize(true, quint32(sum + 32));
}
--
2.16.3

View File

@ -1,64 +0,0 @@
From 8907dedc858cc344d770a2e826d6acc516429540 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Tue, 19 Dec 2023 14:22:37 +0100
Subject: [PATCH] Http2: fix potential overflow in assemble_hpack_block()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The function is given a vector of Http2::Frame's and flattens it into
a vector<uchar>. While each Frame can contain a maximum of 16GiB of
data (24-bit size field), one "only" needs 257 of them to overflow the
quint32 variable's range.
So make sure any overflow does not go undetected.
Keep the limited uint32_t range for now, as we don't know whether all
consumers of the result can deal with more than 4GiB of data.
Since all these frames must be in memory, this cannot overflow in
practice on 32-bit machines.
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Iafaa7d1c870cba9100e75065db11d95934f86213
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1e6bb61af3ae29755f93b92f157df026f934ae61)
* asturmlechner 2024-01-02: Use correct include for 5.15
---
src/network/access/qhttp2protocolhandler.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp
index 39dd460881a..ead88d781ae 100644
--- a/src/network/access/qhttp2protocolhandler.cpp
+++ b/src/network/access/qhttp2protocolhandler.cpp
@@ -10,10 +10,12 @@
#include <private/qnoncontiguousbytedevice_p.h>
#include <QtNetwork/qabstractsocket.h>
+
#include <QtCore/qloggingcategory.h>
#include <QtCore/qendian.h>
#include <QtCore/qdebug.h>
#include <QtCore/qlist.h>
+#include <QtCore/private/qnumeric_p.h>
#include <QtCore/qurl.h>
#include <qhttp2configuration.h>
@@ -90,8 +92,10 @@ std::vector<uchar> assemble_hpack_block(const std::vector<Http2::Frame> &frames)
std::vector<uchar> hpackBlock;
quint32 total = 0;
- for (const auto &frame : frames)
- total += frame.hpackBlockSize();
+ for (const auto &frame : frames) {
+ if (add_overflow(total, frame.hpackBlockSize(), &total))
+ return hpackBlock;
+ }
if (!total)
return hpackBlock;
--
GitLab

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
From 54656da9ace06caf4a0eeb1832989c0ab211a4a0 Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Wed, 15 Nov 2023 09:36:06 -0700
Subject: QMimeDatabase: handle buggy type definitions with circular
inheritance
This fixes an infinite loop reported by a user who had both the
definition of text/javascript from shared-mime-info 2.3 and the
definition of text/javascript from shared-mime-info 2.4 installed at the
same time. In 2.3, text/javascript is a subtype of
application/ecmascript, but in 2.4 application/ecmascript is a subtype
of text/javascript. Having both at the same time resulted in circular
inheritance.
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/258#note_2167707
[ChangeLog][QtCore][QMimeDatabase] Added code to detect and break
circular inheritance loops in the MIME data, which were causing infinite
loops
Pick-to: 6.6 6.5
Change-Id: Ic207b1593a49c7bb88e4fd810d8f88aa630087ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
---
src/corelib/mimetypes/qmimedatabase.cpp | 9 +++++++--
src/corelib/mimetypes/qmimetype.cpp | 7 +++++--
.../mimetypes/qmimedatabase/circular-inheritance.xml | 13 +++++++++++++
.../qmimedatabase/qmimedatabase-cache/CMakeLists.txt | 1 +
.../qmimedatabase/qmimedatabase-xml/CMakeLists.txt | 1 +
.../corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp | 8 ++++++++
6 files changed, 35 insertions(+), 4 deletions(-)
create mode 100644 tests/auto/corelib/mimetypes/qmimedatabase/circular-inheritance.xml
diff --git a/src/corelib/mimetypes/qmimedatabase.cpp b/src/corelib/mimetypes/qmimedatabase.cpp
index f06a434d55..eaeb079c97 100644
--- a/src/corelib/mimetypes/qmimedatabase.cpp
+++ b/src/corelib/mimetypes/qmimedatabase.cpp
@@ -10,6 +10,7 @@
#include "qmimeprovider_p.h"
#include "qmimetype_p.h"
+#include <private/qduplicatetracker_p.h>
#include <private/qfilesystementry_p.h>
#include <QtCore/QMap>
@@ -503,6 +504,7 @@ QList<QMimeType> QMimeDatabasePrivate::allMimeTypes()
bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
{
const QString resolvedParent = resolveAlias(parent);
+ QDuplicateTracker<QString> seen;
std::stack<QString, QStringList> toCheck;
toCheck.push(mime);
while (!toCheck.empty()) {
@@ -511,8 +513,11 @@ bool QMimeDatabasePrivate::inherits(const QString &mime, const QString &parent)
const QString mimeName = toCheck.top();
toCheck.pop();
const auto parentList = parents(mimeName);
- for (const QString &par : parentList)
- toCheck.push(resolveAlias(par));
+ for (const QString &par : parentList) {
+ const QString resolvedPar = resolveAlias(par);
+ if (!seen.hasSeen(resolvedPar))
+ toCheck.push(resolvedPar);
+ }
}
return false;
}
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index bed9e94364..ad3c484f30 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -325,14 +325,17 @@ QStringList QMimeType::parentMimeTypes() const
static void collectParentMimeTypes(const QString &mime, QStringList &allParents)
{
const QStringList parents = QMimeDatabasePrivate::instance()->mimeParents(mime);
+ QStringList newParents;
for (const QString &parent : parents) {
// I would use QSet, but since order matters I better not
- if (!allParents.contains(parent))
+ if (!allParents.contains(parent)) {
allParents.append(parent);
+ newParents.append(parent);
+ }
}
// We want a breadth-first search, so that the least-specific parent (octet-stream) is last
// This means iterating twice, unfortunately.
- for (const QString &parent : parents)
+ for (const QString &parent : newParents)
collectParentMimeTypes(parent, allParents);
}
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/circular-inheritance.xml b/tests/auto/corelib/mimetypes/qmimedatabase/circular-inheritance.xml
new file mode 100644
index 0000000000..466f039803
--- /dev/null
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/circular-inheritance.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
+ <mime-type type="application/ecmascript">
+ <comment>It's more accurate to say that ECMAScript is a subset of JavaScript</comment>
+ <sub-class-of type="text/javascript"/>
+ <glob pattern="*.js"/>
+ </mime-type>
+ <mime-type type="text/javascript">
+ <comment>than to say that JavaScript is a subset of ECMAScript</comment>
+ <sub-class-of type="application/ecmascript"/>
+ <glob pattern="*.js"/>
+ </mime-type>
+</mime-info>
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
index 9a70666b07..a267640a50 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-cache/CMakeLists.txt
@@ -31,5 +31,6 @@ qt_internal_add_test(tst_qmimedatabase-cache
#)
set(testdata_resource_files
+ "../circular-inheritance.xml"
"../invalid-magic1.xml"
"../invalid-magic2.xml"
"../invalid-magic3.xml"
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/CMakeLists.txt b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/CMakeLists.txt
index 205d3c362b..729ac3933a 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/CMakeLists.txt
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/qmimedatabase-xml/CMakeLists.txt
@@ -31,5 +31,6 @@ qt_internal_add_test(tst_qmimedatabase-xml
#)
set(testdata_resource_files
+ "../circular-inheritance.xml"
"../invalid-magic1.xml"
"../invalid-magic2.xml"
"../invalid-magic3.xml"
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 9bc3037c99..d7db4bb9bf 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -38,6 +38,7 @@
"invalid-magic2.xml",
"invalid-magic3.xml",
"magic-and-hierarchy.xml",
+ "circular-inheritance.xml",
0 };
static const auto s_resourcePrefix = ":/qt-project.org/qmime/"_L1;
@@ -388,6 +389,13 @@ void tst_QMimeDatabase::inheritance()
const QMimeType mswordTemplate = db.mimeTypeForName(QString::fromLatin1("application/msword-template"));
QVERIFY(mswordTemplate.isValid());
QVERIFY(mswordTemplate.inherits(QLatin1String("application/msword")));
+
+ // Check that buggy type definitions that have circular inheritance don't cause an infinite
+ // loop, especially when resolving a conflict between the file's name and its contents
+ const QMimeType ecmascript = db.mimeTypeForName(QString::fromLatin1("application/ecmascript"));
+ QVERIFY(ecmascript.allAncestors().contains("text/plain"));
+ const QMimeType javascript = db.mimeTypeForFileNameAndData("xml.js", "<?xml?>");
+ QVERIFY(javascript.inherits(QString::fromLatin1("text/javascript")));
}
void tst_QMimeDatabase::aliases()
--
cgit v1.2.3

View File

@ -1,44 +0,0 @@
From ee5da1f2eaf8932aeca02ffea6e4c618585e29e3 Mon Sep 17 00:00:00 2001
From: Marc Mutz <marc.mutz@qt.io>
Date: Tue, 12 Dec 2023 22:08:07 +0100
Subject: [PATCH] HPack: fix incorrect integer overflow check
This code never worked:
For the comparison with max() - 32 to trigger, on 32-bit platforms (or
Qt 5) signed interger overflow would have had to happen in the
addition of the two sizes. The compiler can therefore remove the
overflow check as dead code.
On Qt 6 and 64-bit platforms, the signed integer addition would be
very unlikely to overflow, but the following truncation to uint32
would yield the correct result only in a narrow 32-value window just
below UINT_MAX, if even that.
Fix by using the proper tool, qAddOverflow.
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I7599f2e75ff7f488077b0c60b81022591005661c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
src/network/access/http2/hpacktable.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/network/access/http2/hpacktable.cpp b/src/network/access/http2/hpacktable.cpp
index c8c5d098c80a..2c728b37e3b5 100644
--- a/src/network/access/http2/hpacktable.cpp
+++ b/src/network/access/http2/hpacktable.cpp
@@ -26,7 +26,9 @@ HeaderSize entry_size(QByteArrayView name, QByteArrayView value)
// for counting the number of references to the name and value would have
// 32 octets of overhead."
- const unsigned sum = unsigned(name.size() + value.size());
+ size_t sum;
+ if (qAddOverflow(size_t(name.size()), size_t(value.size()), &sum))
+ return HeaderSize();
if (sum > (std::numeric_limits<unsigned>::max() - 32))
return HeaderSize();
return HeaderSize(true, quint32(sum + 32));
--
2.16.3

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Wed Feb 14 16:53:08 UTC 2024 - Christophe Marin <christophe@krop.fr>
- Update to 6.6.2
* https://www.qt.io/blog/qt-6.6.2-released
- Drop patches, merged upstream:
* 0001-QMimeDatabase-handle-buggy-type-definitions.patch
* 0001-QMimeDatabase-collect-glob-patterns-from.patch
* 0001-HPack-fix-a-Yoda-Condition.patch
* 0002-HPack-fix-incorrect-integer-overflow-check.patch
* 0001-Http2-fix-potential-overflow-in-assemble_hpack_block.patch
-------------------------------------------------------------------
Wed Jan 31 14:51:31 UTC 2024 - Christophe Marin <christophe@krop.fr>

View File

@ -16,7 +16,7 @@
#
%define real_version 6.6.1
%define real_version 6.6.2
%define short_version 6.6
%define tar_name qtbase-everywhere-src
%define tar_suffix %{nil}
@ -30,7 +30,7 @@
%global with_gles 1
%endif
Name: qt6-base%{?pkg_suffix}
Version: 6.6.1
Version: 6.6.2
Release: 0
Summary: Qt 6 core components (Core, Gui, Widgets, Network...)
# Legal: qtpaths is BSD-3-Clause
@ -39,11 +39,6 @@ URL: https://www.qt.io
Source: https://download.qt.io/official_releases/qt/%{short_version}/%{real_version}%{tar_suffix}/submodules/%{tar_name}-%{real_version}%{tar_suffix}.tar.xz
Source99: qt6-base-rpmlintrc
# Patches 0-100 are upstream patches #
Patch0: 0001-QMimeDatabase-handle-buggy-type-definitions.patch
Patch1: 0001-QMimeDatabase-collect-glob-patterns-from.patch
Patch2: 0001-HPack-fix-a-Yoda-Condition.patch
Patch3: 0002-HPack-fix-incorrect-integer-overflow-check.patch
Patch4: 0001-Http2-fix-potential-overflow-in-assemble_hpack_block.patch
# Patches 100-200 are openSUSE and/or non-upstream(able) patches #
Patch100: 0001-Tell-the-truth-about-private-API.patch
# No need to pollute the library dir with object files, install them in the qt6 subfolder

BIN
qtbase-everywhere-src-6.6.1.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b89b426b9852a17d3e96230ab0871346574d635c7914480a2a27f98ff942677b
size 48689304