From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 261581382C5 for ; Thu, 7 Jan 2021 16:31:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5BDF9E083D; Thu, 7 Jan 2021 16:31:58 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 38772E083D for ; Thu, 7 Jan 2021 16:31:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EDEC83413E8 for ; Thu, 7 Jan 2021 16:31:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 79B434B for ; Thu, 7 Jan 2021 16:31:55 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1610037032.df09d077cf4b5361c6d9e8c7da213cb46206e4a5.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtwayland/, dev-qt/qtwayland/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild X-VCS-Directories: dev-qt/qtwayland/files/ dev-qt/qtwayland/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: df09d077cf4b5361c6d9e8c7da213cb46206e4a5 X-VCS-Branch: master Date: Thu, 7 Jan 2021 16:31:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 8785a86a-e9d4-48dc-8102-ef352a8d3160 X-Archives-Hash: a3d581f930149138d1093bdc7416abc4 commit: df09d077cf4b5361c6d9e8c7da213cb46206e4a5 Author: Andreas Sturmlechner gentoo org> AuthorDate: Thu Jan 7 15:23:57 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Thu Jan 7 16:30:32 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df09d077 dev-qt/qtwayland: Scanner: Avoid dangling pointers in destroy_func() See also: https://mail.kde.org/pipermail/plasma-devel/2021-January/119115.html Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner gentoo.org> ...-qtwaylandscanner-avoid-dangling-pointers.patch | 35 ++++++++++++++++++ dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild | 41 ++++++++++++++++++++++ 2 files changed, 76 insertions(+) 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 new file mode 100644 index 00000000000..0799cb1a202 --- /dev/null +++ b/dev-qt/qtwayland/files/qtwayland-5.15.2-qtwaylandscanner-avoid-dangling-pointers.patch @@ -0,0 +1,35 @@ +From 735164b5c2a2637a8d53a8803a2401e4ef477ff0 Mon Sep 17 00:00:00 2001 +From: Vlad Zahorodnii +Date: Fri, 30 Oct 2020 16:55:30 +0200 +Subject: [PATCH] Scanner: Avoid accessing dangling pointers in destroy_func() + +Usually, the object associated with the resource gets destroyed in the +destroy_resource() function. + +Therefore, we need to double-check that the object is still alive before +trying to reset its m_resource. + +Pick-to: 5.15 +Change-Id: I26408228f58919db17eb29584a1cbd4a9427d25c +Reviewed-by: Eskil Abrahamsen Blomfeldt +--- + src/qtwaylandscanner/qtwaylandscanner.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/qtwaylandscanner/qtwaylandscanner.cpp b/src/qtwaylandscanner/qtwaylandscanner.cpp +index 1a1f8bf16..450ef519d 100644 +--- a/src/qtwaylandscanner/qtwaylandscanner.cpp ++++ b/src/qtwaylandscanner/qtwaylandscanner.cpp +@@ -814,7 +814,9 @@ bool Scanner::process() + printf(" if (Q_LIKELY(that)) {\n"); + printf(" that->m_resource_map.remove(resource->client(), resource);\n"); + printf(" that->%s_destroy_resource(resource);\n", interfaceNameStripped); +- printf(" if (that->m_resource == resource)\n"); ++ printf("\n"); ++ printf(" that = resource->%s_object;\n", interfaceNameStripped); ++ printf(" if (that && that->m_resource == resource)\n"); + printf(" that->m_resource = nullptr;\n"); + printf(" }\n"); + printf(" delete resource;\n"); +-- +2.16.3 diff --git a/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild new file mode 100644 index 00000000000..ea32d4ffc9c --- /dev/null +++ b/dev-qt/qtwayland/qtwayland-5.15.2-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit qt5-build + +DESCRIPTION="Wayland platform plugin for Qt" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +fi + +IUSE="vulkan X" + +DEPEND=" + >=dev-libs/wayland-1.6.0 + ~dev-qt/qtcore-${PV} + ~dev-qt/qtdeclarative-${PV} + ~dev-qt/qtgui-${PV}[egl,libinput,vulkan=] + media-libs/mesa[egl] + >=x11-libs/libxkbcommon-0.2.0 + vulkan? ( dev-util/vulkan-headers ) + X? ( + ~dev-qt/qtgui-${PV}[-gles2-only] + x11-libs/libX11 + x11-libs/libXcomposite + ) +" +RDEPEND="${DEPEND}" + +PATCHES=( "${FILESDIR}"/${P}-qtwaylandscanner-avoid-dangling-pointers.patch ) + +src_configure() { + local myqmakeargs=( + -- + $(qt_use vulkan feature-wayland-vulkan-server-buffer) + $(qt_use X feature-xcomposite-egl) + $(qt_use X feature-xcomposite-glx) + ) + qt5-build_src_configure +}