Skip to content

Commit 0573a1e

Browse files
BNieuwenhuizenalexdeucher
authored andcommitted
drm/amdgpu: Actually check flags for all context ops.
Missing validation ... Checked libdrm and it clears all the structs, so we should be safe to just check everything. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit c6b8642) Cc: [email protected]
1 parent e6c6bd6 commit 0573a1e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,16 +685,24 @@ int amdgpu_ctx_ioctl(struct drm_device *dev, void *data,
685685

686686
switch (args->in.op) {
687687
case AMDGPU_CTX_OP_ALLOC_CTX:
688+
if (args->in.flags)
689+
return -EINVAL;
688690
r = amdgpu_ctx_alloc(adev, fpriv, filp, priority, &id);
689691
args->out.alloc.ctx_id = id;
690692
break;
691693
case AMDGPU_CTX_OP_FREE_CTX:
694+
if (args->in.flags)
695+
return -EINVAL;
692696
r = amdgpu_ctx_free(fpriv, id);
693697
break;
694698
case AMDGPU_CTX_OP_QUERY_STATE:
699+
if (args->in.flags)
700+
return -EINVAL;
695701
r = amdgpu_ctx_query(adev, fpriv, id, &args->out);
696702
break;
697703
case AMDGPU_CTX_OP_QUERY_STATE2:
704+
if (args->in.flags)
705+
return -EINVAL;
698706
r = amdgpu_ctx_query2(adev, fpriv, id, &args->out);
699707
break;
700708
case AMDGPU_CTX_OP_GET_STABLE_PSTATE:

0 commit comments

Comments
 (0)