x86: mm/fault: Fix semaphore imbalance
authorBen Hutchings <ben@decadent.org.uk>
Wed, 25 Feb 2015 00:02:28 +0000 (00:02 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 6 Mar 2015 00:39:17 +0000 (00:39 +0000)
When backporting commit 33692f27597f ('vm: add VM_FAULT_SIGSEGV
handling support') I didn't notice that it depended on a recent change
to the locking context of mm_fault_error() (commit 7fb08eca4527,
'x86: mm: move mmap_sem unlock from mm_fault_error() to caller').
That isn't easily applicable to 3.2, so instead make sure we drop
mm->mmap_sem on the new branch of mm_fault_error().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/mm/fault.c

index 8cac088..351590e 100644 (file)
@@ -878,7 +878,7 @@ mm_fault_error(struct pt_regs *regs, unsigned long error_code,
                             VM_FAULT_HWPOISON_LARGE))
                        do_sigbus(regs, error_code, address, fault);
                else if (fault & VM_FAULT_SIGSEGV)
                             VM_FAULT_HWPOISON_LARGE))
                        do_sigbus(regs, error_code, address, fault);
                else if (fault & VM_FAULT_SIGSEGV)
-                       bad_area_nosemaphore(regs, error_code, address);
+                       bad_area(regs, error_code, address);
                else
                        BUG();
        }
                else
                        BUG();
        }