Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbdGZANb convert rfc822-to-8bit (ORCPT ); Tue, 25 Jul 2017 20:13:31 -0400 Received: from tyo161.gate.nec.co.jp ([114.179.232.161]:57855 "EHLO tyo161.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751446AbdGZAN3 (ORCPT ); Tue, 25 Jul 2017 20:13:29 -0400 From: Naoya Horiguchi To: Matt Fleming CC: Baoquan He , Kees Cook , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , "izumi.taku@jp.fujitsu.com" , Thomas Garnier , "fanc.fnst@cn.fujitsu.com" , Junichi Nomura , Ard Biesheuvel Subject: Re: [PATCH v3 2/2] x86/efi: clean up dead code around efi_reserve_boot_services() Thread-Topic: [PATCH v3 2/2] x86/efi: clean up dead code around efi_reserve_boot_services() Thread-Index: AQHTBH+qPAgpRuVhaU+qLX2Dy4L6sqJkp94A Date: Wed, 26 Jul 2017 00:12:31 +0000 Message-ID: <20170726001230.GA32325@hori1.linux.bs1.fc.nec.co.jp> References: <20170710054733.GA22619@hori1.linux.bs1.fc.nec.co.jp> <1499665896-23731-2-git-send-email-n-horiguchi@ah.jp.nec.com> <20170724132044.GB11076@codeblueprint.co.uk> In-Reply-To: <20170724132044.GB11076@codeblueprint.co.uk> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.22] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: <42B908B8A99F524ABE17D399F21E60ED@gisp.nec.co.jp> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 953 Lines: 23 On Mon, Jul 24, 2017 at 02:20:44PM +0100, Matt Fleming wrote: > On Mon, 10 Jul, at 02:51:36PM, Naoya Horiguchi wrote: > > EFI_BOOT_SERVICES_{CODE|DATA} regions never overlap the kernel now, > > so we can clean up the check in efi_reserve_boot_services(). > > > > Signed-off-by: Naoya Horiguchi > > --- > > arch/x86/platform/efi/quirks.c | 23 +---------------------- > > 1 file changed, 1 insertion(+), 22 deletions(-) > > Is this true for kernels not using KASLR? Thank you for pointing out this. It's not true depending on memmap layout. If a firmware does not define the memory around the kernel address (0x1000000 or CONFIG_PHYSICAL_START) as EFI_BOOT_SERVICES_*, no overlap happens. That's true in my testing server, but I don't think that we can expect it generally. So I think of adding some assertion in the patch 1/2 to detect this overlap in extract_kernel() even for no KASLR case. Thanks, Naoya Horiguchi