Skip to content

Commit

Permalink
mm: fix missing page table unmap for stack guard page failure case
Browse files Browse the repository at this point in the history
.. 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>
  • Loading branch information
Linus Torvalds committed Aug 13, 2010
1 parent 320b2b8 commit 5528f91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2792,8 +2792,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),
Expand Down

0 comments on commit 5528f91

Please sign in to comment.