[PATCH] D44705: [HWASan] Port HWASan to Linux x86-64 (compiler-rt)

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 14:41:37 PDT 2018


alekseyshl created this revision.
alekseyshl added a reviewer: eugenis.
Herald added subscribers: Sanitizers, delcypher, kristof.beyls, mgorny, dberris, kubamracek.

Porting HWASan to Linux x86-64, first of the three patches, compiler-rt part.

The approach is similar to ARM case, trap signal is used to communicate
memory tag check failure. int3 instruction is used to generate a signal,
access parameters are stored in nop [eax + offset] instruction immediately
following the int3 one

Had to add HWASan init on malloc because, due to much less interceptors
defined (most other sanitizers intercept much more and get initalized
via one of those interceptors or don't care about malloc), HWASan was not
initialized yet when libstdc++ was trying to allocate memory for its own
fixed-size heap, which led to CHECK-fail in AllocateFromLocalPool.

Also added the CHECK() failure handler with more detailed message and
stack reporting.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44705

Files:
  cmake/config-ix.cmake
  lib/hwasan/hwasan.cc
  lib/hwasan/hwasan.h
  lib/hwasan/hwasan_allocator.cc
  lib/hwasan/hwasan_interceptors.cc
  lib/hwasan/hwasan_linux.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44705.139200.patch
Type: text/x-patch
Size: 9255 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180320/6c2da682/attachment.bin>


More information about the llvm-commits mailing list