Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2018-11-01 16:18:27 +0100
committerBorislav Petkov <bp@suse.de>2018-11-01 16:18:36 +0100
commitd0cb1417228282b0e99e138347e5cef4eb637aa1 (patch)
tree21161679b2536b45b4280f055d07c3ede7739051
parentad55b3696a576584e3b87e5a22c8f5678d0617ec (diff)
x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error
(bsc#1114279).
-rw-r--r--patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch b/patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch
new file mode 100644
index 0000000000..52d767bdff
--- /dev/null
+++ b/patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch
@@ -0,0 +1,62 @@
+From: Bjorn Helgaas <bhelgaas@google.com>
+Date: Thu, 27 Sep 2018 09:21:55 -0500
+Subject: x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error
+Git-commit: 51fbf14f2528a8c6401290e37f1c893a2412f1d3
+Patch-mainline: v4.20-rc1
+References: bsc#1114279
+
+The only use of KEXEC_BACKUP_SRC_END is as an argument to
+walk_system_ram_res():
+
+ int crash_load_segments(struct kimage *image)
+ {
+ ...
+ walk_system_ram_res(KEXEC_BACKUP_SRC_START, KEXEC_BACKUP_SRC_END,
+ image, determine_backup_region);
+
+walk_system_ram_res() expects "start, end" arguments that are inclusive,
+i.e., the range to be walked includes both the start and end addresses.
+
+KEXEC_BACKUP_SRC_END was previously defined as (640 * 1024UL), which is the
+first address *past* the desired 0-640KB range.
+
+Define KEXEC_BACKUP_SRC_END as (640 * 1024UL - 1) so the KEXEC_BACKUP_SRC
+region is [0-0x9ffff], not [0-0xa0000].
+
+Fixes: dd5f726076cc ("kexec: support for kexec on panic using new system call")
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+CC: "H. Peter Anvin" <hpa@zytor.com>
+CC: Andrew Morton <akpm@linux-foundation.org>
+CC: Brijesh Singh <brijesh.singh@amd.com>
+CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+CC: Ingo Molnar <mingo@redhat.com>
+CC: Lianbo Jiang <lijiang@redhat.com>
+CC: Takashi Iwai <tiwai@suse.de>
+CC: Thomas Gleixner <tglx@linutronix.de>
+CC: Tom Lendacky <thomas.lendacky@amd.com>
+CC: Vivek Goyal <vgoyal@redhat.com>
+CC: baiyaowei@cmss.chinamobile.com
+CC: bhe@redhat.com
+CC: dan.j.williams@intel.com
+CC: dyoung@redhat.com
+CC: kexec@lists.infradead.org
+Link: http://lkml.kernel.org/r/153805811578.1157.6948388946904655969.stgit@bhelgaas-glaptop.roam.corp.google.com
+---
+ arch/x86/include/asm/kexec.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h
+index f327236f0fa7..5125fca472bb 100644
+--- a/arch/x86/include/asm/kexec.h
++++ b/arch/x86/include/asm/kexec.h
+@@ -67,7 +67,7 @@ struct kimage;
+
+ /* Memory to backup during crash kdump */
+ #define KEXEC_BACKUP_SRC_START (0UL)
+-#define KEXEC_BACKUP_SRC_END (640 * 1024UL) /* 640K */
++#define KEXEC_BACKUP_SRC_END (640 * 1024UL - 1) /* 640K */
+
+ /*
+ * CPU does not save ss and sp on stack if execution is already
+
diff --git a/series.conf b/series.conf
index 57375b760a..d6cc23de5a 100644
--- a/series.conf
+++ b/series.conf
@@ -18210,6 +18210,7 @@
patches.drivers/spi-sh-msiof-fix-deferred-probing.patch
patches.drivers/spi-bcm63xx-hsspi-keep-pll-clk-enabled.patch
patches.drivers/ACPI-processor-Fix-the-return-value-of-acpi_processo.patch
+ patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch
patches.drivers/iwlwifi-mvm-send-BCAST-management-frames-to-the-righ.patch
patches.drivers/iwlwifi-dbg-don-t-crash-if-the-firmware-crashes-in-t.patch
patches.drivers/iwlwifi-pcie-gen2-build-A-MSDU-only-for-GSO.patch