OSDN Git Service

drm/edid: Don't accept any old garbage as a display descriptor
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 24 Jan 2020 20:02:25 +0000 (22:02 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 14 Feb 2020 21:34:16 +0000 (23:34 +0200)
commita7a131ac18a23d31f572cac4cd20581e56add932
tree69d03063050ce8cd1a019b067fb449940483c338
parent7304b9810a7367131dc26ced61696e7c98dd6666
drm/edid: Don't accept any old garbage as a display descriptor

Currently we assume any 18 byte descriptor to be a display descritor
if only the tag byte matches the expected value. But for detailed
timing descriptors that same byte is just the lower 8 bits of
hblank, and as such can match any display descriptor tag. To
properly validate that the 18 byte descriptor is in fact a
display descriptor we must also examine bytes 0-2 (just byte 1
should actually suffice but the spec does say that bytes 0 and
2 must also always be zero for display descriptors so we check
those too).

Unlike Allen's original proposed patch to just fix is_rb() we
roll this out across the board to fix everything.

Cc: Allen Chen <allen.chen@ite.com.tw>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200124200231.10517-2-ville.syrjala@linux.intel.com
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
drivers/gpu/drm/drm_edid.c