]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/bios: make sure to check vbt size
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 8 Nov 2019 21:13:52 +0000 (13:13 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 13 Nov 2019 18:55:37 +0000 (10:55 -0800)
commitf88c2f55b17ceb11e21de2924b9bfb5da20fff4c
tree5e34485e20396d54d8e1144734dce4d7f1aaa173
parent82f798a3990ce4e45b19a59a33d64a1d90b32b93
drm/i915/bios: make sure to check vbt size

When we call intel_bios_is_valid_vbt(), size may not actually be the
size of the VBT, but rather the size of the blob the VBT is contained
in. For example, when mapping the PCI oprom, size will be the entire
oprom size. We don't want to read beyond what is reported to be the
VBT. So make sure we vbt->vbt_size makes sense and use that for
the latter checks.

v2: check for vbt_size after checking for vbt signature and give it a
more meaningful error message (from Jani)

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191108003602.33526-3-lucas.demarchi@intel.com
drivers/gpu/drm/i915/display/intel_bios.c