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

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