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 0D744C433F5 for ; Mon, 28 Feb 2022 18:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235863AbiB1Sk2 (ORCPT ); Mon, 28 Feb 2022 13:40:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240893AbiB1SkK (ORCPT ); Mon, 28 Feb 2022 13:40:10 -0500 Received: from cavan.codon.org.uk (cavan.codon.org.uk [176.126.240.207]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC69A9A7E; Mon, 28 Feb 2022 10:30:46 -0800 (PST) Received: by cavan.codon.org.uk (Postfix, from userid 1000) id A0CAC40A62; Mon, 28 Feb 2022 18:30:44 +0000 (GMT) Date: Mon, 28 Feb 2022 18:30:44 +0000 From: Matthew Garrett To: Ard Biesheuvel Cc: Baskov Evgeniy , 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: <20220228183044.GA18400@srcf.ucam.org> References: <20220224154330.26564-1-baskov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?