summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/fault.c
diff options
context:
space:
mode:
authorBalbir Singh <bsingharora@gmail.com>2016-11-15 17:56:15 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2016-11-25 15:01:35 +1100
commit1d18ad026844b60d933c25ae38360f86a8cf41eb (patch)
treeded888f805cc100dbf6eecffe9c88ad8a2d1fc72 /arch/powerpc/mm/fault.c
parentee97b6b99f42285d29d439f2e5376e03b2760e09 (diff)
powerpc/mm: Detect instruction fetch denied and report
ISA 3 allows for prevention of instruction fetch and execution of user mode pages. If such an error occurs, SRR1 bit 35 reports the error. We catch and report the error in do_page_fault(). Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/fault.c')
-rw-r--r--arch/powerpc/mm/fault.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 73932f4a386e..a17029aaf939 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -391,6 +391,12 @@ good_area:
if (is_exec) {
/*
+ * An execution fault + no execute ?
+ */
+ if (regs->msr & SRR1_ISI_N_OR_G)
+ goto bad_area;
+
+ /*
* Allow execution from readable areas if the MMU does not
* provide separate controls over reading and executing.
*
@@ -404,6 +410,7 @@ good_area:
(cpu_has_feature(CPU_FTR_NOEXECUTE) ||
!(vma->vm_flags & (VM_READ | VM_WRITE))))
goto bad_area;
+
#ifdef CONFIG_PPC_STD_MMU
/*
* protfault should only happen due to us