diff options
author | Russell Gallop <russell.gallop@gmail.com> | 2019-10-10 10:56:52 +0000 |
---|---|---|
committer | Russell Gallop <russell.gallop@gmail.com> | 2019-10-10 10:56:52 +0000 |
commit | fe7f65b081d5d0b32270cb1a82e2ee9a0391a6d1 (patch) | |
tree | 539951269a99d4d5fd5a3194400a4fe61d451fec /test | |
parent | 640d7e0a87981f53799ad7394c4cb93c928338c4 (diff) | |
download | compiler-rt-fe7f65b081d5d0b32270cb1a82e2ee9a0391a6d1.tar.gz |
Revert "[ASan] Do not misrepresent high value address dereferences as null dereferences"
As it was breaking bots running sanitizer lint check
This reverts r374265 (git b577efe4567f1f6a711ad36e1d17280dd1c4f009)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@374308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/TestCases/Posix/high-address-dereference.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/test/asan/TestCases/Posix/high-address-dereference.c b/test/asan/TestCases/Posix/high-address-dereference.c deleted file mode 100644 index 785033028..000000000 --- a/test/asan/TestCases/Posix/high-address-dereference.c +++ /dev/null @@ -1,50 +0,0 @@ -// On x86_64, the kernel does not provide the faulting address for dereferences -// of addresses greater than the 48-bit hardware addressable range, i.e., -// `siginfo.si_addr` is zero in ASan's SEGV signal handler. This test checks -// that ASan does not misrepresent such cases as "NULL dereferences". - -// REQUIRES: x86_64-target-arch -// RUN: %clang_asan %s -o %t -// RUN: export %env_asan_opts=print_scariness=1 -// RUN: not %run %t 0x0000000000000000 2>&1 | FileCheck %s --check-prefixes=ZERO,HINT-PAGE0 -// RUN: not %run %t 0x0000000000000FFF 2>&1 | FileCheck %s --check-prefixes=LOW1,HINT-PAGE0 -// RUN: not %run %t 0x0000000000001000 2>&1 | FileCheck %s --check-prefixes=LOW2,HINT-NONE -// RUN: not %run %t 0x4141414141414141 2>&1 | FileCheck %s --check-prefixes=HIGH,HINT-HIGHADDR -// RUN: not %run %t 0xFFFFFFFFFFFFFFFF 2>&1 | FileCheck %s --check-prefixes=MAX,HINT-HIGHADDR - -#include <stdint.h> -#include <stdlib.h> - -int main(int argc, const char *argv[]) { - const char *hex = argv[1]; - uint64_t *addr = (uint64_t *)strtoull(hex, NULL, 16); - uint64_t x = *addr; // segmentation fault - return x; -} - -// ZERO: SEGV on unknown address 0x000000000000 (pc -// LOW1: SEGV on unknown address 0x000000000fff (pc -// LOW2: SEGV on unknown address 0x000000001000 (pc -// HIGH: SEGV on unknown address (pc -// MAX: SEGV on unknown address (pc - -// HINT-PAGE0-NOT: Hint: this fault was caused by a dereference of a high value address -// HINT-PAGE0: Hint: address points to the zero page. - -// HINT-NONE-NOT: Hint: this fault was caused by a dereference of a high value address -// HINT-NONE-NOT: Hint: address points to the zero page. - -// HINT-HIGHADDR: Hint: this fault was caused by a dereference of a high value address -// HINT-HIGHADDR-NOT: Hint: address points to the zero page. - -// ZERO: SCARINESS: 10 (null-deref) -// LOW1: SCARINESS: 10 (null-deref) -// LOW2: SCARINESS: 20 (wild-addr-read) -// HIGH: SCARINESS: 20 (wild-addr-read) -// MAX: SCARINESS: 20 (wild-addr-read) - -// TODO: Currently, register values are only printed on Mac. Once this changes, -// remove the 'TODO_' prefix in the following lines. -// TODO_HIGH,TODO_MAX: Register values: -// TODO_HIGH: = 0x4141414141414141 -// TODO_MAX: = 0xffffffffffffffff |