From d140aec490dcbcb5e1835ea55080ec4f9007785a Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Tue, 26 Jul 2016 21:02:45 +0000 Subject: [PATCH] [asan] Remove zero FSR check on ARM. The kernel on Nexus 5X returns error_code in ucontext which has correct FSR_WRITE flag, but empty (zero) abort type field. Removing the checks means that we will report all SEGVs as READ on very old kernels, but will properly distinguish READ vs WRITE on moderately old ones. llvm-svn: 276803 --- compiler-rt/lib/sanitizer_common/sanitizer_linux.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index b8890ea..c2fa4c0 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -1292,10 +1292,6 @@ SignalContext::WriteFlag SignalContext::GetWriteFlag(void *context) { #elif defined(__arm__) static const uptr FSR_WRITE = 1U << 11; uptr fsr = ucontext->uc_mcontext.error_code; - // FSR bits 5:0 describe the abort type, and are never 0 (or so it seems). - // Zero FSR indicates an older kernel that does not pass this information to - // the userspace. - if (fsr == 0) return UNKNOWN; return fsr & FSR_WRITE ? WRITE : READ; #elif defined(__aarch64__) static const u64 ESR_ELx_WNR = 1U << 6; -- 2.7.4