From 384e05d86cce14f965b70c93daae12f31a80657f26c8360156cd4f3fb4688dfc Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux Date: Fri, 11 Sep 2020 06:29:58 +0000 Subject: [PATCH] Qt 5.15.1 - not built yet OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/libqt5-qtbase?expand=0&rev=13 --- ...ad-if-already-in-a-global-threadpool.patch | 225 ------------------ ...menus-showing-on-primary-screens-in-.patch | 37 --- fix-build-openssl-1.1.0.patch | 36 ++- libqt5-qtbase.changes | 13 + libqt5-qtbase.spec | 11 +- qtbase-everywhere-src-5.15.0.tar.xz | 3 - qtbase-everywhere-src-5.15.1.tar.xz | 3 + 7 files changed, 48 insertions(+), 280 deletions(-) delete mode 100644 0001-Do-not-multithread-if-already-in-a-global-threadpool.patch delete mode 100644 0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch delete mode 100644 qtbase-everywhere-src-5.15.0.tar.xz create mode 100644 qtbase-everywhere-src-5.15.1.tar.xz diff --git a/0001-Do-not-multithread-if-already-in-a-global-threadpool.patch b/0001-Do-not-multithread-if-already-in-a-global-threadpool.patch deleted file mode 100644 index 3d0a50b..0000000 --- a/0001-Do-not-multithread-if-already-in-a-global-threadpool.patch +++ /dev/null @@ -1,225 +0,0 @@ -From 5801eb483cce1a9c459b3e86d57dc6fe6f643480 Mon Sep 17 00:00:00 2001 -From: Allan Sandfeld Jensen -Date: Tue, 2 Jun 2020 10:59:21 +0200 -Subject: [PATCH] Do not multithread if already in a global threadpool thread - -This can lead to a deadlock if we block all the worker threads, waiting -for the worker threads to finish. - -Fixes: QTBUG-84619 -Change-Id: I92b7f96007897d86ece0c34223bab0df4ccbed9a -Reviewed-by: Sona Kurazyan -(cherry picked from commit 87d32424de2f471a520c1f3ba0c3035fbff7ee06) -Reviewed-by: Qt Cherry-pick Bot ---- - src/corelib/thread/qthreadpool.cpp | 24 ++++++++++++++++++++++++ - src/corelib/thread/qthreadpool.h | 2 ++ - src/gui/image/qimage.cpp | 7 ++++--- - src/gui/image/qimage_conversions.cpp | 15 +++++++++------ - src/gui/painting/qimagescale.cpp | 5 +++-- - src/gui/painting/qimagescale_neon.cpp | 5 +++-- - src/gui/painting/qimagescale_sse4.cpp | 5 +++-- - 7 files changed, 48 insertions(+), 15 deletions(-) - -diff --git a/src/corelib/thread/qthreadpool.cpp b/src/corelib/thread/qthreadpool.cpp -index 44cdf071df..a583298f01 100644 ---- a/src/corelib/thread/qthreadpool.cpp -+++ b/src/corelib/thread/qthreadpool.cpp -@@ -52,6 +52,7 @@ Q_GLOBAL_STATIC(QThreadPool, theInstance) - */ - class QThreadPoolThread : public QThread - { -+ Q_OBJECT - public: - QThreadPoolThread(QThreadPoolPrivate *manager); - void run() override; -@@ -745,6 +746,28 @@ void QThreadPool::clear() - d->clear(); - } - -+#if QT_VERSION < QT_VERSION_CHECK(6,0,0) -+/*! -+ \internal -+ -+ Returns \c true if \a thread is a thread managed by this thread pool. -+*/ -+#else -+/*! -+ \since 6.0 -+ -+ Returns \c true if \a thread is a thread managed by this thread pool. -+*/ -+#endif -+bool QThreadPool::contains(const QThread *thread) const -+{ -+ Q_D(const QThreadPool); -+ const QThreadPoolThread *poolThread = qobject_cast(thread); -+ if (!poolThread) -+ return false; -+ return d->allThreads.contains(const_cast(poolThread)); -+} -+ - #if QT_DEPRECATED_SINCE(5, 9) - /*! - \since 5.5 -@@ -766,3 +789,4 @@ void QThreadPool::cancel(QRunnable *runnable) - QT_END_NAMESPACE - - #include "moc_qthreadpool.cpp" -+#include "qthreadpool.moc" -diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h -index e3691ab010..004f76a240 100644 ---- a/src/corelib/thread/qthreadpool.h -+++ b/src/corelib/thread/qthreadpool.h -@@ -93,6 +93,8 @@ public: - - void clear(); - -+ bool contains(const QThread *thread) const; -+ - #if QT_DEPRECATED_SINCE(5, 9) - QT_DEPRECATED_X("use tryTake(), but note the different deletion rules") - void cancel(QRunnable *runnable); -diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp -index 2646d298e9..17c31cd8ae 100644 ---- a/src/gui/image/qimage.cpp -+++ b/src/gui/image/qimage.cpp -@@ -5047,15 +5047,16 @@ void QImage::applyColorTransform(const QColorTransform &transform) - }; - } - --#if QT_CONFIG(thread) -+#if QT_CONFIG(thread) && !defined(Q_OS_WASM) - int segments = sizeInBytes() / (1<<16); - segments = std::min(segments, height()); -- if (segments > 1) { -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments > 1 && !threadPool->contains(QThread::currentThread())) { - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (height() - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - transformSegment(y, y + yn); - semaphore.release(1); - }); -diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp -index 506ebc797f..cbfdbdeadb 100644 ---- a/src/gui/image/qimage_conversions.cpp -+++ b/src/gui/image/qimage_conversions.cpp -@@ -236,14 +236,15 @@ void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversio - int segments = src->nbytes / (1<<16); - segments = std::min(segments, src->height); - -- if (segments <= 1) -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments <= 1 || threadPool->contains(QThread::currentThread())) - return convertSegment(0, src->height); - - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (src->height - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - convertSegment(y, y + yn); - semaphore.release(1); - }); -@@ -290,14 +291,15 @@ void convert_generic_to_rgb64(QImageData *dest, const QImageData *src, Qt::Image - int segments = src->nbytes / (1<<16); - segments = std::min(segments, src->height); - -- if (segments <= 1) -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments <= 1 || threadPool->contains(QThread::currentThread())) - return convertSegment(0, src->height); - - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (src->height - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - convertSegment(y, y + yn); - semaphore.release(1); - }); -@@ -396,12 +398,13 @@ bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::Im - #ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS - int segments = data->nbytes / (1<<16); - segments = std::min(segments, data->height); -- if (segments > 1) { -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments > 1 && !threadPool->contains(QThread::currentThread())) { - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (data->height - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - convertSegment(y, y + yn); - semaphore.release(1); - }); -diff --git a/src/gui/painting/qimagescale.cpp b/src/gui/painting/qimagescale.cpp -index 2395c891ce..aac1e20f7b 100644 ---- a/src/gui/painting/qimagescale.cpp -+++ b/src/gui/painting/qimagescale.cpp -@@ -307,12 +307,13 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con - #if QT_CONFIG(thread) && !defined(Q_OS_WASM) - int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); - segments = std::min(segments, dh); -- if (segments > 1) { -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments > 1 && !threadPool->contains(QThread::currentThread())) { - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (dh - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - scaleSection(y, y + yn); - semaphore.release(1); - }); -diff --git a/src/gui/painting/qimagescale_neon.cpp b/src/gui/painting/qimagescale_neon.cpp -index 65fe3fac3c..046e56b419 100644 ---- a/src/gui/painting/qimagescale_neon.cpp -+++ b/src/gui/painting/qimagescale_neon.cpp -@@ -58,12 +58,13 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con - #if QT_CONFIG(thread) && !defined(Q_OS_WASM) - int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); - segments = std::min(segments, dh); -- if (segments > 1) { -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments > 1 && !threadPool->contains(QThread::currentThread())) { - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (dh - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - scaleSection(y, y + yn); - semaphore.release(1); - }); -diff --git a/src/gui/painting/qimagescale_sse4.cpp b/src/gui/painting/qimagescale_sse4.cpp -index 1760e72f65..70cfa08d95 100644 ---- a/src/gui/painting/qimagescale_sse4.cpp -+++ b/src/gui/painting/qimagescale_sse4.cpp -@@ -59,12 +59,13 @@ static inline void multithread_pixels_function(QImageScaleInfo *isi, int dh, con - #if QT_CONFIG(thread) && !defined(Q_OS_WASM) - int segments = (qsizetype(isi->sh) * isi->sw) / (1<<16); - segments = std::min(segments, dh); -- if (segments > 1) { -+ QThreadPool *threadPool = QThreadPool::globalInstance(); -+ if (segments > 1 && !threadPool->contains(QThread::currentThread())) { - QSemaphore semaphore; - int y = 0; - for (int i = 0; i < segments; ++i) { - int yn = (dh - y) / (segments - i); -- QThreadPool::globalInstance()->start([&, y, yn]() { -+ threadPool->start([&, y, yn]() { - scaleSection(y, y + yn); - semaphore.release(1); - }); --- -2.25.1 - diff --git a/0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch b/0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch deleted file mode 100644 index 4501a30..0000000 --- a/0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From f16d0e41bb638ffc1d83ca48321073eca1b86b42 Mon Sep 17 00:00:00 2001 -From: Friedemann Kleint -Date: Wed, 10 Jun 2020 11:26:00 +0200 -Subject: [PATCH] Fix QToolButton menus showing on primary screens in - multiscreen setups - -Calculate an initial position based on the current size hint -and pass it to QMenuPrivate::exec(), which does screen checks -based on it. - -Amends a78d66743171557d79b16c08be775e3ac15bb4ef. - -Pick-to: 5.15 -Fixes: QTBUG-84462 -Task-number: QTBUG-78966 -Change-Id: Icae8d2bc0fb50c4c853cfebaa2b2250fc06542e3 ---- - src/widgets/widgets/qtoolbutton.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp -index edd4788806..0b090d2bac 100644 ---- a/src/widgets/widgets/qtoolbutton.cpp -+++ b/src/widgets/widgets/qtoolbutton.cpp -@@ -805,7 +805,8 @@ void QToolButtonPrivate::popupTimerDone() - // QTBUG-78966, Delay positioning until after aboutToShow(). - auto positionFunction = [q, horizontal](const QSize &sizeHint) { - return positionMenu(q, horizontal, sizeHint); }; -- actualMenu->d_func()->exec({}, nullptr, positionFunction); -+ const auto initialPos = positionFunction(actualMenu->sizeHint()); -+ actualMenu->d_func()->exec(initialPos, nullptr, positionFunction); - - if (!that) - return; --- -2.25.1 - diff --git a/fix-build-openssl-1.1.0.patch b/fix-build-openssl-1.1.0.patch index ad6dd74..51f1fa3 100644 --- a/fix-build-openssl-1.1.0.patch +++ b/fix-build-openssl-1.1.0.patch @@ -3,11 +3,21 @@ Subject: Fix build against OpenSSL 1.1.0 Leap 15.1 still has it and we can't switch away without breaking the world. -Index: qtbase-everywhere-src-5.15.0-rc/src/network/ssl/qsslsocket_openssl_symbols.cpp +Index: qtbase-everywhere-src-5.15.1/src/network/ssl/qsslsocket_openssl_symbols.cpp =================================================================== ---- qtbase-everywhere-src-5.15.0-rc.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp -+++ qtbase-everywhere-src-5.15.0-rc/src/network/ssl/qsslsocket_openssl_symbols.cpp -@@ -373,7 +373,7 @@ DEFINEFUNC3(void, SSL_set_bio, SSL *a, a +--- qtbase-everywhere-src-5.15.1.orig/src/network/ssl/qsslsocket_openssl_symbols.cpp ++++ qtbase-everywhere-src-5.15.1/src/network/ssl/qsslsocket_openssl_symbols.cpp +@@ -146,7 +146,9 @@ DEFINEFUNC2(int, BN_is_word, BIGNUM *a, + DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return) + DEFINEFUNC(int, EVP_PKEY_up_ref, EVP_PKEY *a, a, return 0, return) + DEFINEFUNC2(EVP_PKEY_CTX *, EVP_PKEY_CTX_new, EVP_PKEY *pkey, pkey, ENGINE *e, e, return nullptr, return) ++#if OPENSSL_VERSION_NUMBER >= 0x10101000L + DEFINEFUNC(int, EVP_PKEY_param_check, EVP_PKEY_CTX *ctx, ctx, return 0, return) ++#endif + DEFINEFUNC(void, EVP_PKEY_CTX_free, EVP_PKEY_CTX *ctx, ctx, return, return) + DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return) + DEFINEFUNC(int, RSA_bits, RSA *a, a, return 0, return) +@@ -376,7 +378,7 @@ DEFINEFUNC3(void, SSL_set_bio, SSL *a, a DEFINEFUNC(void, SSL_set_accept_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(void, SSL_set_connect_state, SSL *a, a, return, DUMMYARG) DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, return) @@ -16,11 +26,21 @@ Index: qtbase-everywhere-src-5.15.0-rc/src/network/ssl/qsslsocket_openssl_symbol DEFINEFUNC(int, SSL_get_shutdown, const SSL *ssl, ssl, return 0, return) DEFINEFUNC2(int, SSL_set_session, SSL* to, to, SSL_SESSION *session, session, return -1, return) DEFINEFUNC(void, SSL_SESSION_free, SSL_SESSION *ses, ses, return, DUMMYARG) -Index: qtbase-everywhere-src-5.15.0-rc/src/network/ssl/qsslsocket_openssl_symbols_p.h +Index: qtbase-everywhere-src-5.15.1/src/network/ssl/qsslsocket_openssl_symbols_p.h =================================================================== ---- qtbase-everywhere-src-5.15.0-rc.orig/src/network/ssl/qsslsocket_openssl_symbols_p.h -+++ qtbase-everywhere-src-5.15.0-rc/src/network/ssl/qsslsocket_openssl_symbols_p.h -@@ -516,7 +516,7 @@ void q_SSL_set_bio(SSL *a, BIO *b, BIO * +--- qtbase-everywhere-src-5.15.1.orig/src/network/ssl/qsslsocket_openssl_symbols_p.h ++++ qtbase-everywhere-src-5.15.1/src/network/ssl/qsslsocket_openssl_symbols_p.h +@@ -235,7 +235,9 @@ int q_EVP_CIPHER_CTX_reset(EVP_CIPHER_CT + Q_AUTOTEST_EXPORT int q_EVP_PKEY_up_ref(EVP_PKEY *a); + EVP_PKEY_CTX *q_EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); + void q_EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); ++#if OPENSSL_VERSION_NUMBER >= 0x10101000L + int q_EVP_PKEY_param_check(EVP_PKEY_CTX *ctx); ++#endif + int q_EVP_PKEY_base_id(EVP_PKEY *a); + int q_RSA_bits(RSA *a); + Q_AUTOTEST_EXPORT int q_OPENSSL_sk_num(OPENSSL_STACK *a); +@@ -519,7 +521,7 @@ void q_SSL_set_bio(SSL *a, BIO *b, BIO * void q_SSL_set_accept_state(SSL *a); void q_SSL_set_connect_state(SSL *a); int q_SSL_shutdown(SSL *a); diff --git a/libqt5-qtbase.changes b/libqt5-qtbase.changes index 9103893..f3865fd 100644 --- a/libqt5-qtbase.changes +++ b/libqt5-qtbase.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Sep 10 07:57:00 UTC 2020 - Fabian Vogt + +- Update to 5.15.1: + * New bugfix release + * Fixes CVE-2020-17507 + * For more details please see: + http://code.qt.io/cgit/qt/qtbase.git/plain/dist/changes-5.15.1/?h=5.15.1 +- Drop patches, now upstream: + * 0001-Do-not-multithread-if-already-in-a-global-threadpool.patch + * 0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch +- Adjust fix-build-openssl-1.1.0.patch + ------------------------------------------------------------------- Sun Jul 5 10:16:48 UTC 2020 - Fabian Vogt diff --git a/libqt5-qtbase.spec b/libqt5-qtbase.spec index c27b9e6..d98b69a 100644 --- a/libqt5-qtbase.spec +++ b/libqt5-qtbase.spec @@ -36,16 +36,16 @@ %endif Name: libqt5-qtbase -Version: 5.15.0 +Version: 5.15.1 Release: 0 Summary: C++ Program Library, Core Components License: LGPL-3.0-only or GPL-3.0-with-Qt-Company-Qt-exception-1.1 Group: System/Libraries Url: https://www.qt.io %define base_name libqt5 -%define real_version 5.15.0 -%define so_version 5.15.0 -%define tar_version qtbase-everywhere-src-5.15.0 +%define real_version 5.15.1 +%define so_version 5.15.1 +%define tar_version qtbase-everywhere-src-5.15.1 Source: https://download.qt.io/official_releases/qt/5.15/%{real_version}/submodules/%{tar_version}.tar.xz # to get mtime of file: Source1: libqt5-qtbase.changes @@ -67,12 +67,9 @@ Patch12: 0001-Add-remote-print-queue-support.patch Patch21: 0001-Don-t-white-list-recent-Mesa-versions-for-multithrea.patch Patch24: fix-fixqt4headers.patch # patches 1000-2000 and above from upstream 5.15 branch # -Patch1000: 0001-Do-not-multithread-if-already-in-a-global-threadpool.patch # patches 2000-3000 and above from upstream qt6/dev branch # # Not accepted yet, https://codereview.qt-project.org/c/qt/qtbase/+/255384 Patch2001: 0002-Synthesize-Enter-LeaveEvent-for-accepted-QTabletEven.patch -# Not accepted yet, https://codereview.qt-project.org/c/qt/qtbase/+/303786 -Patch2002: 0001-Fix-QToolButton-menus-showing-on-primary-screens-in-.patch BuildRequires: alsa-devel BuildRequires: cups-devel BuildRequires: double-conversion-devel diff --git a/qtbase-everywhere-src-5.15.0.tar.xz b/qtbase-everywhere-src-5.15.0.tar.xz deleted file mode 100644 index ab3d57b..0000000 --- a/qtbase-everywhere-src-5.15.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e7af10aece15fa9500369efde69cb220eee8ec3a6818afe01ce1e7d484824c5 -size 49931940 diff --git a/qtbase-everywhere-src-5.15.1.tar.xz b/qtbase-everywhere-src-5.15.1.tar.xz new file mode 100644 index 0000000..e8ac513 --- /dev/null +++ b/qtbase-everywhere-src-5.15.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33960404d579675b7210de103ed06a72613bfc4305443e278e2d32a3eb1f3d8c +size 50153132