[PATCH] D75303: Update Sanitizer tests for Android R.
Mitch Phillips via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 27 13:47:16 PST 2020
hctim created this revision.
hctim added reviewers: eugenis, pcc.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.
hctim marked an inline comment as done.
hctim added inline comments.
================
Comment at: compiler-rt/test/asan/TestCases/Posix/no-fd.cpp:7
+// This test closes the 0, 1, and 2 file descriptors before an exec() and relies
+// on them remaining closed across an execve(). This is not the case on newer
----------------
"As a general principle, no portable program, whether privileged or not, can assume that these three file descriptors will remain closed across an execve()."
- http://man7.org/linux/man-pages/man2/execve.2.html
Sanitizer tests don't entirely pass on an R device. Fix up all the
incompatibilities with the new system.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75303
Files:
compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
compiler-rt/test/asan/TestCases/strstr_strict.c
compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp
Index: compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp
===================================================================
--- compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp
+++ compiler-rt/test/sanitizer_common/TestCases/Posix/feof_fileno_ferror.cpp
@@ -1,5 +1,9 @@
// RUN: %clangxx -g %s -o %t && %run %t
+// Newer versions of Android have FDSan, and will fail this test as FDSan will
+// catch the error instead.
+// UNSUPPORTED: android
+
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
Index: compiler-rt/test/asan/TestCases/strstr_strict.c
===================================================================
--- compiler-rt/test/asan/TestCases/strstr_strict.c
+++ compiler-rt/test/asan/TestCases/strstr_strict.c
@@ -1,6 +1,12 @@
// Test strict_string_checks option in strstr function
// RUN: %clang_asan %s -o %t && %run %t 2>&1
+
+// Newer versions of Android's strstr() uses memchr() internally, which actually
+// does trigger a heap-buffer-overflow (as it tries to find the
+// null-terminator).
+// UNSUPPORTED: android
// RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1
+
// RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
#include <assert.h>
Index: compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
+++ compiler-rt/test/asan/TestCases/Posix/no-fd.cpp
@@ -4,6 +4,11 @@
// Test ASan initialization
+// This test closes the 0, 1, and 2 file descriptors before an exec() and relies
+// on them remaining closed across an execve(). This is not the case on newer
+// versions of Android.
+// UNSUPPORTED: android
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75303.247100.patch
Type: text/x-patch
Size: 1824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200227/fd8c18a4/attachment.bin>
More information about the llvm-commits
mailing list