Blame SOURCES/0040-syscall-do-not-capture-stack-trace-while-the-tracee-.patch

7a62b9
From 35e080ae319d25c1df82855cda3a1bb014e90ba6 Mon Sep 17 00:00:00 2001
7a62b9
From: "Dmitry V. Levin" <ldv@altlinux.org>
7a62b9
Date: Wed, 8 Jan 2020 00:41:58 +0000
7a62b9
Subject: [PATCH] syscall: do not capture stack trace while the tracee executes
7a62b9
 strace code
7a62b9
7a62b9
* syscall.c (syscall_entering_trace) [ENABLE_STACKTRACE]: Do not capture
7a62b9
stack trace when TCB_CHECK_EXEC_SYSCALL flag is set.
7a62b9
---
7a62b9
 syscall.c | 9 +++++----
7a62b9
 1 file changed, 5 insertions(+), 4 deletions(-)
7a62b9
7a62b9
diff --git a/syscall.c b/syscall.c
7a62b9
index fadd3b5..a8fb4f1 100644
7a62b9
--- a/syscall.c
7a62b9
+++ b/syscall.c
7a62b9
@@ -620,7 +620,7 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
7a62b9
 	if (hide_log(tcp)) {
7a62b9
 		/*
7a62b9
 		 * Restrain from fault injection
7a62b9
-		 * while the trace executes strace code.
7a62b9
+		 * while the tracee executes strace code.
7a62b9
 		 */
7a62b9
 		tcp->qual_flg &= ~QUAL_INJECT;
7a62b9
 
7a62b9
@@ -655,9 +655,10 @@ syscall_entering_trace(struct tcb *tcp, unsigned int *sig)
7a62b9
 	}
7a62b9
 
7a62b9
 #ifdef ENABLE_STACKTRACE
7a62b9
-	if (stack_trace_enabled) {
7a62b9
-		if (tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER)
7a62b9
-			unwind_tcb_capture(tcp);
7a62b9
+	if (stack_trace_enabled &&
7a62b9
+	    !check_exec_syscall(tcp) &&
7a62b9
+	    tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) {
7a62b9
+		unwind_tcb_capture(tcp);
7a62b9
 	}
7a62b9
 #endif
7a62b9
 
7a62b9
-- 
7a62b9
2.1.4
7a62b9