This patch lets ASan run when /proc is not accessible (ex. not mounted
yet). It includes a special test-only flag that emulates this condition
in an unpriviledged process.
Details
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
compiler-rt/lib/sanitizer_common/sanitizer_posix.h | ||
---|---|---|
106 ↗ | (On Diff #178827) | The purpose of this function is a little ambiguous from the name, it sounds like it might actually try to open the file. Maybe a better name would be ShouldMockFailureToOpen? |
compiler-rt/lib/asan/asan_thread.cc | ||
---|---|---|
302 ↗ | (On Diff #178827) | I dont see why const_cast is needed here |
compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
147 ↗ | (On Diff #178827) | what is the purpose of cache_enabled? |
compiler-rt/lib/asan/asan_thread.cc | ||
---|---|---|
302 ↗ | (On Diff #178827) | Yeah. Removed in a separate commit. |
compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
147 ↗ | (On Diff #178827) | The same as in MemoryMappingLayout constructor - some users are ok with old, cached mappings, some are not. The cache is used to support sandboxing - a situation where /proc/self/maps has been accessible before, but not right now. In that case IsAvailable(true) will say yes if there is cached data. |
compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
---|---|---|
147 ↗ | (On Diff #178827) | So who are those users who set false? |
LGTM
compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
---|---|---|
147 ↗ | (On Diff #178827) | So I'd remove parameter and make it always as true. |
I would note that this commit is Linux only. NetBSD already sanitizers init(8) without issues. It's also running without /proc mounted.
Yes, because *BSD have a sane interface for enumerating virtual memory mappings.
I'll mention this in commit description.