On Thu, Mar 16, 2017 at 11:50:11AM +0530, [email protected] wrote:
> +static int copy_mmio_list(struct drm_i915_private *dev_priv,
> +                             void __user *mmio)
> +{
> +     void __user *mmio_list = ((u8 __user *)mmio + 4);
> +     u32 num_mmio;
> +     int ret;
> +
> +     if (!mmio)
> +             return -EINVAL;
> +
> +     ret = get_user(num_mmio, (u32 __user *)mmio);
> +     if (ret)
> +             return ret;
> +
> +     if (num_mmio > I915_PERF_MMIO_NUM_MAX)
> +             return -EINVAL;
> +
> +     memset(dev_priv->perf.mmio_list, 0, I915_PERF_MMIO_NUM_MAX);
> +     if (copy_from_user(dev_priv->perf.mmio_list, mmio_list, 4*num_mmio))

return -EFAULT;

check all the others (copy_from_user and copy_to_user).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to