From 1bcdd8548286743e1d6b3d53c96a90c6da975620 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 13 Jan 2006 13:21:06 -0700 Subject: [PARISC] Add CONFIG_DEBUG_RODATA to protect read-only data Add the parisc version of the "mark rodata section read only" patches. Based on code from and Signed-off-by Arjan van de Ven , Ingo Molnar , Andi Kleen , Andrew Morton , Linus Torvalds . Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- include/asm-parisc/cacheflush.h | 6 ++++++ include/asm-parisc/pgtable.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include/asm-parisc') diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index 1bc3c83..c53af9f 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h @@ -183,4 +183,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long __flush_cache_page(vma, vmaddr); } + +#ifdef CONFIG_DEBUG_RODATA +void mark_rodata_ro(void); #endif + +#endif /* _PARISC_CACHEFLUSH_H */ + diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index b455471..4e34c6b 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h @@ -213,7 +213,7 @@ extern void *vmalloc_start; #define PAGE_COPY PAGE_EXECREAD #define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) #define PAGE_KERNEL __pgprot(_PAGE_KERNEL) -#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_DIRTY | _PAGE_ACCESSED) +#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE) #define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) #define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ) #define PAGE_FLUSH __pgprot(_PAGE_FLUSH) -- cgit v1.1