From b63f1dff9dc736f7fa66f04976436f1f3fe2ac5d Mon Sep 17 00:00:00 2001 From: comex Date: Mon, 23 Feb 2015 00:41:29 -0500 Subject: Ban calls within transform regions in threadsafe mode. --- lib/substitute.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/substitute.h') diff --git a/lib/substitute.h b/lib/substitute.h index 2045c3d..d8b9fd0 100644 --- a/lib/substitute.h +++ b/lib/substitute.h @@ -29,6 +29,14 @@ enum { * updated to handle that case properly */ SUBSTITUTE_ERR_FUNC_BAD_INSN_AT_START, + /* substitute_hook_functions: can't patch a function because one of the + * instructions within the patch region (other than the last instruction) + * is a call - meaning that a return address within the region (i.e. about + * to point to clobbered code) could be on some thread's stack, where we + * can't easily find and patch it. This check is skipped if + * SUBSTITUTE_NO_THREAD_SAFETY is set. */ + SUBSTITUTE_ERR_FUNC_CALLS_AT_START, + /* substitute_hook_functions: can't patch a function because the (somewhat * cursory) jump analysis found a jump later in the function to within the * patch region at the beginning */ -- cgit v1.2.3