public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: Rob Kramer <rob@solution-space.com>
Subject: Re: [PATCH v2 1/3] drm/i915: Reject panel_type > 0xf from VBT
Date: Mon, 11 Apr 2016 11:08:18 +0300	[thread overview]
Message-ID: <8760vova8d.fsf@intel.com> (raw)
In-Reply-To: <1460359329-10817-1-git-send-email-ville.syrjala@linux.intel.com>

On Mon, 11 Apr 2016, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> 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@linux.intel.com>
> Cc: Rob Kramer <rob@solution-space.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com> (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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-11  8:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 13:28 [PATCH 1/3] drm/i915: Reject panel_type > 0xf from VBT ville.syrjala
2016-04-08 13:28 ` [PATCH 2/3] drm/i915: Replace the static panel_type variable with dev_priv->vbt.panel_type ville.syrjala
2016-04-08 14:29   ` Jani Nikula
2016-04-08 13:28 ` [PATCH 3/3] drm/i915: Get panel_type from OpRegion panel details ville.syrjala
2016-04-08 14:50   ` Jani Nikula
2016-04-08 14:59     ` Ville Syrjälä
2016-04-08 15:01       ` Jani Nikula
2016-04-08 15:46         ` Ville Syrjälä
2016-04-11  7:23   ` [PATCH v2 " ville.syrjala
2016-04-11  8:09     ` Jani Nikula
2016-04-12 12:18       ` Ville Syrjälä
2016-04-08 13:56 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915: Reject panel_type > 0xf from VBT Patchwork
2016-04-08 14:07   ` Ville Syrjälä
2016-04-08 14:26 ` [PATCH 1/3] " Jani Nikula
2016-04-11  7:22 ` [PATCH v2 " ville.syrjala
2016-04-11  8:08   ` Jani Nikula [this message]
2016-04-11  7:56 ` ✗ Fi.CI.BAT: failure for series starting with [v2,1/3] drm/i915: Reject panel_type > 0xf from VBT (rev3) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8760vova8d.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rob@solution-space.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox