diff options
author | Kostya Serebryany <kcc@google.com> | 2017-02-10 22:26:19 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2017-02-10 22:26:19 +0000 |
commit | 5b53a2f2928bbbf397bfa4f4126ecc7805314dfc (patch) | |
tree | 6ee6df631e4227773f5b4690914303c26a2d3b7d /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 46d72b1b7f73e39415122ab262b148683bd60e36 (diff) | |
download | llvm-5b53a2f2928bbbf397bfa4f4126ecc7805314dfc.zip llvm-5b53a2f2928bbbf397bfa4f4126ecc7805314dfc.tar.gz llvm-5b53a2f2928bbbf397bfa4f4126ecc7805314dfc.tar.bz2 |
Fix AddressSanitizer on s390 (31-bit)
Summary:
GET_CALLER_PC doesn't work properly on 31-bit s390, as pointers are 31-bit, the MSB bit can be set when the return address is copied into integer.
This causes e.g. errors like:
#0 0xfdadb129 (<unknown module>)
#1 0x7da5e1d1 in __asan::GetStackTraceWithPcBpAndContext(__sanitizer::BufferedStackTrace*, unsigned long, unsigned long, unsigned long, void*, bool) ../../../../../libsanitizer/asan/asan_stack.h:50
#2 0x7da5e1d1 in __asan::ErrorGeneric::Print() ../../../../../libsanitizer/asan/asan_errors.cc:482
#3 0x7db178d5 in __asan::ErrorDescription::Print() ../../../../../libsanitizer/asan/asan_errors.h:360
#4 0x7db178d5 in __asan::ScopedInErrorReport::~ScopedInErrorReport() ../../../../../libsanitizer/asan/asan_report.cc:167
#5 0x7db178d5 in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ../../../../../libsanitizer/asan/asan_report.cc:397
#6 0x7dadb14f in __interceptor_memcmp ../../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:626
#7 0x400cf5 in main /home/jakub/gcc/gcc/testsuite/c-c++-common/asan/memcmp-1.c:14
#8 0x7d807215 in __libc_start_main (/lib/libc.so.6+0x1a215)
#9 0x4007ed (/home/jakub/gcc/obj/gcc/testsuite/memcmp-1.exe+0x4007ed)
The actual return PC inside __interceptor_memcmp was 0x7dadb129 rather than 0xfdadb129.
Reviewers: koriakin, kcc
Reviewed By: kcc
Subscribers: kubamracek
Differential Revision: https://reviews.llvm.org/D29824
llvm-svn: 294793
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions