lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-1e9de1d2207d67b97bb0b62e38454b663d6542fa@git.kernel.org>
Date:   Wed, 3 Jan 2018 08:19:32 -0800
From:   tip-bot for Ard Biesheuvel <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     matt@...eblueprint.co.uk, torvalds@...ux-foundation.org,
        linux-kernel@...r.kernel.org, arvind.yadav.cs@...il.com,
        hpa@...or.com, tbaicar@...eaurora.org, ard.biesheuvel@...aro.org,
        tglx@...utronix.de, gomonovych@...il.com, sboyd@...eaurora.org,
        mingo@...nel.org, peterz@...radead.org
Subject: [tip:efi/core] arm64/efi: Ignore EFI_MEMORY_XP attribute if RP
 and/or WP are set

Commit-ID:  1e9de1d2207d67b97bb0b62e38454b663d6542fa
Gitweb:     https://git.kernel.org/tip/1e9de1d2207d67b97bb0b62e38454b663d6542fa
Author:     Ard Biesheuvel <ard.biesheuvel@...aro.org>
AuthorDate: Tue, 2 Jan 2018 18:10:39 +0000
Committer:  Ingo Molnar <mingo@...nel.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@...eaurora.org>
Tested-by: Stephen Boyd <sboyd@...eaurora.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: Arvind Yadav <arvind.yadav.cs@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tyler Baicar <tbaicar@...eaurora.org>
Cc: Vasyl Gomonovych <gomonovych@...il.com>
Cc: linux-efi@...r.kernel.org
Link: http://lkml.kernel.org/r/20180102181042.19074-3-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@...nel.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 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ