aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Tabi <[email protected]>2022-05-11 11:37:16 -0500
committerLyude Paul <[email protected]>2022-06-02 18:40:03 -0400
commitc441d28945fb113220d48d6c86ebc0b090a2b677 (patch)
tree86478e27b7ec4f4fc63ba93cc30707eb0ca8db64
parent10e619f1f31cf126885b3e0ac43a8de9744467fb (diff)
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") Cc: <[email protected]> # v4.8+ Signed-off-by: Timur Tabi <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-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;
}