| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Josh Poimboeuf <[email protected]>
- Date: Sun, 31 Dec 2017 10:18:07 -0600
- Subject: [PATCH] x86/dumpstack: Print registers for first stack frame
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- In the stack dump code, if the frame after the starting pt_regs is also
- a regs frame, the registers don't get printed. Fix that.
- Reported-by: Andy Lutomirski <[email protected]>
- Tested-by: Alexander Tsoy <[email protected]>
- Signed-off-by: Josh Poimboeuf <[email protected]>
- Cc: Andy Lutomirski <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Cc: Thomas Gleixner <[email protected]>
- Cc: Toralf Förster <[email protected]>
- Cc: [email protected]
- Fixes: 3b3fa11bc700 ("x86/dumpstack: Print any pt_regs found on the stack")
- Link: http://lkml.kernel.org/r/396f84491d2f0ef64eda4217a2165f5712f6a115.1514736742.git.jpoimboe@redhat.com
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit 3ffdeb1a02be3086f1411a15c5b9c481fa28e21f)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit 3aef1ce621ae2eb0bd58e07cf9e66a859faa17cd)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- 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 8da5b487919f..042f80c50e3b 100644
- --- a/arch/x86/kernel/dumpstack.c
- +++ b/arch/x86/kernel/dumpstack.c
- @@ -115,6 +115,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
-
- unwind_start(&state, task, regs, stack);
- stack = stack ? : get_stack_pointer(task, regs);
- + regs = unwind_get_entry_regs(&state, &partial);
-
- /*
- * Iterate through the stacks, starting with the current stack pointer.
- @@ -132,7 +133,7 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
- * - hardirq stack
- * - entry stack
- */
- - for (regs = NULL; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
- + for ( ; stack; stack = PTR_ALIGN(stack_info.next_sp, sizeof(long))) {
- const char *stack_name;
-
- if (get_stack_info(stack, task, &stack_info, &visit_mask)) {
- --
- 2.14.2
|