Skip to content

Commit eeeebea

Browse files
committed
drm/i915: Reject panel_type > 0xf from VBT
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) Link: http://patchwork.freedesktop.org/patch/msgid/1460359329-10817-1-git-send-email-ville.syrjala@linux.intel.com
1 parent 7067780 commit eeeebea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/i915/intel_bios.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,11 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
212212
return;
213213

214214
dev_priv->vbt.lvds_dither = lvds_options->pixel_dither;
215-
if (lvds_options->panel_type == 0xff)
215+
if (lvds_options->panel_type > 0xf) {
216+
DRM_DEBUG_KMS("Invalid VBT panel type 0x%x\n",
217+
lvds_options->panel_type);
216218
return;
219+
}
217220

218221
panel_type = lvds_options->panel_type;
219222

0 commit comments

Comments
 (0)