[Intel-gfx] [PATCH] drm/i915: Check DVO reads for errors

Quentin Casasnovas quentin.casasnovas at oracle.com
Thu Feb 26 09:47:14 PST 2015


On Thu, Feb 26, 2015 at 05:10:17PM +0000, Chris Wilson wrote:
> Not all of the DVO functions were checking the return value from their
> i2c routines when reading registers. This could lead to us feeding
> garbage values back into the hardware, possible causing further
> failures. In some cases the uninitialised stack values were being
> written into the kernel log.
> 
> Quentin Casasnovas suggested the simple solution of just initialising
> the output parameter to zero in all cases, but we may as well spend the
> extra few moments to fix it correctly.

I'm not sure your patch would be -stable material mainly because of the
diffstat.  Given the security implications, I would still rather have my
patch merged first so it can easily be back-ported to -stable and distro
kernels easily, and then have your patch on top when it gets properly
reviewed.  Especially since your patch looks like it's doing other
not strictly related stuffs like these:

> --- a/drivers/gpu/drm/i915/dvo_ivch.c
> +++ b/drivers/gpu/drm/i915/dvo_ivch.c
> @@ -151,8 +151,6 @@

>  struct ivch_priv {
>          bool quiet;
> 	 -
> 	 -       uint16_t width, height;
> 	  };
> 
> 
> @@ -263,9 +261,6 @@ static bool ivch_init(struct intel_dvo_device *dvo,
>                 goto out;
> 		        }
> 
> -       ivch_read(dvo, VR20, &priv->width);
> -       ivch_read(dvo, VR21, &priv->height);
> -
>         return true;
	

So again, I think my fix as a start would be preferable since it's quite
small and easily reviewable.

Quentin


More information about the Intel-gfx mailing list