Downloads · 30 days
2
5% of all-time downloads
willardj/armnn-intovfl-poc
armnn-intovfl-poc is a machine learning model from willardj. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Vulnerability: Integer overflow in TensorShape::GetNumElements() (src/armnn/Tensor.cpp:181-209)
Downloads · 30 days
2
5% of all-time downloads
All-time downloads
41
Public
Repo size
1 KB
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 39%
From the Hugging Face model README
Vulnerability: Integer overflow in TensorShape::GetNumElements() (src/armnn/Tensor.cpp:181-209)
GetNumElements() multiplies tensor dimensions using unsigned int (32-bit) with no overflow check:
unsigned int count = 1;
for (unsigned int i = 0; i < m_NumDimensions; ++i) {
count *= m_Dimensions[i]; // NO OVERFLOW CHECK
}
poc_armnn_overflow.tflite — A patched TFLite model with a tensor whose shape is [65536, 65536].
When loaded by Arm NN's TFLite parser:
GetNumElements() computes 65536 * 65536 = 0 (unsigned int overflow)GetNumBytes() returns sizeof(float) * 0 = 0CheckBufferSize() at TfLiteParser.cpp:270 compares overflowed value (0) against buffer size — check passesnew T[0] allocates a tiny buffer (TfLiteParser.cpp:653)Use uint64_t accumulator or checked multiplication (e.g., __builtin_mul_overflow) in GetNumElements().
src/armnn/Tensor.cpp:190-197 — GetNumElements() (core, affects ALL parsers)src/armnn/Tensor.cpp:429 — GetNumBytes() (multiplies overflowed result)src/armnnTfLiteParser/TfLiteParser.cpp:270,653,663 — buffer check + allocation + memcpy