diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-09-14 12:01:31 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-09-14 12:01:31 +0800 |
commit | a2c2b91df6f826596e697da3037e955b7d48b1ce (patch) | |
tree | 264d280710918871707eadd5d3add090949112e2 /mm | |
parent | a27e72a62c09eebc54bbd8db5afc338d2e956c37 (diff) | |
parent | 4ad5dcaca7428dd2bc1a6a40c948e3799c1e27ae (diff) |
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/memory.c b/mm/memory.c index d064caff9d7d..1aa63e7dd790 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 |