mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-07-08 17:56:55 +00:00
Revert "mm: fix page table unmap for stack guard page properly"
This reverts commit 1cb5bb4cb2.
This commit is contained in:
13
mm/memory.c
13
mm/memory.c
@@ -2644,23 +2644,24 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
spinlock_t *ptl;
|
||||
pte_t entry;
|
||||
|
||||
pte_unmap(page_table);
|
||||
|
||||
/* Check if we need to add a guard page to the stack */
|
||||
if (check_stack_guard_page(vma, address) < 0)
|
||||
if (check_stack_guard_page(vma, address) < 0) {
|
||||
pte_unmap(page_table);
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
|
||||
/* Use the zero-page for reads */
|
||||
if (!(flags & FAULT_FLAG_WRITE)) {
|
||||
entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
|
||||
vma->vm_page_prot));
|
||||
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
|
||||
ptl = pte_lockptr(mm, pmd);
|
||||
spin_lock(ptl);
|
||||
if (!pte_none(*page_table))
|
||||
goto unlock;
|
||||
goto setpte;
|
||||
}
|
||||
|
||||
/* Allocate our own private page. */
|
||||
pte_unmap(page_table);
|
||||
|
||||
if (unlikely(anon_vma_prepare(vma)))
|
||||
goto oom;
|
||||
page = alloc_zeroed_user_highpage_movable(vma, address);
|
||||
|
||||
Reference in New Issue
Block a user