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