Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326AbdCXIfn (ORCPT ); Fri, 24 Mar 2017 04:35:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37154 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638AbdCXIe4 (ORCPT ); Fri, 24 Mar 2017 04:34:56 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 956DC7EBA1 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=bhe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 956DC7EBA1 Date: Fri, 24 Mar 2017 16:34:51 +0800 From: Baoquan He To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-efi@vger.kernel.org, Thomas Garnier , Kees Cook , Borislav Petkov , Andrew Morton , Masahiro Yamada , Dave Young , Bhupesh Sharma Subject: Re: [PATCH v2] x86/mm/KASLR: EFI region is mistakenly included into KASLR VA space for randomization Message-ID: <20170324083451.GC30442@x1> References: <1490331592-31860-1-git-send-email-bhe@redhat.com> <20170324080833.GA15200@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170324080833.GA15200@gmail.com> User-Agent: Mutt/1.7.0 (2016-08-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 24 Mar 2017 08:34:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1851 Lines: 42 On 03/24/17 at 09:08am, Ingo Molnar wrote: > > Cc: #4.8+ > > Signed-off-by: Baoquan He > > Acked-by: Dave Young > > Reviewed-by: Bhupesh Sharma > > Acked-by: Thomas Garnier > > Cc: Thomas Gleixner > > Cc: Ingo Molnar > > Cc: "H. Peter Anvin" > > Cc: x86@kernel.org > > Cc: linux-efi@vger.kernel.org > > Cc: Thomas Garnier > > Cc: Kees Cook > > Cc: Borislav Petkov > > Cc: Andrew Morton > > Cc: Masahiro Yamada > > Cc: Dave Young > > Cc: Bhupesh Sharma > > So I applied this kexec fix and extended the changelog to clearly show why this > fix matters in practice. I thought it only impacts kexec, but Dave thought it will impact 1st kenrel either. > > Also, to make sure I understood it correctly: these addresses are all dynamic on > 64-bit kernels, i.e. we are establishing and then tearing down these page tables > around EFI calls, and they are 'normally' not present at all, right? The EFI region is reserved for EFI runtime services virtual mapping, the original purpose is to preserve this region so that they can be reused by kexec-ed kernel. This was introduced by Boris in commit d2f7cbe7b26a7 ("x86/efi: Runtime services virtual mapping"). So it will be establishing and stay there. According to Dave's telling, efi will still fetch efi variables or time/date by runtime service by switching the efi pgd and entering into efi mode. And then switch back to normal OS. Not sure if I am right for efi part in 1st kernel. For 2nd kernel, if want to reuse the them, the efi region has to be kept. Thanks Baoquan