On 23/07/15 10:10, Ralf Baechle wrote: > Execution of break instruction, trap instructions, emulation of unaligned > loads or floating point instructions - anything that tries to read the > instruction's opcode from userspace - needs read access to a page. > > RIXI (Read Inhibit / Execute Inhibit) support however allows the creation of > pags that are executable but not readable. On such a mapping the attempted > load of the opcode by the kernel is going to cause an endless loop of > page faults. > > The quick workaround for this is to disable the combinations that the kernel > currently isn't able to handle which are executable mappings. > > Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Reviewed-by: James Hogan <james.hogan@xxxxxxxxxx> Cheers James > --- > arch/mips/mm/cache.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c > index 77d96db..aab218c 100644 > --- a/arch/mips/mm/cache.c > +++ b/arch/mips/mm/cache.c > @@ -160,18 +160,18 @@ static inline void setup_protection_map(void) > protection_map[1] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); > protection_map[2] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); > protection_map[3] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); > - protection_map[4] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); > + protection_map[4] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > protection_map[5] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > - protection_map[6] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); > + protection_map[6] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > protection_map[7] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > > protection_map[8] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); > protection_map[9] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); > protection_map[10] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | _PAGE_NO_READ); > protection_map[11] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE); > - protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); > + protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > protection_map[13] = __pgprot(_page_cachable_default | _PAGE_PRESENT); > - protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE | _PAGE_NO_READ); > + protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE); > protection_map[15] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE); > > } else { >
Attachment:
signature.asc
Description: OpenPGP digital signature