[asan] relax sanbox_read_proc_self_maps_test to pass even if unshare() fails.

llvm-svn: 303911
This commit is contained in:
Kostya Serebryany 2017-05-25 20:50:36 +00:00
parent ca7a3947f5
commit f3509b6d9b
1 changed files with 3 additions and 5 deletions

View File

@ -14,17 +14,15 @@ int main() {
if (unshare(CLONE_NEWUSER)) {
printf("unshare failed\n");
abort();
return 1;
}
// remove access to /proc/self/maps
if (chroot("/tmp")) {
printf("chroot failed\n");
abort();
return 2;
}
*(volatile int*)0x42 = 0;
// CHECK: AddressSanitizer: SEGV on unknown address 0x000000000042
// CHECK-NOT: AddressSanitizer CHECK failed
// CHECK: SUMMARY: AddressSanitizer: SEGV
// CHECK-NOT: CHECK failed
}