Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 972CE18E351 for ; Tue, 20 Aug 2024 23:51:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724197861; cv=none; b=de8jJGZncNLAmGfUK6zH5c1/ozFGiwXnP3Fq5T6pICW07dlIshlrdYUrfLpm8u2/0AfPWU800pnT8+XMUJ7g3OUbiSNkiudZBeG7O6Phm2D6FvXZCn/W/tOoyph+qRmP45dIkH0MT87KM9kVyKN2eYTaSq2uW4NB1c/6Z9Yu2ps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724197861; c=relaxed/simple; bh=Pi/AoIHgKf6GEAqwQEABkFHpr0k/KWWeQVf+teC1d7k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AajQiaCXsIAwzVLEGUbDoRZTXlBR7MK76cAIFsQg5ZigzG2NmXBSgw0vayC8D4o1Ou2uLZI0/DCTR1DingN4h3XaBL2gga0zUbgscxwh39XeNs5RP/lDZh3HXg1u3QrO3428jvKcpNB6JfhYFdtM+7ku6cOrpBqU2yYGsTke7rI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SW6DYLuQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SW6DYLuQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C252AC4AF09; Tue, 20 Aug 2024 23:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724197861; bh=Pi/AoIHgKf6GEAqwQEABkFHpr0k/KWWeQVf+teC1d7k=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SW6DYLuQNd2ckzegXUsK+nvtaRLqMg3gip8iNtHNcGd++cAIFVTV+rsX9bG2iCJps ZQ4SsNMXb3pOf5Dx910xeYZs3PHHujztBc7MnbjOW69dCwjX56RBCyrGHXJTJsaXBM YNsAbKZuiZpE+0FbItP3O/urBedbjIGTynX2pBBE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-43863: drm/vmwgfx: Fix a deadlock in dma buf fence polling Date: Wed, 21 Aug 2024 07:50:56 +0800 Message-ID: <2024082156-CVE-2024-43863-9124@gregkh> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3114; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Pi/AoIHgKf6GEAqwQEABkFHpr0k/KWWeQVf+teC1d7k=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlHtR8c6/TZsPfWrRuVfwLWfW/eN2P9doWJjHP1Cwx0z oVUpQjUdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEDr9mWHDgkrT50vKPHwVe pzGuCbu9l5lj0gWGBX2F5ZIGCU5dOcs4J79yf9JRm/WyGwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: drm/vmwgfx: Fix a deadlock in dma buf fence polling Introduce a version of the fence ops that on release doesn't remove the fence from the pending list, and thus doesn't require a lock to fix poll->fence wait->fence unref deadlocks. vmwgfx overwrites the wait callback to iterate over the list of all fences and update their status, to do that it holds a lock to prevent the list modifcations from other threads. The fence destroy callback both deletes the fence and removes it from the list of pending fences, for which it holds a lock. dma buf polling cb unrefs a fence after it's been signaled: so the poll calls the wait, which signals the fences, which are being destroyed. The destruction tries to acquire the lock on the pending fences list which it can never get because it's held by the wait from which it was called. Old bug, but not a lot of userspace apps were using dma-buf polling interfaces. Fix those, in particular this fixes KDE stalls/deadlock. The Linux kernel CVE team has assigned CVE-2024-43863 to this issue. Affected and fixed versions =========================== Issue introduced in 3.18 with commit 2298e804e96e and fixed in 5.15.165 with commit 9e20d028d8d1 Issue introduced in 3.18 with commit 2298e804e96e and fixed in 6.1.104 with commit 3b933b16c996 Issue introduced in 3.18 with commit 2298e804e96e and fixed in 6.6.45 with commit a8943969f9ea Issue introduced in 3.18 with commit 2298e804e96e and fixed in 6.10.4 with commit c98ab18b9f31 Issue introduced in 3.18 with commit 2298e804e96e and fixed in 6.11-rc2 with commit e58337100721 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-43863 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/gpu/drm/vmwgfx/vmwgfx_fence.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/9e20d028d8d1deb1e7fed18f22ffc01669cf3237 https://git.kernel.org/stable/c/3b933b16c996af8adb6bc1b5748a63dfb41a82bc https://git.kernel.org/stable/c/a8943969f9ead2fd3044fc826140a21622ef830e https://git.kernel.org/stable/c/c98ab18b9f315ff977c2c65d7c71298ef98be8e3 https://git.kernel.org/stable/c/e58337100721f3cc0c7424a18730e4f39844934f