aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-02-05 15:18:41 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-02-05 15:18:41 -0500
commit162e006ef59266b9ebf34e3d15ca1f3d9ee956d7 (patch)
treed7f1b61fbe822e71867bd04ee4ee7f3f1cd20842 /arch/s390/mm
parentab14de6c37fae22911ba99f4171613e6d758050b (diff)
[S390] Mark kernel text section read-only.
Set read-only flag in the page table entries for the kernel image text section. This will catch all instruction caused corruptions withing the text section. Instruction replacement via kprobes still works, since it bypasses now dynamic address translation. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/init.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 162a338a5575..b3e7c45efb63 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -26,7 +26,6 @@
26#include <linux/pfn.h> 26#include <linux/pfn.h>
27#include <linux/poison.h> 27#include <linux/poison.h>
28#include <linux/initrd.h> 28#include <linux/initrd.h>
29
30#include <asm/processor.h> 29#include <asm/processor.h>
31#include <asm/system.h> 30#include <asm/system.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
@@ -96,8 +95,8 @@ static void __init setup_ro_region(void)
96 pte_t new_pte; 95 pte_t new_pte;
97 unsigned long address, end; 96 unsigned long address, end;
98 97
99 address = ((unsigned long)&__start_rodata) & PAGE_MASK; 98 address = ((unsigned long)&_stext) & PAGE_MASK;
100 end = PFN_ALIGN((unsigned long)&__end_rodata); 99 end = PFN_ALIGN((unsigned long)&_eshared);
101 100
102 for (; address < end; address += PAGE_SIZE) { 101 for (; address < end; address += PAGE_SIZE) {
103 pgd = pgd_offset_k(address); 102 pgd = pgd_offset_k(address);
@@ -173,8 +172,8 @@ void __init mem_init(void)
173 datasize >>10, 172 datasize >>10,
174 initsize >> 10); 173 initsize >> 10);
175 printk("Write protected kernel read-only data: %#lx - %#lx\n", 174 printk("Write protected kernel read-only data: %#lx - %#lx\n",
176 (unsigned long)&__start_rodata, 175 (unsigned long)&_stext,
177 PFN_ALIGN((unsigned long)&__end_rodata) - 1); 176 PFN_ALIGN((unsigned long)&_eshared) - 1);
178} 177}
179 178
180void free_initmem(void) 179void free_initmem(void)