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=1796380772; b=Y8eSt5ZdlefsMG7lsUDhGzVZ9hpUiHXaftJ7LbbCTf6R+nrW4juG35EOFfB0mz6zodEB mULaks7Qs1VfeTpXS3ViSbPdVOTec2Dfb2IOQcO5tFxNj6Z5zgGKBRj0IHKY0hc3LIhb4 qW+0WjRd0dGWngVluOzrTHbjEnWBdRRsdgk9dSY0zWq7+jn2IL/xdk+eA9r2n7DSViOh3 BqB7JymOkqtTpIAhd7GH27fvSzL3sLcoCUr1crngYKRosnuRUh1/Tpf7OU0PDaHqUaXRs MoucIgBOePFLh8TF53FdCGRxn3E2eAv2taR2+y4hjRllkSNBuuKK6D3WtEvbeOiQdaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380772; 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=uNn1NwdRuN6wsp2UFM9kgQ0tmPz4SbSn/TMdqoboX6U=; b=OsHUE27b4PtsXWcH6J6YkNbHWqna6LOvjbA+z01gWiUPthJGlky7iR1DL+2bgsP57YNg W3SvybW4RWRB1s7nv03XZ7kVFfELjqP/rey3kzZZzhXpqvoh5otMvsRj259FmEdwnHvRl /7YslUFI2zPYXC88j9oiTD36dad/BT3u+mjXp9hFikLFqQTHEz+AkuHNroE6XMDAv5RMo brTpiG1o5DMZdsCnYbYeK2avKpVdnQXMWeEX38gXBZunfgS0o3hK94MbeKng1oVCkeJ09 WgZSESwaMENea0dhtUqLTzDZwdmmEyjRbkaJa8b5CwornU1NXpbfVA8o6zrlGt8807Q== 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=jtPqoc9d; 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 4117A606A322; Fri, 4 Dec 2026 10:39:32 +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=jtPqoc9d Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABB531F000CE; Fri, 4 Dec 2026 10:39:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380772; bh=uNn1NwdRuN6wsp2UFM9kgQ0tmPz4SbSn/TMdqoboX6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jtPqoc9dhc7wszUVxtJS/ad1H4mP/Ta2uw2/jPV5+FOae7YneyjwImbLnpN7QuOaT lkHQn/qCru8ZgprhqFzM3AkyL0GOEX226oY1cK6Jd7RLzz9W7kWKgjo/1Bd7wEPWMO ecaL85VJx6U1p49/Ln6fBk5igbvMA2T1a3u2/CdY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zack Rusin , Maaz Mombasawala , fausten Subject: [PATCH 7.3 418/742] drm/vmwgfx: reserve dumb buffers while detaching their surfaces Date: Fri, 4 Dec 2026 19:04:42 +0900 Message-ID: <20261204100646.206296779@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@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 7.3-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);