drm/i915: check i915_get_reset_stats_ioctl args
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 12 Nov 2013 17:49:35 +0000 (19:49 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 13 Nov 2013 10:51:49 +0000 (11:51 +0100)
Insist that flags and pad fields are zero, so that
we can safely extend the interface in future.

Testcase: igt/gem_reset_stats/params

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_uncore.c

index 21cf9519be78fb21b2ccbc849b480c37e49ec355..a881906969eb4d08a47c8046d431ef4753db39a2 100644 (file)
@@ -641,6 +641,9 @@ int i915_get_reset_stats_ioctl(struct drm_device *dev,
        struct i915_ctx_hang_stats *hs;
        int ret;
 
+       if (args->flags || args->pad)
+               return -EINVAL;
+
        if (args->ctx_id == DEFAULT_CONTEXT_ID && !capable(CAP_SYS_ADMIN))
                return -EPERM;