[ASan] Initial support for Kernel AddressSanitizer
authorAlexander Potapenko <glider@google.com>
Fri, 19 Jun 2015 12:19:07 +0000 (12:19 +0000)
committerAlexander Potapenko <glider@google.com>
Fri, 19 Jun 2015 12:19:07 +0000 (12:19 +0000)
commite9149f4f8cd3b915ada134d80452c6eae7875ca4
treebcc85fdc88912e785fed0d4f8320ac6fc1d48775
parentec77d9ad83cfd14517bb534256feb9c5154a636b
[ASan] Initial support for Kernel AddressSanitizer

This patch adds initial support for the -fsanitize=kernel-address flag to Clang.
Right now it's quite restricted: only out-of-line instrumentation is supported, globals are not instrumented, some GCC kasan flags are not supported.
Using this patch I am able to build and boot the KASan tree with LLVMLinux patches from github.com/ramosian-glider/kasan/tree/kasan_llvmlinux.
To disable KASan instrumentation for a certain function attribute((no_sanitize("kernel-address"))) can be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240131 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Instrumentation.h
lib/Transforms/Instrumentation/AddressSanitizer.cpp