aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/fault.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/mm/fault.c')
-rw-r--r--arch/arm64/mm/fault.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 52638171d6fd..98af6e760cce 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -148,6 +148,7 @@ void do_bad_area(unsigned long addr, unsigned int esr, struct pt_regs *regs)
148#define VM_FAULT_BADACCESS 0x020000 148#define VM_FAULT_BADACCESS 0x020000
149 149
150#define ESR_WRITE (1 << 6) 150#define ESR_WRITE (1 << 6)
151#define ESR_CM (1 << 8)
151#define ESR_LNX_EXEC (1 << 24) 152#define ESR_LNX_EXEC (1 << 24)
152 153
153/* 154/*
@@ -206,7 +207,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
206 struct task_struct *tsk; 207 struct task_struct *tsk;
207 struct mm_struct *mm; 208 struct mm_struct *mm;
208 int fault, sig, code; 209 int fault, sig, code;
209 int write = esr & ESR_WRITE; 210 bool write = (esr & ESR_WRITE) && !(esr & ESR_CM);
210 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | 211 unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE |
211 (write ? FAULT_FLAG_WRITE : 0); 212 (write ? FAULT_FLAG_WRITE : 0);
212 213