From: tip-bot for Jiri Kosina <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: aarcange@redhat.com, peterz@infradead.org,
torvalds@linux-foundation.org, tglx@linutronix.de,
matt@codeblueprint.co.uk, dave.hansen@linux.intel.com,
sivanich@hpe.com, jkosina@suse.cz, ard.biesheuvel@linaro.org,
hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip:x86/pti] x86/pti: Unbreak EFI old_memmap
Date: Sat, 6 Jan 2018 03:52:48 -0800 [thread overview]
Message-ID: <tip-5ad9a697fa957e61d50ef969179c18348968cd9f@git.kernel.org> (raw)
In-Reply-To: <nycvar.YFH.7.76.1801052215460.11852@cbobk.fhfr.pm>
Commit-ID: 5ad9a697fa957e61d50ef969179c18348968cd9f
Gitweb: https://git.kernel.org/tip/5ad9a697fa957e61d50ef969179c18348968cd9f
Author: Jiri Kosina <jkosina@suse.cz>
AuthorDate: Fri, 5 Jan 2018 22:35:41 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 6 Jan 2018 11:43:44 +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@hpe.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1801052215460.11852@cbobk.fhfr.pm
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
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();
next prev parent reply other threads:[~2018-01-06 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 21:35 [PATCH] PTI: unbreak " Jiri Kosina
2018-01-06 11:52 ` tip-bot for Jiri Kosina [this message]
2018-01-06 21:03 ` [tip:x86/pti] x86/pti: Unbreak " tip-bot for Jiri Kosina
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-5ad9a697fa957e61d50ef969179c18348968cd9f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=aarcange@redhat.com \
--cc=ard.biesheuvel@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jkosina@suse.cz \
--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=sivanich@hpe.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome