Skip to content

Commit

Permalink
drm/i915/bios: Make copies of VBT data blocks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ville Syrjälä committed Apr 12, 2022
1 parent d58a3d6 commit e163cfb
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 57 deletions.
Loading

0 comments on commit e163cfb

Please sign in to comment.