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=1796382276; b=XxwER8OUBpkj0b1nv43zZpT4G+6HYJUOX0h1UBOiPjXALa9UUXNxykGef0j0TbkqvKjs LH7Vg0zr2x58Hl2xCnt+9k3J4LC/TV0xWS6mX88VGuGqqV7ukDSk1bBH+rAv6fS8BXq/0 9xj5fzXUge0aS8f17l7efvm5l+J3Wf23pmDYwgdvOG91ZdMY4ASCqRskIVjfTpfH+k/Eq r5lhESIvzn8pr12t1LgEOj/3/Up2AwE6kprpqEOGJMjDqFN6DroqWQt2kuWjhhtUNa1co HaxpUMU/CPyBOqqv7I/veEamXBjPMh3x2Gwn7NUcwc9h0RJZuS+m+Y7UR4e3TWpwYDg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382276; 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=jXTvazK5oYNTPMbUFqOwEoK+U7KCbh1vOdbz+8qkrmw=; b=EqPVri82LaecSw3L/pcao283BYMYgYFgKIBgFe0I5PiyrPXiF1pNa+GGE0y1fEHcJuzd fX2PXkh4fSL/ov7SQD7UkWoD2M1QemNrVA60gHm1OvOkwL/2Q9Eq/HMnI3CWeULd1r3+k VkGLhYDucjX3Ebb95Y6ARc4NJEz+Pg10X2ND03m7vX9xGaxCZbzCSiXQx/fS07csxSm2C ZOfINmTxa+KAAXLMNV1oCWLEF1zC93HizVOfC4gZXhofHr5DM1dpt6WUMB0Q+tMYMtntA iFSBlbzMGLD/bah/ZL2NbyY/HcgKTKHsmGNrf/0l3hixZSQ3N/jHPJFltYyANOiK0Mw== 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="ZWXScuh/"; 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 5619D606A32D; Fri, 4 Dec 2026 11:04:36 +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=ZWXScuh/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE2561F000C2; Fri, 4 Dec 2026 11:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382276; bh=jXTvazK5oYNTPMbUFqOwEoK+U7KCbh1vOdbz+8qkrmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZWXScuh/oHdBw/9aEHeRMS4j/4dV5ZZNvUVUDovTnfOp5zI43SpZ5rWE76wpdTKjE DyGSkPO58NEYGzI/XpXUODL1LlkcyzGXWlR0oJ3QbTcx5ODrfv1eO/m6m1plQVbnBA bSaUZPWzIQHxJgaKW6UNzIJE1FleYIhBOFb334GM= 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.18 384/703] drm/vmwgfx: reserve dumb buffers while detaching their surfaces Date: Fri, 4 Dec 2026 19:04:43 +0900 Message-ID: <20261204100638.059338562@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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 @@ -55,6 +55,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); @@ -62,6 +64,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);