git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] 32bit integer overflow in invalidate_inode_pages2()
[pandora-kernel.git]
/
mm
/
mprotect.c
diff --git
a/mm/mprotect.c
b/mm/mprotect.c
index
57577f6
..
653b857
100644
(file)
--- a/
mm/mprotect.c
+++ b/
mm/mprotect.c
@@
-29,8
+29,9
@@
static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
unsigned long addr, unsigned long end, pgprot_t newprot)
{
pte_t *pte;
unsigned long addr, unsigned long end, pgprot_t newprot)
{
pte_t *pte;
+ spinlock_t *ptl;
- pte = pte_offset_map
(pmd, addr
);
+ pte = pte_offset_map
_lock(mm, pmd, addr, &ptl
);
do {
if (pte_present(*pte)) {
pte_t ptent;
do {
if (pte_present(*pte)) {
pte_t ptent;
@@
-44,7
+45,7
@@
static void change_pte_range(struct mm_struct *mm, pmd_t *pmd,
lazy_mmu_prot_update(ptent);
}
} while (pte++, addr += PAGE_SIZE, addr != end);
lazy_mmu_prot_update(ptent);
}
} while (pte++, addr += PAGE_SIZE, addr != end);
- pte_unmap
(pte - 1
);
+ pte_unmap
_unlock(pte - 1, ptl
);
}
static inline void change_pmd_range(struct mm_struct *mm, pud_t *pud,
}
static inline void change_pmd_range(struct mm_struct *mm, pud_t *pud,
@@
-88,7
+89,6
@@
static void change_protection(struct vm_area_struct *vma,
BUG_ON(addr >= end);
pgd = pgd_offset(mm, addr);
flush_cache_range(vma, addr, end);
BUG_ON(addr >= end);
pgd = pgd_offset(mm, addr);
flush_cache_range(vma, addr, end);
- spin_lock(&mm->page_table_lock);
do {
next = pgd_addr_end(addr, end);
if (pgd_none_or_clear_bad(pgd))
do {
next = pgd_addr_end(addr, end);
if (pgd_none_or_clear_bad(pgd))
@@
-96,7
+96,6
@@
static void change_protection(struct vm_area_struct *vma,
change_pud_range(mm, pgd, addr, next, newprot);
} while (pgd++, addr = next, addr != end);
flush_tlb_range(vma, start, end);
change_pud_range(mm, pgd, addr, next, newprot);
} while (pgd++, addr = next, addr != end);
flush_tlb_range(vma, start, end);
- spin_unlock(&mm->page_table_lock);
}
static int
}
static int
@@
-168,8
+167,8
@@
success:
vma->vm_flags = newflags;
vma->vm_page_prot = newprot;
change_protection(vma, start, end, newprot);
vma->vm_flags = newflags;
vma->vm_page_prot = newprot;
change_protection(vma, start, end, newprot);
-
__
vm_stat_account(mm, oldflags, vma->vm_file, -nrpages);
-
__
vm_stat_account(mm, newflags, vma->vm_file, nrpages);
+ vm_stat_account(mm, oldflags, vma->vm_file, -nrpages);
+ vm_stat_account(mm, newflags, vma->vm_file, nrpages);
return 0;
fail:
return 0;
fail: