From ab747b1ffd600554ab949c74c06faea14fc2e441 Mon Sep 17 00:00:00 2001 From: Alysa Liu Date: Mon, 9 Jun 2025 09:40:14 -0400 Subject: [PATCH] rocr: Prevent int overflow in arithmetic operation Cast range->x and range->y to uint64_t before performing multiplication Signed-off-by: Alysa Liu [ROCm/ROCR-Runtime commit: 77b86ca9084e5eccd9f2fa5d08fb61dec256609d] --- .../runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp index d5f9187121..a4692fa1d0 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_sdma.cpp @@ -646,7 +646,7 @@ BlitSdma::SubmitCopyRe BuildCopyRectCommand(append, dst, dst_offset, src, src_offset, range); } - uint64_t size = range->x * range->y * range->z; + uint64_t size = static_cast(range->x) * static_cast(range->y) * range->z; std::vector gang_signals(0);