Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/nouveau/gsp: Fix potential integer overflow on integer shifts

The left shift int 32 bit integer constants 1 is evaluated using 32 bit
arithmetic and then assigned to a 64 bit unsigned integer. In the case
where the shift is 32 or more this can lead to an overflow. Avoid this
by shifting using the BIT_ULL macro instead.

Fixes: 6c3ac7bcfcff ("drm/nouveau/gsp: support deeper page tables in COPY_SERVER_RESERVED_PDES")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20250522131512.2768310-1-colin.i.king@gmail.com

authored by

Colin Ian King and committed by
Danilo Krummrich
80626ae6 2e3395ab

+1 -1
+1 -1
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c
··· 121 121 page_shift -= desc->bits; 122 122 123 123 ctrl->levels[i].physAddress = pd->pt[0]->addr; 124 - ctrl->levels[i].size = (1 << desc->bits) * desc->size; 124 + ctrl->levels[i].size = BIT_ULL(desc->bits) * desc->size; 125 125 ctrl->levels[i].aperture = 1; 126 126 ctrl->levels[i].pageShift = page_shift; 127 127