Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1375450

Re: x86/stacktrace: add function for detecting reliable stack traces

From Jessica Yu <jeyu@redhat.com>
Newsgroups linux.kernel
Subject Re: x86/stacktrace: add function for detecting reliable stack traces
Date 2016-04-11 05:40 +0200
Message-ID <rmARH-7G8-15@gated-at.bofh.it> (permalink)
References <rgFKp-6zA-3@gated-at.bofh.it> <rgFKr-6zA-59@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


+++ Josh Poimboeuf [25/03/16 14:34 -0500]:
>For live patching and possibly other use cases, a stack trace is only
>useful if you can be assured that it's completely reliable.  Add a new
>save_stack_trace_tsk_reliable() function to achieve that.
>
>Scenarios which indicate that a stack strace may be unreliable:

s/strace/trace

>
>- interrupt stacks
>- preemption
>- corrupted stack data
>- newly forked tasks
>- running tasks
>- the user didn't provide a large enough entries array
>
>Also add a config option so arch-independent code can determine at build
>time whether the function is implemented.
>
>Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
>---
> arch/Kconfig                 |  6 ++++++
> arch/x86/Kconfig             |  1 +
> arch/x86/kernel/dumpstack.c  | 36 ++++++++++++++++++++++++++++++++++++
> arch/x86/kernel/stacktrace.c | 32 ++++++++++++++++++++++++++++++++
> include/linux/stacktrace.h   | 20 ++++++++++++++++----
> kernel/stacktrace.c          |  4 ++--
> lib/Kconfig.debug            |  6 ++++++
> 7 files changed, 99 insertions(+), 6 deletions(-)
>
>diff --git a/arch/Kconfig b/arch/Kconfig
>index 81869a5..68b95f1 100644
>--- a/arch/Kconfig
>+++ b/arch/Kconfig
>@@ -589,6 +589,12 @@ config HAVE_STACK_VALIDATION
> 	  Architecture supports the 'objtool check' host tool command, which
> 	  performs compile-time stack metadata validation.
>
>+config HAVE_RELIABLE_STACKTRACE
>+	bool
>+	help
>+	  Architecure has a save_stack_trace_tsk_reliable() function which only

s/Architecure/Architecture

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: x86/stacktrace: add function for detecting reliable stack traces Jessica Yu <jeyu@redhat.com> - 2016-04-11 05:40 +0200

csiph-web