Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751902AbcDKD3z (ORCPT ); Sun, 10 Apr 2016 23:29:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38934 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbcDKD3x (ORCPT ); Sun, 10 Apr 2016 23:29:53 -0400 Date: Sun, 10 Apr 2016 23:29:49 -0400 From: Jessica Yu To: Josh Poimboeuf Cc: Jiri Kosina , Miroslav Benes , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Vojtech Pavlik Subject: Re: x86/stacktrace: add function for detecting reliable stack traces Message-ID: <20160411032948.GB12795@packer-debian-8-amd64.digitalocean.com> References: <1f8c648ed8b8eb49a75f5a6cacf8b7ca76f44fa9.1458933243.git.jpoimboe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1f8c648ed8b8eb49a75f5a6cacf8b7ca76f44fa9.1458933243.git.jpoimboe@redhat.com> X-OS: Linux eisen.io 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1526 Lines: 45 +++ 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 >--- > 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