On Wed, Jun 11, 2025 at 10:41:07AM +0100, Yeoreum Yun wrote:
quoted hunk ↗ jump to hunk
+static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, int tag_check, int atag_check)
{
char *ptr, *map_ptr;
int run, result, map_size;@@ -97,16 +106,16 @@ static int check_anonymous_memory_mapping(int mem_type, int mode, int mapping, i
munmap((void *)map_ptr, map_size);
return KSFT_FAIL;
}
- result = check_mte_memory(ptr, sizes[run], mode, tag_check);
+ result = check_mte_memory(ptr, sizes[run], mode, tag_check, atag_check);
mte_clear_tags((void *)ptr, sizes[run]);
mte_free_memory((void *)map_ptr, map_size, mem_type, false);
- if (result == KSFT_FAIL)
- return KSFT_FAIL;
+ if (result != KSFT_SKIP)
+ return result;
}
This changes the logic to exit the loop immediately if the check passes
which doesn't seem like what we want, should we instead change the test
to be:
if (result != KSFT_PASS)
which I think is more the intent?
quoted hunk ↗ jump to hunk
+ result = check_mte_memory(ptr, sizes[run], mode, TAG_CHECK_ON, atag_check);
mte_free_memory_tag_range((void *)ptr, sizes[run], mem_type, UNDERFLOW, OVERFLOW);
if (result != KSFT_PASS)
return KSFT_FAIL;
@@ -192,7 +201,7 @@ static int check_clear_prot_mte_flag(int mem_type, int mode, int mapping)
close(fd);
return KSFT_FAIL;
}
Won't this upgrade any skips to fails?