[Intel-gfx] [PATCH] drm/i915: Sanity check execbuffer arguments before touching state.

Chris Wilson chris at chris-wilson.co.uk
Thu May 21 12:07:28 CEST 2009


On Thu, 2009-05-21 at 10:14 +0100, Chris Wilson wrote:
>  int
>  i915_gem_execbuffer(struct drm_device *dev, void *data,
>  		    struct drm_file *file_priv)
> @@ -3278,6 +3288,14 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
>  		goto pre_mutex_err;
>  	}
>  
> +	/* Sanity check the batch buffer, prior to manipulating objects */
> +	exec_offset = exec_list[args->buffer_count - 1].offset;
> +	ret = i915_gem_check_execbuffer (args, exec_offset);
> +	if (ret != 0) {
> +		DRM_ERROR("execbuf with invalid offset/length\n");
> +		goto pre_mutex_err;
> +	}
> +

This check would be better placed after pin+relocate...
-ickle




More information about the Intel-gfx mailing list