mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-10-01 01:36:01 -04:00
mte: disable write-after-free check for slab allocations when MTE is on
Freed slab memory is tagged with a reserved tag value that is never used for live allocations.
This commit is contained in:
parent
52fcaf55d6
commit
d80e2f232c
@ -464,6 +464,12 @@ static void write_after_free_check(const char *p, size_t size) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAS_ARM_MTE
|
||||
if (likely(is_memtag_enabled())) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < size; i += sizeof(u64)) {
|
||||
if (unlikely(*(const u64 *)(const void *)(p + i))) {
|
||||
fatal_error("detected write after free");
|
||||
|
Loading…
Reference in New Issue
Block a user