All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Ard Biesheuvel <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: matt@codeblueprint.co.uk, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, arvind.yadav.cs@gmail.com,
	hpa@zytor.com, tbaicar@codeaurora.org, ard.biesheuvel@linaro.org,
	tglx@linutronix.de, gomonovych@gmail.com, sboyd@codeaurora.org,
	mingo@kernel.org, peterz@infradead.org
Subject: [tip:efi/core] arm64/efi: Ignore EFI_MEMORY_XP attribute if RP and/or WP are set
Date: Wed, 3 Jan 2018 08:19:32 -0800	[thread overview]
Message-ID: <tip-1e9de1d2207d67b97bb0b62e38454b663d6542fa@git.kernel.org> (raw)
In-Reply-To: <20180102181042.19074-3-ard.biesheuvel@linaro.org>

Commit-ID:  1e9de1d2207d67b97bb0b62e38454b663d6542fa
Gitweb:     https://git.kernel.org/tip/1e9de1d2207d67b97bb0b62e38454b663d6542fa
Author:     Ard Biesheuvel <ard.biesheuvel@linaro.org>
AuthorDate: Tue, 2 Jan 2018 18:10:39 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 3 Jan 2018 14:03:48 +0100

arm64/efi: Ignore EFI_MEMORY_XP attribute if RP and/or WP are set

The UEFI memory map is a bit vague about how to interpret the
EFI_MEMORY_XP attribute when it is combined with EFI_MEMORY_RP and/or
EFI_MEMORY_WP, which have retroactively been redefined as cacheability
attributes rather than permission attributes.

So let's ignore EFI_MEMORY_XP if _RP and/or _WP are also set. In this
case, it is likely that they are being used to describe the capability
of the region (i.e., whether it has the controls to reconfigure it as
non-executable) rather than the nature of the contents of the region
(i.e., whether it contains data that we will never attempt to execute)

Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tyler Baicar <tbaicar@codeaurora.org>
Cc: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180102181042.19074-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/arm64/kernel/efi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index 82cd075..f85ac58 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -48,7 +48,9 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md)
 		return pgprot_val(PAGE_KERNEL_ROX);
 
 	/* RW- */
-	if (attr & EFI_MEMORY_XP || type != EFI_RUNTIME_SERVICES_CODE)
+	if (((attr & (EFI_MEMORY_RP | EFI_MEMORY_WP | EFI_MEMORY_XP)) ==
+	     EFI_MEMORY_XP) ||
+	    type != EFI_RUNTIME_SERVICES_CODE)
 		return pgprot_val(PAGE_KERNEL);
 
 	/* RWX */

  reply	other threads:[~2018-01-03 16:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 18:10 [GIT PULL 0/5] EFI updates for v4.16 Ard Biesheuvel
2018-01-02 18:10 ` Ard Biesheuvel
2018-01-02 18:10 ` [PATCH 1/5] efi/capsule-loader: pr_err() strings should end with newlines Ard Biesheuvel
2018-01-02 18:10   ` Ard Biesheuvel
2018-01-03 16:19   ` [tip:efi/core] efi/capsule-loader: Fix pr_err() string to end with newline tip-bot for Arvind Yadav
2018-01-02 18:10 ` [PATCH 2/5] arm64: efi: ignore EFI_MEMORY_XP attribute if RP and/or WP are set Ard Biesheuvel
2018-01-02 18:10   ` Ard Biesheuvel
2018-01-03 16:19   ` tip-bot for Ard Biesheuvel [this message]
2018-01-02 18:10 ` [PATCH 3/5] efi: Use PTR_ERR_OR_ZERO() Ard Biesheuvel
2018-01-03 16:19   ` [tip:efi/core] " tip-bot for Vasyl Gomonovych
2018-01-02 18:10 ` [PATCH 4/5] efi: move ARM CPER code to new file Ard Biesheuvel
2018-01-02 18:10   ` Ard Biesheuvel
2018-01-03 16:20   ` [tip:efi/core] efi: Move " tip-bot for Tyler Baicar
2018-01-02 18:10 ` [PATCH 5/5] efi: parse ARM error information value Ard Biesheuvel
2018-01-03 16:21   ` [tip:efi/core] efi: Parse " tip-bot for Tyler Baicar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-1e9de1d2207d67b97bb0b62e38454b663d6542fa@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=gomonovych@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sboyd@codeaurora.org \
    --cc=tbaicar@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.