drm/radeon/r600_cs: Fix possible int overflow in r600_packet3_check()
authorIgor Artemiev <Igor.A.Artemiev@mcst.ru>
Fri, 27 Sep 2024 15:07:19 +0000 (18:07 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 1 Oct 2024 21:41:09 +0000 (17:41 -0400)
commita1e2da6a5072f8abe5b0feaa91a5bcd9dc544a04
tree0918aae467a14ffe96db9436be9a292389382b7e
parenta3f4060e3733bb0b40438ddbdd01a4c8f48c594d
drm/radeon/r600_cs: Fix possible int overflow in r600_packet3_check()

It is possible, although unlikely, that an integer overflow will occur
when the result of radeon_get_ib_value() is shifted to the left.

Avoid it by casting one of the operands to larger data type (u64).

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Signed-off-by: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/r600_cs.c