Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756051AbdGXNeV (ORCPT ); Mon, 24 Jul 2017 09:34:21 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38452 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755489AbdGXNeM (ORCPT ); Mon, 24 Jul 2017 09:34:12 -0400 Date: Mon, 24 Jul 2017 14:34:10 +0100 From: Matt Fleming To: Baoquan He Cc: Ingo Molnar , linux-kernel@vger.kernel.org, x86@kernel.org, keescook@chromium.org, tglx@linutronix.de, hpa@zytor.com, izumi.taku@jp.fujitsu.com, fanc.fnst@cn.fujitsu.com, thgarnie@google.com, n-horiguchi@ah.jp.nec.com Subject: Re: [PATCH v6 RESEND] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Message-ID: <20170724133410.GC11076@codeblueprint.co.uk> References: <1500542189-15779-1-git-send-email-bhe@redhat.com> <20170721103757.hc74czr3mfunrv6c@gmail.com> <20170721131956.GK2344@x1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170721131956.GK2344@x1> User-Agent: Mutt/1.5.24+42 (6e565710a064) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 506 Lines: 14 On Fri, 21 Jul, at 09:19:56PM, Baoquan He wrote: > > There are places where the efi map is getting and used like this. E.g > in efi_high_alloc() of drivers/firmware/efi/libstub/efi-stub-helper.c. > EFI developers worry the size of efi_memory_desc_t could not be the same > as e->efi_memdesc_size? > > Hi Matt, > > Could you help have a look at this? You're exactly right. The code guards against the size of the efi_memory_desc_t struct changing. The UEFI spec says to traverse the memory map this way.