Fix nasty little bug we've missed in Nick's mremap move ZERO_PAGE patch.
The "pte" at that point may be a swap entry or a pte_file entry: we must
check pte_present before perhaps corrupting such an entry.
Patch below against 2.6.14-rc2-mm1, but the same bug is in 2.6.14-rc2's
mm/mremap.c, and more dangerous there since it's affecting all arches:
I think the safest course is to send Nick's patch and Yoichi's build fix
and this fix (build tested) on to Linus - so only MIPS can be affected.
Signed-off-by: Hugh Dickins <[email protected]>
--- 2.6.14-rc2-mm1/include/asm-generic/pgtable.h 2005-09-22 12:32:00.000000000 +0100
+++ linux/include/asm-generic/pgtable.h 2005-09-24 10:51:41.000000000 +0100
@@ -164,7 +164,8 @@ static inline void ptep_set_wrprotect(st
#define move_pte(pte, prot, old_addr, new_addr) \
({ \
pte_t newpte = (pte); \
- if (pfn_valid(pte_pfn(pte)) && pte_page(pte) == ZERO_PAGE(old_addr)) \
+ if (pte_present(pte) && pfn_valid(pte_pfn(pte)) && \
+ pte_page(pte) == ZERO_PAGE(old_addr)) \
newpte = mk_pte(ZERO_PAGE(new_addr), (prot)); \
newpte; \
})
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|