[PATCH] D44777: Mmap interceptor providing mprotect support

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 22 17:50:56 PDT 2018


vitalybuka added inline comments.


================
Comment at: test/sanitizer_common/TestCases/Linux/mmap_write_exec.cpp:15
   // CHECK: WARNING: {{.*}}Sanitizer: writable-executable page usage
+  char *q = (char *)mmap(p, 64, PROT_READ | PROT_WRITE,
+                         MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
----------------
devnexen wrote:
> vitalybuka wrote:
> > Please extend tests with:
> > 1. env_tool_opts=detect_write_exec=0  and // CHECK-DISABLED-NOT: writable-executable
> > 2. correct call to mprotect without warning.
> > 3. add //CHECK for [[@LINE
> > 4. Move all correct mprotec and mpap to the end and CHECK-NOT: writable-executable to make sure there is no 3rd report
> > 
> When I set to respectively LINE-3, LINE-2 ... does not work ... any clue eventually ?
you are matching sanitizer_common_interceptors.in file.
you should match mmap_write_exec.cpp:[[@LINE....


================
Comment at: test/sanitizer_common/TestCases/Linux/mmap_write_exec.cpp:21
+  // CHECK-DISABLED-NOT: WARNING: {{.*}}Sanitizer: writable-executable page usage
+  // CHECK-DISABLED-NOT: #0 {{.* ?}}__interceptor_mprotect {{.*}}sanitizer_common_interceptors.inc:6901
+
----------------
CHECK-DISABLED-NOT: #0 is unnecacary
you still need to keep // CHECK: for reports


https://reviews.llvm.org/D44777





More information about the llvm-commits mailing list