diff options
author | Nick Piggin <npiggin@suse.de> | 2008-07-08 11:31:06 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-07-08 11:31:15 +0200 |
commit | 138c9021ca68d6f8a6fac3418995fee102a3cc22 (patch) | |
tree | f345a4754d5551b8578051379a68594618dda190 /include/asm-s390 | |
parent | 7b51ba38d9baca207152d1c97ec793cfb673a6cd (diff) | |
download | op-kernel-dev-138c9021ca68d6f8a6fac3418995fee102a3cc22.zip op-kernel-dev-138c9021ca68d6f8a6fac3418995fee102a3cc22.tar.gz |
[S390] protect _PAGE_SPECIAL bit against mprotect
Stop mprotect's pte_modify from wiping out the s390 pte_special bit, which
caused oops thereafter when vm_normal_page thought X's abnormal was normal.
Debugged-by: Ryan Hope <rmh3093@gmail.com>
Debugged-by: Zan Lynx <zlynx@acm.org>
Acked-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'include/asm-s390')
-rw-r--r-- | include/asm-s390/pgtable.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index c7f4f8e..bd0ea19 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -223,6 +223,9 @@ extern char empty_zero_page[PAGE_SIZE]; #define _PAGE_SPECIAL 0x004 /* SW associated with special page */ #define __HAVE_ARCH_PTE_SPECIAL +/* Set of bits not changed in pte_modify */ +#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_SPECIAL) + /* Six different types of pages. */ #define _PAGE_TYPE_EMPTY 0x400 #define _PAGE_TYPE_NONE 0x401 @@ -681,7 +684,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt */ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { - pte_val(pte) &= PAGE_MASK; + pte_val(pte) &= _PAGE_CHG_MASK; pte_val(pte) |= pgprot_val(newprot); return pte; } |