Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp719284imc; Sun, 10 Mar 2019 19:45:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDRabbHOEdjbkbAn4B9xI7JRzJrcj+PoHWgU8MBXG6RvV5smGn2V+eCt5oMRkmyvLoV0kS X-Received: by 2002:a63:e506:: with SMTP id r6mr3408991pgh.251.1552272334705; Sun, 10 Mar 2019 19:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552272334; cv=none; d=google.com; s=arc-20160816; b=xoWy/yFwbmO58ppEbkb8JdSZEYiYhBhsGqQ7p2w9rWii1zaYQqdCgscHpKl35/MjSe KszJVHDP6nhb0k9D3K5RJntCs600TxFcd/L71pohNSd75cSayeAenCoi2Ch0Vuq6u8cN efXq0AtqlFVDyPqy/lNYsLsfPDe77HdWAiNXE+X94E0xVTVpCdwA5FUSU88h2IuzpyoO wi5Og5z5h+AopkWxwr85P3wokXEZNJUcHMPUDh2Zy+xtRcgAvdbZLFcBQfcyyDQ90dZw CuTPW6Ag9oba3M8/Ga2R6l798MfUiOu7pFNH7YKJvvvPh3W6UgS3dj+nzk8hKyu1myjD Pzgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date; bh=dDXj45qru0r1xkFo0rYG278E5rBOOnWmY4Vm/+XU5XA=; b=JQM+WNHm36eryKSayRkAagydXehLAMgZmFqb1FHcaZczl4Yed+KUPf5QxgQZR5v5oW 8f7DUJup6eoyxEbngTC2qRbDIy2Fz5Ju6LmiT/W2FXZLXk2D/V+PswnW/mB0L+B1fn4I JyErV4eOk8QnKyRvl1Vr9EZ5PKrSuxR3teN9iopW3Dg4MhBxnLYSUX6sxb6lHD0LFiYP v3TIeH5NLrievYAl6nRc5ePnbE8iYoV0QWLZXs2EL3H+LYmKCsc62i/U6N7p9kw6MXnT MKGpFJBgoPWP1XmfvIQncem+ehSK5TW+/hTn2a0sEX/gAXxd8lilQaJOAtrVwkZwPTZe 2yyg== 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 z62si4231506pfz.244.2019.03.10.19.45.02; Sun, 10 Mar 2019 19:45:34 -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 S1727050AbfCKBpN convert rfc822-to-8bit (ORCPT + 99 others); Sun, 10 Mar 2019 21:45:13 -0400 Received: from terminus.zytor.com ([198.137.202.136]:54145 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbfCKBpN (ORCPT ); Sun, 10 Mar 2019 21:45:13 -0400 Received: from [IPv6:2601:646:8680:2bb1:b911:67c8:ac46:1844] ([IPv6:2601:646:8680:2bb1:b911:67c8:ac46:1844]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id x2B1ilYF3742446 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 10 Mar 2019 18:44:49 -0700 Date: Sun, 10 Mar 2019 18:44:39 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <20190310061840.GA21641@kroah.com> References: <20190308124902.257040783@linuxfoundation.org> <20190308124904.216497374@linuxfoundation.org> <20190310061840.GA21641@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH 5.0 30/46] x86/boot/compressed/64: Do not read legacy ROM on EFI system To: Greg Kroah-Hartman CC: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Pitam Mitra , "Kirill A. Shutemov" , Thomas Gleixner , Bockjoo Kim , bp@alien8.de From: hpa@zytor.com Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On March 9, 2019 10:18:40 PM PST, Greg Kroah-Hartman wrote: >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 :) -- Sent from my Android device with K-9 Mail. Please excuse my brevity.