[Intel-gfx] [PATCH 3/3] drm/i915: Catch dirt in unused execbuffer fields

Chris Wilson chris at chris-wilson.co.uk
Thu Apr 24 08:19:56 CEST 2014


On Wed, Apr 23, 2014 at 08:32:20PM +0200, Daniel Vetter wrote:
> We need to make sure that userspace keeps on following the contract,
> otherwise we won't be able to use the reserved fields at all.
> 
> Testcase: igt/gem_exec_params/*-dirt
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index c2e5d39a1df8..0f0aebdd8dbd 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1115,6 +1115,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
>  			ret = -EFAULT;
>  			goto pre_mutex_err;
>  		}
> +	} else {
> +		if (args->DR1 || args->DR4 || args->cliprects_ptr)
> +			return -EINVAL;

We're inside a mutex here.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list