drm/i915: check i915_get_reset_stats_ioctl args
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>
This commit is contained in:
Родитель
b53c8c3577
Коммит
661df0415e
|
@ -641,6 +641,9 @@ int i915_get_reset_stats_ioctl(struct drm_device *dev,
|
||||||
struct i915_ctx_hang_stats *hs;
|
struct i915_ctx_hang_stats *hs;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (args->flags || args->pad)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (args->ctx_id == DEFAULT_CONTEXT_ID && !capable(CAP_SYS_ADMIN))
|
if (args->ctx_id == DEFAULT_CONTEXT_ID && !capable(CAP_SYS_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче