1 //===-- hwasan_poisoning.cpp ------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of HWAddressSanitizer.
11 //===----------------------------------------------------------------------===//
13 #include "hwasan_poisoning.h"
15 #include "hwasan_mapping.h"
16 #include "interception/interception.h"
17 #include "sanitizer_common/sanitizer_common.h"
18 #include "sanitizer_common/sanitizer_linux.h"
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
);
28 } // namespace __hwasan
30 // --- Implementation of LSan-specific functions --- {{{1
32 bool WordIsPoisoned(uptr addr
) {
33 // Fixme: implement actual tag checking.