aboutsummaryrefslogtreecommitdiff
path: root/tests/time_test.cpp
diff options
context:
space:
mode:
authorEvgenii Stepanov <eugenis@google.com>2018-11-06 16:44:45 -0800
committerEvgenii Stepanov <eugenis@google.com>2018-11-06 16:59:21 -0800
commit96bd339c51194bf56781ccc738fde8babd618fc6 (patch)
tree8aadb242fdb150116029677bac486866adb08001 /tests/time_test.cpp
parent6d1c5cab94f9fb7423198f950fb94dc7e31c4ddd (diff)
downloadbionic-96bd339c51194bf56781ccc738fde8babd618fc6.tar.gz
Remove timer_delete_multiple test.
According to posix, this test invokes undefined behavior by deleting a timer twice. According to hwasan, the second call to timer_delete loads kernel_timer_id from previously deallocated PosixTimer (i.e. heap-use-after-free). Bug: 114279110 Test: bionic-unit-tests with hwasan Change-Id: Ic54579e3bb41d3f38282b8822dafaba51efd003a
Diffstat (limited to 'tests/time_test.cpp')
-rw-r--r--tests/time_test.cpp17
1 files changed, 0 insertions, 17 deletions
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index e82f15d16..4ec5976b4 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -488,23 +488,6 @@ TEST(time, timer_create_EINVAL) {
ASSERT_EQ(EINVAL, errno);
}
-TEST(time, timer_delete_multiple) {
- timer_t timer_id;
- ASSERT_EQ(0, timer_create(CLOCK_MONOTONIC, nullptr, &timer_id));
- ASSERT_EQ(0, timer_delete(timer_id));
- ASSERT_EQ(-1, timer_delete(timer_id));
- ASSERT_EQ(EINVAL, errno);
-
- sigevent_t se;
- memset(&se, 0, sizeof(se));
- se.sigev_notify = SIGEV_THREAD;
- se.sigev_notify_function = NoOpNotifyFunction;
- ASSERT_EQ(0, timer_create(CLOCK_MONOTONIC, &se, &timer_id));
- ASSERT_EQ(0, timer_delete(timer_id));
- ASSERT_EQ(-1, timer_delete(timer_id));
- ASSERT_EQ(EINVAL, errno);
-}
-
TEST(time, timer_create_multiple) {
Counter counter1(Counter::CountNotifyFunction);
Counter counter2(Counter::CountNotifyFunction);