/[linux-patches]/genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1758 - (show annotations) (download)
Fri Aug 20 16:05:23 2010 UTC (7 years, 2 months ago) by mpagano
File size: 952 byte(s)
Patch to fix page table unmap for stack guard page
1 --- a/mm/memory.c 2010-08-20 11:41:48.000000000 -0400
2 +++ b/mm/memory.c 2010-08-20 11:44:30.000000000 -0400
3 @@ -2792,24 +2792,22 @@ static int do_anonymous_page(struct mm_s
4 spinlock_t *ptl;
5 pte_t entry;
6
7 - if (check_stack_guard_page(vma, address) < 0) {
8 - pte_unmap(page_table);
9 - return VM_FAULT_SIGBUS;
10 - }
11 + pte_unmap(page_table);
12
13 + if (check_stack_guard_page(vma, address) < 0)
14 + return VM_FAULT_SIGBUS;
15 +
16 + /* Use the zero-page for reads */
17 if (!(flags & FAULT_FLAG_WRITE)) {
18 entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
19 vma->vm_page_prot));
20 - ptl = pte_lockptr(mm, pmd);
21 - spin_lock(ptl);
22 + page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
23 if (!pte_none(*page_table))
24 goto unlock;
25 goto setpte;
26 }
27
28 /* Allocate our own private page. */
29 - pte_unmap(page_table);
30 -
31 if (unlikely(anon_vma_prepare(vma)))
32 goto oom;
33 page = alloc_zeroed_user_highpage_movable(vma, address);

  ViewVC Help
Powered by ViewVC 1.1.20