All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE" has been added to the 4.7-stable tree
@ 2016-09-05 13:55 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-05 13:55 UTC (permalink / raw)
  To: mark.rutland, ard.biesheuvel, catalin.marinas, gregkh,
	will.deacon
  Cc: stable, stable-commits


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

    arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE

to the 4.7-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:
     arm64-avoid-tlb-conflict-with-config_randomize_base.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From fd363bd417ddb6103564c69cfcbd92d9a7877431 Mon Sep 17 00:00:00 2001
From: Mark Rutland <mark.rutland@arm.com>
Date: Wed, 24 Aug 2016 18:02:08 +0100
Subject: arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE

From: Mark Rutland <mark.rutland@arm.com>

commit fd363bd417ddb6103564c69cfcbd92d9a7877431 upstream.

When CONFIG_RANDOMIZE_BASE is selected, we modify the page tables to remap the
kernel at a newly-chosen VA range. We do this with the MMU disabled, but do not
invalidate TLBs prior to re-enabling the MMU with the new tables. Thus the old
mappings entries may still live in TLBs, and we risk violating
Break-Before-Make requirements, leading to TLB conflicts and/or other issues.

We invalidate TLBs when we uninsall the idmap in early setup code, but prior to
this we are subject to issues relating to the Break-Before-Make violation.

Avoid these issues by invalidating the TLBs before the new mappings can be
used by the hardware.

Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR")
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/kernel/head.S |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -757,6 +757,9 @@ ENTRY(__enable_mmu)
 	isb
 	bl	__create_page_tables		// recreate kernel mapping
 
+	tlbi	vmalle1				// Remove any stale TLB entries
+	dsb	nsh
+
 	msr	sctlr_el1, x19			// re-enable the MMU
 	isb
 	ic	iallu				// flush instructions fetched


Patches currently in stable-queue which might be from mark.rutland@arm.com are

queue-4.7/arm64-kernel-avoid-literal-load-of-virtual-address-with-mmu-off.patch
queue-4.7/arm64-avoid-tlb-conflict-with-config_randomize_base.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-05 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-05 13:55 Patch "arm64: avoid TLB conflict with CONFIG_RANDOMIZE_BASE" has been added to the 4.7-stable tree gregkh

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.