Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4821579pxj; Wed, 9 Jun 2021 02:41:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsptAchrMzg+fmvLrRTtaMooIwT8h0D4SpoGsCHjf+c5jn3LxOC7Lx0VMm4TgFej+7v3uB X-Received: by 2002:a05:6638:12c1:: with SMTP id v1mr21101080jas.97.1623231711974; Wed, 09 Jun 2021 02:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623231711; cv=none; d=google.com; s=arc-20160816; b=VjcmznUdjNB79UBPwQOpXmsIpN7rn8mr0fs2p02vHMC21XO24BQ70K7TEeOFhgOwzu 66a6Qzxa/9M644ugn9ar6B7VyDPM+ksvsM/H45inRO4jDM0aAHGz4ZOVxZ7mM+yF+QCZ lSAOg7TQ+q9lDvvc2g5jY5Jj9C+/R5YhBfeoJnZdULFiBiO9KUQYMTAYm32nDL9pNmmE BAqzJWXPvBDgo8Sz1s5lraBySJF/N1W247Wta/Tcp+YBc4EU519m2xa5DuUL8zYIG84q WOiai3krTYmQPxGglovTBwDKqFxOnryTq98YexDvzADTLXJOpMiZ+Ow9lCICXGQHhsbw UIJg== 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=HWjZGk+/M5ocwafmTttSFbhYl6iCE6pLW8VR5PoRyaA=; b=Chhc8UNdLzq76tGu/AZFk6NPXDLFB+p1QO6awYvqSG9z9Rhks69s8Bm6KZ4vdPmAE2 INvOID76JS2mnl/wg+x2Cq9eAbNSXT/a4QN8cXaBSyDNflz9rTtGeKSLWckcOFnX0nsA AKb1kxrUbwU77j1bKtFM0/brjIY4cdudPP8ZJLYSv+dG3M6lzu6/A420U+GNBGchofNY EN5x1vQfmNeKS+DGAfeMWZ/S5++q+n5/tsPRLS+HlUK4+tKXvAPs0I+19CWphiAYi74F a07qGqIuTwG5hTjNnRGSHO+qybTC+0caqRVnSztLcYAjUO5ODTxuuEvNjMfLGrQPSBQL 60Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XlROtDOi; 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 d15si2624005iln.114.2021.06.09.02.41.39; Wed, 09 Jun 2021 02:41:51 -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=XlROtDOi; 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 S234690AbhFHSd6 (ORCPT + 99 others); Tue, 8 Jun 2021 14:33:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:57158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234281AbhFHScu (ORCPT ); Tue, 8 Jun 2021 14:32:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 530AA613CE; Tue, 8 Jun 2021 18:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177046; bh=podLt0Q3vRWbWw6k5D1sRvkgt8TqwjcT4GxfTMqQ2H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XlROtDOicaR5NSw8/ThbJRwAMQIZh2SfLEBCwJ6f0z795HqSQ6xEGsLKK97Gqj/mV KbuG+ZrgEybxoK9WQz1ZBtqqpKzGFl37Nicz/dPPrtBJ3i53utGlBaCScBv3sXAw6L vISVqlXlo3l5ka02I2bCM6wZyGHxV5xfGtaKlGGY= 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 4.14 02/47] efi: Allow EFI_MEMORY_XP and EFI_MEMORY_RO both to be cleared Date: Tue, 8 Jun 2021 20:26:45 +0200 Message-Id: <20210608175930.558620338@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175930.477274100@linuxfoundation.org> References: <20210608175930.477274100@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 aac972b056d9..e0889922cc6d 100644 --- a/drivers/firmware/efi/memattr.c +++ b/drivers/firmware/efi/memattr.c @@ -69,11 +69,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