When a signal is raised before HWASAN has a chance to initialize it's TLS entry the program crashes. This only happens when hwasan-with-tls is true, which is default value. This patch fixes the problem by disabling signals during thread initialization time.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It would be awesome to have a test, but here D113328 I failed to make reproducer for the similar patch.
compiler-rt/lib/hwasan/hwasan_interceptors.cpp | ||
---|---|---|
48–49 | Up to you, but I guess you still can keep *A = {callback, param}; | |
48–49 | for consistency, as it makes no difference with the current state of code |
compiler-rt/lib/hwasan/hwasan_interceptors.cpp | ||
---|---|---|
47–48 | unrelated to the patch, but this could be a source of subtle leaks Imagine:
so if lsan checks in the step 4, heap allocated param pointer is only in the mapped region, which lsan can't see, and |
unrelated to the patch, but this could be a source of subtle leaks
Imagine:
so if lsan checks in the step 4, heap allocated param pointer is only in the mapped region, which lsan can't see, and
before __hwasan_thread_enter the new thread is not visible to lsan as well