Commit 78d481fb authored by Nick Lopez's avatar Nick Lopez Committed by Yuan Can
Browse files

drm/nouveau: fix off by one in BIOS boundary checking

stable inclusion
from stable-v4.19.228
commit b2a21669ee98aafc41c6d42ef15af4dab9e6e882
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA72KO
CVE: CVE-2022-48732

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b2a21669ee98aafc41c6d42ef15af4dab9e6e882



--------------------------------

commit 1b777d4d upstream.

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: default avatarNick Lopez <github@glowingmonkey.org>
Fixes: 4d4e9907 ("drm/nouveau/bios: guard against out-of-bounds accesses to image")
Cc: <stable@vger.kernel.org> # v4.10+
Reviewed-by: default avatarIlia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220122081906.2633061-1-github@glowingmonkey.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYuan Can <yuancan@huawei.com>
parent 196331cd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment