Skip to content

Commit b31e513

Browse files
ickledanvet
authored andcommitted
drm/i915: Reject invalid-pad for context-destroy and -create ioctls
Unknown parameters, especially structure padding, are expected to invoke rejection with -EINVAL. v2: similar issue exists for context-create Testcase: igt/gem_ctx_create/invalid-pad Testcase: igt/gem_ctx_bad_destroy/invalid-pad Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89602 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93999 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1454690759-31201-1-git-send-email-chris@chris-wilson.co.uk
1 parent 22824fa commit b31e513

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/i915/i915_gem_context.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ int i915_gem_context_create_ioctl(struct drm_device *dev, void *data,
855855
if (!contexts_enabled(dev))
856856
return -ENODEV;
857857

858+
if (args->pad != 0)
859+
return -EINVAL;
860+
858861
ret = i915_mutex_lock_interruptible(dev);
859862
if (ret)
860863
return ret;
@@ -878,6 +881,9 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
878881
struct intel_context *ctx;
879882
int ret;
880883

884+
if (args->pad != 0)
885+
return -EINVAL;
886+
881887
if (args->ctx_id == DEFAULT_CONTEXT_HANDLE)
882888
return -ENOENT;
883889

0 commit comments

Comments
 (0)