Skip to content

Commit c8d99bb

Browse files
committed
drm/msm: Fix legacy relocs path
In moving code around, we ended up using the same pointer to copy_from_user() the relocs tables as we used for the cmd table entry, which is clearly not right. This went unnoticed because modern mesa on non-ancent kernels does not actually use relocs. But this broke ancient mesa on modern kernels. Reported-by: Emil Velikov <[email protected]> Fixes: 20224d7 ("drm/msm/submit: Move copy_from_user ahead of locking bos") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Akhil P Oommen <[email protected]>
1 parent 7df222c commit c8d99bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ static int submit_lookup_cmds(struct msm_gem_submit *submit,
198198
submit->cmd[i].idx = submit_cmd.submit_idx;
199199
submit->cmd[i].nr_relocs = submit_cmd.nr_relocs;
200200

201+
userptr = u64_to_user_ptr(submit_cmd.relocs);
202+
201203
sz = array_size(submit_cmd.nr_relocs,
202204
sizeof(struct drm_msm_gem_submit_reloc));
203205
/* check for overflow: */

0 commit comments

Comments
 (0)