All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gyeyoung Baek <gye976@gmail.com>
To: stable@vger.kernel.org
Cc: Guangshuo Li <lgs201920130244@gmail.com>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	Gyeyoung Baek <gye976@gmail.com>
Subject: [PATCH 7.3.y 1/2] accel/rocket: put IOMMU domain on BO creation failure
Date: Wed,  2 Dec 2026 23:31:06 +0900	[thread overview]
Message-ID: <20261202143107.620649-1-gye976@gmail.com> (raw)
In-Reply-To: <2026120219-prize-curled-f73f@gregkh>

From: Guangshuo Li <lgs201920130244@gmail.com>

rocket_ioctl_create_bo() takes an IOMMU domain reference for each newly
created BO.

The normal GEM object release path drops that reference from
rocket_gem_bo_free(). However, the BO creation error paths free the
object with drm_gem_shmem_object_free(), which bypasses the driver's GEM
.free callback. Those paths therefore release the shmem object without
dropping the IOMMU domain reference.

Drop the domain reference explicitly on the BO creation error path before
freeing the shmem object.

Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://patch.msgid.link/20260708114354.753817-1-lgs201920130244@gmail.com
(cherry picked from commit 90035d3f26e011e16fcf9c5071571f0d956b5219)
Signed-off-by: Gyeyoung Baek <gye976@gmail.com>
---
 drivers/accel/rocket/rocket_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/accel/rocket/rocket_gem.c b/drivers/accel/rocket/rocket_gem.c
index d981c6a93ff..79135351b8e 100644
--- a/drivers/accel/rocket/rocket_gem.c
+++ b/drivers/accel/rocket/rocket_gem.c
@@ -127,6 +127,8 @@ int rocket_ioctl_create_bo(struct drm_device *dev, void *data, struct drm_file *
 	mutex_unlock(&rocket_priv->mm_lock);
 
 err:
+	rocket_iommu_domain_put(rkt_obj->domain);
+	rkt_obj->domain = NULL;
 	drm_gem_shmem_object_free(gem_obj);
 
 	return ret;
-- 
2.43.0


  parent reply	other threads:[~2026-12-02 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 11:09 FAILED: patch "[PATCH] accel/rocket: Fix drm_mm UAF on close vs in-flight job" failed to apply to 7.3-stable tree gregkh
2026-12-02 14:27 ` [PATCH 7.3.y 1/2] accel/rocket: put IOMMU domain on BO creation failure Gyeyoung Baek
2026-12-02 14:31 ` Gyeyoung Baek [this message]
2026-12-02 14:31   ` [PATCH 7.3.y 2/2] accel/rocket: Fix drm_mm UAF on close vs in-flight job Gyeyoung Baek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202143107.620649-1-gye976@gmail.com \
    --to=gye976@gmail.com \
    --cc=lgs201920130244@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tomeu@tomeuvizoso.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.