diff options
author | Ben Skeggs <[email protected]> | 2017-04-11 08:25:22 +1000 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2017-04-29 22:39:23 +1000 |
commit | a7cb78bab3671dbad08e5b2f5fd83a6dbda90fe5 (patch) | |
tree | f744107295dfc8a9841f835b838b420992b8bae8 /drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c | |
parent | eef4988ab4c1a99e88e535502a67763a78d51515 (diff) |
drm/nouveau/bios/bitP: check that table is long enough for optional pointers
Fixes OOB VBIOS accesses on some boards.
Signed-off-by: Ben Skeggs <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c index eaf74eb72983..8ab896dd4e92 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/boost.c @@ -33,7 +33,7 @@ nvbios_boostTe(struct nvkm_bios *bios, u32 boost = 0; if (!bit_entry(bios, 'P', &bit_P)) { - if (bit_P.version == 2) + if (bit_P.version == 2 && bit_P.length >= 0x34) boost = nvbios_rd32(bios, bit_P.offset + 0x30); if (boost) { |