From: Linus Torvalds Date: Fri, 13 Aug 2010 16:24:04 +0000 (-0700) Subject: mm: fix missing page table unmap for stack guard page failure case X-Git-Tag: v2.6.34.4~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5eafdadb782787f9ae13bd0b1e5e372c5a6c28f2;p=thirdparty%2Fkernel%2Fstable.git mm: fix missing page table unmap for stack guard page failure case 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/mm/memory.c b/mm/memory.c index 5b0760feda790..daa100ff2f992 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2783,8 +2783,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),