fixed bz#1364717, Segfault in QDBusConnectionPrivate::closeConnection -> QObject::disconnect on exit

This commit is contained in:
Than Ngo 2017-07-17 19:47:03 +02:00
parent 4c4bc81e4d
commit a97a8f9163
2 changed files with 97 additions and 1 deletions

View File

@ -0,0 +1,89 @@
diff -up qtbase-opensource-src-5.7.1/src/corelib/plugin/qfactoryloader.cpp.than qtbase-opensource-src-5.7.1/src/corelib/plugin/qfactoryloader.cpp
--- qtbase-opensource-src-5.7.1/src/corelib/plugin/qfactoryloader.cpp.than 2017-07-17 18:01:15.412236821 +0200
+++ qtbase-opensource-src-5.7.1/src/corelib/plugin/qfactoryloader.cpp 2017-07-17 18:02:15.109007120 +0200
@@ -187,10 +187,12 @@ void QFactoryLoader::update()
++keyUsageCount;
}
}
- if (keyUsageCount || keys.isEmpty())
+ if (keyUsageCount || keys.isEmpty()) {
+ library->setLoadHints(QLibrary::PreventUnloadHint); // once loaded, don't unload
d->libraryList += library;
- else
+ } else {
library->release();
+ }
}
}
#else
diff -up qtbase-opensource-src-5.7.1/src/corelib/plugin/qpluginloader.cpp.than qtbase-opensource-src-5.7.1/src/corelib/plugin/qpluginloader.cpp
--- qtbase-opensource-src-5.7.1/src/corelib/plugin/qpluginloader.cpp.than 2017-07-17 18:02:31.655389105 +0200
+++ qtbase-opensource-src-5.7.1/src/corelib/plugin/qpluginloader.cpp 2017-07-17 18:04:34.596792308 +0200
@@ -154,6 +154,7 @@ QPluginLoader::QPluginLoader(const QStri
: QObject(parent), d(0), did_load(false)
{
setFileName(fileName);
+ setLoadHints(QLibrary::PreventUnloadHint);
}
/*!
@@ -348,7 +349,7 @@ static QString locatePlugin(const QStrin
void QPluginLoader::setFileName(const QString &fileName)
{
#if defined(QT_SHARED)
- QLibrary::LoadHints lh;
+ QLibrary::LoadHints lh = QLibrary::PreventUnloadHint;
if (d) {
lh = d->loadHints();
d->release();
@@ -394,7 +395,7 @@ QString QPluginLoader::errorString() con
\brief Give the load() function some hints on how it should behave.
You can give hints on how the symbols in the plugin are
- resolved. By default, none of the hints are set.
+ resolved. By default since Qt 5.7, QLibrary::PreventUnloadHint is set.
See the documentation of QLibrary::loadHints for a complete
description of how this property works.
diff -up qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.cpp.than qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.cpp
--- qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.cpp.than 2017-07-17 10:11:45.915973856 +0200
+++ qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.cpp 2017-07-17 10:15:08.622262320 +0200
@@ -40,8 +40,6 @@
#include "qnetworkconfigmanager_p.h"
#include "qbearerplugin_p.h"
-#include <QtCore/private/qfactoryloader_p.h>
-
#include <QtCore/qdebug.h>
#include <QtCore/qtimer.h>
#include <QtCore/qstringlist.h>
@@ -60,7 +58,9 @@
QT_BEGIN_NAMESPACE
QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
- : QObject(), pollTimer(0), mutex(QMutex::Recursive), forcedPolling(0), firstUpdate(true)
+ : QObject(), pollTimer(0), mutex(QMutex::Recursive),
+ loader(QBearerEngineFactoryInterface_iid, QLatin1String("/bearer")),
+ forcedPolling(0), firstUpdate(true)
{
qRegisterMetaType<QNetworkConfiguration>();
qRegisterMetaType<QNetworkConfigurationPrivatePointer>();
diff -up qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.h.than qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.h
--- qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.h.than 2017-07-17 10:31:53.723102056 +0200
+++ qtbase-opensource-src-5.7.1/src/network/bearer/qnetworkconfigmanager_p.h 2017-07-17 10:32:43.543213865 +0200
@@ -54,6 +54,7 @@
#include "qnetworkconfigmanager.h"
#include "qnetworkconfiguration_p.h"
+#include <QtCore/private/qfactoryloader_p.h>
#include <QtCore/qmutex.h>
#include <QtCore/qset.h>
@@ -117,6 +118,7 @@ private:
private:
mutable QMutex mutex;
+ QFactoryLoader loader;
QList<QBearerEngine *> sessionEngines;
QSet<QString> onlineConfigurations;

View File

@ -66,7 +66,7 @@ BuildRequires: pkgconfig(libsystemd)
Name: qt5-qtbase
Summary: Qt5 - QtBase components
Version: 5.7.1
Release: 18%{?dist}
Release: 19%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -128,6 +128,9 @@ Patch63: qt5-qtbase-5.7.1-openssl11.patch
# support firebird version 3.x
Patch64: qt5-qtbase-5.7.1-firebird.patch
# Segfault in QDBusConnectionPrivate::closeConnection -> QObject::disconnect on exit
Patch65: qt5-qtbase-5.7.1-bz#1364717.patch
## upstream patches
## 5.8 branch
# https://bugzilla.redhat.com/show_bug.cgi?id=1403500
@ -395,6 +398,7 @@ Qt5 libraries used for drawing widgets and OpenGL items.
%if 0%{?firebird3x}
%patch64 -p1 -b .firebird
%endif
%patch65 -p1 -b .bz#1364717
%if 0%{?inject_optflags}
## adjust $RPM_OPT_FLAGS
@ -993,6 +997,9 @@ fi
%changelog
* Mon Jul 17 2017 Than Ngo <than@redhat.com> - 5.7.1-19
- fixed bz#1364717, Segfault in QDBusConnectionPrivate::closeConnection -> QObject::disconnect on exit
* Fri Jul 07 2017 Than Ngo <than@redhat.com> - 5.7.1-18
- fixed bz#1409600, stack overflow in QXmlSimpleReader, CVE-2016-10040