Description
Describe the issue
When initializing CPUIDInfo for ARM64 platform, the core count is retrieved and used to loop over and initialize the core_uarchs_
and is_armv8_narrow_ld_
member variables, however inside the loop the index is used to get the processor entry (not core) and the processor entry's linux_id
is used as index into the two member variables. This can result in out of bound write.
Taking as example a machine with 8 cores and 12 processors, both vector would be sized for 8 values while the linux_id
value can be 9, 10, 11, etc... (processor id). This can cause random crashes when using onnxruntime.
I believe there is no need to query the processor entry inside the loop and cpuinfo_get_core
should be used directly.
onnxruntime/onnxruntime/core/common/cpuid_info.cc
Lines 161 to 180 in e0b66ca
To reproduce
Compile ONNXRuntime 1.21.0 ARM64 for an Orin Jetson board (JetPack 6.2) and try running onnxruntime_perf_test (no argument needed). An invalid free crash happens at the end of execution.
Urgency
No response
Platform
Linux
OS Version
JetPack 6.2
ONNX Runtime Installation
Built from Source
ONNX Runtime Version or Commit ID
1.21.0
ONNX Runtime API
C++
Architecture
ARM64
Execution Provider
Default CPU
Execution Provider Library Version
No response