]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdgpu: Check for multiplication overflow in checkpoint stack size
authorDavid Francis <David.Francis@amd.com>
Fri, 16 Jan 2026 15:21:15 +0000 (10:21 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 6 Mar 2026 21:33:59 +0000 (16:33 -0500)
commit421c0f19043337a553e802b2dfe4b56d538ef4d6
treea252e5d2ae1a1927401b0ae6097673478c1dd857
parent8c78845bf9b18d336e5b5d00c966176a3c3f9581
drm/amdgpu: Check for multiplication overflow in checkpoint stack size

get_checkpoint_info() in kfd_mqd_manager_v9.c finds 32-bit value
ctl_stack_size by multiplying two 32-bit values. This can overflow to a
lower value, which could result in copying outside the bounds of
a buffer in checkpoint_mqd() in the same file.

Put in a check for the overflow, and fail with -EINVAL if detected.

v2: use check_mul_overflow()

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.h
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c