From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbdEEMWI (ORCPT ); Fri, 5 May 2017 08:22:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:46510 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751335AbdEEMWG (ORCPT ); Fri, 5 May 2017 08:22:06 -0400 From: Jiri Slaby To: akpm@linux-foundation.org Cc: torvalds@linux-foundation.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Josh Poimboeuf Subject: [PATCH 5/7] unwinder: show_stack, check also ret_addr_p's contents Date: Fri, 5 May 2017 14:21:58 +0200 Message-Id: <20170505122200.31436-5-jslaby@suse.cz> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170505122200.31436-1-jslaby@suse.cz> References: <20170505122200.31436-1-jslaby@suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The DWARF unwinder stores the return address in an internal structure. This is returned to the generic unwinder. So do not check only ret_addr_p against the current stack pointer, but also if the address is the return address. This makes the unwinder to really think the addresses are reliable. Signed-off-by: Jiri Slaby Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x86@kernel.org Cc: Josh Poimboeuf --- arch/x86/kernel/dumpstack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index dbce3cca94cb..963c6b60887f 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c @@ -123,7 +123,8 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, continue; } - if (stack == ret_addr_p) + if (stack == ret_addr_p || + (ret_addr_p && addr == *ret_addr_p)) reliable = 1; /* -- 2.12.2