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


Groups > linux.kernel > #1546408 > unrolled thread

[PATCH urgent] Revert "x86/unwind: Detect bad stack return address"

Started byJosh Poimboeuf <jpoimboe@redhat.com>
First post2016-12-22 16:10 +0100
Last post2016-12-23 20:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH urgent] Revert "x86/unwind: Detect bad stack return address" Josh Poimboeuf <jpoimboe@redhat.com> - 2016-12-22 16:10 +0100
    [tip:x86/urgent] Revert "x86/unwind: Detect bad stack return  address" tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2016-12-23 20:40 +0100

#1546408 — [PATCH urgent] Revert "x86/unwind: Detect bad stack return address"

FromJosh Poimboeuf <jpoimboe@redhat.com>
Date2016-12-22 16:10 +0100
Subject[PATCH urgent] Revert "x86/unwind: Detect bad stack return address"
Message-ID<sRdai-2C1-29@gated-at.bofh.it>
This reverts commit b6959a362177 ("x86/unwind: Detect bad stack return
address").

Andrey Konovalov reported an unwinder warning:

  WARNING: unrecognized kernel stack return address ffffffffa0000001 at ffff88006377fa18 in a.out:4467

The unwind was initiated from an interrupt which occurred while running in the
generated code for a kprobe.  The unwinder printed the warning because it
expected regs->ip to point to a valid text address, but instead it pointed to
the generated code.

Eventually we may want come up with a way to identify generated kprobe
code so the unwinder can know that it's a valid return address.  Until
then, just remove the warning.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/kernel/unwind_frame.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c
index 20d4b4e..4443e49 100644
--- a/arch/x86/kernel/unwind_frame.c
+++ b/arch/x86/kernel/unwind_frame.c
@@ -51,16 +51,7 @@ unsigned long unwind_get_return_address(struct unwind_state *state)
 	addr = ftrace_graph_ret_addr(state->task, &state->graph_idx, *addr_p,
 				     addr_p);
 
-	if (!__kernel_text_address(addr)) {
-		printk_deferred_once(KERN_WARNING
-			"WARNING: unrecognized kernel stack return address %p at %p in %s:%d\n",
-			(void *)addr, addr_p, state->task->comm,
-			state->task->pid);
-		unwind_dump(state, addr_p);
-		return 0;
-	}
-
-	return addr;
+	return __kernel_text_address(addr) ? addr : 0;
 }
 EXPORT_SYMBOL_GPL(unwind_get_return_address);
 
-- 
2.7.4

[toc] | [next] | [standalone]


#1546958 — [tip:x86/urgent] Revert "x86/unwind: Detect bad stack return address"

Fromtip-bot for Josh Poimboeuf <tipbot@zytor.com>
Date2016-12-23 20:40 +0100
Subject[tip:x86/urgent] Revert "x86/unwind: Detect bad stack return address"
Message-ID<sRDR7-2It-15@gated-at.bofh.it>
In reply to#1546408
Commit-ID:  c280f7736ab26a601932b1ce017a3840dbedcfdc
Gitweb:     http://git.kernel.org/tip/c280f7736ab26a601932b1ce017a3840dbedcfdc
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Thu, 22 Dec 2016 09:02:49 -0600
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 23 Dec 2016 20:32:30 +0100

Revert "x86/unwind: Detect bad stack return address"

Revert the following commit:

  b6959a362177 ("x86/unwind: Detect bad stack return address")

... because Andrey Konovalov reported an unwinder warning:

  WARNING: unrecognized kernel stack return address ffffffffa0000001 at ffff88006377fa18 in a.out:4467

The unwind was initiated from an interrupt which occurred while running in the
generated code for a kprobe.  The unwinder printed the warning because it
expected regs->ip to point to a valid text address, but instead it pointed to
the generated code.

Eventually we may want come up with a way to identify generated kprobe
code so the unwinder can know that it's a valid return address.  Until
then, just remove the warning.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/02f296848fbf49fb72dfeea706413ecbd9d4caf6.1482418739.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/unwind_frame.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/x86/kernel/unwind_frame.c b/arch/x86/kernel/unwind_frame.c
index 20d4b4e..4443e49 100644
--- a/arch/x86/kernel/unwind_frame.c
+++ b/arch/x86/kernel/unwind_frame.c
@@ -51,16 +51,7 @@ unsigned long unwind_get_return_address(struct unwind_state *state)
 	addr = ftrace_graph_ret_addr(state->task, &state->graph_idx, *addr_p,
 				     addr_p);
 
-	if (!__kernel_text_address(addr)) {
-		printk_deferred_once(KERN_WARNING
-			"WARNING: unrecognized kernel stack return address %p at %p in %s:%d\n",
-			(void *)addr, addr_p, state->task->comm,
-			state->task->pid);
-		unwind_dump(state, addr_p);
-		return 0;
-	}
-
-	return addr;
+	return __kernel_text_address(addr) ? addr : 0;
 }
 EXPORT_SYMBOL_GPL(unwind_get_return_address);
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web