Merge "Run MTE tests on zero-sized allocations." am: 93406da189

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1706267

Change-Id: Iad5541d6126cf79bdbc257172078017b8684d935
This commit is contained in:
Peter Collingbourne 2021-05-14 04:37:57 +00:00 committed by Automerger Merge Worker
commit 4bd1c5c8ac

View file

@ -475,7 +475,7 @@ TEST_P(GwpAsanCrasherTest, gwp_asan_uaf) {
struct SizeParamCrasherTest : CrasherTest, testing::WithParamInterface<size_t> {};
INSTANTIATE_TEST_SUITE_P(Sizes, SizeParamCrasherTest, testing::Values(16, 131072));
INSTANTIATE_TEST_SUITE_P(Sizes, SizeParamCrasherTest, testing::Values(0, 16, 131072));
TEST_P(SizeParamCrasherTest, mte_uaf) {
#if defined(__aarch64__)
@ -483,6 +483,11 @@ TEST_P(SizeParamCrasherTest, mte_uaf) {
GTEST_SKIP() << "Requires MTE";
}
// Any UAF on a zero-sized allocation will be out-of-bounds so it won't be reported.
if (GetParam() == 0) {
return;
}
int intercept_result;
unique_fd output_fd;
StartProcess([&]() {