Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4848308pxj; Wed, 9 Jun 2021 03:27:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynZuoCu2q2tN/n6ATXtW/vml031TM4j+aPEVIKP/JRauY84I9hTvzjaBWid/JMrBOp2EeV X-Received: by 2002:a05:6402:1906:: with SMTP id e6mr20165364edz.14.1623234433852; Wed, 09 Jun 2021 03:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234433; cv=none; d=google.com; s=arc-20160816; b=dIGYqXFVVlzUCUkhaPI+6VlDK9nXwEGpHvTWKX1IU4639GASGc24iBmhtMw17qAT7z R1fUFhUjZgIyPKZMXaqjVXM/tCkQaqCL32YQAeXJjvQEygKpSEsfmQtl8VlAYoCpo1Tl X6oT02Nqs1HyHz4CqF6LbahMU2iOHMlxaou8k8LuR2qEJ1xd+yQXFpZVoqkZ5ObP+YQH MmB7ypvhV1ipCAxesIL3ZdjQG6PWHx8PL09lQomGoLdDn/6gLw5WmbpPcbzX4lowL822 dvkuUDv7aXhkdiuhQ1Ccdw4cow3RPVgPvLp4uVMaNAJramg62VBXjsCiu+bd/Pw3dGtJ sRrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=udpFMYhM19gR/JO6jxROXeUypyj4TkaQ/RF2wt6myIY=; b=AxJDjowkzIAUb2qHFu7M7d+LqSUepvhlFJUnLPs0DRx+IMM8+yEuUg9QhFyxCIfWZk TiCj7MQhkQ9ig1Bw5M6Trlk54d3glQW9kSF7HUA2DB/kpJpmt0NN1eFilJvWBxNFsir+ 6SuyggWOkkTi5dU63wOFc4wfWNZADXYGlvIksGFCkOAT6/CTWui90RStj31/biFP4uJC 0ZMbXAUuk5deQylo6AwM0B6Mb7KzXfsNeCYojf67wspPwofQm6Q1fNRJQ3DI41fmDsXg GeUx1TY/9haXI33WMtjeWDWjN2nbyk/ZjxGHIYu6LClUFOWdcdqShzN9UuAC2LGhWQqJ 4jXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lzo2Vatr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yc22si1076313ejb.277.2021.06.09.03.26.50; Wed, 09 Jun 2021 03:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lzo2Vatr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236738AbhFHS7a (ORCPT + 99 others); Tue, 8 Jun 2021 14:59:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:48486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbhFHSwY (ORCPT ); Tue, 8 Jun 2021 14:52:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 844EB61351; Tue, 8 Jun 2021 18:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177625; bh=FxkRkH0E9G2XWpm2+AFFrGDy/r8ng+80Ved7jl4n/NY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lzo2VatruiG3nG17JDIbXv6CrEvOifUcaanuy9l8JzCHFCXekvx1UVnb9QjiFt3Hs lcz1uk8NwJMFgCCF/aJFu4bVkVyJiwJx9mqNeg/WFoPa5gFwzK3p9TJ5o63hoTTKiB 5laOjJEILS6Q8Xn7FhgM69FTHGKqoKqpTHd6cxqw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , Ard Biesheuvel , Sasha Levin Subject: [PATCH 5.10 007/137] efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared Date: Tue, 8 Jun 2021 20:25:47 +0200 Message-Id: <20210608175942.635782102@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiner Kallweit [ Upstream commit 45add3cc99feaaf57d4b6f01d52d532c16a1caee ] UEFI spec 2.9, p.108, table 4-1 lists the scenario that both attributes are cleared with the description "No memory access protection is possible for Entry". So we can have valid entries where both attributes are cleared, so remove the check. Signed-off-by: Heiner Kallweit Fixes: 10f0d2f577053 ("efi: Implement generic support for the Memory Attributes table") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin --- drivers/firmware/efi/memattr.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c index 5737cb0fcd44..0a9aba5f9cef 100644 --- a/drivers/firmware/efi/memattr.c +++ b/drivers/firmware/efi/memattr.c @@ -67,11 +67,6 @@ static bool entry_is_valid(const efi_memory_desc_t *in, efi_memory_desc_t *out) return false; } - if (!(in->attribute & (EFI_MEMORY_RO | EFI_MEMORY_XP))) { - pr_warn("Entry attributes invalid: RO and XP bits both cleared\n"); - return false; - } - if (PAGE_SIZE > EFI_PAGE_SIZE && (!PAGE_ALIGNED(in->phys_addr) || !PAGE_ALIGNED(in->num_pages << EFI_PAGE_SHIFT))) { -- 2.30.2