summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/v3d/v3d_submit.c
diff options
context:
space:
mode:
authorMaíra Canal <mcanal@igalia.com>2023-11-30 13:40:28 -0300
committerMaíra Canal <mcanal@igalia.com>2023-12-01 09:34:12 -0300
commit6893deb881ab7da1691bd05045ffcc0c806319b9 (patch)
tree3073bf95717ccdc2ad7ce6c0f2d586c6bcaf9ca3 /drivers/gpu/drm/v3d/v3d_submit.c
parent8288faaa8b3817c2fcdbacc720527bb8df2b57b1 (diff)
drm/v3d: Don't allow two multisync extensions in the same job
Currently, two multisync extensions can be added to the same job and only the last multisync extension will be used. To avoid this vulnerability, don't allow two multisync extensions in the same job. Signed-off-by: Maíra Canal <mcanal@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231130164420.932823-7-mcanal@igalia.com
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_submit.c')
-rw-r--r--drivers/gpu/drm/v3d/v3d_submit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_submit.c b/drivers/gpu/drm/v3d/v3d_submit.c
index a0caf9c499bb..10141dc2820a 100644
--- a/drivers/gpu/drm/v3d/v3d_submit.c
+++ b/drivers/gpu/drm/v3d/v3d_submit.c
@@ -329,6 +329,11 @@ v3d_get_multisync_submit_deps(struct drm_file *file_priv,
struct v3d_submit_ext *se = data;
int ret;
+ if (se->in_sync_count || se->out_sync_count) {
+ DRM_DEBUG("Two multisync extensions were added to the same job.");
+ return -EINVAL;
+ }
+
if (copy_from_user(&multisync, ext, sizeof(multisync)))
return -EFAULT;