Skip to contentSkip to conversation

Patch "x86/tboot: Unbreak tboot with PTI enabled" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Jan 15, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

x86/tboot: Unbreak tboot with PTI enabled

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
x86-tboot-unbreak-tboot-with-pti-enabled.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 262b6b30087246abf09d6275eb0c0dc421bcbe38 Mon Sep 17 00:00:00 2001

From: Dave Hansen <[email protected]>
Date: Sat, 6 Jan 2018 18:41:14 +0100
Subject: x86/tboot: Unbreak tboot with PTI enabled

From: Dave Hansen <[email protected]>

commit 262b6b30087246abf09d6275eb0c0dc421bcbe38 upstream.

This is another case similar to what EFI does: create a new set of page tables, map some code at a low address, and jump to it. PTI mistakes this low address for userspace and mistakenly marks it non-executable in an effort to make it unusable for userspace.

Undo the poison to allow execution.

Fixes 385ce0ea4c07 ("x86/mm/pti: Add Kconfig")
Cc Alan Cox <[email protected]>
Cc Tim Chen <[email protected]>
Cc Jon Masters <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Jeff Law <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David" <[email protected]>
Cc Nick Clifton <[email protected]>
---
 arch/x86/kernel/tboot.c |    1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/tboot.c +1 -0
@@ -127,6 +127,7 @@ static int map_tboot_page(unsigned long
 	p4d = p4d_alloc(&tboot_mm, pgd, vaddr);
 	if (!p4d)
 		return -1;
+	pgd->pgd &= ~_PAGE_NX;
 	pud = pud_alloc(&tboot_mm, p4d, vaddr);
 	if (!pud)
 		return -1;

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/x86-pti-unbreak-efi-old_memmap.patch queue-4.14/x86-documentation-add-pti-description.patch queue-4.14/x86-tboot-unbreak-tboot-with-pti-enabled.patch