[PATCH] D44777: Mmap interceptor providing mprotect support

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 23 15:20:56 PDT 2018


vitalybuka requested changes to this revision.
vitalybuka added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/sanitizer_common/sanitizer_malloc_mac.inc:76
 INTERCEPTOR(int, mprotect, void *addr, size_t len, int prot) {
+  if (common_flags()->detect_write_exec)
+    ReportMmapWriteExec(prot);
----------------
It does not look right.
We have now two conditional interceptors.

I think better approach to instert some mmaloc hook into the common interceptor
and make it empty on all platforms and put "if (addr == malloc_zones && prot == PROT_READ) {" into the mac one.


https://reviews.llvm.org/D44777





More information about the llvm-commits mailing list