aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/memory.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index e158f7ac6730..c717b5bcc80e 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3910,8 +3910,18 @@ int handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
3910 * further. 3910 * further.
3911 */ 3911 */
3912 if (unlikely((current->flags & PF_KTHREAD) && !(ret & VM_FAULT_ERROR) 3912 if (unlikely((current->flags & PF_KTHREAD) && !(ret & VM_FAULT_ERROR)
3913 && test_bit(MMF_UNSTABLE, &vma->vm_mm->flags))) 3913 && test_bit(MMF_UNSTABLE, &vma->vm_mm->flags))) {
3914
3915 /*
3916 * We are going to enforce SIGBUS but the PF path might have
3917 * dropped the mmap_sem already so take it again so that
3918 * we do not break expectations of all arch specific PF paths
3919 * and g-u-p
3920 */
3921 if (ret & VM_FAULT_RETRY)
3922 down_read(&vma->vm_mm->mmap_sem);
3914 ret = VM_FAULT_SIGBUS; 3923 ret = VM_FAULT_SIGBUS;
3924 }
3915 3925
3916 return ret; 3926 return ret;
3917} 3927}