Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4337182pxj; Tue, 8 Jun 2021 11:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqG31ETv6+B39TR0z0FBchzUBLabvdn+7Qgy0FbGQqkU9jm9ghZrLAR396ObokKVwaaP+y X-Received: by 2002:a17:906:b317:: with SMTP id n23mr25375633ejz.324.1623178273195; Tue, 08 Jun 2021 11:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623178273; cv=none; d=google.com; s=arc-20160816; b=sOE06N0nd9E4/g+OPQmJMVMrwy1vduEhLcWdZZmPtWZ2IZNJTuaTFU450KskAck+Lc VxtAqSOUZ/Mn3w3NrbAUEEcV1ISNQAXgX34SVg2uaTe4mXk/7+yrjQEodYKr+oCpa2s5 Bq0ESKYdFPDxUfF2L9ud2lAeLYwuTbPFJfe6h3eiiT36x/2AVwmCtNWNxjXF35uh0UuQ swlWw8FQSrz7akLa7tycOTRYGNlinas7CaSQ/txL3c7DrvDPoEduGH2aiQ+D4dSLYDBp EX1au3hRvkji4PAs148031/OF0Arji2qcz6Fj72Xc3b+KVN1/CDaRVpRcyKnH6FKDQPN t5RA== 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=afa4+X0CoMtzigFPXKVcUxV4uSWTaP2m9hgqpACyFUw=; b=dpKLznYpu8Y1UKDCst2EPuxCxrXXkIHiegSzjHxDX97LASL3eByqiu214AyUCpgih8 9ehmNtleF3Pr1bewqVEDGDYzBYnTowF0oHbGcxdftKvf8H7Fy2R8dX6bdhLamEQlE9HF 9MT+/ksUIvtTlHfCLBeGq5uK1eOnv9gIhxJuMcFnc3DhZLaEtCLLa97ZfOWo5Gtdc0ry BsNZplVSytYUzCllUAyyJvKYibs4mNu7iPcztDNFvWhFWJsq00ckTuwYN5lj+8K4Tu7Z HW1F1Z4uQY7GJQmfW0yrk/5MK9rJZ6eH3Ftga9ZQpDHsWLbzy9nF/bfMBBvtFSgWencw rZew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RCoPwJyv; 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 oy3si378551ejb.550.2021.06.08.11.50.49; Tue, 08 Jun 2021 11:51: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=RCoPwJyv; 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 S235943AbhFHSte (ORCPT + 99 others); Tue, 8 Jun 2021 14:49:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235536AbhFHSoU (ORCPT ); Tue, 8 Jun 2021 14:44:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2D56160FEA; Tue, 8 Jun 2021 18:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177396; bh=tWjMsLeOtb/NYgMrbgElfA9i5rrsbAZrDJrx7GY7N70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RCoPwJyvYbo7b9ce3U8VW6O30gxYwCAVYPynlLev7l3UHTW4DgU2VhIQw+IHfFCPO 09CSuNEW521FGIT56ulV0w0/+o0S87Iu08kJWxs3qDOqDeVwNvCshFdKBjfQZy7gOa RWf8i5mr7tVfjuO38IUSinfeIP5qofFe6A12SaWY= 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.4 07/78] efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared Date: Tue, 8 Jun 2021 20:26:36 +0200 Message-Id: <20210608175935.513740979@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@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 58452fde92cc..5d343dc8e535 100644 --- a/drivers/firmware/efi/memattr.c +++ b/drivers/firmware/efi/memattr.c @@ -66,11 +66,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