1 //===-- hwasan_poisoning.cpp ------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // This file is a part of HWAddressSanitizer. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "hwasan_poisoning.h" 14 15 #include "hwasan_mapping.h" 16 #include "interception/interception.h" 17 #include "sanitizer_common/sanitizer_common.h" 18 #include "sanitizer_common/sanitizer_linux.h" 19 20 namespace __hwasan { 21 22 uptr TagMemory(uptr p, uptr size, tag_t tag) { 23 uptr start = RoundDownTo(p, kShadowAlignment); 24 uptr end = RoundUpTo(p + size, kShadowAlignment); 25 return TagMemoryAligned(start, end - start, tag); 26 } 27 28 } // namespace __hwasan 29 30 // --- Implementation of LSan-specific functions --- {{{1 31 namespace __lsan { 32 bool WordIsPoisoned(uptr addr) { 33 // Fixme: implement actual tag checking. 34 return false; 35 } 36 } // namespace __lsan 37