aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorTimur Tabi <ttabi@nvidia.com>2022-05-11 11:37:16 -0500
committerKarol Herbst <kherbst@redhat.com>2022-08-04 18:28:24 +0200
commit54d91b55c7f3f9f2c86e0b6be4501433b32ddc89 (patch)
treef6179a1c9f57556b3c04ec85701f062b1c37f033 /drivers/gpu/drm/nouveau
parentdrm/imx/dcss: get rid of HPD warning message (diff)
downloadlinux-dev-54d91b55c7f3f9f2c86e0b6be4501433b32ddc89.tar.xz
linux-dev-54d91b55c7f3f9f2c86e0b6be4501433b32ddc89.zip
drm/nouveau: fix another off-by-one in nvbios_addr
This check determines whether a given address is part of image 0 or image 1. Image 1 starts at offset image0_size, so that address should be included. Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") Signed-off-by: Timur Tabi <ttabi@nvidia.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Signed-off-by: Karol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220511163716.3520591-1-ttabi@nvidia.com
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
index 64e423dddd9e..6c318e41bde0 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c
@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size)
{
u32 p = *addr;
- if (*addr > bios->image0_size && bios->imaged_addr) {
+ if (*addr >= bios->image0_size && bios->imaged_addr) {
*addr -= bios->image0_size;
*addr += bios->imaged_addr;
}