If SANITIZER_CAN_USE_PREINIT_ARRAY=0 interceptors or cfi callbacks can be called
before constructor.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
compiler-rt/lib/cfi/cfi.cc | ||
---|---|---|
426 ↗ | (On Diff #135586) | This mutex is not very useful. An interceptor could still go ahead while cfi_init is running in another thread. And we probably can not afford a lock in cfi_slowpath. Perhaps add a constructor to all cfi-instrumented binaries? Then we would not need lazy initialization in __cfi_slowpath, and I don't care how many locks dlopen() takes. |
Comment Actions
A constructor would also mitigate the dlopen issue (see the comment before the interceptor). Not that we've seen this issue in the wild.
Comment Actions
As discussed offline, I going to keep primary initialization unchanged and make lazy only interceptors initialization.
compiler-rt/lib/cfi/cfi.cc | ||
---|---|---|
416 ↗ | (On Diff #135717) | I see, that's too early for that. |