diff for duplicates of <20180105195535.GZ26807@redhat.com> diff --git a/a/1.txt b/N1/1.txt index b50b59d..b084bb8 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -31,3 +31,38 @@ For vsyscalls? I also had to single out warnings out of init_mm.pgd for the same reasons. How does the below (untested) look? + +>From ab949b80124588c4791568429cf8a234dda16340 Mon Sep 17 00:00:00 2001 +From: Jiri Kosina <jikos@kernel.org> +Date: Fri, 5 Jan 2018 20:00:25 +0100 +Subject: [RHEL7.5 PATCH 1/1] x86/kaiser/efi: unbreak EFI old_memmap + +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. + +Signed-off-by: Jiri Kosina <jkosina@suse.cz> +Signed-off-by: Andrea Arcangeli <aarcange@redhat.com> +--- + arch/x86/platform/efi/efi_64.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c +index f951026ea2d2..395079128d98 100644 +--- a/arch/x86/platform/efi/efi_64.c ++++ b/arch/x86/platform/efi/efi_64.c +@@ -110,6 +110,7 @@ void __init efi_call_phys_prelog(void) + vaddr = (unsigned long)__va(pgd * PGDIR_SIZE); + pgd_efi = pgd_offset_k(addr_pgd); + save_pgd[pgd] = *pgd_efi; ++ pgd_efi->pgd &= ~_PAGE_NX; + + pud = pud_alloc(&init_mm, pgd_efi, addr_pgd); + if (!pud) { diff --git a/a/content_digest b/N1/content_digest index 4c4ee51..45372b9 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -58,6 +58,41 @@ "For vsyscalls? I also had to single out warnings out of init_mm.pgd\n" "for the same reasons.\n" "\n" - How does the below (untested) look? + "How does the below (untested) look?\n" + "\n" + ">From ab949b80124588c4791568429cf8a234dda16340 Mon Sep 17 00:00:00 2001\n" + "From: Jiri Kosina <jikos@kernel.org>\n" + "Date: Fri, 5 Jan 2018 20:00:25 +0100\n" + "Subject: [RHEL7.5 PATCH 1/1] x86/kaiser/efi: unbreak EFI old_memmap\n" + "\n" + "old_memmap's efi_call_phys_prolog() calls set_pgd() with swapper PGD that\n" + "has PAGE_USER set, which makes PTI set NX on it, and therefore EFI can't\n" + "execute it's code.\n" + "\n" + "Fix that by forcefully clearing _PAGE_NX from the PGD (this can't be done\n" + "by the pgprot API).\n" + "\n" + "_PAGE_NX will be automatically reintroduced in efi_call_phys_epilog(), as\n" + "_set_pgd() will again notice that this is _PAGE_USER, and set _PAGE_NX on\n" + "it.\n" + "\n" + "Signed-off-by: Jiri Kosina <jkosina@suse.cz>\n" + "Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>\n" + "---\n" + " arch/x86/platform/efi/efi_64.c | 1 +\n" + " 1 file changed, 1 insertion(+)\n" + "\n" + "diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c\n" + "index f951026ea2d2..395079128d98 100644\n" + "--- a/arch/x86/platform/efi/efi_64.c\n" + "+++ b/arch/x86/platform/efi/efi_64.c\n" + "@@ -110,6 +110,7 @@ void __init efi_call_phys_prelog(void)\n" + " \t\tvaddr = (unsigned long)__va(pgd * PGDIR_SIZE);\n" + " \t\tpgd_efi = pgd_offset_k(addr_pgd);\n" + " \t\tsave_pgd[pgd] = *pgd_efi;\n" + "+\t\tpgd_efi->pgd &= ~_PAGE_NX;\n" + " \n" + " \t\tpud = pud_alloc(&init_mm, pgd_efi, addr_pgd);\n" + " \t\tif (!pud) {" -368798a7e728307778f740b3d5501ebb14b9507dbcd0e490036be3df4a758319 +8c4fbc9c2d07e354727ad69a15a5f6b7ba91926b77b88325cd6c21e1679f553b
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.