diff options
author | Mark Brown <broonie@kernel.org> | 2014-11-21 18:53:19 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-21 18:53:19 +0000 |
commit | 09cc926e9a6002790e69ed213217ef9874888624 (patch) | |
tree | d97960db291ce620a9ee216b4d3cafd6f38ee2d3 /arch/arc | |
parent | d18b9ba808322f843375c262a7df889ff406a71c (diff) | |
parent | 252f23ea5987a4730e3399ef1ad5d78efcc786c9 (diff) |
Merge tag 'v3.10.61' into linux-linaro-lsk
This is the 3.10.61 stable release
Diffstat (limited to 'arch/arc')
-rw-r--r-- | arch/arc/mm/fault.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index 331a0846628e..50533b750a99 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c @@ -59,8 +59,7 @@ void do_page_fault(struct pt_regs *regs, int write, unsigned long address, struct mm_struct *mm = tsk->mm; siginfo_t info; int fault, ret; - unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | - (write ? FAULT_FLAG_WRITE : 0); + unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; /* * We fault-in kernel-space virtual memory on-demand. The @@ -88,6 +87,8 @@ void do_page_fault(struct pt_regs *regs, int write, unsigned long address, if (in_atomic() || !mm) goto no_context; + if (user_mode(regs)) + flags |= FAULT_FLAG_USER; retry: down_read(&mm->mmap_sem); vma = find_vma(mm, address); @@ -115,12 +116,12 @@ good_area: if (write) { if (!(vma->vm_flags & VM_WRITE)) goto bad_area; + flags |= FAULT_FLAG_WRITE; } else { if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } -survive: /* * If for any reason at all we couldn't handle the fault, * make sure we exit gracefully rather than endlessly redo @@ -200,14 +201,12 @@ no_context: die("Oops", regs, address, cause_code); out_of_memory: - if (is_global_init(tsk)) { - yield(); - goto survive; - } up_read(&mm->mmap_sem); - if (user_mode(regs)) - do_group_exit(SIGKILL); /* This will never return */ + if (user_mode(regs)) { + pagefault_out_of_memory(); + return; + } goto no_context; |