[PATCH] drm/i915/gvt: Audit the command buffer address

Zhenyu Wang zhenyuw at linux.intel.com
Thu Jul 6 07:20:23 UTC 2017


On 2017.07.04 16:09:58 +0800, Ping Gao wrote:
> The command buffer address in context like ring buffer base address
> and wa_ctx address need to be audit to make sure they are in the
> valid GGTT range.
> 
> Signed-off-by: Ping Gao <ping.a.gao at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/cmd_parser.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index 4ddae9b..7ed8c55 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -2536,6 +2536,11 @@ static int scan_workload(struct intel_vgpu_workload *workload)
>  		gma_head == gma_tail)
>  		return 0;
>  
> +	if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
>  	ret = ip_gma_set(&s, gma_head);
>  	if (ret)
>  		goto out;
> @@ -2579,6 +2584,11 @@ static int scan_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
>  	s.rb_va = wa_ctx->indirect_ctx.shadow_va;
>  	s.workload = workload;
>  
> +	if (!intel_gvt_ggtt_validate_range(s.vgpu, s.ring_start, s.ring_size)) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
>  	ret = ip_gma_set(&s, gma_head);
>  	if (ret)
>  		goto out;
> -- 

applied, thanks!

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170706/73c39357/attachment.sig>


More information about the intel-gvt-dev mailing list