[hwasan] Fix kernel instrumentation of stack.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 9 Feb 2018 00:59:10 +0000 (00:59 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 9 Feb 2018 00:59:10 +0000 (00:59 +0000)
commit80ccda2d4bd3d5aed4a7c49d3d4d4adbb20318f3
treee00896184b4f4185b3a95408854f77a6db752615
parent7d3dde3c6b31b513a9c3e6b8d9cf8acc530dbab0
[hwasan] Fix kernel instrumentation of stack.

Summary:
Kernel addresses have 0xFF in the most significant byte.
A tag can not be pushed there with OR (tag << 56);
use AND ((tag << 56) | 0x00FF..FF) instead.

Reviewers: kcc, andreyknvl

Subscribers: srhines, llvm-commits, hiraditya

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

llvm-svn: 324691
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
llvm/test/Instrumentation/HWAddressSanitizer/kernel-alloca.ll [new file with mode: 0644]