]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/nouveau/gsp: Fix potential integer overflow on integer shifts
authorColin Ian King <colin.i.king@gmail.com>
Thu, 22 May 2025 13:15:12 +0000 (14:15 +0100)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 13 Jun 2025 14:25:37 +0000 (16:25 +0200)
commit80626ae6ffe57917915c6e6d8ea1e908689954fd
tree8d034c023e3efc28b09f7c7f699ae838a43f597c
parent2e3395ab2a358ba8d1c80d8df35dcfb882cfc28e
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
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/vmm.c