From: Greg Kroah-Hartman Date: Wed, 11 Feb 2015 04:16:51 +0000 (+0800) Subject: 3.18-stable patches X-Git-Tag: v3.10.69~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab2f102a703c56c2a495cb1675b199056456d684;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: x86-mm-move-mmap_sem-unlock-from-mm_fault_error-to-caller.patch --- diff --git a/queue-3.18/series b/queue-3.18/series index 6c6ef7b8ca5..b2f5993d032 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -37,3 +37,4 @@ smpboot-add-missing-get_online_cpus-in-smpboot_register_percpu_thread.patch hrtimer-fix-incorrect-tai-offset-calculation-for-non-high-res-timer-systems.patch tracing-add-condition-check-to-rcu-lockdep-checks.patch x86-tlb-trace-do-not-trace-on-cpu-that-is-offline.patch +x86-mm-move-mmap_sem-unlock-from-mm_fault_error-to-caller.patch diff --git a/queue-3.18/x86-mm-move-mmap_sem-unlock-from-mm_fault_error-to-caller.patch b/queue-3.18/x86-mm-move-mmap_sem-unlock-from-mm_fault_error-to-caller.patch new file mode 100644 index 00000000000..5ee86f5b447 --- /dev/null +++ b/queue-3.18/x86-mm-move-mmap_sem-unlock-from-mm_fault_error-to-caller.patch @@ -0,0 +1,65 @@ +From 7fb08eca45270d0ae86e1ad9d39c40b7a55d0190 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +Date: Mon, 15 Dec 2014 14:46:06 -0800 +Subject: x86: mm: move mmap_sem unlock from mm_fault_error() to caller + +From: Linus Torvalds + +commit 7fb08eca45270d0ae86e1ad9d39c40b7a55d0190 upstream. + +This replaces four copies in various stages of mm_fault_error() handling +with just a single one. It will also allow for more natural placement +of the unlocking after some further cleanup. + +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/mm/fault.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/arch/x86/mm/fault.c ++++ b/arch/x86/mm/fault.c +@@ -844,11 +844,8 @@ do_sigbus(struct pt_regs *regs, unsigned + unsigned int fault) + { + struct task_struct *tsk = current; +- struct mm_struct *mm = tsk->mm; + int code = BUS_ADRERR; + +- up_read(&mm->mmap_sem); +- + /* Kernel mode? Handle exceptions or die: */ + if (!(error_code & PF_USER)) { + no_context(regs, error_code, address, SIGBUS, BUS_ADRERR); +@@ -879,7 +876,6 @@ mm_fault_error(struct pt_regs *regs, uns + unsigned long address, unsigned int fault) + { + if (fatal_signal_pending(current) && !(error_code & PF_USER)) { +- up_read(¤t->mm->mmap_sem); + no_context(regs, error_code, address, 0, 0); + return; + } +@@ -887,14 +883,11 @@ mm_fault_error(struct pt_regs *regs, uns + if (fault & VM_FAULT_OOM) { + /* Kernel mode? Handle exceptions or die: */ + if (!(error_code & PF_USER)) { +- up_read(¤t->mm->mmap_sem); + no_context(regs, error_code, address, + SIGSEGV, SEGV_MAPERR); + return; + } + +- up_read(¤t->mm->mmap_sem); +- + /* + * We ran out of memory, call the OOM killer, and return the + * userspace (which will retry the fault, or kill us if we got +@@ -1249,6 +1242,7 @@ good_area: + return; + + if (unlikely(fault & VM_FAULT_ERROR)) { ++ up_read(&mm->mmap_sem); + mm_fault_error(regs, error_code, address, fault); + return; + }