[Devel] [PATCH rh7 3/4] ms/kcov: don't profile branches in kcov

Andrey Ryabinin aryabinin at virtuozzo.com
Fri Oct 14 05:01:28 PDT 2016


Profiling 'if' statements in __sanitizer_cov_trace_pc() leads to
unbound recursion and crash:

	__sanitizer_cov_trace_pc() ->
		ftrace_likely_update ->
			__sanitizer_cov_trace_pc() ...

Define DISABLE_BRANCH_PROFILING to disable this tracer.

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov at google.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>

(cherry picked from commit 36f05ae8bce904b4c8105363e6227a79d343bda6)
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/kcov.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/kcov.c b/kernel/kcov.c
index f963fca..91b00e6 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -1,5 +1,6 @@
 #define pr_fmt(fmt) "kcov: " fmt
 
+#define DISABLE_BRANCH_PROFILING
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <linux/file.h>
-- 
2.7.3



More information about the Devel mailing list