Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2018-01-12 21:55:29 +0100
committerBorislav Petkov <bp@suse.de>2018-01-12 21:55:33 +0100
commite6b1ca57c8fdbc9f973fb053ff1e734c90e78e98 (patch)
treeb15aaaf275f36cd75f59584b6030d238fd7b1a74
parent3fe48f5814ca83bc3162c9926236edff3f33e2ed (diff)
x86/irq/64: Print the offending IP in the stack overflow warning
(bsc#1068032 CVE-2017-5754).
-rw-r--r--patches.arch/04-x86-irq-64-print-the-offending-ip-in-the-stack-overflow-warning.patch57
-rw-r--r--series.conf1
2 files changed, 58 insertions, 0 deletions
diff --git a/patches.arch/04-x86-irq-64-print-the-offending-ip-in-the-stack-overflow-warning.patch b/patches.arch/04-x86-irq-64-print-the-offending-ip-in-the-stack-overflow-warning.patch
new file mode 100644
index 0000000000..826c1f5c1c
--- /dev/null
+++ b/patches.arch/04-x86-irq-64-print-the-offending-ip-in-the-stack-overflow-warning.patch
@@ -0,0 +1,57 @@
+From: Andy Lutomirski <luto@kernel.org>
+Date: Mon, 4 Dec 2017 15:07:11 +0100
+Subject: x86/irq/64: Print the offending IP in the stack overflow warning
+Git-commit: 4f3789e792296e21405f708cf3cb409d7c7d5683
+Patch-mainline: v4.15-rc5
+References: bsc#1068032 CVE-2017-5754
+
+In case something goes wrong with unwind (not unlikely in case of
+overflow), print the offending IP where we detected the overflow.
+
+Signed-off-by: Andy Lutomirski <luto@kernel.org>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Reviewed-by: Borislav Petkov <bp@suse.de>
+Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Cc: Borislav Petkov <bp@alien8.de>
+Cc: Borislav Petkov <bpetkov@suse.de>
+Cc: Brian Gerst <brgerst@gmail.com>
+Cc: Dave Hansen <dave.hansen@intel.com>
+Cc: Dave Hansen <dave.hansen@linux.intel.com>
+Cc: David Laight <David.Laight@aculab.com>
+Cc: Denys Vlasenko <dvlasenk@redhat.com>
+Cc: Eduardo Valentin <eduval@amazon.com>
+Cc: Greg KH <gregkh@linuxfoundation.org>
+Cc: H. Peter Anvin <hpa@zytor.com>
+Cc: Josh Poimboeuf <jpoimboe@redhat.com>
+Cc: Juergen Gross <jgross@suse.com>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Rik van Riel <riel@redhat.com>
+Cc: Will Deacon <will.deacon@arm.com>
+Cc: aliguori@amazon.com
+Cc: daniel.gruss@iaik.tugraz.at
+Cc: hughd@google.com
+Cc: keescook@google.com
+Link: https://lkml.kernel.org/r/20171204150605.231677119@linutronix.de
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Acked-by: Borislav Petkov <bp@suse.de>
+---
+ arch/x86/kernel/irq_64.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/x86/kernel/irq_64.c
++++ b/arch/x86/kernel/irq_64.c
+@@ -56,10 +56,10 @@ static inline void stack_overflow_check(
+ if (regs->sp >= estack_top && regs->sp <= estack_bottom)
+ return;
+
+- 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",
++ 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",
+ current->comm, curbase, regs->sp,
+ irq_stack_top, irq_stack_bottom,
+- estack_top, estack_bottom);
++ estack_top, estack_bottom, (void *)regs->ip);
+
+ if (sysctl_panic_on_stackoverflow)
+ panic("low stack detected by irq handler - check messages\n");
diff --git a/series.conf b/series.conf
index 1e01caf990..f2c300d550 100644
--- a/series.conf
+++ b/series.conf
@@ -7375,6 +7375,7 @@
patches.arch/01-x86-entry-64-paravirt-use-paravirt-safe-macro-to-access-eflags.patch
patches.arch/02-x86-unwinder-orc-dont-bail-on-stack-overflow.patch
patches.arch/03-x86-unwinder-handle-stack-overflows-more-gracefully.patch
+ patches.arch/04-x86-irq-64-print-the-offending-ip-in-the-stack-overflow-warning.patch
########################################################
# Staging tree patches