mte: rename arm_mte_store_tags_and_clear() to arm_mte_tag_and_clear_mem()

pull/226/head
Dmitry Muhomor 2023-10-30 12:27:47 +02:00 committed by Daniel Micay
parent 7a6dbd8152
commit 03883eb2ce
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ static inline void *arm_mte_create_random_tag(void *p, u64 exclusion_mask) {
// //
// scudo is licensed under the Apache License v2.0 with LLVM Exceptions, which is compatible with // scudo is licensed under the Apache License v2.0 with LLVM Exceptions, which is compatible with
// the hardened_malloc's MIT license // the hardened_malloc's MIT license
static inline void arm_mte_store_tags_and_clear(void *tagged_ptr, size_t len) { static inline void arm_mte_tag_and_clear_mem(void *tagged_ptr, size_t len) {
uintptr_t Begin = (uintptr_t) tagged_ptr; uintptr_t Begin = (uintptr_t) tagged_ptr;
uintptr_t End = Begin + len; uintptr_t End = Begin + len;
uintptr_t LineSize, Next, Tmp; uintptr_t LineSize, Next, Tmp;

View File

@ -589,7 +589,7 @@ static void *tag_and_clear_slab_slot(struct slab_metadata *metadata, void *slot_
void *tagged_ptr = arm_mte_create_random_tag(slot_ptr, tem); void *tagged_ptr = arm_mte_create_random_tag(slot_ptr, tem);
// slot addresses and sizes are always aligned by 16 // slot addresses and sizes are always aligned by 16
arm_mte_store_tags_and_clear(tagged_ptr, slot_size); arm_mte_tag_and_clear_mem(tagged_ptr, slot_size);
// store new tag of this slot // store new tag of this slot
u4_arr_set(slot_tags, slot_idx + 1, get_pointer_tag(tagged_ptr)); u4_arr_set(slot_tags, slot_idx + 1, get_pointer_tag(tagged_ptr));
@ -798,7 +798,7 @@ static inline void deallocate_small(void *p, const size_t *expected_size) {
bool skip_zero = false; bool skip_zero = false;
#ifdef HAS_ARM_MTE #ifdef HAS_ARM_MTE
if (likely(is_memtag_enabled())) { if (likely(is_memtag_enabled())) {
arm_mte_store_tags_and_clear(set_pointer_tag(p, RESERVED_TAG), size); arm_mte_tag_and_clear_mem(set_pointer_tag(p, RESERVED_TAG), size);
// metadata->arm_mte_tags is intentionally not updated, it should keep the previous slot // metadata->arm_mte_tags is intentionally not updated, it should keep the previous slot
// tag after slot is freed // tag after slot is freed
skip_zero = true; skip_zero = true;