Revert "[NFC][scudo] Let disableMemoryTagChecksTestOnly to fail"

This reverts commit 2c212db4ea.

It's not needed.
This commit is contained in:
Vitaly Buka 2021-05-25 11:35:12 -07:00
parent 9c91614959
commit d1e5f046cc
2 changed files with 15 additions and 15 deletions

View File

@ -92,13 +92,12 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() { return false; }
#endif // SCUDO_LINUX #endif // SCUDO_LINUX
inline bool disableMemoryTagChecksTestOnly() { inline void disableMemoryTagChecksTestOnly() {
__asm__ __volatile__( __asm__ __volatile__(
R"( R"(
.arch_extension memtag .arch_extension memtag
msr tco, #1 msr tco, #1
)"); )");
return true;
} }
inline void enableMemoryTagChecksTestOnly() { inline void enableMemoryTagChecksTestOnly() {
@ -251,7 +250,7 @@ inline bool systemDetectsMemoryTagFaultsTestOnly() {
UNREACHABLE("memory tagging not supported"); UNREACHABLE("memory tagging not supported");
} }
inline bool disableMemoryTagChecksTestOnly() { inline void disableMemoryTagChecksTestOnly() {
UNREACHABLE("memory tagging not supported"); UNREACHABLE("memory tagging not supported");
} }

View File

@ -399,20 +399,21 @@ SCUDO_TYPED_TEST(ScudoCombinedTest, DisableMemoryTagging) {
// Check that disabling memory tagging works correctly. // Check that disabling memory tagging works correctly.
void *P = Allocator->allocate(2048, Origin); void *P = Allocator->allocate(2048, Origin);
EXPECT_DEATH(reinterpret_cast<char *>(P)[2048] = 0xaa, ""); EXPECT_DEATH(reinterpret_cast<char *>(P)[2048] = 0xaa, "");
if (scudo::disableMemoryTagChecksTestOnly()) { scudo::disableMemoryTagChecksTestOnly();
Allocator->disableMemoryTagging(); Allocator->disableMemoryTagging();
reinterpret_cast<char *>(P)[2048] = 0xaa; reinterpret_cast<char *>(P)[2048] = 0xaa;
Allocator->deallocate(P, Origin); Allocator->deallocate(P, Origin);
P = Allocator->allocate(2048, Origin); P = Allocator->allocate(2048, Origin);
EXPECT_EQ(scudo::untagPointer(P), P); EXPECT_EQ(scudo::untagPointer(P), P);
reinterpret_cast<char *>(P)[2048] = 0xaa; reinterpret_cast<char *>(P)[2048] = 0xaa;
Allocator->deallocate(P, Origin); Allocator->deallocate(P, Origin);
// Disabling memory tag checks may interfere with subsequent tests. Allocator->releaseToOS();
// Re-enable them now.
scudo::enableMemoryTagChecksTestOnly(); // Disabling memory tag checks may interfere with subsequent tests.
} // Re-enable them now.
scudo::enableMemoryTagChecksTestOnly();
} }
} }