lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191113015622.11592-95-sashal@kernel.org>
Date:   Tue, 12 Nov 2019 20:56:02 -0500
From:   Sasha Levin <sashal@...nel.org>
To:     linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc:     Bjorn Helgaas <bhelgaas@...gle.com>, Borislav Petkov <bp@...e.de>,
        "H. Peter Anvin" <hpa@...or.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Brijesh Singh <brijesh.singh@....com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ingo Molnar <mingo@...hat.com>,
        Lianbo Jiang <lijiang@...hat.com>,
        Takashi Iwai <tiwai@...e.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Tom Lendacky <thomas.lendacky@....com>,
        Vivek Goyal <vgoyal@...hat.com>,
        baiyaowei@...s.chinamobile.com, bhe@...hat.com,
        dan.j.williams@...el.com, dyoung@...hat.com,
        kexec@...ts.infradead.org, Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 4.14 095/115] x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error

From: Bjorn Helgaas <bhelgaas@...gle.com>

[ Upstream commit 51fbf14f2528a8c6401290e37f1c893a2412f1d3 ]

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@...gle.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
CC: "H. Peter Anvin" <hpa@...or.com>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: Brijesh Singh <brijesh.singh@....com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Ingo Molnar <mingo@...hat.com>
CC: Lianbo Jiang <lijiang@...hat.com>
CC: Takashi Iwai <tiwai@...e.de>
CC: Thomas Gleixner <tglx@...utronix.de>
CC: Tom Lendacky <thomas.lendacky@....com>
CC: Vivek Goyal <vgoyal@...hat.com>
CC: baiyaowei@...s.chinamobile.com
CC: bhe@...hat.com
CC: dan.j.williams@...el.com
CC: dyoung@...hat.com
CC: kexec@...ts.infradead.org
Link: http://lkml.kernel.org/r/153805811578.1157.6948388946904655969.stgit@bhelgaas-glaptop.roam.corp.google.com
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
 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 f327236f0fa71..5125fca472bb0 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
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ