diff options
author | Rob Clark <robdclark@chromium.org> | 2021-02-04 23:53:11 +0100 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-02-05 19:00:10 +0100 |
commit | c8d99bb938d3303989c4988caf090084073e85a2 (patch) | |
tree | 43b7ec4cc6612833ef387cf56b5cbf93a172fee7 /drivers/gpu | |
parent | drm/msm/disp/mdp5: mdp5_cfg: Fix msm8974v2 max_clk (diff) | |
download | linux-c8d99bb938d3303989c4988caf090084073e85a2.tar.xz linux-c8d99bb938d3303989c4988caf090084073e85a2.zip |
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 <emil.velikov@collabora.com>
Fixes: 20224d715a88 ("drm/msm/submit: Move copy_from_user ahead of locking bos")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Akhil P Oommen <akhilpo@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index d04c349d8112..5480852bdeda 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -198,6 +198,8 @@ static int submit_lookup_cmds(struct msm_gem_submit *submit, submit->cmd[i].idx = submit_cmd.submit_idx; submit->cmd[i].nr_relocs = submit_cmd.nr_relocs; + userptr = u64_to_user_ptr(submit_cmd.relocs); + sz = array_size(submit_cmd.nr_relocs, sizeof(struct drm_msm_gem_submit_reloc)); /* check for overflow: */ |