[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-de53c3786a3ce162a1c815d0c04c766c23ec9c0a@git.kernel.org>
Date: Sat, 6 Jan 2018 13:03:58 -0800
From: tip-bot for Jiri Kosina <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: aarcange@...hat.com, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org, ard.biesheuvel@...aro.org,
sivanich@....com, hpa@...or.com, dave.hansen@...ux.intel.com,
jkosina@...e.cz, mingo@...nel.org, matt@...eblueprint.co.uk,
peterz@...radead.org, tglx@...utronix.de
Subject: [tip:x86/pti] x86/pti: Unbreak EFI old_memmap
Commit-ID: de53c3786a3ce162a1c815d0c04c766c23ec9c0a
Gitweb: https://git.kernel.org/tip/de53c3786a3ce162a1c815d0c04c766c23ec9c0a
Author: Jiri Kosina <jkosina@...e.cz>
AuthorDate: Fri, 5 Jan 2018 22:35:41 +0100
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Sat, 6 Jan 2018 21:38:16 +0100
x86/pti: Unbreak EFI old_memmap
EFI_OLD_MEMMAP's efi_call_phys_prolog() calls set_pgd() with swapper PGD that
has PAGE_USER set, which makes PTI set NX on it, and therefore EFI can't
execute it's code.
Fix that by forcefully clearing _PAGE_NX from the PGD (this can't be done
by the pgprot API).
_PAGE_NX will be automatically reintroduced in efi_call_phys_epilog(), as
_set_pgd() will again notice that this is _PAGE_USER, and set _PAGE_NX on
it.
Tested-by: Dimitri Sivanich <sivanich@....com>
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@...aro.org>
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: linux-efi@...r.kernel.org
Cc: stable@...r.kernel.org
Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1801052215460.11852@cbobk.fhfr.pm
---
arch/x86/platform/efi/efi_64.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index 39c4b35..61975b6 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -134,7 +134,9 @@ pgd_t * __init efi_call_phys_prolog(void)
pud[j] = *pud_offset(p4d_k, vaddr);
}
}
+ pgd_offset_k(pgd * PGDIR_SIZE)->pgd &= ~_PAGE_NX;
}
+
out:
__flush_tlb_all();
Powered by blists - more mailing lists