From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760388AbdAINAo (ORCPT ); Mon, 9 Jan 2017 08:00:44 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37070 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935172AbdAINAg (ORCPT ); Mon, 9 Jan 2017 08:00:36 -0500 Date: Mon, 9 Jan 2017 13:00:33 +0000 From: Matt Fleming To: Ard Biesheuvel Cc: Nicolai Stange , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , "x86@kernel.org" , Mika =?iso-8859-1?Q?Penttil=E4?= , Dan Williams , Dave Young , "linux-efi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 2/2] efi: efi_mem_reserve(): don't reserve through memblock after mm_init() Message-ID: <20170109130033.GH16838@codeblueprint.co.uk> References: <20170105125130.2815-1-nicstange@gmail.com> <20170105125130.2815-2-nicstange@gmail.com> <87wpe8mjdk.fsf@gmail.com> <87showm682.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 06 Jan, at 07:28:40PM, Ard Biesheuvel wrote: > > This is my point exactly. But it appears efi_free_boot_services() > occurs much later than I thought, and so there is a sizabe time window > where SLAB is up but reservations can still be made. But we don't > check whether efi_free_boot_services() has been called. True. This has only been correct thus far because all code has been audited, but adding a check to catch future offenders is a good idea. > Another problem is that we never check that the reservation is > covered by a BootServicesData region, which are the only ones that > are guaranteed to be retained up to this point. The runtime regions are guaranteed to be retained too. Again, this shouldn't actually be a problem today, but the potential for breakage here warrants some kind of check and loud warning.