已合并
fix: guard invalid numa id for nodemask shift #98
gcw_Nt0RibX4创建于 7 天前
fix: guard invalid numa id for nodemask shift #98
已合并
共 1 个文件变更+4-0
| @@ -32,6 +32,10 @@ void *RackMem::MemoryIDUsedByNuma(AppBorrowMetaDesc &desc, const std::vector<uin | |||
| 32 | DBG_LOGERROR("numaid invalid, numaid is " << numaId); | 32 | DBG_LOGERROR("numaid invalid, numaid is " << numaId); |
| 33 | return nullptr; | 33 | return nullptr; |
| 34 | } | 34 | } |
| 35 | + if (numaId >= static_cast<int64_t>(8 * sizeof(unsigned long))) { | ||
| 36 | + DBG_LOGERROR("numaid out of range, numaid is " << numaId); | ||
| 37 | + return nullptr; | ||
| 38 | + } | ||
| 35 | void *mappedMemory = nullptr; | 39 | void *mappedMemory = nullptr; |
| 36 | DBG_LOGINFO("Borrowing memory by numa, name=" << name << ", numa id=" << numaId << ", size=" << desc.GetFileSize() | 40 | DBG_LOGINFO("Borrowing memory by numa, name=" << name << ", numa id=" << numaId << ", size=" << desc.GetFileSize() |
| 37 | << "mem ids"); | 41 | << "mem ids"); |