- Intercepting mprotect calls.
- Fixing forgotten flag check.
Patch by David CARLIER
Paths
| Differential D44777
Mmap interceptor providing mprotect support ClosedPublic Authored by devnexen on Mar 22 2018, 5:00 AM.
Details
Summary
Patch by David CARLIER
Diff Detail Event TimelineHerald added subscribers: Restricted Project, llvm-commits, kubamracek. · View Herald TranscriptMar 22 2018, 5:00 AM Comment Actions After that, next step would be trying to fix Android support. sorry for all the work I give you @vitalybuka vitalybuka added inline comments.
This revision now requires changes to proceed.Mar 22 2018, 2:11 PM
This revision is now accepted and ready to land.Mar 23 2018, 1:41 PM
Closed by commit rL328369: Mmap interceptor providing mprotect support (authored by vitalybuka). · Explain WhyMar 23 2018, 2:02 PM This revision was automatically updated to reflect the committed changes. Comment Actions Hi, this probably broke on Darwin, https://smooshbase.apple.com/ci/view/BuildCzar/job/apple-clang-master-RA-stage1-cmake-incremental/44333/console: duplicate symbol _wrap_mprotect in: projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.watchossim.dir/asan_interceptors.cc.o projects/compiler-rt/lib/asan/CMakeFiles/RTAsan_dynamic.watchossim.dir/asan_malloc_mac.cc.o ld: 1 duplicate symbol for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Can you take a look? Comment Actions Would need to protect the common interception and still catching the flags in the mac part maybe. This revision is now accepted and ready to land.Mar 23 2018, 2:48 PM Comment Actions Thanks. If you don't have a macOS machine, you can email me a patch and I can test it out for you. Comment Actions Fix Apple build, as mprotect is already intercepted. We check the flags in apple case too. Comment Actions
I tested with an weak apple machine I reproduced your linkage issues and do not get them after the changes. vitalybuka added inline comments.
This revision now requires changes to proceed.Mar 23 2018, 3:20 PM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 24 2018, 12:49 AM Closed by commit rL328415: Mmap interceptor providing mprotect support (authored by vitalybuka). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 139678 lib/sanitizer_common/sanitizer_common.h
lib/sanitizer_common/sanitizer_common_interceptors.inc
lib/sanitizer_common/sanitizer_common_libcdep.cc
lib/sanitizer_common/sanitizer_malloc_mac.inc
lib/sanitizer_common/sanitizer_posix.cc
test/sanitizer_common/TestCases/Linux/mmap_write_exec.cpp
|
Just put this into INTERCEPTOR
No need to have COMMON_INTERCEPTOR_MPROTECT_IMPL before we have overrides