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 86BCB4F55B6; Wed, 30 Sep 2026 16:53:17 +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=1790787198; cv=none; b=ifGNIv77GHICSQyMWridLHM5UHz8GcPdINI2//cB0ByRa1kmaWvvvwY60PcMSy6kFjuZtk0ZL1+/oIt5nTAbNjJA9RuZ7cVZZrvZIVCQS5HUGGROOlmxkaG32ViMf7p9EAn6tcGgVl9Mk4bwJXFYvLryK0Pj2GoyBpcx5gwQY9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790787198; c=relaxed/simple; bh=XthYtVVVi+MYrbT30CA62fsa1aP4aCH7WII8as3him8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JDM0uF3vEeDQJNf/2Pu8E/wruRlBZUMnb1frY0rTlzE81MqwqjKfHbZ/2owJ6MeOtn+Z7Ddw6LrAa4C4v6ugbZlCLmpDPem2IEYv+hrN+P8CuDL5aBITa3tFuqYEtsXYjnrs0ZN34tMCR1f+dwx1OtnzFzCjkRSLBnAIbt/+wEA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=sNi0KBxa; 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="sNi0KBxa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1C571F000FF; Wed, 30 Sep 2026 16:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790787197; bh=jkLhUerXRHSFwKstCAvpBPp3F6CrVmvFml8LNnZjsiA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sNi0KBxaoXHw8zdyrfyNBF4H6QVIGUfOI320/PXNu4kYOEJcBpXFQ7OWvsySr/9MW 10LJfCQSw0c/gtPirvFuMW7bWkhPYIHYwPdsNSMPeUWT8rUOMoxcAVAHVm4QpauVsz pAhxk8CSkNBxTUkah2N5zWY2hLSWSPjFKHd3Oknw= 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 7.2 109/457] drm/virtio: fix object leak in virtio_gpu_resource_create_ioctl() Date: Wed, 30 Sep 2026 17:23:34 +0200 Message-ID: <20260930152348.406130077@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152346.024115587@linuxfoundation.org> References: <20260930152346.024115587@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Junrui Luo [ Upstream commit 477bc3068fc3777b9d8ffd79e265b0dfdf2d3a6b ] virtio_gpu_resource_create_ioctl() calls drm_gem_object_release() on the drm_gem_handle_create() error path instead of dropping the reference it owns, so obj->funcs->free() never runs and the virtio_gpu_object, its pages and sg table, the resource id and the host-side resource are leaked. Use drm_gem_object_put() instead. Fixes: 62fb7a5e1096 ("virtio-gpu: add 3d/virgl support") Assisted-by: Claude:claude-opus-5 Signed-off-by: Junrui Luo Signed-off-by: Dmitry Osipenko Link: https://patch.msgid.link/20260915-fixes-v2-2-a0d799e4db66@outlook.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index 3d8e4ccdb7c1f..d16f07abb266a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -185,7 +185,7 @@ static int virtio_gpu_resource_create_ioctl(struct drm_device *dev, void *data, 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