[all-commits] [llvm/llvm-project] 3d049b: hwasan: Support for outlined checks in the Linux k...

pcc via All-commits all-commits at lists.llvm.org
Fri Oct 30 14:26:08 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d049bce98ce39becfaa0fc15a54f1e8a7d62643
      https://github.com/llvm/llvm-project/commit/3d049bce98ce39becfaa0fc15a54f1e8a7d62643
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2020-10-30 (Fri, 30 Oct 2020)

  Changed paths:
    M llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
    M llvm/test/CodeGen/AArch64/hwasan-check-memaccess.ll
    M llvm/test/Instrumentation/HWAddressSanitizer/kernel.ll

  Log Message:
  -----------
  hwasan: Support for outlined checks in the Linux kernel.

Add support for match-all tags and GOT-free runtime calls, which
are both required for the kernel to be able to support outlined
checks. This requires extending the access info to let the backend
know when to enable these features. To make the code easier to maintain
introduce an enum with the bit field positions for the access info.

Allow outlined checks to be enabled with -mllvm
-hwasan-inline-all-checks=0. Kernels that contain runtime support for
outlined checks may pass this flag. Kernels lacking runtime support
will continue to link because they do not pass the flag. Old versions
of LLVM will ignore the flag and continue to use inline checks.

With a separate kernel patch [1] I measured the code size of defconfig
+ tag-based KASAN, as well as boot time (i.e. time to init launch)
on a DragonBoard 845c with an Android arm64 GKI kernel. The results
are below:

         code size    boot time
before    92824064      6.18s
after     38822400      6.65s

[1] https://linux-review.googlesource.com/id/I1a30036c70ab3c3ee78d75ed9b87ef7cdc3fdb76

Depends on D90425

Differential Revision: https://reviews.llvm.org/D90426




More information about the All-commits mailing list