Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp93051imc; Sat, 9 Mar 2019 22:19:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzc3SoXsRlXHyUy7QHMPxJyw0boP/4SlOO+PthIfGNG4L54wKbixq7frrsfq22K0p8/e6EO X-Received: by 2002:a62:f20d:: with SMTP id m13mr26683608pfh.174.1552198761299; Sat, 09 Mar 2019 22:19:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552198761; cv=none; d=google.com; s=arc-20160816; b=DKsM+YjZAdcKatSe7woVModLUfTZS3o2Py1IBiHsEteOfbCVtIcQiZQQudfKl/stwC qTCt6Gq/1IHaL0F0JFi3xmlKce9eeMRPhthve4lUPfUe6s+GV85Ov3JFpqvTZyuO/oFr FUY1MMw76EeKVgiD13NCbdoPziyAfEwkCHPnXlxqeOySCa6g9+5Sw1V/3fMUNQnKMID0 S7/FxrkM9fGDTquHzgtYMHn083UIqXpMqSzS4AEO7KFm2QWIzaYqD3W1nfhkxNdyZ32T Ox1vMhcM1e5pB02HVH4rN7LHjDXmwptLNv60N13+PfIyLTKw/FSspO9oBmiHe/DPYfXE iGaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VnwMcrzCBwz836bTYljylQXFy87y2yH0OG0qh3ZgJUk=; b=GiFPnNWkadU8k/Q19STqvTI0gjwPYuavx6AIRllcaWdfUr8kdM8YqWWU2OV9TYufL0 dT0S3uHlkscL34gY09HrKA6THk49qXeYtbXmoSGbj6LxblMBEkM3+bSMRhOIez2tKCce tfVFy0ZYzmuIttLwryArEfCHjEPrFE7F+lbiICuqfqrJhFDHnIxPgzLNX9f6ZO7fcNqU OJorVuRVQ5ioM1ryHpJVPWLcQIZA7asFBKX+3xk+t9w/rdJkQtEpgjHl6amXrkMAd7k8 5S2ewAEXw83dTYZvNQutaiF647diz/E3J4508apr/QdGLlB0kbe90n5P9pUPIqmKtDkc sjSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPIHBbse; 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 l16si2218213pgh.509.2019.03.09.22.19.03; Sat, 09 Mar 2019 22:19:21 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=EPIHBbse; 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 S1725816AbfCJGSo (ORCPT + 99 others); Sun, 10 Mar 2019 01:18:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:40890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfCJGSn (ORCPT ); Sun, 10 Mar 2019 01:18:43 -0500 Received: from localhost (unknown [89.248.140.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 555F2207E0; Sun, 10 Mar 2019 06:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552198722; bh=z5QReKz+CxjyUuLwQnpNvSIDkA9ajgLKi1EzjlWsxxg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EPIHBbseocxGIHZNuEzW7+43ssvUK4fOO3qqRn4H2Dqv5f6IiaRBIrzUlEdZ/6c5k uriBlKuUBTDqIle36S5cnwiU6pzSKisFOkeIy470EoUdSn0dyBuhnqXWWTCZl+wta4 bOsqt+YbFdDnemdI/lx2KwZOAzspW1QPqzIblSkk= Date: Sun, 10 Mar 2019 07:18:40 +0100 From: Greg Kroah-Hartman To: hpa@zytor.com Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Pitam Mitra , "Kirill A. Shutemov" , Thomas Gleixner , Bockjoo Kim , bp@alien8.de Subject: Re: [PATCH 5.0 30/46] x86/boot/compressed/64: Do not read legacy ROM on EFI system Message-ID: <20190310061840.GA21641@kroah.com> References: <20190308124902.257040783@linuxfoundation.org> <20190308124904.216497374@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 09, 2019 at 10:10:19PM -0800, hpa@zytor.com wrote: > On March 8, 2019 4:50:03 AM PST, Greg Kroah-Hartman wrote: > >5.0-stable review patch. If anyone has any objections, please let me > >know. > > > >------------------ > > > >From: Kirill A. Shutemov > > > >commit 6f913de3231e1d70a871135b38219da7810df218 upstream. > > > >EFI systems do not necessarily provide a legacy ROM. If the ROM is > >missing > >the memory is not mapped at all. > > > >Trying to dereference values in the legacy ROM area leads to a crash on > >Macbook Pro. > > > >Only look for values in the legacy ROM area for non-EFI system. > > > >Fixes: 3548e131ec6a ("x86/boot/compressed/64: Find a place for 32-bit > >trampoline") > >Reported-by: Pitam Mitra > >Signed-off-by: Kirill A. Shutemov > >Signed-off-by: Thomas Gleixner > >Tested-by: Bockjoo Kim > >Cc: bp@alien8.de > >Cc: hpa@zytor.com > >Cc: stable@vger.kernel.org > >Link: > >https://lkml.kernel.org/r/20190219075224.35058-1-kirill.shutemov@linux.intel.com > >Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202351 > >Signed-off-by: Greg Kroah-Hartman > > > >--- > > arch/x86/boot/compressed/pgtable_64.c | 19 ++++++++++++++++--- > > 1 file changed, 16 insertions(+), 3 deletions(-) > > > >--- a/arch/x86/boot/compressed/pgtable_64.c > >+++ b/arch/x86/boot/compressed/pgtable_64.c > >@@ -1,5 +1,7 @@ > >+#include > > #include > > #include > >+#include > > #include "pgtable.h" > > #include "../string.h" > > > >@@ -37,9 +39,10 @@ int cmdline_find_option_bool(const char > > > > static unsigned long find_trampoline_placement(void) > > { > >- unsigned long bios_start, ebda_start; > >+ unsigned long bios_start = 0, ebda_start = 0; > > unsigned long trampoline_start; > > struct boot_e820_entry *entry; > >+ char *signature; > > int i; > > > > /* > >@@ -47,8 +50,18 @@ static unsigned long find_trampoline_pla > > * This code is based on reserve_bios_regions(). > > */ > > > >- ebda_start = *(unsigned short *)0x40e << 4; > >- bios_start = *(unsigned short *)0x413 << 10; > >+ /* > >+ * EFI systems may not provide legacy ROM. The memory may not be > >mapped > >+ * at all. > >+ * > >+ * Only look for values in the legacy ROM for non-EFI system. > >+ */ > >+ signature = (char *)&boot_params->efi_info.efi_loader_signature; > >+ if (strncmp(signature, EFI32_LOADER_SIGNATURE, 4) && > >+ strncmp(signature, EFI64_LOADER_SIGNATURE, 4)) { > >+ ebda_start = *(unsigned short *)0x40e << 4; > >+ bios_start = *(unsigned short *)0x413 << 10; > >+ } > > > > if (bios_start < BIOS_START_MIN || bios_start > BIOS_START_MAX) > > bios_start = BIOS_START_MAX; > > Only one objection: the explanation is nonsensical. Heh, take it up with the original submitter, I don't change the changelog text after it hits Linus's tree :) greg k-h