]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm: fix missing page table unmap for stack guard page failure case
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 13 Aug 2010 16:24:04 +0000 (09:24 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:44:11 +0000 (12:44 -0700)
commit 5528f9132cf65d4d892bcbc5684c61e7822b21e9 upstream.

.. which didn't show up in my tests because it's a no-op on x86-64 and
most other architectures.  But we enter the function with the last-level
page table mapped, and should unmap it at exit.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/memory.c

index c5f81714b35441474b142a0d659f49d1bd1ecb01..01ac735d673761d55bc73700044a0141a8d4d77b 100644 (file)
@@ -2677,8 +2677,10 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
        spinlock_t *ptl;
        pte_t entry;
 
-       if (check_stack_guard_page(vma, address) < 0)
+       if (check_stack_guard_page(vma, address) < 0) {
+               pte_unmap(page_table);
                return VM_FAULT_SIGBUS;
+       }
 
        if (!(flags & FAULT_FLAG_WRITE)) {
                entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),