x86/stacktrace: Do not unwind after user regs
authorJiri Slaby <jslaby@suse.cz>
Fri, 18 May 2018 06:47:08 +0000 (08:47 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 21 Jun 2018 14:34:55 +0000 (16:34 +0200)
Josh pointed out, that there is no way a frame can be after user regs.
So remove the last unwind and the check.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-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: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/lkml/20180518064713.26440-1-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/stacktrace.c

index 093f2ea..8948b7d 100644 (file)
@@ -113,15 +113,6 @@ __save_stack_trace_reliable(struct stack_trace *trace,
                        if (!user_mode(regs))
                                return -EINVAL;
 
-                       /*
-                        * The last frame contains the user mode syscall
-                        * pt_regs.  Skip it and finish the unwind.
-                        */
-                       unwind_next_frame(&state);
-                       if (!unwind_done(&state)) {
-                               STACKTRACE_DUMP_ONCE(task);
-                               return -EINVAL;
-                       }
                        break;
                }