From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7020A5172EF; Wed, 30 Sep 2026 18:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790792371; cv=none; b=OlZiWIwIjIIiQyrLhQ2q+JICdenRXBlipt8tYtKa06ga9HKEdF5C3SpBzh/hzXcg291fSRcqmnxYeDVkw7EJOWBORVuUM1Ed7riLb/BfJBRHt8QOD/xehbhU6SMTWWubmFIclOn4gsOTA3k5rx9WadpFaaUK9YUQJrjnz43COvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790792371; c=relaxed/simple; bh=EjnHnSy/YU+mLZqw+EZvyXuq3jPUvgJhoJB7PA0gHas=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qK33SMiL+65grtM+lhylcjTZcbAXnJl0HL9fV2eClJWCCghSyxRbduZxrOkYf7cIq4ya4TdoxHiYwTwM1A5e6dG3MIFnxRVYeuewQCtOQ0dhCD4c+zN3hJL20DySHhSb4oIpeK/ToeUMqXtZyQsVCvyPaF4kX10P8ksiJzstDjg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vG/67zCu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vG/67zCu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E8551F000FF; Wed, 30 Sep 2026 18:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790792370; bh=+mxJyBtmx8huIXeFDJ/NGbUGCFsprnG/Mbf1oLVGqWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vG/67zCuSVNF3WhANDZLBXB9HolGWsUw3xyH+rgo7+9itKi0xzj7N0hwVtKyghKk7 F0N69dHxqRj83vXPKoNtHR9WEHLaW3Yt8UYLe4IbmTtrbnco5M2TpqMF8sf2P3HubD fx4L4f/vJo6R+RMVJ7nB478ZImNS8WiRytIfbgFw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Junrui Luo , Dmitry Osipenko , Sasha Levin Subject: [PATCH 5.15 631/752] drm/virtio: fix object leaks in virtio_gpu_resource_create_blob_ioctl() Date: Wed, 30 Sep 2026 17:28:21 +0200 Message-ID: <20260930152411.924388251@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152358.131179731@linuxfoundation.org> References: <20260930152358.131179731@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Junrui Luo [ Upstream commit 24b6d5c7641412c9ebef0d4c8b888d49a0e6b880 ] virtio_gpu_resource_create_blob_ioctl() calls drm_gem_object_release() on both the virtio_gpu_resource_assign_uuid() and drm_gem_handle_create() error paths instead of dropping the reference it owns, so obj->funcs->free() never runs and the virtio_gpu_object, the resource id and the host-side resource are leaked. Use drm_gem_object_put() instead. Fixes: 897b4d1acaf5 ("drm/virtio: implement blob resources: resource create blob ioctl") Assisted-by: Claude:claude-opus-5 Signed-off-by: Junrui Luo Signed-off-by: Dmitry Osipenko Link: https://patch.msgid.link/20260915-fixes-v2-3-a0d799e4db66@outlook.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3f327a8a8aa3a..97f05f07184af 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -654,14 +654,14 @@ static int virtio_gpu_resource_create_blob_ioctl(struct drm_device *dev, if (params.blob_flags & VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE) { ret = virtio_gpu_resource_assign_uuid(vgdev, bo); if (ret) { - drm_gem_object_release(obj); + drm_gem_object_put(obj); return ret; } } ret = drm_gem_handle_create(file, obj, &handle); if (ret) { - drm_gem_object_release(obj); + drm_gem_object_put(obj); return ret; } -- 2.53.0