Skip to content

Commit ffc8274

Browse files
brooniectmarinas
authored andcommitted
selftests/arm64: Allow zero tags in mte_switch_mode()
mte_switch_mode() currently rejects attempts to set a zero tag however there are tests such as check_tags_inclusion which attempt to cover cases with zero tags using mte_switch_mode(). Since it is not clear why we are rejecting zero tags change the test to accept them. The issue has not previously been as apparent as it should be since the return value of mte_switch_mode() was not always checked in the callers and the tests weren't otherwise failing. Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Shuah Khan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 9a56817 commit ffc8274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/arm64/mte/mte_common_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ int mte_switch_mode(int mte_option, unsigned long incl_mask)
283283
return -EINVAL;
284284
}
285285

286-
if (!(incl_mask <= MTE_ALLOW_NON_ZERO_TAG)) {
286+
if (incl_mask & ~MT_INCLUDE_TAG_MASK) {
287287
ksft_print_msg("FAIL: Invalid incl_mask %lx\n", incl_mask);
288288
return -EINVAL;
289289
}

0 commit comments

Comments
 (0)