mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: tip-bot for Jiri Kosina <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: aarcange@redhat.com, linux-kernel@vger.kernel.org,
	torvalds@linux-foundation.org, ard.biesheuvel@linaro.org,
	sivanich@hpe.com, hpa@zytor.com, dave.hansen@linux.intel.com,
	jkosina@suse.cz, mingo@kernel.org, matt@codeblueprint.co.uk,
	peterz@infradead.org, tglx@linutronix.de
Subject: [tip:x86/pti] x86/pti: Unbreak EFI old_memmap
Date: Sat, 6 Jan 2018 13:03:58 -0800	[thread overview]
Message-ID: <tip-de53c3786a3ce162a1c815d0c04c766c23ec9c0a@git.kernel.org> (raw)
In-Reply-To: <nycvar.YFH.7.76.1801052215460.11852@cbobk.fhfr.pm>

Commit-ID:  de53c3786a3ce162a1c815d0c04c766c23ec9c0a
Gitweb:     https://git.kernel.org/tip/de53c3786a3ce162a1c815d0c04c766c23ec9c0a
Author:     Jiri Kosina <jkosina@suse.cz>
AuthorDate: Fri, 5 Jan 2018 22:35:41 +0100
Committer:  Thomas Gleixner <tglx@linutronix.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@hpe.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
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
Cc: stable@vger.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();
 

      parent reply	other threads:[~2018-01-06 21:08 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:x86/pti] x86/pti: Unbreak " tip-bot for Jiri Kosina
2018-01-06 21:03 ` tip-bot for Jiri Kosina [this message]

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-de53c3786a3ce162a1c815d0c04c766c23ec9c0a@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