Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1465301
| From | Josh Poimboeuf <jpoimboe@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v4 52/57] x86/dumpstack: warn on stack recursion |
| Date | 2016-08-18 15:20 +0200 |
| Message-ID | <s7voL-ho-79@gated-at.bofh.it> (permalink) |
| References | <s7vf3-dJ-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Print a warning if stack recursion is detected.
Use printk_deferred_once() because the unwinder can be called with the
console lock by lockdep via save_stack_trace().
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
arch/x86/kernel/dumpstack_32.c | 5 ++++-
arch/x86/kernel/dumpstack_64.c | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index fa7a85c..d78bd4b 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -101,8 +101,11 @@ recursion_check:
* just break out and report an unknown stack type.
*/
if (visit_mask) {
- if (*visit_mask & (1UL << info->type))
+ if (*visit_mask & (1UL << info->type)) {
+ printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n",
+ info->type);
goto unknown;
+ }
*visit_mask |= 1UL << info->type;
}
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 33f3142..fa2ba2f 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -125,8 +125,11 @@ recursion_check:
* just break out and report an unknown stack type.
*/
if (visit_mask) {
- if (*visit_mask & (1UL << info->type))
+ if (*visit_mask & (1UL << info->type)) {
+ printk_deferred_once(KERN_WARNING "WARNING: stack recursion on stack type %d\n",
+ info->type);
goto unknown;
+ }
*visit_mask |= 1UL << info->type;
}
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:20 +0200
[PATCH v4 52/57] x86/dumpstack: warn on stack recursion Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:20 +0200
[PATCH v4 46/57] x86/dumpstack: fix duplicate RIP address display in __show_regs() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:20 +0200
[PATCH v4 28/57] x86/dumpstack/ftrace: convert dump_trace() callbacks to use ftrace_graph_ret_addr() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 29/57] ftrace/x86: implement HAVE_FUNCTION_GRAPH_RET_ADDR_PTR Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 26/57] ftrace: add return address pointer to ftrace_ret_stack Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 34/57] x86/dumpstack: add get_stack_info() interface Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 23/57] proc: fix return address printk conversion specifer in /proc/<pid>/stack Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 36/57] x86/unwind: add new unwind interface and implementations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 21/57] perf/x86: check perf_callchain_store() error Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 33/57] x86/dumpstack: simplify in_exception_stack() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 27/57] ftrace: add ftrace_graph_ret_addr() stack unwinding helpers Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 19/57] x86/entry/head/32: use local labels Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 25/57] ftrace: only allocate the ret_stack 'fp' field when needed Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 16/57] x86/entry/32: fix the end of the stack for newly forked tasks Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 40/57] x86/dumpstack: convert show_trace_log_lvl() to use the new unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 39/57] oprofile/x86: convert x86_backtrace() to use the new unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 35/57] x86/dumpstack: add recursion checking for all stacks Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 22/57] oprofile/x86: add regs->ip to oprofile trace Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 38/57] x86/stacktrace: convert save_stack_trace_*() to use the new unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 24/57] ftrace: remove CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST from config Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 45/57] x86/dumpstack: print any pt_regs found on the stack Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 30/57] x86/dumpstack/ftrace: mark function graph handler function as unreliable Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 47/57] x86/dumpstack: print orig_ax in __show_regs() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 44/57] x86/dumpstack: print stack identifier on its own line Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Frederic Weisbecker <fweisbec@gmail.com> - 2016-08-18 15:30 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Ingo Molnar <mingo@kernel.org> - 2016-08-18 15:40 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Steven Rostedt <rostedt@goodmis.org> - 2016-08-18 16:40 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 16:40 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Steven Rostedt <rostedt@goodmis.org> - 2016-08-18 16:50 +0200
Re: [PATCH v4 00/57] x86/dumpstack: rewrite x86 stack dump code Ingo Molnar <mingo@kernel.org> - 2016-08-19 07:10 +0200
[PATCH v4 41/57] x86/dumpstack: remove dump_trace() and related callbacks Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 31/57] x86/dumpstack/ftrace: don't print unreliable addresses in print_context_stack_bp() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 42/57] x86/entry/unwind: create stack frames for saved interrupt registers Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 20/57] x86/entry/32: rename 'error_code' to 'common_exception' Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 37/57] perf/x86: convert perf_callchain_kernel() to use the new unwinder Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 32/57] x86/dumpstack: allow preemption in show_stack_log_lvl() and dump_trace() Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:30 +0200
[PATCH v4 12/57] x86: move _stext marker to before head code Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:40 +0200
[PATCH v4 09/57] x86/dumpstack: fix x86_32 kernel_stack_pointer() previous stack access Josh Poimboeuf <jpoimboe@redhat.com> - 2016-08-18 15:40 +0200
csiph-web