From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0C8BC4332F for ; Thu, 3 Mar 2022 20:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236374AbiCCUsz (ORCPT ); Thu, 3 Mar 2022 15:48:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235403AbiCCUsv (ORCPT ); Thu, 3 Mar 2022 15:48:51 -0500 Received: from cavan.codon.org.uk (irc.codon.org.uk [IPv6:2a00:1098:84:22e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB6562E0B2; Thu, 3 Mar 2022 12:48:00 -0800 (PST) Received: by cavan.codon.org.uk (Postfix, from userid 1000) id 7700040A44; Thu, 3 Mar 2022 20:47:59 +0000 (GMT) Date: Thu, 3 Mar 2022 20:47:59 +0000 From: Matthew Garrett To: baskov@ispras.ru Cc: Ard Biesheuvel , Peter Jones , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , X86 ML , linux-efi , Linux Kernel Mailing List Subject: Re: [PATCH RFC v2 0/2] Handle UEFI NX-restricted page tables Message-ID: <20220303204759.GA20294@srcf.ucam.org> References: <20220224154330.26564-1-baskov@ispras.ru> <20220228183044.GA18400@srcf.ucam.org> <9787f1c1948cc640e70a50e4b929f44f@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9787f1c1948cc640e70a50e4b929f44f@ispras.ru> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 03, 2022 at 04:42:07PM +0300, baskov@ispras.ru wrote: > On 2022-02-28 21:30, Matthew Garrett wrote: > > On Mon, Feb 28, 2022 at 05:45:53PM +0100, Ard Biesheuvel wrote: > > > > > Given that this is a workaround for a very specific issue arising on > > > PI based implementations of UEFI, I consider this a quirk, and so I > > > think this approach is reasonable. I'd still like to gate it on some > > > kind of identification, though - perhaps something related to DMI like > > > the x86 core kernel does as well. > > > > When the V1 patches were reviewed, you suggested allocating > > EFI_LOADER_CODE rather than EFI_LOADER_DATA. The example given for a > > failure case is when NxMemoryProtectionPolicy is set to 0x7fd4, in which > > case EFI_LOADER_CODE, EFI_BOOT_SERVICES_CODE and > > EFI_RUNTIEM_SERVICES_CODE should not have the nx policy applied. So it > > seems like your initial suggestion (s/LOADER_DATA/LOADER_CODE/) should > > have worked, even if there was disagreement about whether the spec > > required it to. Is this firmware applying a stricter policy? > > Yes, this firmware is being modified to enforce stricter policy. Ok. I think this should really go through the UEFI spec process - I agree that from a strict interpretation of the spec, what this firmware is doing is legitimate, but I don't like having a situation where we have to depend on the DXE spec. How does Windows handle this? Just update the page tables itself for any regions it needs during boot?