summaryrefslogtreecommitdiff
path: root/lib/hwasan/hwasan.h
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-10-17 20:32:54 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2019-10-17 20:32:54 +0000
commit6e86c1660cd0c8f0af4575b41f83150a560d3941 (patch)
treec8a57e634bb86935da969757daf7eaaa3f0713cb /lib/hwasan/hwasan.h
parent45c83da934bc2f2f7cb68b2602753753cb0929f4 (diff)
downloadcompiler-rt-6e86c1660cd0c8f0af4575b41f83150a560d3941.tar.gz
libhwasan initialisation include kernel syscall ABI relaxation
Summary: Until now AArch64 development has been on patched kernels that have an always on relaxed syscall ABI where tagged pointers are accepted. The patches that have gone into the mainline kernel rely on each process opting in to this relaxed ABI. This commit adds code to choose that ABI into __hwasan_init. The idea has already been agreed with one of the hwasan developers (http://lists.llvm.org/pipermail/llvm-dev/2019-September/135328.html). The patch ignores failures of `EINVAL` for Android, since there are older versions of the Android kernel that don't require this `prctl` or even have the relevant values. Avoiding EINVAL will let the library run on them. I've tested this on an AArch64 VM running a kernel that requires this prctl, having compiled both with clang and gcc. Patch by Matthew Malcomson. Reviewers: eugenis, kcc, pcc Reviewed By: eugenis Subscribers: srhines, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D68794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@375166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/hwasan/hwasan.h')
-rw-r--r--lib/hwasan/hwasan.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/hwasan/hwasan.h b/lib/hwasan/hwasan.h
index 817cee650..9e0ced93b 100644
--- a/lib/hwasan/hwasan.h
+++ b/lib/hwasan/hwasan.h
@@ -74,6 +74,7 @@ extern int hwasan_report_count;
bool ProtectRange(uptr beg, uptr end);
bool InitShadow();
+void InitPrctl();
void InitThreads();
void MadviseShadow();
char *GetProcSelfMaps();