summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-09-14 04:01:31 (GMT)
committerAlex Shi <alex.shi@linaro.org>2017-09-14 04:01:31 (GMT)
commita2c2b91df6f826596e697da3037e955b7d48b1ce (patch)
tree264d280710918871707eadd5d3add090949112e2 /mm
parenta27e72a62c09eebc54bbd8db5afc338d2e956c37 (diff)
parent4ad5dcaca7428dd2bc1a6a40c948e3799c1e27ae (diff)
downloadlinux-a2c2b91df6f826596e697da3037e955b7d48b1ce.tar.xz
Merge tag 'v4.9.50' into linux-linaro-lsk-v4.9
This is the 4.9.50 stable release
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/memory.c b/mm/memory.c
index d064caf..1aa63e7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3596,6 +3596,11 @@ int handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
/* do counter updates before entering really critical section. */
check_sync_rss_stat(current);
+ if (!arch_vma_access_permitted(vma, flags & FAULT_FLAG_WRITE,
+ flags & FAULT_FLAG_INSTRUCTION,
+ flags & FAULT_FLAG_REMOTE))
+ return VM_FAULT_SIGSEGV;
+
/*
* Enable the memcg OOM handling for faults triggered in user
* space. Kernel faults are handled more gracefully.
@@ -3603,11 +3608,6 @@ int handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
if (flags & FAULT_FLAG_USER)
mem_cgroup_oom_enable();
- if (!arch_vma_access_permitted(vma, flags & FAULT_FLAG_WRITE,
- flags & FAULT_FLAG_INSTRUCTION,
- flags & FAULT_FLAG_REMOTE))
- return VM_FAULT_SIGSEGV;
-
if (unlikely(is_vm_hugetlb_page(vma)))
ret = hugetlb_fault(vma->vm_mm, vma, address, flags);
else