提交 138c9021 编写于 作者: N Nick Piggin 提交者: Martin Schwidefsky

[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: NRyan Hope <rmh3093@gmail.com>
Debugged-by: NZan Lynx <zlynx@acm.org>
Acked-by: NHugh Dickins <hugh@veritas.com>
Signed-off-by: NNick Piggin <npiggin@suse.de>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 7b51ba38
...@@ -223,6 +223,9 @@ extern char empty_zero_page[PAGE_SIZE]; ...@@ -223,6 +223,9 @@ extern char empty_zero_page[PAGE_SIZE];
#define _PAGE_SPECIAL 0x004 /* SW associated with special page */ #define _PAGE_SPECIAL 0x004 /* SW associated with special page */
#define __HAVE_ARCH_PTE_SPECIAL #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. */ /* Six different types of pages. */
#define _PAGE_TYPE_EMPTY 0x400 #define _PAGE_TYPE_EMPTY 0x400
#define _PAGE_TYPE_NONE 0x401 #define _PAGE_TYPE_NONE 0x401
...@@ -681,7 +684,7 @@ static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *pt ...@@ -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) 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); pte_val(pte) |= pgprot_val(newprot);
return pte; return pte;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册