Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3071843pxm; Mon, 28 Feb 2022 11:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxieZAkjRclSgHMYLBYssnW6frou1y9nBSdRxFi0UFlH6QFSj83FoZrKz2ZMVOuUi/NxZjq X-Received: by 2002:a17:90a:480e:b0:1bc:1d88:8d4e with SMTP id a14-20020a17090a480e00b001bc1d888d4emr17875471pjh.157.1646076346489; Mon, 28 Feb 2022 11:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646076346; cv=none; d=google.com; s=arc-20160816; b=FdCfa+o6pHHWULVwuTrzdkuB8ks0LbGrbCuLAUp639IExn49q5cIuOuctIrp7BJMld 2+ZP7mFFiR3ynh0mbwH/FtfXnHEGCWCeY4X6oaHuSJxjz0BZfHLiLdNx01zMnfvuiqAg ZOafrAiaXUJLMeDcu3fY+s5+3AMczoS2H6Kn6qQtm2Mz9m1qcc/eKjbliOaVPFqwzgV2 sZBPObIrrIcjqFmCLMNvl2+p44XxhHJ1ZPVCPLNlf8O9v3Q4KS9S4Y1ojcGiAP9X5foa vrERG43Y1h/jAvG4W8C+vSUXjVqPbu/q0Y0bYx13mArkbY39YTnL2e1y7rAGMEYX2dx+ CslQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=op4KpLDhHDE9fJFJghNS8lSBElIY/1JnsKoa/el5rTk=; b=NrkYYQgzGcDIP79T5tYd+Jc6QvgE/XvtR4RDFwoU82yZJdXwUsjV8KEX3fzoQJnKGX RlmRK+Ivg7Sk32uAAw80VkGljZxn5aaV16RGoVGD0hWoZNPjCP3BcyGVc97A7T4bwg/R dCR0x23sp1AGpG9vm1Yv4DB7AkF4rh7ML3UoVE23G06IsIaDxgQ4Uc1C0JTWM+ZXqh+y 4ruEVzxeIs5QJJnmEhBbke8ypc0nfMwpsWGnIa9XNPk/Uw4+b4ZudfqBi4viwZR8Jxfd S0UUgTQde/REfMKXMbBF7B+2KBy/m9BWN8CWAItSXnopXiTd6Mg3vKTkLEAlzW1B24AE WH9w== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s10-20020a17090a5d0a00b001bc98ce1e8csi246608pji.129.2022.02.28.11.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 11:25:46 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A9122C7C23; Mon, 28 Feb 2022 11:12:45 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240661AbiB1SkZ (ORCPT + 99 others); Mon, 28 Feb 2022 13:40:25 -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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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?