1 |
commit: df09d077cf4b5361c6d9e8c7da213cb46206e4a5 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 7 15:23:57 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 7 16:30:32 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df09d077 |
7 |
|
8 |
dev-qt/qtwayland: Scanner: Avoid dangling pointers in destroy_func() |
9 |
|
10 |
See also: https://mail.kde.org/pipermail/plasma-devel/2021-January/119115.html |
11 |
|
12 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
13 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
14 |
|
15 |
...-qtwaylandscanner-avoid-dangling-pointers.patch | 35 ++++++++++++++++++ |
16 |
dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild | 41 ++++++++++++++++++++++ |
17 |
2 files changed, 76 insertions(+) |
18 |
|
19 |
diff --git a/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch b/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..0799cb1a202 |
22 |
--- /dev/null |
23 |
+++ b/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch |
24 |
@@ -0,0 +1,35 @@ |
25 |
+From 735164b5c2a2637a8d53a8803a2401e4ef477ff0 Mon Sep 17 00:00:00 2001 |
26 |
+From: Vlad Zahorodnii <vlad.zahorodnii@×××.org> |
27 |
+Date: Fri, 30 Oct 2020 16:55:30 +0200 |
28 |
+Subject: [PATCH] Scanner: Avoid accessing dangling pointers in destroy_func() |
29 |
+ |
30 |
+Usually, the object associated with the resource gets destroyed in the |
31 |
+destroy_resource() function. |
32 |
+ |
33 |
+Therefore, we need to double-check that the object is still alive before |
34 |
+trying to reset its m_resource. |
35 |
+ |
36 |
+Pick-to: 5.15 |
37 |
+Change-Id: I26408228f58919db17eb29584a1cbd4a9427d25c |
38 |
+Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@××.io> |
39 |
+--- |
40 |
+ src/qtwaylandscanner/qtwaylandscanner.cpp | 4 +++- |
41 |
+ 1 file changed, 3 insertions(+), 1 deletion(-) |
42 |
+ |
43 |
+diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp |
44 |
+index 1a1f8bf16..450ef519d 100644 |
45 |
+--- a/src/qtwaylandscanner/qtwaylandscanner.cpp |
46 |
++++ b/src/qtwaylandscanner/qtwaylandscanner.cpp |
47 |
+@@ -814,7 +814,9 @@ bool Scanner::process() |
48 |
+ printf(" if (Q_LIKELY(that)) {\n"); |
49 |
+ printf(" that->m_resource_map.remove(resource->client(), resource);\n"); |
50 |
+ printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped); |
51 |
+- printf(" if (that->m_resource == resource)\n"); |
52 |
++ printf("\n"); |
53 |
++ printf(" that = resource->%s_object;\n", interfaceNameStripped); |
54 |
++ printf(" if (that && that->m_resource == resource)\n"); |
55 |
+ printf(" that->m_resource = nullptr;\n"); |
56 |
+ printf(" }\n"); |
57 |
+ printf(" delete resource;\n"); |
58 |
+-- |
59 |
+2.16.3 |
60 |
|
61 |
diff --git a/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild |
62 |
new file mode 100644 |
63 |
index 00000000000..ea32d4ffc9c |
64 |
--- /dev/null |
65 |
+++ b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild |
66 |
@@ -0,0 +1,41 @@ |
67 |
+# Copyright 1999-2021 Gentoo Authors |
68 |
+# Distributed under the terms of the GNU General Public License v2 |
69 |
+ |
70 |
+EAPI=7 |
71 |
+inherit qt5-build |
72 |
+ |
73 |
+DESCRIPTION="Wayland platform plugin for Qt" |
74 |
+ |
75 |
+if [[ ${QT5_BUILD_TYPE} == release ]]; then |
76 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" |
77 |
+fi |
78 |
+ |
79 |
+IUSE="vulkan X" |
80 |
+ |
81 |
+DEPEND=" |
82 |
+ >=dev-libs/wayland-1.6.0 |
83 |
+ ~dev-qt/qtcore-${PV} |
84 |
+ ~dev-qt/qtdeclarative-${PV} |
85 |
+ ~dev-qt/qtgui-${PV}[egl,libinput,vulkan=] |
86 |
+ media-libs/mesa[egl] |
87 |
+ >=x11-libs/libxkbcommon-0.2.0 |
88 |
+ vulkan? ( dev-util/vulkan-headers ) |
89 |
+ X? ( |
90 |
+ ~dev-qt/qtgui-${PV}[-gles2-only] |
91 |
+ x11-libs/libX11 |
92 |
+ x11-libs/libXcomposite |
93 |
+ ) |
94 |
+" |
95 |
+RDEPEND="${DEPEND}" |
96 |
+ |
97 |
+PATCHES=( "${FILESDIR}"/${P}-qtwaylandscanner-avoid-dangling-pointers.patch ) |
98 |
+ |
99 |
+src_configure() { |
100 |
+ local myqmakeargs=( |
101 |
+ -- |
102 |
+ $(qt_use vulkan feature-wayland-vulkan-server-buffer) |
103 |
+ $(qt_use X feature-xcomposite-egl) |
104 |
+ $(qt_use X feature-xcomposite-glx) |
105 |
+ ) |
106 |
+ qt5-build_src_configure |
107 |
+} |