]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/bios: Make copies of VBT data blocks
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 6 Apr 2022 13:38:17 +0000 (16:38 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 12 Apr 2022 06:18:14 +0000 (09:18 +0300)
commit3bf7e3b641d69bb9149ba30a12b9a0134358121b
tree916d5e5f0bcff49411d6cb15c3d96f8c904bf7aa
parentaf71c5a72d1fb4ee2279b6d7d280cc1f7f6a87b6
drm/i915/bios: Make copies of VBT data blocks

Make a copy of each VBT data block with a guaranteed minimum
size. The extra (if any) will just be left zeroed.

This means we don't have to worry about going out of bounds
when accessing any of the structure members. Otherwise that
could easliy happen if we simply get the version check wrong,
or if the VBT is broken/malicious.

v2: Don't do arithmetic between bdb header and copy
    of the LFP data block (Jani)
v3: Make all the copies up front
v4: Only WARN about min_size==0 if we found the block

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220406133817.30652-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/i915_drv.h