lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-10b1105004fbd81058383537b67df35cc188ab62@git.kernel.org>
Date:   Fri, 25 May 2018 02:50:41 -0700
From:   tip-bot for Alexey Budankov <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     alexey.budankov@...ux.intel.com, torvalds@...ux-foundation.org,
        acme@...hat.com, linux-kernel@...r.kernel.org, namhyung@...nel.org,
        mingo@...nel.org, acme@...nel.org, tglx@...utronix.de,
        hpa@...or.com, eranian@...gle.com, jolsa@...hat.com,
        peterz@...radead.org, alexander.shishkin@...ux.intel.com,
        vincent.weaver@...ne.edu
Subject: [tip:perf/core] perf/x86: Store user space frame-pointer value on a
 sample

Commit-ID:  10b1105004fbd81058383537b67df35cc188ab62
Gitweb:     https://git.kernel.org/tip/10b1105004fbd81058383537b67df35cc188ab62
Author:     Alexey Budankov <alexey.budankov@...ux.intel.com>
AuthorDate: Thu, 24 May 2018 17:11:54 +0300
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 25 May 2018 08:11:12 +0200

perf/x86: Store user space frame-pointer value on a sample

Store user space frame-pointer value (BP register) into the perf trace
on a sample for a process so the value becomes available when
unwinding call stacks for functions gaining event samples.

Signed-off-by: Alexey Budankov <alexey.budankov@...ux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Link: http://lkml.kernel.org/r/311d4a34-f81b-5535-3385-01427ac73b41@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/perf_regs.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/perf_regs.c b/arch/x86/kernel/perf_regs.c
index e47b2dbbdef3..c06c4c16c6b6 100644
--- a/arch/x86/kernel/perf_regs.c
+++ b/arch/x86/kernel/perf_regs.c
@@ -151,17 +151,19 @@ void perf_get_regs_user(struct perf_regs *regs_user,
 	regs_user_copy->sp = user_regs->sp;
 	regs_user_copy->cs = user_regs->cs;
 	regs_user_copy->ss = user_regs->ss;
-
 	/*
-	 * Most system calls don't save these registers, don't report them.
+	 * Store user space frame-pointer value on sample
+	 * to facilitate stack unwinding for cases when
+	 * user space executable code has such support
+	 * enabled at compile time:
 	 */
+	regs_user_copy->bp = user_regs->bp;
+
 	regs_user_copy->bx = -1;
-	regs_user_copy->bp = -1;
 	regs_user_copy->r12 = -1;
 	regs_user_copy->r13 = -1;
 	regs_user_copy->r14 = -1;
 	regs_user_copy->r15 = -1;
-
 	/*
 	 * For this to be at all useful, we need a reasonable guess for
 	 * the ABI.  Be careful: we're in NMI context, and we're

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ