summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Clementi <luca.clementi@gmail.com>2014-06-09 22:05:38 -0700
committerDmitry V. Levin <ldv@altlinux.org>2014-06-11 00:09:55 +0000
commitf1d73110a00122879a0fdb63bbeffc0bd161e857 (patch)
treea1f7a72d632a5710e9f51902ba56e59b90ed9ccc
parent6555711a6ee9b63a5a9c5e3e530d066306c0760c (diff)
downloadstrace-f1d73110a00122879a0fdb63bbeffc0bd161e857.tar.gz
unwind: disable stack trace with multiple personalities
* unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, unwind_capture_stacktrace): Disable stack tracing of non-default personality processes.
-rw-r--r--unwind.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/unwind.c b/unwind.c
index ba7b5790c..aff6c5a07 100644
--- a/unwind.c
+++ b/unwind.c
@@ -269,6 +269,12 @@ rebuild_cache_if_invalid(struct tcb *tcp, const char *caller)
void
unwind_cache_invalidate(struct tcb* tcp)
{
+#if SUPPORTED_PERSONALITIES > 1
+ if (tcp->currpers != DEFAULT_PERSONALITY) {
+ /* disable strack trace */
+ return;
+ }
+#endif
mmap_cache_generation++;
DPRINTF("tgen=%u, ggen=%u, tcp=%p, cache=%p", "increment",
tcp->mmap_cache_generation,
@@ -566,6 +572,12 @@ queue_print(struct queue_t *queue)
void
unwind_print_stacktrace(struct tcb* tcp)
{
+#if SUPPORTED_PERSONALITIES > 1
+ if (tcp->currpers != DEFAULT_PERSONALITY) {
+ /* disable strack trace */
+ return;
+ }
+#endif
if (tcp->queue->head) {
DPRINTF("tcp=%p, queue=%p", "queueprint", tcp, tcp->queue->head);
queue_print(tcp->queue);
@@ -582,6 +594,12 @@ unwind_print_stacktrace(struct tcb* tcp)
void
unwind_capture_stacktrace(struct tcb *tcp)
{
+#if SUPPORTED_PERSONALITIES > 1
+ if (tcp->currpers != DEFAULT_PERSONALITY) {
+ /* disable strack trace */
+ return;
+ }
+#endif
if (tcp->queue->head)
error_msg_and_die("bug: unprinted entries in queue");