Commit Graph

8 Commits (2024091700)

Author SHA1 Message Date
Dmitry Muhomor 7268189933 mte: use tag 0 for freed slots, stop reserving tag 15 2024-01-23 12:56:54 -05:00
Dmitry Muhomor 5fbbdc2ef8 memtag_test: add test for MADV_DONTNEED behavior 2024-01-23 12:56:54 -05:00
Dmitry Muhomor 4756716904 memtag_test: move SEGV code checks to device-side binary 2024-01-23 12:56:54 -05:00
Dmitry Muhomor 88b3c1acf9 memtag_test: fix sporadic failures of overflow/underflow tests 2023-11-01 17:33:20 -04:00
Dmitry Muhomor f16ef601d4 memtag_test: improve capturing of test results
Using debuggerd + logcat parsing is unreliable and slow, print SEGV signal code to stderr instead.
2023-10-30 14:20:53 -04:00
Dmitry Muhomor 155800526a memtag_test: improve tag_distinctness test
- check that tag distinctess checks are actually reached (it was previously verified manually by
looking at the now-removed printf output)
- check that only non-reserved tags are used
- check that all of non-reserved tags are used
- print tag usage statistics at the end of run
2023-10-30 14:20:53 -04:00
Dmitry Muhomor 28d5d394cf memtag_test: remove usages of rand()
It didn't work correctly due to not being seeded and its usage wasn't necessary.
2023-10-30 14:20:53 -04:00
Dmitry Muhomor 576328b1b4 android: add MTE tests
To run them, connect an MTE-enabled device via adb and execute `atest HMallocTest:MemtagTest`.

Since these tests are not deterministic (and neither is hardened_malloc itself), it's better to run
them multiple times, e.g. `atest --iterations 30 HMallocTest:MemtagTest`.

There are also CTS tests that are useful for checking correctness of the Android integration:
`atest CtsTaggingHostTestCases`
2023-10-30 14:20:53 -04:00