]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau: fix off by one in BIOS boundary checking
authorNick Lopez <github@glowingmonkey.org>
Sat, 22 Jan 2022 08:19:06 +0000 (01:19 -0700)
committerKarol Herbst <kherbst@redhat.com>
Mon, 31 Jan 2022 21:47:53 +0000 (22:47 +0100)
commitf1f25d2047b37727bc0bb8354d72bdafbb60d061
tree9dab3da35d5d24583dee845bad611aad21f6bda4
parent3fec6c17c007504cfe7b486be3d4a17dd88efb48
drm/nouveau: fix off by one in BIOS boundary checking

Bounds checking when parsing init scripts embedded in the BIOS reject
access to the last byte. This causes driver initialization to fail on
Apple eMac's with GeForce 2 MX GPUs, leaving the system with no working
console.

This is probably only seen on OpenFirmware machines like PowerPC Macs
because the BIOS image provided by OF is only the used parts of the ROM,
not a power-of-two blocks read from PCI directly so PCs always have
empty bytes at the end that are never accessed.

Signed-off-by: Nick Lopez <github@glowingmonkey.org>
Fixes: a5fc52e4bf667 ("drm/nouveau/bios: guard against out-of-bounds accesses to image")
Cc: <stable@vger.kernel.org> # v4.10+
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220122081906.2633061-1-github@glowingmonkey.org
drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c