-
Notifications
You must be signed in to change notification settings - Fork 6
Non scalar scanners overrun buffer #1
Copy link
Copy link
Open
Description
The AVX2 scanner reads 32bytes at once, so as chunk approaches the end of size, it ends up reading past the end of the buffer
LightningScanner/src/backends/Avx2.cpp
Lines 15 to 17 in 76e59b6
| for (size_t chunk = 0; chunk < size; chunk++) { | |
| __m256i chunkData = | |
| _mm256_loadu_si256((__m256i*)((char*)startAddr + chunk)); |
The SSE4.2 scanner also has the same issue.
LightningScanner/src/backends/Sse42.cpp
Lines 15 to 17 in 76e59b6
| for (size_t chunk = 0; chunk < size; chunk++) { | |
| __m128i chunkData = | |
| _mm_loadu_si128((__m128i*)((char*)startAddr + chunk)); |
This can cause crashes if there is no readable memory past the end of the buffer.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels