From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796383746; b=U+gi6J8r9niQNODQvdqnKqph0/PgnbI1jLHAMQ4TBjaU5EFpCkaOIQAu/ix27vA95jg/ OusS5XqLn6PghJ6ba23BH3LPWCGaZmerzW7avcJjZSX6Xo4hdgzFJfzGa3vUUhPfk2UoP NS4M5BFWI6+q8YJ8cMtL9kBuufFBzIv+7j384kHZdTGMTwlLiDjCAPcAsMpJiHBSvFQPJ 2vFSEwhCgnyomecFGhA9W15axwoejKFyQK2E5znSNv14COlRnXLCr4WTQffK/Qlo9mDp0 IUHTFtPC/sdjhfcYjfQAW9a5t9aUK0gIYD07+c5zqzkqBwpvsZQdkuWvA2qw7KD3ljw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383746; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=ad5NHMfljc5955FQezVXsviOJ64CiTHORVq3y79pTQY=; b=XOvehmmI6DTM3UCzcZ8v8xNPM3zeIemfqAZBRGNYfhjbwagRSZwz68kX9bdAf7g32qqK ApL3PVCdGU/ZD/VqTqM9MfmOHpUBjBleDdpy2KVnTMXbjBnhWJdKwdGjflOaDDdgNiKV6 fMCF/b1H4Abq59GusPdqZrvJTcmRnwvqrlUnIsr/t9ud/osz/ZtIobhPurjXxEWEjWTwY JWZaFLwoWsbQkzYomlJFVFWqW8ybieoV/HbCQxqhr4XuGudJ3Dh0O+PjLB1xEU/NyAcPO uXLHAcrc1YLppphW03H7WDmSxx4JjTslMftE7xiBG6hVnM1lXYvtMk0VPvurifSb+/A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=JPwd+4Dv; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3DDE606A322; Fri, 4 Dec 2026 11:29:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=JPwd+4Dv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2959A1F000CE; Fri, 4 Dec 2026 11:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383746; bh=ad5NHMfljc5955FQezVXsviOJ64CiTHORVq3y79pTQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JPwd+4DvdeafzLnLCqR4XbUxo6t9granG68fEzy6OLsIdAm4kFAxvVB74mRW7D/5y y/KJuL+q9DEbP4z5qNBJUNm091zQ3+rV8e3qNMbgGfo7ChNYv6+9OGGHzFMnCO/9nE mj6IQUzUTPSth+PkoZX8j8XIRUxWFjuPyGnUZKfI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zack Rusin , Maaz Mombasawala , fausten Subject: [PATCH 6.12 351/555] drm/vmwgfx: reserve dumb buffers while detaching their surfaces Date: Fri, 4 Dec 2026 19:06:34 +0900 Message-ID: <20261204100623.334053345@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zack Rusin commit 13e766130673ec3b9df8b72ff1dbe6826cac1dfe upstream. vmw_bo_free() detaches the surface associated with a dumb buffer and clears its guest memory binding. It reserves the resource, but does not hold the buffer reservation required by vmw_resource_mob_detach(). TTM releases that reservation before invoking the buffer destructor. KMS clients destroying dumb buffers can therefore trigger the reservation assertion from vmw_resource_mob_detach(). GNOME reaches this path through DRM_IOCTL_MODE_DESTROY_DUMB during cursor and display updates. Reacquire the buffer reservation while detaching the surface and clearing its dirty tracking and guest memory binding. Acquire it after cmdbuf_mutex, following the command validation lock order, and release it before releasing the resource and GEM object. Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-5-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_bo.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_bo.c @@ -56,6 +56,8 @@ static void vmw_bo_free(struct ttm_buffe /* Reserve and switch the backing mob. */ mutex_lock(&res->dev_priv->cmdbuf_mutex); (void)vmw_resource_reserve(res, false, true); + /* TTM drops the reservation before calling the destructor. */ + dma_resv_lock(bo->base.resv, NULL); vmw_resource_mob_detach(res); if (res->dirty) res->func->dirty_free(res); @@ -63,6 +65,7 @@ static void vmw_bo_free(struct ttm_buffe vmw_bo_dirty_release(res->guest_memory_bo); res->guest_memory_bo = NULL; res->guest_memory_offset = 0; + dma_resv_unlock(bo->base.resv); vmw_resource_unreserve(res, true, false, false, NULL, 0); mutex_unlock(&res->dev_priv->cmdbuf_mutex);