]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe: Skip address copy for sync-only execs
authorShuicheng Lin <shuicheng.lin@intel.com>
Thu, 22 Jan 2026 21:40:54 +0000 (21:40 +0000)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Mon, 26 Jan 2026 13:50:32 +0000 (14:50 +0100)
commitc73a8917b31e8ddbd53cc248e17410cec27f8f58
treeda2bdb274da5a5af7d617595e6bd23dacc30918a
parente27ada4f19e7ffda4c05ce8633daf6daed667eea
drm/xe: Skip address copy for sync-only execs

For parallel exec queues, xe_exec_ioctl() copied the batch buffer address
array from userspace without checking num_batch_buffer.
If user creates a sync-only exec that doesn't use the address field, the
exec will fail with -EFAULT.
Add num_batch_buffer check to skip the copy, and the exec could be executed
successfully.

Here is the sync-only exec:
struct drm_xe_exec exec = {
    .extensions = 0,
    .exec_queue_id = qid,
    .num_syncs = 1,
    .syncs = (uintptr_t)&sync,
    .address = 0,            /* ignored for sync-only */
    .num_batch_buffer = 0,   /* sync-only */
};

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260122214053.3189366-2-shuicheng.lin@intel.com
(cherry picked from commit 4761791c1e736273d612ff564f318bfbbb04fa4e)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
drivers/gpu/drm/xe/xe_exec.c