A bunch of MTE tests like ./ScudoUnitTest-aarch64-Test/MemtagTest.StoreTags can fail on aarch64-linux if the kernel doesn't support TBI. It looks like the call to prctl(PR_GET_TAGGED_ADDR_CTRL, 0, 0, 0, 0) can return -1, which casted to an unsigned int and masked will return a value not equal to PR_MTE_TCF_NONE, meaning systemDetectsMemoryTagFaultsTestOnly can return an incorrect value.
This updates the check to account for a failing prctl call.
Can we change this to:
and remove the #if on line 26 instead? (This is orthogonal to your issue though.)