⬢ DragonFlyBSD Kernel Audit
DF-4121 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/i915/intel_bios.c
+++ b/sys/dev/drm/i915/intel_bios.c
@@ -366,6 +366,12 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
 		      const struct bdb_header *bdb)
 {
 	const struct lvds_dvo_timing *dvo_timing;
 	struct drm_display_mode *panel_fixed_mode;
 	int index;
@@ -370,6 +376,12 @@ parse_sdvo_panel_data(struct drm_i915_private *dev_priv,
 		index = sdvo_lvds_options->panel_type;
 	}
 
+	if (index > 0xf) {
+		DRM_DEBUG_KMS("Invalid SDVO panel type %d\n", index);
+		return;
+	}
+
 	dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
 	if (!dvo_timing)
 		return;
# NOTE: authored against the read-only sys/ tree after verification; never applied there.