sanitizer_common: don't write into .rodata
authorDmitry Vyukov <dvyukov@google.com>
Mon, 10 May 2021 11:27:06 +0000 (13:27 +0200)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 12 May 2021 05:54:06 +0000 (07:54 +0200)
commit23596fece043fa04206dcd5b26b4ca832e6741db
treeb6b7f4b7297f14c72eedb4e4c5dff0fb60911680
parent85a96d82ca76819df56c97b6b3b5d5d98a030d5d
sanitizer_common: don't write into .rodata

setlocale interceptor imitates a write into result,
which may be located in .rodata section.
This is the only interceptor that tries to do this and
I think the intention was to initialize the range for msan.
So do that instead. Writing into .rodata shouldn't happen
(without crashing later on the actual write) and this
traps on my local tsan experiments.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D102161
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc