Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5018098imm; Tue, 9 Oct 2018 08:32:04 -0700 (PDT) X-Google-Smtp-Source: ACcGV63kGZ/AH8q17YEj+NJkQsNaDxgplEhXHMK3ysuzi3p/0iGbbyEXrJzYxBKkOiMfFfOfUcgj X-Received: by 2002:a62:1b45:: with SMTP id b66-v6mr30575529pfb.94.1539099124860; Tue, 09 Oct 2018 08:32:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539099124; cv=none; d=google.com; s=arc-20160816; b=p94Zie0pTTgc40CTunmIt1JPKyC6qKejNQyhS6C+L/PoOQzpPDLSEGHZM7dm8ByVdX iqtNdZnSLydRBvgl9Ovx/qNmlzA2Nv83O8OaG2g43y14W3e258g0CUh2Gf5dKYEgY1S6 /SdIKuDDPuxiVogL7EUpHhGbNGcaMlz1BrM/fd/5NheFQdC7m6VOPyx/FdIIOHATHVoQ LsxNYAosnbbabsxtOmM/y4LORBJTTdXKfEYPKI2rFRD8jtchOhsV69W/Mtn8c/FFdZ8a tvKPK3HzR//75Nk1ejcfRqfmwudbjfR9bJUTiKRluFMkHOLKUhi8h1Ksj2V2rmT/ZaC2 8OyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=FXXkOzatbBfyH7E2muUNj0BLf75iT7h7377DEBtq9FE=; b=t1ZLnrfVe1//UHJonlqeHjQhgpwBBtfmAURrzNXTfts/XGmbd3yZJaphY+KVEp1Ou3 gcy5RR7VLtnH8nQsC2vONiRGY1t3CukVQ6DUmGxx2vnxC3Ka+eq+mi5n8ZV4Asgslb44 WiRE+rHs6uLuqyeFWHW82F/tqHW7aH51p2chvkrjJyJNDND4lfVl8NNoMjDMVMWQmBDD W14nozeRoTSA1lgvjG7RbPlY39C8AUQGLC8wqID01SLPL0LW4lwcoY8cPDyilSTTkDIA vT9u9Y+d/lxrO74Yc5mYIzXumjtVLJvjIu5q9ppfCWr3Ib3uNtqhvNaQ2acD/1rylUQx OodA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d40-v6si22474057pla.217.2018.10.09.08.31.49; Tue, 09 Oct 2018 08:32:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726600AbeJIWsu (ORCPT + 99 others); Tue, 9 Oct 2018 18:48:50 -0400 Received: from terminus.zytor.com ([198.137.202.136]:56119 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeJIWsu (ORCPT ); Tue, 9 Oct 2018 18:48:50 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w99FUov01091779 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Oct 2018 08:30:50 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w99FUouf1091776; Tue, 9 Oct 2018 08:30:50 -0700 Date: Tue, 9 Oct 2018 08:30:50 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Bjorn Helgaas Message-ID: Cc: lijiang@redhat.com, brijesh.singh@amd.com, tglx@linutronix.de, gregkh@linuxfoundation.org, thomas.lendacky@amd.com, mingo@kernel.org, akpm@linux-foundation.org, hpa@zytor.com, mingo@redhat.com, bp@suse.de, vgoyal@redhat.com, tiwai@suse.de, bhelgaas@google.com, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, akpm@linux-foundation.org, gregkh@linuxfoundation.org, thomas.lendacky@amd.com, mingo@kernel.org, lijiang@redhat.com, brijesh.singh@amd.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, bhelgaas@google.com, tiwai@suse.de, bp@suse.de, vgoyal@redhat.com, mingo@redhat.com In-Reply-To: <153805811578.1157.6948388946904655969.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <153805811578.1157.6948388946904655969.stgit@bhelgaas-glaptop.roam.corp.google.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/mm] x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error Git-Commit-ID: 51fbf14f2528a8c6401290e37f1c893a2412f1d3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_48_96 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 51fbf14f2528a8c6401290e37f1c893a2412f1d3 Gitweb: https://git.kernel.org/tip/51fbf14f2528a8c6401290e37f1c893a2412f1d3 Author: Bjorn Helgaas AuthorDate: Thu, 27 Sep 2018 09:21:55 -0500 Committer: Borislav Petkov CommitDate: Tue, 9 Oct 2018 17:18:31 +0200 x86/kexec: Correct KEXEC_BACKUP_SRC_END off-by-one error 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 Signed-off-by: Borislav Petkov CC: "H. Peter Anvin" CC: Andrew Morton CC: Brijesh Singh CC: Greg Kroah-Hartman CC: Ingo Molnar CC: Lianbo Jiang CC: Takashi Iwai CC: Thomas Gleixner CC: Tom Lendacky CC: Vivek Goyal 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