From 7c9e8492e6c7882c495b29c53e078327c2a23de5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 28 Jun 2024 13:31:00 +0200 Subject: executor: don't trace PCs as comparisons Currnetly we always write PCs into the buffer even if tracing comparisons. Such bogus data will fail comparison consistentcy checks (type/pc) and executor will crash. Don't trace PCs as comparisons. --- executor/executor_test.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'executor/executor_test.h') diff --git a/executor/executor_test.h b/executor/executor_test.h index 870dcb397..a5eda15d2 100644 --- a/executor/executor_test.h +++ b/executor/executor_test.h @@ -43,7 +43,7 @@ extern "C" notrace void __sanitizer_cov_trace_pc(void) unsigned long ip = (unsigned long)__builtin_return_address(0); // Convert to what is_kernel_pc will accept as valid coverage; ip = kernel_text_start | (ip & kernel_text_mask); - if (current_thread == nullptr || current_thread->cov.data == nullptr) + if (current_thread == nullptr || current_thread->cov.data == nullptr || current_thread->cov.collect_comps) return; unsigned long* start = (unsigned long*)current_thread->cov.data; unsigned long* end = (unsigned long*)current_thread->cov.data_end; @@ -61,6 +61,7 @@ static void cover_open(cover_t* cov, bool extra) static void cover_enable(cover_t* cov, bool collect_comps, bool extra) { + cov->collect_comps = collect_comps; } static void cover_reset(cover_t* cov) -- cgit mrf-deployment