* FAILED: patch "[PATCH] powerpc/mm/radix: Fix execute permissions for" failed to apply to 4.9-stable tree
@ 2017-07-22 14:12 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-22 14:12 UTC (permalink / raw)
To: bsingharora, mpe; +Cc: stable
The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 7f6d498ed3354740cfd100e4aa99e388f1a95be7 Mon Sep 17 00:00:00 2001
From: Balbir Singh <bsingharora@gmail.com>
Date: Thu, 29 Jun 2017 03:04:10 +1000
Subject: [PATCH] powerpc/mm/radix: Fix execute permissions for
interrupt_vectors
Commit 9abcc981de97 ("powerpc/mm/radix: Only add X for pages
overlapping kernel text") changed the linear mapping on Radix to only
mark the kernel text executable.
However if the kernel is run relocated, for example as a kdump kernel,
then the exception vectors are split from the kernel text, ie. they
remain at real address 0.
We tend to get away with it, because the kernel itself will usually be
below 1G, which means the 1G page at 0-1G is marked executable and
everything works OK. However if the kernel is loaded above 1G, or the
system has less than 1G in total (meaning we can't use a 1G page),
then the exception vectors will not be marked executable and the
kernel will fail to boot.
Fix it by also checking if the address range overlaps the exception
vectors when deciding if we should add PAGE_KERNEL_X.
Fixes: 9abcc981de97 ("powerpc/mm/radix: Only add X for pages overlapping kernel text")
Cc: stable@vger.kernel.org # v4.7+
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
[mpe: Combine with the existing check, rewrite change log]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index f6af90371b1e..1342859552b1 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -150,7 +150,8 @@ static int __meminit create_physical_mapping(unsigned long start,
vaddr = (unsigned long)__va(addr);
- if (overlaps_kernel_text(vaddr, vaddr + mapping_size))
+ if (overlaps_kernel_text(vaddr, vaddr + mapping_size) ||
+ overlaps_interrupt_vector_text(vaddr, vaddr + mapping_size))
prot = PAGE_KERNEL_X;
else
prot = PAGE_KERNEL;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-07-22 14:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 14:12 FAILED: patch "[PATCH] powerpc/mm/radix: Fix execute permissions for" failed to apply to 4.9-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.