From ee64538c9ffd9061beed35146e37813a1e26a152 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Thu, 15 Jun 2023 00:13:50 -0700 Subject: executor: use exitf instead of fail outside of setup sequence (#3959) We have a long history of executor managing to corrupt itself in various interesting ways (e.g. using read with a pointer pointing to some global/stack variable and then kernel overwrites it). Or rt_sigreturn can corrupt other registers which won't cause immediate SIGSEGV, but rather some random behavior later. This is the race we can't win. We can't rely on memory consistency when the test already started, so we should use exitf instead of fail outside of setup sequence (and relying more on unit testing to ensure that executor works as expected for sane programs). Suggested-by: Dmitry Vyukov Signed-off-by: Andrei Vagin --- executor/common_linux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index c5fc7f6ab..621f0b2d8 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -35,7 +35,7 @@ static void event_reset(event_t* ev) static void event_set(event_t* ev) { if (ev->state) - fail("event already set"); + exitf("event already set"); __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE); syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000); } -- cgit mrf-deployment