Re: [PATCH v2 1/3] drm/i915: Reject panel_type > 0xf from VBT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Apr 2016, ville.syrjala@xxxxxxxxxxxxxxx wrote:
> From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>
> VBT can only contain 16 panel entries, indexed with the panel_type.
> To play it safe we should reject panel_type > 0xf, so that we don't
> read past the valid data.
>
> v2: Add debug logging (Jani)
>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Rob Kramer <rob@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx> (v1)

Yup.

> ---
>  drivers/gpu/drm/i915/intel_bios.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index eb756c41d9e1..c8857b5dbfec 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -212,8 +212,11 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
>  		return;
>  
>  	dev_priv->vbt.lvds_dither = lvds_options->pixel_dither;
> -	if (lvds_options->panel_type == 0xff)
> +	if (lvds_options->panel_type > 0xf) {
> +		DRM_DEBUG_KMS("Invalid VBT panel type 0x%x\n",
> +			      lvds_options->panel_type);
>  		return;
> +	}
>  
>  	panel_type = lvds_options->panel_type;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux