]>
Commit | Line | Data |
---|---|---|
321d628a FG |
1 | From 3c131c80b6a5a95ab9a24e444ef02eba38710840 Mon Sep 17 00:00:00 2001 |
2 | From: Andy Lutomirski <luto@kernel.org> | |
3 | Date: Mon, 4 Dec 2017 15:07:11 +0100 | |
b378f209 | 4 | Subject: [PATCH 141/233] x86/irq/64: Print the offending IP in the stack |
321d628a FG |
5 | overflow warning |
6 | MIME-Version: 1.0 | |
7 | Content-Type: text/plain; charset=UTF-8 | |
8 | Content-Transfer-Encoding: 8bit | |
9 | ||
10 | CVE-2017-5754 | |
11 | ||
12 | In case something goes wrong with unwind (not unlikely in case of | |
13 | overflow), print the offending IP where we detected the overflow. | |
14 | ||
15 | Signed-off-by: Andy Lutomirski <luto@kernel.org> | |
16 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
17 | Reviewed-by: Borislav Petkov <bp@suse.de> | |
18 | Reviewed-by: Thomas Gleixner <tglx@linutronix.de> | |
19 | Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> | |
20 | Cc: Borislav Petkov <bp@alien8.de> | |
21 | Cc: Borislav Petkov <bpetkov@suse.de> | |
22 | Cc: Brian Gerst <brgerst@gmail.com> | |
23 | Cc: Dave Hansen <dave.hansen@intel.com> | |
24 | Cc: Dave Hansen <dave.hansen@linux.intel.com> | |
25 | Cc: David Laight <David.Laight@aculab.com> | |
26 | Cc: Denys Vlasenko <dvlasenk@redhat.com> | |
27 | Cc: Eduardo Valentin <eduval@amazon.com> | |
28 | Cc: Greg KH <gregkh@linuxfoundation.org> | |
29 | Cc: H. Peter Anvin <hpa@zytor.com> | |
30 | Cc: Josh Poimboeuf <jpoimboe@redhat.com> | |
31 | Cc: Juergen Gross <jgross@suse.com> | |
32 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
33 | Cc: Peter Zijlstra <peterz@infradead.org> | |
34 | Cc: Rik van Riel <riel@redhat.com> | |
35 | Cc: Will Deacon <will.deacon@arm.com> | |
36 | Cc: aliguori@amazon.com | |
37 | Cc: daniel.gruss@iaik.tugraz.at | |
38 | Cc: hughd@google.com | |
39 | Cc: keescook@google.com | |
40 | Link: https://lkml.kernel.org/r/20171204150605.231677119@linutronix.de | |
41 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
42 | (cherry picked from commit 4f3789e792296e21405f708cf3cb409d7c7d5683) | |
43 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
44 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
45 | (cherry picked from commit aa820446b0d31df0870b176257b40baadaf4444c) | |
46 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
47 | --- | |
48 | arch/x86/kernel/irq_64.c | 4 ++-- | |
49 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
50 | ||
51 | diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c | |
52 | index 3be74fbdeff2..feca14980e32 100644 | |
53 | --- a/arch/x86/kernel/irq_64.c | |
54 | +++ b/arch/x86/kernel/irq_64.c | |
55 | @@ -56,10 +56,10 @@ static inline void stack_overflow_check(struct pt_regs *regs) | |
56 | if (regs->sp >= estack_top && regs->sp <= estack_bottom) | |
57 | return; | |
58 | ||
59 | - WARN_ONCE(1, "do_IRQ(): %s has overflown the kernel stack (cur:%Lx,sp:%lx,irq stk top-bottom:%Lx-%Lx,exception stk top-bottom:%Lx-%Lx)\n", | |
60 | + WARN_ONCE(1, "do_IRQ(): %s has overflown the kernel stack (cur:%Lx,sp:%lx,irq stk top-bottom:%Lx-%Lx,exception stk top-bottom:%Lx-%Lx,ip:%pF)\n", | |
61 | current->comm, curbase, regs->sp, | |
62 | irq_stack_top, irq_stack_bottom, | |
63 | - estack_top, estack_bottom); | |
64 | + estack_top, estack_bottom, (void *)regs->ip); | |
65 | ||
66 | if (sysctl_panic_on_stackoverflow) | |
67 | panic("low stack detected by irq handler - check messages\n"); | |
68 | -- | |
69 | 2.14.2 | |
70 |