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 <broonie@kernel.org>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220510164520.768783-3-broonie@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
Mark Brown 2022-05-10 17:45:17 +01:00 committed by Catalin Marinas
parent 9a56817107
commit ffc8274c21
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ int mte_switch_mode(int mte_option, unsigned long incl_mask)
return -EINVAL;
}
if (!(incl_mask <= MTE_ALLOW_NON_ZERO_TAG)) {
if (incl_mask & ~MT_INCLUDE_TAG_MASK) {
ksft_print_msg("FAIL: Invalid incl_mask %lx\n", incl_mask);
return -EINVAL;
}