From: David Yat Sin Date: Fri, 18 Feb 2022 22:53:43 +0000 (-0500) Subject: drm/amdkfd: Fix for possible integer overflow X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8f7519b2f3a93f6eae76912be66188366cc47aed;p=linux.git drm/amdkfd: Fix for possible integer overflow Fix for possible integer overflow when doing addition. Reported-by: Dan Carpenter Signed-off-by: David Yat Sin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index c3f252fc337b0..6eca9509f2e38 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -786,7 +786,7 @@ int kfd_criu_restore_queue(struct kfd_process *p, } *priv_data_offset += sizeof(*q_data); - q_extra_data_size = q_data->ctl_stack_size + q_data->mqd_size; + q_extra_data_size = (uint64_t)q_data->ctl_stack_size + q_data->mqd_size; if (*priv_data_offset + q_extra_data_size > max_priv_data_size) { ret = -EINVAL;