Skip to content

Commit 54d91b5

Browse files
ttabikarolherbst
authored andcommitted
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: 4d4e990 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") Signed-off-by: Timur Tabi <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 30bdc36 commit 54d91b5

File tree

1 file changed

+1
-1
lines changed
  • drivers/gpu/drm/nouveau/nvkm/subdev/bios

1 file changed

+1
-1
lines changed

drivers/gpu/drm/nouveau/nvkm/subdev/bios/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size)
3333
{
3434
u32 p = *addr;
3535

36-
if (*addr > bios->image0_size && bios->imaged_addr) {
36+
if (*addr >= bios->image0_size && bios->imaged_addr) {
3737
*addr -= bios->image0_size;
3838
*addr += bios->imaged_addr;
3939
}

0 commit comments

Comments
 (0)