android / android/ndk

ASan doesn't detect invalid read of heap memory in NEON Intrinsics

Open
#1,687 4 comments 0 reactions 1 assignee Claimed by @eugenis View on GitHub
enhancement
Dominant language
No language data
Stars
2.3k
Forks
310
PR merge metrics
No merged PRs in 30d

Description

### Description

Using `vld1_u8()` intrinsic for out of bound data loading, if with Address Sanitizer, there should report invalid heap memory read, but actually no report generated.

The key code:
```c++
uint8_t* Sp = (uint8_t*)malloc(1920);
int xofsp[8] = {0, 1916};

{
uint8x8_t d0 = vld1_u8(Sp + xofsp[0]);
uint8x8_t d1 = vld1_u8(Sp + xofsp[1]); //1916 + 8 = 1924, which is greater than 1920, should report invalid heap memory read.

std::cout << d0 << std::endl;
std::cout << d1 << std::endl;
}

free(Sp);
```

The full reproduce code: https://github.com/zchrissirhcz/min-repros/tree/master/test_asan_for_intrinsics

### Affected versions

r23b, r25-beta2

### Canary version

_No response_

### Host OS

Linux

### Host OS version

Ubuntu 20.04

### Affected ABIs

armeabi-v7a, arm64-v8a

### Build system

CMake

### Other build system

_No response_

### minSdkVersion

I don't know this..

### Device API level

30

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.