From c2128d0af9cbba91e8963b097305496495c24d2e Mon Sep 17 00:00:00 2001 From: Branislav Brzak Date: Thu, 6 Jun 2024 02:54:57 -0700 Subject: [PATCH] SWDEV-465203 - Treat 0 elf length images as invalid This addresses: SWDEV-465203 SWDEV-465202 Change-Id: I49fcdd537fd07585e25c5fdef37cd10815466f79 [ROCm/clr commit: f01412452772665fe6b51d690203bfa49c56fe05] --- projects/clr/hipamd/src/hip_fatbin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_fatbin.cpp b/projects/clr/hipamd/src/hip_fatbin.cpp index 8b52e9f32f..d163d121fc 100644 --- a/projects/clr/hipamd/src/hip_fatbin.cpp +++ b/projects/clr/hipamd/src/hip_fatbin.cpp @@ -175,8 +175,13 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordeviceId()] - = new FatBinaryDeviceInfo(image_, CodeObject::ElfSize(image_), 0); + = new FatBinaryDeviceInfo(image_, elf_size, 0); fatbin_dev_info_[devices[dev_idx]->deviceId()]->program_ = new amd::Program(*devices[dev_idx]->asContext()); if (fatbin_dev_info_[devices[dev_idx]->deviceId()]->program_ == nullptr) {