Skip to content

Commit 4401d89

Browse files
[AUTO-CHERRYPICK] Added Patch CVE-2022-25255 for qt5-qtbase - branch main (#10835)
Co-authored-by: Mykhailo Bykhovtsev <[email protected]>
1 parent 4dd3ddf commit 4401d89

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
From 926c72f641cd122e1e8fc9f92f0fea885d3c8ede Mon Sep 17 00:00:00 2001
2+
From: Mykhailo Bykhovtsev <[email protected]>
3+
Date: Wed, 23 Oct 2024 16:13:23 -0700
4+
Subject: [PATCH] patch CVE-2022-25255
5+
Patch taken from https://download.qt.io/official_releases/qt/5.15/qprocess5-15.diff
6+
7+
---
8+
src/corelib/io/qprocess_unix.cpp | 28 +++++++++++++++-------------
9+
1 file changed, 15 insertions(+), 13 deletions(-)
10+
11+
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
12+
index 7a2daa2a..29b771a1 100644
13+
--- a/src/corelib/io/qprocess_unix.cpp
14+
+++ b/src/corelib/io/qprocess_unix.cpp
15+
@@ -1,7 +1,7 @@
16+
/****************************************************************************
17+
**
18+
** Copyright (C) 2016 The Qt Company Ltd.
19+
-** Copyright (C) 2016 Intel Corporation.
20+
+** Copyright (C) 2022 Intel Corporation.
21+
** Contact: https://www.qt.io/licensing/
22+
**
23+
** This file is part of the QtCore module of the Qt Toolkit.
24+
@@ -422,14 +422,15 @@ void QProcessPrivate::startProcess()
25+
// Add the program name to the argument list.
26+
argv[0] = nullptr;
27+
if (!program.contains(QLatin1Char('/'))) {
28+
+ // findExecutable() returns its argument if it's an absolute path,
29+
+ // otherwise it searches $PATH; returns empty if not found (we handle
30+
+ // that case much later)
31+
const QString &exeFilePath = QStandardPaths::findExecutable(program);
32+
- if (!exeFilePath.isEmpty()) {
33+
- const QByteArray &tmp = QFile::encodeName(exeFilePath);
34+
- argv[0] = ::strdup(tmp.constData());
35+
- }
36+
- }
37+
- if (!argv[0])
38+
+ const QByteArray &tmp = QFile::encodeName(exeFilePath);
39+
+ argv[0] = ::strdup(tmp.constData());
40+
+ } else {
41+
argv[0] = ::strdup(encodedProgramName.constData());
42+
+ }
43+
44+
// Add every argument to the list
45+
for (int i = 0; i < arguments.count(); ++i)
46+
@@ -975,15 +976,16 @@ bool QProcessPrivate::startDetached(qint64 *pid)
47+
envp = _q_dupEnvironment(environment.d.constData()->vars, &envc);
48+
}
49+
50+
- QByteArray tmp;
51+
if (!program.contains(QLatin1Char('/'))) {
52+
+ // findExecutable() returns its argument if it's an absolute path,
53+
+ // otherwise it searches $PATH; returns empty if not found (we handle
54+
+ // that case much later)
55+
const QString &exeFilePath = QStandardPaths::findExecutable(program);
56+
- if (!exeFilePath.isEmpty())
57+
- tmp = QFile::encodeName(exeFilePath);
58+
+ const QByteArray &tmp = QFile::encodeName(exeFilePath);
59+
+ argv[0] = ::strdup(tmp.constData());
60+
+ } else {
61+
+ argv[0] = ::strdup(QFile::encodeName(program));
62+
}
63+
- if (tmp.isEmpty())
64+
- tmp = QFile::encodeName(program);
65+
- argv[0] = tmp.data();
66+
67+
if (envp)
68+
qt_safe_execve(argv[0], argv, envp);
69+
--
70+
2.34.1
71+

SPECS/qt5-qtbase/qt5-qtbase.spec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
Name: qt5-qtbase
3434
Summary: Qt5 - QtBase components
3535
Version: 5.12.11
36-
Release: 13%{?dist}
36+
Release: 14%{?dist}
3737
# See LICENSE.GPL3-EXCEPT.txt, for exception details
3838
License: GFDL AND LGPLv3 AND GPLv2 AND GPLv3 with exceptions AND QT License Agreement 4.0
3939
Vendor: Microsoft Corporation
@@ -163,6 +163,8 @@ Patch90: CVE-2022-25643.patch
163163
Patch91: qt5-qtbase-5.15-http-encrypted-signal.patch
164164
Patch92: CVE-2024-39936.patch
165165

166+
Patch93: CVE-2022-25255.patch
167+
166168
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
167169
# Those themes are there for platform integration. If the required libraries are
168170
# not there, the platform to integrate with isn't either. Then Qt will just
@@ -276,6 +278,7 @@ Qt5 libraries used for drawing widgets and OpenGL items.
276278
%patch90 -p1
277279
%patch91 -p1
278280
%patch92 -p1
281+
%patch93 -p1
279282

280283
## upstream patches
281284

@@ -781,6 +784,9 @@ fi
781784
%{_qt5_libdir}/cmake/Qt5Gui/Qt5Gui_QXdgDesktopPortalThemePlugin.cmake
782785

783786
%changelog
787+
* Wed Oct 23 2024 Mykhailo Bykhovtsev <[email protected]> - 5.12.11-14
788+
- Add patch to resolve CVE-2022-25255.
789+
784790
* Wed Aug 07 2024 Sumedh Sharma <[email protected]> - 5.12.11-13
785791
- Add patch to resolve CVE-2024-39936.
786792

0 commit comments

Comments
 (0)