Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull MIPS fix from Ralf Baechle:
"Only a single fix for 4.7 pending at this point. It fixes an issue
that may lead to corruption of the cache mode bits in the page table"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
MIPS: Fix possible corruption of cache mode by mprotect.

+6 -4
+6 -4
arch/mips/include/asm/pgtable.h
··· 24 24 struct vm_area_struct; 25 25 26 26 #define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_NO_READ | \ 27 - _CACHE_CACHABLE_NONCOHERENT) 27 + _page_cachable_default) 28 28 #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | \ 29 29 _page_cachable_default) 30 30 #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_NO_EXEC | \ ··· 476 476 pte.pte_low &= (_PAGE_MODIFIED | _PAGE_ACCESSED | _PFNX_MASK); 477 477 pte.pte_high &= (_PFN_MASK | _CACHE_MASK); 478 478 pte.pte_low |= pgprot_val(newprot) & ~_PFNX_MASK; 479 - pte.pte_high |= pgprot_val(newprot) & ~_PFN_MASK; 479 + pte.pte_high |= pgprot_val(newprot) & ~(_PFN_MASK | _CACHE_MASK); 480 480 return pte; 481 481 } 482 482 #elif defined(CONFIG_PHYS_ADDR_T_64BIT) && defined(CONFIG_CPU_MIPS32) ··· 491 491 #else 492 492 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) 493 493 { 494 - return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot)); 494 + return __pte((pte_val(pte) & _PAGE_CHG_MASK) | 495 + (pgprot_val(newprot) & ~_PAGE_CHG_MASK)); 495 496 } 496 497 #endif 497 498 ··· 633 632 634 633 static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) 635 634 { 636 - pmd_val(pmd) = (pmd_val(pmd) & _PAGE_CHG_MASK) | pgprot_val(newprot); 635 + pmd_val(pmd) = (pmd_val(pmd) & _PAGE_CHG_MASK) | 636 + (pgprot_val(newprot) & ~_PAGE_CHG_MASK); 637 637 return pmd; 638 638 } 639 639