]> 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)
commitc72a3a48f295876e4012dbf946acc399563345c8
tree916d5e5f0bcff49411d6cb15c3d96f8c904bf7aa
parentbd56cff6e943d73db6d55e64adada5f26bfe6288
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