From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH 1/2] drm/xe: Fix possible exec queue leak in exec IOCTL
Date: Mon, 4 Nov 2024 16:38:30 -0800 [thread overview]
Message-ID: <20241105003832.4021758-2-matthew.brost@intel.com> (raw)
In-Reply-To: <20241105003832.4021758-1-matthew.brost@intel.com>
In a couple of places after an exec queue is looked up the exec IOCTL
returns on input errors without dropping the exec queue ref. Fix this
ensuring the exec queue ref is dropped on input error.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: stable <stable@kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
drivers/gpu/drm/xe/xe_exec.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
index f23ac1e2ed88..6de12f91b865 100644
--- a/drivers/gpu/drm/xe/xe_exec.c
+++ b/drivers/gpu/drm/xe/xe_exec.c
@@ -132,12 +132,16 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
if (XE_IOCTL_DBG(xe, !q))
return -ENOENT;
- if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM))
- return -EINVAL;
+ if (XE_IOCTL_DBG(xe, q->flags & EXEC_QUEUE_FLAG_VM)) {
+ err = -EINVAL;
+ goto err_exec_queue;
+ }
if (XE_IOCTL_DBG(xe, args->num_batch_buffer &&
- q->width != args->num_batch_buffer))
- return -EINVAL;
+ q->width != args->num_batch_buffer)) {
+ err = -EINVAL;
+ goto err_exec_queue;
+ }
if (XE_IOCTL_DBG(xe, q->ops->reset_status(q))) {
err = -ECANCELED;
--
2.34.1
next prev parent reply other threads:[~2024-11-05 0:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 0:38 [PATCH 0/2] A couple exec IOCTL fixes Matthew Brost
2024-11-05 0:38 ` Matthew Brost [this message]
2024-11-05 2:44 ` [PATCH 1/2] drm/xe: Fix possible exec queue leak in exec IOCTL Rodrigo Vivi
2024-11-05 4:45 ` Matthew Brost
2024-11-05 0:38 ` [PATCH 2/2] drm/xe: Drop VM dma-resv lock on xe_sync_in_fence_get failure " Matthew Brost
2024-11-05 2:46 ` Rodrigo Vivi
2024-11-05 0:38 ` [PATCH v2] drm/xe: Restore system memory GGTT mappings Matthew Brost
-- strict thread matches above, loose matches on Subject: below --
2024-11-05 4:35 [PATCH 0/2] A couple exec IOCTL fixes Matthew Brost
2024-11-05 4:35 ` [PATCH 1/2] drm/xe: Fix possible exec queue leak in exec IOCTL Matthew Brost
2024-11-05 6:48 ` Upadhyay, Tejas
2024-11-05 20:52 ` Lucas De Marchi
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=20241105003832.4021758-2-matthew.brost@intel.com \
--to=matthew.brost@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox