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
- Build Status
Buildable 26265 Build 26264: arc lint + arc unit
Event Timeline
| compiler-rt/lib/sanitizer_common/sanitizer_posix.h | ||
|---|---|---|
| 106 | 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 | Yeah. Removed in a separate commit. | |
| compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
| 147 | 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 | So who are those users who set false? | |
LGTM
| compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
|---|---|---|
| 147 | 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.
I dont see why const_cast is needed here